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
3f43953fcb Fixed test case for expired password
Added test case for ODBC-138
2018-04-20 07:19:40 +02:00
Georg Richter
1b95733b57 Windows build fixes:
disable conc-317 for windows platforms
2018-04-14 07:30:19 +02:00
Georg Richter
679b5b5cb7 Fix for CONC-317:
Parsing of configuration file fails if key/value pairs contain white spaces.
2018-04-12 07:00:43 +02:00
Georg Richter
971fae75a8 Fix for CONC-315:
If no default client character set was specified, the utf8 character set will be used by default (instead of setting the client character set to server character set)
2018-04-11 13:21:05 +02:00
Georg Richter
d3644be080 CONC-314: Support for expired passwords (MySQL Server)
Added option MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS for
mysql_options/mysql_optionsv.

If this option is set, client indicates that he will be able to handle expired passwords by setting the CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS capability flag.
If password expired and CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS is set, the server will not return an error when connecting, but put the connection in sandbox mode, where all commands will return error 1820 (ER_MUST_CHANGE_PASSWORD) unless a new password was set.

Since we frequently update mysqld_error.h error codes from 10.2-server, the ma_error_server.h include file now includes mysqld_error.h (and is just a stub)
2018-04-07 07:42:59 +02:00
Georg Richter
929614903e Travis and Appveyor integration:
- added travis support
  - fixed appveyor settings
  - fixed some warnings (gcc 4.8)
  - removed sleep commands
  - disabled failing tests when running against MySQL server,
    mostly related to stored procedures and binary protocol
  - reverted fix for MDEV_10361

Still open: TLS/SSL appveyor tests, since .msi installation on appveyor doesn't provide certificates.
2018-02-16 12:14:01 +01:00
Georg Richter
eefaadfe21 Removed automatic detection of program name 2018-02-16 11:43:32 +01:00
Vladislav Vaintroub
67cc3438a8 Fix unit test.
Fix send() prototype
2018-02-14 19:35:31 +00:00
Vladislav Vaintroub
931450c3f8 Fix some conversion warnings.
Exclude definitions from my_config.h that conflict with server's config.h
(most of ma_config.h is not used by connector anyway)

