[Libreoffice-bugs] [Bug 114755] SQL error: extra parentheses

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sat Dec 30 20:42:14 UTC 2017


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

Julien Nabet <serval2412 at yahoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lionel at mamane.lu

--- Comment #4 from Julien Nabet <serval2412 at yahoo.fr> ---
I retrieved a backtrace from location indicated by console logs and got this:
#0  0x00007fffc4b9610e in connectivity::firebird::StatusVectorToString(long
const (&) [20], rtl::OUString const&) (rStatusVector=...,
rCause="isc_dsql_prepare")
    at
/home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Util.cxx:54
#1  0x00007fffc4b962fb in connectivity::firebird::evaluateStatusVector(long
const (&) [20], rtl::OUString const&,
com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
(rStatusVector=..., rCause="isc_dsql_prepare", _rxContext=uno::Reference to
(connectivity::firebird::OStatement *) 0x5555580dea40)
    at
/home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Util.cxx:64
#2  0x00007fffc4b8a5c6 in
connectivity::firebird::OStatementCommonBase::prepareAndDescribeStatement(rtl::OUString
const&, XSQLDA*&, XSQLDA*) (this=0x5555580dea40, sql="INSERT INTO \"Table12\" (
\"cardinal\",\"words\" ) ( SELECT \"cardinal\", \"words\" FROM \"Table1\" )",
pOutSqlda=@0x5555580debe0: 0x5555580dcfa0, pInSqlda=0x0)
    at
/home/julien/lo/libreoffice/connectivity/source/drivers/firebird/StatementCommonBase.cxx:163
#3  0x00007fffc4b88f46 in
connectivity::firebird::OStatement::executeQuery(rtl::OUString const&)
(this=0x5555580dea40, sql="INSERT INTO \"Table12\" ( \"cardinal\",\"words\" ) (
SELECT \"cardinal\", \"words\" FROM \"Table1\" )") at
/home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Statement.cxx:112
#4  0x00007fffc4b892bb in
connectivity::firebird::OStatement::execute(rtl::OUString const&)
(this=0x5555580dea40, sql="INSERT INTO \"Table12\" ( \"cardinal\",\"words\" ) (
SELECT \"cardinal\", \"words\" FROM \"Table1\" )") at
/home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Statement.cxx:148
#5  0x00007fffc4b88dcc in
connectivity::firebird::OStatement::executeUpdate(rtl::OUString const&)
(this=0x5555580dea40, sql="INSERT INTO \"Table12\" ( \"cardinal\",\"words\" ) (
SELECT \"cardinal\", \"words\" FROM \"Table1\" )") at
/home/julien/lo/libreoffice/connectivity/source/drivers/firebird/Statement.cxx:96
#6  0x00007fffcae09623 in OStatement::executeUpdate(rtl::OUString const&)
(this=0x5555580ddff0, _rSQL="INSERT INTO \"Table12\" ( \"cardinal\",\"words\" )
( SELECT \"cardinal\", \"words\" FROM \"Table1\" )") at
/home/julien/lo/libreoffice/dbaccess/source/core/api/statement.cxx:478
#7  0x00007fffc835d28e in dbaui::CopyTableWizard::impl_doCopy_nothrow()
(this=0x5555580a3cf0) at
/home/julien/lo/libreoffice/dbaccess/source/ui/uno/copytablewizard.cxx:1368

The request is generated from
CopyTableWizard::impl_getServerSideCopyStatement_throw 
1442 const OUString sComposedTableName = ::dbtools::composeTableName(
xDestMetaData, _xTable, ::dbtools::EComposeRule::InDataManipulation, true );
1443 OUString sSql("INSERT INTO " + sComposedTableName + " ( " +
sColumns.makeStringAndClear() + " ) ( " + m_pSourceObject->getSelectStatement()
+ " )");

see
https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/uno/copytablewizard.cxx#1425

Lionel: here are 2 questions:
1) I haven't found SQL ref about INSERT INTO SELECT but when I read about it on
to https://www.w3schools.com/sql/sql_insert_into_select.asp or on other
websites, I never see parenthesis around SELECT block.
Do you think it'd be ok to remove them?

2) Now about the table used for INSERT block, the sql can't succeed since the
new table doesn't exist yet at this moment.
However, if we use the same table as the SELECT block, it won't work as soon as
there's primary/unique index.
Any thoughts?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20171230/141d8c17/attachment.html>


More information about the Libreoffice-bugs mailing list