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
5f1f517cfa Various typo fixes
Includes fixes from PR-201.
2022-07-03 13:45:37 +02:00
Georg Richter
35826cd51c Test fix for test_bug4236 2022-06-29 13:27:28 +02:00
Georg Richter
fcce4a8c76 CONC-592: Register replica with host and port
Added new option MARIADB_OPT_RPL_REGISTER_REPLICA which expects
two parameters, host and port. When this option was set, rpl_open
will send a COM_REGISTER_SLAVE command with server_id, host and
port to the connected server. This information can be retrieved
by "SHOW SLAVE STATUS" command.

Example:

rc= mysql_optionsv(mysql, MARIADB_OPT_RPL_REGISTER_REPLICA,
                   "myhost", 123);
2022-05-23 14:05:06 +02:00
Georg Richter
fb1b3ad2a3 Merge branch '3.3' of https://github.com/mariadb-corporation/mariadb-connector-c into 3.3 2022-05-19 16:40:21 +02:00
Georg Richter
4fc7903cf3 test fix:
skip conc336 when testing against XPAND
2022-05-05 19:33:01 +02:00
Georg Richter
3ec6ba753d Skip test conc_336 if we test against XPAND
Due to timeout problems when testing against XPAND,
conc_336 will be disabled if tested with XPAND.
2022-05-04 14:59:14 +02:00
Georg Richter
0d20e47fe5 unittests: print server tls information 2022-04-28 13:10:44 +02:00
Georg Richter
f60a31b5a8 Debug information for tests:
Print tls releated server variables
2022-04-21 11:59:14 +02:00
rusher
ed083576af [misc] correct declaration-after-statement issue 2022-04-14 09:47:21 +02:00
diego Dupin
fb85d99d13 Adding xpand to test suite 2022-03-23 11:46:40 +01:00
Georg Richter
2b6a8c44c5 Merge branch '3.2' into 3.3 2022-03-01 11:30:59 +01:00
Georg Richter
bc9458893f Merge branch '3.1' into 3.2 2022-03-01 11:28:33 +01:00
Georg Richter
367772c5c9 Skip test_mdev19838 when running vs. maxscale 2022-03-01 10:53:57 +01:00
Georg Richter
abc1cf89f1 Test fix:
For detecting if we test against MaxScale check also if
mysql_get_server_info contains "maxScale".
2022-03-01 10:23:34 +01:00
Georg Richter
f3c036e425 Merge branch '3.2' into 3.3 2022-01-26 09:03:31 +01:00
Georg Richter
bc5e8a7964 Merge branch '3.1' into 3.2 2022-01-26 09:02:47 +01:00
Oleksandr Byelkin
f6c3d9fd2a Fix for according to C90 2022-01-25 10:16:07 +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
Georg Richter
37b3760ac9 travis:
- disabled conc566 test when running against SkySQL
- added 10.7 server
2021-11-18 17:00:45 +01:00
Georg Richter
a1feead1e1 CONC-365: Failover capabilities
host parameter of mysql_real_connect (and corresponding configuration
settings MYSQL_OPT_HOST for mysql_options() api call and host key in
configuration files) now accepts to specify multiple hosts and ports.

When establishing a connection, the list of specified hosts is run
through until a connection can be established. If no connection
can be established to any of the specified hosts, an error is returned.

Specifications for multiple hosts/ports:

- hostname and port must be seperated by a colon (:)
- IPv6 addresses must be enclosed within square brackets
- hostname:port pairs must be be seperated by a comma (,)
- if only one host:port was specified, the host string needs to end
  with a comma.
- if no port was specified, the default port will be used.

Examples for failover host string:

host=[::1]:3306,192.168.0.1:3306,test.example.com
host=localhost:3306,
2021-11-11 19:08:43 +01:00
Georg Richter
515361df66 CONC-274: connection string support
A connection string contains key/value pairs, separated by a semicolon
as used in ODBC. Supported keys are all configuration options which can
be used in MariaDB configuration files. For a complete list check
https://github.com/mariadb-corporation/mariadb-connector-c/wiki/config_files#configuration-options.
The connection string must contain at least one semicolon, otherwise
it wil be interpreted as hostname. Unknown or invalid keys will be ignored.

To connect via connection string, the following methods might be used:

- by specifing connection option in configuration file:

  connection=host=localhost;ssl_enforce=1;

-  by using mariadb_connect() macro

   mariadb_connect(mysql, "host=localhost;ssl_enforce=1")

-  by passing connection string in host parameter to mysql_real_connect

   mysql_real_connect(mysql, "host=localhost;ssl_enforce=1", NULL, NULL, NULL, 0, NULL, 0)
