Text values are truncated to 32767 bytes if edited directly in the table widget #1281
Details for the issue
Text values are truncated to 32767 bytes if edited directly in the table widget.
Useful extra information
Steps to reproduce:
I'm opening this issue because:
I'm using DB4S on:
I'm using DB4S version:
I have also:
The text was updated successfully, but these errors were encountered:
For table cells with text larger than 32768 characters, the data gets truncated. If the user doesn't notice this somehow and hits the Escape key the truncated data is written back to the database resulting in a possible data loss. This problem is fixed by this commit in two ways: 1) The maximum length of the editor widgets is increased to the maximum value making this problem much more unlikely. 2) If the user is still hitting this value, i.e. the text is truncated anyway, the widget is put into read only mode and no data is written back to the database. See issue #1281.
The limit is in the QLineEdit class which is used as an editor inside the table view: https://doc.qt.io/qt-5/qlineedit.html#maxLength-prop
I have just pushed a commit which increases the size limit (unfortunately there doesn't seem to be a way to disable it entirely) and which doesn't allow writing data back into the database if the increased limit is still passed. Does that work for you?
Perfect! This is working for me. I don't think it's an issue not being able to remove the maximum if the truncation problem is avoided. These long texts are better edited in the cell editor. In fact, I discovered this while playing around with SVG files for the XML mode editor. At first I didn't know what I've done to break the images