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

594 Commits

Author SHA1 Message Date
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
b4a138cb43 Windows build fixes:
disable conc-317 for windows platforms
2018-05-12 10:44:19 +02:00
luz.paz
212d4051be Fixes misc. typos
found via `codespell -q 3`
2018-05-12 10:43:54 +02:00
Georg Richter
585be643c6 Fix for mariadb_stmt_execute:
If compressed protocol is in use, mariadb_stmt_execute_direct will be emulated by mysql_stmt_prepare and mysql_stmt_execute.
2018-05-12 10:43:20 +02:00
Georg Richter
d83802a3ee Fix for CONC-317:
Parsing of configuration file fails if key/value pairs contain white spaces.
2018-05-12 10:43:15 +02:00
Georg Richter
f39db18ec3 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-05-12 10:43:09 +02:00
Georg Richter
dae524d079 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-05-12 10:43:02 +02:00
Georg Richter
255c4b09ad TLS/SSL test fixes:
- create ssluser to prevent failing test on new db instance
- skip tls_version test when using OpenSSL 1.1.1
2018-05-11 07:15:23 +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
f8ea603fca CONC-321:
Added support for OpenSSL 1.1.1
Tested with OpenSSL 1.1.1 beta 5. For testing TLS v13 the server needs to be patched with patch attached to MDEV-15996.
2018-04-24 18:26:07 +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
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
60e5deec52 Disable cipher mapping test - depending on used OpenSSL version (in client and/or server) several cipher suites might be disabled or removed. 2018-04-18 07:13:21 +02:00
Georg Richter
f226c3b257 Fix for CONC-320:
Non blocking/asynchronous support for OpenSSL and GnuTLS.
Please note that Schannel in asynchronous mode is not supported yet.
2018-04-17 10:35:49 +02:00
Georg Richter
1b95733b57 Windows build fixes:
disable conc-317 for windows platforms
2018-04-14 07:30:19 +02:00
luz.paz
b2e6ed0295 Fixes misc. typos
found via `codespell -q 3`
2018-04-13 07:30:23 +02:00
Georg Richter
748e6fb915 Fix for mariadb_stmt_execute:
If compressed protocol is in use, mariadb_stmt_execute_direct will be emulated by mysql_stmt_prepare and mysql_stmt_execute.
2018-04-12 08:49:26 +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
50d48e91fa Reworked plugin interface
Plugin configuration happens now in CMakeLists.txt files in corresponding plugin directories.

