196 Commits
Author SHA1 Message Date
Vissarion Fisikopoulos 67b51abd65 tdf#42713: maintain SQL comments in design view
When an SQL query has comments then those were deleted
when switching to design view. This is fixed and the comments
are maintained. In the case the query is edited in design
view then the comments are inevitably lost.

Change-Id: Ibcf6e36fce88a526c7340d352aca9859b1b3714e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205441
Tested-by: Jenkins
Reviewed-by: Vissarion Fisikopoulos <vfisikop@libreoffice.org>
2026-06-09 16:11:29 +02:00
Julien Nabet 1137a2f025 Revert "tdf#159588: Query-GUI: LOWER isnt supported in Query-GUI if ...
This causes regression, see tdf#165458

This reverts commit 9530664d07.

Change-Id: Ic2be6ea3a41e1a22c9443a2fe8a0cae188bc6eb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182314
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2025-02-27 16:49:28 +01:00
Caolán McNamara f0c49bd155 cid#1633781 Initialization or destruction ordering is unspecified
and

cid#1633780 Initialization or destruction ordering is unspecified
cid#1633778 Initialization or destruction ordering is unspecified
cid#1633777 Initialization or destruction ordering is unspecified
cid#1633776 Initialization or destruction ordering is unspecified

Change-Id: I8ae7cbede6df2ad747fe57d0ac2800e1b6a31038
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175576
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-25 09:22:55 +02:00
Noel Grandin 19bc8856c4 move vcl::DeleteOnDeinit to tools
so we can fix a shutdown use-after-free in sot.

Change-Id: I32f83bd94627d72d7bee7ea2ebd6ab77a7f78435
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175335
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-22 08:01:19 +02:00
Julien Nabet 9530664d07 tdf#159588: Query-GUI: LOWER isnt supported in Query-GUI if condition is LIKE
Let's consider "SQL_TOKEN_LOWER" and "SQL_TOKEN_UPPER" as "string_function_1Argument"
like "SQL_TOKEN_LCASE" and "SQL_TOKEN_UCASE"

Change-Id: I288fd5f3d9e3d104345c73a060ba11d9701500a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163099
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-02-10 12:50:46 +01:00
jucasaca ccf30787a7 tdf#156534 Add Firebird's DATEADD function to SQL parser
Add DATEADD function to SQL parser, so the function can be used in
Query's Design and can produce  editable queries

Change-Id: I14f9d88f6a96021b0f9199fd79df18c8f4bb5ea3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155071
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-08-18 08:23:18 +02:00
jucasaca 42364fbfaf tdf#104918 Add Firebird's DATEDIFF syntax to the sql parser
Add one of the Firebird's DATEDIFF syntax to the parser so now it is possible to execute DATEDIFF(unit, datetime, datetime) in the
Base Query designer and don't need to execute it in SQL direct anymore

Change-Id: I0514542785c47a2a4693cba26de1815c96ee1b9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155027
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-08-07 23:38:50 +02:00
jucasaca f8a3126178 fixing a typo in sqlbison.y
schema_glement_list is not registered, son can't be used. schema_element_list is registered and defined and seems to be the correct

Change-Id: I7661532707ce6ddb32b95629192e9ba9847f21df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154766
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Lionel Mamane <lionel@mamane.lu>
Tested-by: Lionel Mamane <lionel@mamane.lu>
2023-07-22 21:48:13 +02:00
Julien Nabet 007ef352c2 Revert "tdf#155431: SQL Editor does not recognize UNSIGNED"
This reverts commit 408a51a964.

Reason for revert: I gave a new try, it indeed doesn't work, I must have missed something.

Change-Id: Ibf3318374cf68eaf093b9fa140b79beef2ddbd3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154546
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-07-18 11:26:46 +02:00
Julien Nabet 408a51a964 tdf#155431: SQL Editor does not recognize UNSIGNED
Change-Id: I2d618b27a92e1a85a6b7730aca3341f5259c4037
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152128
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-07-18 10:04:49 +02:00
Julien Nabet 77a2fe5a64 tdf#118817: add WEEK, WEEKDAY, YEARDAY AND MILLISECOND for EXTRACT
Change-Id: I912e9c2f8394f487dc3753d653f5a9ba19d7f416
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154524
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-07-17 19:54:28 +02:00
Noel Grandin e469a17183 wrap OSQLParser::s_xLocaleData in vcl::DeleteOnDeinit
since my adaption of i18npool to use OUStringLiteral, this
data structure might get torn down after the i18npool data is
has pointers to.

Change-Id: If83d232d5bfb003ed4dbfb70d47f707a73d2bcc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153121
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-15 18:39:31 +02:00
Noel Grandin b6977dad45 osl::Mutex->std::mutex in OSQLParser
Change-Id: Ibc56fee796914a6dd39970f7a7879d5b5b2c219f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148660
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-11 05:54:16 +00:00
Caolán McNamara 4616935555 cid#1500499 Resource leak
the only change should be to the two trailing cases in
OSQLParseNode::substituteParameterNames which do seem to leak.  The
closest I got to triggering the actual code is toggling into sqlview
mode of a query but couldn't quite construct a sql statement to trigger
it.

Change-Id: I320dc4df3b18a18b236c91ee30329c10001c9a08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140081
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-09-17 10:52:40 +02:00
jsala 9e7e95a57b tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change associated for by std::find_if in sqlbison.y
Also change some integer by std::size_t

Change-Id: I0d2100fbd7c22729da6ce0462c6cc093e0767fb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136263
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2022-09-04 20:04:23 +02:00
Caolán McNamara f6e24b10c9 cid#1500536 silence Resource leak
Change-Id: Ibd626a90136f89af731dc2bfa684d99609d44b90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138481
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-18 16:05:53 +02:00
Noel Grandin 5200a73627 use more string_view in various
found by examining uses of OUString::copy() for likely places

Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-01 08:30:18 +02:00
Caolán McNamara 77919edd1f cid#1497933 suppress Macro compares unsigned to 0
Change-Id: I7f06f889f2bd687028c00d79bdcf9e2edacc5c82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129601
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-08 12:44:33 +01:00
Stephan Bergmann 45227d9b79 Adapt to Bison 3.8 internal yyn -> yyrule rename
see
<https://git.savannah.gnu.org/cgit/bison.git/commit/?id=f30067ed51f23802fc91761ede1506dfa72b2865>
"glr2.cc: log the execution of deferred actions" including "Rename argument yyn
as yyrule for clarity."

YYBISON was defined as 1 rather than as a representation of the Bison version
prior to
<https://git.savannah.gnu.org/cgit/bison.git/commit/?id=21c147b6e5372563b7c4741deadaddb9354f4b09>
"yacc.c: provide the Bison version as an integral macro", which shouldn't be a
problem here.  And YYBISON is apparently completely undefined with
/usr/bin/bison on macOS.

(The preceding comment always mentioned "yyi" and "yyrmap" in apparent mismatch
with the actually used "yyn" and "yyr1" ever since
c25ec0608a "initial import", so just leave it
untouched.)

Change-Id: I4f901407aa21ed4abec84e661d813ee7599f02f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122082
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-14 14:53:38 +02:00
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