View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
14469Bug reports_ Unknownpublic2019-01-31 01:16
Reporterrealitix Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status closedResolutionduplicate 
Product Version3.15.x 
Fixed in Version3.15.x 
Summary14469: Deleting a question crash with PostgreSQL under certain cicumstance
Description

If you create a question of multiple choice with comment type with postgresql, you can crash limesurvey.
See the steps to reproduce.

Jean-Sébastien

Steps To Reproduce

This bug only appears with Postgresql:

  1. Create a new survey and a first group
  2. Add a question of type: multiple choice with comment
  3. Set the answer like this:

SQ001 ; SQ001 légitime
SQ001comment ; SQ001 injection
comment ; injectionseule

  1. Try to delete the question: CRASH
Additional Information

The problem comes from the generated SQL QUERY which is:

SELECT COUNT(*) FROM "lime_questions" "t" LEFT OUTER JOIN "lime_groups" "groups" ON ("t"."gid"="groups"."gid") AND ("t"."language"="groups"."language") WHERE ((((t.sid='837195') AND (t.language='fr')) AND (t.parent_qid='0')) AND (groups.gid LIKE '%7%'));

And you get the following error: ERROR: operator does not exist: integer ~~ unknown

It's because groups.gid is an INTEGER and you can't apply the LIKE operator on an INTEGER type.
I suspect MySQL to accept silently this syntax error.

I'm working on it but I currently doesn't find where the operator type is defined in the source code.
I added

array('gid', 'numerical', 'integerOnly'=>true)

to the rules() function of application/models/QuestionGroup.php but that's not working.

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)3.15.0+181008
I will donate to the project if issue is resolvedNo
Browser
Database type & versionPostgresql
Server OS (if known)
Webserver software & version (if known)
PHP VersionNot important

Relationships

duplicate of 14431 closedDenisChenu Error 500 when deleting a question 

Users monitoring this issue

There are no users monitoring this issue.

Activities

realitix

realitix

2019-01-30 16:34

reporter   ~50346

Hello,
It's fixed since the 22 january with the commit 886f1d303f437f611b35139aa04c766428b2522d

realitix

realitix

2019-01-30 16:34

reporter   ~50347

You can close this issue

Issue History

Date Modified Username Field Change
2019-01-30 16:20 realitix New Issue
2019-01-30 16:34 realitix Note Added: 50346
2019-01-30 16:34 realitix Note Added: 50347
2019-01-31 01:15 DenisChenu Relationship added duplicate of 14431
2019-01-31 01:16 DenisChenu Assigned To => DenisChenu
2019-01-31 01:16 DenisChenu Status new => closed
2019-01-31 01:16 DenisChenu Resolution open => duplicate
2019-01-31 01:16 DenisChenu Fixed in Version => 3.15.x