diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-07 13:43:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-07 20:12:52 +0200 |
commit | 6d024a69164716f7856ec936a72d01a6630d2a7c (patch) | |
tree | 9bda920145156abaf3208cf51fe2c5b84e24752b /connectivity/source/parse | |
parent | 66661417ff019831cbe7e647be2df1a4328ec2e6 (diff) |
tdf#126588 crash in saving view
regression from
commit d425658bd9fd8e315e4931afb544bc845da0360e
Date: Wed Dec 19 16:10:51 2018 +0200
pass OSQLParseNode around by unique_ptr
We have a OSQLNode being deleted at
connectivity::OSQLParseNodesContainer::clearAndDelete() at
connectivity/source/parse/sqlnode.cxx:2781
connectivity::OSQLParser::parseTree(rtl::OUString&, rtl::OUString
const&, bool)
(this=0x38eba90, rErrorMessage="syntax error, unexpected UNION,
expecting $end", rStatement="CREATE VIEW \"View1\" AS SELECT
\"Tab1\".\"Name\" AS \"Name1\", \"Tab1\".\"Geburtsdatum\" AS
\"Geburtsdatum1\", 1 AS \"MonatZahl1\",
COALESCE(\"Tab1\".\"MonatZaehler\",999) AS \"MonatZaehler1\", 'Januar'
AS \"Monat1\", \"Tab2"..., bInternational=false)
at workdir/YaccTarget/connectivity/source/parse/sqlbison.cxx:10914
namespace)::parseStatement_throwError(connectivity::OSQLParser&,
rtl::OUString const&,
com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
(_rParser=..., _rStatement="CREATE VIEW \"View1\" AS SELECT
\"Tab1\".\"Name\" AS \"Name1\", \"Tab1\".\"Geburtsdatum\" AS
\"Geburtsdatum1\", 1 AS \"MonatZahl1\",
COALESCE(\"Tab1\".\"MonatZaehler\",999) AS \"MonatZaehler1\", 'Januar'
AS \"Monat1\", \"Tab2"..., _rxContext=uno::Reference to
(dbaccess::OSingleSelectQueryComposer *) 0x38eb8d0)
at dbaccess/source/core/api/SingleSelectQueryComposer.cxx:106
and then again at
std::unique_ptr<connectivity::OSQLParseNode,
std::default_delete<connectivity::OSQLParseNode>
>::operator=(decltype(nullptr))
(this=0x38eba90) at connectivity/source/parse/sqlnode.cxx:1500
Change-Id: I292627a06369208e0010743063c7eb5a38921a19
Reviewed-on: https://gerrit.libreoffice.org/77106
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/parse')
-rw-r--r-- | connectivity/source/parse/sqlbison.y | 1 | ||||
-rw-r--r-- | connectivity/source/parse/sqlnode.cxx | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y index 013073b882d5..a6aa13353584 100644 --- a/connectivity/source/parse/sqlbison.y +++ b/connectivity/source/parse/sqlbison.y @@ -4597,6 +4597,7 @@ std::unique_ptr<OSQLParseNode> OSQLParser::parseTree(OUString& rErrorMessage, // clear the garbage collector (*s_pGarbageCollector)->clearAndDelete(); + m_pParseTree.release(); // because the garbage collector deleted it return nullptr; } else diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 84bc3492ce90..3050d347fcdc 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1293,6 +1293,7 @@ std::unique_ptr<OSQLParseNode> OSQLParser::predicateTree(OUString& rErrorMessage // clear the garbage collector (*s_pGarbageCollector)->clearAndDelete(); + m_pParseTree.release(); // because the garbage collector deleted it return nullptr; } else |