Avoid overriding server's SIGN_TARGET() macro, if used as subproject.
Make WITH_UNIT_TESTS exclude unit tests, like it is for the server.
2017-09-30 22:38:53 +00:00
Georg Richter
02f57a9c14 Fix for CONC-276: client library crashes on Windows after TLS reconnect:
The connection pointer mysql is now no longer part (and doesn't need to be updated) of schannel security context, since it can be obtained directly from tls container.
2017-08-24 18:09:50 +02:00
Sergei Golubchik
524f14a8e3 conc_connection fails on 32-bit 2017-07-05 12:06:45 +02:00
Georg Richter
e2df6d2552 Fix for MDEV-12965 and MDEV-13100:
If no configuration file and no configuration group was specified, Connector/C ddoesn't read any configurationm files.
By default the follwing groups will be read:
- client
- client-server
- client-mariadb

If no configuration file was specified, Connector/C looks up for configuration files in following locations:
- Windows:
  - System directory
  - Windows directory
  - C:\
  - Directoy from which the application was started
  - MYSQL_HOME environment variable
- Unix platforms
  - DEFAULT_SYSCONFIR (if specified)
  or
  - /etc and /etc/mysql
  - MYSQL_HOME environment variable
  - .my.cnf in home directory

Special case: If NULL or empty string will be passed for MYSQL_READ_DEFAULT_GROUP option Connector/C will read the default groups and the group which matches the application name.
2017-06-25 14:14:55 +02:00
Sergei Golubchik
e14ed01c8e fix connection unit test 2017-05-09 18:27:52 +02:00
Georg Richter
d2aec415d7 Minor fixes:
fixed compiler warnings in openssl.c and dialog.c
  fixed timeout setting (was wrong in a previous commit)
  disabled session tracking test
2017-05-09 16:40:09 +02:00
Georg Richter
5c4cf7a9b6 Implementation of SHA256 authentication plugin (CONC-229).
On Windows the sha256 plugin doesn't need any external TLS/Crypto libraries, it uses windows cryto library. On non Windws platforms the plugin requires OpenSSL (GnuTLS doesn't support OAEP v2.0 padding yet)
2017-05-08 14:12:17 +02:00
Georg Richter
082b165c6d Smaller test case fixes 2017-03-23 16:53:00 +01:00
Georg Richter
6bec9204f0 Fix for MDEV-12446:
When no default configuration is present, C/C crashed due to double free
in ma_default.c
2017-03-20 07:29:51 +01:00
Georg Richter
aae1d2df74 Fixed test case for reset_connection:
We need to cast with my_ulonglong instead of ulong
2017-03-06 06:33:19 +01:00
Georg Richter
4ab155cf39 Unit test fixes for server integration
- SSL tests require CERT_PATH. Subdirectory certs was removed. If Connector/C is build outside of the server tree, certification path has to be specified manually (-DCERT_PATH=/path/to/certs).
- All tables and users will removed, if the test passed (otherwise mtr will complain).
2017-03-04 17:37:39 +01:00
Georg Richter
87e861c360 client side implemetation for MDEV-10340:
int STDCALL mysql_reset_connection(MYSQL *mysql)
2016-12-29 19:10:35 +01:00
Georg Richter
c8dd0899d4 When an attempt to open a unix sucket failed, the socket was not properly closed. 2016-09-24 11:14:53 +02:00
Georg Richter
b0506f63e9 Instead of mysql_real_connect in tests we call now my_test_connect to apply global options like tls usage 2016-09-08 07:59:34 +02:00
Georg Richter
9f88e25fd6 Compiler warning fixes 2016-09-03 12:46:50 +02:00
Georg Richter
429b166cbe Move mariadb specific client flags and server capabilities to mysql->extension 2016-08-16 14:58:15 +02:00
Georg Richter
ecf26f7e6f Added support for indicator variables
Fixed windows compilation bug
2016-07-08 12:51:26 +02:00
Georg Richter
26d31929d4 several fixes for mariadb_stmt_execute_direct:
- allow param binding via mysql_stmt_attr_set:
  mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, &param_count);
- If a prepared statement will be reexecuted, we send COM_STMT_CLOSE
  together with COM_STMT_PREPARE and COM_STMT_EXECUTE
2016-06-18 14:07:28 +02:00
Georg Richter
c70128b50c Fix for CONC-173: Fixed memory leak in mysql_real_connect
fixed warning in pthread_once
2016-04-18 09:32:25 +02:00
Georg Richter
b4efe73c9e session tracking implementation (10.2-integration):
- At the moment the following session tracking types are supported:
  SESSION_TRACK_SCHEMA
  SESSION_TRACK_SYSTEM_VARIABLES
  SESSION_TRACK_STATE_CHANGE
  SESSION_TRACK_TRANSACTION_CHARACTERISTICS
- New API functions
  mysql_session_track_get_next
  mysql_session_track_get_first
2016-03-31 08:41:12 +02:00
Georg Richter
21be8f4eef Moved connection_handler to mysql->extension 2016-03-29 09:44:03 +02:00
Georg Richter
bea035a72b - Unittests: link static library instead of dynamic
- TLS/SSL: renamed HAVE_SSL to HAVE_TLS to avoid trouble in
  10.2-integration
- Fixed wrong timeout in non-blocking mode
- Fixed valgrind error in prepared statement
2016-03-28 10:29:55 +02:00
Georg Richter
4b1e94bccc Since we use TLS and not SSL functions and structures were renamed
from SSL to TLS
2016-03-16 18:20:08 +01:00
Georg Richter
cc0c34554d - Fixes for 10.2-integration
- As requested by Wlad we use connect timeout for read/write unless
    the connection was established.
