Skip Menu |

This queue is for tickets about the Sphinx-Search CPAN distribution.

Report information
The Basics
Id: 77178
Status: resolved
Priority: 0/
Queue: Sphinx-Search

People
Owner: Nobody in particular
Requestors: dedukhin [...] mail.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: UpdateAttributes and negative values
Is there any reason why I can't set negative value using UpdateAttributes API call? The code that prevents this: else { croak("entry value $v is not an integer") unless ($v =~ /^(\d+)$/o); } I think regexp should be changed to /^(-?\d+)$/o
Subject: Re: [rt.cpan.org #77178] UpdateAttributes and negative values
Date: Mon, 14 May 2012 09:33:05 +0930
To: bug-Sphinx-Search [...] rt.cpan.org
From: Jon Schutz <jon.schutz [...] youramigo.com>
Hi Dmitry, According to the documentation, attribute types include unsigned integers only. (There are other attribute type options, such as floating point and string values, but the UpdateAttributes API appears to only support 32-bit values; I use the PHP API as a reference for the perl implementation). http://sphinxsearch.com/docs/2.0.4/attributes.html Regards, -- Jon Schutz CTO, YourAmigo Ltd 53 Gilbert St Adelaide SA 5000 Ph: +61 8 82119211 Fax: +61 8 8211 6356 http://www.youramigo.com On 13/05/12 23:59, Dmitry Dedukhin via RT wrote: Show quoted text
> Sun May 13 10:29:09 2012: Request 77178 was acted upon. > Transaction: Ticket created by Demetros > Queue: Sphinx-Search > Subject: UpdateAttributes and negative values > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: dedukhin@mail.ru > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=77178 > > > > Is there any reason why I can't set negative value using UpdateAttributes > API call? > The code that prevents this: > > else { > croak("entry value $v is not an integer") unless ($v =~ > /^(\d+)$/o); > } > > I think regexp should be changed to /^(-?\d+)$/o
From: dedukhin [...] mail.ru
Вск Май 13 20:03:25 2012, jon.schutz@youramigo.com писал: Show quoted text
> Hi Dmitry, > > According to the documentation, attribute types include unsigned > integers only. (There are other attribute type options, such as > floating point and string values, but the UpdateAttributes API appears > to only support 32-bit values; I use the PHP API as a reference for the > perl implementation). > > http://sphinxsearch.com/docs/2.0.4/attributes.html > > Regards, >
As I can see from http://sphinxsearch.com/docs/manual-2.0.4.html#api-func-updateatttributes there are no any restrictions regarding 32-bit unsigned integers in manual. And I don't see any reason to prohibit updating signed bigint attributes http://sphinxsearch.com/docs/manual-2.0.4.html#conf-sql-attr-bigint According to this thread http://sphinxsearch.com/forum/view.html?id=1842 Sphinx author told about this feature in 0.9.9 release. And this http://sphinxsearch.com/forum/view.html?id=5742 is related to subject. I'll check Sphinx source code and will return back a bit later.
From: dedukhin [...] mail.ru
Hmm, as I can see from the Sphinx's source http://code.google.com/p/sphinxsearch/source/browse/trunk/api/libsphinxclient/sphinxclient.c#2272 there is an explicit type convertion to unsigned int for attribute values.