Commit Graph
177 Commits
Author SHA1 Message Date
Julien Nabet 016a58d2f5 tdf#132385: sql parser: don't drop clauses from window specification
bison rule

window_specification:
        '(' window_specification_details ')'
        {
                $$ = SQL_NEW_RULE;
                $$->append(newNode("(", SQLNodeType::Punctuation));
                $$->append($2);
                $$->append(newNode(")", SQLNodeType::Punctuation));
        }
        ;

makes it look like rule "window_specification_details" is a single
node, but in reality it is a sequence of four nodes:

window_specification_details:
        opt_existing_window_name
        opt_window_partition_clause
        opt_order_by_clause
        opt_window_frame_clause
        ;

The result is that only the "opt_existing_window_name" clause was
being put in the parse tree, and the other three were simply
discarded.

Since that will forever be a trap, and this is the only place
where window_specification_details is used, we inline it into
window_specification and remove it.

Change-Id: I568904355174d2bc36155bde1d4dd09f57759cd2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92894
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Jenkins
2020-04-26 12:56:17 +02:00
Julien Nabet 11ee7b59dd Typo: *Comparsion* -> *Comparison* in dbaccess/connectivity
Change-Id: I9dfe37b290dbb83b1dfb2f92669ae254898ee72e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92898
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-04-25 20:19:58 +02:00
Noel Grandin 386bb99bf6 sal_Char->char in connectivity
Change-Id: Ie32cbef9b03d69044c401f79bc737cde6dd0ed5d
Reviewed-on: https://gerrit.libreoffice.org/85396
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-18 20:38:03 +01:00
Andrea Gelmini 0940229305 Fix '..'
To complete this:
https://gerrit.libreoffice.org/#/c/78312/

This is a massive replace for lines ending with
".." instead of "..."

It passed "make check" on Linux.

Change-Id: I07fa7b2e30ba9ea17a1f9a5e21c57216ba958efe
Reviewed-on: https://gerrit.libreoffice.org/78356
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2019-09-01 11:15:11 +02:00
Noel Grandin 6d024a6916 tdf#126588 crash in saving view
regression from
    commit d425658bd9
    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>
2019-08-07 20:12:52 +02:00
Noel Grandin d425658bd9 pass OSQLParseNode around by unique_ptr
Change-Id: I8ffb9e04614472c3645d24bebdc88f91059d12ad
Reviewed-on: https://gerrit.libreoffice.org/65436
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-21 08:26:15 +01:00
Gabor Kelemen dfaa7d4d28 Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories from connectivity to cui

Change-Id: I9903c10d0a04bbeb93d0f776d1d252b152459499
Reviewed-on: https://gerrit.libreoffice.org/57408
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-16 12:24:49 +02:00
Mike Kaganski b7c5ddcdd0 connectivity: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: I22553d7cbbae7cfaac3f39a17db54dfe06e2e5bc
Reviewed-on: https://gerrit.libreoffice.org/48989
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-31 21:03:22 +01:00
Tor Lillqvist 72ff62a13a tdf#104986: Add MILLISECOND, WEEKDAY, and YEARDAY tokens for Firebird
Change-Id: I2ba866c408dbf49f1655cc08cc5d0df840eaf01e
Reviewed-on: https://gerrit.libreoffice.org/47271
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-01-02 20:09:35 +01:00
Jens Carl 17cc6627f9 tdf#39468 Translate German comments
Translate German comments and terms in connectivity/

Change-Id: Id32217529e02d3efd070bc226b0078dcab73a602
Reviewed-on: https://gerrit.libreoffice.org/35820
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2017-03-29 19:38:52 +00:00
Caolán McNamara 6abcf8b289 no special support for MACOSX PPC in master for a while now
Change-Id: I8d5dc878f41939e55ef8995d1da74548faa4711f
2017-01-17 16:19:11 +00:00
Stephan Bergmann 3a639ccf74 New loplugin:externvar: connectivity
Change-Id: I7e62a92ee4b019163de797fd4448170a741879dc
2017-01-09 15:44:10 +01:00
Stephan Bergmann 30dd4ac3a8 Fix loplugin warnings in sqlbison.y
(Normally hidden by T_YACCFLAGS containing -l in connectivity/Library_dbtools.mk
suppressing #line directives; some loplugin:cstylecast would remain in bison-
provided expansions of $1 etc. variables.)

Change-Id: Ic93bea0b2fe0ec5f741c4bc41f25cc72fec0498f
2017-01-04 16:18:13 +01:00
Noel Grandin a52231c785 com::sun::star->css in connectivity
Change-Id: I9489e92dc89a6d83a26ff4f0d9aad26acd28ad9f
Reviewed-on: https://gerrit.libreoffice.org/25537
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-30 08:37:11 +00:00
Rohan Kumar 576ab77255 tdf#91794 Remove OSL_DEBUG_LEVEL > 1 conditionals
I either replaced OSL_DEBUG_LEVEL > 1 with OSL_DEBUG_LEVEL > 0
statements or i used SAL_INFO(..)s

