Commit graph

159 commits

Author SHA1 Message Date
Sergei Golubchik
d3cc15eb82 Merge branch '10.0' into 10.1 2017-06-30 13:28:39 +02:00
Sergei Golubchik
a02ba9c1c9 Merge branch '5.5' into 10.0 2017-06-28 10:10:31 +02:00
Sergei Golubchik
d5cd334504 MDEV-13187 incorrect backslash parsing in clients
cover ANSI_QUOTES and NO_BACKSLASH_ESCAPES in mysqltest
2017-06-27 14:00:37 +02:00
Daniel Black
d59b94e7fd Add replace_regex to not ignore the regex in "$var /regex/val/" 2017-04-18 11:46:10 +10:00
Sergei Golubchik
12c3e16dfa Merge branch '5.5' into 10.0 2016-10-25 16:41:43 +02:00
Sergei Golubchik
01b39b7b07 mysqltest: don't eat new lines in --exec
pass them through as is
2016-10-14 01:12:04 +02:00
Sergei Golubchik
fece177fe2 mysqltest: support pairs of delimiters in replace_regex 2014-08-04 21:19:24 +02:00
Alexander Barkov
e02ad98c63 Merge 5.5 -> 10.0-base 2013-11-08 20:59:08 +04:00
Michael Widenius
6cc9f4ac5c Added usage of handler error names to mysqltest
include/CMakeLists.txt:
  Added handler_ername.h
include/handler_ername.h:
  Names of handler error messages
mysql-test/extra/binlog_tests/binlog.test:
  Test using handler error names
mysql-test/r/mysqltest.result:
  Update for new error message
mysql-test/t/auto_increment.test:
  Test using handler error names
mysql-test/t/auto_increment_ranges.inc:
  Test using handler error names
mysql-test/t/replace.test:
  Test using handler error names
2013-11-05 20:30:36 +02:00
Sergei Golubchik
0af4b6c6ee 5.5 merge 2013-01-29 15:10:47 +01:00
Sergei Golubchik
672b293860 5.3 merge
client/mysqltest.cc:
  make --error to work for --change_user errors
2013-01-25 11:24:42 +01:00
Sergei Golubchik
bfc71e63a7 MDEV-3915 COM_CHANGE_USER allows fast password brute-forcing
allow only three failed change_user per connection.
successful change_user do NOT reset the counter

tests/mysql_client_test.c:
  make --error to work for --change_user errors
2013-01-25 00:17:39 +01:00
Michael Widenius
1864d9596d Implementation of Multi-source replication (MDEV:253)
Documentation of the feature can be found at: http://kb.askmonty.org/en/multi-source-replication/
This code is based on code from Taobao, developed by Plinux

BUILD/SETUP.sh:
  Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it)
client/mysqltest.cc:
  Added support for error names starting with 'W'
  Added connection_name support to --sync_with_master
cmake/maintainer.cmake:
  Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it)
mysql-test/r/mysqltest.result:
  Updated results
mysql-test/r/parser.result:
  Updated results
mysql-test/suite/multi_source/my.cnf:
  Setup of multi-master tests
mysql-test/suite/multi_source/simple.result:
  Simple basic test of multi-source functionality
mysql-test/suite/multi_source/simple.test:
  Simple basic test of multi-source functionality
mysql-test/suite/multi_source/syntax.result:
  Test of multi-source syntax
mysql-test/suite/multi_source/syntax.test:
  Test of multi-source syntax
mysql-test/suite/rpl/r/rpl_rotate_logs.result:
  Updated results because of new error messages
mysql-test/t/parser.test:
  Updated test as master_pos_wait() now takes more arguments than before
