summaryrefslogtreecommitdiff
path: root/connectivity
AgeCommit message (Collapse)Author
2018-01-12More loplugin:cstylecast: connectivityStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Idbefb16acae20ab137497e78c9bc5dc5634c07fe
2018-01-11loplugin:redundantcast: connectivityStephan Bergmann
(after a to-be-committed improved loplugin:cstylecast would have rewritten the C-style casts into static_casts) Change-Id: I43a148a0d192f85bbad95696c7c3c3e717c5b00a
2018-01-11connectivity: various small cleanups in the Writer driverMiklos Vajna
Change-Id: I91735c3e92262fd37966c53f973d5eee1522cd61 Reviewed-on: https://gerrit.libreoffice.org/47741 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-11(related:tdf#114939) connectivity: use real SHA1Michael Stahl
It looks like OConnectionWrapper::createUniqueId() doesn't really care what particular hash is used, it just wants to create something unique, so don't use the 'special' StarOffice SHA1 here. Change-Id: I817be900ecc9c6d686f21cce4a46f9eadd244b71
2018-01-11convert (a>b?a:b) to std::max(a,b)Noel Grandin
with something like: git grep -nP '(.*)\s*>\s*(.*)\s*\?\s*\g1\s*:\s*\g2' Change-Id: I60b9a3a2a09162bc0de4c13fdde2c209696e5413 Reviewed-on: https://gerrit.libreoffice.org/47602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-07fixup tdf#104986 move named parameters substitution into generic layerLionel Elie Mamane
remove now unused class member Change-Id: I30ffcf60833580a5f0029fa4efef80507d7918df Reviewed-on: https://gerrit.libreoffice.org/47524 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-07tdf#114495 ODBC: clear row status buffer *before* we throw away the statementJulien Nabet
Change-Id: I898e9d0e3e2cf1ed41489231d1cd761171bfcea4 Reviewed-on: https://gerrit.libreoffice.org/47514 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
2018-01-06Revert "tdf#114495: fix crash in odbc resultset dtr"Julien Nabet
This reverts commit 89e354eff9d99d05461e2892fb1af56d186b8653. Change-Id: I73435ba76d7d7ca7ebf91eeced470fb792786c92 Reviewed-on: https://gerrit.libreoffice.org/47513 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-06tdf#114495: fix crash in odbc resultset dtrJulien Nabet
See bt https://bugs.documentfoundation.org/attachment.cgi?id=138913 Regression from https://cgit.freedesktop.org/libreoffice/core/commit/?id=12d5e57dcac22c288ef23075b82e3e3e87929912 Change-Id: Ic079b87370207a1e51d747e250caea2bfcbc8c17 Reviewed-on: https://gerrit.libreoffice.org/47496 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-04tdf#104986 move named parameters substitution into generic layerLionel Elie Mamane
Previously, drivers were responsible for making the substitution themselves. In practice they all (Firebird, ODBC and JDBC) used the LibreOffice SQL parser to parse the SQL statement and do the substitution. This had a few negative consequences: * The substitition was applied to _all_ SQL commands, including queries having the "execute SQL directly" bit set. Which means that the SQL was _not_ sent to the DBMS exactly as typed by the user. Even if there was no substitution to be made, since the SQL command was always round-tripped through the parser, thus "normalising" it (which is what led to tdf#104986). * "execute SQL directly" queries "magically" behaved slightly differently depending on whether the LibreOffice SQL parser succeeded in parsing them or not. Change-Id: Ieedc643f33467435a139e2565a01e6f398af041f Reviewed-on: https://gerrit.libreoffice.org/47283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
2018-01-04firebird-sdbc: check parameter index before setting in all casesLionel Elie Mamane
Change-Id: I291b0436a7cfde07879436a753329b52ff0c1049 Reviewed-on: https://gerrit.libreoffice.org/47284 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
2018-01-04loplugin:unusedfieldsNoel Grandin
fix the ReturnStmt check Change-Id: I95076076bd1313d23798c4615ea12910c86ed9a8 Reviewed-on: https://gerrit.libreoffice.org/47309 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-02tdf#104986: Add MILLISECOND, WEEKDAY, and YEARDAY tokens for FirebirdTor Lillqvist
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-02tdf#71007: Pass also fractional seconds to/from FirebirdTor Lillqvist
We know that ISC_TIME is simply in units of seconds/ISC_TIME_SECONDS_PRECISION. Change-Id: I2896f53c2d32a773c535e19f55dd1314abd18ec9 Reviewed-on: https://gerrit.libreoffice.org/47266 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-01-01Related tdf#104942: implement setByte on firebirdJulien Nabet
There's no TINYINT or equivalent so let's do the same as setShort Change-Id: Ia1154ee068b02f40e7efa21571036d8b49844859 Reviewed-on: https://gerrit.libreoffice.org/47234 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-01Don't call getLength() on OUStringBuffer after makeStringAndClear()Tor Lillqvist
It's the length of the OUString that we just made from the OUStringBuffer that we want. Fixes a problem where the code would try to execute an erronoeus SQL statement like: ')EATE TABLE "Tasks" ("Notes" VARCHAR(32765),"TaskID" INTEGER,"EndDate" DATE,"StartDate" DATE,"Description" VARCHAR(65000),' Too lazy to file a bug for this, the error should be obvious by just reading the code. Change-Id: I473cd8a7a9791700ca8b6467a84f4bad5dee4d55 Reviewed-on: https://gerrit.libreoffice.org/47230 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-30coverity#1427009 Uninitialized scalar fieldCaolán McNamara
Change-Id: I372e9f7e286e2c563533c88205b7eb5ada1c02b4
2017-12-29loplugin:passstuffbyref improved return in variousNoel Grandin
Change-Id: I0a8282d8e0d9575b055243073fc89a7d6b67b560 Reviewed-on: https://gerrit.libreoffice.org/47173 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-29Fix typosAndrea Gelmini
Change-Id: I0e56430afa65b6b5826d56212ac501c0244fce9b Reviewed-on: https://gerrit.libreoffice.org/47145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-29Fix typosAndrea Gelmini
Change-Id: I3d16dc162e5fa2e08134d848a835eb392e64056e Reviewed-on: https://gerrit.libreoffice.org/47126 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-29loplugin:passstuffbyref improved return in ucb,connectivityNoel Grandin
Change-Id: Ib2590648c9dced87693a58a506cb62d04e37b18d Reviewed-on: https://gerrit.libreoffice.org/47149 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-28tdf#104734 Firebird: Add LONGVARBINARY/Image typeTamas Bunth
Implement it as a user-defined Blob subtype. Change-Id: Ia369b6858e7d9191f34032445c1003931273e926 Reviewed-on: https://gerrit.libreoffice.org/47098 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2017-12-28Firebird: use 32 bitTamas Bunth
Change-Id: I435524d1852a6691b382b93c9b6d2a7705938cd7 Reviewed-on: https://gerrit.libreoffice.org/47130 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2017-12-28tdf#104734 Firebird improve XClob implementationTamas Bunth
Create a more effective implementation of XClob::length() and XClob::getSubString() methods, where string is read segment-by-segment instead of reading the whole underlying blob. That way it is possible to handle big texts which would not fit into memory. Also allow reading Clob data from a resultset with getString() and writing it in a prepared statement with setString(). Implement XPreparedStatement::setClob(). Also implement a private version of setClob() for creating a clob from OUString: Allow the creation of a clob column with GUI by adding a new type in ODataBaseMetaData::getTypeInfo(). Change-Id: Ibcbbdd80e8eed5e2a3fe55b0fa196401f1bcbcdf Reviewed-on: https://gerrit.libreoffice.org/47093 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2017-12-28tdf#104734 Firebird: Add VARBINARY type to driverTamas Bunth
Change-Id: I9a1b3aa9bde855577078fe0db2e31a9c160031d7 Reviewed-on: https://gerrit.libreoffice.org/47092 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-12-28tdf#104734 Firebird: Add Binary (fix) typeTamas Bunth
There is no explicit binary type in Firebird. It can be accomplished using the CHAR type with a special character set, which tells the database that it is binary data and there is no collation. (called OCTETS). Because of that, we also need the character set to decide the exact column type. And also refactor some parts of the driver: - Create class to determine internal type from firebird type, subtype, scale and character set. - Use internal type (DataType::XXX) in XDatabaseMetaData::getTypeInfo() indirectly. (We want to return a Firebird type for each internal type, not in the opposite direction. Change-Id: Ica56a84d89253e11936e7012086fe1d9f61a65f0 Reviewed-on: https://gerrit.libreoffice.org/47091 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-12-28firebird: return consistent (if wrong...) results for XMultipleResultsLionel Elie Mamane
Just in case we are called by code not checking our DatabaseMetadata to learn we don't support multiple resultsets. Change-Id: I6d8c5f4ef04bcd9ec8b66a83881607281e125b7b Reviewed-on: https://gerrit.libreoffice.org/47117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-20inline typedefs in connectivity/StdTypeDefsNoel Grandin
Change-Id: I614833ed2418ff99057c7d496ddb64f06e8395db Reviewed-on: https://gerrit.libreoffice.org/46809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19remove unused typedefsNoel Grandin
Change-Id: I6fd7a9fed3a80c91a3766fceefd43c5db0aa5275 Reviewed-on: https://gerrit.libreoffice.org/46763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19inline use-once typedefsNoel Grandin
Change-Id: I5c3ffc03c26b3428f1f336e6ecba7838a1cf1157 Reviewed-on: https://gerrit.libreoffice.org/46764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-18loplugin:unusedindexMike Kaganski
Change-Id: I256a807dd2a4c81126b5a76f3d472e31b8224146 Reviewed-on: https://gerrit.libreoffice.org/46652 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-15loplugin:salcall (clang-cl)Stephan Bergmann
Change-Id: Idda630320bb5e02e1ea675b3b3786c9ec6ac166b Reviewed-on: https://gerrit.libreoffice.org/46504 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-15loplugin:salcall (macOS)Stephan Bergmann
Change-Id: Ie3454079f405df91280658e62f72b5108dfb7714 Reviewed-on: https://gerrit.libreoffice.org/46473 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-15loplugin:salcall (macOS)Stephan Bergmann
Change-Id: I297ac09358ce948acae9b73e8ed605964520c73b Reviewed-on: https://gerrit.libreoffice.org/46437 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-14No need to keep these whitelisted functions decorated with SAL_CALLStephan Bergmann
The only effect SAL_CALL effectively has on LO-internal code is to change non- static member functions from __thiscall to __cdecl in MSVC (where all other functions are __cdecl by default, anyway). (For 3rd-party code, it could be argued that SAL_CALL is useful on function declarations in the URE stable interface other than non-static member functions, too, in case 3rd-party code uses a compiler switch to change the default calling convention to something other than __cdecl. But loplugin:salcall exempts the URE stable interface, anyway.) One could argue that SAL_CALL, even if today it effectively only affects non- static member functions in MSVC, could be extended in the future to affect more functions on more platforms. However, the current code would already not support that. For example, 3af500580b1c82eabd60335c9ebc458a3f68850c "loplugin:salcall fix functions" changed FrameControl_createInstance in UnoControls/source/base/registercontrols.cxx to no longer be SAL_CALL, even though its address (in ctl_component_getFacrory, in the same file) is passed to cppuhelper::createSingleFactory as an argument of type cppu::ComponentInstantiation, which is a pointer to SAL_CALL function. Change-Id: I3acbf7314a3d7868ed70e35bb5c47bc11a0b7ff6 Reviewed-on: https://gerrit.libreoffice.org/46436 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-11loplugin:salcall fix functionsNoel Grandin
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11loplugin:unnecessaryparen (clang-cl)Stephan Bergmann
Change-Id: I2c5aa4c5c3a100de87d3f873b371dded994e4a7c Reviewed-on: https://gerrit.libreoffice.org/46200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-09Firebird: check isc_blob_info errorTamas Bunth
Change-Id: I398bf195a8cfebe081fd3034d6c539b02aaf6d73 Reviewed-on: https://gerrit.libreoffice.org/46148 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-09Firebird: Revert not closing cursor,..Tamas Bunth
..but suppress error of closing closed cursor Change-Id: I58f96f02f3f600a089bde361ed3e46a03a4902d4 Reviewed-on: https://gerrit.libreoffice.org/46141 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2017-12-09clean code at setObjectWithInfoTamas Bunth
Change-Id: I8cb4eaebd71d8b06523230954da15d73325ac94b Reviewed-on: https://gerrit.libreoffice.org/46130 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2017-12-09tdf#70425 do not close cursor explicitlyTamas Bunth
A cursor need only be closed in this manner if it was previously opened and associated with stmt_handle by isc_dsql_set_cursor_name() See Interbase API Guide: isc_dsql_free_statement Change-Id: Iadb0dcf83ee58b6196112c44d922528a3f56f7ea Reviewed-on: https://gerrit.libreoffice.org/46132 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-12-09tdf#70425 Firebird: accept integers in setDoubleTamas Bunth
Change-Id: I471197a9c60ca28b93be0974956e5e1d90f843ca Reviewed-on: https://gerrit.libreoffice.org/46125 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-12-07loplugin:salcall handle static methodsNoel Grandin
Change-Id: Id6820abec4b8ca8bee26d62b333fd30b42a14aec Reviewed-on: https://gerrit.libreoffice.org/46007 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-07loplugin:countusersofdefaultparams in connectivityNoel Grandin
Change-Id: Ia613257f2de1395c6629c1c37026ed48d4b927c8 Reviewed-on: https://gerrit.libreoffice.org/45854 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-06loplugin:salcall handle virtual methodsNoel Grandin
Change-Id: Iab95db31188ea2914a46d63a7ebef3d825e6ec42 Reviewed-on: https://gerrit.libreoffice.org/45851 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05Replace deprecated std::bin2nd with lambda in connectivityStephan Bergmann
(as std::bind2nd is gone by default at least from recent libc++ in C++17 mode) Change-Id: I344fe128fab0f57a2c5f2dfc8c097e1ab2406508 Reviewed-on: https://gerrit.libreoffice.org/45857 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-05loplugin:unnecessaryparenStephan Bergmann
Change-Id: Ib9eeb7d224b20622bafd96e123feb5aa97abac28 Reviewed-on: https://gerrit.libreoffice.org/45858 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-05Replace deprecated std::mem_fun et al in connectivityStephan Bergmann
(as std::mem_fun_t is gone by default at least from recent libc++ in C++17 mode) Change-Id: I74a7ff92385068cb4de1865921bd7c2509859b63 Reviewed-on: https://gerrit.libreoffice.org/45859 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-05loplugin:salcall fix non-virtual methodsNoel Grandin
first, since those are safer to change than virtual methods Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe Reviewed-on: https://gerrit.libreoffice.org/45798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05remove some unused definesNoel Grandin
and move the script to python Change-Id: I97bca04053d9d38b59c74fcf61caafbc2c137cc9 Reviewed-on: https://gerrit.libreoffice.org/45776 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>