Once data is saved Kexi does not trim any data secretly but there are problems in the GUI. There is no indication about text trimming that for text fields (limited by default to 200 characters) for text exceeding the maximum length. Reproducible: Always Steps to Reproduce: 1. Create table with one text field type (not long text) 2a. In data mode try to enter >200 characters to a field 2b. In data mode try to paste text with >200 characters Actual Results: For 2a. Entering stops at 200th character, no indication there is no space anymore for entering characters. For 2b. Pasted text is trimmed to 200 characters, although pasted successfully, no indication there was a trim. Expected Results: For 2a. Entering stops at 200th character, a clearly visible tip should appear near the text box indicating there is no space anymore for entering characters. For 2b. A clearly visible tip should appear near the text box indicating the text is larger than maximum. Two solutions should be provided: "Trim text to 200 characters" button and "Cancel" button. "More information" link should be added too, when clicked, user should see information that she can cancel the paste and redesign the table's field to allow for larger sizes (or change to long text type). Appropriate links leading to relevant options could be be added to this text too: 1. go to Design mode, 2. enlarge the max length to specified value, 3. change the subtype to long text.
Applies to any max length set, e.g. if I change to 300, trims at 300.
I also provided current workarounds at http://community.kde.org/Kexi/Releases/Kexi_2.4/Workaround_301136. Please ask if more info is needed so the document can be updated.
Created attachment 71555 [details] Kexi file project with single table and one field limited to 200 characters.
Git commit da2bf9b689ead286dbed755d51802c581aea4ca4 by Jaroslaw Staniek. Committed on 08/06/2012 at 01:35. Pushed by staniek into branch 'master'. Set limit to 255 for Text type in MySQL Driver MySQL Driver: *set limit to 255 characters for Text type (VARCHAR) *call "SET SESSION sql_mode='TRADITIONAL'" on opening database - needed to turn warnings about trimming string values into SQL errors *practical solution for 'Kexi shows no indication that text is trimmed' bug in case of MySQL: error is displayed eg. "Record inserting on the server failed.Message from server: Data too long for column 'hn' at row 1. SQL statement: INSERT INTO table4 (hn) VALUES ('...................'). Server result: 1406" More info on VARCHAR support in databases: http://www.ispirer.com/wiki/sqlways/mysql/data-types/varchar_n Related: bug 301277 REVIEW:105182 FIXED-IN:2.4.3 M +12 -2 kexi/doc/dev/CHANGELOG-Kexi-js M +18 -2 kexi/kexidb/connection.cpp M +1 -0 kexi/kexidb/driver.cpp M +7 -0 kexi/kexidb/driver_p.h M +8 -1 kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp M +2 -0 kexi/kexidb/drivers/mySQL/mysqldriver.cpp http://commits.kde.org/calligra/da2bf9b689ead286dbed755d51802c581aea4ca4
Git commit 366d03dbbf73d7773235b4ee45be99d5b02b33bf by Jaroslaw Staniek. Committed on 08/06/2012 at 01:35. Pushed by staniek into branch 'calligra/2.4'. Set limit to 255 for Text type in MySQL Driver MySQL Driver: *set limit to 255 characters for Text type (VARCHAR) *call "SET SESSION sql_mode='TRADITIONAL'" on opening database - needed to turn warnings about trimming string values into SQL errors *practical solution for 'Kexi shows no indication that text is trimmed' bug in case of MySQL: error is displayed eg. "Record inserting on the server failed.Message from server: Data too long for column 'hn' at row 1. SQL statement: INSERT INTO table4 (hn) VALUES ('...................'). Server result: 1406" More info on VARCHAR support in databases: http://www.ispirer.com/wiki/sqlways/mysql/data-types/varchar_n Related: bug 301277 REVIEW:105182 FIXED-IN:2.4.3 M +34 -0 kexi/doc/dev/CHANGELOG-Kexi-js M +18 -2 kexi/kexidb/connection.cpp M +1 -0 kexi/kexidb/driver.cpp M +7 -0 kexi/kexidb/driver_p.h M +8 -1 kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp M +2 -0 kexi/kexidb/drivers/mySQL/mysqldriver.cpp http://commits.kde.org/calligra/366d03dbbf73d7773235b4ee45be99d5b02b33bf
Git commit bb65aa5fe7cc9121b04942c569e2d2c9ba1ca955 by Yue Liu, on behalf of Jaroslaw Staniek. Committed on 08/06/2012 at 01:35. Pushed by liu into branch 'connection-interaction-yue'. Set limit to 255 for Text type in MySQL Driver MySQL Driver: *set limit to 255 characters for Text type (VARCHAR) *call "SET SESSION sql_mode='TRADITIONAL'" on opening database - needed to turn warnings about trimming string values into SQL errors *practical solution for 'Kexi shows no indication that text is trimmed' bug in case of MySQL: error is displayed eg. "Record inserting on the server failed.Message from server: Data too long for column 'hn' at row 1. SQL statement: INSERT INTO table4 (hn) VALUES ('...................'). Server result: 1406" More info on VARCHAR support in databases: http://www.ispirer.com/wiki/sqlways/mysql/data-types/varchar_n Related: bug 301277 REVIEW:105182 FIXED-IN:2.4.3 M +12 -2 kexi/doc/dev/CHANGELOG-Kexi-js M +18 -2 kexi/kexidb/connection.cpp M +1 -0 kexi/kexidb/driver.cpp M +7 -0 kexi/kexidb/driver_p.h M +8 -1 kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp M +2 -0 kexi/kexidb/drivers/mySQL/mysqldriver.cpp http://commits.kde.org/calligra/bb65aa5fe7cc9121b04942c569e2d2c9ba1ca955
Git commit 0a7667c32063831fff3c8e6ba9346d061cf56191 by Jaroslaw Staniek. Committed on 29/06/2012 at 22:37. Pushed by staniek into branch 'master'. Set limit to 255 for Text type in MySQL Driver *set limit to 255 characters for Text type (VARCHAR) *call "SET SESSION sql_mode='TRADITIONAL'" on opening database - needed to turn warnings about trimming string values into SQL errors *practical solution for 'Kexi shows no indication that text is trimmed' bug in case of MySQL: error is displayed eg. "Record inserting on the server failed.Message from server: Data too long for column 'hn' at row 1. SQL statement: INSERT INTO table4 (hn) VALUES ('...................'). Server result: 1406" *More info on VARCHAR support in databases: http://www.ispirer.com/wiki/sqlways/mysql/data-types/varchar_n *(2012-06-08 calligra master commit da2bf9b689e) Related: bug 301277 M +9 -2 Drivers/mysql/MysqlConnection_p.cpp M +2 -0 Drivers/mysql/MysqlDriver.cpp M +18 -2 Predicate/Connection.cpp M +2 -1 Predicate/Driver_p.cpp M +8 -1 Predicate/Driver_p.h http://commits.kde.org/predicate/0a7667c32063831fff3c8e6ba9346d061cf56191
Git commit 5a045908fb47dec17f28af77754ae553061a4195 by Jaroslaw Staniek. Committed on 27/10/2012 at 01:52. Pushed by staniek into branch 'calligra/2.6'. Tables/Forms: show indication that edited or pasted text is trimmed REVIEW:107068 DIGEST:Kexi shows indication that edited or pasted text is trimmed, more at http://blogs.kde.org/2012/10/27/kexi-26-text-trimming M +36 -1 kexi/core/kexidataiteminterface.cpp M +22 -1 kexi/core/kexidataiteminterface.h M +11 -1 kexi/plugins/forms/kexiformscrollview.cpp M +7 -1 kexi/plugins/forms/kexiformscrollview.h M +25 -9 kexi/plugins/forms/widgets/kexidblineedit.cpp M +11 -6 kexi/plugins/forms/widgets/kexidblineedit.h M +94 -31 kexi/widget/dataviewcommon/kexidataawareobjectiface.cpp M +18 -1 kexi/widget/dataviewcommon/kexidataawareobjectiface.h M +22 -10 kexi/widget/tableview/kexiinputtableedit.cpp M +3 -1 kexi/widget/tableview/kexiinputtableedit.h M +12 -1 kexi/widget/tableview/kexitableview.cpp M +6 -0 kexi/widget/tableview/kexitableview.h M +37 -9 kexi/widget/tableview/kexitextformatter.cpp M +5 -2 kexi/widget/tableview/kexitextformatter.h http://commits.kde.org/calligra/5a045908fb47dec17f28af77754ae553061a4195
Git commit c4bf842347421f20b75463932e4147e14cda96ae by Jaroslaw Staniek. Committed on 27/10/2012 at 01:52. Pushed by staniek into branch 'master'. Tables/Forms: show indication that edited or pasted text is trimmed REVIEW:107068 DIGEST:Kexi shows indication that edited or pasted text is trimmed, more at http://blogs.kde.org/2012/10/27/kexi-26-text-trimming M +36 -1 kexi/core/kexidataiteminterface.cpp M +22 -1 kexi/core/kexidataiteminterface.h M +11 -1 kexi/plugins/forms/kexiformscrollview.cpp M +7 -1 kexi/plugins/forms/kexiformscrollview.h M +25 -9 kexi/plugins/forms/widgets/kexidblineedit.cpp M +11 -6 kexi/plugins/forms/widgets/kexidblineedit.h M +94 -31 kexi/widget/dataviewcommon/kexidataawareobjectiface.cpp M +18 -1 kexi/widget/dataviewcommon/kexidataawareobjectiface.h M +22 -10 kexi/widget/tableview/kexiinputtableedit.cpp M +3 -1 kexi/widget/tableview/kexiinputtableedit.h M +12 -1 kexi/widget/tableview/kexitableview.cpp M +6 -0 kexi/widget/tableview/kexitableview.h M +37 -9 kexi/widget/tableview/kexitextformatter.cpp M +5 -2 kexi/widget/tableview/kexitextformatter.h http://commits.kde.org/calligra/c4bf842347421f20b75463932e4147e14cda96ae