View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
18275 | Bug reports | Survey taking | public | 2022-07-26 14:34 | 2024-09-04 16:33 |
Reporter | ritapas | Assigned To | |||
Priority | none | Severity | minor | ||
Status | confirmed | Resolution | open | ||
Product Version | 3.28.x | ||||
Summary | 18275: Long free text question cannot handle excessively long input | ||||
Description | When a user fills a Long free text question, they have no idea of the actual limit of the cell unless the designer put one. However, the designers themselves have no idea about that. | ||||
Steps To Reproduce | Steps to reproducecreate simple survey with example (pre-given) group and question. Activate. In the answer put a big series of characters (we saw that 60k is ok while 70k is not). Submit the answer. Expected resultResponse should be acquired or rejected with an error mesage. Actual resultCDbException CDbCommand failed to execute the SQL statement: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column '745942X3X3' at row 1. The SQL statement executed was: UPDATE /var/www/html/limesurvey3/framework/db/CDbCommand.php(358) | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 12 | ||||
Complete LimeSurvey version number (& build) | 3.28.14 (build 220608) | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Mozilla Firefox | ||||
Database type & version | mariadb-10.3.32-2 | ||||
Server OS (if known) | Red Hat Enterprise Linux release 8.5 (Ootpa) | ||||
Webserver software & version (if known) | httpd-2.4.37 | ||||
PHP Version | php-7.2.24 | ||||
Related? 18187 |
|
Should be pretty simple to just limit the input for different text types according to the DB limits: |
|
Not really since this one broke and the previous one not …
See https://github.com/LimeSurvey/LimeSurvey/blob/e3efd7fb1771e39d18396315fa7b2be56b78e800/application/helpers/expressions/em_manager_helper.php#L9832 |
|
@c_schmitz Maybe we can set an arbitrary number considering the minimum size that the different DB engines can handle. What do you think? |
|
Or, as MySQL (and Postgre?) can handle 65k in text fields, we can set that as that as a limit, when using MySQL engine. What do you think? |
|
Please : don't broke plugin … for mysql need to check column type (TEXT (LimeSurvey default) vs MEDIUMTEXT vs LONGTEXT) |
|
What kind of comment is that? I was thinking on a limit on the html control, not on an update to the DB |
|
@gabrieljenik Set the limit depending on the database type. |
|
If a plugin or an user update TEXT to LONGTEXT : you need more :) TEXT is the default
Not in checkValidityAnswer ? Seems the best place ?
database AND column type : right ? |
|
TEXT : 65k |
|
Please find below some analysis done. Renderer Part:
Calculating Max Amount:
|
|
Also, if validation side is also needed: Validation Part (not required, but may be good idea):
|
|
? Server side validation is always required … |
|
PS in checkValidityAnswer : we already have the sgq, then the column name for some question type : we can directly use it DB type. |
|
Yes, but you would have to add 1 query for every question... isn't that something to avoid if possible taking into account that is the survey taking process? If not, create some extra metadata on survey activate. |
|
Maybe more in $knownVars variable ?
or in getQuestionAttributesForEM ? Since it's enter in EMCache About knownVars : except static var : i think all other can enter in EMCache in future |
|
I see this problem is also present in my 5.4.14 installation, the only difference is that it is triggered by a larger input. I succeeded with a 650K chars input |
|
OK, if setting the limit depending on the database type is too hard, how about we focus on gracefully catching the error., then? |
|
For the Long/huge free text
|
|
Maybe for MYSQL/MARIADB we can use LONGTEXT https://mariadb.com/kb/en/longtext/ for Long text question and/or Huge text question ? |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2022-07-26 14:34 | ritapas | New Issue | |
2022-07-26 14:34 | ritapas | File Added: immagine.png | |
2022-07-28 18:56 | gabrieljenik | Status | new => confirmed |
2022-07-28 19:12 | gabrieljenik | Note Added: 71235 | |
2022-07-28 19:12 | gabrieljenik | Bug heat | 0 => 2 |
2022-10-11 08:59 | ritapas | Issue Monitored: ritapas | |
2022-10-11 08:59 | ritapas | Bug heat | 2 => 4 |
2022-10-11 15:11 | Mazi | Note Added: 72197 | |
2022-10-11 15:11 | Mazi | Bug heat | 4 => 6 |
2022-10-11 15:23 | DenisChenu | Note Added: 72198 | |
2022-10-11 15:23 | DenisChenu | Bug heat | 6 => 8 |
2022-10-11 15:24 | DenisChenu | Note Edited: 72198 | |
2022-10-18 16:24 | gabrieljenik | Note Added: 72333 | |
2022-10-18 16:26 | gabrieljenik | Note Added: 72334 | |
2022-10-18 16:27 | DenisChenu | Note Added: 72335 | |
2022-10-18 16:32 | gabrieljenik | Note Added: 72336 | |
2022-10-18 16:37 | c_schmitz | Note Added: 72339 | |
2022-10-18 16:37 | c_schmitz | Bug heat | 8 => 10 |
2022-10-18 16:43 | DenisChenu | Note Added: 72340 | |
2022-10-18 16:44 | DenisChenu | Note Added: 72341 | |
2022-10-25 19:00 | gabrieljenik | Note Added: 72419 | |
2022-10-25 19:01 | gabrieljenik | Note Added: 72420 | |
2022-10-25 19:03 | gabrieljenik | Note Edited: 72419 | |
2022-10-25 19:04 | gabrieljenik | Note Edited: 72419 | |
2022-10-25 19:09 | DenisChenu | Note Added: 72421 | |
2022-10-25 19:10 | DenisChenu | Note Added: 72422 | |
2022-10-25 20:37 | gabrieljenik | Note Added: 72423 | |
2022-10-25 20:39 | gabrieljenik | Note Edited: 72423 | |
2022-10-26 08:20 | DenisChenu | Note Added: 72424 | |
2023-02-10 13:23 | ritapas | Note Added: 73796 | |
2023-02-10 13:23 | ritapas | Bug heat | 10 => 12 |
2023-06-16 10:47 | c_schmitz | Note Added: 75663 | |
2023-06-16 10:47 | c_schmitz | Note Edited: 75663 | |
2023-06-16 10:48 | c_schmitz | Note Edited: 75663 | |
2024-09-04 16:15 | c_schmitz | Note Added: 80899 | |
2024-09-04 16:32 | DenisChenu | Note Added: 80900 | |
2024-09-04 16:33 | DenisChenu | Note Edited: 80900 |