- Added experimental session cache support for OpenSSL. It's currently
  disabled
2016-03-08 17:08:01 +01:00
Georg Richter
4ca933bb81 Global cleanup:
removed global locks
  removed dead code and files
  removed dbug
2016-02-08 18:43:02 +01:00
Georg Richter
f8912935b1 - Fixed several aurora plugin crashes (after reconnect)
- moved mysql->reconnect to mysql->options.reconnect
2016-01-16 07:04:28 +01:00
Georg Richter
4cb9b79ced renamed MARIADB_OPT_SSL_PASSWORD to PASSPHRASE
Since MySQL server is picky about cipher suites, cipher suites in GnuTLS
switched back to default (NORMAL) without RHE_DSA
2016-01-05 09:49:49 +01:00
Georg Richter
4c7e5cbd1b Added new option MARIADB_OPT_USERDATA.
Syntax: mysql_optionsv(MYSQL *mysql, MYSQL_OPT_USERDATA, void *key, void
*data)
2015-12-14 11:56:17 +01:00
Georg Richter
da017f5381 Merge branch 'master' of https://github.com/MariaDB/mariadb-connector-c
Conflicts:
	CMakeLists.txt
2015-12-10 12:55:02 +01:00
Georg Richter
bec245a913 Initial aurora implementation 2015-12-10 12:52:51 +01:00
Georg Richter
edcfe061c1 Added new functions mysql_get_optionv and mysql_get_option 2015-12-10 06:51:01 +01:00
Georg Richter
32f1903f97 Added new option MARIADB_OPT_SSL_PASSWORD which allows use of
decrypted client certificate (private key only).
Currently this option is supported by GnuTLS and OpenSSL only
2015-11-13 12:41:29 +01:00
Georg Richter
e85caa83ca Added new test for testing binding interfaces:
To run these tests a TCP/IP connection is required and
  the environment variable MYSQL_TEST_BINADDR has to be specified.
2015-11-02 18:42:00 +01:00
Eric Herman
f10aa72112 fix compiler cast warnings in unittests
size_t is not always an unsigned long on all platforms, but for diagnostic
message in a test, it should be fine to cast it this way

addresses these warnings:

unittest/libmariadb/connection.c:635:3: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'time_t' [-Wformat=]
   diag("elapsed: %u", elapsed);

unittest/libmariadb/dyncol.c:149:5: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]
     diag("%s %d", my_keys[i].str, my_keys[i].length);

unittest/libmariadb/dyncol.c:227:5: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]
     diag("Key: %s Len: %d", unpack_keys[i].str, unpack_keys[i].length);
2015-10-16 11:55:01 +02:00
Georg Richter
c516ca70b3 We now build an object library which prevents compiling sources twice (for shared and static libraries)
Fixed test cases
2015-01-21 11:47:34 +01:00
Georg Richter
0e92a68589 (Corrected) Fix for CONC-118: memory leak when reconnecting 2015-01-14 15:29:27 +01:00
Georg Richter
2ceb2f7ffc Fix for conc-77: Backslash escaped quotes (', "") are not parsed correctly 2014-02-10 09:04:01 +01:00
holzboote@googlemail.com
8c0a7fff46 Fix for CONC-70: Unknown error when reading large packets via conpressed protocol 2014-01-27 21:14:02 +01:00
holzboote@googlemail.com
1b36e6d3b5 Fix for CONC-66: Support for quoted values in configuration file 2014-01-22 22:31:08 +01:00
holzboote@googlemail.com
a6ee40ab8e Added mingw support (Win32). Special thanks to Eric Trinh for his patch! 2014-01-11 20:09:32 +01:00
Georg Richter
1fabe4eaac Fixes for DBD:mysql (CONC-57)
added missing functions mysql_read_query_result and mysql_get_parameters
2013-10-14 14:17:54 +02:00
holzboote@googlemail.com
725425a9c4 Fixes for Win64 build 2013-10-10 15:14:15 +02:00