At irregular intervals older windows versions (prior Windows 10) fail to establish a secure (TLS)
connection and return errors SEC_E_INVALID_TOKEN, SEC_E_BUFFER_TOO_SMALL or SEC_E_MESSAGE_ALTERED.
This is a bug in windows schannel library and was only fixed in recent versions, also OpenSSL provided
a workaround (see https://github.com/openssl/openssl/pull/1350).
Since we are unable to fix this, we introduced a workaround for this problem. In case of an error
during TLS handshake we check the errorcode and try to reconnect up to three times if the error code
was SEC_E_INVALID_TOKEN, SEC_E_BUFFER_TOO_SMALL or SEC_E_MESSAGE_ALTERED.
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/).
it's an internal state variable, should be in st_mariadb_extension.
In particular, treating it like an option, caused mysql->options
to be allocated in mysql_init(), which caused failed reconnects
to leak memory:
Direct leak of 10824 byte(s) in 33 object(s) allocated from:
#0 0x7f00db5ba79a in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9879a)
#1 0x55eb1b1d545e in mysql_init /home/buildbot/mariadb-10.2-build24320/libmariadb/libmariadb/mariadb_lib.c:1021
#2 0x55eb1b1e342e in mariadb_reconnect /home/buildbot/mariadb-10.2-build24320/libmariadb/libmariadb/mariadb_lib.c:1621
...
fixed length calculation for connection attributes. We now call mysql_net_store_length passing the size of the connection attribute and substract the offset of the passed buffer to determine the correct size.
Disable LOAD DATA LOCAL INFILE suport by default and
auto-enable it for the duration of one query, if the query
string starts with the word "load". In all other cases the application
should enable LOAD DATA LOCAL INFILE support explicitly.
(Based on Sergei Golubchiks 5.5 server patch)
if a options is unknown or not supported.
This will fix possible error when setting connection attributes.
Kudos to Coray Hickey for providing this patch!
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.
Allow multiple initialization of the client library (mysql_server_init(
mysql_server_end).
Note: This was already fixed by commit for CONC-277, unfortunately the fix
was overwritten by a bad merge.
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.
attribute).
mysql->host is not always set (apparently not when reconnecting),
This made MariaDB C/C produce invalid handshake reply packet
with incorrecly encoded connection attributes. there cannot be connection
attributes with empty values in MySQL protocol.
Fix connector to only send _server_host is host is valid non-empty string.
Also prevent adding connection attributes with empty values.
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)
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)