View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
04913Bug reportsSurvey editingpublic2011-02-17 18:25
Reporterlimech Assigned Toc_schmitz  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
Product Version1.91RC2 
Target Version1.91RC4Fixed in Version1.91RC4 
Summary04913: GSoC - SQL syntax error in index.php::buildsurveysession()
Description

SELECT attr.qid,value FROM ".db_table_name('question_attributes')." AS attr
RIGHT JOIN ".db_table_name('questions')." AS quests ON attr.qid=quests.qid
WHERE attribute='random_group' AND value <> '' AND sid=$surveyid
GROUP BY attr.qid

as queried in buildserveysession() line 2699 is syntactically wrong and rejected by PostgreSQL 8.4. The value attribute needs either to be grouped-by or aggregated.

MySQL seems to accept the query.

Steps To Reproduce

Preview a question or a question group from the survey designer, using PostgreSQL as a database backend.

Additional Information

Diagnostic from PostgreSQL:

2011-01-24 15:53:43 CET ERROR: column "attr.value" must appear in the GROUP BY clause or be used in an aggregate function
2011-01-24 15:53:43 CET STATEMENT: SELECT attr.qid,value FROM "lime_question_attributes" as attr right join "lime_questions" as quests on attr.qid=quests.qid WHERE attribute='random_group' and value <> '' and sid=41153 GROUP BY attr.qid

TagsNo tags attached.
Bug heat10
Complete LimeSurvey version number (& build)9672
I will donate to the project if issue is resolvedNo
Browser
Database type & versionPostgreSQL 8.4.6-0ubuntu10.04 & 145
Server OS (if known)Ubuntu Server 10.04.1 LTS
Webserver software & version (if known)Apache httpd-2.2.14-5ubuntu8.4
PHP Version5.3.2-1ubuntu4.7

Relationships

related to 04915 closedc_schmitz GSoC - SQL error testing survey (MS SQL Server 2005) 

Users monitoring this issue

limech

Activities

Mazi

Mazi

2011-01-31 16:24

updater   ~14012

Carsten, you seem to be the only person having postgres set up. From what I have seen at the error message this is only a minor issue but it has to be solved and tested.

limech

limech

2011-02-01 13:49

reporter   ~14026

Related to 04915.

bobc55

bobc55

2011-02-02 18:03

reporter   ~14044

There isn't any aggregation in the select, the only change needed is to replace "group by" with "order by"

c_schmitz

c_schmitz

2011-02-17 18:25

administrator   ~14221

1.91RC4 released

Issue History

Date Modified Username Field Change
2011-01-31 13:28 limech New Issue
2011-01-31 14:07 limech Issue Monitored: limech
2011-01-31 16:23 Mazi Assigned To => c_schmitz
2011-01-31 16:23 Mazi Status new => assigned
2011-01-31 16:24 Mazi Note Added: 14012
2011-01-31 16:24 Mazi Status assigned => acknowledged
2011-02-01 13:49 limech Note Added: 14026
2011-02-01 16:15 mdekker Target Version => 1.91RC4
2011-02-02 12:39 Mazi Relationship added related to 04915
2011-02-02 18:03 bobc55 Note Added: 14044
2011-02-09 16:06 Mazi Summary SQL syntax error in index.php::buildsurveysession() => GSoC - SQL syntax error in index.php::buildsurveysession()
2011-02-11 19:18 c_schmitz Status acknowledged => resolved
2011-02-11 19:18 c_schmitz Fixed in Version => 1.91RC4
2011-02-11 19:18 c_schmitz Resolution open => fixed
2011-02-17 18:25 c_schmitz Note Added: 14221
2011-02-17 18:25 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing
2021-08-24 11:41 guest Bug heat 8 => 10