1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-09-15 08:21:18 +03:00

1089 Commits

Author SHA1 Message Date
Ryuta Kamizono
e9a2c9eccc Fix typo utf8m4 -> utf8mb4 2021-04-08 23:42:15 +05:30
Georg Richter
10784a282b Fix for CONC-537: Only read from MYSQL_HOME if MARIADB_HOME is not set
To allow to use different configuration directories for MariaDB and MySQL,
configuration files from MYSQL_HOME environment variable will be
processed only, if MARIADB_HOME environment variable was not set.
2021-04-08 23:42:15 +05:30
Georg Richter
66f8dbdb64 Fix for CONC-535: disabled checksum ignored in events
QUERY_EVENT and ANNOTATE_ROWS_EVENT don't check if the crc32
checksum option is disabled and strip always 4 bytes from
protocol buffer.

Kudos to Ruslan Altynbaev for reporting and providing this small fix.
2021-04-08 23:42:15 +05:30
Georg Richter
0f2a185da9 Merge branch '3.1' into 3.2 2021-04-07 22:05:04 +02:00
Georg Richter
13bcf7cfdf Fix for CONC-539
Added cipher suites ECDHE-RSA-AES128-SHA256 (0xC027) and
ECDHE-RSA-AES256-SHA384 (0xC028) to the cipher map which maps
cipher suite names to the corresponding algorithm ids.

Since this list is still incomplete, and additional list containing
the cipher suite ids and openssl cipher suite names was added. This
list will be used now to detect the cipher suite for the current
connection.
2021-04-01 07:15:29 +02:00
Rucha Deodhar
a08fd79afd MDEV-22189: Change error messages inside code to have mariadb instead of
mysql

This patch is made as a part of MDEV-22189 which required changing error
messages for client.
2021-03-26 00:23:51 +05:30
Ryuta Kamizono
55f71a800b Fix typo utf8m4 -> utf8mb4 2021-03-25 23:40:58 +05:30
Georg Richter
f97c938e23 Fix for CONC-537: Only read from MYSQL_HOME if MARIADB_HOME is not set
To allow to use different configuration directories for MariaDB and MySQL,
configuration files from MYSQL_HOME environment variable will be
processed only, if MARIADB_HOME environment variable was not set.
2021-03-25 23:40:58 +05:30
Georg Richter
7ac85a38fd Fix for CONC-535: disabled checksum ignored in events
QUERY_EVENT and ANNOTATE_ROWS_EVENT don't check if the crc32
checksum option is disabled and strip always 4 bytes from
protocol buffer.

Kudos to Ruslan Altynbaev for reporting and providing this small fix.
2021-03-25 23:40:58 +05:30
Georg Richter
5719e9e51d Merge branch '3.1' of https://github.com/mariadb-corporation/mariadb-connector-c into 3.1 2021-03-22 10:18:45 +01:00
Georg Richter
80d9aaa723 Fix for CONC-537: Only read from MYSQL_HOME if MARIADB_HOME is not set
To allow to use different configuration directories for MariaDB and MySQL,
configuration files from MYSQL_HOME environment variable will be
processed only, if MARIADB_HOME environment variable was not set.
2021-03-22 10:16:13 +01:00
Georg Richter
26c66aed26 Merge pull request #155 from kamipo/patch-1
Fix typo utf8m4 -> utf8mb4
2021-03-22 09:38:30 +01:00
Georg Richter
d272377f89 Fix for CONC-535: disabled checksum ignored in events
QUERY_EVENT and ANNOTATE_ROWS_EVENT don't check if the crc32
checksum option is disabled and strip always 4 bytes from
protocol buffer.

