Instead of getlogin() we first try to determine the current user of the process
by calling getpwuid(). If for some reaon getpwuid() will fail, we will use getlogin() instead.
mysql_list_processlists was marked as deprecated in MySQL 4.0 and not
updated anymore. It exists still in latest MySQL and MariaDB connectors.
It now supports the 4.1 protocol, using 7 instead of 5 fields.
The following functions are now marked deprecated in source:
* mysql_list_dbs
* mysql_list_tables
* mysql_list_processes
Various coverity scan fixes, including CONC-452 and CONC-453.
Special thanks to Lukas Javorsky for fixing numerous covscan
issues (This patch includes part of his pull request #126).
Coverity scan build was using the following cmake parameters:
-WITH_EXTERNAL_ZLIB=ON -DWITH_UNIT_TESTS=OFF.
CWE-416 (use after free) in dtoa.c (from netlib) is still open.
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!