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

159 Commits

Author SHA1 Message Date
Pavol Sloboda
9e4042c149 fix: fixed a possible leak when one of the files (fp1 or fp2) fails to
open by adding a simple condition that checks whether one of them opens
while the other fails and closing it
and added the extra prentheses for the assignment inside the if statement
for easier debugging and to avoid static analysis flagging it as a wrong
statement inside the if clause
2025-07-17 09:14:53 +02:00
Georg Richter
0ff64ca045 Merge branch '3.1' into 3.3 2025-02-27 09:35:33 +01:00
Georg Richter
f7633e9d68 Test fix: pipe name
Instead of relying on default (MySQL), we check @@socket and
pass the correct pipe name.
2025-02-27 09:33:35 +01:00
Georg Richter
4c9bc2b0f6 Merge branch '3.1' into 3.3 2025-02-27 07:52:35 +01:00
Georg Richter
aa240cd181 CONC-760: valid named pipe connection is closed
Fixed different behavior of pvio_is_alive (which was first used
with fix of CONC-589). Both for sockets and named pipe the function
now returns true if the connection is alive, otherwise false.
2025-02-27 07:48:58 +01:00
Georg Richter
1e4e47347d test fix: use my_ulonglong instead of ulong
Use 64-bit long instead of 32-bit value to avoid
overflow
2025-02-11 19:38:55 +01:00
Sergei Golubchik
2d56f340c4 Merge branch '3.1' into 3.3 2025-01-24 14:52:35 +01:00
Sergei Golubchik
7d930974c0 CONC-751 unit.conc_connection fails with CYPHER missmatch on some builds
disable the test for old gnutls
2025-01-24 14:42:37 +01:00
Georg Richter
5f4b9b6e8c Travis fix: Skip reconnect test (MaxScale) 2025-01-21 14:21:33 +01:00
Georg Richter
53b7169315 Merge branch '3.1' into 3.3 2025-01-15 10:46:29 +01:00
Georg Richter
36d1c3ac77 Travis fix: Skip reconnect test (MaxScale) 2025-01-15 10:41:32 +01:00
Georg Richter
57ce0ce3c7 Merge branch '3.1' into 3.3 2025-01-15 08:00:19 +01:00
Georg Richter
e09e24e890 CONC-589: First query fails after reconnect
If automatic reconnect is enabled (MYSQL_OPT_RECONNECT) it is
mandatory to check if the connection/socket is still alive before
sending a command to the server (unless the command is COM_QUIT).
2025-01-15 07:26:18 +01:00
Georg Richter
fa9f5f66be Travis and test fixes:
- Build server build with latest C/C: Instead of copying the C/C directory
  into server, we now fetch the actual commit or PR into server repository
- Fix travis environment variables (Windows)
- Skip character set tests if the server doesn't support charset/collation
- Don't use CREATE OR REPLACE SQL syntax to make MySQL happy
- Disable TLS connection test for MaxScale
- Don't set TEST environment variables if they are empty
2025-01-07 16:57:53 +01:00
Georg Richter
486a07c824 Test fix:
use mysql_real_connect instead of my_test_connect for unix_socket
test to reduce diagnostic output from my_test_connect function.
2024-12-21 08:33:15 +01:00
Georg Richter
5485acd470 Test case fix:
Don't connect with anonymous user, since mtr doesn't run with
unix_sockets by default.
2024-12-20 12:02:35 +01:00
Georg Richter
32addee3fc Test case fix:
Don't connect with anonymous user, since mtr doesn't run with
unix_sockets by default.
2024-12-20 06:14:02 +01:00
Georg Richter
6d28fe89af Merge branch '3.1' into 3.3 2024-12-08 11:50:43 +01:00
Georg Richter
af44fc5c5e CONC-748: Allow to set TLSv1.3 ciphers in GnuTLS
- Added TLSv1.3 ciphers to cipher map.
- Fixed retrieval of cipher suite: Since gnutls_cipher_suite_get_name
  supports only TLSv1.2 (and lower) cipher suites, we have to call
  gnutls_ciphersuite_get() (requires GnuTLS 3.7.4 or newer).
2024-12-08 11:27:32 +01: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
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
rusher
dd927bd171 Update server test suite 2023-08-30 09:52:22 +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
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
ece593f571 Merge branch '3.3-rpl' into 3.3 2023-02-21 17:11:56 +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
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
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
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
diego Dupin
fb85d99d13 Adding xpand to test suite 2022-03-23 11:46:40 +01:00
Georg Richter
770cf2286a CONC-575: Support for MySQL zstd compression
ZSTD compression is now supported for connections
to a MySQL Server 8.0.

Compression algorithms are supported via compression
plugins, which can be found in plugins/compress.
2022-01-25 05:02:33 +01:00
Georg Richter
b5c1a23c82 Merge branch '3.2' into 3.3 2022-01-25 03:52:42 +01:00
Georg Richter
3fe2f50545 Merge branch '3.1' into 3.2 2022-01-25 03:51:45 +01:00
Georg Richter
8aa0ffdcbd Test fixes:
Fixed warning (int/size_t)
Fixed error message
2022-01-24 14:49:34 +01:00
Georg Richter
49a22c269a Merge pull request #153 from Antchel/3.1
test fixes
2022-01-23 21:08:32 +01:00
Georg Richter
ddb031b6a1 Travis fix:
When reading connection parameters from configuration file
a secure connection must be established.
2022-01-07 17:54:25 +01:00
Georg Richter
141fb0d5fa Test fixes:
- For reconnection/and multi host tests specify also socket location,
since mtr doesn't use default socket for localhost connections

- parse_connection_string now returns NULL for empty password in
  curly braces
2022-01-04 10:37:12 +01:00