Kudos to Ruslan Altynbaev for reporting and providing this small fix.
2021-03-22 09:28:46 +01:00
Georg Richter
b36d89685e Merge branch '3.1' into 3.2 2021-03-15 08:25:59 +01:00
Georg Richter
c23ecca2a8 Fix for CONC-475:
The function mariadb_rpl_init_ex was not listed in the the list
of exported replication/binlog API functions.
2021-03-15 07:18:43 +01:00
Vladislav Vaintroub
4aa1734f05 Merge remote-tracking branch 'origin/3.1' into 3.2
# Conflicts:
#	CMakeLists.txt
2021-03-12 12:40:16 +01:00
Vladislav Vaintroub
fc431a035a Support MSVC ASAN 2021-03-12 00:29:16 +01:00
Georg Richter
ca1ea5c1a2 Fix for CONC-525: Support LOAD * LOCAL INFILE statements in binary protocol
With implementation of MDEV-16708 (support all commands in binary protocol) we
need to check for local infile in text and binary protocol. Therefore the local
infile relevant part from ma_simple_command was moved to mthd_my_send_cmd method.
2021-02-23 07:55:35 +01:00
Ryuta Kamizono
b8eed18f78 Fix typo utf8m4 -> utf8mb4 2021-02-21 16:37:09 +09:00
Marko Mäkelä
375bab0d51 Merge 3.1 into 3.2 2021-02-16 18:44:15 +02:00
Georg Richter
ef3d315796 Test case fix:
unittests always reset the default connection (and depending statements)
which might end up in an error when trying to close a statement which was
not prepared before.
In this case mysql_stmt_reset only needs to set statement status to
MYSQL_STMT_PREPARE if the statement id was set before.
2021-01-18 18:23:17 +01:00
Georg Richter
2ff01c121c Fix for CONC-518:
Check if mysql->options.extension was allocated before checking
async_context: this is handled by IS_MYSQL_ASYNC() macro now.
2020-11-27 18:33:06 +01:00
Georg Richter
820faff627 codespell fixes, removed MSDOS preprocessor macros 2020-11-26 09:07:17 +01:00
Georg Richter
b1c2d4e0db Merge remote-tracking branch 'origin/3.1' into 3.2 2020-11-18 11:32:30 +01:00
Georg Richter
79137a4ae1 Fix for CONC-517: C/C looks for plugins in wrong locatio on Windows
If the plugin dir wasn't specified via mysql_optionsv() or the
 environment variable MARIADB_PLUGIN_DIR wasn't set, the plugin
needs to be read from the default location (current path, DLPATH
or PATH).
2020-11-18 09:05:54 +01:00
Vladislav Vaintroub
777460c226 Fix C11 conformance
Ellipsis in variadic macro requires at least 1 argument
2020-11-12 23:24:19 +00:00
Georg Richter
02f9574766 Merge branch '3.1' into 3.2 2020-11-06 07:06:23 +01:00
Marko Mäkelä
e382442206 CONC-514 ma_net_write_buff() invokes memcpy() on null pointer
When the function ma_net_write_buff() is invoked with len=0,
it may call memcpy() on a null pointer, which is flagged in
WITH_UBSAN builds.
2020-10-30 16:22:59 +02:00
Georg Richter
93618b4036 Fix for CONC-512: truncation check for float values fails on i386
Due to gcc bug 323 (optimized code gives strange floating point results)
we need to declare floating point variable as volatile, to make sure it
will be reread from memory when converting a long long value to float.
2020-10-30 08:18:44 +01:00
Georg Richter
561dcf80dd Merge branch '3.1' into 3.2 2020-10-21 07:40:53 +02:00
Georg Richter
ca4f043cfe Fix for CONC-507:
Setting max_allowed_packet in every ma_net_init() call may lead to
race conditions (Thanks to Alexander Sapin for reporting this issue).
Global variables max_allowed_packet_size and
net_buffer_size can be set via mysql_optionsv. If globally and not
per connection this should happen immeidately after library initialization.
2020-10-20 19:32:49 +02:00
Vladislav Vaintroub
6a763b9000 MDEV-19237 - do not resend prepared statement metadata unnecessarily
fix warnings
2020-10-20 14:58:37 +02:00
Georg Richter
b2966c05e4 Revert "MDEV-19237 - do not resend prepared statement metadata unnecessarily":
This reverts commit ed4d747510.
2020-10-20 14:57:22 +02:00
Vladislav Vaintroub
ed4d747510 MDEV-19237 - do not resend prepared statement metadata unnecessarily
fix warnings
2020-10-15 22:25:09 +02:00
Georg Richter
6cf8ccc14f Build fix for OpenSSL 1.1.0 2020-10-06 15:30:05 +02:00
Georg Richter
55a64c1bd5 Fix for CONC-504: reset stmt->result.rows when executing mysql_stmt_next_result
While in text protocol the number of rows is resetted in mysql_store/use_result
in binary protocol we need to explicitly reset it when switching to next result set.
2020-10-02 09:47:52 +02:00
Georg Richter
c17947c68a Partially revert of 9a50a7d:
Instead of cheking GetConsoleWindow() function, we need to check
if GetConsoleCP() returns a positive number, otherwise we will use
the ANSI Code page Identifier for the system (GetACP()).
2020-10-01 07:32:13 +02:00
Georg Richter
42d32ba95f Fix for mariadb_stmt_execute_direct():
- If prepare failed, we need to ignore errormessage from mysql_stmt_execute()
(which is always an error packet, mentioning invalid sttmt_id)
- Added additional check in mysql_stmt_reset for stmt_id == -1.
2020-09-30 16:19:31 +02:00
Vladislav Vaintroub
c0837c3b8d MDEV-21612 Remove COM_MULTI.
The server command code 254 is now reserved,
as well as corresponding protocol flag.

