Bug 74019 - FILEOPEN: Any table or select query having more than 10 fields cannot be opened in a database with embedded FireBird.
Summary: FILEOPEN: Any table or select query having more than 10 fields cannot be open...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.2.0.3 rc
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2014-01-24 13:27 UTC by Jiri Spitz
Modified: 2014-07-02 20:23 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
The attached file contains a table with many columns and queries GoodQurey and BugQuery demonstrating the described behaviour. (62.40 KB, application/vnd.oasis.opendocument.base)
2014-01-24 13:27 UTC, Jiri Spitz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Spitz 2014-01-24 13:27:42 UTC
Created attachment 92726 [details]
The attached file contains a table with many columns and queries GoodQurey and BugQuery demonstrating the described behaviour.

I create table with more than 10 columns, columns' types are not important. When I try to open the table, I receive the following error message:

firebird_sdbc error:
*Dynamic SQL Error
*SQL error code = -804
*Incorrect values within SQLDA structure
caused by
'isc_dsql_fetch'

and no data is displayed. The same happens with a select query having more than 10 columns. Tables having 10 or less columns are opened fine. Query having 10 or less columns opens also fine even it is build from a table having more than 10 columns. The error occurs even for empty tables or queries.

I am using LO 4.2.0 RC1 through RC3 with the Czech UI downloaded from the main LO site. The experimental features in the LO settings are switched on.
Comment 1 Robert Großkopf 2014-01-24 22:01:44 UTC
I have opened the bug-query. Can't confirm the bug here with OpenSUSE 12.3 Linux 64bit rpm, LO 4.2.0.3. The query works as expected.

When I try the same with the table the table couldn't be opened. Should we change the title and delete the query-part?

The problem: You have written about two bugs. The behavior is the same for you, but not for other people.

Regards

Robert
Comment 2 Robert Großkopf 2014-01-24 22:05:40 UTC
Have tested a little bit more. I could reproduce the bug for more than 12 columns in a query. I will switch this report to New.
Comment 3 Alex Thurgood 2014-03-14 15:28:29 UTC
Adding Andrjez and Lionel to CC
Comment 4 Alex Thurgood 2014-03-14 15:29:43 UTC
Sorry Andrzej, got a case of the keyboard dyslexia today ;-)
Comment 5 ribotb 2014-04-24 11:40:59 UTC
I reproduce with LO 4.2.4.1 (Win7/x86).

I tried a workaround : SELECT * FROM but I have the same message.

And I can't open the table (same message).

Bernard
Comment 6 ribotb 2014-04-25 07:39:11 UTC
Adding as blocker for making Firebird the default
Comment 7 Julien Nabet 2014-05-31 14:42:17 UTC
On pc Debian x86-64, I had different results according to LO version:
1) LO 4.2.4, Debian package (once enable experimental has been checked)
I reproduced exactly the description
- table opening : KO (with same message as indicated by Jiri)
- bugQuery opening : KO
- goodQuery opening : OK

2) 4.2 sources udpated today (once enable experimental has been checked)
- table opening : OK
- bugQuery opening : OK
- goodQuery opening : OK

