Bug 74160 - Embedded Firebird : content of a VARCHAR text field is truncated to 17 characters
Summary: Embedded Firebird : content of a VARCHAR text field is truncated to 17 charac...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.2.0.0.beta1
Hardware: All All
: medium major
Assignee: Lionel Elie Mamane
URL:
Whiteboard: target:4.3.0 target:4.2.1
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-28 20:17 UTC by ribotb
Modified: 2014-02-01 11:21 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ribotb 2014-01-28 20:17:04 UTC
Hello,

In a text field with data type VARCHAR the content is truncated to 17 characters after saving the table.
For example : if "abcdefghijklmnopqrstuvwxyz" (without ") is entered in a text field with VARCHAr (100), after saving the field contains "abcdefghijklmnopq" (without ").
The problem does not occur with  a text field with data type CHAR.

Bernard Ribot
Comment 1 Julien Nabet 2014-01-28 21:11:58 UTC
On pc Debian x86-64 with master sources updated today, I can reproduce this.
Comment 2 Julien Nabet 2014-01-28 21:52:08 UTC
I tried to find where the problem could be from "RID_STR_SAVE_CURRENT_RECORD" but got lost in gdb.
Lionel/Andrzej: any code pointer or idea?

Just for information, the same test with hsqldb is ok.
Comment 3 Lionel Elie Mamane 2014-01-29 05:41:50 UTC
(In reply to comment #2)
> I tried to find where the problem could be from
> "RID_STR_SAVE_CURRENT_RECORD" but got lost in gdb.
> Lionel/Andrzej: any code pointer or idea?

Hmm... I don't find where updateString is implemented in the Firebird driver.

Try to break in dbaccess::ORowSet::updateString (file dbaccess/source/core/api/RowSet.cxx) and dbaccess::OResultSet::updateString (file dbaccess/source/core/api/resultset.cxx) and step from there.
Comment 4 Julien Nabet 2014-01-29 22:45:31 UTC
Thank you Lionel for your feedback.

I gave a try but still miss where it enters a Firebird part. I tried to enter in every function but think i get lost each time because of notify/fire parts.
Comment 5 Lionel Elie Mamane 2014-01-30 04:42:08 UTC
The right code pointer was dbaccess::ORowSet::updateRow which goes into dbaccess::ORowSetCache::updateRow which goes into dbaccess::OKeySet::updateRow, etc.
Comment 6 Lionel Elie Mamane 2014-01-30 04:53:10 UTC
The real "update" (and going into FireBird code) happens in dbaccess::OCacheSet::setParameter
which goes into
dbtools::setObjectWithInfo
which goes into
dbaccess::OPreparedStatement::setString
which goes into
connectivity::firebird::OPreparedStatement::setString
Comment 7 Lionel Elie Mamane 2014-01-30 05:06:48 UTC
@Andrzej: For your information, in C/C++, "^" is bitwise xor and not exponentiation. So 2^16 is (00000010) XOR (00010000) that is (00010010) that is 18.
Comment 8 Commit Notification 2014-01-30 05:14:55 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5e951de92544bceb19e03244f4ffef19c62c4d90

fdo#74160 firebird XParameters::setString truncate to 65535 characters



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2014-01-30 13:36:16 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=88eee0c3d591b210257298f3fd094727bd0dc05e&h=libreoffice-4-2

fdo#74160 firebird XParameters::setString truncate to 65535 characters


It will be available in LibreOffice 4.2.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 ribotb 2014-02-01 09:59:27 UTC
Hello,

It's OK with  LO 4.2.1.0.0+
Build ID: 92346fb7714ca7c6a467771d8a8b01305c1b17d1
TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-01-31_00:15:33

Thanks,
Bernard Ribot
Comment 11 Lionel Elie Mamane 2014-02-01 11:21:12 UTC
Setting to VERIFIED/FIXED based on comment 10.