View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
06088Bug reportsOtherpublic2012-05-28 15:12
Reportermars99 Assigned Toc_schmitz  
PriorityhighSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.00RC1 
Fixed in Version2.00RC2 
Summary06088: Saving a sub
Description

Saving a subquestion with the PostgreSQL backend results in the following error...

PDOException

SQLSTATE[42602]: Invalid name: 7 ERROR: invalid name syntax

/usr/share/webapps/limesurvey2/framework/db/CDbConnection.php(535)

523 return $this->getSchema()->getCommandBuilder();
524 }
525
526 /*
527
Returns the ID of the last inserted row or sequence value.
528 @param string $sequenceName name of the sequence object (required by some DBMS)
529
@return string the row ID of the last row inserted, or the last value retrieved from the sequence object
530 @see http://www.php.net/manual/en/function.PDO-lastInsertId.php
531
/
532 public function getLastInsertID($sequenceName='')
533 {
534 $this->setActive(true);
535 return $this->_pdo->lastInsertId($sequenceName);
536 }
537
538 /*
539
Quotes a string value for use in a query.
540 @param string $str string to be quoted
541
@return string the properly quoted string
542 @see http://www.php.net/manual/en/function.PDO-quote.php
543
/
544 public function quoteValue($str)
545 {
546 if(is_int($str) || is_float($str))
547 return $str;

Stack Trace
#0
+
/usr/share/webapps/limesurvey2/framework/db/CDbConnection.php(535): PDO->lastInsertId("")
#1

/usr/share/webapps/limesurvey2/application/controllers/admin/database.php(335): CDbConnection->getLastInsertID()

330 else
331 {
332 if (!isset($insertqid[$scale_id][$position]))
333 {
334 Questions::model()-> insertRecords(array('sid'=>$surveyid, 'gid'=>$gid, 'question_order'=>$position+1,'title'=>$codes[$scale_id][$position],'question'=>$subquestionvalue,'parent_qid'=>$qid,'language'=>$language,'scale_id'=>$scale_id));
335 $insertqid[$position]=Yii::app()->db->getLastInsertID();
336 }
337 else
338 {
339 switchMSSQLIdentityInsert('questions',true);
340 Questions::model()-> insertRecords(array('qid'=>$insertqid[$scale_id][$position],'sid'=>$surveyid, 'gid'=>$gid, 'question_order'=>$position+1,'title'=>$codes[$scale_id][$position],'question'=>$subquestionvalue,'parent_qid'=>$qid,'language'=>$language,'scale_id'=>$scale_id));

#2
unknown(0): database->index(null)
#3
+
/usr/share/webapps/limesurvey2/framework/web/actions/CAction.php(107): ReflectionMethod->invokeArgs(database, array(null))
#4

/usr/share/webapps/limesurvey2/application/core/Survey_Common_Action.php(82): CAction->runWithParamsInternal(database, ReflectionMethod, array())

77 $oMethod = new ReflectionMethod($this, $sDefault);
78 }
79
80 // We're all good to go, let's execute it
81 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
82 return parent::runWithParamsInternal($this, $oMethod, $params);
83 }
84
85 /*
86
Some functions have different parameters, which are just an alias of the
87 * usual parameters we're getting in the url. This function just populates

#5
+
/usr/share/webapps/limesurvey2/framework/web/CController.php(309): Survey_Common_Action->runWithParams(array())
#6
+
/usr/share/webapps/limesurvey2/framework/web/CController.php(287): CController->runAction(database)
#7
+
/usr/share/webapps/limesurvey2/framework/web/CController.php(266): CController->runActionWithFilters(database, array())
#8

/usr/share/webapps/limesurvey2/application/controllers/AdminController.php(150): CController->run("database")

145 Yii::app()->session['redirectopage'] = Yii::app()->request->requestUri;
146
147 $this->redirect($this->createUrl('/admin/authentication/login'));
148 }
149
150 return parent::run($action);
151 }
152
153 /*
154
Routes all the actions to their respective places
155 *

#9
+
/usr/share/webapps/limesurvey2/framework/web/CWebApplication.php(276): AdminController->run("database")
#10
+
/usr/share/webapps/limesurvey2/framework/web/CWebApplication.php(135): CWebApplication->runController("admin/database")
#11
+
/usr/share/webapps/limesurvey2/framework/base/CApplication.php(162): CWebApplication->processRequest()
#12
+
/usr/share/webapps/limesurvey2/index.php(171): CApplication->run()

Steps To Reproduce

1.) Login in to the backend
2.) Create a new survey, group and multiple choice question
3.) Enter one or more subquestions
4.) Save the entered subquestions --> ERROR

Only the first item is saved but the error occurs every time (if only one or multiple subquestions have to be saved).

Additional Information

There are more problems with PostgreSQL, so I have to assume it's more or less untested (additional reports will follow).

As a general advice I suggest using transactions for all operations on all databases (I know that the MyISAM MySQL Backend doesn't support it) as data integrity is important and other databases including MySQL with the InnoDB backend support it.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)120510
I will donate to the project if issue is resolvedNo
Browser
Database type & versionPostgreSQL 9.1.3
Server OS (if known)Ubuntu 12.04 LTS (ARM)
Webserver software & version (if known)lighttpd/1.4.28
PHP VersionPHP5 (5.3.10-1*)

Users monitoring this issue

There are no users monitoring this issue.

Activities

mars99

mars99

2012-05-12 21:59

reporter   ~18723

The full summary should have been:
Saving a subquestion with the PostgreSQL backend returns error

c_schmitz

c_schmitz

2012-05-15 21:30

administrator   ~18770

Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8475

c_schmitz

c_schmitz

2012-05-28 15:12

administrator   ~18960

Version 2.00RC2 released.

Related Changesets

LimeSurvey: Yii 7afad535

2012-05-15 12:29:28

c_schmitz

Details Diff
Fixed issue 06088: Saving a subquestion using Postgres shows error Affected Issues
06088
mod - application/controllers/admin/database.php Diff File

Issue History

Date Modified Username Field Change
2012-05-12 21:57 mars99 New Issue
2012-05-12 21:59 mars99 Note Added: 18723
2012-05-13 08:31 c_schmitz Assigned To => c_schmitz
2012-05-13 08:31 c_schmitz Status new => assigned
2012-05-15 21:28 c_schmitz Status assigned => resolved
2012-05-15 21:28 c_schmitz Fixed in Version => 2.00RC2
2012-05-15 21:28 c_schmitz Resolution open => fixed
2012-05-15 21:30 c_schmitz Changeset attached => LimeSurvey Yii 7afad535
2012-05-15 21:30 c_schmitz Note Added: 18770
2012-05-28 15:12 c_schmitz Note Added: 18960
2012-05-28 15:12 c_schmitz Status resolved => closed