so future 4.2.6 should be ok.
Could someone give a try to 4.2.5RC1?
Comment 8 wabik 2014-06-02 06:03:22 UTC
Look at the comment ... https://bugs.freedesktop.org/show_bug.cgi?id=76164#c8
Comment 9 Julien Nabet 2014-06-04 20:49:59 UTC
wabik: it seems the bug can't be reproduced from 4.2.6. (see https://bugs.freedesktop.org/show_bug.cgi?id=76164#c9)
Could someone give a try to the 4.2 daily build? (see http://dev-builds.libreoffice.org/daily/libreoffice-4-2/)
Comment 10 wabik 2014-06-05 06:35:09 UTC
Version: 4.2.6.0.0+
Build ID: 743bcdebef21deeb73f0111b4e6e047c88fd7b8f
TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-06-04_14:23:07

The same error:

Error code: 1

firebird_sdbc error:
*Dynamic SQL Error
*SQL error code = -804
*Incorrect values within SQLDA structure
caused by
'isc_dsql_fetch'
Comment 11 Julien Nabet 2014-06-05 06:43:36 UTC
Thank you for your feedback, no idea then :-(.
Comment 12 Alex Thurgood 2014-06-06 08:13:04 UTC
When I click on good query, I get an immediate crash oOSX with my latest master build :-/ separate bug report coming
Comment 13 Alex Thurgood 2014-06-06 08:58:26 UTC
Tried opening bug query on OSX LO 4242


Error code: 1

firebird_sdbc error:
*Dynamic SQL Error
*SQL error code = -804
*Incorrect values within SQLDA structure
caused by
'isc_dsql_fetch'

Good query loads OK
Comment 14 Lionel Elie Mamane 2014-06-11 17:57:04 UTC
This most probably comes from the hardcoded "10" at http://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/firebird/StatementCommonBase.cxx#125

This hardcoded 10 (my guess) needs to be replaced by *runtime-determined* right value of columns in the query.

Thanks to Julien Nabet for finding that piece of code, while investigating bug 79714.
Comment 15 Lionel Elie Mamane 2014-06-11 18:15:25 UTC
(In reply to comment #14)
 
> This hardcoded 10 (my guess) needs to be replaced by *runtime-determined*
> right value of columns in the query.

Reading the Firebird API doc, section DSQL programming methods / Method 3 page 101 (http://www.ibphoenix.com/files/60ApiGuide.zip - linked from http://www.firebirdsql.org/en/reference-manuals/), actually what the code does looks OK from a cursory glance. Try with 10, and if this is not enought, then reallocate and call isc_dsql_describe again.

Indeed, there was a

 out_sqlda->sqln = n;

missing, which Julien just added.

Julien: doesn't your patch for bug 79714 actually fix this bug, too?
Comment 16 Julien Nabet 2014-06-11 18:30:58 UTC
(In reply to comment #15)
>..
> Julien: doesn't your patch for bug 79714 actually fix this bug, too?
Yes and no.
Yes because indeed, I can open both queries of the attachment (fdo#79714 doesn't include a specific attachment but links to the attachment of this fdo) on MacOs.
No because there's a crash, at least with debug build when closing LO (only when I opened at least 1 of the 2 queries).
That's why, I'm eager to see the result on a non debug build :)
Comment 17 Alex Thurgood 2014-06-12 06:14:11 UTC
(In reply to comment #16)
> (In reply to comment #15)
> >..
> > Julien: doesn't your patch for bug 79714 actually fix this bug, too?
> Yes and no.
> Yes because indeed, I can open both queries of the attachment (fdo#79714
> doesn't include a specific attachment but links to the attachment of this
> fdo) on MacOs.
> No because there's a crash, at least with debug build when closing LO (only
> when I opened at least 1 of the 2 queries).
> That's why, I'm eager to see the result on a non debug build :)


Confirming that your patch allows me to open both queries.

I don't see a crash on exit either, and I have a debug build :-)
Nice work for nailing this :-))
Comment 18 Alex Thurgood 2014-06-12 06:16:45 UTC
As far as I'm concerned, you can set this to resolved fixed.
Comment 19 Julien Nabet 2014-06-12 06:23:24 UTC
Thank you Alex for the test!
So with:
- on master http://cgit.freedesktop.org/libreoffice/core/commit/?id=0acd0ed3a58698a34e11dd82f3368a983f8530df
- 4.3 https://gerrit.libreoffice.org/9741
- 4.2 https://gerrit.libreoffice.org/9742
 and according to your comment, let's put it as FIXED.
Comment 20 Alex Thurgood 2014-06-12 06:32:32 UTC
Ooops, having just checked my autoge, I'm not using dgbutil after all, so can not confirm that a debug build doesn't cras, but at least my normal build works ;-)
Comment 21 Jiri Spitz 2014-06-18 15:16:11 UTC
I can confirm that the issue is fixed. LO 4.3.0 RC1 works fine for me.

Thanks, Jiri