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

605 Commits

Author SHA1 Message Date
Georg Richter
1d3fd5818a Test fix for test_bug4236 2024-04-08 17:19:42 +02:00
Georg Richter
ebe1949540 Fix for CONC-505:
Don't allow to specify unsupported client flags (like
CLIENT_DEPRECATE_EOF) as client flag in mysql_real_connect
api function.
2024-02-22 09:03:51 +01:00
Sergei Golubchik
f6e99af056 Revert "self-signed certificate verification", it's 3.4 feature
This reverts 395641549ac7..536d9e2b9e5b, in particular:

8dffd56936 MDEV-31857 enable MYSQL_OPT_SSL_VERIFY_SERVER_CERT by default
a99570c118 MDEV-31855 SSL cert validation protocol extension
9aa15e72a7 TLS fingerprint

and related commits
2024-02-19 11:16:26 +01:00
Sergei Golubchik
8dffd56936 MDEV-31857 enable MYSQL_OPT_SSL_VERIFY_SERVER_CERT by default
because the default value of every option is 0
(option and option.extension are bzero-ed to reset),
tls_verify_server_cert was renamed to tls_allow_invalid_server_cert
with the default value of 0, "do not allow".

API didn't change, it's still MYSQL_OPT_SSL_VERIFY_SERVER_CERT
2024-02-04 22:17:25 +01:00
Sergei Golubchik
50f65db279 compilation warning
ps_bugs.c:3275:5: note: ‘sprintf’ output between 9 and 19 bytes into a destination of size 12
2024-02-04 22:17:25 +01:00
Georg Richter
00fb2062b9 Test fix for MaxScale:
Skip character set tests which set character set
during handshake, since MaxScale sends utf8mb4 via
session_track information in handshake OK packet.
(https://jira.mariadb.org/browse/MXS-4898).
2023-12-14 09:07:44 +01:00
Georg Richter
b0a2f65f55 Character set test:
Added diagnostic output.
2023-12-14 08:01:46 +01:00
Georg Richter
ba55b5b78f Test fix:
Append terminating 0 in status_callback_function.
2023-12-13 18:46:55 +01:00
Oleksandr Byelkin
64f9d88f30 Merge branch '3.1' into 3.3 2023-10-23 13:36:05 +02:00
Oleksandr Byelkin
ae565eea90 Use safer snprintf call. 2023-10-23 13:32:45 +02:00
rusher
dd927bd171 Update server test suite 2023-08-30 09:52:22 +02:00
Georg Richter
209b23a38c Test fixes:
- Fixed failing test when running against MySQL server
- Disabled test when running against MySQL server.
2023-08-30 07:44:32 +02:00
Georg Richter
5f88f50cf0 Build fix:
Move the setting "treat warning as errors" befind feature detection,
otherwise several try_compile/try_run commands will fail.
2023-08-16 15:02:02 +02:00
Georg Richter
1acb81e11c Build fixes:
- Fixed build error, which was previously introduced by commit
c8ca89112e

- Treat warnings as errors
2023-08-16 14:09:34 +02:00
Georg Richter
c8ca89112e Fix for CONC-659:
When checking for a semi sync indication header, we need also check if
the undocumented session variable @rpl_semi_sync_slave was set.
Otherwise the timestamp of the event could contain values which match
the 2 bytes of the semi sync header.

Since the variable rpl_semi_sync_slave and it's behavior is not documented,
a new option MARIADB_RPL_SEMI_SYNC was added.
2023-08-11 10:14:26 +02:00
Georg Richter
cd59c70ce7 Merge branch '3.1' into 3.3 2023-08-10 11:20:29 +02:00
Georg Richter
5000bc790a Test fix:
Always specify the socketname when calling my_test_connect().
2023-08-10 11:18:22 +02:00
Georg Richter
bec589e679 Merge branch '3.1' into 3.3 2023-04-26 08:10:40 +02:00
Georg Richter
f5a4c73df4 Fix memory leak in unittest 2023-04-26 08:10:08 +02:00
Georg Richter
dd8962a4b5 Merge branch '3.1' into 3.3 2023-04-25 15:08:28 +02:00
Georg Richter
b0ec2101bf Test fixes when testing against MySQL 2023-04-24 14:58:01 +02:00
Georg Richter
6c29921bbe travis fix:
remove server builds > 10.5, since 10.6 and above use
Connector/C 3.3 branch.
2023-04-22 06:56:53 +02:00
Georg Richter
2000b06183 Replace SET_CLIENT_STMT_ERROR by stmt_set_error(). 2023-04-11 18:31:19 +02:00
Georg Richter
dbb4d8d93b Fixed segfault:
Use rpl->host and port instead of mysql->options.
2023-02-22 11:32:21 +01:00
Georg Richter
ece593f571 Merge branch '3.3-rpl' into 3.3 2023-02-21 17:11:56 +01:00
Georg Richter
29a8156193 Skip test_bug49694 when testing with Xpand.
local_infile variable is not supported by XPand (XPT-600).
2023-02-18 08:49:25 +01:00
Georg Richter
2105a2bc7f Skip tests when testing with Xpand. 2023-02-18 08:39:10 +01:00
Georg Richter
80f18e417f SKIP debug test if testing with Xpand. 2023-02-18 08:33:49 +01:00
Georg Richter
780c330f38 Since we can't determine if load data local is
suppoerted by Xpand, we skip it for now.
2023-02-17 11:23:22 +01:00
Georg Richter
87bd5bfc34 Removed decryption stuff from rpl api 2023-02-12 14:26:02 +01:00
Georg Richter
e4417e725e Merge branch '3.1' into 3.3 2023-02-09 08:57:48 +01:00
Georg Richter
669726a1d9 Fix for CONC-633:
If prepare step failed in mariadb_stmt_execute_direct now both
mysql_stmt_error and mysql_error return the error message from
prepare step instead of error message of execute.
2023-02-08 12:21:22 +01:00
Georg Richter
75439c0f39 CONC-632
When resetting the connection with mysql reset_connection(), the
server_status must be checked and any other resultsets that mayi
exist must be removed.
2023-02-08 11:46:39 +01:00
Georg Richter
12bd1d5511 Merge branch '3.1' into 3.3 2023-01-16 12:12:46 +01:00
Georg Richter
895235815c Fix for CONC-627:
Don't substitute parameters in server error messages in
prepeated statement error handler function.
2023-01-16 11:13:00 +01:00
Georg Richter
003b5cd168 Follow up for CONC-622 test:
Host 0.0.0.0 is mapped to locahost, so we need another invalid
host address (1.0.0.0) instead and reduce the number of loops.
2023-01-15 17:41:29 +01:00
Georg Richter
5f6133653d Fix for CONC-623:
If callback function returns a non zero return code, execute
will now abort with error CR_ERR_STMT_PARAM_CALLBACK.
2023-01-15 15:12:38 +01:00
Georg Richter
abea2dfa6b Merge branch '3.1' into 3.3 2023-01-15 14:27:41 +01:00
Georg Richter
bf82b2d8cb Fix for CONC-624:
- ER() macro now checks if the error code is known, if not it will return
  "Unknown or undefined error code" (instead of crashing)
- SET_CLIENT_STMT_ERROR now maps to stmt_set_error and accepts variadic
  arguments
2023-01-15 14:11:54 +01:00
Georg Richter
da9bb98c0c CONC-622: Fix double free() if asnyc connect failed
If mysql_real_connect_start/cont failed, we need to
set async->pvio to zero after calling ma_pvio_close
to avoid double free() in mysql_close.
2022-12-27 14:36:44 +01:00
Georg Richter
28df8a73b6 Merge branch '3.3-status' into 3.3 2022-08-02 10:20:19 +02:00
Georg Richter
a8832afa2a status and session_tracik callback function:
This feature allows client applications to register a callback function,
which is called as soon as the server status changes or session_track
information was sent by the server.

Registration is handled via mysql_optionsv() API function:

mysql_optionsv(mysql, MARIADB_OPT_STATUS_CALLBACK, function, data)

The callback function must be defined as follws:

void status_callback(void *data, enum enum_mariadb_status_info type, ..)

  Parameters:
    - data  Pointer passed with registration of callback function
            (usually a connection handle)
    - type  Information type  STATUS_TYPE or SESSION_TRACK_TYPE

  Variadic Parameters:

  if (type == STATUS_TYPE):
    - server status (unsigned int)

  if (type == SESSION_TRACK_TYPE)
    - enum enum_session_state_type track_type - session track type

    if (track_type == SESSION_TRACK_SYSTEM_VARIABLES)
      - MARIADB_CONST_STRING *key
      - MARIADB_CONST_STRING *value

    else
      - MARIADB_CONST_STRING *value

An example can be found in connection.c (test_status_callback)
2022-08-02 10:10:50 +02:00
Georg Richter
dcb14e3c5d erge branch '3.1' into 3.3 2022-08-01 12:26:27 +02:00
Alexander Barkov
df6feae0df Libmariadb changes for MDEV-27009 Add UCA-14.0.0 collations 2022-07-27 12:56:56 +04:00
Marko Mäkelä
b9811b7c6d Fix clang -Wunused-but-set-variable 2022-07-26 08:16:53 +03:00
Georg Richter
2dd03f04d1 typo fixes (was PR 203) 2022-07-25 08:44:26 +02:00
Georg Richter
6dbd953420 Merge branch '3.1' into 3.3 2022-07-24 10:52:52 +02:00
Georg Richter
cdb6e90c35 Fix for CONC-608: Replace server error codes
Since Connector/C is not able to retrieve
error strings for server error codes, the following
error codes were replaced:

- ER_NET_PACKET_TOO_LARFE by CR_NET_PACKET_TOO_LARGE
- ER_OUT_OF_RESOURCES by CR_OUT_OF_MEMORY
- ER_NET_WRITE_ERROR by CR_ERR_NET_WRITE (new constant)
- ER_NET_UNCOMPRESS_ERROR by CR_ERR_NET_UNCOMPRESS (new constant)
2022-07-21 09:11:29 +02:00
Georg Richter
e8e356e355 Merge branch '3.1' into 3.3 2022-07-18 11:48:33 +02:00
Georg Richter
9a572bc548 Fix for CONC-604 and CONC-605:
This patch fixes a crash when reconnectiong via TLS.
2022-07-18 11:41:46 +02:00