Commit Graph

141 Commits

Author SHA1 Message Date
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
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
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 10777b3753.

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:
16c9ce4877
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
Tor Lillqvist
cb6d67c21f Spelling "separate" (etc) correctly is hard 2013-05-15 11:14:28 +03: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
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
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 c41efc6d0b
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
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
Tor Lillqvist
aac64d030f Fix warning: unused variable 'aMutex' [loplugin]
Change-Id: I1dc2d18f285bbd7fc4316a7a194a21769b11d545
2013-03-25 21:44:13 +02:00
Thomas Arnhold
6dddefc6e7 fdo#43460: use isEmpty()
Change-Id: Ia768e684d3cf255239c04d024b35488830cc9fe6
2013-03-09 21:47:31 +01:00
Thomas Arnhold
4f4e4e40f5 loplugin: improve indentation
Change-Id: Idb847766d93dc222d6c55889616da21eeac212ee
2013-02-25 17:59:40 +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
22fef9910e Make UNKNOWN_RULE the default value of connectivity::OSQLParseNode::Rule
Change-Id: I4e56da8820d5c92d3b6e2ff2c749bdc0cef46d73
2013-01-23 16:32:52 +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
Stephan Bergmann
03a9f139bd ComponentContext::getUnoContext -> getComponentContext simplification
...and some further clean-up.

Change-Id: If5dce53e382b56390c502d0d0d93fc06cbfe33ea
2012-09-19 13:16:38 +02:00
Noel Grandin
369e3fdcda fdo#46808, Adapt i18n::LocaleData UNO service to new style
The implementation of the LocaleData implements the optional XLocaleData4,
so rather than creating a new interface for the new-style service, we simply
make the service implement XLocaleData4, which in turn implements
XLocaleData3, XLocaleData2, XLocaleData.

Change-Id: I3e9a48b031be6b2aa5e04b376b3940b942add85a
2012-09-17 14:28:21 +02:00
Lionel Elie Mamane
cc430308c3 Put functions exported by sqlbison.hxx into a .hxx file
Change-Id: Ibf4fed39e4d36cb03d079cf55a12d4ec37a70f2b
2012-08-21 19:30:18 +02:00
Christophe JAILLET
df645a2bd8 There is not need to allocate memory just for getting the 'indexOf'
a literal within a OUString.

Change-Id: I01ca30c68228f81b3d313dfca5b975448f3c4fc7
2012-07-16 11:33:05 +01:00
Christophe JAILLET
a767448225 Search for char instead of 1 char long string, when possible.
It is faster and even avoid memory allocation somtimes.

Change-Id: Ic12ff70e95953de44ef5798131150669d07a5445
2012-07-13 16:36:04 +02:00
Caolán McNamara
887fc099c1 update unused code list
Change-Id: I8845df6193233b268b5cce958fea9f25625c7025
2012-06-27 16:44:07 +01:00
Michael Meeks
ddaf53acd4 re-base on ALv2 code. 2012-06-12 22:24:55 +01:00
Thomas Arnhold
3770bbbdba Remove superfluous empty lines on top
More than two lines are removed for readability.

