LimeSurvey bugs and feature requests - Bug reports
View Issue Details
06838Bug reports[All Projects] RemoteControlpublic2012-11-07 17:082012-11-15 16:27
Assigned Toc_schmitz 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformOSOS Version
Product Version2.00+ 
Target VersionFixed in Version2.00+ 
Complete LimeSurvey version number (& build)121106
I will donate to the project if issue is resolvedNo
BrowserFirefox 16
Database & DB-VersionMySQL 5.5.25
Operating System (Server)opensuse 12.1
Webserver software & versionApache/2.2.21
PHP Version5.3.8
Summary06838: export_responses gives a SQLSTATE[42000]
DescriptionrpcClient->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
TagsNo tags attached.
Attached Files

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?
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!
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 =
WHERE return
ORDER BY `lime_survey_712485`.`id` LIMIT 1
2012-11-08 14:43   
Fix committed to master branch:
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"

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 = 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?
2012-11-08 23:19   
if you want to start with record 4 then OFFSET 4 is the right statement?
2012-11-09 00:07   
Fix committed to 2.1 branch:

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