https://bugs.documentfoundation.org/show_bug.cgi?id=104227

--- Comment #13 from Julien Nabet <serval2...@yahoo.fr> ---
It seems there's a confusion about sqlsubtypes, "decimal" and "numeric"
Reading src/common/dsc.h from Firebird package included in LO:
    445 // Exact numeric subtypes: with ODS >= 10, these apply when dtype
    446 // is short, long, or quad.
    447 
    448 const SSHORT dsc_num_type_none          = 0;    // defined as SMALLINT
or INTEGER
    449 const SSHORT dsc_num_type_numeric       = 1;    // defined as
NUMERIC(n,m)
    450 const SSHORT dsc_num_type_decimal       = 2;    // defined as
DECIMAL(n,m)


In connectivity/source/drivers/firebird/ResultSet.cxx, we can see:
    458         case SQL_SHORT:
    459             if(nSqlSubType == 0 || nSqlSubType == 1) //numeric or
decimal
    460                 return getString(nColumnIndex);
    461             return getShort(nColumnIndex);
    462         case SQL_LONG:
    463             if(nSqlSubType == 0 || nSqlSubType == 1) //numeric or
decimal
    464                 return getString(nColumnIndex);
    465             return getInt(nColumnIndex);

    468         case SQL_DOUBLE:
    469             if(nSqlSubType == 0 || nSqlSubType == 1) //numeric or
decimal
    470                 return getString(nColumnIndex);
    471             return getDouble(nColumnIndex);

    480         case SQL_INT64:
    481             if(nSqlSubType == 0 || nSqlSubType == 1) //numeric or
decimal
    482                 return getString(nColumnIndex);
    483             return getLong(nColumnIndex);

so comment doesn't correspond to code.
Whereas this part is ok:
    581     else if ((aSqlType == SQL_SHORT || aSqlType == SQL_LONG
    582                 || aSqlType == SQL_DOUBLE || aSqlType == SQL_INT64)
    583                     && (aSqlSubType == 1 || aSqlSubType == 2))
    584     {
    585         // decimal and numeric types

See
http://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/firebird/ResultSet.cxx#459

I gave a try by changing the four:
if(nSqlSubType == 0 || nSqlSubType == 1)

by
if(nSqlSubType == 1 || nSqlSubType == 2)
and I haven't reproduced the crash with it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to