Closed (won't fix)
Project:
Voting API
Version:
6.x-2.1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Apr 2008 at 09:52 UTC
Updated:
7 Dec 2017 at 09:27 UTC
Jump to comment: Most recent
When voting using Vote Up/Down widget got this error:
* user warning: Column count doesn't match value count at row 1 query: INSERT INTO votingapi_cache (vote_cache_id, content_type, content_id, value, value_type, tag, function, timestamp) VALUES (1217, 'node', 21, -0,36363636363636, 'points', 'lista', 'average', 1207388853) in /includes/database.mysql.inc on line 172.
* user warning: Column count doesn't match value count at row 1 query: INSERT INTO votingapi_cache (vote_cache_id, content_type, content_id, value, value_type, tag, function, timestamp) VALUES (1220, 'node', 21, -0,36363636363636, 'points', 'lista', 'average', 1207388854) in /includes/database.mysql.inc on line 172.
I think this is result of inserting decimal number in query: -0,3... . Semicolon in that number cause query crash due to column count mismatch.
Comments
Comment #1
Greggus commentedI've changed query in function votingapi_insert_cache_result from
to:
( %f → '%f' )
and everything looks to be fine but I'm not sure if it is correct.
Can somebody tell me if it is OK to insert number value as text (in ' ')?
Comment #2
eaton commentedHmmm. It appears, actually, that the problem is in a localized number (-0,36363636363636) being inserted into the SQL. The comma in that is treated as a column delimiter. Are you using localized number formats on your server, by any chance?
Comment #3
Greggus commentedYes, my server uses localized system but this error doesn't appear anymore... :)
Comment #4
ij3net commentedWhen cast vote get a warning -
* user warning: Column count doesn't match value count at row 1 query: INSERT INTO votingapi_cache (content_type, content_id, value, value_type, tag, function, timestamp) VALUES ('node', 55, 68,5714285714, 'percent', 'vote', 'average', 1247495719) in /var/www/virtual/night.lg.ua/htdocs/includes/common.inc on line 3422.
Error in votingapi.module -
im correct it -
im add a string of code $vote_result['value']=str_replace(',','.',$vote_result['value']);
Error caused by a peculiarity of the Russian locale. In the Russian locale for the fractional part separated by a comma, not point.
Comment #5
legolasboDrupal 6 is no longer supported. Closing old issues to clean up the issue queue.
Please reopen and update this issue if this is still an issue in the D7 or D8 version.