460 Commits

Author SHA1 Message Date
Tor Lillqvist
60a1254495 WaE: unused functions
Change-Id: Ie54546ef97fe102de09888ce9c7eefe6c879aae4
2013-07-10 20:48:49 +03:00
Tor Lillqvist
911a229cc6 Undef SQLyyerror, too
Change-Id: Id80d373d93df140b8fc0d0d0c44044b94ceb97a9
2013-07-10 20:48:48 +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
9a34875667 compatibility with 2008-era bison (2.3)
Undo problematic pollution by sqlbison.hxx
Since with post-2008 (2.4 and later) bison that "#define SQLyylex"\is not active in sqlflex.l, this forces the situation	o be the same in all versions of bison, and should notreak anything by itself.

Change-Id: Ie65e3f6cc61dc97adc1d530e3781306ecd176b17
2013-07-10 18:08:39 +02:00
Lionel Elie Mamane
412c67a916 fix doubly-defined aEmptyStr with Bison 2.3
Change-Id: Ia54673f3e689a49b3e9101ae4cf5b57f1e68f592
2013-07-10 16:14:05 +02:00
Lionel Elie Mamane
83076c22e1 TODO note
Change-Id: I1b310119c08052949e975bfa3838e229d4e140b2
2013-07-10 03:15:13 +02:00
Lionel Elie Mamane
c9a8f238e0 remove bogus test
the TABLENAME property contains the *original* tablename, but this column should have the query table alias as table name

Change-Id: Ieeb362f38b701b92998e293dda474bad36e5e577
2013-07-10 03:15:12 +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
6eb9c378f4 fdo#58644 fix handling of subqueries
don't remove parentheses around subqueries
(without the parentheses, it is not valid SQL)

Change-Id: I4e9c55cea0276f10b0f97e31bc329949aba5b989
2013-07-10 03:15:11 +02:00
Michael Stahl
4296394d5c remove pointless external guards for standard headers
Change-Id: I509984a6029b6a86fd1ee3f947394af9cdf71c6a
2013-06-28 18:10:16 +02:00
Lionel Elie Mamane
2cfb215de6 impl_parseLikeNodeToString_throw should be called only on a like_predicate
Change-Id: I3597aadab8b13703ed7b7731d530320c4e5999be
2013-06-28 16:26:07 +02:00
Lionel Elie Mamane
ede7f6ae5f fdo#66130 correct "skip column name" condition for LIKE predicate
When converting a parse tree to SQL snippet for a predicate in the
context of a column, we skip the name of the same column in 'simple'
cases.

This is used mainly in the "Criterion" lines of query design,
and in the search/filter dialogs of forms, tables, etc.

In all other cases (such as when creating a full SQL command, or for
references to *other* columns than the context one), the column name
must be printed out.

In this respect, the condition "should we skip the column name?" in
impl_parseLikeNodeToString_throw was buggy, and different from the
one in the general case (in impl_parseNodeToString_throw), leading
to generating invalid SQL like:
 SELECT foo, bar FROM baz LEFT JOIN qux ON LIKE qux.quu
instead of
 SELECT foo, bar FROM baz LEFT JOIN qux ON baz.baa LIKE qux.quu

Change-Id: Ie14fce319554a66feb0fd0ce1a03d947a46a820a
2013-06-28 16:26:06 +02:00
Lionel Elie Mamane
ed9f838720 Revert "fdo#65653, fdo#65619, fdo#65216: Missing check"
This reverts commit 10777b37536be16c6d2e167b59e9e31e37ba3517.

The problem has been fixed in a more safe way by making columnMatchP
treat the case where rParam.xField is not set instead of requiring
it from all callers.

Change-Id: Ic68a764e08446a7b669c6030c2bcd55c7d31772b
2013-06-18 13:06:45 +02:00
Lionel Elie Mamane
20499497b0 fdo#65653 make columnMatchP safer
Change-Id: Id994ab5aed6172d8a93fd331a366fca10a663a48
2013-06-18 13:02:38 +02:00
Radu Ioan
dd3f8fbaff fdo#63690 - replace RTL_CONTEXT_ macros with SAL_INFO
- replaced RTL_CONTEXT_ with SAL_INFO
- replace OSL_* with SAL_*

Change-Id: If89af70767c3fdc4b1d0cb5e51033ca98583bc5d
Reviewed-on: https://gerrit.libreoffice.org/4286
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
2013-06-17 15:55:21 +00:00
Zolnai Tamás
10777b3753 fdo#65653, fdo#65619, fdo#65216: Missing check
Problem caused by commit:
16c9ce4877def18ca4578171a96615a632d08092
This commit contains code deduplication.
The deduplication removed one needed check (rParam.xFiled.is()),
which causes segfault when member function of rParam.xField
is called inside columnMatchP().

