Bug 105604 - Firebird error when creating a table containing a VARCHAR with by default value 32765
Summary: Firebird error when creating a table containing a VARCHAR with by default val...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2017-01-30 07:34 UTC by Julien Nabet
Modified: 2020-06-07 20:24 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 Julien Nabet 2017-01-30 07:34:58 UTC
Description:
On pc Debian x86-64 with master sources updated 3 days ago + enable-dbgutil, I can't create a table on Firebird with when it contains VARCHAR

Steps to Reproduce:
1. Enable experimental features (required for Firebird)
2. Launch Base
3. Create a brand new ODB file with Firebird
4. Click on Tables pane
5. Select Use Wizard to Create Table...
=> Business category is selected by default
=> Tasks table is selected by default
6. Select Notes and put it to right
7. Click Finish




Actual Results:  
=> popup error message

on console
warn:connectivity.firebird:6627:1:connectivity/source/drivers/firebird/Util.cxx:52: firebird_sdbc error:
*Dynamic SQL Error
*SQL error code = -842
*Short integer expected
caused by
'isc_dsql_prepare'

Expected Results:
No error, table created


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 Julien Nabet 2017-01-30 07:40:31 UTC
tdf#71251 had been fixed by putting max value from 32767 to 32765. I tested again and now the max length value is 8191 for a varchar
Comment 2 Julien Nabet 2017-01-30 08:03:45 UTC
Putting a break shows a value to 65000 ! (not 32765)

#0  connectivity::firebird::StatusVectorToString (rStatusVector=..., rCause="isc_dsql_prepare") at /home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Util.cxx:52
#1  0x00002aaafac11631 in connectivity::firebird::evaluateStatusVector (rStatusVector=..., rCause="isc_dsql_prepare", _rxContext=
    uno::Reference to (connectivity::firebird::OStatement *) 0x55555b171560) at /home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Util.cxx:62
#2  0x00002aaafac08b9f in connectivity::firebird::OStatementCommonBase::prepareAndDescribeStatement (this=this@entry=0x55555b171560, 
    sql="CREATE TABLE \"Tasks\" (\"ID\" INTEGER NOT NULL,\"Notes\" VARCHAR(65000), PRIMARY KEY  (\"ID\"))", pOutSqlda=@0x55555b171700: 0x55555b25d970, 
    pInSqlda=pInSqlda@entry=0x0) at /home/julien/lo/libreoffice/connectivity/source/drivers/firebird/StatementCommonBase.cxx:165
#3  0x00002aaafac07807 in connectivity::firebird::OStatement::executeQuery (this=0x55555b171560, 
    sql="CREATE TABLE \"Tasks\" (\"ID\" INTEGER NOT NULL,\"Notes\" VARCHAR(65000), PRIMARY KEY  (\"ID\"))")
    at /home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Statement.cxx:115
#4  0x00002aaafac07564 in connectivity::firebird::OStatement::execute (this=<optimized out>, sql=...)
    at /home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Statement.cxx:150
#5  0x00002aaafac0f69f in connectivity::firebird::Tables::appendObject (this=0x55555b97f480, rName="Tasks", rDescriptor=...)
    at /home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Tables.cxx:170
#6  0x00002aaabc7e6976 in connectivity::sdbcx::OCollection::appendByDescriptor (this=0x55555b97f480, 
    descriptor=uno::Reference to (dbaccess::ODBTableDecorator *) 0x5555577f44d0) at /home/julien/lo/libreoffice/connectivity/source/sdbcx/VCollection.cxx:367
#7  0x00002aaaf99cb00a in dbaccess::OTableContainer::appendObject (this=0x55555789e4f0, _rForName="Tasks", 
    descriptor=uno::Reference to (dbaccess::ODBTableDecorator *) 0x5555577f44d0) at /home/julien/lo/libreoffice/dbaccess/source/core/api/tablecontainer.cxx:282
#8  0x00002aaabc7e6976 in connectivity::sdbcx::OCollection::appendByDescriptor (this=0x55555789e4f0, 
    descriptor=uno::Reference to (dbaccess::ODBTableDecorator *) 0x5555577f44d0) at /home/julien/lo/libreoffice/connectivity/source/sdbcx/VCollection.cxx:367
Comment 3 Julien Nabet 2017-01-30 08:32:41 UTC
If I click Finish just after having selected Notes field, SQL contains 65000
If I click Next and see details of Notes field length 32765, SQL contains 32765
Anyway, both cases fail, impossible to create a table with 32765 length.
Idem when trying SQL command directly (so not related to wizard except 65000/32765 pb):
CREATE TABLE "Tasks" ("ID" INTEGER NOT NULL,"Notes" VARCHAR(32765), PRIMARY KEY  ("ID"))
Comment 4 Julien Nabet 2017-01-30 08:37:53 UTC
Tamas/Lionel: thought you might be interested in this one.
Comment 5 Alex Thurgood 2017-01-31 11:34:35 UTC
No repro with

Version: 5.4.0.0.alpha0+
Build ID: 8b93a951214b64fb166e14477f370657ebf67c0d
CPU Threads: 2; OS Version: Mac OS X 10.12.2; UI Render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group

which is a few days older than the one you tested, I think.
Comment 6 Terrence Enger 2017-02-05 21:00:38 UTC
I see the error in daily dbgutil bibisect repository version
2017-02-05 running on debain-stretch.  Setting bug status NEW.
Comment 7 Julien Nabet 2018-01-02 10:09:46 UTC
Fixed with https://cgit.freedesktop.org/libreoffice/core/commit/?id=ee29c944868a578b002103bb58595029bf385473

I think it could be useful to cherry-pick this patch on 6.0 branch. If everyone is ok, I may do it.
Any opinion?
Comment 8 Terrence Enger 2018-01-04 20:29:20 UTC
FWIW, I see the bug is fixed in daily Linux dbgutil bibisect
repository version 2018-01-04.