Change-Id: Iefb6b83e86e1767e55600b6e1989ee91207fb220
Reviewed-on: https://gerrit.libreoffice.org/23000
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-03-08 13:31:09 +00:00
Noel Grandin 960d4ebf76 convert SQLNodeType to scoped enum
Change-Id: I622e55622d38e6017993c8bc52625c85d0f74d74
2016-02-25 13:50:26 +02:00
Noel Grandin 4dd65f861d convert InternationalKeyCode to scoped enum
Change-Id: I2eba99ebb86003f1f5ddefafb4cd191b29853819
2016-02-25 13:50:25 +02:00
Noel Grandin 6a9046d02e convert ErrorCode to scoped enum
Change-Id: I37d2dd0b84fce229b548bbe941cfdd1169170af9
2016-02-25 13:50:24 +02:00
Andrea Gelmini 3f6da86e9f Fix typos
Change-Id: I13c3dc33722f139582f27412d5d336264d3d15a3
Reviewed-on: https://gerrit.libreoffice.org/18942
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-09-30 13:05:20 +00:00
Stephan Bergmann 32b6f11132 warning: nonterminal usesless in grammar
...ever since its use got removed in 17e1d9f46d
"INTEGRATION: CWS oj4"

Change-Id: I6494e11bb162d4c4bb880a6c4f9ece01331975dd
2015-09-03 10:10:20 +02:00
Stephan Bergmann d8bf4491b1 warning: nonterminal usesless in grammar
Change-Id: I97f3fb5cf62a68460157b2302a84d56a1417d376
2015-09-03 10:05:37 +02:00
Andrea Gelmini 5b1337f7b2 tdf#62475: partial handmade fixes
Change-Id: Ib9af202c43b916b9af4b4e18db35d470a8692fe4
Reviewed-on: https://gerrit.libreoffice.org/15712
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2015-05-15 17:55:15 +00:00
Julien Nabet ee12e843c6 fdo#84073: change ODBC/JDBC escapes to lowercase
Change-Id: I19ce3acb9575fbef8273bbd84cb4dc322e101ac8
2014-10-09 18:22:15 +02:00
Michael Stahl 86cd29772e remove HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY check and macro
This has been supported by GCC and clang for a very long time.

Change-Id: I410a2b39004c932003f8cbefe935aedb109b1163
2014-10-02 20:00:17 +02:00
Lionel Elie Mamane 325ce86b56 fix build & better name for ERROR_INVALID_TABLE
Change-Id: Ic7253575859766f18869159e4a8dd6b3d715850d
2014-09-26 16:27:53 +02:00
Noel Grandin ac10225762 implement --with-system-odbc on windows
Change-Id: I1757b9ce74277b1c11533f41caeafaf9b88658ef
2014-09-26 15:37:27 +02:00
Norbert Thiebaud a62a046df3 fdo#55703 automagically use IS NULL fo 'null' in query design.
Change-Id: I31bcec74a786df016d994834e6146fb7a76e72cb
2014-09-04 15:39:38 +02:00
Lionel Elie Mamane 3dd12b4a5c fdo#82427 disambiguate "NOT LIKE 'foo'"
Change-Id: Iab383639ea73cc87c03f4f42433bc9ccfcd988ef
2014-08-18 22:23:57 +02:00
Lionel Elie Mamane 32551a546c fdo#81336 bison priority increase with bigger number
Change-Id: Ib99f08c52379fd9df90c30b61cc246ee53022506
Reviewed-on: https://gerrit.libreoffice.org/10401
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
2014-07-19 07:45:30 +00:00
Lionel Elie Mamane b5997b9354 JOINs are left-associative
Change-Id: I24fdd2ce9bb87cc52a7c84ec8cd300bc13b11461
2014-07-03 15:44:11 +02:00
Michael Stahl 0de1e3a015 remove spurious com::sun::star::chaos
Apparently some time before inital CVS import a global
search-and-replace went horribly wrong and added spurious namespace
prefixes everywhere.

Change-Id: I4009bc3ab4b1d4c80412f75ad0e4628a382f99f0
2014-06-25 15:04:46 +02:00
Noel Grandin 39d3f2bb3a connectivity: sal_Bool->bool
Change-Id: Ice855d69c70d4f5fc119ddf1ddebf18ee6add270
2014-04-01 07:38:09 +02:00
Alexander Wilms ac9212feed Remove visual noise from connectivity
Conflicts:
	connectivity/source/inc/odbc/OConnection.hxx

