Bug 106866 - When I change the field length of the result is multiplied by 4 each time (firebird, varchar)
Summary: When I change the field length of the result is multiplied by 4 each time (fi...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.3.1.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-30 07:50 UTC by avsharapov
Modified: 2022-03-10 11:08 UTC (History)
4 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 avsharapov 2017-03-30 07:50:37 UTC
Description:
When I change the field length of the result is multiplied by 4 each time.
For example, when I enter a length equal to 100, it creates a field with a length of 400.
For information: Locale ru-RU

Actual Results:  
Creates a field of wrong length

Expected Results:
I would like to create a database field desired length


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Comment 1 avsharapov 2017-03-30 07:52:35 UTC
Base - Firebird
Comment 2 Robert Großkopf 2017-03-30 18:56:37 UTC
Opened a Firebird-Database with LO 5.3.2.1 on OpenSUSE 64bit rpm Linux, German GUI-language.
Created a new table with an Integer and a Varchar-field. Varchar had length while creating the table.
Saved the table, closed the table, closed LO.
Then reopened the database, reopened the table for editing, ot for putting values in rows.
Length of Varchar-field is 100 as expected.

So I couldn't confirm this bug.

Might be a special effect while fixing bug 105142
Comment 3 avsharapov 2017-03-31 06:08:41 UTC
Sad.
Version for Firebird I found a lot of problems.
I think it had something to do with an attempt to recalculate the lengths for the locales which are saved in UTF8, two bytes (in the previous version that I such attempts have not seen).
But if you try on the versions in Latin locale, you are unlikely to be able to confirm at least one.
Will have to wait for the opinions of Chinese users . :(
Anyway. Thank you for your work.
Good luck
Comment 4 Alex Thurgood 2017-04-07 08:13:49 UTC
Possibly linked to this bug :

http://tracker.firebirdsql.org/browse/CORE-4277
Comment 5 Alex Thurgood 2017-04-07 08:28:06 UTC
As Robert has mentioned, it could also be a side effect of 

https://cgit.freedesktop.org/libreoffice/core/commit/?id=1db423338899c71ba70e361af339d7b7e4aff61f

where these lines were added :

+            const char sCharset[] = "UTF8";
+            *dpb++ = isc_dpb_set_db_charset;
+            int nCharsetLength = sizeof(sCharset) - 1;
+            *dpb++ = (char) nCharsetLength;
+            strcpy(dpb, sCharset);
+            dpb+= nCharsetLength;
Comment 6 Alex Thurgood 2017-04-07 08:30:02 UTC
From comment 3, this would be a regression for users of such locales.
Comment 7 Commit Notification 2017-04-10 04:18:21 UTC
Tamás Bunth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1b81754f3f269d06f66fd5b56037ff79138ae512

tdf#106866 query character size instead of bytes

It will be available in 5.4.0.

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 8 Alex Thurgood 2017-04-10 07:00:34 UTC
Marking as resolved fixed, but needs verifying