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

594 Commits

Author SHA1 Message Date
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
Georg Richter
a1ac1b832d Added test case for conc336 2018-05-30 09:14:52 +02:00
Georg Richter
99c878d47e Merge pull request #55 from FaramosCZ/patch-4
Fix: use after free()
2018-05-30 07:12:34 +02:00
Georg Richter
8f168c4d51 Added test case for conc336 2018-05-30 07:04:38 +02:00
Georg Richter
e06960d7a6 Fix for CONC-336:
Allow multiple initialization of the client library (mysql_server_init(
mysql_server_end).
Note: This was already fixed by commit for CONC-277, unfortunately the fix
was overwritten by a bad merge.
2018-05-29 18:42:11 +02:00
Georg Richter
6b16eb778f Fix for CONC-336:
Allow multiple initialization of the client library (mysql_server_init(
mysql_server_end).
Note: This was already fixed by commit for CONC-277, unfortunately the fix
was overwritten by a bad merge.
2018-05-29 17:46:47 +02:00
Georg Richter
9f6b9f26f0 Fix for CONC334:
Copy all members of MYSQL_FIELD from mysql->fields to stmt->fields.
2018-05-29 15:29:08 +02:00
Georg Richter
1511314d3a Merge branch 'master' of https://github.com/MariaDB/mariadb-connector-c 2018-05-29 11:43:47 +02:00
Georg Richter
407ca36f24 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-05-29 11:42:36 +02:00
Georg Richter
53c40f5aaa Fix for CONC334:
Copy all members of MYSQL_FIELD from mysql->fields to stmt->fields.
2018-05-29 09:49:35 +02:00
Georg Richter
8455b6e1c9 Changed default character set from utf8 (see fix for CONC-315) to
latin1, which is also default behavior in MariaDB 10.1
To use another default character set, MariaDB Connector/C has to be build
with CMake parameter -DDEFAUT_CHARSET=name.
2018-05-24 12:10:02 +02:00
FaramosCZ
cd91dc8b2e Fix: use after free() 2018-05-24 07:35:20 +02:00