summaryrefslogtreecommitdiff
path: root/connectivity
AgeCommit message (Collapse)AuthorFilesLines
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>
2019-09-06tdf#39593 use isUnoTunnelIdArkadiy Illarionov27-49/+55
Adapt getUnoTunnelId methods where required: rename or make public. Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315 Reviewed-on: https://gerrit.libreoffice.org/78680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-06TyposAndrea Gelmini17-22/+22
Mainly fixing '....' and '..' Change-Id: Ic928701b319868671b826d757dd94c296fd5e942 Reviewed-on: https://gerrit.libreoffice.org/78668 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-03tdf#127093 mysqlc: set NO_AUTO_VALUE_ON_ZEROTamas Bunth1-1/+2
Without setting this sql_mode, NULL or 0 inserted to an auto-incremented column of a prepared statement would cause that to be auto generated. Setting NO_AUTO_VALUE_ON_ZERO allows us to copy/paste auto-incremented columns which may contain zero values as well. Change-Id: I9602746371c75c82c99ff63240025e8cfb03776a Reviewed-on: https://gerrit.libreoffice.org/78560 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-09-01Fix '..'Andrea Gelmini1-1/+1
To complete this: https://gerrit.libreoffice.org/#/c/78312/ This is a massive replace for ".." instead of "..." between words. It passed "make check" on Linux. Change-Id: I144d8061fca9f545c762941551e59dffdd3650e8 Reviewed-on: https://gerrit.libreoffice.org/78357 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-09-01Fix '..'Andrea Gelmini1-1/+1
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-08-31mysqlc: Implement DatabaseMetadata::getUserNameTamas Bunth1-3/+13
Change-Id: Id3518a049a55d64e7272d265f22e930881a70161 Reviewed-on: https://gerrit.libreoffice.org/78296 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-08-31Related tdf#118809: add some XDatabaseMetaData for FirebirdJulien Nabet1-3/+8
getStringFunctions getTimeDateFunctions getNumericFunctions Thank you Drew Jensen for suggestion (see https://bugs.documentfoundation.org/show_bug.cgi?id=118809#c4) Change-Id: I1e3b7d9559f4e520260de39ee4b8ad078cc80c87 Reviewed-on: https://gerrit.libreoffice.org/78337 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-31tdf#118809: Fill DatabaseProductName and DatabaseProductVersion for FirebirdJulien Nabet1-2/+7
Thank you to Drew Jensen for the suggestion here: https://bugs.documentfoundation.org/show_bug.cgi?id=118809#c3 Change-Id: Ie9b5a2c744b158100b2306b27b1d56a30afc5182 Reviewed-on: https://gerrit.libreoffice.org/78302 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-30new loplugin:noexceptmoveNoel Grandin1-1/+1
idea from mike kaganski look for places where we can mark move operators as noexcept, which makes some STL operations more efficient Change-Id: Id732b89d1fcadd5ceb0ea2b9d159fed06136330f Reviewed-on: https://gerrit.libreoffice.org/78251 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-27loplugin:referencecasting find more redundant static_castNoel Grandin2-2/+2
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae Reviewed-on: https://gerrit.libreoffice.org/78191 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-25Fix build on big-endian platforms with clangMike Kaganski1-1/+1
Reportedly, this builds OK with gcc, but not with clang (rightfully). /tmp/usr/ports/editors/libreoffice/work/libreoffice-6.3.0.4/connectivity/source/drivers/odbc/OTools.cxx:148:21: error: arithmetic on a pointer to void _pValue += _nSize - properSize; ~~~~~~~ ^ 1 error generated. The pointer arithmetics on void* was introduced in 2012 in commit 63b6b1d6120d82c4baf5cb679d75dcc5427dbbc3. Change-Id: I78beddeda8bc516e45dd2a99dba8c7b8b1cf9255 Reviewed-on: https://gerrit.libreoffice.org/78076 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-24loplugin:returnconstval in connectivity..cuiNoel Grandin1-1/+1
Change-Id: Ie6444713088c14d1821640f6eb219cee3d6ee542 Reviewed-on: https://gerrit.libreoffice.org/78056 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>