Commit Graph

65 Commits

Author SHA1 Message Date
18b2d22c51 CONCPP-110 Fixed, that could confuse the compiler.
Contains also libmariadb submodule update to the latest release and some
tests improvements/fixes.
2022-11-16 15:37:46 +01:00
d19b6611fa Adding ability to set tests verbosity using env variable
Made teavis tests verbose. Made some tests timeout longer
2022-09-26 14:32:15 +02:00
96efd9e142 CONCPP-106 Enabling use of bulk statement execution with the testcase
The feature is enabled with useBulkStmts boolean options, that is off by
default. Works only with MariaDB servers >= 10.2.7. It won't be used
with streaming parameters.
2022-09-26 00:40:15 +02:00
b311cbec93 CONCPP-107 Preventing possibility to set fetch size !=0
1.0 version does not support this feature
2022-09-20 14:39:04 +02:00
97ee32effb C/C updated to the v3.3.2
Plus small test change along the way
2022-08-19 17:28:45 +02:00
ff0f77cd8a CONCPP-105 crash when attempting connections from multiple threads
The RowProtocal class used reference to static object, that caused race
condition in concurrent environment.
Also, small addition to packaging on macos.
2022-07-26 14:54:24 +02:00
4f4609add7 [misc] travis test adding suite
mysql test improvement
2022-07-19 15:03:07 +02:00
9b23a0fa79 Moved cmake option defaults to the separate file
Added bit definition server param array(bulk) capability
Enabled WITH_SIGNCODE option for cmake. It depends on DEVELOPER_ID
option.
2022-07-18 18:42:58 +02:00
e2e03dadfd CONCPP-99 rewriteBatchedStatements option support
For insert queries, rewrites batch of staments to execute in a single
executeQuery. e.g.
insert into ab (i) values (?) with first batch values = 1, second = 2
will be rewritten as insert into ab (i) values (1), (2)
If query cannot be rewriten in "multi-values", rewrite will use
multi-queries, i.e.
insert into ab (i) values (1);insert into ab (i) values (2)
Using this option causes the useServerPrepStmts option to be set to false
2022-07-17 19:14:52 +02:00
bf5069abfb Move in Travis tests to use of connector test machine 2022-07-04 11:28:12 +02:00
ed44e401b0 Fixed the teststcase in databasemetadata for 10.8
It's about descending part of an index.
Moved 10.8 out of allowed failures section on Travis