Change-Id: I5ca98359e18cf1b27bf53037dde211774d798626
Reviewed-on: https://gerrit.libreoffice.org/8245
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2014-02-27 06:54:35 -06:00
Jelle van der Waa c69b6417af fdo#72598 Remove SunStudio cruft from code base
Change-Id: Ia6799c852eb95d496fbc8dcfdabde62dffc263a6
Reviewed-on: https://gerrit.libreoffice.org/7066
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2013-12-13 09:07:07 +00:00
Lionel Elie Mamane ee712dd696 fdo#72267 boolean_test is subsumed by general case "foo IS [NOT] bar"
Change-Id: Ie9666b1c8878dd26593629b4b64d74b7448f98c1
2013-12-07 21:35:57 +01:00
Stephan Bergmann 2fde764591 sqlbison.y string clean-up
Change-Id: I1ab32794a10f78f305de8057af5885d7719f87a3
2013-11-26 23:15:36 +01:00
Thomas Arnhold 7eb42bddb3 windows: warning 4706 is disabled globally in com_MSC_defs.mk
So there is no need to do this locally, too.

Change-Id: Ibc623235cae07a86dfd0dbc1d7672ca4273facec
2013-10-28 01:08:27 +01:00
Stephan Bergmann abb6ab4145 Fix warnings in sqlflex.l, sqlbison.y
Change-Id: I6c6b9452014940e09f8f4b7466c5a5f562c9fff5
2013-10-02 16:49:48 +02:00
Michael Stahl fac0354929 translate german comments in sqlbison.y
Change-Id: Ic573e5ae63fdfb3d4ff79eb6d81fe0f4b058d582
2013-09-13 14:56:32 +02:00
Michael Stahl 04e92a626e fix Apple g++ 4.2.1 unused function warning in sqlbison.y
Change-Id: Icc55a6b485341e3be0d3e96f51f41a2bba1629c1
2013-09-13 14:56:32 +02:00
Norbert Thiebaud 231cb07d0e connectivity bison/flex: get rid on unnecessary static OUString()
Change-Id: I06057fd5fddde278333bf3b65388c70d30b69d79
2013-07-11 22:34:19 -05:00
Tor Lillqvist a0c50b739c Further fallout from the connectivity SQL parser changes
A couple of headers now need to be public because they are indirectly
included in other modules.

Change-Id: Id01945197b67183a0a042e854289875ae147a0eb
2013-07-10 20:48:49 +03:00
Tor Lillqvist 986b39aa4f Avoid duplicate definition of xxx_pGLOBAL_SQLPARSER at linking stage
Change-Id: I29a3a68f9ee434332cad7199a90a1b01c22fbe0e
2013-07-10 20:48:49 +03:00
Tor Lillqvist 60a1254495 WaE: unused functions
Change-Id: Ie54546ef97fe102de09888ce9c7eefe6c879aae4
2013-07-10 20:48:49 +03:00
Lionel Elie Mamane 86ffbdcd40 make aEmptyString const
ensures nobody mistakenly modifies it, and makes other code get
a non-empty string where empty string is expected.

Change-Id: I477edd0e589444da19b68381234eb5e85ecd54cc
2013-07-10 18:15:14 +02:00
Lionel Elie Mamane f220c3913a make SQL grammar Generalised LR
This fixes parsing failures, like e.g.
warn:legacy.osl:30429:1:dbaccess/source/core/api/SingleSelectQueryComposer.cxx:783: OSingleSelectQueryComposer::getColumns: could not parse the column retrieval statement!
when opening query "Balance" of https://bugs.freedesktop.org/attachment.cgi?id=71964

OTOH, since we have reduce/reduce conflicts, we might have true
ambiguities in our grammar. This change makes the parsing fail
in the presence of full-expression ambiguities instead of making
a ~arbitrary choice.

Change-Id: I88574da91045dd52f198f193c78d144302f298a4
2013-07-10 03:15:12 +02:00
Lionel Elie Mamane fccfa69c15 remove unused const
Change-Id: I94c274e8afc70fa702063d61139299a7bde9165b
2013-04-26 16:49:49 +02:00
Lionel Elie Mamane 5fb4fe1b97 demote OSQLParser::RuleIDToRule failure to INFO
Change-Id: Ica2d3485c62f44311f612ade20924690bfbb2666
2013-04-15 11:52:39 +02:00
Lionel Elie Mamane d42b1afc4f janitorial: indentation
Change-Id: Icf3b500b9317cd45b3dc424da155ab6c48227ea5
2013-04-10 18:12:09 +02:00
Thomas Arnhold 488e6875e9 remove external include guards
Change-Id: If5758e02baa8e019923355b6c97043b306223fdd
2013-03-25 19:58:16 +01:00