plugins.cmake now contains REGISTER_PLUGIN_FUNCTION which accepts the following parameters:
  - TARGET: the name of the plugin (dynamic plugins will be named ${TARGET}.so (or .dll)
  - SOURCES: source files
  - LIBRARIES: additional libraries for linking
  - INCLUDES: include directories
  - CONFIGURATIONS: possible plugin configurations: valid arguments are DYNAMIC, STATIC, OFF
  - DEFAULT: default configuration (see CONFIGURATIONS)
  - COMPILE_OPTIONS: compiler flags

The default plugin configuration can be specified via cmake parameter -DCLIENT_PLUGIN_${TARGET}=[DYNAMIC|STATIC|OFF]
2018-04-07 07:14:43 +02:00
Georg Richter
83eef02ec8 Test fixes:
for api functions which require string with length parameter (e.g.
  mysql_real_connect() or mysql_stmt_prepare() we now use the macro
  SL(string) which substitutes string and string length.
2018-02-16 13:05:35 +01: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
da9ed3cdd2 Added test for MDEV-15133 2018-02-16 11:45:07 +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
aed8005e2e Fix clang on Windows warnings
- STDCALL is ignored for variable argument functions.
- __attribute__ does work for Clang (also if that pretends to be MSVC)
- remove unused function
- simplify ma_getopt, fixes some strange compile error in clang (about
SSE intrinsics)

- fix some clang warnings
2018-02-09 19:10:50 +01:00
Georg Richter
058fc080b4 Fixed 2 buffer overflows in unittests 2018-01-26 13:04:37 +01:00
Vladislav Vaintroub
935c33b690 Fix Windows size_t warnings. 2018-01-12 18:19:19 +00:00
Georg Richter
c9c40a37a4 TLS/SSL fixes:
- don't run fingerprint and passphrase protected tests if the corresponding
  files (sha1 and encrypted client key) are not found in CERT_PATH
- don't overwrite SSL errors if handshake failed
- Use gnutls read/write instead of pvio
2018-01-10 11:11:02 +01:00
Sergei Golubchik
9fc53fcafa delete a zero-length frm manually
because DROP TABLE won't do it
2017-11-22 18:31:06 +01:00
Georg Richter
e42dd6c0e0 Fix for MDEV-14165:
- The metadata length value for a column with a zerofill flag was calculated with a fixed length instead of using the reported length.
- fixed a possible stackoverflow, if the display width for a column with zerofill flag is greater then 22. (libmysql ps implementation truncates the result after 21 digits and reports truncation error).
2017-10-28 16:46:49 +02:00
Georg Richter
7e53ab3698 Fix compiler warning 2017-10-25 19:08:01 +02:00
Georg Richter
7209efa5aa CONC-282:
Connector/C now provides additional information for package version
mariadb_config --cc_version lists the package version
Beside MARIADB_PACKAGE_VERSION numeric representation MARIADB_PACKAGE_VERSION_ID can be used now within preprocessor directives
2017-10-25 18:32:55 +02:00
Georg Richter
b241f8995f MDEV-14101: tls-version
Client part of MDEV-14101: Add support for tls-version, via
mysql_options(mysql, MARIADB_OPT_TLS_VERSION, value)
Accepted values are "TLSv1.1", "TLSv1.2" and "TLSv1.3".

Fixed testcase openssl_1 for schannel
2017-10-23 11:09:54 +02:00
Georg Richter
abf4bf8024 Provide details about TLS/SSL library in use
When calling mariadb_get_infov with option MARIADB_TLS_LIBRARY
the functioni now returns the correct version number and name
of the tls/ssl library in use.
2017-10-17 15:57:42 +02:00
Georg Richter
7bcd78f93b CONC-286:
- Force TLS/SSL connection if finger print options were specified
- Allow hex finger prints with colon separated 2 digit numbers
2017-10-10 12:25:27 +02:00
Lawrin Novitsky
31f7fb00fc Implementation and testcase for CONC-275 - skipping particular paramset in bulk operation - with help of special indicator value STMT_INDICATOR_IGNORE_ROW set in any column of the row.
The revision also adds some (mainly VS specific) file/dirs definitions to .gitignore to make 'gid status' usable on Windows, and the typo in bulk1 testsuite
2017-10-10 12:23:19 +02: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
240204eaeb Fix for CONC-282: mysql_stmt_fetch_column doesn't work with prior call to mysql_stmt_store_result
- If no bind variables were bound or the function mysql_stmt_store_result was not called before, the internal bind variables (stmt->bind) was not filled (lengths and null values)
2017-09-25 15:45:14 +02: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
Sergei Golubchik
67277fb1d1 followup for e2df6d2: default directories, files, and groups
* do not read ini_exts array beyond the end
* do not use local variable (val) address outside of the variable's scope
* do not read $HOME/my.cnf
* do not create files in the user's $HOME, use $MYSQL_TMP_DIR
* test reading of the executable name group
* fail the test if .my.cnf cannot be opened
2017-07-04 19:34:28 +02:00
Georg Richter
ea8a31e63a Fixed compiler warnings 2017-07-04 13:56:38 +02:00
Georg Richter
6e156a63e3 Fixes for bigendian systems (CONC-252, CONC-265) 2017-06-30 14:00:28 +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
Georg Richter
ff4bfdf1ca Added conversion tests for bulk 2017-06-14 14:04:00 +02:00
Georg Richter
1ea7be32f5 Merge remote-tracking branch 'origin/MDEV-12471' 2017-06-14 11:12:59 +02:00
Georg Richter
e50571e3ab Disallow bulk execution if parameter count is 0 2017-05-15 14:11:59 +02:00