1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

55 Commits

Author SHA1 Message Date
Georg Richter
5f1f517cfa Various typo fixes
Includes fixes from PR-201.
2022-07-03 13:45:37 +02:00
diego Dupin
fb85d99d13 Adding xpand to test suite 2022-03-23 11:46:40 +01:00
Georg Richter
49a22c269a Merge pull request #153 from Antchel/3.1
test fixes
2022-01-23 21:08:32 +01:00
Sergei Golubchik
0cc16f18c1 compilation failure with gcc 4.8.5
/home/buildbot/buildbot/build/libmariadb/unittest/libmariadb/ps.c:5152:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (unsigned int i=0; i < mysql_field_count(mysql); i++)
   ^
/home/buildbot/buildbot/build/libmariadb/unittest/libmariadb/ps.c:5152:3: note: use option -std=c99 or -std=gnu99 to compile your code
2021-07-27 20:43:37 +02:00
Georg Richter
9c651bd678 CONC-565: Incorrect max_length in binary protocol
Fixed max_length values in ma_stmt_codecs for integer types:
- all types included an extra byte for trailing zero character
- maximum value for year column type is 2155 (and not 0xFFFF).
2021-07-26 17:47:37 +02:00
Oleksandr Byelkin
e21d21d71f Fix ASAN issues in the tests 2021-01-27 20:25:13 +01:00
Oleksandr Byelkin
b503e52288 fix problems found by 10.0 2021-01-27 13:13:31 +01:00
Anton Golovenko
a7e888b518 Test bugs fixes 2021-01-20 18:54:55 +05:00
kolzeq
29fc3bc7bd [misc] test improvement
* adding SkySQL HA to test suite
* test server build 10.6
* test maxscale 2.5.3
2021-01-19 10:23:14 +01:00
Georg Richter
9637689e5e Test and travis modification for testing against SkySQL 2020-09-02 14:08:19 +02:00
Oleksandr Byelkin
895dcb61e3 C preprocessor defines fix 2020-06-04 16:49:21 +02:00
Otto Kekäläinen
c0d5d7d15b Fix typo in output string: inital -> initial 2020-03-04 20:05:56 +02:00
Georg Richter
1218ffac1a Fix for CONC-452 and CONC-453:
Various coverity scan fixes, including CONC-452 and CONC-453.
Special thanks to Lukas Javorsky for fixing numerous covscan
issues (This patch includes part of his pull request #126).

Coverity scan build was using the following cmake parameters:
-WITH_EXTERNAL_ZLIB=ON -DWITH_UNIT_TESTS=OFF.

CWE-416 (use after free) in dtoa.c (from netlib) is still open.
2020-02-14 09:52:21 +01:00
Georg Richter
639413cb21 Implementation of CONC-349:
Added new parameter STMT_ATTR_STATE to retrieve statement status via api
function mysql_stmt_attr_get
2018-10-23 13:11:23 +02:00
Daniel Black
b19f6a475b CONC-329: change pvio_*_blocking to return int to accomidate SOCKET_ERROR(-1)
POWER and other architectures that define char(as my_bool) to be unsigned (as the C
standard leaves this undefined). This resulted in error branches being
unreachabe as indicated by the below compile warnings.

plugins/pvio/pvio_socket.c:763:42: warning: comparison of constant -1 with expression of type 'my_bool' (aka 'char') is always
      false [-Wtautological-constant-out-of-range-compare]
    if (pvio_socket_blocking(pvio, 1, 0) == SOCKET_ERROR)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~
plugins/pvio/pvio_socket.c:875:46: warning: comparison of constant -1 with expression of type 'my_bool' (aka 'char') is always
      false [-Wtautological-constant-out-of-range-compare]
        if (pvio_socket_blocking(pvio, 0, 0) == SOCKET_ERROR)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~
plugins/pvio/pvio_socket.c:907:42: warning: comparison of constant -1 with expression of type 'my_bool' (aka 'char') is always
      false [-Wtautological-constant-out-of-range-compare]
    if (pvio_socket_blocking(pvio, 1, 0) == SOCKET_ERROR)

ma_hext2int: signed char - prevent compiler errors when char is unsigned.

libmariadb/ma_tls.c:169:31: warning: comparison of constant -1 with expression of type 'char' is always false
      [-Wtautological-constant-out-of-range-compare]
    if ((d1 = ma_hex2int(*p)) == - 1 ||
        ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
libmariadb/ma_tls.c:170:35: warning: comparison of constant -1 with expression of type 'char' is always false
      [-Wtautological-constant-out-of-range-compare]
        (d2 = ma_hex2int(*(p+1))) == -1 ||
        ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~

To fix this all the pvio_*_blocking functions have been changed to use
int as a return value.

Other my_bool/char differences fixed:

mariadb_dyncol_val_str: fix prototype to use char - like implemented function.

unittest: bind.is_null is my_bool* so we use a my_bool.
2018-07-19 08:12:33 +10:00
FaramosCZ
cd91dc8b2e Fix: use after free() 2018-05-24 07:35:20 +02:00
luz.paz
b2e6ed0295 Fixes misc. typos
found via `codespell -q 3`
2018-04-13 07:30:23 +02:00
Georg Richter
83eef02ec8 Test fixes:
for api functions which require string with length parameter (e.g.
  mysql_real_connect() or mysql_stmt_prepare() we now use the macro
  SL(string) which substitutes string and string length.
2018-02-16 13:05:35 +01:00
Georg Richter
929614903e Travis and Appveyor integration:
- added travis support
  - fixed appveyor settings
  - fixed some warnings (gcc 4.8)
  - removed sleep commands
  - disabled failing tests when running against MySQL server,
    mostly related to stored procedures and binary protocol
  - reverted fix for MDEV_10361

Still open: TLS/SSL appveyor tests, since .msi installation on appveyor doesn't provide certificates.
2018-02-16 12:14:01 +01:00
Vladislav Vaintroub
935c33b690 Fix Windows size_t warnings. 2018-01-12 18:19:19 +00:00
Georg Richter
ea8a31e63a Fixed compiler warnings 2017-07-04 13:56:38 +02:00
Georg Richter
08450df078 initial implementation for MDEV-12471 2017-04-24 15:45:58 +02:00
Georg Richter
082b165c6d Smaller test case fixes 2017-03-23 16:53:00 +01:00
Georg Richter
63e0897d43 Fix for MDEV-12247:
If a statement with open (read only) cursor is executed there is no buffered
result set (result set rows will be fetched directly from server), so we need to skip reading unbuffered result sets if a cursor is open.
2017-03-21 17:26:19 +01:00
Georg Richter
4ab155cf39 Unit test fixes for server integration
- SSL tests require CERT_PATH. Subdirectory certs was removed. If Connector/C is build outside of the server tree, certification path has to be specified manually (-DCERT_PATH=/path/to/certs).
- All tables and users will removed, if the test passed (otherwise mtr will complain).
2017-03-04 17:37:39 +01:00
Vladislav Vaintroub
7cb8479605 Fix Win64 warnings. Correctly define my_socket in ma_global.h 2016-10-12 21:05:31 +00:00
Georg Richter
b0506f63e9 Instead of mysql_real_connect in tests we call now my_test_connect to apply global options like tls usage 2016-09-08 07:59:34 +02:00
Georg Richter
9f88e25fd6 Compiler warning fixes 2016-09-03 12:46:50 +02:00
Georg Richter
2a7cc977fb Shared memory fixes 2016-08-24 19:26:30 +02:00
Georg Richter
fbf6fd1598 Valgrind fixes:
- fixed 2 unitialized memory errors
- fixed leak in client test
2016-08-21 20:35:13 +02:00
Georg Richter
26d31929d4 several fixes for mariadb_stmt_execute_direct:
- allow param binding via mysql_stmt_attr_set:
  mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, &param_count);
- If a prepared statement will be reexecuted, we send COM_STMT_CLOSE
  together with COM_STMT_PREPARE and COM_STMT_EXECUTE
2016-06-18 14:07:28 +02:00
Georg Richter
bea035a72b - Unittests: link static library instead of dynamic
- TLS/SSL: renamed HAVE_SSL to HAVE_TLS to avoid trouble in
  10.2-integration
- Fixed wrong timeout in non-blocking mode
- Fixed valgrind error in prepared statement
2016-03-28 10:29:55 +02:00
Georg Richter
8845fcb7ce First implementation of mariadb_stmt_execute_direct 2016-01-28 16:58:30 +01:00
Georg Richter
f0215ab091 Added GSSAPI authentication plugin 2016-01-22 20:00:40 +01:00
Georg Richter
f8912935b1 - Fixed several aurora plugin crashes (after reconnect)
- moved mysql->reconnect to mysql->options.reconnect
2016-01-16 07:04:28 +01:00
Georg Richter
d68c7dae95 Fixed warning on Windows 64-bit build 2015-12-19 17:07:10 +01:00
Georg Richter
bec245a913 Initial aurora implementation 2015-12-10 12:52:51 +01:00
Georg Richter
c516ca70b3 We now build an object library which prevents compiling sources twice (for shared and static libraries)
Fixed test cases
2015-01-21 11:47:34 +01:00
holzboote@googlemail.com
e038a7fae0 Fix for CONC-97 and CONC-98:
- Check if the connection is valid before resetting statement
  - Fix windows compile error (mingw)
2014-06-10 09:48:05 +02:00
holzboote@googlemail.com
b3c35dfaf9 Added delay/sleep after mysql_kill 2014-05-14 12:20:47 +02:00
holzboote@googlemail.com
8cab5e53a4 Unittest fixes (recommit to start/test buildbot) 2014-04-02 18:21:30 +02:00
holzboote@googlemail.com
b37317d482 Fix for CONC-83: Crash in prepared statements after reconnect
save stmt->mysql, since it will be set to NULL during reconnect and
 retrieve error code from saved pointer.
2014-03-13 16:44:55 +01:00
Georg Richter
28e7a867f1 Fix for CONC79: Performance issue with c client library
Added read-ahed cache for vio to reduce the number of reads
2014-03-03 11:19:47 +01:00
holzboote@googlemail.com
c9c78d0c31 Fix for CONC-60: crash when STMT_ATTR_UPDATE_MAX_LENGTH attribute was set and new date formats are used.
Special thanks to Lionel Elie Mamane and Daniel Bart for their tremendous help.
2013-11-20 20:37:30 +01:00
holzboote@googlemail.com
9552507348 Minor prepared statement fixes for time/date/datetime/timestamp types
Added flag MADB_BIND_DUMMY which allows binding empty buffers
2013-10-26 18:55:24 +02:00
Georg Richter
7038dc9280 Removed all internal dependencies from ma_dyncol.
Fixed compiler warnings
2013-10-01 09:53:41 +02:00
holzboote@googlemail.com
077afd8e10 Several test fixes 2013-07-24 07:01:48 +02:00
holzboote@googlemail.com
7fd247bb3b Fixed compiler warnings 2013-07-01 05:27:17 +02:00
Georg Richter
ae7353ad13 Added workaround for MDEV-6304: In mysql_stmt_more_results we check for both SERVER_MORE_RESULTS_EXIST
and for SERVER_PS_OUT_PARAMS
2013-06-01 13:50:35 +02:00
Georg Richter
30caf3c64b - Fixed memory overrun in mysql_stmt_execute due to wrong length calculation.
- Fixed bug in mysql_stmt_next_result
- Fixed mysql_stmt_reset: multi result sets weren't flushed properly
- Fixed several test cases
2013-05-20 18:00:08 +02:00