sql/event_scheduler.cc:
  No reason to initialize slave_thread (it's guaranteed to be zero here)
sql/item_create.cc:
  Added connection_name argument to master_pos_wait()
  Simplified code
sql/item_func.cc:
  Added connection_name argument to master_pos_wait()
sql/item_func.h:
  Added connection_name argument to master_pos_wait()
sql/log.cc:
  Added tag "Master 'connection_name'" to slave errors that has a connection name.
sql/mysqld.cc:
  Added variable mysqld_server_initialized so that other functions can test if server is fully initialized.
  Free all slave data in one place (fewer ifdef's)
  Removed not needed call to close_active_mi()
  Initialize slaves() later in startup to ensure that everthing is really initialized when slaves start.
  Made status variable slave_running multi-source safe
sql/mysqld.h:
  Added mysqld_server_initialized
sql/rpl_mi.cc:
  Store connection name and cmp_connection_name (only used for show full slave status) in Master_info
  Added code for Master_info_index, which handles storage of multi-master information
  Don't write the empty "" connection_name to multi-master.info file. This is handled by the original code.
sql/rpl_mi.h:
  Added connection_name and Master_info_index
sql/rpl_rli.cc:
  Added connection_name to relay log files.
sql/rpl_rli.h:
  Fixed type of slave_skip_counter as we now access it directly in sys_vars.cc, so it must be uint
sql/share/errmsg-utf8.txt:
  Added new error messages needed for multi-source
  Added multi-source name to error ER_MASTER_INFO and WARN_NO_MASTER_INFO
sql/slave.cc:
  Moved things a bit around to make it easier to handle error conditions.
  Create a global master_info_index and add the "" connection to it
  Ensure that new Master_info doesn't fail.
  Don't call terminate_slave_threads(active_mi..) on end_slave() as this is now done automaticly when deleting master_info_index.
  Delete not needed function close_active_mi(). One can achive same thing by calling end_slave().
  Added support for SHOW FULL SLAVE STATUS (show status for all master connections with connection_name as first column)
sql/slave.h:
  Added new prototypes
sql/sql_base.cc:
  More DBUG_PRINT
sql/sql_class.cc:
  Reset thd->connection_name and thd-->default_master_connection
sql/sql_class.h:
  Added thd->connection_name and thd-->default_master_connection
  Added slave_skip_count to variables to make changing the @@sql_slave_skip_count variable thread safe
sql/sql_const.h:
  Added MAX_CONNECTION_NAME
sql/sql_lex.cc:
  Reset 'lex->verbose' (to simplify some sql_yacc.yy code)
sql/sql_lex.h:
  Added connection_name
sql/sql_parse.cc:
  Added support for connection_name to all SLAVE commands.
  - Instead of using active_mi, we now get the current Master_info from master_info_index.
  - Create new replication threads with CHANGE MASTER
  - Added support for show_all_master_info()
sql/sql_reload.cc:
  Made reset/full slave use master_info_index->get_master_info() instead of active_mi.
  If one uses 'RESET SLAVE "connection_name" all' the connection is removed from master_info_index.
sql/sql_repl.cc:
  sql_slave_skip_counter is moved to thd->variables to make it thread safe and fix some bugs with it
  Add connection name to relay log files.
  Added connection name to errors.
  Added some logging for multi-master if log_warnings > 1
  stop_slave():
  - Don't check if thd is set. It's guaranteed to always be set.
  change_master():
  - Check for duplicate connection names in change_master()
  - Check for wrong arguments first in file (to simplify error handling)
  - Register new connections in master_info_index
sql/sql_yacc.yy:
  Added optional connection_name to a all relevant master/slave commands
sql/strfunc.cc:
  my_global.h shoud always be included first.
sql/sys_vars.cc:
  Added variable default_master_connection
  Made variable sql_slave_skip_counter multi-source safe
sql/sys_vars.h:
  Added Sys_var_session_lexstring (needed for default_master_connection)
  Added Sys_var_multi_source_uint (needed for sql_slave_skip_counter).
2012-09-28 02:06:56 +03:00
Elena Stepanova
403cac0fe7 Allow multiple error codes inside a variable in --error command 2012-07-16 06:14:53 +04:00
Sergei Golubchik
c39877071a overlay support for mysql-test-run and mysqltest
mysql-test-run auto-disables all optional plugins.


mysql-test/include/default_client.cnf:
  no @OPT.plugindir anymore
mysql-test/include/default_mysqld.cnf:
  don't disable plugins manually - mtr can do it better
mysql-test/suite/innodb/t/innodb_bug47167.test:
  mtr now uses suite-dir as an include path
mysql-test/suite/innodb/t/innodb_file_format.test:
  mtr now uses suite-dir as an include path
mysql-test/t/partition_binlog.test:
  this test uses partitions
storage/example/mysql-test/mtr/t/source.result:
  update results. as mysqltest includes the correct overlayed include
storage/innobase/handler/ha_innodb.cc:
  the assert is wrong
2012-02-23 07:50:11 +01:00
Sergei Golubchik
38e3ae155d mysql-5.5 merge 2012-01-16 20:16:35 +01:00
Sergei Golubchik
2ccf247e93 after merge changes:
* rename all debugging related command-line options
  and variables to start from "debug-", and made them all
  OFF by default.
* replace "MySQL" with "MariaDB" in error messages
* "Cast ... converted ... integer to it's ... complement"
  is now a note, not a warning
* @@query_cache_strip_comments now has a session scope,
  not global.
2011-12-12 23:58:40 +01:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Michael Widenius
7b368e3810 Merge with MySQL 5.1.60 2011-11-23 19:32:14 +02:00
Bjorn Munch
020600a4ed Bug #13055685 NO WAY TO REPLACE NON-DETERMINISTIC FRAGMENTS IN OUTPUT OF 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
2011-11-08 15:55:25 +01:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
unknown
434dd8635e Bug #11754855 46528: NEED A WAY TO PASS A VARIABLE TO MTR COMMANDS
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
2011-10-19 12:53:52 +05:30
Bjorn Munch
04c402c452 upmerge 12793118,12912120 2011-09-15 13:09:24 +02:00
Bjorn Munch
52960624d3 Bug #12793118 MYSQLTEST: --ERROR AND --DISABLE_ABORT_ON_ERROR DO NOT WORK 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
2011-09-14 15:19:24 +02:00
Bjorn Munch
a238e6ada2 Bug #12956584 MYSQLTEST: --ENABLE_X OR --DISABLE_X APPLYING ONLY TO NEXT 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
2011-09-14 15:15:36 +02:00
Bjorn Munch
4cb3072356 Bug #12793170 MYSQLTEST: PROVIDE ACCESS TO ERROR NAMES THROUGH NUMERIC CODES 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)...."
2011-08-22 13:58:49 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
unknown
4ea53bc29b automerge 2011-05-18 15:17:26 +02:00
unknown
e55fb3bbe8 Fix mysqltest printing of include stack.
The printing of include stack in the error case in mysqltest omitted the
bottom of the stack (the line number in original test case file), and instead
printed the top of the stack twice. Fix to print each element on the stack
once and only once.
2011-05-18 15:15:36 +02:00
Michael Widenius
4cb68c0e89 mysqltest: Write command to be executed to the log BEFORE executing the command.
Fixed race condition in event that could cause hang when stopping event scheduler with SET GLOBAL event_scheduler=OFF 

client/mysqltest.cc:
  Write command to be executed to the log BEFORE executing the command.
  This makes it easier to debug crashes as the log will contain the fatal command.
mysql-test/r/mysqltest.result:
  Updated results (we now get more things logged)
sql/event_queue.cc:
  Fixed race condition in event that could cause hang when stopping event scheduler with SET GLOBAL event_scheduler=OFF.
  The reason was that a kill signal could be sent between last check of thd->killed and before thd->enter_cond() in which case the signal
  would be missed and we would be stuck in Event_scheduler::stop() forever.
2011-05-09 14:38:49 +03:00
Michael Widenius
e415ba0fb2 Merge with MySQL 5.1.57/58
Moved some BSD string functions from Unireg
2011-05-02 20:58:45 +03:00
Michael Widenius
58bb0769bd Merge with MySQL 5.1.55
- Fixed some issues with partitions and connection_string, which also fixed lp:716890 "Pre- and post-recovery crash in Aria"
- Fixed wrong assert in Aria

Now need to merge with latest xtradb before pushing 

sql/ha_partition.cc:
  Ensure that m_ordered_rec_buffer is not freed before close.
sql/mysqld.cc:
  Changed to use opt_stack_trace instead of opt_pstack.
  Removed references to pstack
sql/partition_element.h:
  Ensure that connect_string is initialized
storage/maria/ma_key_recover.c:
  Fixed wrong assert
2011-02-20 18:51:43 +02:00
Bjorn Munch
8937cbd5ae upmerge 58896,58900,59002 2011-01-11 15:15:25 +01:00
Bjorn Munch
e2b73747df Bug #59002 Please make mtr print correct file and line number when tests fail
Followup: had forgotten to update mysqltest.test due to changed output - duh!
2011-01-11 15:00:21 +01:00
Bjorn Munch
5376a76dea Bug #58900 query_get_value crashes when result begins with dollar sign
Generalized fix for recursive backtick
Optional arg to eval_expr telling it not to interpret
2011-01-11 10:54:42 +01:00
Bjorn Munch
2c8bccadcc merge from 5.5 main 2010-12-17 10:37:46 +01:00
Georgi Kodinov
b908a74bc9 merge 2010-12-16 16:40:52 +02:00
Bjorn Munch
5a95f0aeb1 upmerge 58511,58522,58608,58092 2010-12-09 15:32:39 +01:00
Bjorn Munch
06790ea7be Bug #58695 mysqltest coredumps on "if($x == ){"
Add check that there is a RHS of the expression
Added to mysqltest.test
2010-12-09 12:15:25 +01:00
Bjorn Munch
cc21483fcf Bug #58092 Test "rpl_cross_version" has "copy_file" failing
I am not fixing the test failure
Adds printing of my_errno when commands fail, could hopefully help
2010-12-01 11:11:16 +01:00
Bjorn Munch
ca2ea5541e Bug #58412 mysqltest: allow quoting of strings in let and in if comparison
Stripping quotes in let was a bad idea, will not fix
Added code to strip quotes from rhs in comparisons
2010-11-26 10:57:01 +01:00
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Ramil Kalimullin
bd557f04f6 Manual merge from mysql-5.5-bugteam. 2010-11-22 14:47:28 +03:00
Ramil Kalimullin
65116d3408 Manual-merge from mysql-5.1-bugteam. 2010-11-22 12:21:10 +03:00
Michael Widenius
b52020221e Merge with MySQL 5.1.52 2010-11-23 23:39:59 +02:00
Bjorn Munch
5da7193a7b upmerge 58257 2010-11-18 16:41:35 +01:00
Bjorn Munch
32ea070845 Bug #58257 mysqltest: in if(), ! $var with space is always false
Evaluation would start with the space and thus ignore the $
Added while() to skip past white space
2010-11-17 16:05:52 +01:00
Bjorn Munch
32b7c75073 upmerge 58087 2010-11-17 11:18:52 +01:00
Mattias Jonsson
2db0a406fd merge 2010-11-17 10:41:54 +01:00