Bug 143609 - FILEOPEN Exiting before completion due to errors caused by 'isc_service_query'
Summary: FILEOPEN Exiting before completion due to errors caused by 'isc_service_query'
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.2.0.1 rc
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-29 18:02 UTC by Brant Maltby
Modified: 2022-05-19 07:26 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 Brant Maltby 2021-07-29 18:02:16 UTC
7.2.0.1 7/28/21 daily build [really 7.2.0.1 RC1 to date]
Windows 10 pro, 64 bit, 21H1

firebird_sdbc error:
*arithmetic exception, numeric overflow, or string truncation
*string right truncation
*expected length 30, actual 35
*gds_$send failed
*Exiting before completion due to errors
caused by
'isc_service_query'

Have several odb files created with 7.0 and 7.1 that can be opened and edited in 7.1.5.2.

A small one = .99 mg works in 7.2.

Two larger ones, 28.3 mg and 5.71 mg, I get the above error.

I sometimes use Zorin 16 linux.  When 7.2.0.1 RC1 was released I installed it and tried to open the 28.3 file and got the above error.

Back in February 2021 I did find this error mentioned and the statement that a new system would be available to fix it.
Comment 1 Julien Nabet 2021-07-29 19:11:47 UTC
Would it be possible to have an example file?
Since attachments are public, attach a file with no private/confidential part or sanitize it with 7.0 or 7.1 LO version (see https://wiki.documentfoundation.org/QA/Bugzilla/Sanitizing_Files_Before_Submission)
Comment 2 Brant Maltby 2021-08-02 12:00:01 UTC
*string right truncation
*expected length 30, actual 35

The error appears to be text field strings in excess of the specified field length in the table master file.  7.0 & 7.1 are forgiving in uploading and file opening, 7.2 is not.  To fix, use the Calc LEN function in calc to calculate the string length of each text field.  Open the odf file in 7.1 and correct the specified text field string lengths, for each text field as appropriate.  The odf file should then open in 7.2.
Comment 3 QA Administrators 2021-08-04 03:46:57 UTC Comment hidden (obsolete)
Comment 4 Julien Nabet 2021-08-15 20:49:59 UTC
I'm not sure there's a bug here.
Was it expected LO accepts a string with a length superior to the definition?
I mean, would Firebird client would have accepted this?
Comment 5 Julien Nabet 2021-08-15 20:53:26 UTC
Brant: I had forgotten about your email so I'm copying/pasting here so everyone have the information:
"
If 7.2 is not made more forgiving to text field
string lengths in excess of the amount specified in the odb table master file,
then users will have to make sure that specified string length for each text
field is at least equal to the maximum length in the table for that field. 
Exporting to a calc spreadsheet, copying the field headings out to the right,
using the LEN and Max functions and then updating the odb master file using
7.1 [upload file format length importing into 7.2] appears to solve the
problem. 

The error I posted showed the master file specified 30 but base 7.2 found a
string length of 35.  I found 10 specified and a 12 maximum field length and
20 specified and a 28 maximum.  Each text field has to be corrected.   I know
that I was lazy in that I used the auto feature for 10/100/1000 rows with an
upload of 31,000 rows.  In 7.0 and 7.1 that was not a problem, a file upload
with with string lengths in excess of the specified amount would upload/open
and it does not appear to have truncated the data.
"
Comment 6 Julien Nabet 2021-08-15 20:54:21 UTC
What about changing the structure of the table so it'll accept more than 30 characters?
Comment 7 Buovjaga 2022-05-18 14:01:45 UTC
(In reply to Julien Nabet from comment #6)
> What about changing the structure of the table so it'll accept more than 30
> characters?

Setting to needinfo.
Comment 8 Robert Großkopf 2022-05-19 05:47:32 UTC
This problem could only be solved by opening the database with an older version of LO like LO 7.1.

The length of the field has been calculated wrong in older versions of Firebird internal database. See bug 108082
Comment 9 Buovjaga 2022-05-19 06:23:38 UTC
(In reply to Robert Großkopf from comment #8)
> This problem could only be solved by opening the database with an older
> version of LO like LO 7.1.
> 
> The length of the field has been calculated wrong in older versions of
> Firebird internal database. See bug 108082

But can the database be fixed in any way?
Comment 10 Robert Großkopf 2022-05-19 07:09:18 UTC
(In reply to Buovjaga from comment #9)
> 
> But can the database be fixed in any way?

The database has to be opened with LO 7.1 or an older version of LO. There must be a field, which is defined with length 30, but contains 35 characters.

1. 
A query like
SELECT * FROM "Table" WHERE CHAR_LENGTH("Text") > 30
should show this field.
The value must be changed.

2. other solution
Table must be edited. Looking for the field, which is set to 30 characters and change it to 35 characters.

After this changes you could open the database also in LO 7.2 an newer versions.
Comment 11 Buovjaga 2022-05-19 07:26:56 UTC
Thanks a lot. Then I think we can close this. It is unfortunate that this glitch existed, but good to know the db can be fixed.