summaryrefslogtreecommitdiff
path: root/client/mysqltest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | * Update wrong zip-code
* Crude "auto-load-data-local-infile" modemariadb-5.5.63Sergei Golubchik2019-01-271-2/+0
| | | | | | | 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.
* MDEV-16658 Memory leak in mysqltest on connect failureEugene Kosov2019-01-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close connection handler on connection failure. This fixes 14 failing tests in main suite under clang+ASAN build. ASAN report for main.connect looks like this: ================================================================= ==25495==ERROR: LeakSanitizer: detected memory leaks Direct leak of 146280 byte(s) in 115 object(s) allocated from: #0 0x4fba47 in calloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:138 #1 0x5a7a02 in mysql_init /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:977:26 #2 0x570a7a in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6096:26 #3 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9 #4 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 Indirect leak of 7065600 byte(s) in 115 object(s) allocated from: #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129 #1 0x637a83 in my_context_init /work/mariadb/libmariadb/libmariadb/ma_context.c:367:23 #2 0x59fd16 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2738:9 #3 0x5bc1d4 in mysql_options /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3242:10 #4 0x570b94 in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6103:7 #5 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9 #6 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 Indirect leak of 940240 byte(s) in 115 object(s) allocated from: #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129 #1 0x64386e in ma_init_dynamic_array /work/mariadb/libmariadb/libmariadb/ma_array.c:49:31 #2 0x649ead in _hash_init /work/mariadb/libmariadb/libmariadb/ma_hash.c:52:7 #3 0x5a3080 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2938:13 #4 0x5bc20c in mysql_options4 /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3248:10 #5 0x56f63b in connect_n_handle_errors(st_command*, st_mysql*, char const*, char const*, char const*, char const*, int, char const*) /work/mariadb/client/mysqltest.cc:5874:3 #6 0x57146b in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6193:7 #7 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9 #8 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 ... Closes #809
* mysqltest: use a dynamically growing command bufferSergei Golubchik2018-11-281-16/+26
|
* test framework manual is movedTakashi Sasaki2018-11-011-1/+1
|
* mysqltest: Allow HANDLER READ in --ps-protocol testsSergei Golubchik2018-06-111-0/+1
| | | | adjust tests
* uninitialized variableSergei Golubchik2017-06-291-1/+1
|
* MDEV-13187 incorrect backslash parsing in clientsSergei Golubchik2017-06-271-2/+12
| | | | cover ANSI_QUOTES and NO_BACKSLASH_ESCAPES in mysqltest
* MDEV-13187 incorrect backslash parsing in clientsSergei Golubchik2017-06-271-2/+2
| | | | don't do backslash escapes inside backticks
* MDEV-13002 mysqltest regex replace results in incorrect resultSergei Golubchik2017-06-181-4/+14
| | | | regex didn't replace lines that were split by 16K chunk reads.
* MDEV-12276 Missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "do_exec"Sergei Golubchik2017-04-201-10/+10
|
* Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55Sergei Golubchik2017-04-111-1/+1
|\
| * BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING ↵Ramil Kalimullin2017-03-101-3/+3
| | | | | | | | | | | | | | | | | | SSL CONNECTION MYSQL_OPT_SSL_MODE option introduced. It is set in case of --ssl-mode=REQUIRED and permits only SSL connection. (cherry picked from commit 3b2d28578c526f347f5cfe763681eff365731f99)
* | MDEV-10100 main.pool_of_threads fails sporadically in buildbotElena Stepanova2017-01-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport the fix to 5.5, because it fails there too The patch fixes two test failures: - on slow builders, sometimes a connection attempt which should fail due to the exceeded number of thread_pool_max_threads actually succeeds; - on even slow builders, MTR sometimes cannot establish the initial connection, and check-testcase fails prior to the test start The problem with check-testcase was caused by connect-timeout=2 which was set for all clients in the test config file. On slow builders it might be not enough. There is no way to override it for the pre-test check, so it needed to be substantially increased or removed. The other problem was caused by a race condition between sleeps that the test performs in existing connections and the connect timeout for the connection attempt which was expected to fail. If sleeps finished before the connect-timeout was exceeded, it would allow the connection to succeed. To solve each problem without making the other one worse, connect-timeout should be configured dynamically during the test. Due to the nature of the test (all connections must be busy at the moment when we need to change the timeout, and cannot execute SET GLOBAL ...), it needs to be done independently from the server. The solution: - recognize 'connect_timeout' as a connection option in mysqltest's "connect" command; - remove connect-timeout from the test configuration file; - use the new connect_timeout option for those connections which are expected to fail; - re-arrange the test flow to allow running a huge SLEEP without affecting the test execution time (because it would be interrupted after the main test flow is finished). The test is still subject to false negatives, e.g. if the connection fails due to timeout rather than due to the exceeded number of allowed threads, or if the connection on extra port succeeds due to a race condition and not because the special logic for the extra port. But those false negatives have always been possible there on slow builders, they should not be critical because faster builders should catch such failures if they appear. Conflicts: client/mysqltest.cc mysql-test/r/pool_of_threads.result mysql-test/t/pool_of_threads.test
* | MDEV-9409 Windows - workaround VS2015 CRT bug that makesVladislav Vaintroub2016-10-271-6/+22
| | | | | | | | | | | | | | | | | | | | | | mysqldump/mysql_install_db.exe fail The bug is described in https://connect.microsoft.com/VisualStudio/Feedback/Details/1902345 When reading from a pipe in text mode, using CRT function such as fread(), some newlines may be lost. Workaround is to use binary mode on reading side and if necessary, replace \r\n with \n.
* | mysqltest: don't eat new lines in --execSergei Golubchik2016-10-141-4/+0
| | | | | | | | pass them through as is
* | MDEV-9366 : do_shutdown_server fails to detect server shutdown on Windows.Vladislav Vaintroub2016-06-081-2/+3
| | | | | | | | | | | | | | | | | | Fix test whether process is alive in mysqltest. Also fix SHUT_RD definition on Windows to be SD_RECEIVE. SD_BOTH was used instead prior to this patch, and this would occasionally make mysql_shutdown() fail - when the socket for the current connection is not able send the COM_SHUTDOWN response anymore.
* | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-04-201-1/+1
|\ \ | |/
| * WL#9072: Backport WL#8785 to 5.5Ramil Kalimullin2016-02-191-5/+7
| |
| * Bug #16402124 - MTR PROCESSES CERTAIN ASSIGNED VARDIR VALUES WRONGsayantan dutta2013-03-291-3/+9
| |
| * merge 5.1 => 5.5Tor Didriksen2012-12-211-1/+1
| |\
| | * Bug#16027468 ADDRESSSANITIZER BUG IN MYSQLTESTTor Didriksen2012-12-201-2/+1
| | | | | | | | | | | | | | | | | | DBUG_ENTER and DBUG_LEAVE must *always* match, otherwise all subsequent DBUG_ENTER calls will be poking into undefined stack frames.
| * | Merge of patch for Bug#13928675 from mysql-5.1.Nirbhay Choubey2012-08-071-1/+1
| |\ \ | | |/
| | * Bug#13928675 MYSQL CLIENT COPYRIGHT NOTICE MUSTNirbhay Choubey2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SHOW 2012 INSTEAD OF 2011 * Added a new macro to hold the current year : COPYRIGHT_NOTICE_CURRENT_YEAR * Modified ORACLE_WELCOME_COPYRIGHT_NOTICE macro to take the initial year as parameter and pick current year from the above mentioned macro.
| * | Bug #12998841: libmysql divulges plaintext password upon request in 5.5Georgi Kodinov2012-07-051-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+2
| |\ \ | | |/
| | * Bug #13708485: malformed resultset packet crashes clientGeorgi Kodinov2012-06-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Bug#14238406 NEW COMPILATION WARNINGS WITH GCC 4.7 (-WERROR=NARROWING)Jon Olav Hauglid2012-06-291-2/+2
| |\ \ | | |/ | | | Manual merge from mysql-5.1 to mysql-5.5
| * | Bug #13055685 NO WAY TO REPLACE NON-DETERMINISTIC FRAGMENTS IN OUTPUT OF ↵Bjorn Munch2011-11-081-27/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MTR'S ECHO Don't do this for echo, instead: 1) Enable replacements also for assignment from backquoted SQL 2) Allow replace_regex to take a variable for the *entire* argument list With this, the test can be amended, but only in its version in trunk
| * | Bug #13096353 62712: RPM-BASED INSTALL OF THE TEST SUITE IS USELESS FOR ↵Bjorn Munch2011-11-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NON-ROOT USERS Simplified fix avoiding changes to mysys: Use the MY_HOLD_ORIGINAL_MODES flag when calling my_copy(), this also stops it from attempting to chown() the file. Yes this behavior is a bit confusing.... The only case this might change the behavior is if the destination file exists, but since we also use MY_DONT_OVERWRITE_FILE, it would fail in those cases anyway.
| * | Bug #11754855 46528: NEED A WAY TO PASS A VARIABLE TO MTR COMMANDSsayantan.dutta@oracle.com2011-10-191-1/+13
| | | | | | | | | | | | | | | | | | modified function do_get_error in mysqltest.cc to handle multiple variable passed added test case to mysqltest.test to verify handling to multiple errors passed
| * | 12956584 followup fix for mysqltestBjorn Munch2011-09-301-7/+4
| | | | | | | | | | | | | | | | | | run_query_stmt() might use disable_xxx vars after calling handle_no_error But handle_no_error() hes reverted any ONCE settings Fix is to take revert_properties() out of handle_no_error()
| * | upmerge 12793118,12912120Bjorn Munch2011-09-151-5/+22
| |\ \ | | |/
| | * Bug #12793118 MYSQLTEST: --ERROR AND --DISABLE_ABORT_ON_ERROR DO NOT WORK ↵Bjorn Munch2011-09-141-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | FOR SQL IN COMMANDS Call handle_error() instead of die() when evaluating these Must remember "current command" with link to errors to ignore Added test cases to mysqltest.test
| * | Bug #12956584 - MYSQLTEST: --ENABLE_X OR --DISABLE_X APPLYING ONLY TO NEXT ↵Bjorn Munch2011-09-151-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | COMMAND/STMT Followup fixes for --ps-protocol: 1) Incorrectly set ps_protocol variable instead of ps_protocol_enabled 2) disable_result_log was tested after calling handle_no_error() which would revert a temporary setting.
| * | Bug #12956584 MYSQLTEST: --ENABLE_X OR --DISABLE_X APPLYING ONLY TO NEXT ↵Bjorn Munch2011-09-141-30/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COMMAND/STMT Added a keyword ONCE to add to those commands Some internal tables to keep track of which properties are temporarily overriden Added tests in mysqltest.test Updates to other tests will be done later
| * | Bug #12793170 MYSQLTEST: PROVIDE ACCESS TO ERROR NAMES THROUGH NUMERICBjorn Munch2011-08-221-3/+3
| | | | | | | | | | | | | | | | | | CODES AND VICE VERSA Followup: Some statement may give errors not in the list, map these to "<Unknown>" rather than failing.
| * | Bug #12793170 MYSQLTEST: PROVIDE ACCESS TO ERROR NAMES THROUGH NUMERIC CODES ↵Bjorn Munch2011-08-221-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | AND VICE VERSA Added a second internal variable $mysql_errname This is set the same way as $mysql_errno Can be used like "if ($mysql_errname == ER_NO_SUCH_TABLE)...."
| * | Manual merge from mysql-5.1.Alexander Nozdrin2011-07-221-8/+1
| |\ \ | | |/
| | * Manual merge from mysql-5.0.Alexander Nozdrin2011-07-221-9/+3
| | |
| | * Updated/added copyright headersKent Boortz2011-07-031-10/+14
| | |\
| | * | Updated/added copyright headersKent Boortz2011-06-301-2/+4
| | | |
| * | | Fixed cast warnings in introducing the pluggable authentication clientGeorgi Kodinov2011-06-061-1/+1
| | | | | | | | | | | | | | | | options.
| * | | BUG#11762616: BUG#55229: 'POSTION'Luis Soares2011-05-061-2/+2
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | Manual merge from mysql-5.1 into mysql-5.5. Conflicts ========= Text conflict in mysql-test/suite/rpl/t/rpl_row_until.test Text conflict in sql/handler.h Text conflict in storage/archive/ha_archive.cc
| | * | BUG#11762616: BUG#55229: 'POSTION' Luis Soares2011-05-061-2/+2
| | | | | | | | | | | | | | | | | | | | Fix for all "postion" in Oracle files (s/postion/position). Updated the copyright notices where needed.
| * | | Merge mysql-5.1-innodb to mysql-5.5-innodb.Marko Mäkelä2011-04-111-5/+7
| |\ \ \ | | |/ /
| | * | Bug #11766513 - 59641: Prepared XA transaction in system after hard crashMarko Mäkelä2011-04-071-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | causes future shutdown hang InnoDB would hang on shutdown if any XA transactions exist in the system in the PREPARED state. This has been masked by the fact that MySQL would roll back any PREPARED transaction on shutdown, in the spirit of Bug #12161 Xa recovery and client disconnection. [mysql-test-run] do_shutdown_server: Interpret --shutdown_server 0 as a request to kill the server immediately without initiating a shutdown procedure. xid_cache_insert(): Initialize XID_STATE::rm_error in order to avoid a bogus error message on XA ROLLBACK of a recovered PREPARED transaction. innobase_commit_by_xid(), innobase_rollback_by_xid(): Free the InnoDB transaction object after rolling back a PREPARED transaction. trx_get_trx_by_xid(): Only consider transactions whose trx->is_prepared flag is set. The MySQL layer seems to prevent attempts to roll back connected transactions that are in the PREPARED state from another connection, but it is better to play it safe. The is_prepared flag was introduced in the InnoDB Plugin. trx_n_prepared: A new counter, counting the number of InnoDB transactions in the PREPARED state. logs_empty_and_mark_files_at_shutdown(): On shutdown, allow trx_n_prepared transactions to exist in the system. trx_undo_free_prepared(), trx_free_prepared(): New functions, to free the memory objects of PREPARED transactions on shutdown. This is not needed in the built-in InnoDB, because it would collect all allocated memory on shutdown. The InnoDB Plugin needs this because of innodb_use_sys_malloc. trx_sys_close(): Invoke trx_free_prepared() on all remaining transactions.
| * | | merge from 5.5 mainBjorn Munch2011-03-221-1/+1
| |\ \ \
| | * | | Fix for BUG#59894Guilhem Bichot2011-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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.
| * | | | upmerge 11885854Bjorn Munch2011-03-181-3/+5
| |\ \ \ \ | | |/ / / | |/| / / | | |/ /