Change-Id: Ibff6cf68d7c512e240a54065b54a225bb23a782b
2012-06-09 04:57:58 +02:00
Norbert Thiebaud
19f38b6fab targeted string re-work
Change-Id: I2db379d3aeb22d29aec3ae4079314f75873790dc
2012-06-02 09:42:47 -05:00
Michael Meeks
6e6d81e9cf targetted SAL_N_ELEMENTS reversion.
Change-Id: I30be93ccaeb1f9fd17cbe9e3ed3165e094810b2e
2012-05-29 18:03:34 +01:00
Takeshi Abe
01dc468f3d removed unused temporary rtl::OUString
Change-Id: I81e04b1b71b8ee5a903185b6857e8cf91b67eed1
2012-05-21 22:08:17 +09:00
Santiago Martinez
10e92b820d Remove unused code in sqlnode 2012-03-29 13:16:12 +01:00
Takeshi Abe
86647a1873 removed duplicate includes in connectivity 2012-03-29 10:44:49 +09:00
Philipp Weissenbacher
d1e5860bc0 Translate German comments. 2012-03-01 14:54:18 +05:30
Olivier Hallot
1777c09a07 Fix for fdo43460 Part IX getLength() to isEmpty()
Part IX
Module
connectivity
2011-12-17 16:36:00 +04:00
Michael T. Whiteley
dcfd4beb21 childs -> children 2011-12-08 11:32:41 +02:00
August Sodora
443a7229f9 Remove uses of charAt 2011-12-01 11:10:28 +01:00
Norbert Thiebaud
3c43177528 remove include of pch header in connectivity 2011-11-27 13:02:11 -06:00
Caolán McNamara
705e5fe947 callcatcher: remove some unused code 2011-11-19 21:11:01 +00:00
Tor Lillqvist
1967376c7b WaE: deletion of pointer to incomplete type; no destructor called
Move the struct OSQLParser_Data definition to the sqlparse.hxx
header. A somewhat ugly workaround for warning C4150: deletion of
pointer to incomplete type 'connectivity::OSQLParser_Data'; no
destructor called.
2011-10-04 18:51:13 +03:00
Thorsten Behrens
f51c3f66b1 Merge commit 'ooo/DEV300_m106' into integration/dev300_m106
Conflicts:
	avmedia/source/gstreamer/gstframegrabber.cxx
	avmedia/source/gstreamer/gstplayer.cxx
	avmedia/source/gstreamer/gstplayer.hxx
	basic/inc/basic/sbxdef.hxx
	basic/source/classes/sbxmod.cxx
	basic/source/comp/makefile.mk
	basic/source/comp/sbcomp.cxx
	basic/source/inc/namecont.hxx
	basic/source/inc/scriptcont.hxx
	basic/source/runtime/methods.cxx
	basic/source/runtime/runtime.cxx
	basic/source/runtime/stdobj.cxx
	basic/source/runtime/step1.cxx
	basic/source/uno/namecont.cxx
	basic/util/makefile.mk
	connectivity/source/commontools/predicateinput.cxx
	connectivity/source/drivers/dbase/DNoException.cxx
	connectivity/source/drivers/dbase/DTable.cxx
	connectivity/source/drivers/file/fcomp.cxx
	connectivity/source/drivers/jdbc/JConnection.cxx
	connectivity/source/drivers/odbcbase/OResultSet.cxx
	connectivity/source/drivers/odbcbase/OStatement.cxx
	connectivity/source/parse/sqlnode.cxx
	desktop/source/app/app.cxx
	drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
	drawinglayer/source/processor2d/vclprocessor2d.cxx
	formula/inc/formula/token.hxx
	formula/source/core/api/token.cxx
	fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
	fpicker/source/win32/filepicker/platform_vista.h
	framework/source/helper/persistentwindowstate.cxx
	framework/source/uielement/menubarmanager.cxx
	oovbaapi/ooo/vba/XFoundFiles.idl
	oovbaapi/ooo/vba/excel/XApplication.idl
	oovbaapi/ooo/vba/msforms/XCheckBox.idl
	oovbaapi/ooo/vba/msforms/XComboBox.idl
	oovbaapi/ooo/vba/msforms/XControl.idl
	oovbaapi/ooo/vba/msforms/XGroupBox.idl
	oovbaapi/ooo/vba/msforms/XLabel.idl
	oovbaapi/ooo/vba/msforms/XListBox.idl
	oovbaapi/ooo/vba/msforms/XNewFont.idl
	oovbaapi/ooo/vba/msforms/XRadioButton.idl
	oovbaapi/ooo/vba/msforms/XTextBox.idl
	oovbaapi/ooo/vba/msforms/XToggleButton.idl
	scripting/source/dlgprov/dlgevtatt.cxx
	sfx2/source/control/unoctitm.cxx
	sfx2/source/doc/objstor.cxx
	sfx2/source/doc/objxtor.cxx
	svx/inc/svx/svdograf.hxx
	svx/source/form/fmpage.cxx
	svx/source/form/fmpgeimp.cxx
	svx/source/svdraw/svdedtv.cxx
	svx/source/svdraw/svdfmtf.cxx
	svx/source/svdraw/svdograf.cxx
	svx/source/svdraw/svdouno.cxx
	svx/source/xml/xmlgrhlp.cxx
	uui/source/iahndl-ssl.cxx
	vbahelper/Library_msforms.mk
	vbahelper/Library_vbahelper.mk
	vbahelper/inc/vbahelper/vbahelper.hxx
	vbahelper/prj/build.lst
	vbahelper/source/msforms/vbacombobox.cxx
	vbahelper/source/msforms/vbacontrol.cxx
	vbahelper/source/msforms/vbacontrols.cxx
	vbahelper/source/msforms/vbaframe.cxx
	vbahelper/source/msforms/vbaframe.hxx
	vbahelper/source/msforms/vbalabel.cxx
	vbahelper/source/msforms/vbalabel.hxx
	vbahelper/source/msforms/vbalistbox.cxx
	vbahelper/source/msforms/vbalistbox.hxx
	vbahelper/source/msforms/vbamultipage.cxx
	vbahelper/source/msforms/vbatogglebutton.cxx
	vbahelper/source/msforms/vbauserform.cxx
	vbahelper/source/vbahelper/vbacommandbar.cxx
	vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
	vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
	vbahelper/source/vbahelper/vbahelper.cxx
	vbahelper/source/vbahelper/vbawindowbase.cxx
	xmloff/source/meta/xmlmetai.cxx
	xmloff/source/style/PageMasterExportPropMapper.cxx
	xmloff/source/style/PageMasterStyleMap.cxx
	xmloff/source/text/txtexppr.cxx
	xmloff/source/text/txtprmap.cxx
2011-04-28 00:12:58 +02:00
Francisco Saito
e60d365c86 drop bogus executable flag from [ch]xx/bas/asm files 2011-03-29 21:40:28 +01:00