LimeSurvey bugs, patches and feature requests - Bug reports
View Issue Details
06838Bug reports[All Projects] RemoteControlpublic2012-11-07 17:082012-11-15 16:27
jweberhofer 
c_schmitz 
normalminorhave not tried
closedfixed 
2.00+ 
2.00+ 
No
121106
Firefox 16
MySQL 5.5.25
opensuse 12.1
Apache/2.2.21
5.3.8
06838: export_responses gives a SQLSTATE[42000]
rpcClient->export_responses( zavbtzpautzd4psezkbnnegrn7g86dk6, 712485, 'csv', 'de', 'all', 'full', 'long', 5, 5)

Always returns in the following exception:
Request error: CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return\nORDER BY `lime_survey_712485`.`id` LIMIT 1 OFFSET 4' at line 5
No tags attached.
Issue History
2012-11-07 17:08jweberhoferNew Issue
2012-11-08 09:50c_schmitzNote Added: 22005
2012-11-08 09:50c_schmitzAssigned To => c_schmitz
2012-11-08 09:50c_schmitzStatusnew => feedback
2012-11-08 14:38jweberhoferNote Added: 22016
2012-11-08 14:38jweberhoferStatusfeedback => assigned
2012-11-08 14:43c_schmitzChangeset attached => LimeSurvey master 7bb8660c
2012-11-08 14:43c_schmitzNote Added: 22018
2012-11-08 14:43c_schmitzResolutionopen => fixed
2012-11-08 14:43c_schmitzStatusassigned => resolved
2012-11-08 14:43c_schmitzFixed in Version => 2.00+
2012-11-08 23:13jweberhoferNote Added: 22030
2012-11-08 23:14jweberhoferNote Added: 22031
2012-11-08 23:14jweberhoferStatusresolved => feedback
2012-11-08 23:14jweberhoferResolutionfixed => reopened
2012-11-08 23:19c_schmitzNote Deleted: 22031
2012-11-08 23:19c_schmitzNote Added: 22032
2012-11-09 00:07c_schmitzChangeset attached => LimeSurvey 2.1 bb2b2baa
2012-11-09 00:07c_schmitzNote Added: 22036
2012-11-15 16:27c_schmitzStatusfeedback => closed
2012-11-15 16:27c_schmitzResolutionreopened => fixed

Notes
(22005)
c_schmitz   
2012-11-08 09:50   
Can you set debug mode to 2 in application/config/config.php and see if you get a more detailed error message?
(22016)
jweberhofer   
2012-11-08 14:38   
Thank you for the debug-hint. Following your response I see that the following statement is executed; it's the "WHERE" line that is wrong. Executing the statement without that line runs smoothly!
=====
SELECT *
FROM `lime_survey_712485`
LEFT JOIN `lime_tokens_712485` ON lime_tokens_712485.token=lime_survey_712485.token
LEFT JOIN `lime_survey_712485_timings` `survey_timings` ON lime_survey_712485.id = survey_timings.id
WHERE return
ORDER BY `lime_survey_712485`.`id` LIMIT 1
(22018)
c_schmitz   
2012-11-08 14:43   
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=10193 [^]
(22030)
jweberhofer   
2012-11-08 23:13   
Wow, you are really fast. I've corrected that, and is looks good, but:

Another problem occures when I set an offset, in my case, I'll start with record four. The correct syntax would be "LIMIT 4" instead of "OFFSET 4"

=======
SELECT *
FROM `lime_survey_712485`
LEFT JOIN `lime_tokens_712485` ON lime_tokens_712485.token=lime_survey_712485.token
LEFT JOIN `lime_survey_712485_timings` `survey_timings` ON lime_survey_712485.id = survey_timings.id ORDER BY `lime_survey_712485`.`id` OFFSET 4;

=======
Some notes/questions:

When I try to limit the result to one line, that second parameter will be completely ignored in the SQL-Statement, but that might be handled within code, too. I can't see a handling in the completion state within the SQL statement.

Is there a way to load exactly a specific token's result, too?
(22032)
c_schmitz   
2012-11-08 23:19   
if you want to start with record 4 then OFFSET 4 is the right statement?
(22036)
c_schmitz   
2012-11-09 00:07   
Fix committed to 2.1 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=10212 [^]