summaryrefslogtreecommitdiff
path: root/connectivity
AgeCommit message (Collapse)AuthorFilesLines
2019-11-20connectivity: avoid redundant access specifierMiklos Vajna1-1/+0
Change-Id: Id30b699dfdf561a42012e620db7cafabeab3ebc0 Reviewed-on: https://gerrit.libreoffice.org/83238 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-15make some classes module-privateNoel Grandin8-9/+9
Change-Id: I95845d7217fc5e77e3f8e205030e9cd761ad0cc5 Reviewed-on: https://gerrit.libreoffice.org/82116 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-14New loplugin:consttoboolStephan Bergmann2-6/+6
...to: "Find implicit conversions from non-'bool' constants (e.g., 'sal_False') to 'bool'". Due to how FALSE is defined as just #define FALSE (0) (i.e., a literal of type 'int') but TRUE is defined as #define TRUE (!FALSE) (i.e., an implicit conversion from 'int' to 'bool') in GLib (see the comment in ConstToBool::VisitImplicitCastExpr), we get more warnings about uses of 'TRUE' than of 'FALSE'. For example, in libreofficekit/source/gtk/lokdocview.cxx there is a warning about the 'TRUE' in g_main_context_iteration(nullptr, TRUE); but not about the 'FALSE' in g_main_context_iteration(nullptr, FALSE); (where the parameter of 'g_main_context_iteration' is of type 'gboolean'). Lets live with that asymmetry for now... (Besides the issues addressed directly in this commit, it also found the two bogus asserts at 7e09d08807b5ba2fd8b9831557752a415bdad562 "Fix useless assert(true) (which would never fire)" and 122a0be8ae480473bd1d7f35e197a2529f4621e3 "Fix useless assert(true) (which would never fire)", plus 5f0d6df7f57ae281fe161e61c7f25d67453fddd2 "Use two-argument form of static_assert".) Change-Id: Id77322de9f94b85a7b65608a03e0e9865d14467b Reviewed-on: https://gerrit.libreoffice.org/82667 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-13Extend loplugin:salbool to loplugin:fakeboolStephan Bergmann8-29/+29
...checking for unnecessary uses of more "fake bool" types. In the past, some of the checks involving the types of variables or data members, or the return types of functions, issued warnings that required surrounding code to be changed too (e.g., when changing the signature of a function whose address was taken). These checks have been tightened now to not warn in such cases (which avoids warnings that require changes to additional code, or changes that might even be impossible to make, at the cost of being less aggressive about removing all unnecessary uses of those "fake bool" types). Change-Id: I70eb75039817cda34ed611387ee27dc5f36a3e2e Reviewed-on: https://gerrit.libreoffice.org/82554 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-12use std::move when popping stuff off stacksNoel Grandin1-3/+3
Change-Id: I6ba0ee8afee1a9579045643cd0118cf19599d5b9 Reviewed-on: https://gerrit.libreoffice.org/82497 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-11rename a PCH file to properly match its MakefileLuboš Luňák3-2/+2
Change-Id: I61f317f4cc31d329452a08b6cee5f59975fea007 Reviewed-on: https://gerrit.libreoffice.org/82398 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-11-08loplugin:stringadd (clang-cl)Stephan Bergmann1-2/+1
Change-Id: Icf2894f77c90aa4620910d621249947bad4be8b7 Reviewed-on: https://gerrit.libreoffice.org/82269 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-06Base/Firebird fix column creationJulien Nabet1-1/+0
Avoid these logs when saving a brand new table in embedded Firebird: warn:legacy.osl:6038:6038:comphelper/source/property/propertycontainerhelper.cxx:181: OPropertyContainerHelper::implPushBackProperty: name already exists! warn:legacy.osl:6038:6038:comphelper/source/property/propertycontainerhelper.cxx:182: OPropertyContainerHelper::implPushBackProperty: handle already exists! ... Change-Id: I305791ad14d0bd18b3a527b848c031e02d661dbb Reviewed-on: https://gerrit.libreoffice.org/81926 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-11-04Build mysql_jdbc library even when building without javaTamas Bunth1-0/+1
Change-Id: Iecf49ab466a77f8342e69bf245a30e1529fe0078 Reviewed-on: https://gerrit.libreoffice.org/79056 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/81917 Tested-by: Jenkins
2019-11-03mysqlc: replace initializer list with assignmentTamas Bunth1-17/+23
Because visual c++ compiler may not support it without creating a constructor for the struct. Change-Id: I6c8868c4e34cbe7b67e413b1db18aed01378c959 Reviewed-on: https://gerrit.libreoffice.org/65905 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/76727 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tamás Bunth <btomi96@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/81901 Tested-by: Jenkins
2019-10-31Fix StringAdd::isCompileTimeConstantStephan Bergmann1-2/+2
...to find StringLiteral on the RHS of +=. Which revealed that the VisitCompoundStmt/checkForCompoundAssign logic needed to be fixed, too, so that s += side_effect(); s += "literal"; s += side_effect(); only gets combined to s += side_effect() + "literal"; s += side_effect(); and not all the way to s += side_effect() + "literal" + side_effect(); Change-Id: I432e3458b933a7d0ad6141c747b675cc8b0f0ba4 Reviewed-on: https://gerrit.libreoffice.org/81804 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-26size some stringbuffer to prevent re-allocNoel Grandin1-5/+5
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512 (e.g. in emfio/). Change-Id: Ib7caf35a1b7e42b0e4ed8aa812493449e3eefc8f Reviewed-on: https://gerrit.libreoffice.org/81540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:stringadd (macOS)Stephan Bergmann1-1/+1
Change-Id: Ic9c23fcda4c798c1ca2de5a010da292d56b10e8b Reviewed-on: https://gerrit.libreoffice.org/81201 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-21loplugin:bufferadd (macOS)Stephan Bergmann1-5/+1
Change-Id: I97822e6843d6adef1af2435e186ac93d016e5322 Reviewed-on: https://gerrit.libreoffice.org/81202 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-19mariadb still uses char for my_boolCaolán McNamara1-1/+1
mariadb-devel-10.3.17-1.fc30.x86_64 still has typedef char my_bool; Change-Id: I3d1f5423c8750180bc28c56bc0ead4f746fd1c23 Reviewed-on: https://gerrit.libreoffice.org/81137 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák8-11/+39
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-18Fix building against MySQL Connector/C 8Peter Levine1-2/+8
In MySQL Connector/C 8, my_bool is replaced by bool. It was previously defined as char. When building against MySQL Connector/C 8, this leads to type punning build errors. Redefine affected members of struct BindMetaData as bool if using version 8 of greater. Otherwise, default to char. Change-Id: If12b975d95afae86502867cb334cb4195802f91d Reviewed-on: https://gerrit.libreoffice.org/81002 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-10-17loplugin:buffereadd find stuff involving adding *StringBufferNoel Grandin1-10/+6
and create conversion methods on *StringBuffer to make this work Change-Id: I3cf5ee3e139826168894b46eff8ee4bcde00cb7e Reviewed-on: https://gerrit.libreoffice.org/80949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-17Remove some memset callsMike Kaganski7-20/+9
Replace them with default initialization or calloc Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1 Reviewed-on: https://gerrit.libreoffice.org/80805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Remaining loplugin:bufferaddStephan Bergmann7-134/+56
...that had been missing because the plugin didn't implement postRun, so it didn't report anything when run as part of the shared plugin. (But did report the expected warnings when run as a standalone plugin during CompilerTest_compilerplugins_clang.) Most fixes are straightforward. A noteworthy one is PreparedStatement::setBytes in connectivity/source/drivers/postgresql/pq_preparedstatement.cxx: The old preallocation of a 20 character OStringBuffer might have prevented buf.append( reinterpret_cast<char *>(escapedString), len -1 ); from potentially throwing std::bad_alloc, which would have caused escapedString to be leaked. Even though that 20-character preallocation was likely just random junk and not meant to address the potential leak, lets address it now. Change-Id: Ib506332d061684a22a74e5e39e591539fd2c4900 Reviewed-on: https://gerrit.libreoffice.org/80925 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann3-5/+5
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-15new loplugin:bufferaddNoel Grandin6-36/+25
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-15Replace getDefaultValue by getColExprForDefaultSettingVal (postgresql)Julien Nabet4-4/+4
Change-Id: I8e0eea84a711ce45d991c07d7811094e33bcce38 Reviewed-on: https://gerrit.libreoffice.org/80787 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-10-14use common PCH for more librariesLuboš Luňák1-0/+2
Change-Id: I53164be413426691025a63cfba731cf5f9d1b7f8 Reviewed-on: https://gerrit.libreoffice.org/80790 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-14loplugin:stringadd look for unnecessary temporariesNoel Grandin1-1/+1
which defeat the *StringConcat optimisation. Also make StringConcat conversions treat a nullptr as an empty string, to match the O*String(char*) constructors. Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b Reviewed-on: https://gerrit.libreoffice.org/80724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-13tdf#128111: "adsrc" doesn't exist from Postgresql 12Julien Nabet4-7/+18
Before Postgresql 8.0, there was only "adsrc" then it's been deprecated "The adsrc field is historical, and is best not used, because it does not track outside changes that might affect the representation of the default value. Reverse-compiling the adbin field (with pg_get_expr for example) is a better way to display the default value " and finally it's been removed with version 12 See evolution with: - https://www.postgresql.org/docs/8/catalog-pg-attrdef.html - https://www.postgresql.org/docs/11/catalog-pg-attrdef.html - https://www.postgresql.org/docs/12/catalog-pg-attrdef.html Change-Id: I57e9da423a23b5a96bbb64b0e026b160e9643ab9 Reviewed-on: https://gerrit.libreoffice.org/80722 Tested-by: Jenkins Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
2019-10-11simplify "a = a +" to "a +="Noel Grandin3-5/+5
mostly so that my stringadd loplugin can point out places to improve Change-Id: I9920ee1c99cdb6b811ba67ff9d8e32aa261884b5 Reviewed-on: https://gerrit.libreoffice.org/80618 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-10convert WriteCharPtr..getStr to WriteOStringNoel Grandin1-1/+1
and improve the WriteOString method, we can avoid the strlen here, we already have the length One change in behaviour to be noted - if the string contains trailing zero bytes, which ARE INCLUDED IN THE STRING LENGTH, i.e. I'm not talking about the normal terminating zero, then this patch changes behaviour because we will now write those zeros to the stream. Change-Id: I4668b9b9eb877f820b1dc70d6cd10ba2623bc0a2 Reviewed-on: https://gerrit.libreoffice.org/80597 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-09Resolve FIXME Decimal Separator should be OUString (connectivity/dbaccess/svx)Julien Nabet2-13/+14
instead of a sal_Char Change-Id: I14fd983dac7ceb83a788c26dd4ea9d1c87444c9a Reviewed-on: https://gerrit.libreoffice.org/80493 Tested-by: Jenkins Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-10-09loplugin:redundantpointerops check other pointer typesNoel Grandin1-1/+1
as well as unique_ptr Change-Id: I54842bca161ee460fb96c46ca31b6f9c0a7dbbdf Reviewed-on: https://gerrit.libreoffice.org/80455 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08loplugin:stringadd (macOS)Stephan Bergmann1-3/+3
Change-Id: I4dde1fa6f1f3e6d75abe5002655d3cd5fa685c0b Reviewed-on: https://gerrit.libreoffice.org/80487 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-07enable -Wrange-loop-analysis on clangNoel Grandin1-3/+3
Change-Id: I2095308943c94ad16c110d5fac47715398eb5d39 Reviewed-on: https://gerrit.libreoffice.org/80187 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01loplugin:redundantcast (clang-cl)Stephan Bergmann2-2/+2
Change-Id: I3f66a7850b4604dee576aeb61a39c4e45563d0c1 Reviewed-on: https://gerrit.libreoffice.org/79930 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:data (clang-cl)Stephan Bergmann1-1/+1
Change-Id: Ib8b2bc1c5f7b27a646036ce23cae2b6a06edd038 Reviewed-on: https://gerrit.libreoffice.org/79922 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:stringconstant (clang-cl)Stephan Bergmann2-2/+2
Change-Id: Id1a82cea4444255fdb693e126b7571a406094624 Reviewed-on: https://gerrit.libreoffice.org/79916 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:simplifyconstruct (clang-cl)Stephan Bergmann1-1/+1
Change-Id: I08da288a88c2bce1d4250ec77f17bd483e6bc09c Reviewed-on: https://gerrit.libreoffice.org/79911 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:stringadd in basctl..cuiNoel Grandin6-14/+6
Change-Id: I2fdeb7eb3ead3512ad6d3fe793305038ab3aa7ae Reviewed-on: https://gerrit.libreoffice.org/79886 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-24support O(U)String::number() for fast string concatenationLuboš Luňák2-2/+2
When I did the fast string concatenation, I didn't add any support for number(), which simply returned a O(U)String, and so it did the extra allocation/deallocation, although that could be avoided. In order to support this, number() now returns a special temporary return type, similarly to O(U)StringConcat, which allows delaying the concatenation the same way. Also similarly, the change of the return type in some cases requires explicit cast to the actual string type. Usage of OString::getStr() is so extensive in the codebase that I actually added it to the helper class, after that it's only relatively few cases. Change-Id: Iba6e158010e1e458089698c426803052b6f46031 Reviewed-on: https://gerrit.libreoffice.org/78873 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-23tdf#39593 use getUnoTunnelImplementationArkadiy Illarionov7-104/+76
Change-Id: I78eb67913a568c610e38e5002f914773c4906dfd Reviewed-on: https://gerrit.libreoffice.org/79350 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-09-23loplugin:fragiledestructor (macOS)Stephan Bergmann2-2/+17
Change-Id: I908a7dbdb44c0b49315f0fd8559c21302dbc83a8 Reviewed-on: https://gerrit.libreoffice.org/79399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák11-11/+11
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-23tdf#127657: FIREBIRD error in query input param when referred field is integerJulien Nabet1-0/+14
Change-Id: I626c8a8869570986d0293cd9070a1ee40ec585dc Reviewed-on: https://gerrit.libreoffice.org/79314 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-19improve and enable loplugin:fragiledestructorNoel Grandin6-10/+8
Where the problem was benign and the class was not extended, I marked the class as final. Where the problem was benign and the class was extended, I marked the relevant callee methods as final. Other cases were excluded in the plugin. Change-Id: Idb762fb2206af4e8b534aa35ff77f8368c7909bc Reviewed-on: https://gerrit.libreoffice.org/79089 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-17tdf#126852 Bind TEXT mysql type to ClobTamas Bunth1-1/+3
Change-Id: I5a71666f1fafa9507032deffafebf885813a0369 Reviewed-on: https://gerrit.libreoffice.org/78815 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-09-12cid#1453559 silence Unchecked return valueCaolán McNamara2-2/+2
cid#1453560 silence Unchecked return value cid#1453562 silence Unchecked return value Change-Id: I6b7dc42d6f2ebd8abb47fb71805c66c7f45d7748 Reviewed-on: https://gerrit.libreoffice.org/78838 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-09-12base: add some doc from Tomi's talkMiklos Vajna1-0/+1
See <https://conference.libreoffice.org/2019/program/schedule/sept-12th-thursday/>. Change-Id: I0edb74d69f6af06c82022350e2fe0aedab56c486 Reviewed-on: https://gerrit.libreoffice.org/78832 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-09-11tdf#120945: Relationship of tables isn't recognized by formwizardJulien Nabet2-10/+14
The patch implements getExportedKeys which was lacking. Console logs: warn:connectivity.firebird:13144:18512:connectivity/source/drivers/firebird/DatabaseMetaData.cxx:1468: Not yet implemented warn:legacy.osl:13144:18512:connectivity/source/drivers/firebird/DatabaseMetaData.cxx:1469: Not implemented yet! The only difference with getImportedKeys is the fact that : - in getImportedKeys, table name of Where condition is the foreign key - in getExportedKeys, table name of Where condition should be the primary key Instead of duplicating the whole code of getImportedKeys, I created a local function which contains the main part. Change-Id: Ia4497524fecf098257eec27e44e016a7cbe23480 Reviewed-on: https://gerrit.libreoffice.org/78822 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-07tdf#39593 drop comphelper::getImplementationArkadiy Illarionov8-8/+15
Replace with comphelper::getUnoTunnelImplementation. Change-Id: I96277aa9c17532ea6e2781dbc3305b2dbaa4e5c2 Reviewed-on: https://gerrit.libreoffice.org/78733 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-09-07tdf#39593 use isUnoTunnelId in connectivityArkadiy Illarionov24-35/+45
Change-Id: I458049e23e9fc1855cb4ba9519b9b940f170b024 Reviewed-on: https://gerrit.libreoffice.org/78732 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-09-06mysqlc: Support connection to utf8mb4 serverTamas Bunth1-1/+3
This charset is backward compatible with 'normal' utf-8. Change-Id: I4407894bf9029b9c56eb0d2530796e85bd226591 Reviewed-on: https://gerrit.libreoffice.org/78650 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>