View Issue Details

This issue affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
04029Bug reportsStatisticspublic2010-01-24 23:56
Reporteruser5992Assigned Togandalfar  
PrioritynormalSeverityminor 
Status closedResolutionunable to reproduce 
Product Version1.87RC5 
Summary04029: PostgreSQL syntax errors : PG 8.3 refuses implicit casts from char to int
Description

hi folks,

I'm trying to get a full statitics page for a specific survey from :

/admin/admin.php?action=statistics#start

If i ask the stats for a few questions it's ok, but if i want to "View summary of all available fields" i get the following error :

Couldn't get question
SELECT title, type, question, qid, lid, lid1, other FROM "lime_questions" WHERE qid='' AND language='fr'
ERROR: invalid input syntax for integer: ""

Additional Information

the problem lies at the line 1352 of admin/statistics_function.php :

For some reason the $rqid variable is set to "" (empty string) but the qid column is and integer.

The implicit conversion of $rquid in integer might work with MySQL and old PostgreSQL versions, but modern PostgreSQL don't do these conversions anymore.

IMHO the best way to avoid that bug is to explicitly cast the qid inside the php code. Here's my patch :

1339c1339
< $qqid=$fielddata['qid'];

                          $qqid=intval($fielddata['qid']);

1349c1349
< $rqid=$qqid;

                          $rqid=intval($qqid);

1361c1361
< $qiqid=$nrow[3];

                                  $qiqid=intval($nrow[3]);

This is not exhaustive but you get the idea.

PostgreSQL is getting more and more strict and standard compliant :-)

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
Browser
Database type & version8.3.9
Server OS (if known)
Webserver software & version (if known)
PHP Version

Users monitoring this issue

gandalfar

Activities

c_schmitz

c_schmitz

2010-01-14 16:53

administrator   ~10780

Gandalfar, are you taking care of this?

gandalfar

gandalfar

2010-01-24 22:32

reporter   ~10870

I can't reproduce this with a simple survey. Maybe a more complex survey is needed

Issue History

Date Modified Username Field Change
2010-01-02 17:06 user5992 New Issue
2010-01-02 17:06 user5992 Status new => assigned
2010-01-02 17:06 user5992 Assigned To => user372
2010-01-02 17:06 user5992 Database & DB-Version => 8.3.9
2010-01-03 19:47 user372 Assigned To user372 => rakete
2010-01-05 21:50 user372 Issue Monitored: gandalfar
2010-01-12 22:13 user372 Assigned To rakete => gandalfar
2010-01-14 16:53 c_schmitz Note Added: 10780
2010-01-24 22:32 gandalfar Note Added: 10870
2010-01-24 23:56 c_schmitz Status assigned => closed
2010-01-24 23:56 c_schmitz Resolution open => unable to reproduce