Very impressed with this module! Small problem however when working with PostgreSQL as storage engine for both Drupal and LimeSurvey.
PDOException: SQLSTATE[42804]: Datatype mismatch: 7 ERROR: argument of WHERE must be type boolean, not type integer LINE 1: ... AS ls_token, submitdate FROM survey_588599 WHERE 1 ORDER BY... ^: SELECT id AS ls_aid, startlanguage AS ls_lang, token AS ls_token, submitdate FROM {survey_588599} WHERE 1 ORDER BY id ASC; Array ( ) in limesurvey_sync_answ_extract_answers() (line 529 of /Library/WebServer/Documents/drupal/sites/all/modules/limesurvey_sync/ls_api/limesurvey_sync_api_answ.inc).
I'm not sure why the default datatype aliasses in Drupal do not catch this. Can anyone reproduce this?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | limesurvey_sync-fix pgsql error.zip | 181.35 KB | thedut |
| #3 | PostgreSQL_error-1950030-3.patch | 1.79 KB | thedut |
Comments
Comment #1
thedut commentedHello ericsol !
I have never tested my module using PostgreSQL, I'm glad you did it !
You report a common bug happening with PostgreSQL :
- PostgreSQL query error when searching,
- SELECT * FROM ... WHERE 1 breaks PostGres,
- Some queries don't work in PostgreSQL.
Thank you for reporting it.
I need to adapt each 'WHERE 1' string in the LimeSurvey Sync module code in order to fix this PostgreSQL issue.
I guess it is not catched because I am using static queries (not dynamic ones), for performance reasons.
I will fix this issue for the next release.
Comment #2
thedut commentedI hope I will only have to execute a 'find and replace' procedure :
Finding : WHERE 1
replacing it by : WHERE 1=1
and make sure MySql still works !
Comment #3
thedut commentedHi ericsol,
I provide the fix here : you can try either the patch or the whole module directory (they are equal) attached.
there was only 3 lines to edit.
Please report if ti solves your postgreSQL issue.
Comment #4
thedut commentedI guess this issue is fixed. I will include this patch into the next release.
Comment #5
ericsol commentedSorry for slow response. Confirmed working.
Eric
Comment #6
thedut commentedgreat, thanks.
Comment #7
thedut commentedFixed into the LimeSurvey_sync v7.x-1.3 and LimeSurvey_Sync v6.x-1.3 releases.