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

108 Commits

Author SHA1 Message Date
Georg Richter
7d5511c2e3 Fix warning in misc.c unittest 2018-12-01 18:07:20 +01: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
eefaadfe21 Removed automatic detection of program name 2018-02-16 11:43:32 +01:00
Vladislav Vaintroub
935c33b690 Fix Windows size_t warnings. 2018-01-12 18:19:19 +00: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
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
082b165c6d Smaller test case fixes 2017-03-23 16:53:00 +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
ab3ffdc473 removed api function mysql_get_server_status (introduced in last commit). Instead of mariadb_get_infov now supports additional parameters:
* MARIADB_CONNECTION_SERVER_STATUS
* MARIADB_CONNECTION_SERVER_CAPABILITIES
* MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES
* MARIADB_CONNECTION_CLIENT_CAPABILITIES
2016-12-13 07:09:06 +01:00
Georg Richter
7a1e3a699d - Fixed crash in prepared statement: Indicator variable should be checked only if we are in bulk operation mode (=stmt->array_size > 0 and bulk is supported by server
- Added new api function mysql_get_server_status, so client applications no longer need to access members of the mysql structure
2016-12-10 14:09:53 +01:00
Georg Richter
aabaac04aa Plugin fixes
- include ma_errmsg.h if plugin is built dynamically
- trace_example fixes
2016-11-24 08:56:27 +01:00
Georg Richter
c20974b039 - removed global context for tls, so code can be used also with no yassl branch in 10.2
- added new gnutls cipher mapping
- fixed ssl test case: skip hostname verification if both server and client run on localhost
- added server certificates
2016-10-17 16:02:51 +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
ecf26f7e6f Added support for indicator variables
Fixed windows compilation bug
2016-07-08 12:51:26 +02:00
Georg Richter
21be8f4eef Moved connection_handler to mysql->extension 2016-03-29 09:44:03 +02:00
Georg Richter
89fce625b5 Build fixes for 10.2 integration 2016-03-01 13:54:33 +01:00
Georg Richter
38b78704e0 Fix for read/write timeout for sockets on non Windows platforms 2016-02-23 13:25:03 +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
e138995b87 more fixes for 10.2 integration 2016-02-02 20:09:42 +01:00
Georg Richter
f9232bacff Fixed redefinition for ssl structure 2016-01-18 06:36:38 +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
b5cf443681 Windows fixes for remote_io plugin 2016-01-04 10:02:10 +01:00
Georg Richter
5f98f7710a Fixed mysql_api methods: On Windows functions need to be declared with
STDCALL.
Fixed warning in my_context.h
2015-12-29 20:37:18 +01:00
Georg Richter
d73e4c23a2 Added new API function mysql_get_info/mysql_get_infov which retrieves
global or connection dependent information:

mysql_get_infov(MYSQL *mysql, enum mariadb_value value, void *arg, ...)

the following value types are supported:
    MARIADB_CHARSET_ID (requires numeric 4th parameter)
    MARIADB_CHARSET_INFO (requires string 4th parameter)
    MARIADB_CHARSET_NAME
    MARIADB_CLIENT_ERRORS
    MARIADB_CLIENT_VERSION
    MARIADB_CLIENT_VERSION_ID
    MARIADB_CONNECTION_ASYNC_TIMEOUT
    MARIADB_CONNECTION_ASYNC_TIMEOUT_MS
    MARIADB_CONNECTION_HOST
    MARIADB_CONNECTION_INFO
    MARIADB_CONNECTION_PORT
    MARIADB_CONNECTION_PROTOCOL_VERSION_ID
    MARIADB_CONNECTION_PVIO_TYPE
    MARIADB_CONNECTION_SCHEMA
    MARIADB_CONNECTION_SERVER_TYPE
    MARIADB_CONNECTION_SERVER_VERSION
    MARIADB_CONNECTION_SERVER_VERSION_ID
    MARIADB_CONNECTION_SOCKET
    MARIADB_CONNECTION_SSL_CIPHER
    MARIADB_CONNECTION_SSL_VERSION
    MARIADB_CONNECTION_SSL_VERSION_ID
    MARIADB_CONNECTION_TYPE
    MARIADB_CONNECTION_UNIX_SOCKET
    MARIADB_CONNECTION_USER
    MARIADB_MAX_ALLOWED_PACKET
    MARIADB_NET_BUFFER_LENGTH

MARIADB_CONNECTION prefix indicates that a valid connection handle has
to be passed as first parameter.
2015-12-28 07:32:53 +01:00
Georg Richter
f30bb95c6a Fix for asynchronous (reconnect)
Fixed memory leak after reconnect/change user
2015-11-19 16:55:25 +01:00
Georg Richter
72f7c4abf5 Windows 64-bit fixes:
changed type of length parameter in mysql_stmt_prepare,
mysql_real_query, mysql_stmt_send_long_data (incl. async _start
functions) from unsigned long to size_t.
Fixed warnings
2015-11-05 11:52:50 +01:00
Georg Richter
5827c04551 Windows build fixes 2015-10-19 09:52:30 +02:00
Georg Richter
74e62c2892 Merge remote-tracking branch 'origin/master' into cio
Conflicts:
	CMakeLists.txt
	include/mysql/client_plugin.h
	libmariadb/client_plugin.c.in
	libmariadb/libmariadb.c
	libmariadb/ma_secure.c
	libmariadb/my_malloc.c
	libmariadb/net.c
	plugins/io/CMakeLists.txt
	unittest/libmariadb/misc.c
2015-10-02 12:28:54 +02:00
Georg Richter
05659c872e More plugin configuration changes (last commit was incomplete) 2015-10-02 10:09:41 +02:00
Georg Richter
0bc7dc5e3c Added build option WITH_REMOTEIO (default=off) 2015-09-19 13:02:30 +02:00
Georg Richter
4597cd6a80 Various ssl and schannel fixes 2015-09-10 17:16:21 +02:00
Georg Richter
f886562fb2 Initial cio implementation 2015-08-06 13:06:54 +02:00
Georg Richter
8680b5794f Minor windows fixes 2015-04-07 17:06:35 +02:00
Georg Richter
95724c85a5 Added support for remote files via plugin.
This will allow to read and import data from remote locations, e.g.
LOAD DATA LOCAL INFILE 'htp://www.example.com' or
mysql_options(mysql, MYSQL_READ_DEFAULT_FILE, "http://localhost/test.cnf");
The implementation uses libcurl. For a list of supported URL types
see http://curl.haxx.se/libcurl/
2015-03-18 19:52:51 +01:00
Georg Richter
04c05f4d44 Fix for CONC-117:
if reconnecting fails (e.g. server has gone) we don't freee memory associated with tmp_mysql.
2014-12-21 17:43:38 +01:00
Georg Richter
6bfad6e025 Fixed misc.c (was test case for CONC-114) 2014-12-09 20:11:54 +01:00
Georg Richter
088fdacfc1 Fixed vio for non-blocking API calls 2014-11-12 18:10:22 +01:00
holzboote@googlemail.com
fc5859154e Fix for CONC-101: redefinition of dlerror 2014-07-14 11:50:16 +02:00
holzboote@googlemail.com
8cab5e53a4 Unittest fixes (recommit to start/test buildbot) 2014-04-02 18:21:30 +02: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
a6ee40ab8e Added mingw support (Win32). Special thanks to Eric Trinh for his patch! 2014-01-11 20:09:32 +01:00
holzboote@googlemail.com
9552507348 Minor prepared statement fixes for time/date/datetime/timestamp types
Added flag MADB_BIND_DUMMY which allows binding empty buffers
2013-10-26 18:55:24 +02:00
Georg Richter
7038dc9280 Removed all internal dependencies from ma_dyncol.
Fixed compiler warnings
2013-10-01 09:53:41 +02:00