2021-11-05 06:31:58 +01:00
Georg Richter
e8fc259320 CONC-467: Rotate event doesn't handle filename correctly
When receiving a ROTATE event, the offset of filename
was not computed correctly. Similiar to the
BINLOG_CHECK_POINT event filename will also be stored
in MARIADB_RPL handle
2021-10-09 10:44:04 +02:00
Georg Richter
004f9d4217 CONC-470: Support for semi synchronous replication
Beside already supported asynchronous replication
the replication/binlog API now supports semi
synchronous replication:

If an event contains a semi synchronous indicator (0xEF)
behind status byte and acknowledgement flag is set,
mariadb_rpl_fetch() automatically sends an acknowledge
message to the connected primary server.
2021-10-09 08:26:15 +02:00
Georg Richter
52934a1c08 Merge branch '3.2' into 3.3 2021-10-08 10:26:06 +02:00
Marko Mäkelä
5cd74de9f1 Merge 3.1 into 3.2 2021-10-06 10:26:42 +03:00
Marko Mäkelä
80188c3859 MDEV-26761 test_mdev19838() fixup: type mismatch on 64-bit Windows 2021-10-06 07:06:55 +03:00
Marko Mäkelä
8574d0b840 Merge 3.1 into 3.2 2021-10-05 16:59:15 +03:00
Marko Mäkelä
33853036dd fixup 9c02505474: build failure outside clang 2021-10-05 16:48:31 +03:00
Marko Mäkelä
f4772150d2 CONC-566 fixup: unit test cleanup 2021-10-05 16:48:07 +03:00
Georg Richter
2933a1ca75 Merge branch '3.1' into 3.2 2021-10-05 15:19:59 +02:00
Georg Richter
ae9f14534c Merge branch '3.1' of https://github.com/mariadb-corporation/mariadb-connector-c into 3.1 2021-10-05 14:54:16 +02:00
Georg Richter
9c02505474 Fixed for MDEV-26761:
If mariadb_stmt_execute_direct fails, we need to set the number
of parameters (obtained by response packet of mysql_stmt_prepare)
back to the number of prebinded parameters to avoid memory
overrun.

This fix also includes several adress-sanitizer bugs in unit tests
of Connector/C.
2021-10-05 14:50:32 +02:00
SergMariaDB
80215e221d Merge pull request #171 from pasha-bolokhov/patch-1
Update async.c
2021-10-05 05:26:31 -04:00
Georg Richter
18f7cf423f Merge branch '3.1' into 3.2 2021-09-25 16:28:04 +02:00
Georg Richter
4b9379b2aa Fix for CONC-566:
If cursor type is set to read only, and SERVER_STATUS_CURSOR_EXISTS
flag was not set in the server_status of EOF packet, the assumption
was made that a single result set will follow which will be stored
by a call to mysql_stmt_store_result().

As the example in the bug report shows, this is not always the case,
since a stored procedure call might also unset the CURSOR flag and
will always return multiple result sets. In this case it will be
handled now as "normal" unbuffered result set.
2021-09-25 16:07:24 +02:00
Georg Richter
e142c3b24a Skip test for CONC-544 when testing against SkySQL/MaxScale. 2021-09-14 07:11:19 +02:00
Georg Richter
7e0be5a919 CONC-544: restrict authentication plugins
Added new option MARIADB_OPT_RESTRICTED_AUTH (and corresponding
"restricted-auth" option for configuration files) which specifies
on or more comma spearated authentication plugins which are allowed
for authenication.

If the server asks for an authentication plugin not listed in this
option the connect attempt will fail with error CR_PLUGIN_NOT_ALLOWED.
2021-09-14 06:24:56 +02:00
diego Dupin
2ca0c22fd3 correct test after 3.1 merge 2021-08-31 19:02:43 +02:00
Marko Mäkelä
fc25d79083 Merge 3.1 into 3.2 2021-08-31 10:28:30 +03:00
Marko Mäkelä
42cb1e442c test_bug38486(): Do not leave behind a garbage table
This fixes "Check of testcase failed for: unit.conc_cursor"
in the MariaDB Server test suite.
2021-08-25 09:37:42 +03:00
Marko Mäkelä
9990ab7d49 Fix clang -Wunused-but-set-variable 2021-08-25 09:10:10 +03:00
Georg Richter
7cf38704c9 Merge branch '3.1' into 3.2 2021-07-28 06:06:11 +02:00
Sergei Golubchik
0cc16f18c1 compilation failure with gcc 4.8.5
/home/buildbot/buildbot/build/libmariadb/unittest/libmariadb/ps.c:5152:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (unsigned int i=0; i < mysql_field_count(mysql); i++)
   ^
/home/buildbot/buildbot/build/libmariadb/unittest/libmariadb/ps.c:5152:3: note: use option -std=c99 or -std=gnu99 to compile your code
2021-07-27 20:43:37 +02:00
Georg Richter
547fc4987b Post-merge fix:
Prevent double freeing of result set
2021-07-26 18:10:34 +02:00