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

605 Commits

Author SHA1 Message Date
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
Georg Richter
f1fd014a15 Fixed leak in ma_tls_read/write 2018-07-31 09:39:03 +02:00
Georg Richter
d76de10de8 Merge branch 'master' of https://github.com/MariaDB/mariadb-connector-c 2018-07-27 07:35:36 +02:00
Georg Richter
1788e000d2 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-07-27 07:17:27 +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
Georg Richter
d3e06bc161 Added test for nested dynamic column 2018-07-13 14:48:42 +02:00
Georg Richter
c95f86e882 More coverity fixes 2018-07-13 12:30:13 +02:00
Georg Richter
eda04fe615 Fixed warning 2018-07-04 07:25:24 +02:00
Georg Richter
6658605159 Skip test for MDEV-16593 (not fixed yet) 2018-07-03 12:45:55 +02:00
Georg Richter
dc50976e36 Fix for travis tests:
Older server versions don't support CREATE or REPLACE syntax.
2018-07-03 11:22:31 +02:00
Georg Richter
a0d4b422bd 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-07-03 11:17:46 +02:00
Georg Richter
9e1fef0bf2 Fix for CONC-344: reset internal row counter before executing prepared statement 2018-06-28 17:22:08 +02:00
Sergei Golubchik
74fbbaefeb fix unit test conc336 to pass in mtr 2018-06-24 20:37:01 +02:00