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

667 Commits

Author SHA1 Message Date
Georg Richter
b0411b731f CONC-386:
Added support for pem files which contain certificate and private key.
In case the file will contain more than one certificate or key, the first
certificate or key found will be used.
2019-06-02 13:39:27 +02:00
Marko Mäkelä
68e6c5bd67 CONC-394: The unit test does not compile on Windows 2019-05-05 22:40:45 +03:00
Oleksandr Byelkin
bce6c80138 Free memory used in the unit test 2019-05-04 13:04:14 +02:00
Georg Richter
ad385b954a CONC-394: Some TLS related options are not settable in configuration file
The following options are now supported in configuration files:
* ssl_enforce (bool)
* ssl_crl (string)
* ssl_crlpath (string)
2019-04-06 11:42:24 +02:00
Georg Richter
a8bec1c68a CONC-395: Dashes and underscores are not interchangeable in options in my.cnf 2019-03-26 16:48:21 +01:00
Sergei Golubchik
4ac8030b33 fix memory leaks to keep LeakSanitizer happy 2019-03-05 20:21:32 +01:00
Georg Richter
8473246541 Fix authentication tests:
- specify correct plugin type for checks
- allow access to test schema for ed25519 user
2019-03-04 17:06:00 +01:00
Georg Richter
af47d1beab Merge branch '3.0' into 3.1 2019-03-03 14:03:20 +01:00
Georg Richter
f24915057c Don't close default connection in test_conc392 in case we have to skip test 2019-03-02 14:49:27 +01:00
Georg Richter
0cc2df4180 Follow up of 68d05007bb:
Skip test if the server doesn't support session tracking
2019-03-02 14:26:55 +01:00
Georg Richter
68d05007bb Fix for CONC-392:
Fixed crash when server sent session tracking information with session type
SESSION_TRACK_STATE_CHANGE. In this special case the packet doesn't contain
the overall length. (see https://mariadb.com/kb/en/library/ok_packet/).
2019-03-02 07:54:06 +01:00
Georg Richter
0acf529e34 Fix for MDEV-18634:
Even if this test is intended to fail we need to pass valid memory buffer
to simulate overflow (length > length of sql statement).
2019-02-19 08:44:19 +01:00
Sergei Golubchik
4aad20db15 Merge tag 'v3.0.9' into 3.1 2019-02-18 20:16:23 +01:00
Georg Richter
a1469b407a Fix test for expired password.
Followup of 02bf9033ef
2019-02-11 20:13:17 +01:00
Georg Richter
70f2964dc4 Fix for CONC-384:
fixed length calculation for connection attributes. We now call mysql_net_store_length passing the size of the connection attribute and substract the offset of the passed buffer to determine the correct size.
2019-02-07 04:14:55 +01:00
Georg Richter
0ca2f2cb38 Fixed conversion from zerofill integer to MYSQL_TYPE_STRING:
if the length of the provided result buffer is equal or smaller than the converted number and
ZEROFILL FLAG is set, a truncation error will be reported.
2019-02-06 11:00:42 +01:00
Sergei Golubchik
a4effc462d fix connection unit test to work in mtr 2019-02-04 16:05:41 +01:00
Sergei Golubchik
cdf5eab4cc compiler warnings - unused variables 2019-02-04 16:05:27 +01:00
Sergei Golubchik
b6c3895eec Merge tag 'v3.0.8-release' into 3.1 2019-02-04 16:05:19 +01:00
Georg Richter
3ab17c0310 Fix compiler warning (gcc-8.1) 2019-02-03 17:26:24 +01:00
Sergei Golubchik
34f8887af0 Fix warnings on Windows 2018-12-18 17:34:42 +01:00
Georg Richter
56631c5f8a Fix test for ed25519 2018-12-18 13:48:54 +01:00
Vladislav Vaintroub
1ecc37f94f CONC-387 return MYSQL_DATA_TRUNCATED for invalid numeric strings.
Fix a regression in new my_atoll()/my_atoull()
to set error, if there are non-digits found in the string.

Spaces at the start and end of string are ignored (however, not between the
digits).
2018-12-07 17:21:39 +01:00
Georg Richter
1888c141f7 Manual merge from CONC-325 branch: Initial implementation for binlog/replication API 2018-12-02 18:28:38 +01:00
Georg Richter
b87845b18d CONC-366: Implementation of ed25519 authentication plugin 2018-12-02 16:58:30 +01:00
Georg Richter
7d5511c2e3 Fix warning in misc.c unittest 2018-12-01 18:07:20 +01:00
Georg Richter
005195f9cb CONC-312: Implementation for caching_sha2_password plugin 2018-12-01 08:56:24 +01:00
Vladislav Vaintroub
06fd8c901e CONC-372 Fix str_to_TIME() parsing wrt performance.
Fix implementations of str_to_TIME() and my_atoll()

Implement own version my_strtoll() (similar to strtoull(), not requiring
null termination).

Use it to for optimized implementation of numbers and dates.
2018-11-11 02:24:21 +01:00
Lawrin Novitsky
738e4fa86f Correction of test_codbc138 test. It could fail
with some compilers(observed with VS). That would happen in memcmp of 2 MYSQL_TIME structures. Apparently because different
content of memory areas the compiler used to pad structures.
2018-11-08 15:42:25 +01:00
Sergei Golubchik
6545b1d194 CONC-371 fix for frac > 6 2018-11-07 13:29:43 +01:00
Sergei Golubchik
efc9f60dbf compilation failure on windows
libmariadb\libmariadb\ma_stmt_codec.c(263): warning C4244: '*=': conversion from 'double' to 'unsigned long', possible loss of data

generally avoid slow floating point pow() when all you need is to
multiply an integer by a small power of 10.
2018-11-07 08:48:54 +01:00
Sergei Golubchik
72ce6c1fbf Merge branch '10.3-server' into 3.0 2018-11-07 00:18:48 +01:00
Georg Richter
70082afeb7 Fix for CONC-371: Incorrect fractional part conversion
If a datetime or time value is represented a a string and has a fractional part with less than 6 digits,
it should be interpreted as a 6-digit representation:

.9 becomes 900000
.09 becomes 90000
etc.
2018-11-06 10:03:15 +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
Sergei Golubchik
0e0bf9aa49 Merge tag 'v3.0.6' into 10.3-server 2018-08-10 15:01:16 +02:00
Sergei Golubchik
3db62d628d Merge branch '10.2-server' into 10.3-serg 2018-08-10 14:24:53 +02:00
Daniel Black
3616c977f6 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-08-08 13:04:07 +02:00
Georg Richter
6530cc161f Fix for CONC-332:
mysql_change_user doesn't reset server status

Fixed my_auth.c, after successful connect the server status package information (including session change information) must be updated.
2018-08-08 13:01:44 +02:00
Georg Richter
9cf39da26a Added test for nested dynamic column 2018-08-08 12:59:59 +02:00
Georg Richter
3630fecae6 More coverity fixes 2018-08-08 12:59:51 +02:00
Georg Richter
3a4b088f4b Fixed warning 2018-08-08 12:35:38 +02:00
Georg Richter
c3e9aab76d Skip test for MDEV-16593 (not fixed yet) 2018-08-08 12:35:32 +02:00
Georg Richter
ea79ee6e7d Fix for CONC-345: heap-use-after free in client_mpvio_read_packet
We need to check if pkt_len is > 0 before the buffer content will be checked.
2018-08-08 12:33:45 +02:00
Georg Richter
4700c3fcec Fix for CONC-344: reset internal row counter before executing prepared statement 2018-08-08 12:33:39 +02:00
Sergei Golubchik
010124ca12 compilation warning 2018-08-08 11:54:32 +02:00
FaramosCZ
768f50ebe3 Fix: use after free() 2018-08-08 11:51:37 +02:00
Georg Richter
7d28557c8d Fixed string conversion to MYSQL_TIME_TYPE:
- added support for negative time values
- invalid strings (and/or conversion) and invalid values will result in MYSQL_TIMESTAMP_ERROR time type
- added support for 2digit year representation:
    values < 69 will be converted to 20YY
    values >= 69 will be converted to 19YY
2018-08-08 11:50:24 +02:00
Georg Richter
e5a7852f42 CONC-327:
Add support for !include an !includedir in configuration files
2018-08-08 11:41:26 +02:00
Georg Richter
51920cbbf3 Travis test fix for CONC-351: skip test if the server doesn't support session tracking 2018-08-07 07:16:42 +02:00
Georg Richter
072fa008b8 Fix for CONC-351:
If an ok packet doesn't contain session state tracking information, we need to
clear session state information from previous ok packet.
2018-08-06 18:45:30 +02:00