Do not reuse them.
2020-09-22 17:26:04 +02:00
Georg Richter
ee2216aa3f Build fix for OpenSSL < 1.1 2020-09-18 09:25:08 +02:00
Georg Richter
65cf891e49 CONC-501: Support for TLSv1.3 cipher suites
Added support for TLSv1.3 cipher suites, which require a separate API call.
2020-09-18 08:31:03 +02:00
Georg Richter
159540fe8c OpenSSL fixes:
Since we still need to support OpenSSL 1.0.2 everything is now loaded
in context instead of ssl.
If handshake failed, we now call SSL_get_verify_result for getting a more
defailed error message in case certificate alerts were raised (e.g. revocation)
2020-09-17 10:41:01 +02:00
Georg Richter
f885593e59 Don't load certificates in global context. 2020-09-16 07:42:06 +02:00
Georg Richter
0157f3db88 Revert "Follow up of 7b8b5ddae280b2d33e2b3fce8446f679521a75be:"
The fix fails with ssl_crl server test, since certificates are loaded
in global context. If there is a valid certificate in global context,
certificate revocation test on server will fail.

This reverts commit db385afbbe.
2020-09-16 07:28:41 +02:00
Georg Richter
db385afbbe Follow up of 7b8b5ddae2:
Since we load the certificate chain in context, we need to load also key in context.
2020-09-15 17:14:15 +02:00
Georg Richter
7b8b5ddae2 Fix for CONC-500:
Only use SSL_CTX_use_certificate_chain_file to load and check the certificate.
2020-09-14 17:21:19 +02:00
Georg Richter
7052619cc4 Added build option WITH_ICONV.
Default is OFF, which means MariaDB Connector/C
will be built without iconv support.

If set to OFF The API function mariadb_convert_string will always
return -1 and errorcode ENOTSUP.
2020-09-14 12:01:06 +02:00
Georg Richter
828f37eefa Merge pull request #148 from EGuesnet/AIX2
AIX build
2020-09-13 15:47:41 +02:00
xantares
9d7c233e8d Fix include on case-sensitive fs
shlwapi is lowercase on case-sensitive file-systems
2020-09-12 14:29:56 +02:00
Georg Richter
29a3396456 CONC-302: Added support for SESSION_TRACK_GTIDS (MySQL server) 2020-09-12 10:58:33 +02:00