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
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
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
Georg Richter
9661ddaefb Fixed compiler warnings (introduced by changeset b78ba1b251) 2021-06-24 15:05:08 +02:00
Georg Richter
353e99fba1 More test fixes 2021-06-24 12:48:16 +02:00
Georg Richter
47df15edb6 Fixed compiler warnings (introduced by changeset b78ba1b251) 2021-06-24 11:27:07 +02:00
kolzeq
25e38080cb Merge branch '3.1' into 3.2-diego
# Conflicts:
#	.travis.yml
#	unittest/libmariadb/charset.c
#	unittest/libmariadb/connection.c
2021-06-17 10:54:30 +02:00
kolzeq
94e85cdd4b testing various correction
travis: use connector-test-machine test script that permit to run the following tests :

* MariaDB all supported version
* Maxscale
* MySQL
* SkySQL

If CONNECTOR_TEST_SECRET_KEY is not provided (PR) only MariaDB and MySQL community will be test
Pull request testing correction

appveyor correction using archive if not latest server release
2021-06-15 17:09:10 +02:00
Georg Richter
aca697e5a1 Travis test fixes
Since 10.6 server returns utf8mb3 for character set (and it will change
to utf8mb4), so we use strncmp to check the character set returned by
server.
2021-06-09 07:29:56 +02:00
Georg Richter
01ada4b85f Merge branch '3.1' into 3.2 2021-05-03 14:01:37 +02:00
Georg Richter
9244281d6b Fix for CONC-490:
If CLIENT_CONNECT_WITH_DB flag was specified without a database name,
we need to unset this flag to prevent breaking connection handshake.
2021-04-29 10:59:25 +02:00
Rucha Deodhar
2f7230c62b MDEV-8334: Rename utf8 to utf8mb3
This patch is made as a part of MDEV-8334 to fix failing test in unit and
main test suite so that utf8mb3 characterset is recognized. Failing tests:
main.mysql_client_test
main.mysql_client_test_comp
unit.conc_basic-t
unit.conc_charset
unit.conc_connection
2021-04-17 02:10:25 +05:30
Oleksandr Byelkin
b503e52288 fix problems found by 10.0 2021-01-27 13:13:31 +01:00
Anton Golovenko
a7e888b518 Test bugs fixes 2021-01-20 18:54:55 +05:00
kolzeq
29fc3bc7bd [misc] test improvement
* adding SkySQL HA to test suite
* test server build 10.6
* test maxscale 2.5.3
2021-01-19 10:23:14 +01:00
Georg Richter
820faff627 codespell fixes, removed MSDOS preprocessor macros 2020-11-26 09:07:17 +01:00
Georg Richter
03948821ae Test fix:
Drop procedure at end of test.
2020-10-28 10:58:05 +01:00
Georg Richter
b24d337027 More test fixes:
Always provide a message to the FAIL_ macros
2020-10-20 16:17:25 +02:00
Georg Richter
dec58668dd Test fix (appveyor):
Don't use hardcoded schema name, since default schema can be set via
environment variable (or option).
2020-10-20 15:25:05 +02:00
Georg Richter
29a3396456 CONC-302: Added support for SESSION_TRACK_GTIDS (MySQL server) 2020-09-12 10:58:33 +02:00
Georg Richter
2c22f8e71b Don't test session tracking for character set against server < 10.3 2020-09-10 17:27:39 +02:00
Georg Richter
a17e73f953 Skip test_conc496 if session_tracking_transaction_info variable is not available/supported. 2020-09-10 16:30:04 +02:00
Georg Richter
3e699a1738 CONC-496: Added support for SESSION_TRACK_TRANSACTION_STATE in ok packet 2020-09-10 14:03:00 +02:00
Georg Richter
01859950cf Revert "Fix for CONC-494:"
This reverts commit 8581cafad4.
2020-09-09 12:19:27 +02:00
Georg Richter
8581cafad4 Fix for CONC-494:
Install all symlinks for shared and static libraries in
component Development instead of SharedLibraries.
2020-09-09 10:24:55 +02:00
Georg Richter
9637689e5e Test and travis modification for testing against SkySQL 2020-09-02 14:08:19 +02:00
Oleksandr Byelkin
895dcb61e3 C preprocessor defines fix 2020-06-04 16:49:21 +02:00
Georg Richter
37a4fd1d6d Workaround for CONC-469
If no default authentication plugin was specified and the server sends preferred
authentication method in server hello package client now uses servers preferred
authentication method instead of using mysql_native_password. If no default
authentication plugin was specified and the server didn't send an
authenticatoin method client uses the default mysql_native_password plugin.
2020-05-25 11:50:04 +02:00
Georg Richter
66d449fc99 Added test for CONC-443 2019-10-17 18:41:58 +02:00
rusher
158a2d7db3 [MENT-26] Adding Azure CI testing
Tests configured for windows and ubuntu 18.04

Tests with simple password are changed for more complex password to
satisfy possible complex password requirement.
2019-07-22 09:40:53 +02:00
Georg Richter
8473246541 Fix authentication tests:
- specify correct plugin type for checks
- allow access to test schema for ed25519 user
2019-03-04 17:06:00 +01:00
Georg Richter
af47d1beab Merge branch '3.0' into 3.1 2019-03-03 14:03:20 +01:00
Georg Richter
f24915057c Don't close default connection in test_conc392 in case we have to skip test 2019-03-02 14:49:27 +01:00
Georg Richter
0cc2df4180 Follow up of 68d05007bb:
Skip test if the server doesn't support session tracking
2019-03-02 14:26:55 +01:00
Georg Richter
68d05007bb Fix for CONC-392:
Fixed crash when server sent session tracking information with session type
SESSION_TRACK_STATE_CHANGE. In this special case the packet doesn't contain
the overall length. (see https://mariadb.com/kb/en/library/ok_packet/).
2019-03-02 07:54:06 +01:00
Georg Richter
a1469b407a Fix test for expired password.
Followup of 02bf9033ef
2019-02-11 20:13:17 +01:00
Sergei Golubchik
a4effc462d fix connection unit test to work in mtr 2019-02-04 16:05:41 +01:00
Georg Richter
56631c5f8a Fix test for ed25519 2018-12-18 13:48:54 +01:00
Georg Richter
b87845b18d CONC-366: Implementation of ed25519 authentication plugin 2018-12-02 16:58:30 +01:00
Georg Richter
005195f9cb CONC-312: Implementation for caching_sha2_password plugin 2018-12-01 08:56:24 +01: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
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
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
Georg Richter
638f2aa8dd Revert "Fix for CONC-332:"
This reverts commit 0c29fdbbb3.
The fix breaks kill test in mtr (Windows).
2018-05-18 12:24:56 +02:00
Georg Richter
0c29fdbbb3 Fix for CONC-332:
After calling mysql_real_connect or mysql_change_user the server_status was
not updated, since run_plugin_auth didn't read the entire OK packet.
2018-05-17 07:10:15 +02:00
Georg Richter
ec985d92c0 CONC-327:
Add support for !include an !includedir in configuration files
2018-05-02 11:40:42 +02:00
Georg Richter
4adf242564 For expired password test check error codes ER_MUST_CHANGE_PASSWORD (=1820) and ER_MUST_CHANGE_PASSWORD_LOGIN (=1862) 2018-04-20 07:29:50 +02:00