Change-Id: Ibbdaa758dbbce4b76094e6cc120022ef276b30c4
2013-06-15 11:02:32 +02:00
Caolán McNamara
2ae6f9d1d2 RHEL-5 baseline ver of flex doesn't have nounistd
lets try this hack, if it fails revert and I'll just
manually update the baseline with a newer flex than
flex-2.5.4a-41.fc6

Change-Id: If644489e80fc4e4cdba97808af0fe4d544d08646
2013-05-23 13:57:20 +01:00
Tor Lillqvist
cb6d67c21f Spelling "separate" (etc) correctly is hard 2013-05-15 11:14:28 +03:00
Michael Stahl
09373d4583 soltools: remove Package_inc and empty unistd.h nonsense
Change-Id: Ic05de69951b28b9cc8d62f0a534b507c424e6b25
2013-05-10 17:56:24 +02:00
Lionel Elie Mamane
a0b720c9fc remove never-generated "predicate_check" entry
Change-Id: Ib3957fbadf6bfebfaabd5bef09aaf7ab21862cd6
2013-04-26 16:49:50 +02:00
Lionel Elie Mamane
16c9ce4877 QueryDesign: in criteria, remove matching column_ref in simple expressions
Basically, in first children of infix predicates in search_conditions

Change-Id: I0e2f8fbdde023b088f33d2e2fcbd41110f0e02a8
2013-04-26 16:49:49 +02:00
Lionel Elie Mamane
fccfa69c15 remove unused const
Change-Id: I94c274e8afc70fa702063d61139299a7bde9165b
2013-04-26 16:49:49 +02:00
Lionel Elie Mamane
1bc4a49d9b QueryDesign: in criteria, remove column_ref when table *and* column name match
As opposed to only the column name

Change-Id: I261d13f23214f950daa55a5b63cd486e59a0e127
2013-04-26 16:49:48 +02:00
Lionel Elie Mamane
e9ae448b1e janitorial: indentation, spacing, ...
Change-Id: Ie794e91783f8eaacf236070e7cdeb5b5f4361e9b
2013-04-26 16:49:46 +02:00
Lionel Elie Mamane
e3d0f6ad11 sal_Bool -> bool
Change-Id: I157e0e84cbc9832dd863607b8f52359596b51c8c
2013-04-26 16:49:45 +02:00
Lionel Elie Mamane
6536d0eb4f reword comment
Change-Id: I13aaf37421c7652e8e293759e9f563fc76cb1344
2013-04-23 06:45:59 +02:00
Lionel Elie Mamane
5143e162f8 isEmpty() instead of getLength()==0
Change-Id: I610ecd58f3f7fa7f3ab04db8b17259bbc54c2b74
2013-04-23 06:45:58 +02:00
Olivier Ploton
f0c38b6355 Base: fix incorrect field removal in criterion inside query design view 2013-04-23 06:45:57 +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
86ef5f6f8c remove impossible case
nCount == 5 is impossible; the grammar has changed since this code was written.
It used to refer to case '(' joined_table ')' range_variable op_column_commalist
which has become just '(' joined_table ')'
which thus has (by definition) no table range (alias).

Case changed in mega-(merge-)commit:

commit c41efc6d0b2740be4243fd696385f8dbcec0aefe
Author: Jens-Heiner Rechtien <hr@openoffice.org>
Date:   Wed Nov 19 17:43:08 2008 +0000

    CWS-TOOLING: integrate CWS dba301a_DEV300

which seems to have done the other necessary adaptations to this code
and elsewhere.

Change-Id: I96ddbefbf34d6c155435b78aa9e5037a760232ed
2013-04-10 18:12:09 +02:00
Lionel Elie Mamane
d42b1afc4f janitorial: indentation
Change-Id: Icf3b500b9317cd45b3dc424da155ab6c48227ea5
2013-04-10 18:12:09 +02:00
Luboš Luňák
1946794ae0 mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).

Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-04-07 14:23:11 +02:00
Stephan Bergmann
aa753f01ba -Wunused-macros
Change-Id: Ifaa1637122d6f9cae1e29b77ac36ca5d1f220aed
2013-03-27 09:36:53 +01:00
Thomas Arnhold
488e6875e9 remove external include guards
Change-Id: If5758e02baa8e019923355b6c97043b306223fdd
2013-03-25 19:58:16 +01:00
Tor Lillqvist
aac64d030f Fix warning: unused variable 'aMutex' [loplugin]
Change-Id: I1dc2d18f285bbd7fc4316a7a194a21769b11d545
2013-03-25 21:44:13 +02:00
Stephan Bergmann
fa545023ad Introduce HAVE_GCC_PRAGMA_DIAGNOSTIC_{MODIFY,SCOPE}
...replacing hard-coded GCC version checks.  Those checks that guard

  #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"