Fixed getServerVersion in the test framework to work correctly with
minor versions >9(and affected testcases)
2022-05-23 23:22:40 +02:00
014f4ac0be Some additions to previous patch + downmerge from 1.1
The merge was done manually copying relevant code changes from 1.1.
In particulary merged the patch for CONCPP-94
Also many changes, that fix real possible issues, that was also present in 1.0 and found while
working on 1.1. For example(but not limited to), there were many cases of incorrect
find_first_of std::string method, where find had to be really used.
2022-05-23 23:03:37 +02:00
aec36978c3 CONCPP-96 The fix and testcase
The fix sets precision 30 for conversion of the double number to its
string representation, requeired for "client side" statement preparing(server
side wasn't affected by the bug). 30 is taked because it's max number of
decimals for decimal column type. This can cause "overflow" errors if
setDouble is used to populate shorter varchar or other types. SOme older
test have been amended to deal with that.
Testframework was fixed to be more informative about where the error
occured(often it printed line where the exception was caught, and for
some tests that is not very helpful.
Fixed couple of compilation warnings.
2022-05-04 19:28:48 +02:00
f2df1062c2 CONCPP-78 Introduced useCharacterEncoding connection option
Users can use it to set charset used in the conection.

Temporarily made tests against built 10.6 allowed to fail(before that
fixed for travis)
2021-06-14 11:08:33 +02:00
ed2632f03e Tentative fix for the issue.
There is no ticket yet, but bound to use of binaries built with
differnet VS version.
2021-05-05 23:39:23 +02:00
474973768e Fixed tests for run in Travis against SkySQL
Added useCompression to the README
Removed one obsolete cmake option from travis build script
2021-04-16 18:36:35 +02:00
be22353bc2 CONCPP-70 statement::addBatch test sporadically failed
The reason was, that filling of vector with executeBatch results was
done using undefined behavior - it was done using [] operator member
access for not existing members. The values were inserted correctly, but
the size of vector happened to not always be reported correctly.
Added similar test to preparedstatement.
Made clearBatch not to reset current set of parameters - that looks
like to be that jdbc specs expect.
Fixed other such cases of wrong vector use.
Made some to/from text conversion to use C locale.
2021-02-19 10:45:36 +01:00
029bd01df6 Removed direct openssl dependency
Updated dll's copyright year.
Small example program change.
Modified connectionmetadata::getColumnPrivileges test
2021-02-12 18:36:32 +01:00
983e4a84af CONCPP-65 Fix of various possible memorey leaks and other errors 2021-02-08 11:12:24 +01:00
cb827c8653 CONCPP-64 The fix of the reconnect method
Statements created on connection before reconnect stay unusable(in case
connection were lost). New objects have to be created
2021-02-08 02:32:23 +01:00
623eefe3f2 CONCPP-61 Fix of build with VS2015
It choked on const initialization with constexpr

Second possible issue was with
REASON_UNKNOWN in the ClientInfoStatus enum. It clashes with define in
one of Windows headers(Winreg.h). Added undersore prefix to the name.

Also fixed most often warning there.

Additionaly the commit contains some fixes in test faramework and in
tests.
2021-02-05 14:51:50 +01:00
ffb3ba5776 CONCPP-59,60 Windows package issues, Exception crash fix, and more
Added missing headers to msi. Headers now installed into include/mariadb
ALl headers have been renamed from .h to .hpp
ConnCpp.hpp renamed to conncpp.hpp(all small letters)
All headers but conncpp.hpp, have been moved to conncpp subdirectory in
include, and in the msi

All exception classes have got explicit (exported from dll on Windows) copyconstructor
decluration, and definition of those constructors in the connector
library. And to stay on the safe side, all other constructors and
destructors definitions have been moved to library side.
Fixed the error, that few exception methods were declared as
dllimported, and defined in the header at the same time.
2021-02-04 14:15:58 +01:00
02a4ff2488 [misc] test addition
* test against latest 10.6 build
* add SkySQL HA
* update to maxscale 2.5.3
2021-01-19 23:54:09 +01:00
43d72ad28b CONCPP-57,CONCPP-55 Making client side prepared statement a default(instead of ssps)
This includes fixes of various outstanding bugs in CSPS
Made setDouble to accept long double(CONCPP-55)
static_test and driver_test now make one run with default CSPS, and one
with SSPS
Updated README.md with more options info. Changed desription of some
options in DefaultOptions.cpp. Fixed use of autoReconnect and
localSocket
2021-01-19 17:40:49 +01:00
eff5d647b9 Made all tests configurable via env variables
Tests connection credentials can be passed using env variables. All
tests use the same settings for that.

Added the link to the documentation to the README(.md)

Changed in SQLString all size_t to std::size_t(more like for
consictency).
Added npos constant there
2020-12-09 17:56:33 +01:00
c03f6aa5e5 Build fix
Lately to fix one test build with certain VS version, not portable
change has been made, that broke build on other platforms.

Fix of couple of tests for older server versions.
2020-12-04 16:09:08 +01:00
32afc2799a Fix of one testcase in 'statement' that fails with some VS versions
Build fails.
2020-11-25 00:33:25 +01:00
fff542dde4 CONCPP-52,53,54 executeBatch() would execute only last query
and bytes, Ints, Longs were not exported.

API change: execute(Large)Batch return reference to const objects,
rather than pointers.
Restructuring of API and internal headers and introducing of new
separate header files.
Added statement testsuite to ctest - that was forgotten
Connector quality set to RC
2020-11-24 23:13:22 +01:00
c6294e6fdf CONCPP-51 2nd part - prepared statements. With extended testcase
Also removed from jdbccompat define's that do not really belong there.
2020-11-24 00:25:48 +01:00
c235b46300 CONCPP-51 Crash in stmt created on later deleted connection
Also fixed error in tests, that could make ctest not to notice filed
test suites.
Increased timeouts for some tests(skysql)
Some changes in travis osx script
2020-11-18 23:15:08 +01:00
9d00633bf4 CONCPP-50 PS RS was too greedy in buffer allocation
No testcase possible.
2020-11-17 19:46:57 +01:00
2704acd7f4 CONCPP-46 Addition - fix of the build with gcc on macos
Some travis congig fixes for macos

Errors and warnings.
Fix of one testcase failing aginst 10.2
2020-11-15 23:57:16 +01:00
a9c0c852c4 CONCPP-49 The fix and corercted and extended existing test
ResultSetMetaData::getColumnTypeName() returned incorrect type name for
LONGTEXT
2020-11-15 21:46:44 +01:00
36def4203b CONCPP-48 Some Statement methods should not be called from a PS
The public API has been slightly corrected - Statement methods
duplicated in PreparedStatement have been removed. A const qualifier has
been added to the parameter type in one of methods for consistency.

The testcase verifies, that exception is thrown, and with a correct
message.
2020-11-15 16:08:58 +01:00
3145f965c6 CONCPP-46 Resultset navigation issue(s) fix and testcase
In particular connector failed, if navigaten started from 'absolut()'
call, but coulrd be others problem as well.
The patch extended existing test.
Added 'unsorted_bugs testsuite to the ctest
Fix of the build on macos in travis - openssl libs could not be found
2020-11-13 15:34:24 +01:00
197c36b4c6 CONCPP-46 Fix of clang compilation errors&warnings
Added testing against 10.5 in travis.
2020-11-10 23:30:38 +01:00
1ce04edb44 CONCPP-45 Various issues with CallableStatement
Also fixed many things in multiple resultsets processing. Fixed many
tests(previously skipped), and workarounded CONC-504
2020-10-05 22:59:39 +02:00
2f4acdb898 CONCPP-44 The fix and the testcase
For binary protocol connector expected the string is null-terminated.
Also it getBoolead was subotimal and significantly slowed down the
testsuite running.
Removed 5.5 server from travis config
Fixed database metadata test to skip one check with 10.1 server, as it
returns wrong data in many cases.
2020-09-28 13:21:00 +02:00
d911eafb2c Fixed few tests that depend on features not supported in older servers 2020-09-25 23:14:50 +02:00
0837eebc5b CONCPP-31 DriverManager.h missed in binary tarball packages
Also increased the timeout for newly added resultset tests set
2020-09-25 14:51:14 +02:00
11183f39ba CONCPP-35, CONCPP-36, CONCPP-37, CONCPP-40 Fixes and testcases covering
these and previous couple of commits(without specific test)
2020-09-25 14:30:36 +02:00
9a8daef07e CONCPP-29 Introducing DriverManager class with getConnection only
functionality. Unlike connecting via Driver class,
DriverManager::getConnection methods throw an exception in case
connection could not be established for whatever reason. i.e. also if
the format of url is incorrect and could not be parsed.
DriverManager only permits jdbc:mariadb:// type of url. Well, it's
driver manager after all, and needs to know which driver to invoke.
Changed unit tests to connect via DriverManager
Added use examples to the README.md
Fixed return from false to nullptr in couple of methods of the Statement class. They were added to
remove warnings, bool value is wrong for the methods.
Fixed build of database metadata class test on 32b Windows
2020-08-11 14:17:28 +02:00
8baa37e6c0 CONCPP-28 Various fixes int DatabaseMetaData class and in related tests.
The biggest class of changes is making MariaDB schema(database) a schema
in the connector, and not a catalog.
Then many methods and/or tests returned/expected wrong data.
Fixed also issue with resultset navigation. Certain sequences of
the cursor navigation methods could cause the cursor to be at the wrong
position. If I am not mistaken, one of sequences could be next-set of
navigation commands-absolute(0)-next
2020-08-10 19:13:42 +02:00
1a22b796cd CONCPP-26 fix(and the test for getBestRowIdentifier was already where)
enum's in all public interface classes have been verified and changed
where needed.
getBestRowIdentifier returns bestRowSession for SCOPE, not unique
indexes excluded, and generated columns are said to be "pseudo"
2020-08-05 12:50:14 +02:00
374aa394ba Added one more testsuite to ctest(connection)
Added queryTimeout init by the respective constructor and changed its
check to > 0 from !=0
2020-08-03 14:56:39 +02:00
c71b1afc35 Extended a bit testcase to test CONCPP-20
Made timeouts for somet tests longer(it takes time with remote SkySQL
DB).
2020-08-03 14:25:04 +02:00
8dfd4b354f CONCPP-21 Testcase only - it must has been fixed before 2020-08-03 13:07:44 +02:00
671c0e5933 CONCPP-24 Enabling testing against SkySQL database in travis 2020-08-03 10:22:30 +02:00
485fa861a1 Re-arranged unit/classes tests build
Moved common files to the separate OBJECT lib, as it looked like it is
quite difficult for the gcc to chew it.
Skipped tiem-outing test for now. Needs to be fixed.
2020-07-31 10:50:37 +02:00
dda40e1fc7 Connector/C submodule update to 3.1.9
Build error fix
2020-07-30 17:29:24 +02:00