Issue with DBMemo and data type length... lazarus / 16-Databases ---------------------------------------------------------------------- runs · 2015-09-12 17:27 I've made a table (SQLite) with a MEMO or VARCHAR field to store a TDBMemo. I get the following issue: -If I define MEMO(4096) or VARCHAR(4096), all is OK. -But If I define a double lenght MEMO(8192) or VARCHAR(8192), when I save the table, the content of the DBMemo is truncated to just the first char of the string. I know that the max lenght of this data types is 65536. And that never mind the data type, because all are converted/equivalent to TEXT. Why this behaviour? Is it normal? Should I report this as a bug? ---------------------------------------------------------------------- sin_dragan · 2015-09-12 20:23 Is the truncated data only in DBMemo component, or in the database itself? What version of laz/fpc are you using? ---------------------------------------------------------------------- miab3 · 2015-09-12 20:53 @runs, For ZEOS 7.2, Lazarus 1.4.2 and SQLite-3: VARCHAR(100000) fit 100000 Char VARCHAR fit 1G Char If in Properties in ZConnection will be Undefined_Varchar_AsString_Length=50000 then: VARCHAR(100000) fit 100000 Char VARCHAR fit 50000 Char Michal ---------------------------------------------------------------------- runs · 2015-09-12 22:12 Lazarus=1.4.2 FPC: 2.6.4 Not Zeos, but vanilla Lazarus components. Both in DBMemo & Database. ---------------------------------------------------------------------- LacaK · 2015-09-13 06:59 Probably related to: http://wiki.freepascal.org/Lazarus_1.4_fixes_branch QuoteWarning: FPC 2.6.4 has a bug when assigning data to TStringfield types (e.g. VARCHAR) of larger than 8192 bytes. Please see Issue #26068 for a fix you can apply to your projects. ---------------------------------------------------------------------- runs · 2015-09-13 12:46 Yes! It's that problem. I've filled a bug report cos I can solve it: http://bugs.freepascal.org/view.php?id=28673 Thanks. ---------------------------------------------------------------------- LacaK · 2015-09-14 06:07 Can you please download and install Lazarus from http://www.getlazarus.org/ and try if this version fixes your problem? If yes, then bug is already fixed in incomming FPC 3.0 ---------------------------------------------------------------------- runs · 2015-09-14 11:48 Yes it works OK!!! So I'll move to the 1.5 version. I love the new dock system and splash screen. I guess is "stable", meaning no corruption of the code. Thanks. :-)