summaryrefslogtreecommitdiff
path: root/sql-common
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'mariadb-10.0.19' into 10.1Sergei Golubchik2015-06-011-2/+10
|\
| * Merge branch '5.5' into 10.0Sergei Golubchik2015-05-041-2/+10
| |\
| | * MDEV-7859 SSL hostname verification fails for long subject namesSergei Golubchik2015-04-271-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | Don't use a fixed buffer for X509_NAME_oneline() in the client. Do as the server does - allocate it dynamically. For a test - regenerate certificates to have the server cert with a long subject.
* | | MDEV-6650 - LINT_INIT emits code in non-debug buildsSergey Vojtovich2015-03-161-2/+1
| | | | | | | | | | | | | | | Replaced all references to LINT_INIT with UNINIT_VAR and LINT_INIT_STRUCT. Removed LINT_INIT macro.
* | | Merge branch '10.0' into 10.1Sergei Golubchik2015-03-071-2/+2
|\ \ \ | |/ /
| * | Merge branch '5.5' into 10.0Sergei Golubchik2015-02-181-2/+2
| |\ \ | | |/
| | * Merge remote-tracking branch 'bzr/5.5' into bb-5.5-mergeSergei Golubchik2015-02-121-0/+5
| | |\
| | | * MDEV-7435 Windows debug: Run-Time Check Failure #3 - The variable 'unused' ↵Alexey Botchkov2015-02-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | is being used without being initialized. Fixed as it's done in 10.0.
| | * | Merge remote-tracking branch 'mysql/5.5' into bb-5.5-merge @ mysql-5.5.42Sergei Golubchik2015-02-111-2/+2
| | |\ \ | | | |/ | | |/|
| | | * Bug#17599258:- ERROR 1160 (08S01): GOT AN ERROR WRITINGArun Kuruvila2014-11-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COMMUNICATION PACKETS; FEDERATED TABLE Description:- Execution of FLUSH TABLES on a federated table which has been idle for wait_timeout (on the remote server) + tcp_keepalive_time, fails with an error, "ERROR 1160 (08S01): Got an error writing communication packets." Analysis:- During FLUSH TABLE execution the federated table is closed which will inturn close the federated connection. While closing the connection, federated server tries to communincate with the remote server. Since the connection was idle for wait_timeout(on the remote server)+ tcp_keepalive_time, the socket gets closed. So this communication fails because of broken pipe and the error is thrown. But federated connections are expected to reconnect silently. And also it cannot reconnect because the "auto_reconnect" variable is set to 0 in "mysql_close()". Fix:- Before closing the federated connection, in "ha_federated_close()", a check is added which will verify wheather the connection is alive or not. If the connection is not alive, then "mysql->net.error" is set to 2 which will indicate that the connetion is broken. Also the setting of "auto_reconnect" variable to 0 is delayed and is done after "COM_QUIT" command. NOTE:- For reproducing this issue, "tcp_keepalive_time" has to be set to a smaller value. This value is set in the "/proc/sys/net/ipv4/tcp_keepalive_time" file in Unix systems. So we need root permission for changing it, which can't be done through mtr test. So submitting the patch without mtr test.
| | | * Bug #18384260: MULTIPLE SECURITY ISSUES IN CERTIFICATE VALIDATIONGeorgi Kodinov2014-07-311-0/+6
| | | | | | | | | | | | | | | | | | | | the 5.5 version of the fix. Added a call to X509_verify_cert_error_string() into the client certificate verification code.
| | | * Bug #18053212 MYSQL_GET_SERVER_VERSION() CALL WITHOUT A VALID CONNECTION ↵Igor Solodovnikov2014-04-171-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | RESULTS IN SEG FAULT When there is no connection mysql_get_server_version() will return 0 and report CR_COMMANDS_OUT_OF_SYNC error.
| | | * Updated/added copyright headersMurthy Narkedimilli2014-01-061-1/+2
| | | |
| | | * Bug #17297012 MEMORY LEAK IN MYSQL_OPTIONS WHILE CALLING WITH OPTION ↵Igor Solodovnikov2013-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MYSQL_SET_CLIENT_IP Memory Leak in mysql_options() was caused by missing call to my_free() in MYSQL_SET_CLIENT_IP branch. Fixed by adding my_free() to cleanup mysql->options.client_ip value before assigning new value.
| | | * Bug #16680313: CLIENT DOESN'T READ PLUGIN-DIR FROM MY.CNF SET BYGeorgi Kodinov2013-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MYSQL_READ_DEFAULT_FILE Parsing of the plugin-dir config file option was not working due to a typo. Fixed the typo. No test case can be added due to lack of support for defaults-exitra-file testing in mysql-test-run.pl. Thanks to Sinisa for contributing the fix.
| | | * Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-192-2/+2
| | | |
| | | * Merge of patch for bug#14685362 from mysql-5.1.Nirbhay Choubey2013-03-181-0/+2
| | | |\
| | | | * Updated/added copyright headers.Murthy Narkedimilli2013-02-251-1/+1
| | | | |
| | | * | Bug #12910665: AUTH-PLUGIN-DATA-LEN NOT TESTED FOR VALIDITY BY THE Georgi Kodinov2012-06-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | CLIENT Added a check for a negative second part of the scramble length.
| | | * | fixed a missing breakGeorgi Kodinov2012-07-051-0/+1
| | | | |
| | | * | Bug #12998841: libmysql divulges plaintext password upon request in 5.5Georgi Kodinov2012-07-052-9/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Clear text password client plugin disabled by default. 2. Added an environment variable LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN, that when set to something starting with '1', 'Y' or 'y' will enable the clear text plugin for all connections. 3. Added a new mysql_options() option : MYSQL_ENABLE_CLEARTEXT_PLUGIN that takes an my_bool argument. When the value of the argument is non-zero the clear text plugin is enabled for this connection only. 4. Added an enable-cleartext-plugin config file option that takes a numeric argument. If the numeric value of the numeric argument is non-zero the clear text plugin is enabled for the connection 5. Added a boolean command line option "--enable_cleartext_plugin" to mysql, mysqlslap and mysqladmin. When specified it will call mysql_options with the effect of #3 6. Added a new CLEARTEXT option to the connect command in mysqltest. When specified it will enable the cleartext plugin for usage. 7. Added test cases and updated existing ones that need the clear text plugin.
| | | * | merge bug#13708485 5.1->5.5Georgi Kodinov2012-06-291-3/+12
| | | |\ \ | | | | |/
| | | | * Bug #13708485: malformed resultset packet crashes clientGeorgi Kodinov2012-06-281-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several fixes : * sql-common/client.c Added a validity check of the fields metadata packet sent by the server. Now libmysql will check if the length of the data sent by the server matches what's expected by the protocol before using the data. * client/mysqltest.cc Fixed the error handling code in mysqltest to avoid sending new commands when the reading the result set failed (and there are unread data in the pipe). * sql_common.h + libmysql/libmysql.c + sql-common/client.c unpack_fields() now generates a proper error when it fails. Added a new argument to this function to support the error generation. * sql/protocol.cc Added a debug trigger to cause the server to send a NULL insted of the packet expected by the client for testing purposes.
| | | * | Updated/added copyright headersMySQL Build Team2012-02-161-1/+1
| | | |\ \ | | | | |/
| | | | * Updated/added copyright headersKent Boortz2012-02-151-1/+1
| | | | |\
| | | * | \ Merging BUG#13458237 from 5.1.Alexander Barkov2012-01-241-1/+1
| | | |\ \ \ | | | | |/ /
| | | | * | BUG#13458237 - INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY. ↵Alexander Barkov2012-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SIMILAR TO '2009-10-00' - Reverting the patch for Bug # 12584302 The patch will be reverted in 5.1 and 5.5. The patch will not be reverted in 5.6, the change will be properly documented in 5.6. - Backporting DBUG_ASSERT not to crash on '0000-01-00' (already fixed in mysql-trunk (5.6))
| | | | * | Updated/added copyright headersKent Boortz2011-07-031-1/+2
| | | | |\ \
| | | * | \ \ Updated/added copyright headersKent Boortz2011-06-304-7/+8
| | | |\ \ \ \ | | | | |/ / /
| | | | * | | Updated/added copyright headersKent Boortz2011-06-303-6/+13
| | | | |\ \ \ | | | | | | |/ | | | | | |/|
| | | | | * | Updated/added copyright headersKent Boortz2011-06-303-6/+8
| | | | | | |
| | | * | | | Bug#11745920/Bug#21287: "SSL connection error" is not helpful! ↵Tatjana Azundris Nuernberg2011-05-191-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (ssl-verify-server-cert=true vs localhos) SSL errors on client and now more specific to aid end-user with debugging. Also restructures error handling for compliance with SSL docs.
| | | * | | | Bug#11766631 (59780) - Move the client authentication_windows pluginRafal Somla2011-04-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into the server repository This patch adds client windows authentication plugin code to the client library libmysql (only on Windows platform). The plugin is compiled into the library and added to the list of built-in plugins. This way clients should be able to connect to a server which uses windows authentication plugin even as an SQL user which uses such authentication. Note: this makes the client library to depend on Secur32 Windows system library. When building clients, they must be linked against Secur32. Command mysql_config --libs correctly lists Secur32 as a required dependency.
| | | * | | | Addendum to the fix for bug #12325444Georgi Kodinov2011-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed STDCALL from the function definition.
| | | * | | | 5.1 -> 5.5 mergeSergey Glukhov2011-04-271-1/+2
| | | |\ \ \ \ | | | | | |_|/ | | | | |/| |
| | | | * | | Bug#11889186 60503: CRASH IN MAKE_DATE_TIME WITH DATE_FORMAT / STR_TO_DATE ↵Sergey Glukhov2011-04-271-1/+2
| | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COMBINATION calc_daynr() function returns negative result if malformed date with zero year and month is used. Attempt to calculate week day on negative value leads to crash. The fix is return NULL for 'W', 'a', 'w' specifiers if zero year and month is used. Additional fix for calc_daynr(): --added assertion that result can not be negative --return 0 if zero year and month is used
| | | * | | Bug #11766854: 60075: MYSQL_LOAD_CLIENT_PLUGIN DOESN'T CLEAR ERRORGeorgi Kodinov2011-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the cleanup code. Extended mysql_client_test to take --plugin-dir and --default_auth. Added a C test case.
| | | * | | Fix for BUG#59894Guilhem Bichot2011-02-111-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "set optimizer_switch to e or d causes invalid memory writes/valgrind warnings": due to prefix support, the argument "e" was overwritten with its full value "engine_condition_pushdown", which caused a buffer overrun. This was wrong usage of find_type(); other wrong usages are fixed here too. Please start reading with the comment of typelib.c.
| | | * | | mergeGeorgi Kodinov2011-02-021-1/+1
| | | |\ \ \ | | | | |/ /
| | | | * | merge to 5.1.Georgi Kodinov2011-02-021-1/+1
| | | | |\ \ | | | | | |/
| | | | | * Fixes for Bug #55755 and Bug #52315 part 2Georgi Kodinov2011-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #55755 : Date STD variable signness breaks server on FreeBSD and OpenBSD * Added a check to configure on the size of time_t * Created a macro to check for a valid time_t that is safe to use with datetime functions and store in TIMESTAMP columns. * Used the macro consistently instead of the ad-hoc checks introduced by 52315 * Fixed compliation warnings on platforms where the size of time_t is smaller than the size of a long (e.g. OpenBSD 4.8 64 amd64). Bug #52315: utc_date() crashes when system time > year 2037 * Added a correct check for the timestamp range instead of just variable size check to SET TIMESTAMP. * Added overflow checking before converting to time_t. * Using a correct localized error message in this case instead of the generic error. * Added a test suite. * fixed the checks so that they check for unsigned time_t as well. Used the checks consistently across the source code. * fixed the original test case to expect the new error code.
| | | * | | Bug #59657: Move the client authentication_pam plugin into the server repositoryGeorgi Kodinov2011-01-311-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Created a clear text built in client authentication plugin. Test case added. Added a negative test case : a login failure.
| | | * | | BUG#57953 my_load_defaults return junk argument ----args-separator---- to callerHe Zhenxing2011-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After fix of bug#25192, load_defaults() will add an args separator to distinguish options loaded from configure files from that provided in the command line. One problem of this is that the args separator would be added no matter the application need it or not. Fixed the problem by adding an option: bool my_getopt_use_args_separator; to control whether the separator will be added or not. And also added functions: bool my_getopt_is_args_separator(const char* arg); to check if the argument is the separator or not.
| | | * | | Remove configuration preprocessor symbols 'THREAD'Magne Mahre2011-01-112-27/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and 'THREAD_SAFE_CLIENT'. As of MySQL 5.5, we no longer support non-threaded builds. This patch removes all references to the obsolete THREAD and THREAD_SAFE_CLIENT preprocessor symbols. These were used to distinguish between threaded and non-threaded builds.
| | | * | | Manual merge from mysql-5.5-bugteam.Ramil Kalimullin2010-11-222-19/+2
| | | |\ \ \
| | | | * | | WL#5665: Removal of the autotools-based build systemDavi Arnaut2010-11-201-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The autotools-based build system has been superseded and is being removed in order to ease the maintenance burden on developers tweaking and maintaining the build system. In order to support tools that need to extract the server version, a new file that (only) contains the server version, called VERSION, is introduced. The file contents are human and machine-readable. The format is: MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 MYSQL_VERSION_PATCH=8 MYSQL_VERSION_EXTRA=-rc The CMake based version extraction in cmake/mysql_version.cmake is changed to extract the version from this file. The configure to CMake wrapper is retained for backwards compatibility and to support the BUILD/ scripts. Also, a new a makefile target show-dist-name that prints the server version is introduced.
| | | | * | | Bug #57559: Crash in Client plugin apiGeorgi Kodinov2010-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The plugin code was releasing the plugin and only then was reporting an error referencing it. Fixed by first reporting an error and then freeing up the plugin.
| | | * | | | Manual-merge from 5.5-bugfixing.Ramil Kalimullin2010-11-181-14/+14
| | | |\ \ \ \ | | | | |/ / /
| | | | * | | Bug #57744: sql-common/client.c: Missing DBUG_RETURN macroGeorgi Kodinov2010-11-101-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - added missing DBUG_RETURN - fixed whitespace according to coding style.
| | | * | | | Bug#57278: Crash on min/max + with date out of range.Evgeny Potemkin2010-11-041-1/+6
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL officially supports DATE values starting from 1000-01-01. This is enforced for int values, but not for string values, thus one could easily insert '0001-01-01' value. Int values are checked by number_to_datetime function and Item_cache_datetime::val_str uses it to fill MYSQL_TIME struct out of cached int value. This leads to the scenario where Item_cache_datetime caches a non-null datetime value and when it tries to convert it from int to string number_to_datetime function treats the value as out-of-range and returns an error and Item_cache_datetime::val_str returns NULL for a non-null value. Due to this inconsistency server crashes. Now number_to_datetime allows DATE values below 1000-01-01 if the TIME_FUZZY_DATE flag is set. Better NULL handling for Item_cache_datetime. Added the Item_cache_datetime::store function to reset str_value_cached flag when an item is stored.