Closed (fixed)
Project:
Closed Question
Version:
6.x-2.0-beta7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 Apr 2011 at 20:15 UTC
Updated:
26 Apr 2011 at 15:48 UTC
Hello, just testing your module for use in our system and I get this error.
warning: pg_query(): Query failed: ERROR: syntax error at or near "SET" LINE 1: INSERT INTO cq_user_answer SET answer="i:0;", data="N;", onc... ^ in /home/sparcsadmin/drupal6/includes/database.pgsql.inc on line 139.
user warning: query: INSERT INTO cq_user_answer SET answer="i:0;", data="N;", once_correct=0, tries=1, uid=3, nid=3 in /home/sparcsadmin/drupal6/sites/all/modules/closedquestion/question/CqUserAnswerDefault.class.php on line 203.
warning: pg_query(): Query failed: ERROR: syntax error at or near "SET" LINE 1: INSERT INTO cq_user_answer_log SET answer="i:0;", once_corre... ^ in /home/sparcsadmin/drupal6/includes/database.pgsql.inc on line 139.
user warning: query: INSERT INTO cq_user_answer_log SET answer="i:0;", once_correct=0, tries=1, uid=3, nid=3, unixtime=1302293598 in /home/sparcsadmin/drupal6/sites/all/modules/closedquestion/question/CqUserAnswerDefault.class.php on line 153.
Comments
Comment #1
VeeLin commentedSorry - more details. So I created a question using the demo example code from here: http://wmmrc.wur.nl/Drupal%20Modules/Manual/Examples/choice-single
The question is created OK. When I select the first answer and submit I get the above error.
Comment #2
HylkeVDS commentedI guess postgresql doesn't know the INSERT ... SET ... syntax, and I guess you're the first postgresql user :)
I'll release a new version Monday morning using the INSERT ... VALUES... syntax.
Comment #3
HylkeVDS commentedIt should be fixed in beta6. Please re-open this issue if you find any more postgresql incompatibility issues.
Comment #4
VeeLin commentedthanks for looking into this!. Re-installed beta6. and created a questionf rom this example code:
http://wmmrc.wur.nl/Drupal%20Modules/Manual/Examples/choice-single
Question saved properly but when I select the first answer and submit I get:
Comment #5
VeeLin commentedRunning the query in postgres I get success with :
Comment #6
VeeLin commentedSo after manually filling the table with what I think you wanted as per above comment I get the following errors:
And the correct query for the update would be:
It's complaining about the double quotes. Also with the above the value for answer is "i:0;" - not sure what you wanted in there . . .
I hope that helps. it would be fantastic if you got this working with PostgreSQL!
Comment #7
VeeLin commentedAnd one more when re-setting the question:
Comment #8
HylkeVDS commentedAh, pg doesn't like " around strings. I'll change those to single quotes.
And I missed an insert.
the i:0; is a php serialised integer 0, so that's correct.
I'll fix it soon.
Comment #9
HylkeVDS commentedI've released beta7, let me know if you find more problems.
Comment #10
VeeLin commentedOK,
The bad news is that it's still got some errors. The good news is that they are different then before . . .
So I completely uninstalled the module and re-installed to eliminate any errors due to my manual manipulation of the tables yesterday and then repeated the steps in #4 above. I get:
You rock!
Comment #11
HylkeVDS commentedOk, Beta8 should fix that one.
Postgresql is a lot stricter than MySQL :)
Comment #12
VeeLin commentedI'm not getting any more errors :-)
THANKS !!!