appear relevant only for GCC itself, not Clang (which used to fail the old
guards because it typically announces itself with a rather low
__GNUC__/__GNUC_MINOR__ version), see 6e67c03dc0225fc66343546b14e902b9d238b1a3
"Enable -Wnon-virtual-dtor for GCC 4.6"

Change-Id: I6bfa4d5caa6192e7a203ce829682bf6bb8d61a1b
2013-03-25 08:52:54 +01:00
Julien Nabet
b0149eccbf coverity#704590 Explicit null dereferenced
Change-Id: I787a39959a1558fe4f284bc1941194a841e2d600
Reviewed-on: https://gerrit.libreoffice.org/2860
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2013-03-19 23:43:11 +00:00
Kohei Yoshida
f63423d585 Revert "cleanup sqlflex and sqlbison options"
This reverts commit b659d7c33fcacdbbef86557e78f071abf94bead2.

That commit appears to have broken the build on Linux. Reverting it
fixes it.

Change-Id: I70d62c04e9fb284ed2c360c0976d0cbeafc2ddc2
2013-03-15 23:11:33 -04:00
Peter Foley
b659d7c33f cleanup sqlflex and sqlbison options
Change-Id: I3f01636ef861828fdbe87e4057b6dc293ca63576
2013-03-15 21:19:13 -04:00
Thomas Arnhold
6dddefc6e7 fdo#43460: use isEmpty()
Change-Id: Ia768e684d3cf255239c04d024b35488830cc9fe6
2013-03-09 21:47:31 +01:00
Thomas Arnhold
4bf95c4c31 make use of startsWith()
Change-Id: Ie70097de550ddd1cddc6714f8f86f9723cb36679
Reviewed-on: https://gerrit.libreoffice.org/2599
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-03-08 13:16:49 +00:00
Lionel Elie Mamane
8f113d08ce coverity: merge traverse{OR,AND}Criteria into traverseSearchCondition
Meaning, these two functions have the same behaviour,
they produce the same output (and side-effects)
when called on the same input.

traverseORCriteria handles only the actual "foo OR bar" case,
and hands off all other cases to traverseANDCriteria.
But, lo and behold, traverseANDCriteria also handles
the "foo OR bar" case, in the same manner!

Change-Id: I10410e88ce48852b60d1d688fe2865923de9d80b
2013-03-04 11:09:25 +01:00
Thomas Arnhold
4f4e4e40f5 loplugin: improve indentation
Change-Id: Idb847766d93dc222d6c55889616da21eeac212ee
2013-02-25 17:59:40 +01:00
Thomas Arnhold
405caad685 loplugin: unused variables
Change-Id: I46a748bf2c54d15c0f5718901197f3b4c34b82bf
2013-02-25 03:14:00 +01:00
Lionel Elie Mamane
5214bda61e SQL parser: no "as" rule anymore; now as_clause and opt_as
Change-Id: Ib0c7151b311029318c213abb86e6541e3b27d040
2013-01-23 16:32:53 +01:00
Lionel Elie Mamane
09109f3dcd OSQLParser::RuleIDToRule should not silently change s_aReverseRuleIDLookup
Change-Id: I2b408a23162b1200bbcd530be7acb42435388b04
2013-01-23 16:32:52 +01:00
Lionel Elie Mamane
22fef9910e Make UNKNOWN_RULE the default value of connectivity::OSQLParseNode::Rule
Change-Id: I4e56da8820d5c92d3b6e2ff2c749bdc0cef46d73
2013-01-23 16:32:52 +01:00
Lionel Elie Mamane
c9a40d21fa When parsing does not give a table name, take it from the column
Change-Id: Ie8a2c7e473d717cc22c51205dd8cdc59934de8b1
2012-12-11 11:08:53 +01:00
Noel Grandin
b9a4a0b965 fdo#46808, Convert connectivity::SQLError to use XComponentContext...
...instead of comphelper::ComponentContext.

Change-Id: I40384c2d7cfcabd06506321d686dd8e7c7c5f266
2012-12-10 08:05:49 +02:00
Noel Grandin
0666e43c45 fdo#46808, use service constructor for i18n::CharacterClassification
Change-Id: I0499ad7de27b1539e97f01ab8aa0ef2d6713ae76
2012-11-05 18:05:00 +01:00