View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
09283 | Bug reports | Survey taking | public | 2014-10-08 09:29 | 2014-11-26 10:29 |
Reporter | anthony_b | Assigned To | c_schmitz | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.05+ | ||||
Fixed in Version | 2.05+ | ||||
Summary | 09283: Short text field not limited to 255 characters when using PostgreSQL | ||||
Description | When using a postgresql database, short text fields are created as 'character varying(255)', even when no limit is set on the actual question. Survey participants are able to submit a response that exceeds this limit without any warning. An error is output to the participant, such as: Error executing query in dbExecuteAssoc:CDbCommand failed to execute the SQL statement: SQLSTATE[22001]: String data, right truncated: 7 ERROR: value too long for type character varying(255). The SQL statement executed was: UPDATE survey_864954 SET "lastpage"=1, "864954X3X3"='LONG_INPUT' WHERE ID=2 (I truncated the actual response to 'LONG_INPUT'). and the survey administrator receives an email with the subject 'Error saving results'. There is no error actually included, the text at the end just shows: SQL CODE THAT FAILED: ERROR MESSAGE: | ||||
Steps To Reproduce | Create a survey and add a question of type 'short free text'. | ||||
Additional Information | I believe the issue exists in: application/helpers/admin/activate_helper.php on line 293, where the type is set to 'string' for non-MySQL databases. Within the Yii Framework, it appears that this type is cast to varchar(255). Eg, for PostgreSQL, see: framework/db/schema/pgsql/CPgsqlSchema.php (Line 28) It appears the issue would affect SQL server as well. Although I have not tested it, it appears that MySQL would behave correctly. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 2 | ||||
Complete LimeSurvey version number (& build) | 141003 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | PostgreSQL 9.1.3 | ||||
Server OS (if known) | Debian Linux 7 (Wheezy) | ||||
Webserver software & version (if known) | Apache 2.2.22-13 | ||||
PHP Version | 5.4.4-14 | ||||
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=14659 |
|
The short text field indeed can only collect 255 characters on Postgres and MSSQL - that is the intended behaviour. Fixed it so that not more than 255 characters can entered on these DB systems. |
|
Version 2.05 Build 141126 released |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2014-10-08 09:29 | anthony_b | New Issue | |
2014-10-08 09:29 | anthony_b | File Added: limesurvey_survey_864954.lss | |
2014-11-24 19:40 | c_schmitz | Assigned To | => c_schmitz |
2014-11-24 19:40 | c_schmitz | Status | new => assigned |
2014-11-24 19:52 | c_schmitz | Changeset attached | => LimeSurvey master cacfd7ab |
2014-11-24 19:52 | c_schmitz | Note Added: 31089 | |
2014-11-24 19:52 | c_schmitz | Resolution | open => fixed |
2014-11-24 19:53 | c_schmitz | Note Added: 31090 | |
2014-11-24 19:53 | c_schmitz | Status | assigned => resolved |
2014-11-24 19:53 | c_schmitz | Fixed in Version | => 2.05+ |
2014-11-24 20:00 | c_schmitz | Summary | Short text field limited to 255 characters when using PostgreSQL => Short text field not limited to 255 characters when using PostgreSQL |
2014-11-26 10:29 | c_schmitz | Note Added: 31095 | |
2014-11-26 10:29 | c_schmitz | Status | resolved => closed |