summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore4
-rwxr-xr-xBUILD/compile-dist41
-rwxr-xr-xCMakeLists.txt5
-rw-r--r--Makefile.am27
-rwxr-xr-xclient/CMakeLists.txt4
-rw-r--r--client/Makefile.am6
-rw-r--r--client/mysql.cc58
-rw-r--r--client/mysql_upgrade.c17
-rw-r--r--client/mysqladmin.cc44
-rw-r--r--client/mysqlcheck.c27
-rw-r--r--client/mysqldump.c2
-rw-r--r--client/mysqlimport.c2
-rw-r--r--client/mysqlshow.c2
-rw-r--r--client/mysqlslap.c4
-rw-r--r--client/mysqltest.cc (renamed from client/mysqltest.c)1048
-rw-r--r--cmd-line-utils/libedit/Makefile.am34
-rw-r--r--cmd-line-utils/libedit/README50
-rw-r--r--cmd-line-utils/libedit/TEST/test.c269
-rw-r--r--cmd-line-utils/libedit/chared.c45
-rw-r--r--cmd-line-utils/libedit/chared.h9
-rw-r--r--cmd-line-utils/libedit/common.c27
-rw-r--r--cmd-line-utils/libedit/compat.h43
-rw-r--r--cmd-line-utils/libedit/compat_conf.h2
-rw-r--r--cmd-line-utils/libedit/config.h14
-rw-r--r--cmd-line-utils/libedit/editline.3619
-rw-r--r--cmd-line-utils/libedit/editrc.5491
-rw-r--r--cmd-line-utils/libedit/el.c204
-rw-r--r--cmd-line-utils/libedit/el.h6
-rw-r--r--cmd-line-utils/libedit/el_term.h28
-rw-r--r--cmd-line-utils/libedit/emacs.c15
-rw-r--r--cmd-line-utils/libedit/fgetln.h3
-rw-r--r--cmd-line-utils/libedit/filecomplete.c558
-rw-r--r--cmd-line-utils/libedit/filecomplete.h (renamed from cmd-line-utils/libedit/fgetln.c)72
-rw-r--r--cmd-line-utils/libedit/hist.c8
-rw-r--r--cmd-line-utils/libedit/histedit.h24
-rw-r--r--cmd-line-utils/libedit/history.c62
-rw-r--r--cmd-line-utils/libedit/key.c148
-rw-r--r--cmd-line-utils/libedit/key.h6
-rw-r--r--cmd-line-utils/libedit/libedit_term.h124
-rw-r--r--cmd-line-utils/libedit/makelist.sh20
-rw-r--r--cmd-line-utils/libedit/map.c64
-rw-r--r--cmd-line-utils/libedit/np/fgetln.c50
-rw-r--r--cmd-line-utils/libedit/np/strlcat.c80
-rw-r--r--cmd-line-utils/libedit/np/strlcpy.c77
-rw-r--r--cmd-line-utils/libedit/np/unvis.c99
-rw-r--r--cmd-line-utils/libedit/np/vis.c409
-rw-r--r--cmd-line-utils/libedit/np/vis.h19
-rw-r--r--cmd-line-utils/libedit/parse.c12
-rw-r--r--cmd-line-utils/libedit/parse.h4
-rw-r--r--cmd-line-utils/libedit/prompt.c8
-rw-r--r--cmd-line-utils/libedit/read.c60
-rw-r--r--cmd-line-utils/libedit/read.h9
-rw-r--r--cmd-line-utils/libedit/readline.c843
-rw-r--r--cmd-line-utils/libedit/readline/readline.h38
-rw-r--r--cmd-line-utils/libedit/refresh.c76
-rw-r--r--cmd-line-utils/libedit/search.c9
-rw-r--r--cmd-line-utils/libedit/sig.c20
-rw-r--r--cmd-line-utils/libedit/sig.h3
-rw-r--r--cmd-line-utils/libedit/strlcpy.c73
-rw-r--r--cmd-line-utils/libedit/strlcpy.h2
-rw-r--r--cmd-line-utils/libedit/sys.h27
-rw-r--r--cmd-line-utils/libedit/term.c336
-rw-r--r--cmd-line-utils/libedit/tokenizer.c8
-rw-r--r--cmd-line-utils/libedit/tokenizer.h54
-rw-r--r--cmd-line-utils/libedit/tty.c89
-rw-r--r--cmd-line-utils/libedit/tty.h6
-rw-r--r--cmd-line-utils/libedit/unvis.c311
-rw-r--r--cmd-line-utils/libedit/vi.c39
-rw-r--r--cmd-line-utils/libedit/vis.c392
-rw-r--r--cmd-line-utils/libedit/vis.h92
-rw-r--r--config/ac-macros/character_sets.m43
-rw-r--r--config/ac-macros/ha_ndbcluster.m42
-rw-r--r--configure.in25
-rw-r--r--extra/resolve_stack_dump.c3
-rw-r--r--extra/yassl/include/openssl/ssl.h4
-rw-r--r--include/config-win.h78
-rw-r--r--include/hash.h2
-rw-r--r--include/m_ctype.h1
-rw-r--r--include/my_global.h7
-rw-r--r--include/my_sys.h3
-rw-r--r--include/myisam.h2
-rw-r--r--include/thr_lock.h5
-rw-r--r--libmysqld/examples/CMakeLists.txt2
-rw-r--r--libmysqld/examples/Makefile.am2
-rw-r--r--mysql-test/Makefile.am243
-rwxr-xr-xmysql-test/create-test-result65
-rw-r--r--mysql-test/extra/binlog_tests/binlog_truncate.test27
-rw-r--r--mysql-test/extra/binlog_tests/blackhole.test4
-rw-r--r--mysql-test/extra/binlog_tests/ctype_ucs_binlog.test3
-rw-r--r--mysql-test/extra/binlog_tests/database.test2
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test7
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_EE_err.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment.test17
-rw-r--r--mysql-test/extra/rpl_tests/rpl_conflicts.test168
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test12
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_flsh_tbls.test19
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test23
-rw-r--r--mysql-test/extra/rpl_tests/rpl_log.test41
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_001.test8
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp002.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_tabledefs.test12
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_000001.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_truncate.test23
-rw-r--r--mysql-test/extra/rpl_tests/rpl_truncate_helper.test51
-rwxr-xr-xmysql-test/fix-result22
-rw-r--r--mysql-test/include/analyze-sync_with_master.test6
-rw-r--r--mysql-test/include/analyze-timeout.test3
-rw-r--r--mysql-test/include/analyze_failure_sync_with_master.test15
-rw-r--r--mysql-test/include/check-testcase.test52
-rw-r--r--mysql-test/include/check-warnings.test61
-rw-r--r--mysql-test/include/check_events_off.inc31
-rw-r--r--mysql-test/include/circular_rpl_for_4_hosts_init.inc130
-rw-r--r--mysql-test/include/circular_rpl_for_4_hosts_sync.inc23
-rw-r--r--mysql-test/include/cleanup_fake_relay_log.inc16
-rw-r--r--mysql-test/include/commit.inc15
-rw-r--r--mysql-test/include/concurrent.inc2
-rw-r--r--mysql-test/include/count_sessions.inc21
-rw-r--r--mysql-test/include/default_my.cnf25
-rw-r--r--mysql-test/include/default_mysqld.cnf21
-rw-r--r--mysql-test/include/default_ndbd.cnf27
-rw-r--r--mysql-test/include/federated.inc28
-rw-r--r--mysql-test/include/have_32bit.inc2
-rw-r--r--mysql-test/include/have_64bit.inc2
-rw-r--r--mysql-test/include/have_blackhole.inc9
-rw-r--r--mysql-test/include/have_bug25714.inc7
-rw-r--r--mysql-test/include/have_federated_db.inc4
-rw-r--r--mysql-test/include/have_log_bin.inc8
-rw-r--r--mysql-test/include/have_ndbapi_examples.inc2
-rw-r--r--mysql-test/include/have_simple_parser.inc16
-rw-r--r--mysql-test/include/index_merge1.inc26
-rw-r--r--mysql-test/include/linux_sys_vars.inc1
-rw-r--r--mysql-test/include/loaddata_autocom.inc8
-rw-r--r--mysql-test/include/master-slave-reset.inc17
-rw-r--r--mysql-test/include/mix1.inc3
-rw-r--r--mysql-test/include/mtr_check.sql59
-rw-r--r--mysql-test/include/mtr_warnings.sql238
-rw-r--r--mysql-test/include/mysqlbinlog_row_engine.inc10
-rw-r--r--mysql-test/include/mysqltest-x.inc1
-rw-r--r--mysql-test/include/ndb_backup.inc22
-rw-r--r--mysql-test/include/ndb_master-slave_2ch.inc136
-rw-r--r--mysql-test/include/ndb_not_readonly.inc2
-rw-r--r--mysql-test/include/ndb_restore_master.inc4
-rw-r--r--mysql-test/include/ndb_restore_slave_eoption.inc4
-rw-r--r--mysql-test/include/no_running_event_scheduler.inc23
-rw-r--r--mysql-test/include/no_running_events.inc25
-rw-r--r--mysql-test/include/not_as_root.inc7
-rw-r--r--mysql-test/include/ps_modify.inc1
-rw-r--r--mysql-test/include/query_cache.inc1
-rw-r--r--mysql-test/include/report-features.test1
-rw-r--r--mysql-test/include/reset_master_and_slave.inc6
-rw-r--r--mysql-test/include/restart_mysqld.inc25
-rw-r--r--mysql-test/include/rpl_events.inc16
-rw-r--r--mysql-test/include/rpl_multi_engine.inc2
-rw-r--r--mysql-test/include/running_event_scheduler.inc30
-rw-r--r--mysql-test/include/setup_fake_relay_log.inc77
-rw-r--r--mysql-test/include/show_rpl_debug_info.inc87
-rw-r--r--mysql-test/include/start_slave.inc21
-rw-r--r--mysql-test/include/stop_slave.inc21
-rw-r--r--mysql-test/include/sync_slave_io_with_master.inc36
-rw-r--r--mysql-test/include/testdb_only.inc12
-rw-r--r--mysql-test/include/wait_condition_sp.inc62
-rw-r--r--mysql-test/include/wait_for_slave_io_to_start.inc19
-rw-r--r--mysql-test/include/wait_for_slave_io_to_stop.inc51
-rw-r--r--mysql-test/include/wait_for_slave_param.inc90
-rw-r--r--mysql-test/include/wait_for_slave_sql_error.inc68
-rw-r--r--mysql-test/include/wait_for_slave_sql_error_and_skip.inc23
-rw-r--r--mysql-test/include/wait_for_slave_sql_to_start.inc46
-rw-r--r--mysql-test/include/wait_for_slave_sql_to_stop.inc51
-rw-r--r--mysql-test/include/wait_for_slave_to_start.inc51
-rw-r--r--mysql-test/include/wait_for_slave_to_stop.inc59
-rw-r--r--mysql-test/include/wait_show_pattern.inc51
-rw-r--r--mysql-test/include/wait_slave_status.inc129
-rw-r--r--mysql-test/include/wait_until_connected_again.inc6
-rw-r--r--mysql-test/include/wait_until_count_sessions.inc112
-rw-r--r--mysql-test/include/wait_until_disconnected.inc21
-rw-r--r--mysql-test/include/windows_sys_vars.inc1
-rw-r--r--mysql-test/install_test_db.sh115
-rw-r--r--mysql-test/lib/My/Config.pm106
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm655
-rw-r--r--mysql-test/lib/My/CoreDump.pm131
-rw-r--r--mysql-test/lib/My/File/Path.pm177
-rw-r--r--mysql-test/lib/My/Find.pm245
-rwxr-xr-xmysql-test/lib/My/Handles.pm69
-rw-r--r--mysql-test/lib/My/Options.pm199
-rw-r--r--mysql-test/lib/My/Platform.pm156
-rw-r--r--mysql-test/lib/My/SafeProcess.pm580
-rw-r--r--mysql-test/lib/My/SafeProcess/Base.pm212
-rw-r--r--mysql-test/lib/My/SafeProcess/CMakeLists.txt17
-rw-r--r--mysql-test/lib/My/SafeProcess/Makefile.am28
-rwxr-xr-xmysql-test/lib/My/SafeProcess/safe_kill_win.cc85
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.cc277
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.pl151
-rwxr-xr-xmysql-test/lib/My/SafeProcess/safe_process_win.cc323
-rw-r--r--mysql-test/lib/My/SysInfo.pm211
-rw-r--r--mysql-test/lib/My/Test.pm123
-rw-r--r--mysql-test/lib/mtr_cases.pm1138
-rw-r--r--mysql-test/lib/mtr_diff.pl297
-rw-r--r--mysql-test/lib/mtr_gcov.pl36
-rw-r--r--mysql-test/lib/mtr_io.pl164
-rw-r--r--mysql-test/lib/mtr_match.pm97
-rw-r--r--mysql-test/lib/mtr_misc.pl177
-rw-r--r--mysql-test/lib/mtr_process.pl1045
-rw-r--r--mysql-test/lib/mtr_report.pm465
-rw-r--r--mysql-test/lib/mtr_stress.pl10
-rw-r--r--mysql-test/lib/mtr_unique.pm195
-rw-r--r--mysql-test/lib/t/Base.t27
-rw-r--r--mysql-test/lib/t/Find.t33
-rw-r--r--mysql-test/lib/t/Options.t127
-rw-r--r--mysql-test/lib/t/Platform.t18
-rw-r--r--mysql-test/lib/t/SafeProcess.t102
-rwxr-xr-xmysql-test/lib/t/SafeProcessStress.pl149
-rw-r--r--mysql-test/lib/t/copytree.t34
-rw-r--r--mysql-test/lib/t/dummyd.pl38
-rw-r--r--mysql-test/lib/t/rmtree.t52
-rwxr-xr-xmysql-test/lib/t/testMyConfig.t131
-rwxr-xr-xmysql-test/lib/t/testMyConfigFactory.t98
-rwxr-xr-xmysql-test/lib/t/test_child.pl21
-rw-r--r--mysql-test/lib/v1/My/Config.pm422
-rw-r--r--mysql-test/lib/v1/mtr_cases.pl (renamed from mysql-test/lib/mtr_cases.pl)2
-rw-r--r--mysql-test/lib/v1/mtr_gcov.pl74
-rw-r--r--mysql-test/lib/v1/mtr_gprof.pl64
-rw-r--r--mysql-test/lib/v1/mtr_im.pl (renamed from mysql-test/lib/mtr_im.pl)0
-rw-r--r--mysql-test/lib/v1/mtr_io.pl218
-rw-r--r--mysql-test/lib/v1/mtr_match.pl (renamed from mysql-test/lib/mtr_match.pl)0
-rw-r--r--mysql-test/lib/v1/mtr_misc.pl312
-rw-r--r--mysql-test/lib/v1/mtr_process.pl1142
-rw-r--r--mysql-test/lib/v1/mtr_report.pl (renamed from mysql-test/lib/mtr_report.pl)0
-rw-r--r--mysql-test/lib/v1/mtr_stress.pl191
-rw-r--r--mysql-test/lib/v1/mtr_timer.pl (renamed from mysql-test/lib/mtr_timer.pl)0
-rw-r--r--mysql-test/lib/v1/mtr_unique.pl (renamed from mysql-test/lib/mtr_unique.pl)0
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl5393
-rw-r--r--mysql-test/lib/v1/ndb_config_1_node.ini (renamed from mysql-test/ndb/ndb_config_1_node.ini)0
-rw-r--r--mysql-test/lib/v1/ndb_config_2_node.ini (renamed from mysql-test/ndb/ndb_config_2_node.ini)0
-rw-r--r--mysql-test/misc/kill_master.sh4
-rw-r--r--mysql-test/misc/mysql-test_V1.9.pl1121
-rw-r--r--mysql-test/mysql-test-run-shell.sh2338
-rwxr-xr-xmysql-test/mysql-test-run.pl6173
-rw-r--r--mysql-test/ndb/Makefile.am23
-rw-r--r--mysql-test/ndb/basic.result69
-rw-r--r--mysql-test/ndb/basic.test17
-rw-r--r--mysql-test/ndb/basic_log.result0
-rw-r--r--mysql-test/ndb/ndb_config_4_node.ini55
-rw-r--r--mysql-test/ndb/ndbcluster.sh414
-rw-r--r--mysql-test/ndb/restart.result16
-rw-r--r--mysql-test/ndb/restart.test12
-rw-r--r--mysql-test/ndb/restart_log.result20
-rw-r--r--mysql-test/r/1st.result1
-rw-r--r--mysql-test/r/alter_table.result16
-rw-r--r--mysql-test/r/archive.result1
-rw-r--r--mysql-test/r/auto_increment.result12
-rw-r--r--mysql-test/r/backup.result26
-rw-r--r--mysql-test/r/cache_innodb.result13
-rw-r--r--mysql-test/r/change_user.result2
-rw-r--r--mysql-test/r/commit_1innodb.result23
-rw-r--r--mysql-test/r/concurrent_innodb_safelog.result1
-rw-r--r--mysql-test/r/concurrent_innodb_unsafelog.result1
-rw-r--r--mysql-test/r/concurrent_insert_func.result73
-rw-r--r--mysql-test/r/create.result3
-rw-r--r--mysql-test/r/csv.result15
-rw-r--r--mysql-test/r/csv_not_null.result5
-rw-r--r--mysql-test/r/ctype_big5.result4
-rw-r--r--mysql-test/r/ctype_ldml.result19
-rw-r--r--mysql-test/r/ctype_ucs.result53
-rw-r--r--mysql-test/r/date_formats.result49
-rw-r--r--mysql-test/r/delayed.result26
-rw-r--r--mysql-test/r/distinct.result8
-rw-r--r--mysql-test/r/drop.result2
-rw-r--r--mysql-test/r/error_simulation.result1
-rw-r--r--mysql-test/r/events_bugs.result29
-rw-r--r--mysql-test/r/events_restart.result (renamed from mysql-test/r/events_restart_phase2.result)22
-rw-r--r--mysql-test/r/events_restart_phase1.result16
-rw-r--r--mysql-test/r/events_restart_phase3.result6
-rw-r--r--mysql-test/r/events_scheduling.result12
-rw-r--r--mysql-test/r/fulltext.result9
-rw-r--r--mysql-test/r/fulltext_plugin.result5
-rw-r--r--mysql-test/r/func_compress.result1
-rw-r--r--mysql-test/r/func_if.result9
-rw-r--r--mysql-test/r/func_in.result12
-rw-r--r--mysql-test/r/func_misc.result5
-rw-r--r--mysql-test/r/func_sapdb.result14
-rw-r--r--mysql-test/r/func_str.result12
-rw-r--r--mysql-test/r/func_time.result17
-rw-r--r--mysql-test/r/gis.result2
-rw-r--r--mysql-test/r/grant.result8
-rw-r--r--mysql-test/r/grant2.result26
-rw-r--r--mysql-test/r/greedy_optimizer.result77
-rw-r--r--mysql-test/r/group_by.result1
-rw-r--r--mysql-test/r/have_bug25714.require2
-rw-r--r--mysql-test/r/have_outfile.require2
-rw-r--r--mysql-test/r/have_simple_parser.require2
-rw-r--r--mysql-test/r/having.result7
-rw-r--r--mysql-test/r/index_merge_myisam.result28
-rw-r--r--mysql-test/r/information_schema.result45
-rw-r--r--mysql-test/r/init_file.result2
-rw-r--r--mysql-test/r/innodb-autoinc-optimize.result2
-rw-r--r--mysql-test/r/innodb-autoinc.result410
-rw-r--r--mysql-test/r/innodb-semi-consistent.result5
-rw-r--r--mysql-test/r/innodb.result10
-rw-r--r--mysql-test/r/innodb_bug30919.result (renamed from mysql-test/suite/rpl/r/rpl_innodb_bug30919.result)0
-rw-r--r--mysql-test/r/innodb_bug34300.result5
-rw-r--r--mysql-test/r/innodb_bug38231.result11
-rw-r--r--mysql-test/r/innodb_bug39438.result1
-rw-r--r--mysql-test/r/innodb_ignore_builtin.result9
-rw-r--r--mysql-test/r/innodb_max_dirty_pages_pct_func.result30
-rw-r--r--mysql-test/r/innodb_mysql.result164
-rw-r--r--mysql-test/r/innodb_mysql_rbk.result21
-rw-r--r--mysql-test/r/innodb_notembedded.result3
-rw-r--r--mysql-test/r/insert_update.result1
-rw-r--r--mysql-test/r/key_buffer_size_func.result36
-rw-r--r--mysql-test/r/loaddata.result42
-rw-r--r--mysql-test/r/loaddata_autocom_innodb.result4
-rw-r--r--mysql-test/r/lock_tables_lost_commit.result12
-rw-r--r--mysql-test/r/log_queries_not_using_indexes_basic.result53
-rw-r--r--mysql-test/r/log_state.result81
-rw-r--r--mysql-test/r/log_tables.result22
-rw-r--r--mysql-test/r/lowercase_table3.result1
-rw-r--r--mysql-test/r/merge.result11
-rw-r--r--mysql-test/r/myisam.result2
-rw-r--r--mysql-test/r/myisampack.result27
-rw-r--r--mysql-test/r/mysql.result8
-rw-r--r--mysql-test/r/mysql_client_test.result2
-rw-r--r--mysql-test/r/mysql_upgrade.result8
-rw-r--r--mysql-test/r/mysqlbinlog.result41
-rw-r--r--mysql-test/r/mysqlbinlog2.result70
-rw-r--r--mysql-test/r/mysqlbinlog_base64.result5
-rw-r--r--mysql-test/r/mysqlbinlog_row.result2
-rw-r--r--mysql-test/r/mysqlbinlog_row_big.result2
-rw-r--r--mysql-test/r/mysqlbinlog_row_innodb.result10
-rw-r--r--mysql-test/r/mysqlbinlog_row_myisam.result10
-rw-r--r--mysql-test/r/mysqlbinlog_row_trans.result34
-rw-r--r--mysql-test/r/mysqlcheck.result57
-rw-r--r--mysql-test/r/mysqldump.result183
-rw-r--r--mysql-test/r/mysqltest.result31
-rw-r--r--mysql-test/r/not_as_root.require2
-rw-r--r--mysql-test/r/not_embedded_server.result15
-rw-r--r--mysql-test/r/null.result8
-rw-r--r--mysql-test/r/openssl_1.result4
-rw-r--r--mysql-test/r/outfile.resultbin2135 -> 2149 bytes
-rw-r--r--mysql-test/r/partition.result2
-rw-r--r--mysql-test/r/partition_datatype.result2
-rw-r--r--mysql-test/r/partition_error.result52
-rw-r--r--mysql-test/r/partition_innodb_semi_consistent.result129
-rw-r--r--mysql-test/r/partition_mgm.result7
-rw-r--r--mysql-test/r/partition_not_windows.result12
-rw-r--r--mysql-test/r/partition_pruning.result12
-rw-r--r--mysql-test/r/profiling.result2
-rw-r--r--mysql-test/r/ps_1general.result1
-rw-r--r--mysql-test/r/ps_2myisam.result5
-rw-r--r--mysql-test/r/ps_3innodb.result5
-rw-r--r--mysql-test/r/ps_4heap.result5
-rw-r--r--mysql-test/r/ps_5merge.result10
-rw-r--r--mysql-test/r/query_cache.result91
-rw-r--r--mysql-test/r/query_cache_28249.result62
-rw-r--r--mysql-test/r/query_cache_notembedded.result3
-rw-r--r--mysql-test/r/rpl_init_slave_func.result47
-rw-r--r--mysql-test/r/schema.result1
-rw-r--r--mysql-test/r/select.result59
-rw-r--r--mysql-test/r/show_check.result1
-rw-r--r--mysql-test/r/sp-destruct.result4
-rw-r--r--mysql-test/r/sp-error.result2
-rw-r--r--mysql-test/r/sp-security.result4
-rw-r--r--mysql-test/r/sp.result18
-rw-r--r--mysql-test/r/status.result29
-rw-r--r--mysql-test/r/status2.result73
-rw-r--r--mysql-test/r/strict.result7
-rw-r--r--mysql-test/r/subselect.result40
-rw-r--r--mysql-test/r/subselect3.result54
-rw-r--r--mysql-test/r/symlink.result8
-rw-r--r--mysql-test/r/system_mysql_db.result1
-rw-r--r--mysql-test/r/temp_table.result16
-rw-r--r--mysql-test/r/timezone2.result3
-rw-r--r--mysql-test/r/trigger.result12
-rw-r--r--mysql-test/r/type_bit.result41
-rw-r--r--mysql-test/r/type_blob.result20
-rw-r--r--mysql-test/r/type_date.result13
-rw-r--r--mysql-test/r/type_float.result9
-rw-r--r--mysql-test/r/type_timestamp.result19
-rw-r--r--mysql-test/r/user_var-binlog.result2
-rw-r--r--mysql-test/r/user_var.result5
-rw-r--r--mysql-test/r/variables-notembedded.result1
-rw-r--r--mysql-test/r/variables.result6
-rw-r--r--mysql-test/r/view.result8
-rw-r--r--mysql-test/r/wait_timeout.result33
-rw-r--r--mysql-test/r/warnings.result5
-rw-r--r--mysql-test/r/warnings_engine_disabled.result10
-rw-r--r--mysql-test/r/xml.result35
-rwxr-xr-xmysql-test/resolve-stack8
-rw-r--r--mysql-test/std_data/bug40482-bin.000001bin0 -> 172 bytes
-rw-r--r--mysql-test/std_data/cacert.pem24
-rw-r--r--mysql-test/std_data/client-cert.pem75
-rw-r--r--mysql-test/std_data/client-key.pem14
-rw-r--r--mysql-test/std_data/ndb_config_config.ini55
-rw-r--r--mysql-test/std_data/rpl_bug28618.dat (renamed from mysql-test/suite/rpl/data/rpl_bug28618.dat)0
-rw-r--r--mysql-test/std_data/rpl_mixed.dat (renamed from mysql-test/suite/rpl/data/rpl_mixed.dat)0
-rw-r--r--mysql-test/std_data/server-cert-des.pem16
-rw-r--r--mysql-test/std_data/server-cert.pem73
-rw-r--r--mysql-test/std_data/server-key-des.pem18
-rw-r--r--mysql-test/std_data/server-key.pem14
-rw-r--r--mysql-test/std_data/server8k-cert.pem185
-rw-r--r--mysql-test/std_data/server8k-key.pem194
-rw-r--r--mysql-test/suite/binlog/combinations6
-rw-r--r--mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_base64_flag.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_database.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_index.result (renamed from mysql-test/r/binlog_index.result)7
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb.result7
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb_row.result31
-rw-r--r--mysql-test/suite/binlog/r/binlog_killed_simulate.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_multi_engine.result92
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result28
-rw-r--r--mysql-test/suite/binlog/r/binlog_start_comment.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_blackhole.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result12
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_row.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_tmp_table.result30
-rw-r--r--mysql-test/suite/binlog/r/binlog_truncate_innodb.result63
-rw-r--r--mysql-test/suite/binlog/r/binlog_truncate_myisam.result12
-rw-r--r--mysql-test/suite/binlog/r/binlog_unsafe.result7
-rw-r--r--mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test16
-rw-r--r--mysql-test/suite/binlog/t/binlog_index.test (renamed from mysql-test/t/binlog_index.test)18
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb.test1
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb_row.test42
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed.test7
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed_simulate.test7
-rw-r--r--mysql-test/suite/binlog/t/binlog_start_comment.test7
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_row.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_tmp_table.test83
-rw-r--r--mysql-test/suite/binlog/t/binlog_truncate_innodb-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_truncate_innodb.test29
-rw-r--r--mysql-test/suite/binlog/t/binlog_truncate_myisam.test11
-rw-r--r--mysql-test/suite/binlog/t/binlog_unsafe.test14
-rw-r--r--mysql-test/suite/binlog/t/disabled.def2
-rw-r--r--mysql-test/suite/bugs/combinations6
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug36391.result17
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug36391-master.opt1
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug36391.test28
-rw-r--r--mysql-test/suite/federated/disabled.def12
-rw-r--r--mysql-test/suite/federated/federated.inc11
-rw-r--r--mysql-test/suite/federated/federated.result (renamed from mysql-test/r/federated.result)15
-rw-r--r--mysql-test/suite/federated/federated.test (renamed from mysql-test/t/federated.test)6
-rw-r--r--mysql-test/suite/federated/federated_archive.result (renamed from mysql-test/r/federated_archive.result)13
-rw-r--r--mysql-test/suite/federated/federated_archive.test (renamed from mysql-test/t/federated_archive.test)6
-rw-r--r--mysql-test/suite/federated/federated_bug_13118.result (renamed from mysql-test/r/federated_bug_13118.result)13
-rw-r--r--mysql-test/suite/federated/federated_bug_13118.test (renamed from mysql-test/t/federated_bug_13118.test)7
-rw-r--r--mysql-test/suite/federated/federated_bug_25714.result (renamed from mysql-test/r/federated_bug_25714.result)13
-rw-r--r--mysql-test/suite/federated/federated_bug_25714.test (renamed from mysql-test/t/federated_bug_25714.test)12
-rw-r--r--mysql-test/suite/federated/federated_cleanup.inc (renamed from mysql-test/include/federated_cleanup.inc)4
-rw-r--r--mysql-test/suite/federated/federated_innodb-slave.opt (renamed from mysql-test/t/federated_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/federated/federated_innodb.result (renamed from mysql-test/r/federated_innodb.result)13
-rw-r--r--mysql-test/suite/federated/federated_innodb.test (renamed from mysql-test/t/federated_innodb.test)4
-rw-r--r--mysql-test/suite/federated/federated_server.result (renamed from mysql-test/r/federated_server.result)21
-rw-r--r--mysql-test/suite/federated/federated_server.test (renamed from mysql-test/t/federated_server.test)11
-rw-r--r--mysql-test/suite/federated/federated_transactions-slave.opt (renamed from mysql-test/t/federated_transactions-slave.opt)0
-rw-r--r--mysql-test/suite/federated/federated_transactions.result (renamed from mysql-test/r/federated_transactions.result)0
-rw-r--r--mysql-test/suite/federated/federated_transactions.test (renamed from mysql-test/t/federated_transactions.test)6
-rw-r--r--mysql-test/suite/federated/have_federated_db.inc6
-rw-r--r--mysql-test/suite/federated/my.cnf12
-rw-r--r--mysql-test/suite/funcs_1/datadict/charset_collation.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_routines.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_schemata.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_tables.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_triggers.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_views.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/statistics.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/table_constraints.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/tables.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/tables1.inc1
-rw-r--r--mysql-test/suite/funcs_1/include/innodb_tb1.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/innodb_tb2.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/innodb_tb3.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/innodb_tb4.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/memory_tb1.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/memory_tb2.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/memory_tb3.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/memory_tb4.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/myisam_tb1.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/myisam_tb2.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/myisam_tb3.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/myisam_tb4.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/ndb_tb1.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/ndb_tb2.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/ndb_tb3.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/ndb_tb4.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/sp_tb.inc20
-rw-r--r--mysql-test/suite/funcs_1/include/tb3.inc2
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_func_view.result8
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_02.result20
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_03.result20
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_06.result20
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_07.result20
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_08.result227
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_10.result20
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0102.result4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0407.result3
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_09.result5
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_views.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result (renamed from mysql-test/suite/funcs_1/r/is_coll_charset_applic.result)0
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_innodb.result30
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result82
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_memory.result30
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam.result30
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result30
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_ndb.result20
-rw-r--r--mysql-test/suite/funcs_1/r/is_engines.result18
-rw-r--r--mysql-test/suite/funcs_1/r/memory_func_view.result8
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_02.result20
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_03.result20
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_06.result20
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_07.result20
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_08.result227
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_10.result20
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0102.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0407.result3
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_09.result5
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_1011ext.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_views.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_func_view.result8
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_02.result20
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_03.result20
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_06.result20
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_07.result20
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_08.result227
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_10.result20
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0102.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0407.result3
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_09.result5
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views.result4
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_func_view.result8
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_02.result20
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_03.result20
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_06.result20
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_07.result20
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_08.result227
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_10.result20
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_0102.result4
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_0407.result3
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_09.result5
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result4
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_views.result7
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result1256
-rw-r--r--mysql-test/suite/funcs_1/storedproc/load_sp_tb.inc20
-rw-r--r--mysql-test/suite/funcs_1/storedproc/param_check.inc19
-rw-r--r--mysql-test/suite/funcs_1/storedproc/storedproc_06.inc1
-rw-r--r--mysql-test/suite/funcs_1/storedproc/storedproc_10.inc1
-rw-r--r--mysql-test/suite/funcs_1/t/is_basics_mixed.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test (renamed from mysql-test/suite/funcs_1/t/is_coll_charset_applic.test)4
-rw-r--r--mysql-test/suite/funcs_1/t/is_column_privileges.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_columns.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_engines_federated.test2
-rw-r--r--mysql-test/suite/funcs_1/t/is_schema_privileges.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_statistics.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_table_constraints.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_table_privileges.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_user_privileges.test1
-rw-r--r--mysql-test/suite/funcs_1/t/storedproc.test1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_03.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_03e_columns.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_03e_db_level.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_03e_db_table_mix.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_03e_definer.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_03e_global_db_mix.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_03e_prepare.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_03e_table_level.inc2
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_03e_transaction.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_0407.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_08.inc1
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_09.inc3
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc4
-rw-r--r--mysql-test/suite/funcs_1/views/func_view.inc2
-rw-r--r--mysql-test/suite/funcs_2/t/disabled.def8
-rw-r--r--mysql-test/suite/jp/r/jp_create_db_sjis.result4
-rw-r--r--mysql-test/suite/jp/r/jp_create_db_ucs2.result4
-rw-r--r--mysql-test/suite/jp/r/jp_create_db_ujis.result4
-rw-r--r--mysql-test/suite/jp/r/jp_create_db_utf8.result4
-rw-r--r--mysql-test/suite/jp/t/jp_create_db_sjis.test2
-rw-r--r--mysql-test/suite/jp/t/jp_create_db_ucs2.test2
-rw-r--r--mysql-test/suite/jp/t/jp_create_db_ujis.test2
-rw-r--r--mysql-test/suite/jp/t/jp_create_db_utf8.test2
-rw-r--r--mysql-test/suite/ndb/my.cnf20
-rw-r--r--mysql-test/suite/ndb/r/loaddata_autocom_ndb.result4
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result114
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_discover.result18
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_format.result30
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result2
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_log_bin.result96
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_multi.result60
-rw-r--r--mysql-test/suite/ndb/r/ndb_config.result2
-rw-r--r--mysql-test/suite/ndb/r/ndb_load.result4
-rw-r--r--mysql-test/suite/ndb/r/ndb_loaddatalocal.result16
-rw-r--r--mysql-test/suite/ndb/r/ndb_read_multi_range.result2
-rw-r--r--mysql-test/suite/ndb/r/ndb_replace.result4
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore.result24
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_partition.result24
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_print.result24
-rw-r--r--mysql-test/suite/ndb/r/ndb_single_user.result4
-rw-r--r--mysql-test/suite/ndb/r/ndb_trigger.result2
-rw-r--r--mysql-test/suite/ndb/r/ps_7ndb.result5
-rw-r--r--mysql-test/suite/ndb/t/disabled.def3
-rw-r--r--mysql-test/suite/ndb/t/ndb_alter_table.test9
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_discover.test2
-rw-r--r--mysql-test/suite/ndb/t/ndb_config.test8
-rw-r--r--mysql-test/suite/ndb/t/ndb_load.test4
-rw-r--r--mysql-test/suite/ndb/t/ndb_loaddatalocal.test41
-rw-r--r--mysql-test/suite/ndb/t/ndb_read_multi_range.test2
-rw-r--r--mysql-test/suite/ndb/t/ndb_replace.test4
-rw-r--r--mysql-test/suite/ndb/t/ndb_single_user.test17
-rw-r--r--mysql-test/suite/ndb/t/ndb_trigger.test2
-rw-r--r--mysql-test/suite/ndb/t/ndbapi.test16
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result24
-rw-r--r--mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result10
-rw-r--r--mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test26
-rw-r--r--mysql-test/suite/parts/inc/partition.pre4
-rw-r--r--mysql-test/suite/parts/inc/partition_auto_increment.inc10
-rw-r--r--mysql-test/suite/parts/inc/partition_check_drop.inc29
-rw-r--r--mysql-test/suite/parts/inc/partition_key_32col.inc2
-rw-r--r--mysql-test/suite/parts/inc/partition_layout.inc5
-rw-r--r--mysql-test/suite/parts/inc/partition_layout_check1.inc41
-rw-r--r--mysql-test/suite/parts/inc/partition_layout_check2.inc33
-rw-r--r--mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc9
-rw-r--r--mysql-test/suite/parts/r/ndb_dd_backuprestore.result24
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_innodb.result126
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_myisam.result126
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_ndb.result126
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_blackhole.result2
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_innodb.result8
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_memory.result8
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_myisam.result8
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_ndb.result8
-rw-r--r--mysql-test/suite/parts/r/partition_bit_innodb.result18
-rw-r--r--mysql-test/suite/parts/r/partition_bit_myisam.result18
-rw-r--r--mysql-test/suite/parts/r/partition_bit_ndb.result126
-rw-r--r--mysql-test/suite/parts/r/partition_special_innodb.result5
-rw-r--r--mysql-test/suite/parts/r/partition_t55.out124
-rw-r--r--mysql-test/suite/parts/r/rpl_partition.result28
-rw-r--r--mysql-test/suite/parts/t/disabled.def5
-rw-r--r--mysql-test/suite/parts/t/partition_basic_symlink_innodb.test27
-rw-r--r--mysql-test/suite/parts/t/partition_bit_ndb.test60
-rw-r--r--mysql-test/suite/parts/t/partition_recover_myisam.test10
-rw-r--r--mysql-test/suite/parts/t/partition_repair_myisam.test60
-rw-r--r--mysql-test/suite/parts/t/partition_sessions.test391
-rw-r--r--mysql-test/suite/parts/t/partition_special_innodb.test2
-rw-r--r--mysql-test/suite/parts/t/partition_value_innodb.test12
-rw-r--r--mysql-test/suite/parts/t/partition_value_myisam.test12
-rw-r--r--mysql-test/suite/parts/t/partition_value_ndb.test12
-rw-r--r--mysql-test/suite/parts/t/rpl_partition.test4
-rw-r--r--mysql-test/suite/rpl/combinations6
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_dml.inc8
-rw-r--r--mysql-test/suite/rpl/my.cnf14
-rw-r--r--mysql-test/suite/rpl/r/rpl_LD_INFILE.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_db.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_corruption.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug26395.result41
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug33931.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result298
-rw-r--r--mysql-test/suite/rpl/r/rpl_cross_version.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_view.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_events.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_found_rows.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_idempotency.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_load_table_from_master.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata.result21
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_charset.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_fatal.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_m.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_s.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_simple.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddatalocal.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_loadfile.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_misc_functions.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_engine.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result55
-rw-r--r--mysql-test/suite/rpl/r/rpl_ps.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_do.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_001.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_conflicts.result109
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result97
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result68
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_loaddata_m.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mystery22.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id1.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id2.result51
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_grp_exec.result123
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_status.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp_effects.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_000001.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_EE_err2.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_conflicts.result54
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result36
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mystery22.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary_errors.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_timezone.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_2myisam.result238
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_3innodb.result256
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result4
-rw-r--r--mysql-test/suite/rpl/rpl_1slave_base.cnf50
-rw-r--r--mysql-test/suite/rpl/t/disabled.def1
-rwxr-xr-xmysql-test/suite/rpl/t/rpl000017-slave.sh4
-rw-r--r--mysql-test/suite/rpl/t/rpl000018-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl000018-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_000015-slave.opt (renamed from mysql-test/suite/rpl/t/rpl_000015.slave-mi)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_000015.cnf2
-rw-r--r--mysql-test/suite/rpl/t/rpl_LD_INFILE.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_db.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_grant.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_blackhole.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug26395.test97
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug33931-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug33931.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf27
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test324
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version.test36
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_view.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_err_ignoredtable.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_events.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency-slave.opt3
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency.test44
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_from_master.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_table_from_master.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_charset.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_fatal.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_m.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_s.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_simple.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test21
-rw-r--r--mysql-test/suite/rpl/t/rpl_loadfile.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_log_pos.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_misc_functions.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test37
-rw-r--r--mysql-test/suite/rpl/t/rpl_ps.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_read_only-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_do.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt (renamed from mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.cnf6
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_conflicts.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test45
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_max_relay_size.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mystery22.test52
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp005.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test19
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id1.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id2.test45
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_grp_exec.test176
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test36
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_status.test30
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test15
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_stop_slave.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_conflicts.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mystery22.test66
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test59
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary_errors.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test95
-rw-r--r--mysql-test/suite/rpl_ndb/my.cnf75
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result2
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result2
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result8
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result64
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result8
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result4
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result12
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result32
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result457
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result6
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result4
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result8
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result110
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result4
-rw-r--r--mysql-test/suite/rpl_ndb/t/disabled.def3
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test10
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test18
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test7
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf31
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test172
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test4
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test11
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test12
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test4
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt (renamed from mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt (renamed from mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test450
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test5
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test131
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test4
-rw-r--r--mysql-test/suite/sys_vars/inc/charset_basic.inc (renamed from mysql-test/include/charset_basic.inc)0
-rw-r--r--mysql-test/suite/sys_vars/inc/collation_basic.inc (renamed from mysql-test/include/collation_basic.inc)0
-rw-r--r--mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc115
-rw-r--r--mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc4
-rw-r--r--mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc20
-rw-r--r--mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc104
-rw-r--r--mysql-test/suite/sys_vars/inc/timestamp_basic.inc11
-rw-r--r--mysql-test/suite/sys_vars/r/auto_commit_basic.result (renamed from mysql-test/r/auto_commit_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result (renamed from mysql-test/r/auto_increment_increment_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_increment_func.result (renamed from mysql-test/r/auto_increment_increment_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result (renamed from mysql-test/r/auto_increment_offset_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_offset_func.result (renamed from mysql-test/r/auto_increment_offset_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/autocommit_func.result (renamed from mysql-test/r/autocommit_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result (renamed from mysql-test/r/automatic_sp_privileges_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/automatic_sp_privileges_func.result (renamed from mysql-test/r/automatic_sp_privileges_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/basedir_basic.result (renamed from mysql-test/r/basedir_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/big_tables_basic.result (renamed from mysql-test/r/big_tables_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_format_basic.result (renamed from mysql-test/r/binlog_format_basic.result)28
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_basic.result (renamed from mysql-test/r/character_set_client_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_func.result (renamed from mysql-test/r/character_set_client_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_connection_basic.result (renamed from mysql-test/r/character_set_connection_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_connection_func.result (renamed from mysql-test/r/character_set_connection_func.result)3
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_database_basic.result (renamed from mysql-test/r/character_set_database_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_database_func.result (renamed from mysql-test/r/character_set_database_func.result)14
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result (renamed from mysql-test/r/character_set_filesystem_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_results_basic.result (renamed from mysql-test/r/character_set_results_basic.result)bin16478 -> 16478 bytes
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_results_func.result (renamed from mysql-test/r/character_set_results_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_server_basic.result (renamed from mysql-test/r/character_set_server_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_server_func.result (renamed from mysql-test/r/character_set_server_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_system_basic.result (renamed from mysql-test/r/character_set_system_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/collation_connection_basic.result (renamed from mysql-test/r/collation_connection_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/collation_connection_func.result (renamed from mysql-test/r/collation_connection_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/collation_database_basic.result (renamed from mysql-test/r/collation_database_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/collation_database_func.result (renamed from mysql-test/r/collation_database_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/collation_server_basic.result (renamed from mysql-test/r/collation_server_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/collation_server_func.result (renamed from mysql-test/r/collation_server_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/completion_type_basic.result (renamed from mysql-test/r/completion_type_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/completion_type_func.result (renamed from mysql-test/r/completion_type_func.result)45
-rw-r--r--mysql-test/suite/sys_vars/r/concurrent_insert_basic.result (renamed from mysql-test/r/concurrent_insert_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/concurrent_insert_func.result121
-rw-r--r--mysql-test/suite/sys_vars/r/connect_timeout_basic.result (renamed from mysql-test/r/connect_timeout_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/datadir_basic.result (renamed from mysql-test/r/datadir_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/default_week_format_basic.result (renamed from mysql-test/r/default_week_format_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/default_week_format_func.result (renamed from mysql-test/r/default_week_format_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/delay_key_write_basic.result (renamed from mysql-test/r/delay_key_write_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/delay_key_write_func.result (renamed from mysql-test/r/delay_key_write_func.result)14
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result (renamed from mysql-test/r/delayed_insert_limit_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result (renamed from mysql-test/r/delayed_insert_timeout_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/div_precision_increment_basic.result (renamed from mysql-test/r/div_precision_increment_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/div_precision_increment_func.result (renamed from mysql-test/r/div_precision_increment_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result (renamed from mysql-test/r/engine_condition_pushdown_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/error_count_basic.result (renamed from mysql-test/r/error_count_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/event_scheduler_basic.result (renamed from mysql-test/r/event_scheduler_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/event_scheduler_func.result (renamed from mysql-test/r/event_scheduler_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/expire_logs_days_basic.result (renamed from mysql-test/r/expire_logs_days_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/flush_basic.result (renamed from mysql-test/r/flush_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result (renamed from mysql-test/r/foreign_key_checks_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/foreign_key_checks_func.result (renamed from mysql-test/r/foreign_key_checks_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/ft_boolean_syntax_basic.result (renamed from mysql-test/r/ft_boolean_syntax_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result (renamed from mysql-test/r/ft_boolean_syntax_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/general_log_basic.result (renamed from mysql-test/r/general_log_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/general_log_file_basic.result (renamed from mysql-test/r/general_log_file_basic.result)3
-rw-r--r--mysql-test/suite/sys_vars/r/general_log_file_func.result (renamed from mysql-test/r/general_log_file_func.result)12
-rw-r--r--mysql-test/suite/sys_vars/r/general_log_func.result (renamed from mysql-test/r/general_log_func.result)10
-rw-r--r--mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result (renamed from mysql-test/r/group_concat_max_len_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/group_concat_max_len_func.result (renamed from mysql-test/r/group_concat_max_len_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_compress_basic.result (renamed from mysql-test/r/have_compress_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_crypt_basic.result (renamed from mysql-test/r/have_crypt_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_csv_basic.result (renamed from mysql-test/r/have_csv_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_dynamic_loading_basic.result (renamed from mysql-test/r/have_dynamic_loading_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_geometry_basic.result (renamed from mysql-test/r/have_geometry_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_innodb_basic.result (renamed from mysql-test/r/have_innodb_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_ndbcluster_basic.result (renamed from mysql-test/r/have_ndbcluster_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_openssl_basic.result (renamed from mysql-test/r/have_openssl_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_partitioning_basic.result (renamed from mysql-test/r/have_partitioning_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_query_cache_basic.result (renamed from mysql-test/r/have_query_cache_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_rtree_keys_basic.result (renamed from mysql-test/r/have_rtree_keys_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_ssl_basic.result (renamed from mysql-test/r/have_ssl_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/have_symlink_basic.result (renamed from mysql-test/r/have_symlink_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/hostname_basic.result (renamed from mysql-test/r/hostname_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/identity_basic.result (renamed from mysql-test/r/identity_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/identity_func.result (renamed from mysql-test/r/identity_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/init_connect_basic.result (renamed from mysql-test/r/init_connect_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/init_slave_basic.result (renamed from mysql-test/r/init_slave_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_additional_mem_pool_size_basic.result (renamed from mysql-test/r/innodb_additional_mem_pool_size_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_autoextend_increment_basic.result (renamed from mysql-test/r/innodb_autoextend_increment_basic.result)12
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_autoinc_lock_mode_basic.result (renamed from mysql-test/r/innodb_autoinc_lock_mode_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_autoinc_lock_mode_func.result (renamed from mysql-test/r/innodb_autoinc_lock_mode_func.result)5
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result (renamed from mysql-test/r/innodb_buffer_pool_size_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_checksums_basic.result (renamed from mysql-test/r/innodb_checksums_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result (renamed from mysql-test/r/innodb_commit_concurrency_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_data_file_path_basic.result (renamed from mysql-test/r/innodb_data_file_path_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_data_home_dir_basic.result (renamed from mysql-test/r/innodb_data_home_dir_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result (renamed from mysql-test/r/innodb_doublewrite_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result (renamed from mysql-test/r/innodb_fast_shutdown_basic.result)10
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_io_threads_basic.result (renamed from mysql-test/r/innodb_file_io_threads_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result (renamed from mysql-test/r/innodb_file_per_table_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result (renamed from mysql-test/r/innodb_flush_log_at_trx_commit_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result (renamed from mysql-test/r/innodb_flush_method_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_force_recovery_basic.result (renamed from mysql-test/r/innodb_force_recovery_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result (renamed from mysql-test/r/innodb_lock_wait_timeout_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_locks_unsafe_for_binlog_basic.result (renamed from mysql-test/r/innodb_locks_unsafe_for_binlog_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_buffer_size_basic.result (renamed from mysql-test/r/innodb_log_buffer_size_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_file_size_basic.result (renamed from mysql-test/r/innodb_log_file_size_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_files_in_group_basic.result (renamed from mysql-test/r/innodb_log_files_in_group_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_group_home_dir_basic.result (renamed from mysql-test/r/innodb_log_group_home_dir_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_basic.result (renamed from mysql-test/r/innodb_max_dirty_pages_pct_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result94
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_mirrored_log_groups_basic.result (renamed from mysql-test/r/innodb_mirrored_log_groups_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_open_files_basic.result (renamed from mysql-test/r/innodb_open_files_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_rollback_on_timeout_basic.result (renamed from mysql-test/r/innodb_rollback_on_timeout_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result (renamed from mysql-test/r/innodb_support_xa_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_support_xa_func.result (renamed from mysql-test/r/innodb_support_xa_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result (renamed from mysql-test/r/innodb_table_locks_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_table_locks_func.result (renamed from mysql-test/r/innodb_table_locks_func.result)8
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result (renamed from mysql-test/r/innodb_thread_concurrency_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result (renamed from mysql-test/r/innodb_thread_sleep_delay_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/insert_id_basic.result (renamed from mysql-test/r/insert_id_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/insert_id_func.result (renamed from mysql-test/r/insert_id_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/interactive_timeout_basic.result (renamed from mysql-test/r/interactive_timeout_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/interactive_timeout_func.result (renamed from mysql-test/r/interactive_timeout_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result4
-rw-r--r--mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result (renamed from mysql-test/r/keep_files_on_create_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result55
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result63
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_func.result61
-rw-r--r--mysql-test/suite/sys_vars/r/last_insert_id_func.result (renamed from mysql-test/r/last_insert_id_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/lc_time_names_basic.result (renamed from mysql-test/r/lc_time_names_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/lc_time_names_func.result (renamed from mysql-test/r/lc_time_names_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/license_basic.result (renamed from mysql-test/r/license_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/local_infile_basic.result (renamed from mysql-test/r/local_infile_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/local_infile_func.result (renamed from mysql-test/r/local_infile_func.result)4
-rw-r--r--mysql-test/suite/sys_vars/r/log_basic.result (renamed from mysql-test/r/log_basic.result)8
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result (renamed from mysql-test/r/log_bin_trust_function_creators_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_func.result (renamed from mysql-test/r/log_bin_trust_function_creators_func.result)46
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result (renamed from mysql-test/r/log_bin_trust_routine_creators_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/log_output_basic.result (renamed from mysql-test/r/log_output_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/log_output_func.result (renamed from mysql-test/r/log_output_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result104
-rw-r--r--mysql-test/suite/sys_vars/r/log_warnings_basic_32.result4
-rw-r--r--mysql-test/suite/sys_vars/r/long_query_time_basic.result (renamed from mysql-test/r/long_query_time_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/low_priority_updates_basic.result (renamed from mysql-test/r/low_priority_updates_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result (renamed from mysql-test/r/max_allowed_packet_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_allowed_packet_func.result (renamed from mysql-test/r/max_allowed_packet_func.result)12
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result2
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_cache_size_func.result (renamed from mysql-test/r/max_binlog_cache_size_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_size_basic.result (renamed from mysql-test/r/max_binlog_size_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_connections_basic.result (renamed from mysql-test/r/max_connections_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result (renamed from mysql-test/r/max_delayed_threads_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_error_count_basic.result (renamed from mysql-test/r/max_error_count_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result (renamed from mysql-test/r/max_insert_delayed_threads_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_join_size_func.result (renamed from mysql-test/r/max_join_size_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result (renamed from mysql-test/r/max_length_for_sort_data_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result (renamed from mysql-test/r/max_prepared_stmt_count_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_prepared_stmt_count_func.result (renamed from mysql-test/r/max_prepared_stmt_count_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result (renamed from mysql-test/r/max_relay_log_size_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result (renamed from mysql-test/r/max_seeks_for_key_func.result)38
-rw-r--r--mysql-test/suite/sys_vars/r/max_sort_length_basic.result (renamed from mysql-test/r/max_sort_length_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_sort_length_func.result (renamed from mysql-test/r/max_sort_length_func.result)2
-rw-r--r--mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result (renamed from mysql-test/r/max_sp_recursion_depth_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_sp_recursion_depth_func.result (renamed from mysql-test/r/max_sp_recursion_depth_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_user_connections_basic.result (renamed from mysql-test/r/max_user_connections_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/max_user_connections_func.result (renamed from mysql-test/r/max_user_connections_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result (renamed from mysql-test/r/myisam_data_pointer_size_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result (renamed from mysql-test/r/myisam_data_pointer_size_func.result)2
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result2
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result (renamed from mysql-test/r/myisam_sort_buffer_size_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result (renamed from mysql-test/r/myisam_stats_method_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_stats_method_func.result (renamed from mysql-test/r/myisam_stats_method_func.result)26
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_use_mmap_basic.result (renamed from mysql-test/r/myisam_use_mmap_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/ndb_log_update_as_write_basic.result (renamed from mysql-test/r/ndb_log_update_as_write_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/ndb_log_updated_only_basic.result (renamed from mysql-test/r/ndb_log_updated_only_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/net_buffer_length_basic.result (renamed from mysql-test/r/net_buffer_length_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/net_read_timeout_basic.result (renamed from mysql-test/r/net_read_timeout_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/net_write_timeout_basic.result (renamed from mysql-test/r/net_write_timeout_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/new_basic.result (renamed from mysql-test/r/new_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/old_passwords_basic.result (renamed from mysql-test/r/old_passwords_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/old_passwords_func.result (renamed from mysql-test/r/old_passwords_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result (renamed from mysql-test/r/optimizer_prune_level_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result (renamed from mysql-test/r/optimizer_search_depth_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result (renamed from mysql-test/r/preload_buffer_size_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result8
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_limit_func.result (renamed from mysql-test/r/query_cache_limit_func.result)10
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result10
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result10
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_type_basic.result (renamed from mysql-test/r/query_cache_type_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_type_func.result (renamed from mysql-test/r/query_cache_type_func.result)2
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result (renamed from mysql-test/r/query_cache_wlock_invalidate_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result (renamed from mysql-test/r/query_cache_wlock_invalidate_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result36
-rw-r--r--mysql-test/suite/sys_vars/r/query_prealloc_size_func.result (renamed from mysql-test/r/query_prealloc_size_func.result)15
-rw-r--r--mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result8
-rw-r--r--mysql-test/suite/sys_vars/r/read_buffer_size_basic.result (renamed from mysql-test/r/read_buffer_size_basic.result)4
-rw-r--r--mysql-test/suite/sys_vars/r/read_only_basic.result (renamed from mysql-test/r/read_only_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/read_only_func.result (renamed from mysql-test/r/read_only_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result (renamed from mysql-test/r/read_rnd_buffer_size_basic.result)4
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_purge_basic.result (renamed from mysql-test/r/relay_log_purge_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_init_slave_func.result46
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_max_binlog_size_func.result (renamed from mysql-test/r/rpl_max_binlog_size_func.result)3
-rw-r--r--mysql-test/suite/sys_vars/r/secure_auth_basic.result (renamed from mysql-test/r/secure_auth_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/secure_auth_func.result (renamed from mysql-test/r/secure_auth_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result (renamed from mysql-test/r/slave_allow_batching_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/slave_compressed_protocol_basic.result (renamed from mysql-test/r/slave_compressed_protocol_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/slave_exec_mode_basic.result (renamed from mysql-test/r/slave_exec_mode_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result (renamed from mysql-test/r/slave_net_timeout_basic.result)4
-rw-r--r--mysql-test/suite/sys_vars/r/slow_launch_time_basic.result (renamed from mysql-test/r/slow_launch_time_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/slow_launch_time_func.result (renamed from mysql-test/r/slow_launch_time_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_basic.result (renamed from mysql-test/r/slow_query_log_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result (renamed from mysql-test/r/slow_query_log_file_basic.result)6
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_file_func.result (renamed from mysql-test/r/slow_query_log_file_func.result)2
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_func.result (renamed from mysql-test/r/slow_query_log_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result123
-rw-r--r--mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result119
-rw-r--r--mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result (renamed from mysql-test/r/sql_auto_is_null_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_basic.result (renamed from mysql-test/r/sql_big_selects_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_func.result (renamed from mysql-test/r/sql_big_selects_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_tables_basic.result (renamed from mysql-test/r/sql_big_tables_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_tables_func.result (renamed from mysql-test/r/sql_big_tables_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result (renamed from mysql-test/r/sql_buffer_result_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_buffer_result_func.result (renamed from mysql-test/r/sql_buffer_result_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_bin_basic.result (renamed from mysql-test/r/sql_log_bin_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_off_basic.result (renamed from mysql-test/r/sql_log_off_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_off_func.result (renamed from mysql-test/r/sql_log_off_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result (renamed from mysql-test/r/sql_low_priority_updates_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result (renamed from mysql-test/r/sql_low_priority_updates_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_max_join_size_func.result (renamed from mysql-test/r/sql_max_join_size_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_mode_basic.result (renamed from mysql-test/r/sql_mode_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_mode_func.result (renamed from mysql-test/r/sql_mode_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_notes_basic.result (renamed from mysql-test/r/sql_notes_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_notes_func.result (renamed from mysql-test/r/sql_notes_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result (renamed from mysql-test/r/sql_quote_show_create_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_quote_show_create_func.result (renamed from mysql-test/r/sql_quote_show_create_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result (renamed from mysql-test/r/sql_safe_updates_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_safe_updates_func.result (renamed from mysql-test/r/sql_safe_updates_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_select_limit_func.result (renamed from mysql-test/r/sql_select_limit_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result (renamed from mysql-test/r/sql_slave_skip_counter_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_warnings_basic.result (renamed from mysql-test/r/sql_warnings_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sql_warnings_func.result (renamed from mysql-test/r/sql_warnings_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/ssl_ca_basic.result (renamed from mysql-test/r/ssl_ca_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/ssl_capath_basic.result (renamed from mysql-test/r/ssl_capath_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/ssl_cert_basic.result (renamed from mysql-test/r/ssl_cert_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/ssl_cipher_basic.result (renamed from mysql-test/r/ssl_cipher_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/ssl_key_basic.result (renamed from mysql-test/r/ssl_key_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/storage_engine_basic.result (renamed from mysql-test/r/storage_engine_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/sync_frm_basic.result (renamed from mysql-test/r/sync_frm_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/system_time_zone_basic.result (renamed from mysql-test/r/system_time_zone_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/table_definition_cache_basic.result (renamed from mysql-test/r/table_definition_cache_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result (renamed from mysql-test/r/table_lock_wait_timeout_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/table_open_cache_basic.result (renamed from mysql-test/r/table_open_cache_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/thread_cache_size_func.result (renamed from mysql-test/r/thread_cache_size_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/thread_handling_basic.result (renamed from mysql-test/r/thread_handling_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/time_zone_basic.result (renamed from mysql-test/r/time_zone_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/time_zone_func.result (renamed from mysql-test/r/time_zone_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/timed_mutexes_basic.result (renamed from mysql-test/r/timed_mutexes_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/timestamp_basic_32.result5
-rw-r--r--mysql-test/suite/sys_vars/r/timestamp_basic_64.result5
-rw-r--r--mysql-test/suite/sys_vars/r/timestamp_func.result (renamed from mysql-test/r/timestamp_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/timestamp_sysdate_is_now_func.result (renamed from mysql-test/r/timestamp_sysdate_is_now_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/tmp_table_size_basic.result (renamed from mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result)54
-rw-r--r--mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result172
-rw-r--r--mysql-test/suite/sys_vars/r/tmpdir_basic.result (renamed from mysql-test/r/tmpdir_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result6
-rw-r--r--mysql-test/suite/sys_vars/r/tx_isolation_basic.result (renamed from mysql-test/r/tx_isolation_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/tx_isolation_func.result (renamed from mysql-test/r/tx_isolation_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/unique_checks_basic.result (renamed from mysql-test/r/unique_checks_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/updatable_views_with_limit_basic.result (renamed from mysql-test/r/updatable_views_with_limit_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/updatable_views_with_limit_func.result (renamed from mysql-test/r/updatable_views_with_limit_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/version_basic.result (renamed from mysql-test/r/version_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/version_comment_basic.result (renamed from mysql-test/r/version_comment_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/version_compile_machine_basic.result (renamed from mysql-test/r/version_compile_machine_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/version_compile_os_basic.result (renamed from mysql-test/r/version_compile_os_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/wait_timeout_func.result (renamed from mysql-test/r/wait_timeout_func.result)0
-rw-r--r--mysql-test/suite/sys_vars/r/warning_count_basic.result (renamed from mysql-test/r/warning_count_basic.result)0
-rw-r--r--mysql-test/suite/sys_vars/t/auto_commit_basic.test (renamed from mysql-test/t/auto_commit_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test (renamed from mysql-test/t/auto_increment_increment_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_increment_func.test (renamed from mysql-test/t/auto_increment_increment_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test (renamed from mysql-test/t/auto_increment_offset_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_offset_func.test (renamed from mysql-test/t/auto_increment_offset_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func-master.opt (renamed from mysql-test/t/autocommit_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func.test (renamed from mysql-test/t/autocommit_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test (renamed from mysql-test/t/automatic_sp_privileges_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/automatic_sp_privileges_func.test (renamed from mysql-test/t/automatic_sp_privileges_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/basedir_basic.test (renamed from mysql-test/t/basedir_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/big_tables_basic.test (renamed from mysql-test/t/big_tables_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_format_basic.test (renamed from mysql-test/t/binlog_format_basic.test)37
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_client_basic.test (renamed from mysql-test/t/character_set_client_basic.test)2
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_client_func.test (renamed from mysql-test/t/character_set_client_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_connection_basic.test (renamed from mysql-test/t/character_set_connection_basic.test)4
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_connection_func.test (renamed from mysql-test/t/character_set_connection_func.test)17
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_database_basic.test (renamed from mysql-test/t/character_set_database_basic.test)4
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_database_func.test (renamed from mysql-test/t/character_set_database_func.test)25
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test (renamed from mysql-test/t/character_set_filesystem_basic.test)4
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_filesystem_func-master.opt (renamed from mysql-test/t/character_set_filesystem_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_results_basic.test (renamed from mysql-test/t/character_set_results_basic.test)4
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_results_func.test (renamed from mysql-test/t/character_set_results_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_server_basic.test (renamed from mysql-test/t/character_set_server_basic.test)4
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_server_func.test (renamed from mysql-test/t/character_set_server_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_system_basic.test (renamed from mysql-test/t/character_set_system_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/collation_connection_basic.test (renamed from mysql-test/t/collation_connection_basic.test)4
-rw-r--r--mysql-test/suite/sys_vars/t/collation_connection_func.test (renamed from mysql-test/t/collation_connection_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/collation_database_basic.test (renamed from mysql-test/t/collation_database_basic.test)4
-rw-r--r--mysql-test/suite/sys_vars/t/collation_database_func.test (renamed from mysql-test/t/collation_database_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/collation_server_basic.test (renamed from mysql-test/t/collation_server_basic.test)4
-rw-r--r--mysql-test/suite/sys_vars/t/collation_server_func.test (renamed from mysql-test/t/collation_server_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/completion_type_basic.test (renamed from mysql-test/t/completion_type_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/completion_type_func-master.opt (renamed from mysql-test/t/completion_type_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/completion_type_func.test (renamed from mysql-test/t/completion_type_func.test)58
-rw-r--r--mysql-test/suite/sys_vars/t/concurrent_insert_basic.test (renamed from mysql-test/t/concurrent_insert_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/concurrent_insert_func.test (renamed from mysql-test/t/concurrent_insert_func.test)120
-rw-r--r--mysql-test/suite/sys_vars/t/connect_timeout_basic.test (renamed from mysql-test/t/connect_timeout_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/datadir_basic.test (renamed from mysql-test/t/datadir_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/default_week_format_basic.test (renamed from mysql-test/t/default_week_format_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/default_week_format_func.test (renamed from mysql-test/t/default_week_format_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/delay_key_write_basic.test (renamed from mysql-test/t/delay_key_write_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt (renamed from mysql-test/t/delay_key_write_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/delay_key_write_func.test (renamed from mysql-test/t/delay_key_write_func.test)34
-rw-r--r--mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test (renamed from mysql-test/t/delayed_insert_limit_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test (renamed from mysql-test/t/delayed_insert_timeout_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/div_precision_increment_basic.test (renamed from mysql-test/t/div_precision_increment_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/div_precision_increment_func.test (renamed from mysql-test/t/div_precision_increment_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test (renamed from mysql-test/t/engine_condition_pushdown_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/error_count_basic.test (renamed from mysql-test/t/error_count_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/event_scheduler_basic.test (renamed from mysql-test/t/event_scheduler_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/event_scheduler_func.test (renamed from mysql-test/t/event_scheduler_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/expire_logs_days_basic.test (renamed from mysql-test/t/expire_logs_days_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/flush_basic.test (renamed from mysql-test/t/flush_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test (renamed from mysql-test/t/foreign_key_checks_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/foreign_key_checks_func.test (renamed from mysql-test/t/foreign_key_checks_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test (renamed from mysql-test/t/ft_boolean_syntax_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test (renamed from mysql-test/t/ft_boolean_syntax_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_basic.test (renamed from mysql-test/t/general_log_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_file_basic-master.opt (renamed from mysql-test/t/general_log_file_basic-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_file_basic.test (renamed from mysql-test/t/general_log_file_basic.test)7
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_file_func-master.opt (renamed from mysql-test/t/general_log_file_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_file_func.test (renamed from mysql-test/t/general_log_file_func.test)19
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_func.test (renamed from mysql-test/t/general_log_func.test)32
-rw-r--r--mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test (renamed from mysql-test/t/group_concat_max_len_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/group_concat_max_len_func.test (renamed from mysql-test/t/group_concat_max_len_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_compress_basic.test (renamed from mysql-test/t/have_compress_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_crypt_basic.test (renamed from mysql-test/t/have_crypt_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_csv_basic.test (renamed from mysql-test/t/have_csv_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_dynamic_loading_basic.test (renamed from mysql-test/t/have_dynamic_loading_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_geometry_basic.test (renamed from mysql-test/t/have_geometry_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_innodb_basic.test (renamed from mysql-test/t/have_innodb_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_ndbcluster_basic.test (renamed from mysql-test/t/have_ndbcluster_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_openssl_basic.test (renamed from mysql-test/t/have_openssl_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_partitioning_basic.test (renamed from mysql-test/t/have_partitioning_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_query_cache_basic.test (renamed from mysql-test/t/have_query_cache_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_rtree_keys_basic.test (renamed from mysql-test/t/have_rtree_keys_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_ssl_basic.test (renamed from mysql-test/t/have_ssl_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/have_symlink_basic.test (renamed from mysql-test/t/have_symlink_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/hostname_basic.test (renamed from mysql-test/t/hostname_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/identity_basic.test (renamed from mysql-test/t/identity_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/identity_func-master.opt (renamed from mysql-test/t/identity_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/identity_func.test (renamed from mysql-test/t/identity_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/init_connect_basic.test (renamed from mysql-test/t/init_connect_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/init_slave_basic.test (renamed from mysql-test/t/init_slave_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_additional_mem_pool_size_basic.test (renamed from mysql-test/t/innodb_additional_mem_pool_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_autoextend_increment_basic.test (renamed from mysql-test/t/innodb_autoextend_increment_basic.test)127
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test (renamed from mysql-test/t/innodb_autoinc_lock_mode_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt (renamed from mysql-test/t/innodb_autoinc_lock_mode_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test (renamed from mysql-test/t/innodb_autoinc_lock_mode_func.test)15
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test (renamed from mysql-test/t/innodb_buffer_pool_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_checksums_basic.test (renamed from mysql-test/t/innodb_checksums_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test (renamed from mysql-test/t/innodb_commit_concurrency_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_data_file_path_basic.test (renamed from mysql-test/t/innodb_data_file_path_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_data_home_dir_basic.test (renamed from mysql-test/t/innodb_data_home_dir_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test (renamed from mysql-test/t/innodb_doublewrite_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test (renamed from mysql-test/t/innodb_fast_shutdown_basic.test)87
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_io_threads_basic.test (renamed from mysql-test/t/innodb_file_io_threads_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test (renamed from mysql-test/t/innodb_file_per_table_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flush_log_at_trx_commit_basic.test (renamed from mysql-test/t/innodb_flush_log_at_trx_commit_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test (renamed from mysql-test/t/innodb_flush_method_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_force_recovery_basic.test (renamed from mysql-test/t/innodb_force_recovery_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test (renamed from mysql-test/t/innodb_lock_wait_timeout_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test (renamed from mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_buffer_size_basic.test (renamed from mysql-test/t/innodb_log_buffer_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_file_size_basic.test (renamed from mysql-test/t/innodb_log_file_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_files_in_group_basic.test (renamed from mysql-test/t/innodb_log_files_in_group_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_group_home_dir_basic.test (renamed from mysql-test/t/innodb_log_group_home_dir_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test (renamed from mysql-test/t/innodb_max_dirty_pages_pct_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test (renamed from mysql-test/t/innodb_max_dirty_pages_pct_func.test)91
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_mirrored_log_groups_basic.test (renamed from mysql-test/t/innodb_mirrored_log_groups_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_open_files_basic.test (renamed from mysql-test/t/innodb_open_files_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test (renamed from mysql-test/t/innodb_rollback_on_timeout_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test (renamed from mysql-test/t/innodb_support_xa_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_support_xa_func.test (renamed from mysql-test/t/innodb_support_xa_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test (renamed from mysql-test/t/innodb_table_locks_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_table_locks_func.test (renamed from mysql-test/t/innodb_table_locks_func.test)12
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_thread_concurrency_basic.test (renamed from mysql-test/t/innodb_thread_concurrency_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/insert_id_basic.test (renamed from mysql-test/t/insert_id_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/insert_id_func.test (renamed from mysql-test/t/insert_id_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/interactive_timeout_basic.test (renamed from mysql-test/t/interactive_timeout_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/interactive_timeout_func.test (renamed from mysql-test/t/interactive_timeout_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test (renamed from mysql-test/t/keep_files_on_create_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/key_buffer_size_func.test (renamed from mysql-test/t/key_buffer_size_func.test)71
-rw-r--r--mysql-test/suite/sys_vars/t/last_insert_id_func-master.opt (renamed from mysql-test/t/last_insert_id_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/last_insert_id_func.test (renamed from mysql-test/t/last_insert_id_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/lc_time_names_basic.test (renamed from mysql-test/t/lc_time_names_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/lc_time_names_func.test (renamed from mysql-test/t/lc_time_names_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/license_basic.test (renamed from mysql-test/t/license_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/local_infile_basic.test (renamed from mysql-test/t/local_infile_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/local_infile_func.test (renamed from mysql-test/t/local_infile_func.test)4
-rw-r--r--mysql-test/suite/sys_vars/t/log_basic.test (renamed from mysql-test/t/log_basic.test)26
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test (renamed from mysql-test/t/log_bin_trust_function_creators_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_func.test (renamed from mysql-test/t/log_bin_trust_function_creators_func.test)56
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test (renamed from mysql-test/t/log_bin_trust_routine_creators_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/log_output_basic.test (renamed from mysql-test/t/log_output_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/log_output_func.test (renamed from mysql-test/t/log_output_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test132
-rw-r--r--mysql-test/suite/sys_vars/t/long_query_time_basic.test (renamed from mysql-test/t/long_query_time_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/low_priority_updates_basic.test (renamed from mysql-test/t/low_priority_updates_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test (renamed from mysql-test/t/max_allowed_packet_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_allowed_packet_func.test (renamed from mysql-test/t/max_allowed_packet_func.test)21
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt (renamed from mysql-test/t/max_binlog_cache_size_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_size_basic.test (renamed from mysql-test/t/max_binlog_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_connections_basic.test (renamed from mysql-test/t/max_connections_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test (renamed from mysql-test/t/max_delayed_threads_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_error_count_basic.test (renamed from mysql-test/t/max_error_count_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test (renamed from mysql-test/t/max_insert_delayed_threads_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_join_size_func.test (renamed from mysql-test/t/max_join_size_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test (renamed from mysql-test/t/max_length_for_sort_data_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test (renamed from mysql-test/t/max_prepared_stmt_count_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test (renamed from mysql-test/t/max_prepared_stmt_count_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test (renamed from mysql-test/t/max_relay_log_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_seeks_for_key_func.test (renamed from mysql-test/t/max_seeks_for_key_func.test)58
-rw-r--r--mysql-test/suite/sys_vars/t/max_sort_length_basic.test (renamed from mysql-test/t/max_sort_length_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_sort_length_func.test (renamed from mysql-test/t/max_sort_length_func.test)16
-rw-r--r--mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test (renamed from mysql-test/t/max_sp_recursion_depth_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func.test (renamed from mysql-test/t/max_sp_recursion_depth_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_user_connections_basic.test (renamed from mysql-test/t/max_user_connections_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/max_user_connections_func.test (renamed from mysql-test/t/max_user_connections_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test (renamed from mysql-test/t/myisam_data_pointer_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test (renamed from mysql-test/t/myisam_data_pointer_size_func.test)14
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test (renamed from mysql-test/t/myisam_stats_method_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_stats_method_func.test (renamed from mysql-test/t/myisam_stats_method_func.test)37
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_use_mmap_basic.test (renamed from mysql-test/t/myisam_use_mmap_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/ndb_log_update_as_write_basic.test (renamed from mysql-test/t/ndb_log_update_as_write_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/ndb_log_updated_only_basic.test (renamed from mysql-test/t/ndb_log_updated_only_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/net_buffer_length_basic.test (renamed from mysql-test/t/net_buffer_length_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/net_read_timeout_basic.test (renamed from mysql-test/t/net_read_timeout_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/net_write_timeout_basic.test (renamed from mysql-test/t/net_write_timeout_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/new_basic.test (renamed from mysql-test/t/new_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/old_passwords_basic.test (renamed from mysql-test/t/old_passwords_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/old_passwords_func.test (renamed from mysql-test/t/old_passwords_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test (renamed from mysql-test/t/optimizer_prune_level_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test (renamed from mysql-test/t/optimizer_search_depth_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test (renamed from mysql-test/t/preload_buffer_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_limit_func.test (renamed from mysql-test/t/query_cache_limit_func.test)18
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_type_basic.test (renamed from mysql-test/t/query_cache_type_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_type_func.test (renamed from mysql-test/t/query_cache_type_func.test)7
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test (renamed from mysql-test/t/query_cache_wlock_invalidate_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test (renamed from mysql-test/t/query_cache_wlock_invalidate_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/query_prealloc_size_func.test (renamed from mysql-test/t/query_prealloc_size_func.test)64
-rw-r--r--mysql-test/suite/sys_vars/t/read_buffer_size_basic.test (renamed from mysql-test/t/read_buffer_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/read_only_basic.test (renamed from mysql-test/t/read_only_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/read_only_func.test (renamed from mysql-test/t/read_only_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test (renamed from mysql-test/t/read_rnd_buffer_size_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_purge_basic.test (renamed from mysql-test/t/relay_log_purge_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_init_slave_func.test102
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func-master.opt (renamed from mysql-test/t/rpl_max_binlog_size_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func.test (renamed from mysql-test/t/rpl_max_binlog_size_func.test)10
-rw-r--r--mysql-test/suite/sys_vars/t/secure_auth_basic.test (renamed from mysql-test/t/secure_auth_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/secure_auth_func-master.opt (renamed from mysql-test/t/secure_auth_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/secure_auth_func.test (renamed from mysql-test/t/secure_auth_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test (renamed from mysql-test/t/slave_allow_batching_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/slave_compressed_protocol_basic.test (renamed from mysql-test/t/slave_compressed_protocol_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test (renamed from mysql-test/t/slave_exec_mode_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test (renamed from mysql-test/t/slave_net_timeout_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/slow_launch_time_basic.test (renamed from mysql-test/t/slow_launch_time_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/slow_launch_time_func.test (renamed from mysql-test/t/slow_launch_time_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_basic.test (renamed from mysql-test/t/slow_query_log_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_file_basic-master.opt (renamed from mysql-test/t/slow_query_log_file_basic-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test (renamed from mysql-test/t/slow_query_log_file_basic.test)10
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_file_func-master.opt (renamed from mysql-test/t/slow_query_log_file_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_file_func.test (renamed from mysql-test/t/slow_query_log_file_func.test)7
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_func.test (renamed from mysql-test/t/slow_query_log_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test (renamed from mysql-test/t/sql_auto_is_null_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_selects_basic.test (renamed from mysql-test/t/sql_big_selects_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_selects_func.test (renamed from mysql-test/t/sql_big_selects_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_tables_basic.test (renamed from mysql-test/t/sql_big_tables_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_tables_func.test (renamed from mysql-test/t/sql_big_tables_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test (renamed from mysql-test/t/sql_buffer_result_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_buffer_result_func.test (renamed from mysql-test/t/sql_buffer_result_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_bin_basic.test (renamed from mysql-test/t/sql_log_bin_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_off_basic.test (renamed from mysql-test/t/sql_log_off_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_off_func.test (renamed from mysql-test/t/sql_log_off_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test (renamed from mysql-test/t/sql_low_priority_updates_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test (renamed from mysql-test/t/sql_low_priority_updates_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_max_join_size_func.test (renamed from mysql-test/t/sql_max_join_size_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_mode_basic.test (renamed from mysql-test/t/sql_mode_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_mode_func.test (renamed from mysql-test/t/sql_mode_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_notes_basic.test (renamed from mysql-test/t/sql_notes_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_notes_func.test (renamed from mysql-test/t/sql_notes_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test (renamed from mysql-test/t/sql_quote_show_create_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_quote_show_create_func.test (renamed from mysql-test/t/sql_quote_show_create_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test (renamed from mysql-test/t/sql_safe_updates_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_safe_updates_func.test (renamed from mysql-test/t/sql_safe_updates_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_select_limit_func.test (renamed from mysql-test/t/sql_select_limit_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test (renamed from mysql-test/t/sql_slave_skip_counter_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_warnings_basic.test (renamed from mysql-test/t/sql_warnings_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sql_warnings_func.test (renamed from mysql-test/t/sql_warnings_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_ca_basic.test (renamed from mysql-test/t/ssl_ca_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_capath_basic.test (renamed from mysql-test/t/ssl_capath_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_cert_basic.test (renamed from mysql-test/t/ssl_cert_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_cipher_basic.test (renamed from mysql-test/t/ssl_cipher_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_key_basic.test (renamed from mysql-test/t/ssl_key_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/storage_engine_basic-master.opt (renamed from mysql-test/t/storage_engine_basic-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/storage_engine_basic.test (renamed from mysql-test/t/storage_engine_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/sync_frm_basic.test (renamed from mysql-test/t/sync_frm_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/system_time_zone_basic.test (renamed from mysql-test/t/system_time_zone_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/table_definition_cache_basic.test (renamed from mysql-test/t/table_definition_cache_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test (renamed from mysql-test/t/table_lock_wait_timeout_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/table_open_cache_basic.test (renamed from mysql-test/t/table_open_cache_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/thread_cache_size_func.test (renamed from mysql-test/t/thread_cache_size_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/thread_handling_basic.test (renamed from mysql-test/t/thread_handling_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/time_zone_basic.test (renamed from mysql-test/t/time_zone_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/time_zone_func.test (renamed from mysql-test/t/time_zone_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/timed_mutexes_basic.test (renamed from mysql-test/t/timed_mutexes_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_func.test (renamed from mysql-test/t/timestamp_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func-master.opt (renamed from mysql-test/t/timestamp_sysdate_is_now_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func.test (renamed from mysql-test/t/timestamp_sysdate_is_now_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/tmp_table_size_basic.test (renamed from mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc)119
-rw-r--r--mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/tmpdir_basic.test (renamed from mysql-test/t/tmpdir_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/tx_isolation_basic.test (renamed from mysql-test/t/tx_isolation_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt (renamed from mysql-test/t/tx_isolation_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/tx_isolation_func.test (renamed from mysql-test/t/tx_isolation_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/unique_checks_basic.test (renamed from mysql-test/t/unique_checks_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test (renamed from mysql-test/t/updatable_views_with_limit_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/updatable_views_with_limit_func.test (renamed from mysql-test/t/updatable_views_with_limit_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/version_basic.test (renamed from mysql-test/t/version_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/version_comment_basic.test (renamed from mysql-test/t/version_comment_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/version_compile_machine_basic.test (renamed from mysql-test/t/version_compile_machine_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/version_compile_os_basic.test (renamed from mysql-test/t/version_compile_os_basic.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/wait_timeout_func.test (renamed from mysql-test/t/wait_timeout_func.test)0
-rw-r--r--mysql-test/suite/sys_vars/t/warning_count_basic.test (renamed from mysql-test/t/warning_count_basic.test)0
-rw-r--r--mysql-test/t/alter_table.test13
-rw-r--r--mysql-test/t/archive.test1
-rw-r--r--mysql-test/t/auto_increment.test2
-rw-r--r--mysql-test/t/backup.test28
-rw-r--r--mysql-test/t/bootstrap.test4
-rw-r--r--mysql-test/t/change_user-master.opt1
-rw-r--r--mysql-test/t/change_user.test35
-rw-r--r--mysql-test/t/crash_commit_before.test2
-rw-r--r--mysql-test/t/create.test7
-rw-r--r--mysql-test/t/create_not_windows.test3
-rw-r--r--mysql-test/t/csv.test54
-rw-r--r--mysql-test/t/csv_not_null.test1
-rw-r--r--mysql-test/t/ctype_big5.test8
-rw-r--r--mysql-test/t/ctype_ldml.test16
-rw-r--r--mysql-test/t/ctype_ucs.test25
-rw-r--r--mysql-test/t/date_formats.test33
-rw-r--r--mysql-test/t/delayed.test43
-rw-r--r--mysql-test/t/disabled.def7
-rw-r--r--mysql-test/t/distinct.test9
-rw-r--r--mysql-test/t/drop.test16
-rw-r--r--mysql-test/t/error_simulation-master.opt1
-rw-r--r--mysql-test/t/error_simulation.test7
-rw-r--r--mysql-test/t/events_bugs.test278
-rw-r--r--mysql-test/t/events_restart-master.opt1
-rw-r--r--mysql-test/t/events_restart.test106
-rw-r--r--mysql-test/t/events_restart_phase1.test43
-rw-r--r--mysql-test/t/events_restart_phase2-master.opt1
-rw-r--r--mysql-test/t/events_restart_phase2.test41
-rw-r--r--mysql-test/t/events_restart_phase3-master.opt1
-rw-r--r--mysql-test/t/events_restart_phase3.test21
-rw-r--r--mysql-test/t/events_scheduling.test28
-rw-r--r--mysql-test/t/execution_constants.test9
-rw-r--r--mysql-test/t/fix_priv_tables.test3
-rw-r--r--mysql-test/t/fulltext.test9
-rw-r--r--mysql-test/t/fulltext_plugin-master.opt1
-rw-r--r--mysql-test/t/fulltext_plugin.test10
-rw-r--r--mysql-test/t/func_compress.test3
-rw-r--r--mysql-test/t/func_if.test14
-rw-r--r--mysql-test/t/func_in.test13
-rw-r--r--mysql-test/t/func_misc.test9
-rw-r--r--mysql-test/t/func_sapdb.test18
-rw-r--r--mysql-test/t/func_str.test10
-rw-r--r--mysql-test/t/func_time.test11
-rw-r--r--mysql-test/t/gis.test2
-rw-r--r--mysql-test/t/grant.test10
-rw-r--r--mysql-test/t/grant2.test127
-rw-r--r--mysql-test/t/grant3.test16
-rw-r--r--mysql-test/t/grant_cache_no_prot.test2
-rw-r--r--mysql-test/t/grant_cache_ps_prot.test2
-rw-r--r--mysql-test/t/greedy_optimizer.test73
-rw-r--r--mysql-test/t/group_by.test1
-rw-r--r--mysql-test/t/having.test11
-rw-r--r--mysql-test/t/information_schema.test43
-rw-r--r--mysql-test/t/information_schema_chmod.test5
-rw-r--r--mysql-test/t/init_file.test6
-rw-r--r--mysql-test/t/innodb-autoinc-optimize.test3
-rw-r--r--mysql-test/t/innodb-autoinc.test267
-rw-r--r--mysql-test/t/innodb-semi-consistent-master.opt2
-rw-r--r--mysql-test/t/innodb-semi-consistent.test7
-rw-r--r--mysql-test/t/innodb.test45
-rw-r--r--mysql-test/t/innodb_bug30919-master.opt (renamed from mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt)0
-rw-r--r--mysql-test/t/innodb_bug30919.test (renamed from mysql-test/suite/rpl/t/rpl_innodb_bug30919.test)0
-rw-r--r--mysql-test/t/innodb_bug34300.test5
-rw-r--r--mysql-test/t/innodb_bug38231.test75
-rw-r--r--mysql-test/t/innodb_bug39438-master.opt1
-rw-r--r--mysql-test/t/innodb_bug39438.test27
-rw-r--r--mysql-test/t/innodb_ignore_builtin-master.opt1
-rw-r--r--mysql-test/t/innodb_ignore_builtin.test8
-rw-r--r--mysql-test/t/innodb_mysql.test132
-rw-r--r--mysql-test/t/innodb_mysql_rbk-master.opt1
-rw-r--r--mysql-test/t/innodb_mysql_rbk.test35
-rw-r--r--mysql-test/t/innodb_notembedded.test4
-rw-r--r--mysql-test/t/insert_update.test15
-rw-r--r--mysql-test/t/loaddata.test45
-rw-r--r--mysql-test/t/lock_tables_lost_commit.test27
-rw-r--r--mysql-test/t/log_bin_trust_function_creators_func-master.opt1
-rw-r--r--mysql-test/t/log_queries_not_using_indexes_basic.test103
-rw-r--r--mysql-test/t/log_state.test207
-rw-r--r--mysql-test/t/log_tables.test25
-rw-r--r--mysql-test/t/lowercase_table3.test2
-rw-r--r--mysql-test/t/merge.test13
-rw-r--r--mysql-test/t/myisam-system.test7
-rw-r--r--mysql-test/t/myisam.test5
-rw-r--r--mysql-test/t/myisampack.test36
-rw-r--r--mysql-test/t/mysql.test24
-rw-r--r--mysql-test/t/mysql_client_test.test3
-rw-r--r--mysql-test/t/mysql_upgrade.test7
-rw-r--r--mysql-test/t/mysqlbinlog-cp932.test3
-rw-r--r--mysql-test/t/mysqlbinlog.test59
-rw-r--r--mysql-test/t/mysqlbinlog2.test28
-rw-r--r--mysql-test/t/mysqlbinlog_base64.test16
-rw-r--r--mysql-test/t/mysqlbinlog_row.test2
-rw-r--r--mysql-test/t/mysqlbinlog_row_big.test4
-rw-r--r--mysql-test/t/mysqlbinlog_row_trans.test2
-rw-r--r--mysql-test/t/mysqlcheck.test103
-rw-r--r--mysql-test/t/mysqldump.test258
-rw-r--r--mysql-test/t/mysqltest.test72
-rw-r--r--mysql-test/t/not_embedded_server.test78
-rw-r--r--mysql-test/t/null.test2
-rw-r--r--mysql-test/t/openssl_1.test52
-rw-r--r--mysql-test/t/outfile.test42
-rw-r--r--mysql-test/t/partition.test5
-rw-r--r--mysql-test/t/partition_error.test27
-rw-r--r--mysql-test/t/partition_federated.test2
-rw-r--r--mysql-test/t/partition_innodb_semi_consistent-master.opt1
-rw-r--r--mysql-test/t/partition_innodb_semi_consistent.test197
-rw-r--r--mysql-test/t/partition_innodb_stmt.test1
-rw-r--r--mysql-test/t/partition_mgm.test32
-rw-r--r--mysql-test/t/partition_not_windows.test77
-rw-r--r--mysql-test/t/partition_pruning.test16
-rw-r--r--mysql-test/t/profiling.test3
-rw-r--r--mysql-test/t/ps.test2
-rw-r--r--mysql-test/t/ps_1general.test2
-rw-r--r--mysql-test/t/query_cache.test134
-rw-r--r--mysql-test/t/query_cache_28249.test123
-rw-r--r--mysql-test/t/query_cache_notembedded.test7
-rw-r--r--mysql-test/t/repair.test10
-rw-r--r--mysql-test/t/rpl_init_slave_func-slave.opt1
-rw-r--r--mysql-test/t/rpl_init_slave_func.test96
-rw-r--r--mysql-test/t/select.test69
-rw-r--r--mysql-test/t/show_check.test5
-rw-r--r--mysql-test/t/sp-destruct.test27
-rw-r--r--mysql-test/t/sp-error.test10
-rw-r--r--mysql-test/t/sp-security.test4
-rw-r--r--mysql-test/t/sp.test16
-rw-r--r--mysql-test/t/status.test74
-rw-r--r--mysql-test/t/status2.test68
-rw-r--r--mysql-test/t/strict.test9
-rw-r--r--mysql-test/t/subselect.test46
-rw-r--r--mysql-test/t/subselect3.test29
-rw-r--r--mysql-test/t/symlink.test23
-rw-r--r--mysql-test/t/system_mysql_db.test5
-rw-r--r--mysql-test/t/system_mysql_db_fix30020.test5
-rw-r--r--mysql-test/t/system_mysql_db_fix40123.test4
-rw-r--r--mysql-test/t/system_mysql_db_fix50030.test4
-rw-r--r--mysql-test/t/system_mysql_db_fix50117.test4
-rw-r--r--mysql-test/t/temp_table.test31
-rw-r--r--mysql-test/t/timezone2.test3
-rw-r--r--mysql-test/t/trigger-compat.test5
-rw-r--r--mysql-test/t/trigger.test23
-rw-r--r--mysql-test/t/trigger_notembedded.test3
-rw-r--r--mysql-test/t/type_bit.test45
-rw-r--r--mysql-test/t/type_blob.test16
-rw-r--r--mysql-test/t/type_date.test31
-rw-r--r--mysql-test/t/type_float.test15
-rw-r--r--mysql-test/t/type_timestamp.test20
-rw-r--r--mysql-test/t/type_varchar.test7
-rw-r--r--mysql-test/t/upgrade.test13
-rw-r--r--mysql-test/t/user_var-binlog.test4
-rw-r--r--mysql-test/t/user_var.test11
-rw-r--r--mysql-test/t/varbinary.test13
-rw-r--r--mysql-test/t/variables-notembedded.test1
-rw-r--r--mysql-test/t/variables.test96
-rw-r--r--mysql-test/t/view.test8
-rw-r--r--mysql-test/t/wait_timeout-master.opt1
-rw-r--r--mysql-test/t/wait_timeout.test83
-rw-r--r--mysql-test/t/warnings.test3
-rw-r--r--mysql-test/t/warnings_engine_disabled.test9
-rw-r--r--mysql-test/t/xml.test39
-rw-r--r--mysys/charset.c4
-rw-r--r--mysys/hash.c2
-rw-r--r--mysys/my_error.c10
-rw-r--r--mysys/my_getopt.c14
-rw-r--r--mysys/my_init.c157
-rw-r--r--mysys/safemalloc.c2
-rw-r--r--mysys/thr_lock.c9
-rwxr-xr-xnetware/BUILD/nwbootstrap196
-rwxr-xr-xnetware/BUILD/nwbuild86
-rw-r--r--netware/Makefile.am2
-rw-r--r--scripts/make_binary_distribution.sh9
-rw-r--r--scripts/mysql_install_db.sh51
-rw-r--r--scripts/mysqld_multi.sh5
-rw-r--r--sql-bench/bench-init.pl.sh11
-rw-r--r--sql-common/my_time.c13
-rw-r--r--sql/event_db_repository.cc2
-rw-r--r--sql/event_parse_data.cc2
-rw-r--r--sql/event_parse_data.h2
-rw-r--r--sql/field.cc4
-rw-r--r--sql/field.h4
-rw-r--r--sql/filesort.cc3
-rw-r--r--sql/gen_lex_hash.cc2
-rw-r--r--sql/ha_ndbcluster.cc10
-rw-r--r--sql/ha_ndbcluster_binlog.cc19
-rw-r--r--sql/ha_partition.cc40
-rw-r--r--sql/ha_partition.h8
-rw-r--r--sql/handler.cc6
-rw-r--r--sql/handler.h2
-rw-r--r--sql/item.cc59
-rw-r--r--sql/item.h5
-rw-r--r--sql/item_cmpfunc.cc32
-rw-r--r--sql/item_func.cc18
-rw-r--r--sql/item_func.h9
-rw-r--r--sql/item_strfunc.cc13
-rw-r--r--sql/item_sum.cc7
-rw-r--r--sql/item_timefunc.cc41
-rw-r--r--sql/item_timefunc.h19
-rw-r--r--sql/item_xmlfunc.cc8
-rw-r--r--sql/lock.cc2
-rw-r--r--sql/log.cc310
-rw-r--r--sql/log.h11
-rw-r--r--sql/log_event.cc219
-rw-r--r--sql/log_event.h69
-rw-r--r--sql/mysql_priv.h15
-rw-r--r--sql/mysqld.cc81
-rw-r--r--sql/opt_range.cc31
-rw-r--r--sql/parse_file.cc5
-rw-r--r--sql/partition_info.cc1
-rw-r--r--sql/partition_info.h2
-rw-r--r--sql/repl_failsafe.cc10
-rw-r--r--sql/rpl_constants.h4
-rw-r--r--sql/rpl_rli.cc1
-rw-r--r--sql/set_var.cc19
-rw-r--r--sql/share/errmsg.txt48
-rw-r--r--sql/slave.cc39
-rw-r--r--sql/sp_head.cc2
-rw-r--r--sql/spatial.h10
-rw-r--r--sql/sql_acl.cc123
-rw-r--r--sql/sql_base.cc36
-rw-r--r--sql/sql_binlog.cc5
-rw-r--r--sql/sql_cache.cc22
-rw-r--r--sql/sql_class.cc11
-rw-r--r--sql/sql_class.h22
-rw-r--r--sql/sql_cursor.cc18
-rw-r--r--sql/sql_db.cc1
-rw-r--r--sql/sql_delete.cc65
-rw-r--r--sql/sql_error.cc2
-rw-r--r--sql/sql_insert.cc7
-rw-r--r--sql/sql_lex.cc4
-rw-r--r--sql/sql_lex.h11
-rw-r--r--sql/sql_locale.cc436
-rw-r--r--sql/sql_parse.cc31
-rw-r--r--sql/sql_partition.cc35
-rw-r--r--sql/sql_plugin.cc43
-rw-r--r--sql/sql_plugin.h1
-rw-r--r--sql/sql_profile.cc4
-rw-r--r--sql/sql_repl.cc125
-rw-r--r--sql/sql_select.cc124
-rw-r--r--sql/sql_select.h15
-rw-r--r--sql/sql_show.cc65
-rw-r--r--sql/sql_show.h2
-rw-r--r--sql/sql_table.cc68
-rw-r--r--sql/sql_test.cc2
-rw-r--r--sql/sql_trigger.cc88
-rw-r--r--sql/sql_trigger.h6
-rw-r--r--sql/sql_union.cc2
-rw-r--r--sql/sql_update.cc10
-rw-r--r--sql/sql_yacc.yy2
-rw-r--r--sql/table.cc29
-rw-r--r--sql/table.h34
-rw-r--r--sql/unireg.cc30
-rw-r--r--storage/archive/archive_reader.c6
-rw-r--r--storage/blackhole/ha_blackhole.cc2
-rw-r--r--storage/blackhole/ha_blackhole.h2
-rw-r--r--storage/csv/ha_tina.cc11
-rw-r--r--storage/federated/ha_federated.cc2
-rw-r--r--storage/heap/ha_heap.cc2
-rw-r--r--storage/innobase/Makefile.am38
-rw-r--r--storage/innobase/btr/btr0sea.c39
-rw-r--r--storage/innobase/buf/buf0lru.c127
-rw-r--r--storage/innobase/dict/dict0dict.c72
-rw-r--r--storage/innobase/dict/dict0mem.c6
-rw-r--r--storage/innobase/handler/ha_innodb.cc675
-rw-r--r--storage/innobase/handler/ha_innodb.h9
-rw-r--r--storage/innobase/include/btr0sea.h15
-rw-r--r--storage/innobase/include/data0type.ic2
-rw-r--r--storage/innobase/include/dict0dict.h11
-rw-r--r--storage/innobase/include/dict0mem.h10
-rw-r--r--storage/innobase/include/ha_prototypes.h9
-rw-r--r--storage/innobase/include/hash0hash.ic3
-rw-r--r--storage/innobase/include/lock0lock.h17
-rw-r--r--storage/innobase/include/row0mysql.h18
-rw-r--r--storage/innobase/include/srv0srv.h2
-rw-r--r--storage/innobase/include/sync0sync.ic2
-rw-r--r--storage/innobase/include/ut0ut.h6
-rw-r--r--storage/innobase/lock/lock0lock.c83
-rw-r--r--storage/innobase/os/os0file.c32
-rw-r--r--storage/innobase/plug.in43
-rw-r--r--storage/innobase/row/row0mysql.c50
-rw-r--r--storage/innobase/row/row0sel.c74
-rw-r--r--storage/innobase/srv/srv0srv.c49
-rw-r--r--storage/innobase/srv/srv0start.c15
-rw-r--r--storage/innobase/trx/trx0trx.c4
-rw-r--r--storage/innobase/trx/trx0undo.c2
-rw-r--r--storage/innobase/ut/ut0ut.c35
-rw-r--r--storage/myisam/ft_boolean_search.c38
-rw-r--r--storage/myisam/ft_parser.c77
-rw-r--r--storage/myisam/ftdefs.h1
-rw-r--r--storage/myisam/ha_myisam.cc4
-rw-r--r--storage/myisam/mi_check.c5
-rw-r--r--storage/myisam/mi_open.c7
-rw-r--r--storage/myisam/myisamdef.h2
-rw-r--r--storage/myisam/myisampack.c2
-rw-r--r--storage/myisammrg/myrg_open.c27
-rwxr-xr-xstorage/ndb/docs/doxygen/postdoxy.pl4
-rw-r--r--storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp2
-rw-r--r--storage/ndb/test/run-test/atrt.hpp3
-rw-r--r--storage/ndb/test/tools/connect.cpp3
-rw-r--r--strings/conf_to_src.c2
-rw-r--r--strings/ctype.c10
-rw-r--r--strings/xml.c13
-rw-r--r--support-files/my-small.cnf.sh2
-rw-r--r--support-files/mysql.spec.sh115
-rw-r--r--tests/mysql_client_test.c118
-rw-r--r--win/configure.js1
1739 files changed, 40567 insertions, 24955 deletions
diff --git a/.bzrignore b/.bzrignore
index 8ea3b361c87..01ef6f2ffef 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -1289,6 +1289,7 @@ mysql-test/funcs_1.log
mysql-test/funcs_1.tar
mysql-test/gmon.out
mysql-test/install_test_db
+mysql-test/lib/My/SafeProcess/my_safe_process
mysql-test/lib/init_db.sql
mysql-test/linux_sys_vars.inc
mysql-test/load_sysvars.inc
@@ -2097,10 +2098,13 @@ sql/.libs/udf_example.lai
sql/.libs/udf_example.so.0
sql/.libs/udf_example.so.0.0.0
sql/client.c
+sql/Doxyfile
sql/f.c
sql/gen_lex_hash
sql/gmon.out
sql/handlerton.cc
+sql/html
+sql/latex
sql/lex_hash.h
sql/link_sources
sql/max/*
diff --git a/BUILD/compile-dist b/BUILD/compile-dist
index caee172f196..cf6cefc0969 100755
--- a/BUILD/compile-dist
+++ b/BUILD/compile-dist
@@ -11,16 +11,33 @@ test -f Makefile && make maintainer-clean
path=`dirname $0`
. $path/autorun.sh
+gmake=
+for x in gmake gnumake make; do
+ if $x --version 2>/dev/null | grep GNU > /dev/null; then
+ gmake=$x
+ break;
+ fi
+done
+
+if [ -z "$gmake" ]; then
+ # Our build may not depend on GNU make, but I wouldn't count on it
+ echo "Please install GNU make, and ensure it is in your path as gnumake, gmake, or make" >&2
+ exit 2
+fi
+
# Default to gcc for CC and CXX
if test -z "$CXX" ; then
+ export CXX
CXX=gcc
# Set some required compile options
if test -z "$CXXFLAGS" ; then
+ export CXXFLAGS
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
fi
fi
if test -z "$CC" ; then
+ export CC
CC=gcc
fi
@@ -28,36 +45,22 @@ fi
# Use ccache, if available
if ccache -V > /dev/null 2>&1
then
- if echo "$CC" | grep "ccache" > /dev/null
+ if echo "$CC" | grep -v ccache > /dev/null
then
- :
- else
+ export CC
CC="ccache $CC"
fi
- if echo "$CXX" | grep "ccache" > /dev/null
+ if echo "$CXX" | grep -v ccache > /dev/null
then
- :
- else
+ export CXX
CXX="ccache $CXX"
fi
fi
-if test -z "$MAKE"
-then
- if gmake -v > /dev/null 2>&1
- then
- MAKE="gmake"
- else
- MAKE="make"
- fi
-fi
-
-export CC CXX MAKE
-
# Make sure to enable all features that affect "make dist"
# Remember that configure restricts the man pages to the configured features !
./configure \
--with-embedded-server \
--with-ndbcluster
-$MAKE
+$gmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 957cfd4c102..1bb50cbade3 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,10 @@ IF(CYBOZU)
ADD_DEFINITIONS(-DCYBOZU)
ENDIF(CYBOZU)
+IF(EXTRA_DEBUG)
+ ADD_DEFINITIONS(-D EXTRA_DEBUG)
+ENDIF(EXTRA_DEBUG)
+
# in some places we use DBUG_OFF
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
@@ -254,3 +258,4 @@ IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld)
ADD_SUBDIRECTORY(libmysqld/examples)
ENDIF(WITH_EMBEDDED_SERVER)
+ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
diff --git a/Makefile.am b/Makefile.am
index b1f15e76ab1..0435489456b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2000-2006 MySQL AB
+# Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -121,6 +121,10 @@ test-reprepare:
test: test-unit test-ns test-pr
+smoke:
+ cd mysql-test ; \
+ @PERL@ ./mysql-test-run.pl --do-test=s
+
test-full: test test-nr test-ps
test-force:
@@ -159,6 +163,8 @@ test-bt:
@PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
+ -cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
-if [ -d mysql-test/suite/nist ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=nist --force --suite=nist ; \
@@ -175,15 +181,28 @@ test-bt:
echo "no program found for 'embedded' tests - skipped testing" ; \
fi
-# Re-enable the "jp" suite when bug#28563 is fixed
-# -cd mysql-test ; MTR_BUILD_THREAD=auto \
-# @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
+test-bt-fast:
+ -cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --comment=ps --force --timer \
+ --skip-ndbcluster --ps-protocol --report-features
+ -if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
+ cd mysql-test ; \
+ MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \
+ --with-ndbcluster-only ; \
+ else \
+ echo "no program found for 'ndbcluster' tests - skipped testing" ; \
+ fi
+ -cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
test-bt-debug:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=debug --force --timer \
--skip-ndbcluster --skip-rpl --report-features
+test-bt-debug-fast:
+
# Keep these for a while
test-pl: test
test-full-pl: test-full
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index cbd4a1f306b..e96437d40d0 100755
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -32,8 +32,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32)
-ADD_EXECUTABLE(mysqltest mysqltest.c)
-SET_SOURCE_FILES_PROPERTIES(mysqltest.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
+ADD_EXECUTABLE(mysqltest mysqltest.cc)
+SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex wsock32 dbug)
ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
diff --git a/client/Makefile.am b/client/Makefile.am
index c5c82ec0a42..94db565ba37 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -86,9 +86,9 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
$(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a
-mysqltest_SOURCES= mysqltest.c
-mysqltest_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
-mysqltest_LDADD = $(CXXLDFLAGS) \
+mysqltest_SOURCES= mysqltest.cc
+mysqltest_CXXFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
+mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
@CLIENT_EXTRA_LDFLAGS@ \
$(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a \
diff --git a/client/mysql.cc b/client/mysql.cc
index ff53d623d07..65512e695b8 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1535,7 +1535,7 @@ static void usage(int version)
if (version)
return;
printf("\
-Copyright (C) 2000-2008 MySQL AB\n\
+Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n\
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
and you are welcome to modify and redistribute it under the GPL license\n");
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
@@ -2020,7 +2020,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
{
if (!preserve_comments)
{
- // Skip spaces at the beggining of a statement
+ // Skip spaces at the beginning of a statement
if (my_isspace(charset_info,inchar) && (out == line) &&
buffer.is_empty())
continue;
@@ -2044,7 +2044,8 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
#endif
if (!*ml_comment && inchar == '\\' &&
- !(mysql.server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES))
+ !(*in_string &&
+ (mysql.server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES)))
{
// Found possbile one character command like \c
@@ -2103,37 +2104,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
continue;
}
}
- else if (!*ml_comment && !*in_string &&
- (end_of_line - pos) >= 10 &&
- !my_strnncoll(charset_info, (uchar*) pos, 10,
- (const uchar*) "delimiter ", 10))
- {
- // Flush previously accepted characters
- if (out != line)
- {
- buffer.append(line, (uint32) (out - line));
- out= line;
- }
-
- // Flush possible comments in the buffer
- if (!buffer.is_empty())
- {
- if (com_go(&buffer, 0) > 0) // < 0 is not fatal
- DBUG_RETURN(1);
- buffer.length(0);
- }
-
- /*
- Delimiter wants the get rest of the given line as argument to
- allow one to change ';' to ';;' and back
- */
- buffer.append(pos);
- if (com_delimiter(&buffer, pos) > 0)
- DBUG_RETURN(1);
-
- buffer.length(0);
- break;
- }
else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
{
// Found a statement. Continue parsing after the delimiter
@@ -2196,8 +2166,24 @@ static bool add_line(String &buffer,char *line,char *in_string,
// comment to end of line
if (preserve_comments)
+ {
+ bool started_with_nothing= !buffer.length();
+
buffer.append(pos);
+ /*
+ A single-line comment by itself gets sent immediately so that
+ client commands (delimiter, status, etc) will be interpreted on
+ the next line.
+ */
+ if (started_with_nothing)
+ {
+ if (com_go(&buffer, 0) > 0) // < 0 is not fatal
+ DBUG_RETURN(1);
+ buffer.length(0);
+ }
+ }
+
break;
}
else if (!*in_string && inchar == '/' && *(pos+1) == '*' &&
@@ -2284,8 +2270,10 @@ extern "C" char **new_mysql_completion (const char *text, int start, int end);
if not.
*/
-#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
+#if defined(USE_NEW_READLINE_INTERFACE)
extern "C" char *no_completion(const char*,int)
+#elif defined(USE_LIBEDIT_INTERFACE)
+extern "C" int no_completion(const char*,int)
#else
extern "C" char *no_completion()
#endif
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 4d2460dc4e7..190bb2383e9 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -620,6 +620,20 @@ static int run_mysqlcheck_upgrade(void)
}
+static int run_mysqlcheck_fixnames(void)
+{
+ verbose("Running 'mysqlcheck'...");
+ return run_tool(mysqlcheck_path,
+ NULL, /* Send output from mysqlcheck directly to screen */
+ "--no-defaults",
+ ds_args.str,
+ "--all-databases",
+ "--fix-db-names",
+ "--fix-table-names",
+ NULL);
+}
+
+
static const char *expected_errors[]=
{
"ERROR 1060", /* Duplicate column name */
@@ -782,7 +796,8 @@ int main(int argc, char **argv)
/*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
- if (run_mysqlcheck_upgrade() ||
+ if (run_mysqlcheck_fixnames() ||
+ run_mysqlcheck_upgrade() ||
run_sql_fix_privilege_tables())
{
/*
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index b3b699f61fd..1e3249dd92a 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -23,10 +23,6 @@
#include <sys/stat.h>
#include <mysql.h>
-#ifdef LATER_HAVE_NDBCLUSTER_DB
-#include "../ndb/src/mgmclient/ndb_mgmclient.h"
-#endif
-
#define ADMIN_VERSION "8.42"
#define MAX_MYSQL_VAR 256
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
@@ -46,10 +42,6 @@ static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations;
static uint opt_count_iterations= 0, my_end_arg;
static ulong opt_connect_timeout, opt_shutdown_timeout;
static char * unix_port=0;
-#ifdef LATER_HAVE_NDBCLUSTER_DB
-static my_bool opt_ndbcluster=0;
-static char *opt_ndb_connectstring=0;
-#endif
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
@@ -105,9 +97,6 @@ enum commands {
ADMIN_PING, ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS,
ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE, ADMIN_STOP_SLAVE,
ADMIN_FLUSH_THREADS, ADMIN_OLD_PASSWORD
-#ifdef LATER_HAVE_NDBCLUSTER_DB
- ,ADMIN_NDB_MGM
-#endif
};
static const char *command_names[]= {
"create", "drop", "shutdown",
@@ -118,9 +107,6 @@ static const char *command_names[]= {
"ping", "extended-status", "flush-status",
"flush-privileges", "start-slave", "stop-slave",
"flush-threads","old-password",
-#ifdef LATER_HAVE_NDBCLUSTER_DB
- "ndb-mgm",
-#endif
NullS
};
@@ -224,14 +210,6 @@ static struct my_option my_long_options[] =
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout,
(uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
-#ifdef LATER_HAVE_NDBCLUSTER_DB
- {"ndbcluster", OPT_NDBCLUSTER, ""
- "", (uchar**) &opt_ndbcluster,
- (uchar**) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"ndb-connectstring", OPT_NDB_CONNECTSTRING, ""
- "", (uchar**) &opt_ndb_connectstring,
- (uchar**) &opt_ndb_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#endif
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -634,7 +612,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
case ADMIN_VER:
new_line=1;
print_version();
- puts("Copyright (C) 2000-2006 MySQL AB");
+ puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
@@ -984,24 +962,6 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
}
mysql->reconnect=1; /* Automatic reconnect is default */
break;
-#ifdef LATER_HAVE_NDBCLUSTER_DB
- case ADMIN_NDB_MGM:
- {
- if (argc < 2)
- {
- my_printf_error(0, "Too few arguments to ndb-mgm", error_flags);
- return 1;
- }
- {
- Ndb_mgmclient_handle cmd=
- ndb_mgmclient_handle_create(opt_ndb_connectstring);
- ndb_mgmclient_execute(cmd, --argc, ++argv);
- ndb_mgmclient_handle_destroy(cmd);
- }
- argc= 0;
- }
- break;
-#endif
default:
my_printf_error(0, "Unknown command: '%-.60s'", error_flags, argv[0]);
return 1;
@@ -1023,7 +983,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright (C) 2000-2006 MySQL AB");
+ puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Administration program for the mysqld daemon.");
printf("Usage: %s [OPTIONS] command command....\n", my_progname);
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 17ebca497e4..86e1b3352b4 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -40,15 +40,13 @@ static uint verbose = 0, opt_mysql_port=0;
static int my_end_arg;
static char * opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0,
- *default_charset = (char *)MYSQL_DEFAULT_CHARSET_NAME,
- *current_host = 0;
+ *default_charset= 0, *current_host= 0;
static int first_error = 0;
DYNAMIC_ARRAY tables4repair;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
#endif
static uint opt_protocol=0;
-static CHARSET_INFO *charset_info= &my_charset_latin1;
enum operations { DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
@@ -282,12 +280,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case OPT_FIX_DB_NAMES:
what_to_do= DO_UPGRADE;
- default_charset= (char*) "utf8";
opt_databases= 1;
break;
case OPT_FIX_TABLE_NAMES:
what_to_do= DO_UPGRADE;
- default_charset= (char*) "utf8";
break;
case 'p':
if (argument)
@@ -367,11 +363,20 @@ static int get_options(int *argc, char ***argv)
what_to_do = DO_CHECK;
}
- /* TODO: This variable is not yet used */
- if (strcmp(default_charset, charset_info->csname) &&
- !(charset_info= get_charset_by_csname(default_charset,
- MY_CS_PRIMARY, MYF(MY_WME))))
- exit(1);
+ /*
+ If there's no --default-character-set option given with
+ --fix-table-name or --fix-db-name set the default character set to "utf8".
+ */
+ if (!default_charset && (opt_fix_db_names || opt_fix_table_names))
+ {
+ default_charset= (char*) "utf8";
+ }
+ if (default_charset && !get_charset_by_csname(default_charset, MY_CS_PRIMARY,
+ MYF(MY_WME)))
+ {
+ printf("Unsupported character set: %s\n", default_charset);
+ return 1;
+ }
if (*argc > 0 && opt_alldbs)
{
printf("You should give only options, no arguments at all, with option\n");
@@ -779,6 +784,8 @@ static int dbConnect(char *host, char *user, char *passwd)
if (shared_memory_base_name)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
+ if (default_charset)
+ mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
{
diff --git a/client/mysqldump.c b/client/mysqldump.c
index c068b2ff16e..44c53a0e4c2 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index ac3b0e8efba..09ba27b287a 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -193,7 +193,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright (C) 2000-2006 MySQL AB");
+ puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
printf("\
Loads tables from text files in various formats. The base name of the\n\
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 167ff5c6198..0e696aed211 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -249,7 +249,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright (C) 2000-2006 MySQL AB");
+ puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Shows the structure of a mysql database (databases,tables and columns)\n");
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 5ca0b1cd207..9ba912d646c 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -688,9 +688,7 @@ static void usage(void)
{
print_version();
puts("Copyright (C) 2005 MySQL AB");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\
- \nand you are welcome to modify and redistribute it under the GPL \
- license\n");
+ puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Run a query multiple times against the server\n");
printf("Usage: %s [OPTIONS]\n",my_progname);
print_defaults("my",load_default_groups);
diff --git a/client/mysqltest.c b/client/mysqltest.cc
index 6babc42bcd0..89b9c78a049 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.cc
@@ -169,7 +169,6 @@ static ulonglong timer_start;
static void timer_output(void);
static ulonglong timer_now(void);
-static ulonglong progress_start= 0;
static ulong connection_retry_sleep= 100000; /* Microseconds */
@@ -186,12 +185,12 @@ DYNAMIC_ARRAY q_lines;
#include "sslopt-vars.h"
-struct
+struct Parser
{
int read_lines,current_line;
} parser;
-struct
+struct MasterPos
{
char file[FN_REFLEN];
ulong pos;
@@ -200,7 +199,7 @@ struct
/* if set, all results are concated and compared against this file */
const char *result_file_name= 0;
-typedef struct st_var
+typedef struct
{
char *name;
int name_len;
@@ -278,8 +277,9 @@ enum enum_commands {
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
- Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR, Q_LIST_FILES,
- Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
+ Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
+ Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
+ Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
@@ -374,6 +374,8 @@ const char *command_names[]=
"list_files",
"list_files_write_file",
"list_files_append_file",
+ "send_shutdown",
+ "shutdown_server",
0
};
@@ -423,7 +425,7 @@ struct st_command
TYPELIB command_typelib= {array_elements(command_names),"",
command_names, 0};
-DYNAMIC_STRING ds_res, ds_progress, ds_warning_messages;
+DYNAMIC_STRING ds_res;
char builtin_echo[FN_REFLEN];
@@ -433,8 +435,6 @@ void abort_not_supported_test(const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 1, 2);
void verbose_msg(const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 1, 2);
-void warning_msg(const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2);
void log_msg(const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 1, 2);
@@ -447,15 +447,15 @@ VAR* var_get(const char *var_name, const char** var_name_end,
void eval_expr(VAR* v, const char *p, const char** p_end);
my_bool match_delimiter(int c, const char *delim, uint length);
void dump_result_to_reject_file(char *buf, int size);
-void dump_result_to_log_file(char *buf, int size);
void dump_warning_messages();
-void dump_progress();
void do_eval(DYNAMIC_STRING *query_eval, const char *query,
const char *query_end, my_bool pass_through_escape_chars);
void str_to_file(const char *fname, char *str, int size);
void str_to_file2(const char *fname, char *str, int size, my_bool append);
+void fix_win_paths(const char *val, int len);
+
#ifdef __WIN__
void free_tmp_sh_file();
void free_win_path_patterns();
@@ -484,6 +484,177 @@ void free_all_replace(){
}
+class LogFile {
+ FILE* m_file;
+ char m_file_name[FN_REFLEN];
+ size_t m_bytes_written;
+public:
+ LogFile() : m_file(NULL), m_bytes_written(0) {
+ bzero(m_file_name, sizeof(m_file_name));
+ }
+
+ ~LogFile() {
+ close();
+ }
+
+ const char* file_name() const { return m_file_name; }
+ size_t bytes_written() const { return m_bytes_written; }
+
+ void open(const char* dir, const char* name, const char* ext)
+ {
+ DBUG_ENTER("LogFile::open");
+ DBUG_PRINT("enter", ("dir: '%s', name: '%s'",
+ dir, name));
+ if (!name)
+ {
+ m_file= stdout;
+ DBUG_VOID_RETURN;
+ }
+
+ fn_format(m_file_name, name, dir, ext,
+ *dir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
+ MY_REPLACE_EXT);
+
+ DBUG_PRINT("info", ("file_name: %s", m_file_name));
+
+ if ((m_file= fopen(m_file_name, "wb+")) == NULL)
+ die("Failed to open log file %s, errno: %d", m_file_name, errno);
+
+ DBUG_VOID_RETURN;
+ }
+
+ void close()
+ {
+ if (m_file) {
+ if (m_file != stdout)
+ fclose(m_file);
+ else
+ fflush(m_file);
+ }
+ m_file= NULL;
+ }
+
+ void flush()
+ {
+ if (m_file && m_file != stdout)
+ {
+ if (fflush(m_file))
+ die("Failed to flush '%s', errno: %d", m_file_name, errno);
+ }
+ }
+
+ void write(DYNAMIC_STRING* ds)
+ {
+ DBUG_ENTER("LogFile::write");
+ DBUG_ASSERT(m_file);
+
+ if (ds->length == 0)
+ DBUG_VOID_RETURN;
+ DBUG_ASSERT(ds->str);
+
+ if (fwrite(ds->str, 1, ds->length, m_file) != ds->length)
+ die("Failed to write %lu bytes to '%s', errno: %d",
+ (unsigned long)ds->length, m_file_name, errno);
+ m_bytes_written+= ds->length;
+ DBUG_VOID_RETURN;
+ }
+
+ void show_tail(uint lines) {
+ DBUG_ENTER("LogFile::show_tail");
+
+ if (!m_file || m_file == stdout)
+ DBUG_VOID_RETURN;
+
+ if (lines == 0)
+ DBUG_VOID_RETURN;
+ lines++;
+
+ int show_offset= 0;
+ char buf[256];
+ size_t bytes;
+ bool found_bof= false;
+
+ /* Search backward in file until "lines" newline has been found */
+ while (lines && !found_bof)
+ {
+ show_offset-= sizeof(buf);
+ while(fseek(m_file, show_offset, SEEK_END) != 0 && show_offset < 0)
+ {
+ found_bof= true;
+ // Seeking before start of file
+ show_offset++;
+ }
+
+ if ((bytes= fread(buf, 1, sizeof(buf), m_file)) <= 0)
+ {
+ fprintf(stderr, "Failed to read from '%s', errno: %d\n",
+ m_file_name, errno);
+ DBUG_VOID_RETURN;
+ }
+
+ DBUG_PRINT("info", ("Read %lu bytes from file, buf: %s",
+ (unsigned long)bytes, buf));
+
+ char* show_from= buf + bytes;
+ while(show_from > buf && lines > 0 )
+ {
+ show_from--;
+ if (*show_from == '\n')
+ lines--;
+ }
+ if (show_from != buf)
+ {
+ // The last new line was found in this buf, adjust offset
+ show_offset+= (show_from - buf) + 1;
+ DBUG_PRINT("info", ("adjusted offset to %d", show_offset));
+ }
+ DBUG_PRINT("info", ("show_offset: %d", show_offset));
+ }
+
+ fprintf(stderr, "\nThe result from queries just before the failure was:\n");
+
+ DBUG_PRINT("info", ("show_offset: %d", show_offset));
+ if (!lines)
+ {
+ fprintf(stderr, "< snip >\n");
+
+ if (fseek(m_file, show_offset, SEEK_END) != 0)
+ {
+ fprintf(stderr, "Failed to seek to position %d in '%s', errno: %d",
+ show_offset, m_file_name, errno);
+ DBUG_VOID_RETURN;
+ }
+
+ }
+ else {
+ DBUG_PRINT("info", ("Showing the whole file"));
+ if (fseek(m_file, 0L, SEEK_SET) != 0)
+ {
+ fprintf(stderr, "Failed to seek to pos 0 in '%s', errno: %d",
+ m_file_name, errno);
+ DBUG_VOID_RETURN;
+ }
+ }
+
+ while ((bytes= fread(buf, 1, sizeof(buf), m_file)) > 0)
+ fwrite(buf, 1, bytes, stderr);
+
+ if (!lines)
+ {
+ fprintf(stderr,
+ "\nMore results from queries before failure can be found in %s\n",
+ m_file_name);
+ }
+ fflush(stderr);
+
+ DBUG_VOID_RETURN;
+ }
+};
+
+LogFile log_file;
+LogFile progress_file;
+
+
/* Disable functions that only exist in MySQL 4.0 */
#if MYSQL_VERSION_ID < 40000
void mysql_enable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
@@ -623,12 +794,15 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
break;
}
}
+#ifdef __WIN__
+ fix_win_paths(query_eval->str, query_eval->length);
+#endif
DBUG_VOID_RETURN;
}
/*
- Run query and dump the result to stdout in vertical format
+ Run query and dump the result to stderr in vertical format
NOTE! This function should be safe to call when an error
has occured and thus any further errors will be ignored(although logged)
@@ -960,8 +1134,6 @@ void free_used_memory()
my_free(embedded_server_args[--embedded_server_arg_count],MYF(0));
delete_dynamic(&q_lines);
dynstr_free(&ds_res);
- dynstr_free(&ds_progress);
- dynstr_free(&ds_warning_messages);
free_all_replace();
my_free(opt_pass,MYF(MY_ALLOW_ZERO_PTR));
free_defaults(default_argv);
@@ -1039,31 +1211,7 @@ void die(const char *fmt, ...)
fprintf(stderr, "\n");
fflush(stderr);
- /* Show results from queries just before failure */
- if (ds_res.length && opt_tail_lines)
- {
- int tail_lines= opt_tail_lines;
- char* show_from= ds_res.str + ds_res.length - 1;
- while(show_from > ds_res.str && tail_lines > 0 )
- {
- show_from--;
- if (*show_from == '\n')
- tail_lines--;
- }
- fprintf(stderr, "\nThe result from queries just before the failure was:\n");
- if (show_from > ds_res.str)
- fprintf(stderr, "< snip >");
- fprintf(stderr, "%s", show_from);
- fflush(stderr);
- }
-
- /* Dump the result that has been accumulated so far to .log file */
- if (result_file_name && ds_res.length)
- dump_result_to_log_file(ds_res.str, ds_res.length);
-
- /* Dump warning messages */
- if (result_file_name && ds_warning_messages.length)
- dump_warning_messages();
+ log_file.show_tail(opt_tail_lines);
/*
Help debugging by displaying any warnings that might have
@@ -1137,41 +1285,6 @@ void verbose_msg(const char *fmt, ...)
}
-void warning_msg(const char *fmt, ...)
-{
- va_list args;
- char buff[512];
- size_t len;
- DBUG_ENTER("warning_msg");
-
- va_start(args, fmt);
- dynstr_append(&ds_warning_messages, "mysqltest: ");
- if (start_lineno != 0)
- {
- dynstr_append(&ds_warning_messages, "Warning detected ");
- if (cur_file && cur_file != file_stack)
- {
- len= my_snprintf(buff, sizeof(buff), "in included file %s ",
- cur_file->file_name);
- dynstr_append_mem(&ds_warning_messages,
- buff, len);
- }
- len= my_snprintf(buff, sizeof(buff), "at line %d: ",
- start_lineno);
- dynstr_append_mem(&ds_warning_messages,
- buff, len);
- }
-
- len= my_vsnprintf(buff, sizeof(buff), fmt, args);
- dynstr_append_mem(&ds_warning_messages, buff, len);
-
- dynstr_append(&ds_warning_messages, "\n");
- va_end(args);
-
- DBUG_VOID_RETURN;
-}
-
-
void log_msg(const char *fmt, ...)
{
va_list args;
@@ -1329,6 +1442,36 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
/*
+ Test if diff is present. This is needed on Windows systems
+ as the OS returns 1 whether diff is successful or if it is
+ not present.
+
+ We run diff -v and look for output in stdout.
+ We don't redirect stderr to stdout to make for a simplified check
+ Windows will output '"diff"' is not recognized... to stderr if it is
+ not present.
+*/
+
+int diff_check()
+{
+ char buf[512]= {0};
+ FILE *res_file;
+ const char *cmd = "diff -v";
+ int have_diff = 0;
+
+ if (!(res_file= popen(cmd, "r")))
+ die("popen(\"%s\", \"r\") failed", cmd);
+
+ /* if diff is not present, nothing will be in stdout to increment have_diff */
+ if (fgets(buf, sizeof(buf), res_file))
+ {
+ have_diff += 1;
+ }
+ pclose(res_file);
+ return have_diff;
+}
+
+/*
Show the diff of two files using the systems builtin diff
command. If no such diff command exist, just dump the content
of the two files and inform about how to get "diff"
@@ -1344,43 +1487,75 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
void show_diff(DYNAMIC_STRING* ds,
const char* filename1, const char* filename2)
{
-
DYNAMIC_STRING ds_tmp;
+ int have_diff = 0;
if (init_dynamic_string(&ds_tmp, "", 256, 256))
die("Out of memory");
- /* First try with unified diff */
- if (run_tool("diff",
- &ds_tmp, /* Get output from diff in ds_tmp */
- "-u",
- filename1,
- filename2,
- "2>&1",
- NULL) > 1) /* Most "diff" tools return >1 if error */
- {
- dynstr_set(&ds_tmp, "");
+ /* determine if we have diff on Windows
+ needs special processing due to return values
+ on that OS
+ This test is only done on Windows since it's only needed there
+ in order to correctly detect non-availibility of 'diff', and
+ the way it's implemented does not work with default 'diff' on Solaris.
+ */
+#ifdef __WIN__
+ have_diff = diff_check();
+#else
+ have_diff = 1;
+#endif
- /* Fallback to context diff with "diff -c" */
+ if (have_diff)
+ {
+ /* First try with unified diff */
if (run_tool("diff",
&ds_tmp, /* Get output from diff in ds_tmp */
- "-c",
+ "-u",
filename1,
filename2,
"2>&1",
NULL) > 1) /* Most "diff" tools return >1 if error */
{
- /*
- Fallback to dump both files to result file and inform
- about installing "diff"
- */
dynstr_set(&ds_tmp, "");
- dynstr_append(&ds_tmp,
+ /* Fallback to context diff with "diff -c" */
+ if (run_tool("diff",
+ &ds_tmp, /* Get output from diff in ds_tmp */
+ "-c",
+ filename1,
+ filename2,
+ "2>&1",
+ NULL) > 1) /* Most "diff" tools return >1 if error */
+ {
+ dynstr_set(&ds_tmp, "");
+
+ /* Fallback to simple diff with "diff" */
+ if (run_tool("diff",
+ &ds_tmp, /* Get output from diff in ds_tmp */
+ filename1,
+ filename2,
+ "2>&1",
+ NULL) > 1) /* Most "diff" tools return >1 if error */
+ {
+ have_diff= 0;
+ }
+ }
+ }
+ }
+
+ if (! have_diff)
+ {
+ /*
+ Fallback to dump both files to result file and inform
+ about installing "diff"
+ */
+ dynstr_append(&ds_tmp, "\n");
+ dynstr_append(&ds_tmp,
"\n"
"The two files differ but it was not possible to execute 'diff' in\n"
-"order to show only the difference, tried both 'diff -u' or 'diff -c'.\n"
-"Instead the whole content of the two files was shown for you to diff manually. ;)\n\n"
+"order to show only the difference. Instead the whole content of the\n"
+"two files was shown for you to diff manually.\n\n"
"To get a better report you should install 'diff' on your system, which you\n"
"for example can get from http://www.gnu.org/software/diffutils/diffutils.html\n"
#ifdef __WIN__
@@ -1388,16 +1563,15 @@ void show_diff(DYNAMIC_STRING* ds,
#endif
"\n");
- dynstr_append(&ds_tmp, " --- ");
- dynstr_append(&ds_tmp, filename1);
- dynstr_append(&ds_tmp, " >>>\n");
- cat_file(&ds_tmp, filename1);
- dynstr_append(&ds_tmp, "<<<\n --- ");
- dynstr_append(&ds_tmp, filename1);
- dynstr_append(&ds_tmp, " >>>\n");
- cat_file(&ds_tmp, filename2);
- dynstr_append(&ds_tmp, "<<<<\n");
- }
+ dynstr_append(&ds_tmp, " --- ");
+ dynstr_append(&ds_tmp, filename1);
+ dynstr_append(&ds_tmp, " >>>\n");
+ cat_file(&ds_tmp, filename1);
+ dynstr_append(&ds_tmp, "<<<\n --- ");
+ dynstr_append(&ds_tmp, filename1);
+ dynstr_append(&ds_tmp, " >>>\n");
+ cat_file(&ds_tmp, filename2);
+ dynstr_append(&ds_tmp, "<<<<\n");
}
if (ds)
@@ -1561,18 +1735,17 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
/*
- Check the content of ds against result file
+ Check the content of log against result file
SYNOPSIS
check_result
- ds - content to be checked
RETURN VALUES
error - the function will not return
*/
-void check_result(DYNAMIC_STRING* ds)
+void check_result()
{
const char* mess= "Result content mismatch\n";
@@ -1580,10 +1753,7 @@ void check_result(DYNAMIC_STRING* ds)
DBUG_ASSERT(result_file_name);
DBUG_PRINT("enter", ("result_file_name: %s", result_file_name));
- if (access(result_file_name, F_OK) != 0)
- die("The specified result file does not exist: '%s'", result_file_name);
-
- switch (dyn_string_cmp(ds, result_file_name)) {
+ switch (compare_files(log_file.file_name(), result_file_name)) {
case RESULT_OK:
break; /* ok */
case RESULT_LENGTH_MISMATCH:
@@ -1611,9 +1781,10 @@ void check_result(DYNAMIC_STRING* ds)
fn_format(reject_file, result_file_name, opt_logdir,
".reject", MY_REPLACE_DIR | MY_REPLACE_EXT);
}
- str_to_file(reject_file, ds->str, ds->length);
- dynstr_set(ds, NULL); /* Don't create a .log file */
+ if (my_copy(log_file.file_name(), reject_file, MYF(0)) != 0)
+ die("Failed to copy '%s' to '%s', errno: %d",
+ log_file.file_name(), reject_file, errno);
show_diff(NULL, result_file_name, reject_file);
die(mess);
@@ -1727,7 +1898,7 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0;
tmp_var->alloced = (v == 0);
- if (!(tmp_var->str_val = my_malloc(val_alloc_len+1, MYF(MY_WME))))
+ if (!(tmp_var->str_val = (char*)my_malloc(val_alloc_len+1, MYF(MY_WME))))
die("Out of memory");
memcpy(tmp_var->name, name, name_len);
@@ -1914,17 +2085,6 @@ void var_set_errno(int sql_errno)
/*
- Update $mysql_get_server_version variable with version
- of the currently connected server
-*/
-
-void var_set_mysql_get_server_version(MYSQL* mysql)
-{
- var_set_int("$mysql_get_server_version", mysql_get_server_version(mysql));
-}
-
-
-/*
Set variable from the result of a query
SYNOPSIS
@@ -2041,9 +2201,9 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
static DYNAMIC_STRING ds_col;
static DYNAMIC_STRING ds_row;
const struct command_arg query_get_value_args[] = {
- "query", ARG_STRING, TRUE, &ds_query, "Query to run",
- "column name", ARG_STRING, TRUE, &ds_col, "Name of column",
- "row number", ARG_STRING, TRUE, &ds_row, "Number for row"
+ {"query", ARG_STRING, TRUE, &ds_query, "Query to run"},
+ {"column name", ARG_STRING, TRUE, &ds_col, "Name of column"},
+ {"row number", ARG_STRING, TRUE, &ds_row, "Number for row"}
};
DBUG_ENTER("var_set_query_get_value");
@@ -2140,8 +2300,8 @@ void var_copy(VAR *dest, VAR *src)
/* Alloc/realloc data for str_val in dest */
if (dest->alloced_len < src->alloced_len &&
!(dest->str_val= dest->str_val
- ? my_realloc(dest->str_val, src->alloced_len, MYF(MY_WME))
- : my_malloc(src->alloced_len, MYF(MY_WME))))
+ ? (char*)my_realloc(dest->str_val, src->alloced_len, MYF(MY_WME))
+ : (char*)my_malloc(src->alloced_len, MYF(MY_WME))))
die("Out of memory");
else
dest->alloced_len= src->alloced_len;
@@ -2162,8 +2322,16 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
if (*p == '$')
{
VAR *vp;
+ const char* expected_end= *p_end; // Remember var end
if ((vp= var_get(p, p_end, 0, 0)))
var_copy(v, vp);
+
+ /* Make sure there was just a $variable and nothing else */
+ const char* end= *p_end + 1;
+ if (end < expected_end)
+ die("Found junk '%.*s' after $variable in expression",
+ (int)(expected_end - end - 1), end);
+
DBUG_VOID_RETURN;
}
@@ -2199,9 +2367,9 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
v->alloced_len = (new_val_len < MIN_VAR_ALLOC - 1) ?
MIN_VAR_ALLOC : new_val_len + 1;
if (!(v->str_val =
- v->str_val ? my_realloc(v->str_val, v->alloced_len+1,
- MYF(MY_WME)) :
- my_malloc(v->alloced_len+1, MYF(MY_WME))))
+ v->str_val ?
+ (char*)my_realloc(v->str_val, v->alloced_len+1, MYF(MY_WME)) :
+ (char*)my_malloc(v->alloced_len+1, MYF(MY_WME))))
die("Out of memory");
}
v->str_val_len = new_val_len;
@@ -2218,8 +2386,19 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
int open_file(const char *name)
{
char buff[FN_REFLEN];
+ size_t length;
DBUG_ENTER("open_file");
DBUG_PRINT("enter", ("name: %s", name));
+
+ /* Extract path from current file and try it as base first */
+ if (dirname_part(buff, cur_file->file_name, &length))
+ {
+ strxmov(buff, buff, name, NullS);
+ if (access(buff, F_OK) == 0){
+ DBUG_PRINT("info", ("The file exists"));
+ name= buff;
+ }
+ }
if (!test_if_hard_path(name))
{
strxmov(buff, opt_basedir, name, NullS);
@@ -2233,7 +2412,7 @@ int open_file(const char *name)
if (!(cur_file->file = my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
{
cur_file--;
- die("Could not open '%s' for reading", buff);
+ die("Could not open '%s' for reading, errno: %d", buff, errno);
}
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
cur_file->lineno=1;
@@ -2520,7 +2699,7 @@ enum enum_operator
SYNOPSIS
do_modify_var()
query called command
- operator operation to perform on the var
+ op operation to perform on the var
DESCRIPTION
dec $var_name
@@ -2529,7 +2708,7 @@ enum enum_operator
*/
int do_modify_var(struct st_command *command,
- enum enum_operator operator)
+ enum enum_operator op)
{
const char *p= command->first_argument;
VAR* v;
@@ -2539,7 +2718,7 @@ int do_modify_var(struct st_command *command,
die("The argument to %.*s must be a variable (start with $)",
command->first_word_len, command->query);
v= var_get(p, &p, 1, 0);
- switch (operator) {
+ switch (op) {
case DO_DEC:
v->int_val--;
break;
@@ -2789,7 +2968,7 @@ void do_mkdir(struct st_command *command)
int error;
static DYNAMIC_STRING ds_dirname;
const struct command_arg mkdir_args[] = {
- "dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to create"
+ {"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to create"}
};
DBUG_ENTER("do_mkdir");
@@ -2819,7 +2998,7 @@ void do_rmdir(struct st_command *command)
int error;
static DYNAMIC_STRING ds_dirname;
const struct command_arg rmdir_args[] = {
- "dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to remove"
+ {"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to remove"}
};
DBUG_ENTER("do_rmdir");
@@ -3194,6 +3373,14 @@ void do_diff_files(struct st_command *command)
sizeof(diff_file_args)/sizeof(struct command_arg),
' ');
+ if (access(ds_filename.str, F_OK) != 0)
+ die("command \"diff_files\" failed, file '%s' does not exist",
+ ds_filename.str);
+
+ if (access(ds_filename2.str, F_OK) != 0)
+ die("command \"diff_files\" failed, file '%s' does not exist",
+ ds_filename2.str);
+
if ((error= compare_files(ds_filename.str, ds_filename2.str)))
{
/* Compare of the two files failed, append them to output
@@ -3479,24 +3666,19 @@ void do_wait_for_slave_to_stop(struct st_command *c __attribute__((unused)))
}
-void do_sync_with_master2(long offset)
+void do_sync_with_master2(struct st_command *command, long offset)
{
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL *mysql= &cur_con->mysql;
char query_buf[FN_REFLEN+128];
- int tries= 0;
- int rpl_parse;
+ int timeout= 300; /* seconds */
if (!master_pos.file[0])
die("Calling 'sync_with_master' without calling 'save_master_pos'");
- rpl_parse= mysql_rpl_parse_enabled(mysql);
- mysql_disable_rpl_parse(mysql);
- sprintf(query_buf, "select master_pos_wait('%s', %ld)", master_pos.file,
- master_pos.pos + offset);
-
-wait_for_position:
+ sprintf(query_buf, "select master_pos_wait('%s', %ld, %d)",
+ master_pos.file, master_pos.pos + offset, timeout);
if (mysql_query(mysql, query_buf))
die("failed in '%s': %d: %s", query_buf, mysql_errno(mysql),
@@ -3509,30 +3691,48 @@ wait_for_position:
mysql_free_result(res);
die("empty result in %s", query_buf);
}
- if (!row[0])
+
+ int result= -99;
+ const char* result_str= row[0];
+ if (result_str)
+ result= atoi(result_str);
+
+ mysql_free_result(res);
+
+ if (!result_str || result < 0)
{
- /*
- It may be that the slave SQL thread has not started yet, though START
- SLAVE has been issued ?
- */
- mysql_free_result(res);
- if (tries++ == 30)
+ /* master_pos_wait returned NULL or < 0 */
+ show_query(mysql, "SHOW MASTER STATUS");
+ show_query(mysql, "SHOW SLAVE STATUS");
+ show_query(mysql, "SHOW PROCESSLIST");
+ fprintf(stderr, "analyze: sync_with_master\n");
+
+ if (!result_str)
{
- show_query(mysql, "SHOW MASTER STATUS");
- show_query(mysql, "SHOW SLAVE STATUS");
- die("could not sync with master ('%s' returned NULL)", query_buf);
+ /*
+ master_pos_wait returned NULL. This indicates that
+ slave SQL thread is not started, the slave's master
+ information is not initialized, the arguments are
+ incorrect, or an error has occured
+ */
+ die("%.*s failed: '%s' returned NULL "\
+ "indicating slave SQL thread failure",
+ command->first_word_len, command->query, query_buf);
+
}
- sleep(1); /* So at most we will wait 30 seconds and make 31 tries */
- goto wait_for_position;
+
+ if (result == -1)
+ die("%.*s failed: '%s' returned -1 "\
+ "indicating timeout after %d seconds",
+ command->first_word_len, command->query, query_buf, timeout);
+ else
+ die("%.*s failed: '%s' returned unknown result :%d",
+ command->first_word_len, command->query, query_buf, result);
}
- mysql_free_result(res);
- if (rpl_parse)
- mysql_enable_rpl_parse(mysql);
return;
}
-
void do_sync_with_master(struct st_command *command)
{
long offset= 0;
@@ -3547,7 +3747,7 @@ void do_sync_with_master(struct st_command *command)
die("Invalid integer argument \"%s\"", offset_start);
command->last_argument= p;
}
- do_sync_with_master2(offset);
+ do_sync_with_master2(command, offset);
return;
}
@@ -3897,6 +4097,145 @@ void do_set_charset(struct st_command *command)
}
+/*
+ Run query and return one field in the result set from the
+ first row and <column>
+*/
+
+int query_get_string(MYSQL* mysql, const char* query,
+ int column, DYNAMIC_STRING* ds)
+{
+ MYSQL_RES *res= NULL;
+ MYSQL_ROW row;
+
+ if (mysql_query(mysql, query))
+ die("'%s' failed: %d %s", query,
+ mysql_errno(mysql), mysql_error(mysql));
+ if ((res= mysql_store_result(mysql)) == NULL)
+ die("Failed to store result: %d %s",
+ mysql_errno(mysql), mysql_error(mysql));
+
+ if ((row= mysql_fetch_row(res)) == NULL)
+ {
+ mysql_free_result(res);
+ ds= 0;
+ return 1;
+ }
+ init_dynamic_string(ds, (row[column] ? row[column] : "NULL"), ~0, 32);
+ mysql_free_result(res);
+ return 0;
+}
+
+
+static int my_kill(int pid, int sig)
+{
+#ifdef __WIN__
+ HANDLE proc;
+ if ((proc= OpenProcess(PROCESS_TERMINATE, FALSE, pid)) == NULL)
+ return -1;
+ if (sig == 0)
+ {
+ CloseHandle(proc);
+ return 0;
+ }
+ (void)TerminateProcess(proc, 201);
+ CloseHandle(proc);
+ return 1;
+#else
+ return kill(pid, sig);
+#endif
+}
+
+
+
+/*
+ Shutdown the server of current connection and
+ make sure it goes away within <timeout> seconds
+
+ NOTE! Currently only works with local server
+
+ SYNOPSIS
+ do_shutdown_server()
+ command called command
+
+ DESCRIPTION
+ shutdown [<timeout>]
+
+*/
+
+void do_shutdown_server(struct st_command *command)
+{
+ int timeout=60, pid;
+ DYNAMIC_STRING ds_pidfile_name;
+ MYSQL* mysql = &cur_con->mysql;
+ static DYNAMIC_STRING ds_timeout;
+ const struct command_arg shutdown_args[] = {
+ {"timeout", ARG_STRING, FALSE, &ds_timeout, "Timeout before killing server"}
+ };
+ DBUG_ENTER("do_shutdown_server");
+
+ check_command_args(command, command->first_argument, shutdown_args,
+ sizeof(shutdown_args)/sizeof(struct command_arg),
+ ' ');
+
+ if (ds_timeout.length)
+ {
+ timeout= atoi(ds_timeout.str);
+ if (timeout == 0)
+ die("Illegal argument for timeout: '%s'", ds_timeout.str);
+ }
+ dynstr_free(&ds_timeout);
+
+ /* Get the servers pid_file name and use it to read pid */
+ if (query_get_string(mysql, "SHOW VARIABLES LIKE 'pid_file'", 1,
+ &ds_pidfile_name))
+ die("Failed to get pid_file from server");
+
+ /* Read the pid from the file */
+ {
+ int fd;
+ char buff[32];
+
+ if ((fd= my_open(ds_pidfile_name.str, O_RDONLY, MYF(0))) < 0)
+ die("Failed to open file '%s'", ds_pidfile_name.str);
+ dynstr_free(&ds_pidfile_name);
+
+ if (my_read(fd, (uchar*)&buff,
+ sizeof(buff), MYF(0)) <= 0){
+ my_close(fd, MYF(0));
+ die("pid file was empty");
+ }
+ my_close(fd, MYF(0));
+
+ pid= atoi(buff);
+ if (pid == 0)
+ die("Pidfile didn't contain a valid number");
+ }
+ DBUG_PRINT("info", ("Got pid %d", pid));
+
+ /* Tell server to shutdown if timeout > 0*/
+ if (timeout && mysql_shutdown(mysql, SHUTDOWN_DEFAULT))
+ die("mysql_shutdown failed");
+
+ /* Check that server dies */
+ while(timeout--){
+ if (my_kill(pid, 0) < 0){
+ DBUG_PRINT("info", ("Process %d does not exist anymore", pid));
+ DBUG_VOID_RETURN;
+ }
+ DBUG_PRINT("info", ("Sleeping, timeout: %d", timeout));
+ my_sleep(1000000L);
+ }
+
+ /* Kill the server */
+ DBUG_PRINT("info", ("Killing server, pid: %d", pid));
+ (void)my_kill(pid, 9);
+
+ DBUG_VOID_RETURN;
+
+}
+
+
#if MYSQL_VERSION_ID >= 50000
/* List of error names to error codes, available from 5.0 */
typedef struct
@@ -4160,59 +4499,73 @@ void set_reconnect(MYSQL* mysql, int val)
}
-int select_connection_name(const char *name)
+/**
+ Change the current connection to the given st_connection, and update
+ $mysql_get_server_version and $CURRENT_CONNECTION accordingly.
+*/
+void set_current_connection(struct st_connection *con)
+{
+ cur_con= con;
+ /* Update $mysql_get_server_version to that of current connection */
+ var_set_int("$mysql_get_server_version",
+ mysql_get_server_version(&con->mysql));
+ /* Update $CURRENT_CONNECTION to the name of the current connection */
+ var_set_string("$CURRENT_CONNECTION", con->name);
+}
+
+
+void select_connection_name(const char *name)
{
DBUG_ENTER("select_connection_name");
DBUG_PRINT("enter",("name: '%s'", name));
+ st_connection *con= find_connection_by_name(name);
- if (!(cur_con= find_connection_by_name(name)))
+ if (!con)
die("connection '%s' not found in connection pool", name);
- /* Update $mysql_get_server_version to that of current connection */
- var_set_mysql_get_server_version(&cur_con->mysql);
+ set_current_connection(con);
- DBUG_RETURN(0);
+ DBUG_VOID_RETURN;
}
-int select_connection(struct st_command *command)
+void select_connection(struct st_command *command)
{
- char *name;
- char *p= command->first_argument;
DBUG_ENTER("select_connection");
+ static DYNAMIC_STRING ds_connection;
+ const struct command_arg connection_args[] = {
+ { "connection_name", ARG_STRING, TRUE, &ds_connection, "Name of the connection that we switch to." }
+ };
+ check_command_args(command, command->first_argument, connection_args,
+ sizeof(connection_args)/sizeof(struct command_arg),
+ ',');
- if (!*p)
- die("Missing connection name in connect");
- name= p;
- while (*p && !my_isspace(charset_info,*p))
- p++;
- if (*p)
- *p++= 0;
- command->last_argument= p;
- DBUG_RETURN(select_connection_name(name));
+ DBUG_PRINT("info", ("changing connection: %s", ds_connection.str));
+ select_connection_name(ds_connection.str);
+ dynstr_free(&ds_connection);
+ DBUG_VOID_RETURN;
}
void do_close_connection(struct st_command *command)
{
- char *p= command->first_argument, *name;
- struct st_connection *con;
-
DBUG_ENTER("close_connection");
- DBUG_PRINT("enter",("name: '%s'",p));
- if (!*p)
- die("Missing connection name in disconnect");
- name= p;
- while (*p && !my_isspace(charset_info,*p))
- p++;
+ struct st_connection *con;
+ static DYNAMIC_STRING ds_connection;
+ const struct command_arg close_connection_args[] = {
+ { "connection_name", ARG_STRING, TRUE, &ds_connection,
+ "Name of the connection to close." }
+ };
+ check_command_args(command, command->first_argument,
+ close_connection_args,
+ sizeof(close_connection_args)/sizeof(struct command_arg),
+ ' ');
- if (*p)
- *p++= 0;
- command->last_argument= p;
+ DBUG_PRINT("enter",("connection name: '%s'", ds_connection.str));
- if (!(con= find_connection_by_name(name)))
- die("connection '%s' not found in connection pool", name);
+ if (!(con= find_connection_by_name(ds_connection.str)))
+ die("connection '%s' not found in connection pool", ds_connection.str);
DBUG_PRINT("info", ("Closing connection %s", con->name));
#ifndef EMBEDDED_LIBRARY
@@ -4251,6 +4604,13 @@ void do_close_connection(struct st_command *command)
if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME))))
die("Out of memory");
+ if (con == cur_con)
+ {
+ /* Current connection was closed */
+ var_set_int("$mysql_get_server_version", 0xFFFFFFFF);
+ var_set_string("$CURRENT_CONNECTION", con->name);
+ }
+
DBUG_VOID_RETURN;
}
@@ -4597,15 +4957,12 @@ void do_connect(struct st_command *command)
if (!(con_slot->name= my_strdup(ds_connection_name.str, MYF(MY_WME))))
die("Out of memory");
con_slot->name_len= strlen(con_slot->name);
- cur_con= con_slot;
-
+ set_current_connection(con_slot);
+
if (con_slot == next_con)
next_con++; /* if we used the next_con slot, advance the pointer */
}
- /* Update $mysql_get_server_version to that of current connection */
- var_set_mysql_get_server_version(&cur_con->mysql);
-
dynstr_free(&ds_connection_name);
dynstr_free(&ds_host);
dynstr_free(&ds_user);
@@ -5056,55 +5413,6 @@ void convert_to_format_v1(char* query)
/*
- Check a command that is about to be sent (or should have been
- sent if parsing was enabled) to mysql server for
- suspicious things and generate warnings.
-*/
-
-void scan_command_for_warnings(struct st_command *command)
-{
- const char *ptr= command->query;
- DBUG_ENTER("scan_command_for_warnings");
- DBUG_PRINT("enter", ("query: %s", command->query));
-
- while(*ptr)
- {
- /*
- Look for query's that lines that start with a -- comment
- and has a mysqltest command
- */
- if (ptr[0] == '\n' &&
- ptr[1] && ptr[1] == '-' &&
- ptr[2] && ptr[2] == '-' &&
- ptr[3])
- {
- uint type;
- char save;
- char *end, *start= (char*)ptr+3;
- /* Skip leading spaces */
- while (*start && my_isspace(charset_info, *start))
- start++;
- end= start;
- /* Find end of command(next space) */
- while (*end && !my_isspace(charset_info, *end))
- end++;
- save= *end;
- *end= 0;
- DBUG_PRINT("info", ("Checking '%s'", start));
- type= find_type(start, &command_typelib, 1+2);
- if (type)
- warning_msg("Embedded mysqltest command '--%s' detected in "
- "query '%s' was this intentional? ",
- start, command->query);
- *end= save;
- }
-
- ptr++;
- }
- DBUG_VOID_RETURN;
-}
-
-/*
Check for unexpected "junk" after the end of query
This is normally caused by missing delimiters or when
switching between different delimiters
@@ -5161,6 +5469,19 @@ void check_eol_junk(const char *eol)
}
+bool is_delimiter(const char* p)
+{
+ uint match= 0;
+ char* delim= delimiter;
+ while (*p && *p == *delim++)
+ {
+ match++;
+ p++;
+ }
+
+ return (match == delimiter_length);
+}
+
/*
Create a command from a set of lines
@@ -5227,9 +5548,11 @@ int read_command(struct st_command** command_ptr)
if (!(command->query_buf= command->query= my_strdup(p, MYF(MY_WME))))
die("Out of memory");
- /* Calculate first word length(the command), terminated by space or ( */
+ /*
+ Calculate first word length(the command), terminated
+ by 'space' , '(' or 'delimiter' */
p= command->query;
- while (*p && !my_isspace(charset_info, *p) && *p != '(')
+ while (*p && !my_isspace(charset_info, *p) && *p != '(' && !is_delimiter(p))
p++;
command->first_word_len= (uint) (p - command->query);
DBUG_PRINT("info", ("first_word: %.*s",
@@ -5448,7 +5771,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
if (!(cur_file->file=
my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
- die("Could not open '%s' for reading: errno = %d", buff, errno);
+ die("Could not open '%s' for reading, errno: %d", buff, errno);
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
cur_file->lineno= 1;
break;
@@ -5494,6 +5817,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
die("Can't use server argument");
}
break;
+ case OPT_LOG_DIR:
+ /* Check that the file exists */
+ if (access(opt_logdir, F_OK) != 0)
+ die("The specified log directory does not exist: '%s'", opt_logdir);
+ break;
case 'F':
read_embedded_server_arguments(argument);
break;
@@ -5535,6 +5863,14 @@ int parse_args(int argc, char **argv)
if (debug_check_flag)
my_end_arg= MY_CHECK_ERROR;
+
+ if (!record)
+ {
+ /* Check that the result file exists */
+ if (result_file_name && access(result_file_name, F_OK) != 0)
+ die("The specified result file '%s' does not exist", result_file_name);
+ }
+
return 0;
}
@@ -5565,11 +5901,11 @@ void str_to_file2(const char *fname, char *str, int size, my_bool append)
flags|= O_TRUNC;
if ((fd= my_open(buff, flags,
MYF(MY_WME | MY_FFNF))) < 0)
- die("Could not open '%s' for writing: errno = %d", buff, errno);
+ die("Could not open '%s' for writing, errno: %d", buff, errno);
if (append && my_seek(fd, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR)
- die("Could not find end of file '%s': errno = %d", buff, errno);
+ die("Could not find end of file '%s', errno: %d", buff, errno);
if (my_write(fd, (uchar*)str, size, MYF(MY_WME|MY_FNABP)))
- die("write failed");
+ die("write failed, errno: %d", errno);
my_close(fd, MYF(0));
}
@@ -5589,37 +5925,6 @@ void str_to_file(const char *fname, char *str, int size)
}
-void dump_result_to_log_file(char *buf, int size)
-{
- char log_file[FN_REFLEN];
- str_to_file(fn_format(log_file, result_file_name, opt_logdir, ".log",
- *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
- MY_REPLACE_EXT),
- buf, size);
- fprintf(stderr, "\nMore results from queries before failure can be found in %s\n",
- log_file);
-}
-
-void dump_progress(void)
-{
- char progress_file[FN_REFLEN];
- str_to_file(fn_format(progress_file, result_file_name,
- opt_logdir, ".progress",
- *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
- MY_REPLACE_EXT),
- ds_progress.str, ds_progress.length);
-}
-
-void dump_warning_messages(void)
-{
- char warn_file[FN_REFLEN];
-
- str_to_file(fn_format(warn_file, result_file_name, opt_logdir, ".warnings",
- *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
- MY_REPLACE_EXT),
- ds_warning_messages.str, ds_warning_messages.length);
-}
-
void check_regerr(my_regex_t* r, int err)
{
char err_buf[1024];
@@ -5731,7 +6036,7 @@ void fix_win_paths(const char *val, int len)
DBUG_PRINT("info", ("pattern: %s", *pattern));
/* Search for the path in string */
- while ((p= strstr(val, *pattern)))
+ while ((p= strstr((char*)val, *pattern)))
{
DBUG_PRINT("info", ("Found %s in val p: %s", *pattern, p));
@@ -5864,7 +6169,7 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
{
uint max_length= fields[i].max_length + 1;
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
- my_bind[i].buffer= (char *)my_malloc(max_length, MYF(MY_WME | MY_FAE));
+ my_bind[i].buffer= my_malloc(max_length, MYF(MY_WME | MY_FAE));
my_bind[i].buffer_length= max_length;
my_bind[i].is_null= &is_null[i];
my_bind[i].length= &length[i];
@@ -5880,7 +6185,7 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
while (mysql_stmt_fetch(stmt) == 0)
{
for (i= 0; i < num_fields; i++)
- append_field(ds, i, &fields[i], my_bind[i].buffer,
+ append_field(ds, i, &fields[i], (char*)my_bind[i].buffer,
*my_bind[i].length, *my_bind[i].is_null);
if (!display_result_vertically)
dynstr_append_mem(ds, "\n", 1);
@@ -6634,9 +6939,6 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
init_dynamic_string(&ds_warnings, NULL, 0, 256);
- /* Scan for warning before sending to server */
- scan_command_for_warnings(command);
-
/*
Evaluate query if this is an eval command
*/
@@ -6966,28 +7268,10 @@ void get_command_type(struct st_command* command)
}
else
{
- /* -- comment that didn't contain a mysqltest command */
- command->type= Q_COMMENT;
- warning_msg("Suspicious command '--%s' detected, was this intentional? "\
- "Use # instead of -- to avoid this warning",
- command->query);
-
- if (command->first_word_len &&
- strcmp(command->query + command->first_word_len - 1, delimiter) == 0)
- {
- /*
- Detect comment with command using extra delimiter
- Ex --disable_query_log;
- ^ Extra delimiter causing the command
- to be skipped
- */
- save= command->query[command->first_word_len-1];
- command->query[command->first_word_len-1]= 0;
- if (find_type(command->query, &command_typelib, 1+2) > 0)
- die("Extra delimiter \";\" found");
- command->query[command->first_word_len-1]= save;
-
- }
+ /* -- "comment" that didn't contain a mysqltest command */
+ die("Found line beginning with -- that didn't contain "\
+ "a valid mysqltest command, check your syntax or "\
+ "use # if you intended to write a comment");
}
}
@@ -7006,22 +7290,25 @@ void get_command_type(struct st_command* command)
/*
Record how many milliseconds it took to execute the test file
- up until the current line and save it in the dynamic string ds_progress.
-
- The ds_progress will be dumped to <test_name>.progress when
- test run completes
+ up until the current line and write it to .progress file
*/
void mark_progress(struct st_command* command __attribute__((unused)),
int line)
{
+ static ulonglong progress_start= 0; // < Beware
+ DYNAMIC_STRING ds_progress;
+
char buf[32], *end;
ulonglong timer= timer_now();
if (!progress_start)
progress_start= timer;
timer-= progress_start;
+ if (init_dynamic_string(&ds_progress, "", 256, 256))
+ die("Out of memory");
+
/* Milliseconds since start */
end= longlong2str(timer, buf, 10);
dynstr_append_mem(&ds_progress, buf, (int)(end-buf));
@@ -7043,6 +7330,10 @@ void mark_progress(struct st_command* command __attribute__((unused)),
dynstr_append_mem(&ds_progress, "\n", 1);
+ progress_file.write(&ds_progress);
+
+ dynstr_free(&ds_progress);
+
}
#ifdef HAVE_STACKTRACE
@@ -7077,6 +7368,13 @@ static sig_handler signal_handler(int sig)
{
fprintf(stderr, "mysqltest got " SIGNAL_FMT "\n", sig);
dump_backtrace();
+
+ fprintf(stderr, "Writing a core file...\n");
+ fflush(stderr);
+ my_write_core(sig);
+#ifndef __WIN__
+ exit(1); // Shouldn't get here but just in case
+#endif
}
#ifdef __WIN__
@@ -7150,7 +7448,6 @@ int main(int argc, char **argv)
my_bool q_send_flag= 0, abort_flag= 0;
uint command_executed= 0, last_command_executed= 0;
char save_file[FN_REFLEN];
- MY_STAT res_info;
MY_INIT(argv[0]);
save_file[0]= 0;
@@ -7209,11 +7506,14 @@ int main(int argc, char **argv)
init_win_path_patterns();
#endif
- init_dynamic_string(&ds_res, "", 65536, 65536);
- init_dynamic_string(&ds_progress, "", 0, 2048);
- init_dynamic_string(&ds_warning_messages, "", 0, 2048);
+ init_dynamic_string(&ds_res, "", 2048, 2048);
+
parse_args(argc, argv);
+ log_file.open(opt_logdir, result_file_name, ".log");
+ if (opt_mark_progress)
+ progress_file.open(opt_logdir, result_file_name, ".progress");
+
var_set_int("$PS_PROTOCOL", ps_protocol);
var_set_int("$SP_PROTOCOL", sp_protocol);
var_set_int("$VIEW_PROTOCOL", view_protocol);
@@ -7241,37 +7541,37 @@ int main(int argc, char **argv)
if (cursor_protocol_enabled)
ps_protocol_enabled= 1;
- cur_con= connections;
- if (!( mysql_init(&cur_con->mysql)))
+ st_connection *con= connections;
+ if (!( mysql_init(&con->mysql)))
die("Failed in mysql_init()");
if (opt_compress)
- mysql_options(&cur_con->mysql,MYSQL_OPT_COMPRESS,NullS);
- mysql_options(&cur_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
- mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_NAME,
+ mysql_options(&con->mysql,MYSQL_OPT_COMPRESS,NullS);
+ mysql_options(&con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
+ mysql_options(&con->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
if (opt_charsets_dir)
- mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_DIR,
+ mysql_options(&con->mysql, MYSQL_SET_CHARSET_DIR,
opt_charsets_dir);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
{
- mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
+ mysql_ssl_set(&con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost");
- mysql_options(&cur_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+ mysql_options(&con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif
}
#endif
- if (!(cur_con->name = my_strdup("default", MYF(MY_WME))))
+ if (!(con->name = my_strdup("default", MYF(MY_WME))))
die("Out of memory");
- safe_connect(&cur_con->mysql, cur_con->name, opt_host, opt_user, opt_pass,
+ safe_connect(&con->mysql, con->name, opt_host, opt_user, opt_pass,
opt_db, opt_port, unix_sock);
/* Use all time until exit if no explicit 'start_timer' */
@@ -7284,8 +7584,7 @@ int main(int argc, char **argv)
*/
var_set_errno(-1);
- /* Update $mysql_get_server_version to that of current connection */
- var_set_mysql_get_server_version(&cur_con->mysql);
+ set_current_connection(con);
if (opt_include)
{
@@ -7302,8 +7601,8 @@ int main(int argc, char **argv)
command->type != Q_ENABLE_PARSING &&
command->type != Q_DISABLE_PARSING)
{
+ /* Parsing is disabled, silently convert this line to a comment */
command->type= Q_COMMENT;
- scan_command_for_warnings(command);
}
if (cur_block->ok)
@@ -7474,15 +7773,23 @@ int main(int argc, char **argv)
select_connection(command);
else
select_connection_name("slave");
- do_sync_with_master2(0);
+ do_sync_with_master2(command, 0);
break;
}
case Q_COMMENT: /* Ignore row */
command->last_argument= command->end;
break;
case Q_PING:
- (void) mysql_ping(&cur_con->mysql);
- break;
+ handle_command_error(command, mysql_ping(&cur_con->mysql));
+ break;
+ case Q_SEND_SHUTDOWN:
+ handle_command_error(command,
+ mysql_shutdown(&cur_con->mysql,
+ SHUTDOWN_DEFAULT));
+ break;
+ case Q_SHUTDOWN_SERVER:
+ do_shutdown_server(command);
+ break;
case Q_EXEC:
do_exec(command);
command_executed++;
@@ -7591,8 +7898,15 @@ int main(int argc, char **argv)
parser.current_line += current_line_inc;
if ( opt_mark_progress )
mark_progress(command, parser.current_line);
+
+ /* Write result from command to log file immediately */
+ log_file.write(&ds_res);
+ log_file.flush();
+ dynstr_set(&ds_res, 0);
}
+ log_file.close();
+
start_lineno= 0;
if (parsing_disabled)
@@ -7601,9 +7915,9 @@ int main(int argc, char **argv)
/*
The whole test has been executed _sucessfully_.
Time to compare result or save it to record file.
- The entire output from test is now kept in ds_res.
+ The entire output from test is in the log file
*/
- if (ds_res.length)
+ if (log_file.bytes_written())
{
if (result_file_name)
{
@@ -7611,22 +7925,29 @@ int main(int argc, char **argv)
if (record)
{
- /* Recording - dump the output from test to result file */
- str_to_file(result_file_name, ds_res.str, ds_res.length);
+ /* Recording */
+
+ /* save a copy of the log to result file */
+ if (my_copy(log_file.file_name(), result_file_name, MYF(0)) != 0)
+ die("Failed to copy '%s' to '%s', errno: %d",
+ log_file.file_name(), result_file_name, errno);
+
}
else
{
- /* Check that the output from test is equal to result file
- - detect missing result file
- - detect zero size result file
- */
- check_result(&ds_res);
+ /* Check that the output from test is equal to result file */
+ check_result();
}
}
else
{
- /* No result_file_name specified to compare with, print to stdout */
- printf("%s", ds_res.str);
+ /*
+ No result_file_name specified, the result
+ has been printed to stdout, exit with error
+ unless script has called "exit" to indicate success
+ */
+ if (abort_flag == 0)
+ die("Exit with failure! Call 'exit' in script to return with sucess");
}
}
else
@@ -7634,25 +7955,8 @@ int main(int argc, char **argv)
die("The test didn't produce any output");
}
- if (!command_executed &&
- result_file_name && my_stat(result_file_name, &res_info, 0))
- {
- /*
- my_stat() successful on result file. Check if we have not run a
- single query, but we do have a result file that contains data.
- Note that we don't care, if my_stat() fails. For example, for a
- non-existing or non-readable file, we assume it's fine to have
- no query output from the test file, e.g. regarded as no error.
- */
+ if (!command_executed && result_file_name)
die("No queries executed but result file found!");
- }
-
- if ( opt_mark_progress && result_file_name )
- dump_progress();
-
- /* Dump warning messages */
- if (result_file_name && ds_warning_messages.length)
- dump_warning_messages();
timer_output();
/* Yes, if we got this far the test has suceeded! Sakila smiles */
@@ -7721,12 +8025,11 @@ void do_get_replace_column(struct st_command *command)
die("Missing argument in %s", command->query);
/* Allocate a buffer for results */
- start= buff= my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE));
+ start= buff= (char*)my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE));
while (*from)
{
char *to;
uint column_number;
-
to= get_string(&buff, &from, command);
if (!(column_number= atoi(to)) || column_number > MAX_COLUMNS)
die("Wrong column number to replace_column in '%s'", command->query);
@@ -7804,7 +8107,7 @@ void do_get_replace(struct st_command *command)
bzero((char*) &from_array,sizeof(from_array));
if (!*from)
die("Missing argument in %s", command->query);
- start= buff= my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE));
+ start= buff= (char*)my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE));
while (*from)
{
char *to= buff;
@@ -7812,6 +8115,9 @@ void do_get_replace(struct st_command *command)
if (!*from)
die("Wrong number of arguments to replace_result in '%s'",
command->query);
+#ifdef __WIN__
+ fix_win_paths(to, from - to);
+#endif
insert_pointer_name(&from_array,to);
to= get_string(&buff, &from, command);
insert_pointer_name(&to_array,to);
diff --git a/cmd-line-utils/libedit/Makefile.am b/cmd-line-utils/libedit/Makefile.am
index 23ee20894ec..ddafa4aab44 100644
--- a/cmd-line-utils/libedit/Makefile.am
+++ b/cmd-line-utils/libedit/Makefile.am
@@ -1,6 +1,4 @@
## Process this file with automake to create Makefile.in
-# Makefile for the GNU readline library.
-# Copyright (C) 1994,1996,1997 Free Software Foundation, Inc.
ASRC = $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c
AHDR = vi.h emacs.h common.h
@@ -12,32 +10,22 @@ noinst_LIBRARIES = libedit.a
libedit_a_SOURCES = chared.c el.c history.c map.c prompt.c readline.c \
search.c tokenizer.c vi.c common.c emacs.c \
hist.c key.c parse.c read.c refresh.c sig.c term.c \
- tty.c help.c fcns.c
-
-EXTRA_libedit_a_SOURCES = np/unvis.c np/strlcpy.c np/vis.c np/strlcat.c \
- np/fgetln.c
+ tty.c help.c fcns.c filecomplete.c \
+ np/unvis.c np/strlcpy.c np/vis.c np/strlcat.c \
+ np/fgetln.c
libedit_a_LIBADD = @LIBEDIT_LOBJECTS@
libedit_a_DEPENDENCIES = @LIBEDIT_LOBJECTS@
-noinst_HEADERS = readline/readline.h \
-\
- chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.h \
- sys.h tokenizer.h config.h hist.h map.h prompt.h read.h \
- search.h tty.h libedit_term.h vis.h
+pkginclude_HEADERS = readline/readline.h
-EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/vis.h np/strlcat.c np/fgetln.c
+noinst_HEADERS = chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.h \
+ sys.h config.h hist.h map.h prompt.h read.h \
+ search.h tty.h filecomplete.h np/vis.h
-CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c
+EXTRA_DIST = makelist.sh
-# Make sure to include stuff from this directory first, to get right "config.h"
-# Automake puts into DEFAULT_INCLUDES this source and corresponding
-# build directory together with ../../include to let all make files
-# find the central "config.h". This variable is used before INCLUDES
-# above. But in automake 1.10 the order of these are changed. Put the
-# includes of this directory into DEFS to always be sure it is first
-# before DEFAULT_INCLUDES on the compile line.
-DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR -I. -I$(srcdir)
+CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c
SUFFIXES = .sh
@@ -101,6 +89,4 @@ term.o: vi.h emacs.h common.h help.h fcns.h
tty.o: vi.h emacs.h common.h help.h fcns.h
help.o: vi.h emacs.h common.h help.h fcns.h
fcns.o: vi.h emacs.h common.h help.h fcns.h
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
+filecomplete.o: vi.h emacs.h common.h help.h fcns.h
diff --git a/cmd-line-utils/libedit/README b/cmd-line-utils/libedit/README
new file mode 100644
index 00000000000..0b698a6150d
--- /dev/null
+++ b/cmd-line-utils/libedit/README
@@ -0,0 +1,50 @@
+An approximate method to merge from upstream is:
+
+ # Fetch latest from upstream (we also include some compat stuff)
+ $ CVS_RSH=ssh; export CVS_RSH
+ $ CVSROOT="anoncvs@stripped:/cvsroot"
+ $ cvs co -d libedit -P src/lib/libedit
+ $ mkdir libedit/np
+ $ for f in src/common/lib/libc/string/strlcat.c \
+ > src/common/lib/libc/string/strlcpy.c \
+ > src/include/vis.h \
+ > src/lib/libc/gen/unvis.c \
+ > src/lib/libc/gen/vis.c \
+ > src/tools/compat/fgetln.c
+ > do
+ > cvs co -P ${f}
+ > mv ${f} libedit/np
+ > done
+ $ rm -rf src
+ $ cd libedit
+
+ # Remove files we don't need/use
+ $ rm -rf CVS TEST Makefile shlib_version *.[0-9]
+ $ (cd readline; rm -rf CVS Makefile)
+
+ # Rename files to match our naming
+ $ mv makelist makelist.sh
+ $ mv term.h el_term.h
+
+ # Remove NetBSD-specific bits
+ $ for file in $(find . -type f)
+ > do
+ > cp ${file} ${file}.orig
+ > sed -e 's/#include "term.h"/#include "el_term.h"/g' \
+ > -e 's/sig_handler/el_sig_handler/g' \
+ > -e 's/isprint/el_isprint/g' \
+ > -e '/^__RCSID/d' \
+ > ${file}.orig >${file}
+ > rm ${file}.orig
+ > done
+
+then merge remaining bits by hand. All MySQL-specific changes should be
+marked with XXXMYSQL to make them easier to identify and merge. To generate
+a 'clean' diff against upstream you can use the above commands but use
+
+ cvs co -D "2009/02/06 20:09:00" [..]
+
+to fetch the baseline of most recent merge.
+
+Please feed any fixes to Jonathan Perkin <jperkin@stripped> who will endeavour
+to merge them upstream and keep diffs minimal.
diff --git a/cmd-line-utils/libedit/TEST/test.c b/cmd-line-utils/libedit/TEST/test.c
deleted file mode 100644
index 605341eac62..00000000000
--- a/cmd-line-utils/libedit/TEST/test.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/* $NetBSD: test.c,v 1.9 2000/09/04 23:36:41 lukem Exp $ */
-
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Christos Zoulas of Cornell University.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-#include "compat.h"
-#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\
- The Regents of the University of California. All rights reserved.\n");
-#endif /* not lint */
-
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: test.c,v 1.9 2000/09/04 23:36:41 lukem Exp $");
-#endif
-#endif /* not lint && not SCCSID */
-
-/*
- * test.c: A little test program
- */
-#include "sys.h"
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include "histedit.h"
-#include "tokenizer.h"
-
-static int continuation = 0;
-static EditLine *el = NULL;
-
-static u_char complete(EditLine *, int);
- int main(int, char **);
-static char *prompt(EditLine *);
-static void sig(int);
-
-static char *
-prompt(EditLine *el)
-{
- static char a[] = "Edit$";
- static char b[] = "Edit>";
-
- return (continuation ? b : a);
-}
-
-static void
-sig(int i)
-{
-
- (void) fprintf(stderr, "Got signal %d.\n", i);
- el_reset(el);
-}
-
-static unsigned char
-complete(EditLine *el, int ch)
-{
- DIR *dd = opendir(".");
- struct dirent *dp;
- const char* ptr;
- const LineInfo *lf = el_line(el);
- int len;
-
- /*
- * Find the last word
- */
- for (ptr = lf->cursor - 1; !isspace(*ptr) && ptr > lf->buffer; ptr--)
- continue;
- len = lf->cursor - ++ptr;
-
- for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
- if (len > strlen(dp->d_name))
- continue;
- if (strncmp(dp->d_name, ptr, len) == 0) {
- closedir(dd);
- if (el_insertstr(el, &dp->d_name[len]) == -1)
- return (CC_ERROR);
- else
- return (CC_REFRESH);
- }
- }
-
- closedir(dd);
- return (CC_ERROR);
-}
-
-int
-main(int argc, char *argv[])
-{
- int num;
- const char *buf;
- Tokenizer *tok;
- int lastevent = 0, ncontinuation;
- History *hist;
- HistEvent ev;
-
- (void) signal(SIGINT, sig);
- (void) signal(SIGQUIT, sig);
- (void) signal(SIGHUP, sig);
- (void) signal(SIGTERM, sig);
-
- hist = history_init(); /* Init the builtin history */
- /* Remember 100 events */
- history(hist, &ev, H_SETSIZE, 100);
-
- tok = tok_init(NULL); /* Initialize the tokenizer */
-
- /* Initialize editline */
- el = el_init(*argv, stdin, stdout, stderr);
-
- el_set(el, EL_EDITOR, "vi"); /* Default editor is vi */
- el_set(el, EL_SIGNAL, 1); /* Handle signals gracefully */
- el_set(el, EL_PROMPT, prompt); /* Set the prompt function */
-
- /* Tell editline to use this history interface */
- el_set(el, EL_HIST, history, hist);
-
- /* Add a user-defined function */
- el_set(el, EL_ADDFN, "ed-complete", "Complete argument", complete);
-
- /* Bind tab to it */
- el_set(el, EL_BIND, "^I", "ed-complete", NULL);
-
- /*
- * Bind j, k in vi command mode to previous and next line, instead
- * of previous and next history.
- */
- el_set(el, EL_BIND, "-a", "k", "ed-prev-line", NULL);
- el_set(el, EL_BIND, "-a", "j", "ed-next-line", NULL);
-
- /*
- * Source the user's defaults file.
- */
- el_source(el, NULL);
-
- while ((buf = el_gets(el, &num)) != NULL && num != 0) {
- int ac;
- char **av;
-#ifdef DEBUG
- (void) fprintf(stderr, "got %d %s", num, buf);
-#endif
- if (!continuation && num == 1)
- continue;
-
- if (tok_line(tok, buf, &ac, &av) > 0)
- ncontinuation = 1;
-
-#if 0
- if (continuation) {
- /*
- * Append to the right event in case the user
- * moved around in history.
- */
- if (history(hist, &ev, H_SET, lastevent) == -1)
- err(1, "%d: %s\n", lastevent, ev.str);
- history(hist, &ev, H_ADD , buf);
- } else {
- history(hist, &ev, H_ENTER, buf);
- lastevent = ev.num;
- }
-#else
- /* Simpler */
- history(hist, &ev, continuation ? H_APPEND : H_ENTER, buf);
-#endif
-
- continuation = ncontinuation;
- ncontinuation = 0;
-
- if (strcmp(av[0], "history") == 0) {
- int rv;
-
- switch (ac) {
- case 1:
- for (rv = history(hist, &ev, H_LAST); rv != -1;
- rv = history(hist, &ev, H_PREV))
- (void) fprintf(stdout, "%4d %s",
- ev.num, ev.str);
- break;
-
- case 2:
- if (strcmp(av[1], "clear") == 0)
- history(hist, &ev, H_CLEAR);
- else
- goto badhist;
- break;
-
- case 3:
- if (strcmp(av[1], "load") == 0)
- history(hist, &ev, H_LOAD, av[2]);
- else if (strcmp(av[1], "save") == 0)
- history(hist, &ev, H_SAVE, av[2]);
- break;
-
- badhist:
- default:
- (void) fprintf(stderr,
- "Bad history arguments\n");
- break;
- }
- } else if (el_parse(el, ac, av) == -1) {
- switch (fork()) {
- case 0:
- execvp(av[0], av);
- perror(av[0]);
- _exit(1);
- /*NOTREACHED*/
- break;
-
- case -1:
- perror("fork");
- break;
-
- default:
- if (wait(&num) == -1)
- perror("wait");
- (void) fprintf(stderr, "Exit %x\n", num);
- break;
- }
- }
-
- tok_reset(tok);
- }
-
- el_end(el);
- tok_end(tok);
- history_end(hist);
-
- return (0);
-}
diff --git a/cmd-line-utils/libedit/chared.c b/cmd-line-utils/libedit/chared.c
index 4cb6e00d26e..e4823db7147 100644
--- a/cmd-line-utils/libedit/chared.c
+++ b/cmd-line-utils/libedit/chared.c
@@ -1,4 +1,4 @@
-/* $NetBSD: chared.c,v 1.22 2004/08/13 12:10:38 mycroft Exp $ */
+/* $NetBSD: chared.c,v 1.26 2009/02/06 12:45:25 sketch Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* chared.c: Character editor utilities
@@ -40,6 +46,8 @@
#include <stdlib.h>
#include "el.h"
+private void ch__clearmacro (EditLine *);
+
/* value to leave unused in line buffer */
#define EL_LEAVE 2
@@ -51,13 +59,13 @@ cv_undo(EditLine *el)
{
c_undo_t *vu = &el->el_chared.c_undo;
c_redo_t *r = &el->el_chared.c_redo;
- int size;
+ unsigned int size;
/* Save entire line for undo */
size = el->el_line.lastchar - el->el_line.buffer;
vu->len = size;
vu->cursor = el->el_line.cursor - el->el_line.buffer;
- memcpy(vu->buf, el->el_line.buffer, (size_t)size);
+ memcpy(vu->buf, el->el_line.buffer, size);
/* save command info for redo */
r->count = el->el_state.doingarg ? el->el_state.argument : 0;
@@ -439,6 +447,8 @@ cv__endword(char *p, char *high, int n, int (*wtest)(int))
protected int
ch_init(EditLine *el)
{
+ c_macro_t *ma = &el->el_chared.c_macro;
+
el->el_line.buffer = (char *) el_malloc(EL_BUFSIZ);
if (el->el_line.buffer == NULL)
return (-1);
@@ -479,11 +489,10 @@ ch_init(EditLine *el)
el->el_state.argument = 1;
el->el_state.lastcmd = ED_UNASSIGNED;
- el->el_chared.c_macro.level = -1;
- el->el_chared.c_macro.offset = 0;
- el->el_chared.c_macro.macro = (char **) el_malloc(EL_MAXMACRO *
- sizeof(char *));
- if (el->el_chared.c_macro.macro == NULL)
+ ma->level = -1;
+ ma->offset = 0;
+ ma->macro = (char **) el_malloc(EL_MAXMACRO * sizeof(char *));
+ if (ma->macro == NULL)
return (-1);
return (0);
}
@@ -492,7 +501,7 @@ ch_init(EditLine *el)
* Reset the character editor
*/
protected void
-ch_reset(EditLine *el)
+ch_reset(EditLine *el, int mclear)
{
el->el_line.cursor = el->el_line.buffer;
el->el_line.lastchar = el->el_line.buffer;
@@ -513,9 +522,19 @@ ch_reset(EditLine *el)
el->el_state.argument = 1;
el->el_state.lastcmd = ED_UNASSIGNED;
- el->el_chared.c_macro.level = -1;
-
el->el_history.eventno = 0;
+
+ if (mclear)
+ ch__clearmacro(el);
+}
+
+private void
+ch__clearmacro(el)
+ EditLine *el;
+{
+ c_macro_t *ma = &el->el_chared.c_macro;
+ while (ma->level >= 0)
+ el_free((ptr_t)ma->macro[ma->level--]);
}
/* ch_enlargebufs():
@@ -623,9 +642,9 @@ ch_end(EditLine *el)
el->el_chared.c_redo.cmd = ED_UNASSIGNED;
el_free((ptr_t) el->el_chared.c_kill.buf);
el->el_chared.c_kill.buf = NULL;
+ ch_reset(el, 1);
el_free((ptr_t) el->el_chared.c_macro.macro);
el->el_chared.c_macro.macro = NULL;
- ch_reset(el);
}
diff --git a/cmd-line-utils/libedit/chared.h b/cmd-line-utils/libedit/chared.h
index 2dd0a5795c7..fa8f5a58d83 100644
--- a/cmd-line-utils/libedit/chared.h
+++ b/cmd-line-utils/libedit/chared.h
@@ -1,4 +1,4 @@
-/* $NetBSD: chared.h,v 1.14 2004/08/13 12:10:39 mycroft Exp $ */
+/* $NetBSD: chared.h,v 1.17 2006/03/06 21:11:56 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -48,7 +48,7 @@
#define EL_MAXMACRO 10
/*
- * This is a issue of basic "vi" look-and-feel. Defining VI_MOVE works
+ * This is an issue of basic "vi" look-and-feel. Defining VI_MOVE works
* like real vi: i.e. the transition from command<->insert modes moves
* the cursor.
*
@@ -116,11 +116,10 @@ typedef struct el_chared_t {
} el_chared_t;
-#define STReof "^D\b\b"
#define STRQQ "\"\""
#define isglob(a) (strchr("*[]?", (a)) != NULL)
-#define isword(a) (isprint(a))
+#define isword(a) (el_isprint(a))
#define NOP 0x00
#define DELETE 0x01
@@ -161,7 +160,7 @@ protected int c_gets(EditLine *, char *, const char *);
protected int c_hpos(EditLine *);
protected int ch_init(EditLine *);
-protected void ch_reset(EditLine *);
+protected void ch_reset(EditLine *, int);
protected int ch_enlargebufs(EditLine *, size_t);
protected void ch_end(EditLine *);
diff --git a/cmd-line-utils/libedit/common.c b/cmd-line-utils/libedit/common.c
index 81bf9bf29ff..d4d024eae10 100644
--- a/cmd-line-utils/libedit/common.c
+++ b/cmd-line-utils/libedit/common.c
@@ -1,4 +1,4 @@
-/* $NetBSD: common.c,v 1.16 2003/08/07 16:44:30 agc Exp $ */
+/* $NetBSD: common.c,v 1.21 2008/09/30 08:37:42 aymeric Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* common.c: Common Editor functions
@@ -130,7 +136,7 @@ ed_delete_prev_word(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_next_char(EditLine *el, int c __attribute__((__unused__)))
+ed_delete_next_char(EditLine *el, int c)
{
#ifdef notdef /* XXX */
#define EL el->el_line
@@ -147,9 +153,8 @@ ed_delete_next_char(EditLine *el, int c __attribute__((__unused__)))
#ifdef KSHVI
return (CC_ERROR);
#else
- term_overwrite(el, STReof, 4);
- /* then do a EOF */
- term__flush();
+ /* then do an EOF */
+ term_writechar(el, c);
return (CC_EOF);
#endif
} else {
@@ -207,13 +212,13 @@ ed_move_to_end(EditLine *el, int c __attribute__((__unused__)))
el->el_line.cursor = el->el_line.lastchar;
if (el->el_map.type == MAP_VI) {
-#ifdef VI_MOVE
- el->el_line.cursor--;
-#endif
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
return (CC_REFRESH);
}
+#ifdef VI_MOVE
+ el->el_line.cursor--;
+#endif
}
return (CC_CURSOR);
}
@@ -609,7 +614,7 @@ protected el_action_t
ed_start_over(EditLine *el, int c __attribute__((__unused__)))
{
- ch_reset(el);
+ ch_reset(el, 0);
return (CC_REFRESH);
}
@@ -904,7 +909,7 @@ ed_command(EditLine *el, int c __attribute__((__unused__)))
int tmplen;
tmplen = c_gets(el, tmpbuf, "\n: ");
- term__putc('\n');
+ term__putc(el, '\n');
if (tmplen < 0 || (tmpbuf[tmplen] = 0, parse_line(el, tmpbuf)) == -1)
term_beep(el);
diff --git a/cmd-line-utils/libedit/compat.h b/cmd-line-utils/libedit/compat.h
deleted file mode 100644
index 3693a2db809..00000000000
--- a/cmd-line-utils/libedit/compat.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef __LIBEDIT_COMPATH_H
-#define __LIBEDIT_COMPATH_H
-
-#define __RCSID(x)
-#define __COPYRIGHT(x)
-
-#include "compat_conf.h"
-
-#ifndef HAVE_VIS_H
-/* string visual representation - may want to reimplement */
-#define strvis(d,s,m) strcpy(d,s)
-#define strunvis(d,s) strcpy(d,s)
-#endif
-
-#ifndef HAVE_FGETLN
-#include "fgetln.h"
-#endif
-
-#ifndef HAVE_ISSETUGID
-#define issetugid() (getuid()!=geteuid() || getegid()!=getgid())
-#endif
-
-#ifndef HAVE_STRLCPY
-#include "strlcpy.h"
-#endif
-
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-#ifndef __P
-#ifdef __STDC__
-#define __P(x) x
-#else
-#define __P(x) ()
-#endif
-#endif
-
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#define __attribute__(A)
-#endif
-
-#endif
diff --git a/cmd-line-utils/libedit/compat_conf.h b/cmd-line-utils/libedit/compat_conf.h
deleted file mode 100644
index e2b9557f5b1..00000000000
--- a/cmd-line-utils/libedit/compat_conf.h
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#include "my_config.h"
diff --git a/cmd-line-utils/libedit/config.h b/cmd-line-utils/libedit/config.h
index 642123d1ddc..2c3989ee316 100644
--- a/cmd-line-utils/libedit/config.h
+++ b/cmd-line-utils/libedit/config.h
@@ -1,16 +1,2 @@
-
#include "my_config.h"
#include "sys.h"
-
-#if defined(LIBC_SCCS) && !defined(lint)
-#define __RCSID(x)
-#define __COPYRIGHT(x)
-#endif
-#define __RENAME(x)
-#define _DIAGASSERT(x)
-
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#define __attribute__(A)
-#endif
-
-
diff --git a/cmd-line-utils/libedit/editline.3 b/cmd-line-utils/libedit/editline.3
deleted file mode 100644
index 1b812ebcc79..00000000000
--- a/cmd-line-utils/libedit/editline.3
+++ /dev/null
@@ -1,619 +0,0 @@
-.\" $NetBSD: editline.3,v 1.21 2001/04/02 18:29:49 wiz Exp $
-.\"
-.\" Copyright (c) 1997-1999 The NetBSD Foundation, Inc.
-.\" All rights reserved.
-.\"
-.\" This file was contributed to The NetBSD Foundation by Luke Mewburn.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the NetBSD
-.\" Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\" contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd November 12, 1999
-.Os
-.Dt EDITLINE 3
-.Sh NAME
-.Nm editline ,
-.Nm el_init ,
-.Nm el_end ,
-.Nm el_reset ,
-.Nm el_gets ,
-.Nm el_getc ,
-.Nm el_push ,
-.Nm el_parse ,
-.Nm el_set ,
-.Nm el_source ,
-.Nm el_resize ,
-.Nm el_line ,
-.Nm el_insertstr ,
-.Nm el_deletestr ,
-.Nm history_init ,
-.Nm history_end ,
-.Nm history
-.Nd line editor and history functions
-.Sh LIBRARY
-.Lb libedit
-.Sh SYNOPSIS
-.Fd #include <histedit.h>
-.Ft EditLine *
-.Fn el_init "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr"
-.Ft void
-.Fn el_end "EditLine *e"
-.Ft void
-.Fn el_reset "EditLine *e"
-.Ft const char *
-.Fn el_gets "EditLine *e" "int *count"
-.Ft int
-.Fn el_getc "EditLine *e" "char *ch"
-.Ft void
-.Fn el_push "EditLine *e" "const char *str"
-.Ft int
-.Fn el_parse "EditLine *e" "int argc" "char *argv[]"
-.Ft int
-.Fn el_set "EditLine *e" "int op" "..."
-.Ft int
-.Fn el_get "EditLine *e" "int op" "void *result"
-.Ft int
-.Fn el_source "EditLine *e" "const char *file"
-.Ft void
-.Fn el_resize "EditLine *e"
-.Ft const LineInfo *
-.Fn el_line "EditLine *e"
-.Ft int
-.Fn el_insertstr "EditLine *e" "const char *str"
-.Ft void
-.Fn el_deletestr "EditLine *e" "int count"
-.Ft History *
-.Fn history_init
-.Ft void
-.Fn history_end "History *h"
-.Ft int
-.Fn history "History *h" "HistEvent *ev" "int op" "..."
-.Sh DESCRIPTION
-The
-.Nm
-library provides generic line editing and history functions,
-similar to those found in
-.Xr sh 1 .
-.Pp
-These functions are available in the
-.Nm libedit
-library (which needs the
-.Nm libtermcap
-library).
-Programs should be linked with
-.Fl ledit ltermcap .
-.Sh LINE EDITING FUNCTIONS
-The line editing functions use a common data structure,
-.Fa EditLine ,
-which is created by
-.Fn el_init
-and freed by
-.Fn el_end .
-.Pp
-The following functions are available:
-.Bl -tag -width 4n
-.It Fn el_init
-Initialise the line editor, and return a data structure
-to be used by all other line editing functions.
-.Fa prog
-is the name of the invoking program, used when reading the
-.Xr editrc 5
-file to determine which settings to use.
-.Fa fin ,
-.Fa fout
-and
-.Fa ferr
-are the input, output, and error streams (respectively) to use.
-In this documentation, references to
-.Dq the tty
-are actually to this input/output stream combination.
-.It Fn el_end
-Clean up and finish with
-.Fa e ,
-assumed to have been created with
-.Fn el_init .
-.It Fn el_reset
-Reset the tty and the parser.
-This should be called after an error which may have upset the tty's
-state.
-.It Fn el_gets
-Read a line from the tty.
-.Fa count
-is modified to contain the number of characters read.
-Returns the line read if successful, or
-.Dv NULL
-if no characters were read or if an error occurred.
-.It Fn el_getc
-Read a character from the tty.
-.Fa ch
-is modified to contain the character read.
-Returns the number of characters read if successful, -1 otherwise.
-.It Fn el_push
-Pushes
-.Fa str
-back onto the input stream.
-This is used by the macro expansion mechanism.
-Refer to the description of
-.Ic bind
-.Fl s
-in
-.Xr editrc 5
-for more information.
-.It Fn el_parse
-Parses the
-.Fa argv
-array (which is
-.Fa argc
-elements in size)
-to execute builtin
-.Nm
-commands.
-If the command is prefixed with
-.Dq prog:
-then
-.Fn el_parse
-will only execute the command if
-.Dq prog
-matches the
-.Fa prog
-argument supplied to
-.Fn el_init .
-The return value is
--1 if the command is unknown,
-0 if there was no error or
-.Dq prog
-didn't match, or
-1 if the command returned an error.
-Refer to
-.Xr editrc 5
-for more information.
-.It Fn el_set
-Set
-.Nm
-parameters.
-.Fa op
-determines which parameter to set, and each operation has its
-own parameter list.
-.Pp
-The following values for
-.Fa op
-are supported, along with the required argument list:
-.Bl -tag -width 4n
-.It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)"
-Define prompt printing function as
-.Fa f ,
-which is to return a string that contains the prompt.
-.It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)"
-Define right side prompt printing function as
-.Fa f ,
-which is to return a string that contains the prompt.
-.It Dv EL_TERMINAL , Fa "const char *type"
-Define terminal type of the tty to be
-.Fa type ,
-or to
-.Ev TERM
-if
-.Fa type
-is
-.Dv NULL .
-.It Dv EL_EDITOR , Fa "const char *mode"
-Set editing mode to
-.Fa mode ,
-which must be one of
-.Dq emacs
-or
-.Dq vi .
-.It Dv EL_SIGNAL , Fa "int flag"
-If
-.Fa flag
-is non-zero,
-.Nm
-will install its own signal handler for the following signals when
-reading command input:
-.Dv SIGCONT ,
-.Dv SIGHUP ,
-.Dv SIGINT ,
-.Dv SIGQUIT ,
-.Dv SIGSTOP ,
-.Dv SIGTERM ,
-.Dv SIGTSTP ,
-and
-.Dv SIGWINCH .
-Otherwise, the current signal handlers will be used.
-.It Dv EL_BIND , Xo
-.Fa "const char *" ,
-.Fa "..." ,
-.Dv NULL
-.Xc
-Perform the
-.Ic bind
-builtin command.
-Refer to
-.Xr editrc 5
-for more information.
-.It Dv EL_ECHOTC , Xo
-.Fa "const char *" ,
-.Fa "..." ,
-.Dv NULL
-.Xc
-Perform the
-.Ic echotc
-builtin command.
-Refer to
-.Xr editrc 5
-for more information.
-.It Dv EL_SETTC , Xo
-.Fa "const char *" ,
-.Fa "..." ,
-.Dv NULL
-.Xc
-Perform the
-.Ic settc
-builtin command.
-Refer to
-.Xr editrc 5
-for more information.
-.It Dv EL_SETTY , Xo
-.Fa "const char *" ,
-.Fa "..." ,
-.Dv NULL
-.Xc
-Perform the
-.Ic setty
-builtin command.
-Refer to
-.Xr editrc 5
-for more information.
-.It Dv EL_TELLTC , Xo
-.Fa "const char *" ,
-.Fa "..." ,
-.Dv NULL
-.Xc
-Perform the
-.Ic telltc
-builtin command.
-Refer to
-.Xr editrc 5
-for more information.
-.It Dv EL_ADDFN , Xo
-.Fa "const char *name" ,
-.Fa "const char *help" ,
-.Fa "unsigned char (*func)(EditLine *e, int ch)
-.Xc
-Add a user defined function,
-.Fn func ,
-referred to as
-.Fa name
-which is invoked when a key which is bound to
-.Fa name
-is entered.
-.Fa help
-is a description of
-.Fa name .
-At invocation time,
-.Fa ch
-is the key which caused the invocation.
-The return value of
-.Fn func
-should be one of:
-.Bl -tag -width "CC_REDISPLAY"
-.It Dv CC_NORM
-Add a normal character.
-.It Dv CC_NEWLINE
-End of line was entered.
-.It Dv CC_EOF
-EOF was entered.
-.It Dv CC_ARGHACK
-Expecting further command input as arguments, do nothing visually.
-.It Dv CC_REFRESH
-Refresh display.
-.It Dv CC_REFRESH_BEEP
-Refresh display, and beep.
-.It Dv CC_CURSOR
-Cursor moved, so update and perform
-.Dv CC_REFRESH.
-.It Dv CC_REDISPLAY
-Redisplay entire input line.
-This is useful if a key binding outputs extra information.
-.It Dv CC_ERROR
-An error occurred.
-Beep, and flush tty.
-.It Dv CC_FATAL
-Fatal error, reset tty to known state.
-.El
-.It Dv EL_HIST , Xo
-.Fa "History *(*func)(History *, int op, ...)" ,
-.Fa "const char *ptr"
-.Xc
-Defines which history function to use, which is usually
-.Fn history .
-.Fa ptr
-should be the value returned by
-.Fn history_init .
-.It Dv EL_EDITMODE , Fa "int flag"
-If
-.Fa flag
-is non-zero,
-editing is enabled (the default).
-Note that this is only an indication, and does not
-affect the operation of
-.Nm "" .
-At this time, it is the caller's responsibility to
-check this
-(using
-.Fn el_get )
-to determine if editing should be enabled or not.
-.El
-.It Fn el_get
-Get
-.Nm
-parameters.
-.Fa op
-determines which parameter to retrieve into
-.Fa result .
-.Pp
-The following values for
-.Fa op
-are supported, along with actual type of
-.Fa result :
-.Bl -tag -width 4n
-.It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)"
-Return a pointer to the function that displays the prompt.
-.It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)"
-Return a pointer to the function that displays the rightside prompt.
-.It Dv EL_EDITOR , Fa "const char *"
-Return the name of the editor, which will be one of
-.Dq emacs
-or
-.Dq vi .
-.It Dv EL_SIGNAL , Fa "int *"
-Return non-zero if
-.Nm
-has installed private signal handlers (see
-.Fn el_get
-above).
-.It Dv EL_EDITMODE, Fa "int *"
-Return non-zero if editing is enabled.
-.El
-.It Fn el_source
-Initialise
-.Nm
-by reading the contents of
-.Fa file .
-.Fn el_parse
-is called for each line in
-.Fa file .
-If
-.Fa file
-is
-.Dv NULL ,
-try
-.Pa $PWD/.editrc
-then
-.Pa $HOME/.editrc .
-Refer to
-.Xr editrc 5
-for details on the format of
-.Fa file .
-.It Fn el_resize
-Must be called if the terminal size changes.
-If
-.Dv EL_SIGNAL
-has been set with
-.Fn el_set ,
-then this is done automatically.
-Otherwise, it's the responsibility of the application to call
-.Fn el_resize
-on the appropriate occasions.
-.It Fn el_line
-Return the editing information for the current line in a
-.Fa LineInfo
-structure, which is defined as follows:
-.Bd -literal
-typedef struct lineinfo {
- const char *buffer; /* address of buffer */
- const char *cursor; /* address of cursor */
- const char *lastchar; /* address of last character */
-} LineInfo;
-.Ed
-.It Fn el_insertstr
-Insert
-.Fa str
-into the line at the cursor.
-Returns -1 if
-.Fa str
-is empty or won't fit, and 0 otherwise.
-.It Fn el_deletestr
-Delete
-.Fa num
-characters before the cursor.
-.El
-.Sh HISTORY LIST FUNCTIONS
-The history functions use a common data structure,
-.Fa History ,
-which is created by
-.Fn history_init
-and freed by
-.Fn history_end .
-.Pp
-The following functions are available:
-.Bl -tag -width 4n
-.It Fn history_init
-Initialise the history list, and return a data structure
-to be used by all other history list functions.
-.It Fn history_end
-Clean up and finish with
-.Fa h ,
-assumed to have been created with
-.Fn history_init .
-.It Fn history
-Perform operation
-.Fa op
-on the history list, with optional arguments as needed by the
-operation.
-.Fa ev
-is changed accordingly to operation.
-The following values for
-.Fa op
-are supported, along with the required argument list:
-.Bl -tag -width 4n
-.It Dv H_SETSIZE , Fa "int size"
-Set size of history to
-.Fa size
-elements.
-.It Dv H_GETSIZE
-Get number of events currently in history.
-.It Dv H_END
-Cleans up and finishes with
-.Fa h ,
-assumed to be created with
-.Fn history_init .
-.It Dv H_CLEAR
-Clear the history.
-.It Dv H_FUNC , Xo
-.Fa "void *ptr" ,
-.Fa "history_gfun_t first" ,
-.Fa "history_gfun_t next" ,
-.Fa "history_gfun_t last" ,
-.Fa "history_gfun_t prev" ,
-.Fa "history_gfun_t curr" ,
-.Fa "history_sfun_t set" ,
-.Fa "history_vfun_t clear" ,
-.Fa "history_efun_t enter" ,
-.Fa "history_efun_t add"
-.Xc
-Define functions to perform various history operations.
-.Fa ptr
-is the argument given to a function when it's invoked.
-.It Dv H_FIRST
-Return the first element in the history.
-.It Dv H_LAST
-Return the last element in the history.
-.It Dv H_PREV
-Return the previous element in the history.
-.It Dv H_NEXT
-Return the next element in the history.
-.It Dv H_CURR
-Return the current element in the history.
-.It Dv H_SET
-Set the cursor to point to the requested element.
-.It Dv H_ADD , Fa "const char *str"
-Append
-.Fa str
-to the current element of the history, or create an element with
-.It Dv H_APPEND , Fa "const char *str"
-Append
-.Fa str
-to the last new element of the history.
-.It Dv H_ENTER , Fa "const char *str"
-Add
-.Fa str
-as a new element to the history, and, if necessary,
-removing the oldest entry to keep the list to the created size.
-.It Dv H_PREV_STR , Fa "const char *str"
-Return the closest previous event that starts with
-.Fa str .
-.It Dv H_NEXT_STR , Fa "const char *str"
-Return the closest next event that starts with
-.Fa str .
-.It Dv H_PREV_EVENT , Fa "int e"
-Return the previous event numbered
-.Fa e .
-.It Dv H_NEXT_EVENT , Fa "int e"
-Return the next event numbered
-.Fa e .
-.It Dv H_LOAD , Fa "const char *file"
-Load the history list stored in
-.Fa file .
-.It Dv H_SAVE , Fa "const char *file"
-Save the history list to
-.Fa file .
-.El
-.Pp
-.Fn history
-returns 0 if the operation
-.Fa op
-succeeds. Otherwise, -1 is returned and
-.Fa ev
-is updated to contain more details about the error.
-.El
-.\"XXX.Sh EXAMPLES
-.\"XXX: provide some examples
-.Sh SEE ALSO
-.Xr editrc 5 ,
-.Xr sh 1 ,
-.Xr signal 3 ,
-.Xr termcap 3
-.Sh HISTORY
-The
-.Nm
-library first appeared in
-.Bx 4.4 .
-.Dv CC_REDISPLAY
-appeared in
-.Nx 1.3 .
-.Dv CC_REFRESH_BEEP ,
-.Dv EL_EDITMODE
-and the readline emulation appeared in
-.Nx 1.4 .
-.Dv EL_RPROMPT
-appeared in
-.Nx 1.5 .
-.Sh AUTHORS
-The
-.Nm
-library was written by Christos Zoulas.
-Luke Mewburn wrote this manual and implemented
-.Dv CC_REDISPLAY ,
-.Dv CC_REFRESH_BEEP ,
-.Dv EL_EDITMODE ,
-and
-.Dv EL_RPROMPT .
-Jaromir Dolecek implemented the readline emulation.
-.Sh BUGS
-The tokenization functions are not publically defined in
-.Fd <histedit.h>.
-.Pp
-At this time, it is the responsibility of the caller to
-check the result of the
-.Dv EL_EDITMODE
-operation of
-.Fn el_get
-(after an
-.Fn el_source
-or
-.Fn el_parse )
-to determine if
-.Nm
-should be used for further input.
-I.e.,
-.Dv EL_EDITMODE
-is purely an indication of the result of the most recent
-.Xr editrc 5
-.Ic edit
-command.
diff --git a/cmd-line-utils/libedit/editrc.5 b/cmd-line-utils/libedit/editrc.5
deleted file mode 100644
index b1122618939..00000000000
--- a/cmd-line-utils/libedit/editrc.5
+++ /dev/null
@@ -1,491 +0,0 @@
-.\" $NetBSD: editrc.5,v 1.11 2001/06/19 13:42:09 wiz Exp $
-.\"
-.\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
-.\" All rights reserved.
-.\"
-.\" This file was contributed to The NetBSD Foundation by Luke Mewburn.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the NetBSD
-.\" Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\" contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd November 8, 2000
-.Os
-.Dt EDITRC 5
-.Sh NAME
-.Nm editrc
-.Nd configuration file for editline library
-.Sh SYNOPSIS
-.Nm
-.Sh DESCRIPTION
-The
-.Nm
-file defines various settings to be used by the
-.Xr editline 3
-library.
-.Pp
-The format of each line is:
-.Dl [prog:]command [arg [...]]
-.Pp
-.Ar command
-is one of the
-.Xr editline 3
-builtin commands.
-Refer to
-.Sx BUILTIN COMMANDS
-for more information.
-.Pp
-.Ar prog
-is the program name string that a program defines when it calls
-.Xr el_init 3
-to setup
-.Xr editline 3 ,
-which is usually
-.Va argv[0] .
-.Ar command
-will be executed for any program which matches
-.Ar prog .
-.Pp
-.Ar prog
-may also be a
-.Xr regex 3
-style
-regular expression, in which case
-.Ar command
-will be executed for any program that matches the regular expression.
-.Pp
-If
-.Ar prog
-is absent,
-.Ar command
-is executed for all programs.
-.Sh BUILTIN COMMANDS
-The
-.Nm editline
-library has some builtin commands, which affect the way
-that the line editing and history functions operate.
-These are based on similar named builtins present in the
-.Xr tcsh 1
-shell.
-.Pp
-The following builtin commands are available:
-.Bl -tag -width 4n
-.It Ic bind Xo
-.Op Fl a
-.Op Fl e
-.Op Fl k
-.Op Fl l
-.Op Fl r
-.Op Fl s
-.Op Fl v
-.Op Ar key Op Ar command
-.Xc
-Without options, list all bound keys, and the editor command to which
-each is bound.
-If
-.Ar key
-is supplied, show the bindings for
-.Ar key .
-If
-.Ar key command
-is supplied, bind
-.Ar command
-to
-.Ar key .
-Options include:
-.Bl -tag -width 4n
-.It Fl e
-Bind all keys to the standard GNU Emacs-like bindings.
-.It Fl v
-Bind all keys to the standard
-.Xr vi 1 -like
-bindings.
-.It Fl a
-List or change key bindings in the
-.Xr vi 1
-mode alternate (command mode) key map.
-.It Fl k
-.Ar key
-is interpreted as a symbolic arrow key name, which may be one of
-.Sq up ,
-.Sq down ,
-.Sq left
-or
-.Sq right .
-.It Fl l
-List all editor commands and a short description of each.
-.It Fl r
-Remove a key's binding.
-.It Fl s
-.Ar command
-is taken as a literal string and treated as terminal input when
-.Ar key
-is typed.
-Bound keys in
-.Ar command
-are themselves reinterpreted, and this continues for ten levels of
-interpretation.
-.El
-.Pp
-.Ar command
-may be one of the commands documented in
-.Sx "EDITOR COMMANDS"
-below, or another key.
-.Pp
-.Ar key
-and
-.Ar command
-can contain control characters of the form
-.Sm off
-.Sq No ^ Ar character
-.Sm on
-.Po
-e.g.
-.Sq ^A
-.Pc ,
-and the following backslashed escape sequences:
-.Pp
-.Bl -tag -compact -offset indent -width 4n
-.It Ic \ea
-Bell
-.It Ic \eb
-Backspace
-.It Ic \ee
-Escape
-.It Ic \ef
-Formfeed
-.It Ic \en
-Newline
-.It Ic \er
-Carriage return
-.It Ic \et
-Horizontal tab
-.It Ic \ev
-Vertical tab
-.Sm off
-.It Sy \e Ar nnn
-.Sm on
-The ASCII character corresponding to the octal number
-.Ar nnn .
-.El
-.Pp
-.Sq \e
-nullifies the special meaning of the following character,
-if it has any, notably
-.Sq \e
-and
-.Sq ^ .
-.It Ic echotc Xo
-.Op Fl sv
-.Ar arg
-.Ar ...
-.Xc
-Exercise terminal capabilities given in
-.Ar arg Ar ... .
-If
-.Ar arg
-is
-.Sq baud ,
-.Sq cols ,
-.Sq lines ,
-.Sq rows ,
-.Sq meta or
-.Sq tabs ,
-the value of that capability is printed, with
-.Dq yes
-or
-.Dq no
-indicating that the terminal does or does not have that capability.
-.Pp
-.Fl s
-returns an emptry string for non-existent capabilities, rather than
-causing an error.
-.Fl v
-causes messages to be verbose.
-.It Ic edit Op Li on | Li off
-Enable or disable the
-.Nm editline
-functionality in a program.
-.It Ic history
-List the history.
-.It Ic telltc
-List the values of all the terminal capabilities (see
-.Xr termcap 5 ).
-.It Ic settc Ar cap Ar val
-Set the terminal capability
-.Ar cap
-to
-.Ar val ,
-as defined in
-.Xr termcap 5 .
-No sanity checking is done.
-.It Ic setty Xo
-.Op Fl a
-.Op Fl d
-.Op Fl q
-.Op Fl x
-.Op Ar +mode
-.Op Ar -mode
-.Op Ar mode
-.Xc
-Control which tty modes that
-.Nm
-won't allow the user to change.
-.Fl d ,
-.Fl q
-or
-.Fl x
-tells
-.Ic setty
-to act on the
-.Sq edit ,
-.Sq quote
-or
-.Sq execute
-set of tty modes respectively; defaulting to
-.Fl x .
-.Pp
-Without other arguments,
-.Ic setty
-lists the modes in the chosen set which are fixed on
-.Po
-.Sq +mode
-.Pc
-or off
-.Po
-.Sq -mode
-.Pc .
-.Fl a
-lists all tty modes in the chosen set regardless of the setting.
-With
-.Ar +mode ,
-.Ar -mode
-or
-.Ar mode ,
-fixes
-.Ar mode
-on or off or removes control of
-.Ar mode
-in the chosen set.
-.El
-.Sh EDITOR COMMANDS
-The following editor commands are available for use in key bindings:
-.\" Section automatically generated with makelist
-.Bl -tag -width 4n
-.It Ic vi-paste-next
-Vi paste previous deletion to the right of the cursor.
-.It Ic vi-paste-prev
-Vi paste previous deletion to the left of the cursor.
-.It Ic vi-prev-space-word
-Vi move to the previous space delimited word.
-.It Ic vi-prev-word
-Vi move to the previous word.
-.It Ic vi-next-space-word
-Vi move to the next space delimited word.
-.It Ic vi-next-word
-Vi move to the next word.
-.It Ic vi-change-case
-Vi change case of character under the cursor and advance one character.
-.It Ic vi-change-meta
-Vi change prefix command.
-.It Ic vi-insert-at-bol
-Vi enter insert mode at the beginning of line.
-.It Ic vi-replace-char
-Vi replace character under the cursor with the next character typed.
-.It Ic vi-replace-mode
-Vi enter replace mode.
-.It Ic vi-substitute-char
-Vi replace character under the cursor and enter insert mode.
-.It Ic vi-substitute-line
-Vi substitute entire line.
-.It Ic vi-change-to-eol
-Vi change to end of line.
-.It Ic vi-insert
-Vi enter insert mode.
-.It Ic vi-add
-Vi enter insert mode after the cursor.
-.It Ic vi-add-at-eol
-Vi enter insert mode at end of line.
-.It Ic vi-delete-meta
-Vi delete prefix command.
-.It Ic vi-end-word
-Vi move to the end of the current space delimited word.
-.It Ic vi-to-end-word
-Vi move to the end of the current word.
-.It Ic vi-undo
-Vi undo last change.
-.It Ic vi-command-mode
-Vi enter command mode (use alternative key bindings).
-.It Ic vi-zero
-Vi move to the beginning of line.
-.It Ic vi-delete-prev-char
-Vi move to previous character (backspace).
-.It Ic vi-list-or-eof
-Vi list choices for completion or indicate end of file if empty line.
-.It Ic vi-kill-line-prev
-Vi cut from beginning of line to cursor.
-.It Ic vi-search-prev
-Vi search history previous.
-.It Ic vi-search-next
-Vi search history next.
-.It Ic vi-repeat-search-next
-Vi repeat current search in the same search direction.
-.It Ic vi-repeat-search-prev
-Vi repeat current search in the opposite search direction.
-.It Ic vi-next-char
-Vi move to the character specified next.
-.It Ic vi-prev-char
-Vi move to the character specified previous.
-.It Ic vi-to-next-char
-Vi move up to the character specified next.
-.It Ic vi-to-prev-char
-Vi move up to the character specified previous.
-.It Ic vi-repeat-next-char
-Vi repeat current character search in the same search direction.
-.It Ic vi-repeat-prev-char
-Vi repeat current character search in the opposite search direction.
-.It Ic em-delete-or-list
-Delete character under cursor or list completions if at end of line.
-.It Ic em-delete-next-word
-Cut from cursor to end of current word.
-.It Ic em-yank
-Paste cut buffer at cursor position.
-.It Ic em-kill-line
-Cut the entire line and save in cut buffer.
-.It Ic em-kill-region
-Cut area between mark and cursor and save in cut buffer.
-.It Ic em-copy-region
-Copy area between mark and cursor to cut buffer.
-.It Ic em-gosmacs-traspose
-Exchange the two characters before the cursor.
-.It Ic em-next-word
-Move next to end of current word.
-.It Ic em-upper-case
-Uppercase the characters from cursor to end of current word.
-.It Ic em-capitol-case
-Capitalize the characters from cursor to end of current word.
-.It Ic em-lower-case
-Lowercase the characters from cursor to end of current word.
-.It Ic em-set-mark
-Set the mark at cursor.
-.It Ic em-exchange-mark
-Exchange the cursor and mark.
-.It Ic em-universal-argument
-Universal argument (argument times 4).
-.It Ic em-meta-next
-Add 8th bit to next character typed.
-.It Ic em-toggle-overwrite
-Switch from insert to overwrite mode or vice versa.
-.It Ic em-copy-prev-word
-Copy current word to cursor.
-.It Ic em-inc-search-next
-Emacs incremental next search.
-.It Ic em-inc-search-prev
-Emacs incremental reverse search.
-.It Ic ed-end-of-file
-Indicate end of file.
-.It Ic ed-insert
-Add character to the line.
-.It Ic ed-delete-prev-word
-Delete from beginning of current word to cursor.
-.It Ic ed-delete-next-char
-Delete character under cursor.
-.It Ic ed-kill-line
-Cut to the end of line.
-.It Ic ed-move-to-end
-Move cursor to the end of line.
-.It Ic ed-move-to-beg
-Move cursor to the beginning of line.
-.It Ic ed-transpose-chars
-Exchange the character to the left of the cursor with the one under it.
-.It Ic ed-next-char
-Move to the right one character.
-.It Ic ed-prev-word
-Move to the beginning of the current word.
-.It Ic ed-prev-char
-Move to the left one character.
-.It Ic ed-quoted-insert
-Add the next character typed verbatim.
-.It Ic ed-digit
-Adds to argument or enters a digit.
-.It Ic ed-argument-digit
-Digit that starts argument.
-.It Ic ed-unassigned
-Indicates unbound character.
-.It Ic ed-tty-sigint
-Tty interrupt character.
-.It Ic ed-tty-dsusp
-Tty delayed suspend character.
-.It Ic ed-tty-flush-output
-Tty flush output characters.
-.It Ic ed-tty-sigquit
-Tty quit character.
-.It Ic ed-tty-sigtstp
-Tty suspend character.
-.It Ic ed-tty-stop-output
-Tty disallow output characters.
-.It Ic ed-tty-start-output
-Tty allow output characters.
-.It Ic ed-newline
-Execute command.
-.It Ic ed-delete-prev-char
-Delete the character to the left of the cursor.
-.It Ic ed-clear-screen
-Clear screen leaving current line at the top.
-.It Ic ed-redisplay
-Redisplay everything.
-.It Ic ed-start-over
-Erase current line and start from scratch.
-.It Ic ed-sequence-lead-in
-First character in a bound sequence.
-.It Ic ed-prev-history
-Move to the previous history line.
-.It Ic ed-next-history
-Move to the next history line.
-.It Ic ed-search-prev-history
-Search previous in history for a line matching the current.
-.It Ic ed-search-next-history
-Search next in history for a line matching the current.
-.It Ic ed-prev-line
-Move up one line.
-.It Ic ed-next-line
-Move down one line.
-.It Ic ed-command
-Editline extended command.
-.El
-.\" End of section automatically generated with makelist
-.Sh SEE ALSO
-.Xr editline 3 ,
-.Xr regex 3 ,
-.Xr termcap 5
-.Sh AUTHORS
-The
-.Nm editline
-library was written by Christos Zoulas,
-and this manual was written by Luke Mewburn,
-with some sections inspired by
-.Xr tcsh 1 .
diff --git a/cmd-line-utils/libedit/el.c b/cmd-line-utils/libedit/el.c
index c32a01b2151..d99946eb68f 100644
--- a/cmd-line-utils/libedit/el.c
+++ b/cmd-line-utils/libedit/el.c
@@ -1,4 +1,4 @@
-/* $NetBSD: el.c,v 1.39 2004/07/08 00:51:36 christos Exp $ */
+/* $NetBSD: el.c,v 1.47 2009/01/18 12:17:24 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* el.c: EditLine interface functions
@@ -58,9 +64,12 @@ el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
memset(el, 0, sizeof(EditLine));
- el->el_infd = fileno(fin);
+ el->el_infile = fin;
el->el_outfile = fout;
el->el_errfile = ferr;
+
+ el->el_infd = fileno(fin);
+
if ((el->el_prog = el_strdup(prog)) == NULL) {
el_free(el);
return NULL;
@@ -126,7 +135,7 @@ el_reset(EditLine *el)
{
tty_cookedmode(el);
- ch_reset(el); /* XXX: Do we want that? */
+ ch_reset(el, 0); /* XXX: Do we want that? */
}
@@ -136,29 +145,29 @@ el_reset(EditLine *el)
public int
el_set(EditLine *el, int op, ...)
{
- va_list va;
+ va_list ap;
int rv = 0;
if (el == NULL)
return (-1);
- va_start(va, op);
+ va_start(ap, op);
switch (op) {
case EL_PROMPT:
case EL_RPROMPT:
- rv = prompt_set(el, va_arg(va, el_pfunc_t), op);
+ rv = prompt_set(el, va_arg(ap, el_pfunc_t), op);
break;
case EL_TERMINAL:
- rv = term_set(el, va_arg(va, char *));
+ rv = term_set(el, va_arg(ap, char *));
break;
case EL_EDITOR:
- rv = map_set_editor(el, va_arg(va, char *));
+ rv = map_set_editor(el, va_arg(ap, char *));
break;
case EL_SIGNAL:
- if (va_arg(va, int))
+ if (va_arg(ap, int))
el->el_flags |= HANDLE_SIGNALS;
else
el->el_flags &= ~HANDLE_SIGNALS;
@@ -167,6 +176,7 @@ el_set(EditLine *el, int op, ...)
case EL_BIND:
case EL_TELLTC:
case EL_SETTC:
+ case EL_GETTC:
case EL_ECHOTC:
case EL_SETTY:
{
@@ -174,7 +184,7 @@ el_set(EditLine *el, int op, ...)
int i;
for (i = 1; i < 20; i++)
- if ((argv[i] = va_arg(va, char *)) == NULL)
+ if ((argv[i] = va_arg(ap, char *)) == NULL)
break;
switch (op) {
@@ -213,9 +223,9 @@ el_set(EditLine *el, int op, ...)
case EL_ADDFN:
{
- char *name = va_arg(va, char *);
- char *help = va_arg(va, char *);
- el_func_t func = va_arg(va, el_func_t);
+ char *name = va_arg(ap, char *);
+ char *help = va_arg(ap, char *);
+ el_func_t func = va_arg(ap, el_func_t);
rv = map_addfunc(el, name, help, func);
break;
@@ -223,15 +233,15 @@ el_set(EditLine *el, int op, ...)
case EL_HIST:
{
- hist_fun_t func = va_arg(va, hist_fun_t);
- ptr_t ptr = va_arg(va, char *);
+ hist_fun_t func = va_arg(ap, hist_fun_t);
+ ptr_t ptr = va_arg(ap, char *);
rv = hist_set(el, func, ptr);
break;
}
case EL_EDITMODE:
- if (va_arg(va, int))
+ if (va_arg(ap, int))
el->el_flags &= ~EDIT_DISABLED;
else
el->el_flags |= EDIT_DISABLED;
@@ -240,17 +250,17 @@ el_set(EditLine *el, int op, ...)
case EL_GETCFN:
{
- el_rfunc_t rc = va_arg(va, el_rfunc_t);
+ el_rfunc_t rc = va_arg(ap, el_rfunc_t);
rv = el_read_setfn(el, rc);
break;
}
case EL_CLIENTDATA:
- el->el_data = va_arg(va, void *);
+ el->el_data = va_arg(ap, void *);
break;
case EL_UNBUFFERED:
- rv = va_arg(va, int);
+ rv = va_arg(ap, int);
if (rv && !(el->el_flags & UNBUFFERED)) {
el->el_flags |= UNBUFFERED;
read_prepare(el);
@@ -262,7 +272,7 @@ el_set(EditLine *el, int op, ...)
break;
case EL_PREP_TERM:
- rv = va_arg(va, int);
+ rv = va_arg(ap, int);
if (rv)
(void) tty_rawmode(el);
else
@@ -270,12 +280,45 @@ el_set(EditLine *el, int op, ...)
rv = 0;
break;
+ case EL_SETFP:
+ {
+ FILE *fp;
+ int what;
+
+ what = va_arg(ap, int);
+ fp = va_arg(ap, FILE *);
+
+ rv = 0;
+ switch (what) {
+ case 0:
+ el->el_infile = fp;
+ el->el_infd = fileno(fp);
+ break;
+ case 1:
+ el->el_outfile = fp;
+ break;
+ case 2:
+ el->el_errfile = fp;
+ break;
+ default:
+ rv = -1;
+ break;
+ }
+ break;
+ }
+
+ case EL_REFRESH:
+ re_clear_display(el);
+ re_refresh(el);
+ term__flush(el);
+ break;
+
default:
rv = -1;
break;
}
- va_end(va);
+ va_end(ap);
return (rv);
}
@@ -284,90 +327,71 @@ el_set(EditLine *el, int op, ...)
* retrieve the editline parameters
*/
public int
-el_get(EditLine *el, int op, void *ret)
+el_get(EditLine *el, int op, ...)
{
+ va_list ap;
int rv;
- if (el == NULL || ret == NULL)
- return (-1);
+ if (el == NULL)
+ return -1;
+
+ va_start(ap, op);
+
switch (op) {
case EL_PROMPT:
case EL_RPROMPT:
- rv = prompt_get(el, (void *) &ret, op);
+ rv = prompt_get(el, va_arg(ap, el_pfunc_t *), op);
break;
case EL_EDITOR:
- rv = map_get_editor(el, (void *) &ret);
+ rv = map_get_editor(el, va_arg(ap, const char **));
break;
case EL_SIGNAL:
- *((int *) ret) = (el->el_flags & HANDLE_SIGNALS);
+ *va_arg(ap, int *) = (el->el_flags & HANDLE_SIGNALS);
rv = 0;
break;
case EL_EDITMODE:
- *((int *) ret) = (!(el->el_flags & EDIT_DISABLED));
+ *va_arg(ap, int *) = !(el->el_flags & EDIT_DISABLED);
rv = 0;
break;
case EL_TERMINAL:
- term_get(el, (const char **)ret);
+ term_get(el, va_arg(ap, const char **));
rv = 0;
break;
-#if 0 /* XXX */
- case EL_BIND:
- case EL_TELLTC:
- case EL_SETTC:
- case EL_ECHOTC:
- case EL_SETTY:
+ case EL_GETTC:
{
- const char *argv[20];
+ static char name[] = "gettc";
+ char *argv[20];
int i;
- for (i = 1; i < sizeof(argv) / sizeof(argv[0]); i++)
- if ((argv[i] = va_arg(va, char *)) == NULL)
+ for (i = 1; i < (int)(sizeof(argv) / sizeof(argv[0])); i++)
+ if ((argv[i] = va_arg(ap, char *)) == NULL)
break;
switch (op) {
- case EL_BIND:
- argv[0] = "bind";
- rv = map_bind(el, i, argv);
- break;
-
- case EL_TELLTC:
- argv[0] = "telltc";
- rv = term_telltc(el, i, argv);
- break;
-
- case EL_SETTC:
- argv[0] = "settc";
- rv = term_settc(el, i, argv);
- break;
-
- case EL_ECHOTC:
- argv[0] = "echotc";
- rv = term_echotc(el, i, argv);
- break;
-
- case EL_SETTY:
- argv[0] = "setty";
- rv = tty_stty(el, i, argv);
+ case EL_GETTC:
+ argv[0] = name;
+ rv = term_gettc(el, i, argv);
break;
default:
rv = -1;
- EL_ABORT((el->errfile, "Bad op %d\n", op));
+ EL_ABORT((el->el_errfile, "Bad op %d\n", op));
break;
}
break;
}
+#if 0 /* XXX */
case EL_ADDFN:
{
- char *name = va_arg(va, char *);
- char *help = va_arg(va, char *);
- el_func_t func = va_arg(va, el_func_t);
+ char *name = va_arg(ap, char *);
+ char *help = va_arg(ap, char *);
+ el_func_t func = va_arg(ap, el_func_t);
rv = map_addfunc(el, name, help, func);
break;
@@ -375,31 +399,57 @@ el_get(EditLine *el, int op, void *ret)
case EL_HIST:
{
- hist_fun_t func = va_arg(va, hist_fun_t);
- ptr_t ptr = va_arg(va, char *);
+ hist_fun_t func = va_arg(ap, hist_fun_t);
+ ptr_t ptr = va_arg(ap, char *);
rv = hist_set(el, func, ptr);
}
break;
#endif /* XXX */
case EL_GETCFN:
- *((el_rfunc_t *)ret) = el_read_getfn(el);
+ *va_arg(ap, el_rfunc_t *) = el_read_getfn(el);
rv = 0;
break;
case EL_CLIENTDATA:
- *((void **)ret) = el->el_data;
+ *va_arg(ap, void **) = el->el_data;
rv = 0;
break;
case EL_UNBUFFERED:
- *((int *) ret) = (!(el->el_flags & UNBUFFERED));
+ *va_arg(ap, int *) = (!(el->el_flags & UNBUFFERED));
rv = 0;
break;
+ case EL_GETFP:
+ {
+ int what;
+ FILE **fpp;
+
+ what = va_arg(ap, int);
+ fpp = va_arg(ap, FILE **);
+ rv = 0;
+ switch (what) {
+ case 0:
+ *fpp = el->el_infile;
+ break;
+ case 1:
+ *fpp = el->el_outfile;
+ break;
+ case 2:
+ *fpp = el->el_errfile;
+ break;
+ default:
+ rv = -1;
+ break;
+ }
+ break;
+ }
default:
rv = -1;
+ break;
}
+ va_end(ap);
return (rv);
}
@@ -428,17 +478,17 @@ el_source(EditLine *el, const char *fname)
fp = NULL;
if (fname == NULL) {
+#ifdef HAVE_ISSETUGID
static const char elpath[] = "/.editrc";
+/* XXXMYSQL: Portability fix (for which platforms?) */
#ifdef MAXPATHLEN
char path[MAXPATHLEN];
#else
char path[4096];
#endif
-#ifdef HAVE_ISSETUGID
if (issetugid())
return (-1);
-#endif
if ((ptr = getenv("HOME")) == NULL)
return (-1);
if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path))
@@ -446,6 +496,14 @@ el_source(EditLine *el, const char *fname)
if (strlcat(path, elpath, sizeof(path)) >= sizeof(path))
return (-1);
fname = path;
+#else
+ /*
+ * If issetugid() is missing, always return an error, in order
+ * to keep from inadvertently opening up the user to a security
+ * hole.
+ */
+ return (-1);
+#endif
}
if (fp == NULL)
fp = fopen(fname, "r");
diff --git a/cmd-line-utils/libedit/el.h b/cmd-line-utils/libedit/el.h
index d9379d7c8aa..05d88ad88ba 100644
--- a/cmd-line-utils/libedit/el.h
+++ b/cmd-line-utils/libedit/el.h
@@ -1,4 +1,4 @@
-/* $NetBSD: el.h,v 1.16 2003/10/18 23:48:42 christos Exp $ */
+/* $NetBSD: el.h,v 1.17 2006/12/15 22:13:33 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -110,6 +110,7 @@ typedef struct el_state_t {
struct editline {
char *el_prog; /* the program name */
+ FILE *el_infile; /* Stdio stuff */
FILE *el_outfile; /* Stdio stuff */
FILE *el_errfile; /* Stdio stuff */
int el_infd; /* Input file descriptor */
@@ -136,7 +137,8 @@ struct editline {
protected int el_editmode(EditLine *, int, const char **);
-#define el_isprint(x) ((unsigned char) (x) < 0x80 ? isprint(x) : 1)
+/* XXXMYSQL: Bug#23097 mysql can't insert korean on mysql prompt. */
+#define el_isprint(x) ((unsigned char) (x) < 0x80 ? isprint(x) : 1)
#ifdef DEBUG
#define EL_ABORT(a) do { \
diff --git a/cmd-line-utils/libedit/el_term.h b/cmd-line-utils/libedit/el_term.h
index 00ca48e38e2..0e7ddd555f4 100644
--- a/cmd-line-utils/libedit/el_term.h
+++ b/cmd-line-utils/libedit/el_term.h
@@ -1,4 +1,4 @@
-/* $NetBSD: term.h,v 1.15 2003/09/14 21:48:55 christos Exp $ */
+/* $NetBSD: term.h,v 1.19 2008/09/10 15:45:37 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -81,25 +81,6 @@ typedef struct {
#define A_K_EN 5
#define A_K_NKEYS 6
-#ifdef _SUNOS
-extern int tgetent(char *, const char *);
-extern int tgetflag(char *);
-extern int tgetnum(char *);
-extern int tputs(const char *, int, int (*)(int));
-extern char* tgoto(const char*, int, int);
-extern char* tgetstr(char*, char**);
-#endif
-
-
-#if !HAVE_DECL_TGOTO
-/*
- 'tgoto' is not declared in the system header files, this causes
- problems on 64-bit systems. The function returns a 64 bit pointer
- but caller see it as "int" and it's thus truncated to 32-bit
-*/
-extern char* tgoto(const char*, int, int);
-#endif
-
protected void term_move_to_line(EditLine *, int);
protected void term_move_to_char(EditLine *, int);
protected void term_clear_EOL(EditLine *, int);
@@ -119,10 +100,12 @@ protected void term_end(EditLine *);
protected void term_get(EditLine *, const char **);
protected int term_set(EditLine *, const char *);
protected int term_settc(EditLine *, int, const char **);
+protected int term_gettc(EditLine *, int, char **);
protected int term_telltc(EditLine *, int, const char **);
protected int term_echotc(EditLine *, int, const char **);
-protected int term__putc(int);
-protected void term__flush(void);
+protected void term_writec(EditLine *, int);
+protected int term__putc(EditLine *, int);
+protected void term__flush(EditLine *);
/*
* Easy access macros
@@ -134,6 +117,7 @@ protected void term__flush(void);
#define EL_CAN_CEOL (EL_FLAGS & TERM_CAN_CEOL)
#define EL_CAN_TAB (EL_FLAGS & TERM_CAN_TAB)
#define EL_CAN_ME (EL_FLAGS & TERM_CAN_ME)
+#define EL_CAN_UP (EL_FLAGS & TERM_CAN_UP)
#define EL_HAS_META (EL_FLAGS & TERM_HAS_META)
#define EL_HAS_AUTO_MARGINS (EL_FLAGS & TERM_HAS_AUTO_MARGINS)
#define EL_HAS_MAGIC_MARGINS (EL_FLAGS & TERM_HAS_MAGIC_MARGINS)
diff --git a/cmd-line-utils/libedit/emacs.c b/cmd-line-utils/libedit/emacs.c
index 79f2bf0c818..135bd75f566 100644
--- a/cmd-line-utils/libedit/emacs.c
+++ b/cmd-line-utils/libedit/emacs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: emacs.c,v 1.19 2004/10/28 21:14:52 dsl Exp $ */
+/* $NetBSD: emacs.c,v 1.21 2006/03/06 21:11:56 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* emacs.c: Emacs functions
@@ -45,15 +51,14 @@
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_or_list(EditLine *el, int c __attribute__((__unused__)))
+em_delete_or_list(EditLine *el, int c)
{
if (el->el_line.cursor == el->el_line.lastchar) {
/* if I'm at the end */
if (el->el_line.cursor == el->el_line.buffer) {
/* and the beginning */
- term_overwrite(el, STReof, 4); /* then do a EOF */
- term__flush();
+ term_writec(el, c); /* then do an EOF */
return (CC_EOF);
} else {
/*
diff --git a/cmd-line-utils/libedit/fgetln.h b/cmd-line-utils/libedit/fgetln.h
deleted file mode 100644
index b2ddce01da9..00000000000
--- a/cmd-line-utils/libedit/fgetln.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <stdio.h>
-
-char *fgetln(FILE *stream, size_t *len);
diff --git a/cmd-line-utils/libedit/filecomplete.c b/cmd-line-utils/libedit/filecomplete.c
new file mode 100644
index 00000000000..4c63f57bc45
--- /dev/null
+++ b/cmd-line-utils/libedit/filecomplete.c
@@ -0,0 +1,558 @@
+/* $NetBSD: filecomplete.c,v 1.13 2009/01/26 17:32:41 apb Exp $ */
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* AIX requires this to be the first thing in the file. */
+#if defined (_AIX) && !defined (__GNUC__)
+ #pragma alloca
+#endif
+
+#include "config.h"
+
+/* XXXMYSQL */
+#ifdef __GNUC__
+# undef alloca
+# define alloca(n) __builtin_alloca (n)
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifndef _AIX
+extern char *alloca ();
+# endif
+# endif
+#endif
+
+#if !defined(lint) && !defined(SCCSID)
+#endif /* not lint && not SCCSID */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <dirent.h>
+#include <string.h>
+#include <pwd.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <limits.h>
+#include <errno.h>
+#include <fcntl.h>
+#ifdef HAVE_VIS_H
+#include <vis.h>
+#else
+#include "np/vis.h"
+#endif
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include "el.h"
+#include "fcns.h" /* for EL_NUM_FCNS */
+#include "histedit.h"
+#include "filecomplete.h"
+
+static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$',
+ '>', '<', '=', ';', '|', '&', '{', '(', '\0' };
+
+
+/********************************/
+/* completion functions */
+
+/*
+ * does tilde expansion of strings of type ``~user/foo''
+ * if ``user'' isn't valid user name or ``txt'' doesn't start
+ * w/ '~', returns pointer to strdup()ed copy of ``txt''
+ *
+ * it's callers's responsibility to free() returned string
+ */
+char *
+fn_tilde_expand(const char *txt)
+{
+ struct passwd pwres, *pass;
+ char *temp;
+ size_t len = 0;
+ char pwbuf[1024];
+
+ if (txt[0] != '~')
+ return (strdup(txt));
+
+ temp = strchr(txt + 1, '/');
+ if (temp == NULL) {
+ temp = strdup(txt + 1);
+ if (temp == NULL)
+ return NULL;
+ } else {
+ len = temp - txt + 1; /* text until string after slash */
+ temp = malloc(len);
+ if (temp == NULL)
+ return NULL;
+ (void)strncpy(temp, txt + 1, len - 2);
+ temp[len - 2] = '\0';
+ }
+ /* XXXMYSQL: use non-_r functions for now */
+ if (temp[0] == 0) {
+ pass = getpwuid(getuid());
+ } else {
+ pass = getpwnam(temp);
+ }
+ free(temp); /* value no more needed */
+ if (pass == NULL)
+ return (strdup(txt));
+
+ /* update pointer txt to point at string immedially following */
+ /* first slash */
+ txt += len;
+
+ temp = malloc(strlen(pass->pw_dir) + 1 + strlen(txt) + 1);
+ if (temp == NULL)
+ return NULL;
+ (void)sprintf(temp, "%s/%s", pass->pw_dir, txt);
+
+ return (temp);
+}
+
+
+/*
+ * return first found file name starting by the ``text'' or NULL if no
+ * such file can be found
+ * value of ``state'' is ignored
+ *
+ * it's caller's responsibility to free returned string
+ */
+char *
+fn_filename_completion_function(const char *text, int state)
+{
+ static DIR *dir = NULL;
+ static char *filename = NULL, *dirname = NULL, *dirpath = NULL;
+ static size_t filename_len = 0;
+ struct dirent *entry;
+ char *temp;
+ size_t len;
+
+ if (state == 0 || dir == NULL) {
+ temp = strrchr(text, '/');
+ if (temp) {
+ char *nptr;
+ temp++;
+ nptr = realloc(filename, strlen(temp) + 1);
+ if (nptr == NULL) {
+ free(filename);
+ return NULL;
+ }
+ filename = nptr;
+ (void)strcpy(filename, temp);
+ len = temp - text; /* including last slash */
+ nptr = realloc(dirname, len + 1);
+ if (nptr == NULL) {
+ free(filename);
+ return NULL;
+ }
+ dirname = nptr;
+ (void)strncpy(dirname, text, len);
+ dirname[len] = '\0';
+ } else {
+ if (*text == 0)
+ filename = NULL;
+ else {
+ filename = strdup(text);
+ if (filename == NULL)
+ return NULL;
+ }
+ dirname = NULL;
+ }
+
+ if (dir != NULL) {
+ (void)closedir(dir);
+ dir = NULL;
+ }
+
+ /* support for ``~user'' syntax */
+ free(dirpath);
+
+ if (dirname == NULL && (dirname = strdup("./")) == NULL)
+ return NULL;
+
+ if (*dirname == '~')
+ dirpath = fn_tilde_expand(dirname);
+ else
+ dirpath = strdup(dirname);
+
+ if (dirpath == NULL)
+ return NULL;
+
+ dir = opendir(dirpath);
+ if (!dir)
+ return (NULL); /* cannot open the directory */
+
+ /* will be used in cycle */
+ filename_len = filename ? strlen(filename) : 0;
+ }
+
+ /* find the match */
+ while ((entry = readdir(dir)) != NULL) {
+ /* skip . and .. */
+ if (entry->d_name[0] == '.' && (!entry->d_name[1]
+ || (entry->d_name[1] == '.' && !entry->d_name[2])))
+ continue;
+ if (filename_len == 0)
+ break;
+ /* otherwise, get first entry where first */
+ /* filename_len characters are equal */
+ if (entry->d_name[0] == filename[0]
+#if HAVE_STRUCT_DIRENT_D_NAMLEN
+ && entry->d_namlen >= filename_len
+#else
+ && strlen(entry->d_name) >= filename_len
+#endif
+ && strncmp(entry->d_name, filename,
+ filename_len) == 0)
+ break;
+ }
+
+ if (entry) { /* match found */
+
+#if HAVE_STRUCT_DIRENT_D_NAMLEN
+ len = entry->d_namlen;
+#else
+ len = strlen(entry->d_name);
+#endif
+
+ temp = malloc(strlen(dirname) + len + 1);
+ if (temp == NULL)
+ return NULL;
+ (void)sprintf(temp, "%s%s", dirname, entry->d_name);
+ } else {
+ (void)closedir(dir);
+ dir = NULL;
+ temp = NULL;
+ }
+
+ return (temp);
+}
+
+
+static const char *
+append_char_function(const char *name)
+{
+ struct stat stbuf;
+ char *expname = *name == '~' ? fn_tilde_expand(name) : NULL;
+ const char *rs = " ";
+
+ if (stat(expname ? expname : name, &stbuf) == -1)
+ goto out;
+ if (S_ISDIR(stbuf.st_mode))
+ rs = "/";
+out:
+ if (expname)
+ free(expname);
+ return rs;
+}
+/*
+ * returns list of completions for text given
+ * non-static for readline.
+ */
+char ** completion_matches(const char *, char *(*)(const char *, int));
+char **
+completion_matches(const char *text, char *(*genfunc)(const char *, int))
+{
+ char **match_list = NULL, *retstr, *prevstr;
+ size_t match_list_len, max_equal, which, i;
+ size_t matches;
+
+ matches = 0;
+ match_list_len = 1;
+ while ((retstr = (*genfunc) (text, (int)matches)) != NULL) {
+ /* allow for list terminator here */
+ if (matches + 3 >= match_list_len) {
+ char **nmatch_list;
+ while (matches + 3 >= match_list_len)
+ match_list_len <<= 1;
+ nmatch_list = realloc(match_list,
+ match_list_len * sizeof(char *));
+ if (nmatch_list == NULL) {
+ free(match_list);
+ return NULL;
+ }
+ match_list = nmatch_list;
+
+ }
+ match_list[++matches] = retstr;
+ }
+
+ if (!match_list)
+ return NULL; /* nothing found */
+
+ /* find least denominator and insert it to match_list[0] */
+ which = 2;
+ prevstr = match_list[1];
+ max_equal = strlen(prevstr);
+ for (; which <= matches; which++) {
+ for (i = 0; i < max_equal &&
+ prevstr[i] == match_list[which][i]; i++)
+ continue;
+ max_equal = i;
+ }
+
+ retstr = malloc(max_equal + 1);
+ if (retstr == NULL) {
+ free(match_list);
+ return NULL;
+ }
+ (void)strncpy(retstr, match_list[1], max_equal);
+ retstr[max_equal] = '\0';
+ match_list[0] = retstr;
+
+ /* add NULL as last pointer to the array */
+ match_list[matches + 1] = (char *) NULL;
+
+ return (match_list);
+}
+
+/*
+ * Sort function for qsort(). Just wrapper around strcasecmp().
+ */
+static int
+_fn_qsort_string_compare(const void *i1, const void *i2)
+{
+ const char *s1 = ((const char * const *)i1)[0];
+ const char *s2 = ((const char * const *)i2)[0];
+
+ return strcasecmp(s1, s2);
+}
+
+/*
+ * Display list of strings in columnar format on readline's output stream.
+ * 'matches' is list of strings, 'len' is number of strings in 'matches',
+ * 'max' is maximum length of string in 'matches'.
+ */
+void
+fn_display_match_list (EditLine *el, char **matches, int len, int max)
+{
+ int i, idx, limit, count;
+ int screenwidth = el->el_term.t_size.h;
+
+ /*
+ * Find out how many entries can be put on one line, count
+ * with two spaces between strings.
+ */
+ limit = screenwidth / (max + 2);
+ if (limit == 0)
+ limit = 1;
+
+ /* how many lines of output */
+ count = len / limit;
+ if (count * limit < len)
+ count++;
+
+ /* Sort the items if they are not already sorted. */
+ qsort(&matches[1], (size_t)(len - 1), sizeof(char *),
+ _fn_qsort_string_compare);
+
+ idx = 1;
+ for(; count > 0; count--) {
+ for(i = 0; i < limit && matches[idx]; i++, idx++)
+ (void)fprintf(el->el_outfile, "%-*s ", max,
+ matches[idx]);
+ (void)fprintf(el->el_outfile, "\n");
+ }
+}
+
+/*
+ * Complete the word at or before point,
+ * 'what_to_do' says what to do with the completion.
+ * \t means do standard completion.
+ * `?' means list the possible completions.
+ * `*' means insert all of the possible completions.
+ * `!' means to do standard completion, and list all possible completions if
+ * there is more than one.
+ *
+ * Note: '*' support is not implemented
+ * '!' could never be invoked
+ */
+int
+fn_complete(EditLine *el,
+ char *(*complet_func)(const char *, int),
+ char **(*attempted_completion_function)(const char *, int, int),
+ const char *word_break, const char *special_prefixes,
+ const char *(*app_func)(const char *), int query_items,
+ int *completion_type, int *over, int *point, int *end)
+{
+ const LineInfo *li;
+ char *temp, **matches;
+ const char *ctemp;
+ size_t len;
+ int what_to_do = '\t';
+ int retval = CC_NORM;
+
+ if (el->el_state.lastcmd == el->el_state.thiscmd)
+ what_to_do = '?';
+
+ /* readline's rl_complete() has to be told what we did... */
+ if (completion_type != NULL)
+ *completion_type = what_to_do;
+
+ if (!complet_func)
+ complet_func = fn_filename_completion_function;
+ if (!app_func)
+ app_func = append_char_function;
+
+ /* We now look backwards for the start of a filename/variable word */
+ li = el_line(el);
+ ctemp = (const char *) li->cursor;
+ while (ctemp > li->buffer
+ && !strchr(word_break, ctemp[-1])
+ && (!special_prefixes || !strchr(special_prefixes, ctemp[-1]) ) )
+ ctemp--;
+
+ len = li->cursor - ctemp;
+#if defined(__SSP__) || defined(__SSP_ALL__)
+ temp = malloc(len + 1);
+#else
+ temp = alloca(len + 1);
+#endif
+ (void)strncpy(temp, ctemp, len);
+ temp[len] = '\0';
+
+ /* these can be used by function called in completion_matches() */
+ /* or (*attempted_completion_function)() */
+ if (point != 0)
+ *point = li->cursor - li->buffer;
+ if (end != NULL)
+ *end = li->lastchar - li->buffer;
+
+ if (attempted_completion_function) {
+ int cur_off = li->cursor - li->buffer;
+ matches = (*attempted_completion_function) (temp,
+ (int)(cur_off - len), cur_off);
+ } else
+ matches = 0;
+ if (!attempted_completion_function ||
+ (over != NULL && !*over && !matches))
+ matches = completion_matches(temp, complet_func);
+
+ if (over != NULL)
+ *over = 0;
+
+ if (matches) {
+ int i;
+ int matches_num, maxlen, match_len, match_display=1;
+
+ retval = CC_REFRESH;
+ /*
+ * Only replace the completed string with common part of
+ * possible matches if there is possible completion.
+ */
+ if (matches[0][0] != '\0') {
+ el_deletestr(el, (int) len);
+ el_insertstr(el, matches[0]);
+ }
+
+ if (what_to_do == '?')
+ goto display_matches;
+
+ if (matches[2] == NULL && strcmp(matches[0], matches[1]) == 0) {
+ /*
+ * We found exact match. Add a space after
+ * it, unless we do filename completion and the
+ * object is a directory.
+ */
+ el_insertstr(el, (*app_func)(matches[0]));
+ } else if (what_to_do == '!') {
+ display_matches:
+ /*
+ * More than one match and requested to list possible
+ * matches.
+ */
+
+ for(i=1, maxlen=0; matches[i]; i++) {
+ match_len = strlen(matches[i]);
+ if (match_len > maxlen)
+ maxlen = match_len;
+ }
+ matches_num = i - 1;
+
+ /* newline to get on next line from command line */
+ (void)fprintf(el->el_outfile, "\n");
+
+ /*
+ * If there are too many items, ask user for display
+ * confirmation.
+ */
+ if (matches_num > query_items) {
+ (void)fprintf(el->el_outfile,
+ "Display all %d possibilities? (y or n) ",
+ matches_num);
+ (void)fflush(el->el_outfile);
+ if (getc(stdin) != 'y')
+ match_display = 0;
+ (void)fprintf(el->el_outfile, "\n");
+ }
+
+ if (match_display)
+ fn_display_match_list(el, matches, matches_num,
+ maxlen);
+ retval = CC_REDISPLAY;
+ } else if (matches[0][0]) {
+ /*
+ * There was some common match, but the name was
+ * not complete enough. Next tab will print possible
+ * completions.
+ */
+ el_beep(el);
+ } else {
+ /* lcd is not a valid object - further specification */
+ /* is needed */
+ el_beep(el);
+ retval = CC_NORM;
+ }
+
+ /* free elements of array and the array itself */
+ for (i = 0; matches[i]; i++)
+ free(matches[i]);
+ free(matches);
+ matches = NULL;
+ }
+#if defined(__SSP__) || defined(__SSP_ALL__)
+ free(temp);
+#endif
+ return retval;
+}
+
+/*
+ * el-compatible wrapper around rl_complete; needed for key binding
+ */
+/* ARGSUSED */
+unsigned char
+_el_fn_complete(EditLine *el, int ch __attribute__((__unused__)))
+{
+ return (unsigned char)fn_complete(el, NULL, NULL,
+ break_chars, NULL, NULL, 100,
+ NULL, NULL, NULL, NULL);
+}
diff --git a/cmd-line-utils/libedit/fgetln.c b/cmd-line-utils/libedit/filecomplete.h
index 5b95b2f6584..12e0c6f14b0 100644
--- a/cmd-line-utils/libedit/fgetln.c
+++ b/cmd-line-utils/libedit/filecomplete.h
@@ -1,11 +1,11 @@
-/* $NetBSD: fgetln.c,v 1.2 2003/12/10 01:30:27 lukem Exp $ */
+/* $NetBSD: filecomplete.h,v 1.6 2008/04/29 06:53:01 martin Exp $ */
/*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
- * by Christos Zoulas.
+ * by Jaromir Dolecek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -15,13 +15,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -35,54 +28,17 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef _FILECOMPLETE_H_
+#define _FILECOMPLETE_H_
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
+int fn_complete(EditLine *,
+ char *(*)(const char *, int),
+ char **(*)(const char *, int, int),
+ const char *, const char *, const char *(*)(const char *), int,
+ int *, int *, int *, int *);
+void fn_display_match_list(EditLine *, char **, int, int);
+char *fn_tilde_expand(const char *);
+char *fn_filename_completion_function(const char *, int);
-char *
-fgetln(FILE *fp, size_t *len)
-{
- static char *buf = NULL;
- static size_t bufsiz = 0;
- char *ptr;
-
-
- if (buf == NULL) {
- bufsiz = BUFSIZ;
- if ((buf = malloc(bufsiz)) == NULL)
- return NULL;
- }
-
- if (fgets(buf, bufsiz, fp) == NULL)
- return NULL;
- *len = 0;
-
- while ((ptr = strchr(&buf[*len], '\n')) == NULL) {
- size_t nbufsiz = bufsiz + BUFSIZ;
- char *nbuf = realloc(buf, nbufsiz);
-
- if (nbuf == NULL) {
- int oerrno = errno;
- free(buf);
- errno = oerrno;
- buf = NULL;
- return NULL;
- } else
- buf = nbuf;
-
- *len = bufsiz;
- if (fgets(&buf[bufsiz], BUFSIZ, fp) == NULL)
- return buf;
-
- bufsiz = nbufsiz;
- }
-
- *len = (ptr - buf) + 1;
- return buf;
-}
-
+#endif
diff --git a/cmd-line-utils/libedit/hist.c b/cmd-line-utils/libedit/hist.c
index e8f5c0f39ba..c0b23ee6641 100644
--- a/cmd-line-utils/libedit/hist.c
+++ b/cmd-line-utils/libedit/hist.c
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* hist.c: History access functions
diff --git a/cmd-line-utils/libedit/histedit.h b/cmd-line-utils/libedit/histedit.h
index c58eb62dcfa..37823141c06 100644
--- a/cmd-line-utils/libedit/histedit.h
+++ b/cmd-line-utils/libedit/histedit.h
@@ -1,4 +1,4 @@
-/* $NetBSD: histedit.h,v 1.25 2003/12/05 13:37:48 lukem Exp $ */
+/* $NetBSD: histedit.h,v 1.35 2009/02/05 19:15:44 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -41,11 +41,15 @@
#define _HISTEDIT_H_
#define LIBEDIT_MAJOR 2
-#define LIBEDIT_MINOR 9
+#define LIBEDIT_MINOR 11
#include <sys/types.h>
#include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* ==== Editing ====
*/
@@ -88,7 +92,7 @@ void el_reset(EditLine *);
*/
const char *el_gets(EditLine *, int *);
int el_getc(EditLine *, char *);
-void el_push(EditLine *, char *);
+void el_push(EditLine *, const char *);
/*
* Beep!
@@ -105,7 +109,8 @@ int el_parse(EditLine *, int, const char **);
* Low level editline access functions
*/
int el_set(EditLine *, int, ...);
-int el_get(EditLine *, int, void *);
+int el_get(EditLine *, int, ...);
+unsigned char _el_fn_complete(EditLine *, int);
/*
* el_set/el_get parameters
@@ -128,8 +133,12 @@ int el_get(EditLine *, int, void *);
#define EL_CLIENTDATA 14 /* , void *); */
#define EL_UNBUFFERED 15 /* , int); */
#define EL_PREP_TERM 16 /* , int); */
+#define EL_GETTC 17 /* , const char *, ..., NULL); */
+#define EL_GETFP 18 /* , int, FILE **); */
+#define EL_SETFP 19 /* , int, FILE *); */
+#define EL_REFRESH 20 /* , void); */
-#define EL_BUILTIN_GETCFN (NULL)
+#define EL_BUILTIN_GETCFN (NULL)
/*
* Source named file or $PWD/.editrc or $HOME/.editrc
@@ -192,6 +201,7 @@ int history(History *, HistEvent *, int, ...);
#define H_CLEAR 19 /* , void); */
#define H_SETUNIQUE 20 /* , int); */
#define H_GETUNIQUE 21 /* , void); */
+#define H_DEL 22 /* , int); */
/*
@@ -211,4 +221,8 @@ int tok_line(Tokenizer *, const LineInfo *,
int tok_str(Tokenizer *, const char *,
int *, const char ***);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _HISTEDIT_H_ */
diff --git a/cmd-line-utils/libedit/history.c b/cmd-line-utils/libedit/history.c
index c0fa7cc717d..3080dd231f6 100644
--- a/cmd-line-utils/libedit/history.c
+++ b/cmd-line-utils/libedit/history.c
@@ -1,4 +1,4 @@
-/* $NetBSD: history.c,v 1.28 2004/11/27 18:31:45 christos Exp $ */
+/* $NetBSD: history.c,v 1.33 2009/02/06 14:40:32 sketch Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* hist.c: History access functions
@@ -40,7 +46,11 @@
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
+#ifdef HAVE_VIS_H
#include <vis.h>
+#else
+#include "np/vis.h"
+#endif
#include <sys/stat.h>
static const char hist_cookie[] = "_HiStOrY_V2_\n";
@@ -61,6 +71,7 @@ struct history {
history_gfun_t h_prev; /* Get the previous element */
history_gfun_t h_curr; /* Get the current element */
history_sfun_t h_set; /* Set the current element */
+ history_sfun_t h_del; /* Set the given element */
history_vfun_t h_clear; /* Clear the history list */
history_efun_t h_enter; /* Add an element */
history_efun_t h_add; /* Append to an element */
@@ -75,6 +86,7 @@ struct history {
#define HCLEAR(h, ev) (*(h)->h_clear)((h)->h_ref, ev)
#define HENTER(h, ev, str) (*(h)->h_enter)((h)->h_ref, ev, str)
#define HADD(h, ev, str) (*(h)->h_add)((h)->h_ref, ev, str)
+#define HDEL(h, ev, n) (*(h)->h_del)((h)->h_ref, ev, n)
#define h_strdup(a) strdup(a)
#define h_malloc(a) malloc(a)
@@ -122,16 +134,18 @@ typedef struct history_t {
#define H_UNIQUE 1 /* Store only unique elements */
} history_t;
-private int history_def_first(ptr_t, HistEvent *);
-private int history_def_last(ptr_t, HistEvent *);
private int history_def_next(ptr_t, HistEvent *);
+private int history_def_first(ptr_t, HistEvent *);
private int history_def_prev(ptr_t, HistEvent *);
+private int history_def_last(ptr_t, HistEvent *);
private int history_def_curr(ptr_t, HistEvent *);
-private int history_def_set(ptr_t, HistEvent *, const int n);
+private int history_def_set(ptr_t, HistEvent *, const int);
+private void history_def_clear(ptr_t, HistEvent *);
private int history_def_enter(ptr_t, HistEvent *, const char *);
private int history_def_add(ptr_t, HistEvent *, const char *);
+private int history_def_del(ptr_t, HistEvent *, const int);
+
private int history_def_init(ptr_t *, HistEvent *, int);
-private void history_def_clear(ptr_t, HistEvent *);
private int history_def_insert(history_t *, HistEvent *, const char *);
private void history_def_delete(history_t *, HistEvent *, hentry_t *);
@@ -353,6 +367,24 @@ history_def_add(ptr_t p, HistEvent *ev, const char *str)
}
+/* history_def_del():
+ * Delete element hp of the h list
+ */
+/* ARGSUSED */
+private int
+history_def_del(ptr_t p, HistEvent *ev __attribute__((__unused__)),
+ const int num)
+{
+ history_t *h = (history_t *) p;
+ if (history_def_set(h, ev, num) != 0)
+ return (-1);
+ ev->str = strdup(h->cursor->ev.str);
+ ev->num = h->cursor->ev.num;
+ history_def_delete(h, ev, h->cursor);
+ return (0);
+}
+
+
/* history_def_delete():
* Delete element hp of the h list
*/
@@ -364,6 +396,8 @@ history_def_delete(history_t *h,
HistEventPrivate *evp = (void *)&hp->ev;
if (hp == &h->list)
abort();
+ if (h->cursor == hp)
+ h->cursor = hp->prev;
hp->prev->next = hp->next;
hp->next->prev = hp->prev;
h_free((ptr_t) evp->str);
@@ -497,6 +531,7 @@ history_init(void)
h->h_clear = history_def_clear;
h->h_enter = history_def_enter;
h->h_add = history_def_add;
+ h->h_del = history_def_del;
return (h);
}
@@ -512,6 +547,8 @@ history_end(History *h)
if (h->h_next == history_def_next)
history_def_clear(h->h_ref, &ev);
+ h_free(h->h_ref);
+ h_free(h);
}
@@ -597,7 +634,7 @@ history_set_fun(History *h, History *nh)
if (nh->h_first == NULL || nh->h_next == NULL || nh->h_last == NULL ||
nh->h_prev == NULL || nh->h_curr == NULL || nh->h_set == NULL ||
nh->h_enter == NULL || nh->h_add == NULL || nh->h_clear == NULL ||
- nh->h_ref == NULL) {
+ nh->h_del == NULL || nh->h_ref == NULL) {
if (h->h_next != history_def_next) {
history_def_init(&h->h_ref, &ev, 0);
h->h_first = history_def_first;
@@ -609,6 +646,7 @@ history_set_fun(History *h, History *nh)
h->h_clear = history_def_clear;
h->h_enter = history_def_enter;
h->h_add = history_def_add;
+ h->h_del = history_def_del;
}
return (-1);
}
@@ -625,6 +663,7 @@ history_set_fun(History *h, History *nh)
h->h_clear = nh->h_clear;
h->h_enter = nh->h_enter;
h->h_add = nh->h_add;
+ h->h_del = nh->h_del;
return (0);
}
@@ -676,8 +715,8 @@ history_load(History *h, const char *fname)
(void) strunvis(ptr, line);
line[sz] = c;
if (HENTER(h, &ev, ptr) == -1) {
- i = -1;
- goto oomem;
+ i = -1;
+ goto oomem;
}
}
oomem:
@@ -841,6 +880,10 @@ history(History *h, HistEvent *ev, int fun, ...)
retval = HADD(h, ev, str);
break;
+ case H_DEL:
+ retval = HDEL(h, ev, va_arg(va, const int));
+ break;
+
case H_ENTER:
str = va_arg(va, const char *);
if ((retval = HENTER(h, ev, str)) != -1)
@@ -925,6 +968,7 @@ history(History *h, HistEvent *ev, int fun, ...)
hf.h_clear = va_arg(va, history_vfun_t);
hf.h_enter = va_arg(va, history_efun_t);
hf.h_add = va_arg(va, history_efun_t);
+ hf.h_del = va_arg(va, history_sfun_t);
if ((retval = history_set_fun(h, &hf)) == -1)
he_seterrev(ev, _HE_PARAM_MISSING);
diff --git a/cmd-line-utils/libedit/key.c b/cmd-line-utils/libedit/key.c
index 35fcf0651b2..cda02816861 100644
--- a/cmd-line-utils/libedit/key.c
+++ b/cmd-line-utils/libedit/key.c
@@ -1,4 +1,4 @@
-/* $NetBSD: key.c,v 1.15 2003/10/18 23:48:42 christos Exp $ */
+/* $NetBSD: key.c,v 1.19 2006/03/23 20:22:51 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,14 +32,20 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* key.c: This module contains the procedures for maintaining
* the extended-key map.
*
* An extended-key (key) is a sequence of keystrokes introduced
- * with an sequence introducer and consisting of an arbitrary
+ * with a sequence introducer and consisting of an arbitrary
* number of characters. This module maintains a map (the el->el_key.map)
* to convert these extended-key sequences into input strs
* (XK_STR), editor functions (XK_CMD), or unix commands (XK_EXE).
@@ -78,12 +84,12 @@ private int node_trav(EditLine *, key_node_t *, char *,
private int node__try(EditLine *, key_node_t *, const char *,
key_value_t *, int);
private key_node_t *node__get(int);
+private void node__free(key_node_t *);
private void node__put(EditLine *, key_node_t *);
private int node__delete(EditLine *, key_node_t **, const char *);
private int node_lookup(EditLine *, const char *, key_node_t *,
int);
private int node_enum(EditLine *, key_node_t *, int);
-private int key__decode_char(char *, int, int);
#define KEY_BUFSIZ EL_BUFSIZ
@@ -103,7 +109,6 @@ key_init(EditLine *el)
return (0);
}
-
/* key_end():
* Free the key maps
*/
@@ -113,8 +118,7 @@ key_end(EditLine *el)
el_free((ptr_t) el->el_key.buf);
el->el_key.buf = NULL;
- /* XXX: provide a function to clear the keys */
- el->el_key.map = NULL;
+ node__free(el->el_key.map);
}
@@ -443,7 +447,7 @@ node__put(EditLine *el, key_node_t *ptr)
/* node__get():
- * Returns pointer to an key_node_t for ch.
+ * Returns pointer to a key_node_t for ch.
*/
private key_node_t *
node__get(int ch)
@@ -461,7 +465,15 @@ node__get(int ch)
return (ptr);
}
-
+private void
+node__free(key_node_t *k)
+{
+ if (k == NULL)
+ return;
+ node__free(k->sibling);
+ node__free(k->next);
+ el_free((ptr_t) k);
+}
/* node_lookup():
* look for the str starting at node ptr.
@@ -483,7 +495,7 @@ node_lookup(EditLine *el, const char *str, key_node_t *ptr, int cnt)
/* If match put this char into el->el_key.buf. Recurse */
if (ptr->ch == *str) {
/* match found */
- ncnt = key__decode_char(el->el_key.buf, cnt,
+ ncnt = key__decode_char(el->el_key.buf, KEY_BUFSIZ, cnt,
(unsigned char) ptr->ch);
if (ptr->next != NULL)
/* not yet at leaf */
@@ -537,7 +549,8 @@ node_enum(EditLine *el, key_node_t *ptr, int cnt)
return (-1);
}
/* put this char at end of str */
- ncnt = key__decode_char(el->el_key.buf, cnt, (unsigned char) ptr->ch);
+ ncnt = key__decode_char(el->el_key.buf, KEY_BUFSIZ, cnt,
+ (unsigned char)ptr->ch);
if (ptr->next == NULL) {
/* print this key and function */
el->el_key.buf[ncnt + 1] = '"';
@@ -568,9 +581,10 @@ key_kprint(EditLine *el, const char *key, key_value_t *val, int ntype)
switch (ntype) {
case XK_STR:
case XK_EXE:
- (void) fprintf(el->el_outfile, fmt, key,
- key__decode_str(val->str, unparsbuf,
- ntype == XK_STR ? "\"\"" : "[]"));
+ (void) key__decode_str(val->str, unparsbuf,
+ sizeof(unparsbuf),
+ ntype == XK_STR ? "\"\"" : "[]");
+ (void) fprintf(el->el_outfile, fmt, key, unparsbuf);
break;
case XK_CMD:
for (fp = el->el_map.help; fp->name; fp++)
@@ -595,83 +609,97 @@ key_kprint(EditLine *el, const char *key, key_value_t *val, int ntype)
}
+#define ADDC(c) \
+ if (b < eb) \
+ *b++ = c; \
+ else \
+ b++
/* key__decode_char():
* Put a printable form of char in buf.
*/
-private int
-key__decode_char(char *buf, int cnt, int ch)
+protected int
+key__decode_char(char *buf, int cnt, int off, int ch)
{
+ char *sb = buf + off;
+ char *eb = buf + cnt;
+ char *b = sb;
if (ch == 0) {
- buf[cnt++] = '^';
- buf[cnt] = '@';
- return (cnt);
+ ADDC('^');
+ ADDC('@');
+ return b - sb;
}
if (iscntrl(ch)) {
- buf[cnt++] = '^';
+ ADDC('^');
if (ch == '\177')
- buf[cnt] = '?';
+ ADDC('?');
else
- buf[cnt] = ch | 0100;
+ ADDC(ch | 0100);
} else if (ch == '^') {
- buf[cnt++] = '\\';
- buf[cnt] = '^';
+ ADDC('\\');
+ ADDC('^');
} else if (ch == '\\') {
- buf[cnt++] = '\\';
- buf[cnt] = '\\';
+ ADDC('\\');
+ ADDC('\\');
} else if (ch == ' ' || (el_isprint(ch) && !isspace(ch))) {
- buf[cnt] = ch;
+ ADDC(ch);
} else {
- buf[cnt++] = '\\';
- buf[cnt++] = (((unsigned int) ch >> 6) & 7) + '0';
- buf[cnt++] = (((unsigned int) ch >> 3) & 7) + '0';
- buf[cnt] = (ch & 7) + '0';
+ ADDC('\\');
+ ADDC((((unsigned int) ch >> 6) & 7) + '0');
+ ADDC((((unsigned int) ch >> 3) & 7) + '0');
+ ADDC((ch & 7) + '0');
}
- return (cnt);
+ return b - sb;
}
/* key__decode_str():
* Make a printable version of the ey
*/
-protected char *
-key__decode_str(const char *str, char *buf, const char *sep)
+protected int
+key__decode_str(const char *str, char *buf, int len, const char *sep)
{
- char *b;
+ char *b = buf, *eb = b + len;
const char *p;
b = buf;
- if (sep[0] != '\0')
- *b++ = sep[0];
- if (*str == 0) {
- *b++ = '^';
- *b++ = '@';
- if (sep[0] != '\0' && sep[1] != '\0')
- *b++ = sep[1];
- *b++ = 0;
- return (buf);
+ if (sep[0] != '\0') {
+ ADDC(sep[0]);
+ }
+ if (*str == '\0') {
+ ADDC('^');
+ ADDC('@');
+ if (sep[0] != '\0' && sep[1] != '\0') {
+ ADDC(sep[1]);
+ }
+ goto done;
}
for (p = str; *p != 0; p++) {
if (iscntrl((unsigned char) *p)) {
- *b++ = '^';
- if (*p == '\177')
- *b++ = '?';
- else
- *b++ = *p | 0100;
+ ADDC('^');
+ if (*p == '\177') {
+ ADDC('?');
+ } else {
+ ADDC(*p | 0100);
+ }
} else if (*p == '^' || *p == '\\') {
- *b++ = '\\';
- *b++ = *p;
+ ADDC('\\');
+ ADDC(*p);
} else if (*p == ' ' || (el_isprint((unsigned char) *p) &&
!isspace((unsigned char) *p))) {
- *b++ = *p;
+ ADDC(*p);
} else {
- *b++ = '\\';
- *b++ = (((unsigned int) *p >> 6) & 7) + '0';
- *b++ = (((unsigned int) *p >> 3) & 7) + '0';
- *b++ = (*p & 7) + '0';
+ ADDC('\\');
+ ADDC((((unsigned int) *p >> 6) & 7) + '0');
+ ADDC((((unsigned int) *p >> 3) & 7) + '0');
+ ADDC((*p & 7) + '0');
}
}
- if (sep[0] != '\0' && sep[1] != '\0')
- *b++ = sep[1];
- *b++ = 0;
- return (buf); /* should check for overflow */
+ if (sep[0] != '\0' && sep[1] != '\0') {
+ ADDC(sep[1]);
+ }
+done:
+ ADDC('\0');
+ if (b - buf >= len)
+ buf[len - 1] = '\0';
+ return b - buf;
}
diff --git a/cmd-line-utils/libedit/key.h b/cmd-line-utils/libedit/key.h
index 39a075c504e..9c6844e6d99 100644
--- a/cmd-line-utils/libedit/key.h
+++ b/cmd-line-utils/libedit/key.h
@@ -1,4 +1,4 @@
-/* $NetBSD: key.h,v 1.8 2003/08/07 16:44:32 agc Exp $ */
+/* $NetBSD: key.h,v 1.10 2006/03/23 20:22:51 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -74,6 +74,8 @@ protected int key_delete(EditLine *, const char *);
protected void key_print(EditLine *, const char *);
protected void key_kprint(EditLine *, const char *, key_value_t *,
int);
-protected char *key__decode_str(const char *, char *, const char *);
+protected int key__decode_str(const char *, char *, int,
+ const char *);
+protected int key__decode_char(char *, int, int, int);
#endif /* _h_el_key */
diff --git a/cmd-line-utils/libedit/libedit_term.h b/cmd-line-utils/libedit/libedit_term.h
deleted file mode 100644
index 9f03c549515..00000000000
--- a/cmd-line-utils/libedit/libedit_term.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $NetBSD: term.h,v 1.12 2001/01/04 15:56:32 christos Exp $ */
-
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Christos Zoulas of Cornell University.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)term.h 8.1 (Berkeley) 6/4/93
- */
-
-/*
- * el.term.h: Termcap header
- */
-#ifndef _h_el_term
-#define _h_el_term
-
-#include "histedit.h"
-
-typedef struct { /* Symbolic function key bindings */
- const char *name; /* name of the key */
- int key; /* Index in termcap table */
- key_value_t fun; /* Function bound to it */
- int type; /* Type of function */
-} fkey_t;
-
-typedef struct {
- coord_t t_size; /* # lines and cols */
- int t_flags;
-#define TERM_CAN_INSERT 0x001 /* Has insert cap */
-#define TERM_CAN_DELETE 0x002 /* Has delete cap */
-#define TERM_CAN_CEOL 0x004 /* Has CEOL cap */
-#define TERM_CAN_TAB 0x008 /* Can use tabs */
-#define TERM_CAN_ME 0x010 /* Can turn all attrs. */
-#define TERM_CAN_UP 0x020 /* Can move up */
-#define TERM_HAS_META 0x040 /* Has a meta key */
-#define TERM_HAS_AUTO_MARGINS 0x080 /* Has auto margins */
-#define TERM_HAS_MAGIC_MARGINS 0x100 /* Has magic margins */
- char *t_buf; /* Termcap buffer */
- int t_loc; /* location used */
- char **t_str; /* termcap strings */
- int *t_val; /* termcap values */
- char *t_cap; /* Termcap buffer */
- fkey_t *t_fkey; /* Array of keys */
-} el_term_t;
-
-/*
- * fKey indexes
- */
-#define A_K_DN 0
-#define A_K_UP 1
-#define A_K_LT 2
-#define A_K_RT 3
-#define A_K_HO 4
-#define A_K_EN 5
-#define A_K_NKEYS 6
-
-protected void term_move_to_line(EditLine *, int);
-protected void term_move_to_char(EditLine *, int);
-protected void term_clear_EOL(EditLine *, int);
-protected void term_overwrite(EditLine *, const char *, int);
-protected void term_insertwrite(EditLine *, char *, int);
-protected void term_deletechars(EditLine *, int);
-protected void term_clear_screen(EditLine *);
-protected void term_beep(EditLine *);
-protected int term_change_size(EditLine *, int, int);
-protected int term_get_size(EditLine *, int *, int *);
-protected int term_init(EditLine *);
-protected void term_bind_arrow(EditLine *);
-protected void term_print_arrow(EditLine *, const char *);
-protected int term_clear_arrow(EditLine *, const char *);
-protected int term_set_arrow(EditLine *, const char *, key_value_t *, int);
-protected void term_end(EditLine *);
-protected int term_set(EditLine *, const char *);
-protected int term_settc(EditLine *, int, const char **);
-protected int term_telltc(EditLine *, int, const char **);
-protected int term_echotc(EditLine *, int, const char **);
-protected int term__putc(int);
-protected void term__flush(void);
-
-/*
- * Easy access macros
- */
-#define EL_FLAGS (el)->el_term.t_flags
-
-#define EL_CAN_INSERT (EL_FLAGS & TERM_CAN_INSERT)
-#define EL_CAN_DELETE (EL_FLAGS & TERM_CAN_DELETE)
-#define EL_CAN_CEOL (EL_FLAGS & TERM_CAN_CEOL)
-#define EL_CAN_TAB (EL_FLAGS & TERM_CAN_TAB)
-#define EL_CAN_ME (EL_FLAGS & TERM_CAN_ME)
-#define EL_HAS_META (EL_FLAGS & TERM_HAS_META)
-#define EL_HAS_AUTO_MARGINS (EL_FLAGS & TERM_HAS_AUTO_MARGINS)
-#define EL_HAS_MAGIC_MARGINS (EL_FLAGS & TERM_HAS_MAGIC_MARGINS)
-
-#endif /* _h_el_term */
diff --git a/cmd-line-utils/libedit/makelist.sh b/cmd-line-utils/libedit/makelist.sh
index f15b3d1eb9f..fdd3f934e15 100644
--- a/cmd-line-utils/libedit/makelist.sh
+++ b/cmd-line-utils/libedit/makelist.sh
@@ -1,5 +1,5 @@
#!/bin/sh -
-# $NetBSD: makelist,v 1.8 2003/03/10 21:21:10 christos Exp $
+# $NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $
#
# Copyright (c) 1992, 1993
# The Regents of the University of California. All rights reserved.
@@ -15,11 +15,7 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
+# 3. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@@ -68,6 +64,7 @@ case $FLAG in
/\(\):/ {
pr = substr($2, 1, 2);
if (pr == "vi" || pr == "em" || pr == "ed") {
+ # XXXMYSQL: support CRLF
name = substr($2, 1, index($2,"(") - 1);
#
# XXX: need a space between name and prototype so that -fc and -fh
@@ -87,7 +84,7 @@ case $FLAG in
cat $FILES | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#include \"config.h\"\n#include \"el.h\"\n");
+ printf("#include \"sys.h\"\n#include \"el.h\"\n");
printf("private const struct el_bindings_t el_func_help[] = {\n");
low = "abcdefghijklmnopqrstuvwxyz_";
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
@@ -97,6 +94,7 @@ case $FLAG in
/\(\):/ {
pr = substr($2, 1, 2);
if (pr == "vi" || pr == "em" || pr == "ed") {
+ # XXXMYSQL: support CRLF
name = substr($2, 1, index($2,"(") - 1);
uname = "";
fname = "";
@@ -117,13 +115,13 @@ case $FLAG in
printf(" \"");
for (i = 2; i < NF; i++)
printf("%s ", $i);
- sub("\r", "", $i);
+ # XXXMYSQL: support CRLF
+ sub("\r", "", $i);
printf("%s\" },\n", $i);
ok = 0;
}
}
END {
- printf(" { NULL, 0, NULL }\n");
printf("};\n");
printf("\nprotected const el_bindings_t* help__get()");
printf("{ return el_func_help; }\n");
@@ -144,6 +142,7 @@ case $FLAG in
# generate fcns.h from various .h files
#
+# XXXMYSQL: use portable tr syntax
-fh)
cat $FILES | $AWK '/el_action_t/ { print $3 }' | \
sort | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | $AWK '
@@ -170,7 +169,7 @@ case $FLAG in
cat $FILES | $AWK '/el_action_t/ { print $3 }' | sort | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#include \"config.h\"\n#include \"el.h\"\n");
+ printf("#include \"sys.h\"\n#include \"el.h\"\n");
printf("private const el_func_t el_func[] = {");
maxlen = 80;
needn = 1;
@@ -220,6 +219,7 @@ case $FLAG in
/\(\):/ {
pr = substr($2, 1, 2);
if (pr == "vi" || pr == "em" || pr == "ed") {
+ # XXXMYSQL: support CRLF
name = substr($2, 1, index($2, "(") - 1);
fname = "";
for (i = 1; i <= length(name); i++) {
diff --git a/cmd-line-utils/libedit/map.c b/cmd-line-utils/libedit/map.c
index 6be9279b5e5..693b56c82ba 100644
--- a/cmd-line-utils/libedit/map.c
+++ b/cmd-line-utils/libedit/map.c
@@ -1,4 +1,4 @@
-/* $NetBSD: map.c,v 1.20 2004/08/13 12:10:39 mycroft Exp $ */
+/* $NetBSD: map.c,v 1.24 2006/04/09 01:36:51 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* map.c: Editor function definitions
@@ -1118,11 +1124,12 @@ private void
map_print_key(EditLine *el, el_action_t *map, const char *in)
{
char outbuf[EL_BUFSIZ];
- el_bindings_t *bp;
+ el_bindings_t *bp, *ep;
if (in[0] == '\0' || in[1] == '\0') {
- (void) key__decode_str(in, outbuf, "");
- for (bp = el->el_map.help; bp->name != NULL; bp++)
+ (void) key__decode_str(in, outbuf, sizeof(outbuf), "");
+ ep = &el->el_map.help[el->el_map.nfunc];
+ for (bp = el->el_map.help; bp < ep; bp++)
if (bp->func == map[(unsigned char) *in]) {
(void) fprintf(el->el_outfile,
"%s\t->\t%s\n", outbuf, bp->name);
@@ -1139,7 +1146,7 @@ map_print_key(EditLine *el, el_action_t *map, const char *in)
private void
map_print_some_keys(EditLine *el, el_action_t *map, int first, int last)
{
- el_bindings_t *bp;
+ el_bindings_t *bp, *ep;
char firstbuf[2], lastbuf[2];
char unparsbuf[EL_BUFSIZ], extrabuf[EL_BUFSIZ];
@@ -1148,39 +1155,47 @@ map_print_some_keys(EditLine *el, el_action_t *map, int first, int last)
lastbuf[0] = last;
lastbuf[1] = 0;
if (map[first] == ED_UNASSIGNED) {
- if (first == last)
+ if (first == last) {
+ (void) key__decode_str(firstbuf, unparsbuf,
+ sizeof(unparsbuf), STRQQ);
(void) fprintf(el->el_outfile,
- "%-15s-> is undefined\n",
- key__decode_str(firstbuf, unparsbuf, STRQQ));
+ "%-15s-> is undefined\n", unparsbuf);
+ }
return;
}
- for (bp = el->el_map.help; bp->name != NULL; bp++) {
+ ep = &el->el_map.help[el->el_map.nfunc];
+ for (bp = el->el_map.help; bp < ep; bp++) {
if (bp->func == map[first]) {
if (first == last) {
+ (void) key__decode_str(firstbuf, unparsbuf,
+ sizeof(unparsbuf), STRQQ);
(void) fprintf(el->el_outfile, "%-15s-> %s\n",
- key__decode_str(firstbuf, unparsbuf, STRQQ),
- bp->name);
+ unparsbuf, bp->name);
} else {
+ (void) key__decode_str(firstbuf, unparsbuf,
+ sizeof(unparsbuf), STRQQ);
+ (void) key__decode_str(lastbuf, extrabuf,
+ sizeof(extrabuf), STRQQ);
(void) fprintf(el->el_outfile,
"%-4s to %-7s-> %s\n",
- key__decode_str(firstbuf, unparsbuf, STRQQ),
- key__decode_str(lastbuf, extrabuf, STRQQ),
- bp->name);
+ unparsbuf, extrabuf, bp->name);
}
return;
}
}
#ifdef MAP_DEBUG
if (map == el->el_map.key) {
+ (void) key__decode_str(firstbuf, unparsbuf,
+ sizeof(unparsbuf), STRQQ);
(void) fprintf(el->el_outfile,
- "BUG!!! %s isn't bound to anything.\n",
- key__decode_str(firstbuf, unparsbuf, STRQQ));
+ "BUG!!! %s isn't bound to anything.\n", unparsbuf);
(void) fprintf(el->el_outfile, "el->el_map.key[%d] == %d\n",
first, el->el_map.key[first]);
} else {
+ (void) key__decode_str(firstbuf, unparsbuf,
+ sizeof(unparsbuf), STRQQ);
(void) fprintf(el->el_outfile,
- "BUG!!! %s isn't bound to anything.\n",
- key__decode_str(firstbuf, unparsbuf, STRQQ));
+ "BUG!!! %s isn't bound to anything.\n", unparsbuf);
(void) fprintf(el->el_outfile, "el->el_map.alt[%d] == %d\n",
first, el->el_map.alt[first]);
}
@@ -1237,7 +1252,7 @@ map_bind(EditLine *el, int argc, const char **argv)
char outbuf[EL_BUFSIZ];
const char *in = NULL;
char *out = NULL;
- el_bindings_t *bp;
+ el_bindings_t *bp, *ep;
int cmd;
int key;
@@ -1279,8 +1294,8 @@ map_bind(EditLine *el, int argc, const char **argv)
return (0);
case 'l':
- for (bp = el->el_map.help; bp->name != NULL;
- bp++)
+ ep = &el->el_map.help[el->el_map.nfunc];
+ for (bp = el->el_map.help; bp < ep; bp++)
(void) fprintf(el->el_outfile,
"%s\n\t%s\n",
bp->name, bp->description);
@@ -1367,7 +1382,7 @@ map_bind(EditLine *el, int argc, const char **argv)
break;
default:
- EL_ABORT((el->el_errfile, "Bad XK_ type\n", ntype));
+ EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ntype));
break;
}
return (0);
@@ -1381,7 +1396,7 @@ protected int
map_addfunc(EditLine *el, const char *name, const char *help, el_func_t func)
{
void *p;
- int nf = el->el_map.nfunc + 2;
+ int nf = el->el_map.nfunc + 1;
if (name == NULL || help == NULL || func == NULL)
return (-1);
@@ -1400,7 +1415,6 @@ map_addfunc(EditLine *el, const char *name, const char *help, el_func_t func)
el->el_map.help[nf].name = name;
el->el_map.help[nf].func = nf;
el->el_map.help[nf].description = help;
- el->el_map.help[++nf].name = NULL;
el->el_map.nfunc++;
return (0);
diff --git a/cmd-line-utils/libedit/np/fgetln.c b/cmd-line-utils/libedit/np/fgetln.c
index 93da9914dc8..898abc758dc 100644
--- a/cmd-line-utils/libedit/np/fgetln.c
+++ b/cmd-line-utils/libedit/np/fgetln.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fgetln.c,v 1.1.1.1 1999/04/12 07:43:21 crooksa Exp $ */
+/* $NetBSD: fgetln.c,v 1.9 2008/04/29 06:53:03 martin Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -15,13 +15,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -36,17 +29,24 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#else
#include "config.h"
-#include <stdio.h>
+#endif
+
+#if !HAVE_FGETLN
#include <stdlib.h>
+#ifndef HAVE_NBTOOL_CONFIG_H
+/* These headers are required, but included from nbtool_config.h */
+#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
+#endif
char *
-fgetln(fp, len)
- FILE *fp;
- size_t *len;
+fgetln(FILE *fp, size_t *len)
{
static char *buf = NULL;
static size_t bufsiz = 0;
@@ -61,8 +61,8 @@ fgetln(fp, len)
if (fgets(buf, bufsiz, fp) == NULL)
return NULL;
- *len = 0;
+ *len = 0;
while ((ptr = strchr(&buf[*len], '\n')) == NULL) {
size_t nbufsiz = bufsiz + BUFSIZ;
char *nbuf = realloc(buf, nbufsiz);
@@ -76,13 +76,33 @@ fgetln(fp, len)
} else
buf = nbuf;
- *len = bufsiz;
- if (fgets(&buf[bufsiz], BUFSIZ, fp) == NULL)
+ if (fgets(&buf[bufsiz], BUFSIZ, fp) == NULL) {
+ buf[bufsiz] = '\0';
+ *len = strlen(buf);
return buf;
+ }
+ *len = bufsiz;
bufsiz = nbufsiz;
}
*len = (ptr - buf) + 1;
return buf;
}
+
+#endif
+
+#ifdef TEST
+int
+main(int argc, char *argv[])
+{
+ char *p;
+ size_t len;
+
+ while ((p = fgetln(stdin, &len)) != NULL) {
+ (void)printf("%zu %s", len, p);
+ free(p);
+ }
+ return 0;
+}
+#endif
diff --git a/cmd-line-utils/libedit/np/strlcat.c b/cmd-line-utils/libedit/np/strlcat.c
index 6c9f1e92d79..4e2897d8f35 100644
--- a/cmd-line-utils/libedit/np/strlcat.c
+++ b/cmd-line-utils/libedit/np/strlcat.c
@@ -1,59 +1,68 @@
+/* $NetBSD: strlcat.c,v 1.3 2007/06/04 18:19:27 christos Exp $ */
+/* $OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp $ */
+
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- * All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
+ * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#if !defined(_KERNEL) && !defined(_STANDALONE)
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#else
#include "config.h"
+#endif
+
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $";
#endif /* LIBC_SCCS and not lint */
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD: src/lib/libc/string/strlcat.c,v 1.2.4.2 2001/07/09 23:30:06 obrien Exp $";
-#endif
+#ifdef _LIBC
+#include "namespace.h"
+#endif
#include <sys/types.h>
+#include <assert.h>
#include <string.h>
+#ifdef _LIBC
+# ifdef __weak_alias
+__weak_alias(strlcat, _strlcat)
+# endif
+#endif
+
+#else
+#include <lib/libkern/libkern.h>
+#endif /* !_KERNEL && !_STANDALONE */
+
+#if !HAVE_STRLCAT
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(initial dst) + strlen(src); if retval >= siz,
- * truncation occurred.
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
*/
-size_t strlcat(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
+size_t
+strlcat(char *dst, const char *src, size_t siz)
{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
+ char *d = dst;
+ const char *s = src;
+ size_t n = siz;
size_t dlen;
+ _DIAGASSERT(dst != NULL);
+ _DIAGASSERT(src != NULL);
+
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
d++;
@@ -73,3 +82,4 @@ size_t strlcat(dst, src, siz)
return(dlen + (s - src)); /* count does not include NUL */
}
+#endif
diff --git a/cmd-line-utils/libedit/np/strlcpy.c b/cmd-line-utils/libedit/np/strlcpy.c
index 1f154bcf2ea..092a9757c0f 100644
--- a/cmd-line-utils/libedit/np/strlcpy.c
+++ b/cmd-line-utils/libedit/np/strlcpy.c
@@ -1,59 +1,63 @@
-/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */
+/* $NetBSD: strlcpy.c,v 1.3 2007/06/04 18:19:27 christos Exp $ */
+/* $OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- * All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
+ * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#if !defined(_KERNEL) && !defined(_STANDALONE)
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#else
#include "config.h"
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $";
#endif
+#if defined(LIBC_SCCS) && !defined(lint)
#endif /* LIBC_SCCS and not lint */
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD: src/lib/libc/string/strlcpy.c,v 1.2.4.1 2001/07/09 23:30:06 obrien Exp $";
-#endif
+#ifdef _LIBC
+#include "namespace.h"
+#endif
#include <sys/types.h>
+#include <assert.h>
#include <string.h>
+#ifdef _LIBC
+# ifdef __weak_alias
+__weak_alias(strlcpy, _strlcpy)
+# endif
+#endif
+#else
+#include <lib/libkern/libkern.h>
+#endif /* !_KERNEL && !_STANDALONE */
+
+
+#if !HAVE_STRLCPY
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
-size_t strlcpy(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
+size_t
+strlcpy(char *dst, const char *src, size_t siz)
{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
+ char *d = dst;
+ const char *s = src;
+ size_t n = siz;
+
+ _DIAGASSERT(dst != NULL);
+ _DIAGASSERT(src != NULL);
/* Copy as many bytes as will fit */
if (n != 0 && --n != 0) {
@@ -73,3 +77,4 @@ size_t strlcpy(dst, src, siz)
return(s - src - 1); /* count does not include NUL */
}
+#endif
diff --git a/cmd-line-utils/libedit/np/unvis.c b/cmd-line-utils/libedit/np/unvis.c
index 895ff2059ac..3c37c231ceb 100644
--- a/cmd-line-utils/libedit/np/unvis.c
+++ b/cmd-line-utils/libedit/np/unvis.c
@@ -1,4 +1,4 @@
-/* $NetBSD: unvis.c,v 1.22 2002/03/23 17:38:27 christos Exp $ */
+/* $NetBSD: unvis.c,v 1.28 2005/09/13 01:44:09 christos Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -12,11 +12,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -34,34 +30,30 @@
*/
#include "config.h"
+
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: unvis.c,v 1.22 2002/03/23 17:38:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
-#define __LIBC12_SOURCE__
-
#include <sys/types.h>
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
+#ifdef HAVE_VIS_H
+#include <vis.h>
+#else
#include "np/vis.h"
+#endif
#ifdef __weak_alias
__weak_alias(strunvis,_strunvis)
-__weak_alias(unvis,_unvis)
#endif
-#ifdef __warn_references
-__warn_references(unvis,
- "warning: reference to compatibility unvis(); include <vis.h> for correct reference")
-#endif
-
-#if !HAVE_VIS_H
+#if !HAVE_VIS
/*
* decode driven by state machine
*/
@@ -72,30 +64,22 @@ __warn_references(unvis,
#define S_CTRL 4 /* control char started (^) */
#define S_OCTAL2 5 /* octal digit 2 */
#define S_OCTAL3 6 /* octal digit 3 */
-#define S_HEX1 7 /* hex digit */
-#define S_HEX2 8 /* hex digit 2 */
+#define S_HEX1 7 /* hex digit */
+#define S_HEX2 8 /* hex digit 2 */
#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
#define xtod(c) (isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10))
-int
-unvis(cp, c, astate, flag)
- char *cp;
- int c;
- int *astate, flag;
-{
- return __unvis13(cp, (int)c, astate, flag);
-}
-
/*
* unvis - decode characters previously encoded by vis
*/
int
-__unvis13(cp, c, astate, flag)
+unvis(cp, c, astate, flag)
char *cp;
int c;
int *astate, flag;
{
+ unsigned char uc = (unsigned char)c;
_DIAGASSERT(cp != NULL);
_DIAGASSERT(astate != NULL);
@@ -105,7 +89,7 @@ __unvis13(cp, c, astate, flag)
|| *astate == S_HEX2) {
*astate = S_GROUND;
return (UNVIS_VALID);
- }
+ }
return (*astate == S_GROUND ? UNVIS_NOCHAR : UNVIS_SYNBAD);
}
@@ -116,7 +100,7 @@ __unvis13(cp, c, astate, flag)
if (c == '\\') {
*astate = S_START;
return (0);
- }
+ }
if ((flag & VIS_HTTPSTYLE) && c == '%') {
*astate = S_HEX1;
return (0);
@@ -193,7 +177,7 @@ __unvis13(cp, c, astate, flag)
}
*astate = S_GROUND;
return (UNVIS_SYNBAD);
-
+
case S_META:
if (c == '-')
*astate = S_META1;
@@ -204,12 +188,12 @@ __unvis13(cp, c, astate, flag)
return (UNVIS_SYNBAD);
}
return (0);
-
+
case S_META1:
*astate = S_GROUND;
*cp |= c;
return (UNVIS_VALID);
-
+
case S_CTRL:
if (c == '?')
*cp |= 0177;
@@ -219,23 +203,23 @@ __unvis13(cp, c, astate, flag)
return (UNVIS_VALID);
case S_OCTAL2: /* second possible octal digit */
- if (isoctal(c)) {
- /*
- * yes - and maybe a third
+ if (isoctal(uc)) {
+ /*
+ * yes - and maybe a third
*/
*cp = (*cp << 3) + (c - '0');
- *astate = S_OCTAL3;
+ *astate = S_OCTAL3;
return (0);
- }
- /*
- * no - done with current sequence, push back passed char
+ }
+ /*
+ * no - done with current sequence, push back passed char
*/
*astate = S_GROUND;
return (UNVIS_VALIDPUSH);
case S_OCTAL3: /* third possible octal digit */
*astate = S_GROUND;
- if (isoctal(c)) {
+ if (isoctal(uc)) {
*cp = (*cp << 3) + (c - '0');
return (UNVIS_VALID);
}
@@ -243,27 +227,30 @@ __unvis13(cp, c, astate, flag)
* we were done, push back passed char
*/
return (UNVIS_VALIDPUSH);
+
case S_HEX1:
- if (isxdigit(c)) {
- *cp = xtod(c);
+ if (isxdigit(uc)) {
+ *cp = xtod(uc);
*astate = S_HEX2;
return (0);
}
- /*
- * no - done with current sequence, push back passed char
+ /*
+ * no - done with current sequence, push back passed char
*/
*astate = S_GROUND;
return (UNVIS_VALIDPUSH);
+
case S_HEX2:
- *astate = S_GROUND;
- if (isxdigit(c)) {
- *cp = xtod(c) | (*cp << 4);
+ *astate = S_GROUND;
+ if (isxdigit(uc)) {
+ *cp = xtod(uc) | (*cp << 4);
return (UNVIS_VALID);
}
- return (UNVIS_VALIDPUSH);
- default:
- /*
- * decoder in unknown state - (probably uninitialized)
+ return (UNVIS_VALIDPUSH);
+
+ default:
+ /*
+ * decoder in unknown state - (probably uninitialized)
*/
*astate = S_GROUND;
return (UNVIS_SYNBAD);
@@ -271,7 +258,7 @@ __unvis13(cp, c, astate, flag)
}
/*
- * strunvis - decode src into dst
+ * strunvis - decode src into dst
*
* Number of chars decoded into dst is returned, -1 on error.
* Dst is null terminated.
@@ -291,8 +278,8 @@ strunvisx(dst, src, flag)
_DIAGASSERT(dst != NULL);
while ((c = *src++) != '\0') {
- again:
- switch (__unvis13(dst, c, &state, flag)) {
+ again:
+ switch (unvis(dst, c, &state, flag)) {
case UNVIS_VALID:
dst++;
break;
@@ -306,7 +293,7 @@ strunvisx(dst, src, flag)
return (-1);
}
}
- if (__unvis13(dst, c, &state, UNVIS_END) == UNVIS_VALID)
+ if (unvis(dst, c, &state, UNVIS_END) == UNVIS_VALID)
dst++;
*dst = '\0';
return (dst - start);
diff --git a/cmd-line-utils/libedit/np/vis.c b/cmd-line-utils/libedit/np/vis.c
index e8f5c195f10..2a746274681 100644
--- a/cmd-line-utils/libedit/np/vis.c
+++ b/cmd-line-utils/libedit/np/vis.c
@@ -1,7 +1,6 @@
-/* $NetBSD: vis.c,v 1.22 2002/03/23 17:38:27 christos Exp $ */
+/* $NetBSD: vis.c,v 1.38 2008/09/04 09:41:44 lukem Exp $ */
/*-
- * Copyright (c) 1999 The NetBSD Foundation, Inc.
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -13,11 +12,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -34,21 +29,47 @@
* SUCH DAMAGE.
*/
+/*-
+ * Copyright (c) 1999, 2005 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
#include "config.h"
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.22 2002/03/23 17:38:27 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
+
#include <assert.h>
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
+#ifdef HAVE_VIS_H
+#include <vis.h>
+#else
+#include "np/vis.h"
#endif
#include <stdlib.h>
-#include "np/vis.h"
-
#ifdef __weak_alias
__weak_alias(strsvis,_strsvis)
__weak_alias(strsvisx,_strsvisx)
@@ -58,63 +79,61 @@ __weak_alias(svis,_svis)
__weak_alias(vis,_vis)
#endif
-#if !HAVE_VIS_H
+#if !HAVE_VIS || !HAVE_SVIS
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
+
+static char *do_svis(char *, int, int, int, const char *);
+
#undef BELL
-#if defined(__STDC__)
#define BELL '\a'
-#else
-#define BELL '\007'
-#endif
-#define isoctal(c) (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')
+#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
#define iswhite(c) (c == ' ' || c == '\t' || c == '\n')
#define issafe(c) (c == '\b' || c == BELL || c == '\r')
#define xtoa(c) "0123456789abcdef"[c]
-#define MAXEXTRAS 5
-
-
-char *MAKEEXTRALIST(unsigned int flag, const char *orig)
-{
- const char *o = orig;
- char *e, *extra;
- while (*o++)
- continue;
- extra = (char*) malloc((size_t)((o - orig) + MAXEXTRAS));
- assert(extra);
- for (o = orig, e = extra; (*e++ = *o++) != '\0';)
- continue;
- e--;
- if (flag & VIS_SP) *e++ = ' ';
- if (flag & VIS_TAB) *e++ = '\t';
- if (flag & VIS_NL) *e++ = '\n';
- if ((flag & VIS_NOSLASH) == 0) *e++ = '\\';
- *e = '\0';
- return extra;
-}
+#define MAXEXTRAS 5
+#define MAKEEXTRALIST(flag, extra, orig_str) \
+do { \
+ const char *orig = orig_str; \
+ const char *o = orig; \
+ char *e; \
+ while (*o++) \
+ continue; \
+ extra = malloc((size_t)((o - orig) + MAXEXTRAS)); \
+ if (!extra) break; \
+ for (o = orig, e = extra; (*e++ = *o++) != '\0';) \
+ continue; \
+ e--; \
+ if (flag & VIS_SP) *e++ = ' '; \
+ if (flag & VIS_TAB) *e++ = '\t'; \
+ if (flag & VIS_NL) *e++ = '\n'; \
+ if ((flag & VIS_NOSLASH) == 0) *e++ = '\\'; \
+ *e = '\0'; \
+} while (/*CONSTCOND*/0)
/*
- * This is HVIS, the macro of vis used to HTTP style (RFC 1808)
+ * This is do_hvis, for HTTP style (RFC 1808)
*/
-#define HVIS(dst, c, flag, nextc, extra) \
-do \
- if (!isascii(c) || !isalnum(c) || strchr("$-_.+!*'(),", c) != NULL) { \
- *dst++ = '%'; \
- *dst++ = xtoa(((unsigned int)c >> 4) & 0xf); \
- *dst++ = xtoa((unsigned int)c & 0xf); \
- } else { \
- SVIS(dst, c, flag, nextc, extra); \
- } \
-while (/*CONSTCOND*/0)
-
+static char *
+do_hvis(char *dst, int c, int flag, int nextc, const char *extra)
+{
+ if (!isascii(c) || !isalnum(c) || strchr("$-_.+!*'(),", c) != NULL) {
+ *dst++ = '%';
+ *dst++ = xtoa(((unsigned int)c >> 4) & 0xf);
+ *dst++ = xtoa((unsigned int)c & 0xf);
+ } else {
+ dst = do_svis(dst, c, flag, nextc, extra);
+ }
+ return dst;
+}
+
/*
- * This is SVIS, the central macro of vis.
+ * This is do_vis, the central code of vis.
* dst: Pointer to the destination buffer
* c: Character to encode
* flag: Flag word
@@ -122,95 +141,103 @@ while (/*CONSTCOND*/0)
* extra: Pointer to the list of extra characters to be
* backslash-protected.
*/
-#define SVIS(dst, c, flag, nextc, extra) \
-do { \
- int isextra, isc; \
- isextra = strchr(extra, c) != NULL; \
- if (!isextra && isascii(c) && (isgraph(c) || iswhite(c) || \
- ((flag & VIS_SAFE) && issafe(c)))) { \
- *dst++ = c; \
- break; \
- } \
- isc = 0; \
- if (flag & VIS_CSTYLE) { \
- switch (c) { \
- case '\n': \
- isc = 1; *dst++ = '\\'; *dst++ = 'n'; \
- break; \
- case '\r': \
- isc = 1; *dst++ = '\\'; *dst++ = 'r'; \
- break; \
- case '\b': \
- isc = 1; *dst++ = '\\'; *dst++ = 'b'; \
- break; \
- case BELL: \
- isc = 1; *dst++ = '\\'; *dst++ = 'a'; \
- break; \
- case '\v': \
- isc = 1; *dst++ = '\\'; *dst++ = 'v'; \
- break; \
- case '\t': \
- isc = 1; *dst++ = '\\'; *dst++ = 't'; \
- break; \
- case '\f': \
- isc = 1; *dst++ = '\\'; *dst++ = 'f'; \
- break; \
- case ' ': \
- isc = 1; *dst++ = '\\'; *dst++ = 's'; \
- break; \
- case '\0': \
- isc = 1; *dst++ = '\\'; *dst++ = '0'; \
- if (isoctal(nextc)) { \
- *dst++ = '0'; \
- *dst++ = '0'; \
- } \
- } \
- } \
- if (isc) break; \
- if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { \
- *dst++ = '\\'; \
- *dst++ = (unsigned char)(((unsigned int)(unsigned char)c >> 6) & 03) + '0'; \
- *dst++ = (unsigned char)(((unsigned int)(unsigned char)c >> 3) & 07) + '0'; \
- *dst++ = (c & 07) + '0'; \
- } else { \
- if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\'; \
- if (c & 0200) { \
- c &= 0177; *dst++ = 'M'; \
- } \
- if (iscntrl(c)) { \
- *dst++ = '^'; \
- if (c == 0177) \
- *dst++ = '?'; \
- else \
- *dst++ = c + '@'; \
- } else { \
- *dst++ = '-'; *dst++ = c; \
- } \
- } \
-} while (/*CONSTCOND*/0)
+static char *
+do_svis(char *dst, int c, int flag, int nextc, const char *extra)
+{
+ int isextra;
+ isextra = strchr(extra, c) != NULL;
+ if (!isextra && isascii(c) && (isgraph(c) || iswhite(c) ||
+ ((flag & VIS_SAFE) && issafe(c)))) {
+ *dst++ = c;
+ return dst;
+ }
+ if (flag & VIS_CSTYLE) {
+ switch (c) {
+ case '\n':
+ *dst++ = '\\'; *dst++ = 'n';
+ return dst;
+ case '\r':
+ *dst++ = '\\'; *dst++ = 'r';
+ return dst;
+ case '\b':
+ *dst++ = '\\'; *dst++ = 'b';
+ return dst;
+ case BELL:
+ *dst++ = '\\'; *dst++ = 'a';
+ return dst;
+ case '\v':
+ *dst++ = '\\'; *dst++ = 'v';
+ return dst;
+ case '\t':
+ *dst++ = '\\'; *dst++ = 't';
+ return dst;
+ case '\f':
+ *dst++ = '\\'; *dst++ = 'f';
+ return dst;
+ case ' ':
+ *dst++ = '\\'; *dst++ = 's';
+ return dst;
+ case '\0':
+ *dst++ = '\\'; *dst++ = '0';
+ if (isoctal(nextc)) {
+ *dst++ = '0';
+ *dst++ = '0';
+ }
+ return dst;
+ default:
+ if (isgraph(c)) {
+ *dst++ = '\\'; *dst++ = c;
+ return dst;
+ }
+ }
+ }
+ if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) {
+ *dst++ = '\\';
+ *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0';
+ *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0';
+ *dst++ = (c & 07) + '0';
+ } else {
+ if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\';
+ if (c & 0200) {
+ c &= 0177; *dst++ = 'M';
+ }
+ if (iscntrl(c)) {
+ *dst++ = '^';
+ if (c == 0177)
+ *dst++ = '?';
+ else
+ *dst++ = c + '@';
+ } else {
+ *dst++ = '-'; *dst++ = c;
+ }
+ }
+ return dst;
+}
/*
* svis - visually encode characters, also encoding the characters
- * pointed to by `extra'
+ * pointed to by `extra'
*/
char *
-svis(dst, c, flag, nextc, extra)
- char *dst;
- int c, flag, nextc;
- const char *extra;
+svis(char *dst, int c, int flag, int nextc, const char *extra)
{
- char *nextra, *to_be_freed;
+ char *nextra = NULL;
+
_DIAGASSERT(dst != NULL);
_DIAGASSERT(extra != NULL);
- nextra= to_be_freed= MAKEEXTRALIST(flag, extra);
+ MAKEEXTRALIST(flag, nextra, extra);
+ if (!nextra) {
+ *dst = '\0'; /* can't create nextra, return "" */
+ return dst;
+ }
if (flag & VIS_HTTPSTYLE)
- HVIS(dst, c, flag, nextc, nextra);
+ dst = do_hvis(dst, c, flag, nextc, nextra);
else
- SVIS(dst, c, flag, nextc, nextra);
+ dst = do_svis(dst, c, flag, nextc, nextra);
+ free(nextra);
*dst = '\0';
- free(to_be_freed);
- return(dst);
+ return dst;
}
@@ -221,140 +248,146 @@ svis(dst, c, flag, nextc, extra)
* be encoded, too. These functions are useful e. g. to
* encode strings in such a way so that they are not interpreted
* by a shell.
- *
+ *
* Dst must be 4 times the size of src to account for possible
* expansion. The length of dst, not including the trailing NULL,
- * is returned.
+ * is returned.
*
* Strsvisx encodes exactly len bytes from src into dst.
* This is useful for encoding a block of data.
*/
int
-strsvis(dst, src, flag, extra)
- char *dst;
- const char *src;
- int flag;
- const char *extra;
+strsvis(char *dst, const char *csrc, int flag, const char *extra)
{
- char c;
+ int c;
char *start;
- char *nextra, *to_be_freed;
+ char *nextra = NULL;
+ const unsigned char *src = (const unsigned char *)csrc;
_DIAGASSERT(dst != NULL);
_DIAGASSERT(src != NULL);
_DIAGASSERT(extra != NULL);
- nextra= to_be_freed= MAKEEXTRALIST(flag, extra);
+ MAKEEXTRALIST(flag, nextra, extra);
+ if (!nextra) {
+ *dst = '\0'; /* can't create nextra, return "" */
+ return 0;
+ }
if (flag & VIS_HTTPSTYLE) {
for (start = dst; (c = *src++) != '\0'; /* empty */)
- HVIS(dst, c, flag, *src, nextra);
+ dst = do_hvis(dst, c, flag, *src, nextra);
} else {
for (start = dst; (c = *src++) != '\0'; /* empty */)
- SVIS(dst, c, flag, *src, nextra);
+ dst = do_svis(dst, c, flag, *src, nextra);
}
+ free(nextra);
*dst = '\0';
- free(to_be_freed);
return (dst - start);
}
int
-strsvisx(dst, src, len, flag, extra)
- char *dst;
- const char *src;
- size_t len;
- int flag;
- const char *extra;
+strsvisx(char *dst, const char *csrc, size_t len, int flag, const char *extra)
{
- char c;
+ unsigned char c;
char *start;
- char *nextra, *to_be_freed;
+ char *nextra = NULL;
+ const unsigned char *src = (const unsigned char *)csrc;
_DIAGASSERT(dst != NULL);
_DIAGASSERT(src != NULL);
_DIAGASSERT(extra != NULL);
- nextra= to_be_freed= MAKEEXTRALIST(flag, extra);
+ MAKEEXTRALIST(flag, nextra, extra);
+ if (! nextra) {
+ *dst = '\0'; /* can't create nextra, return "" */
+ return 0;
+ }
if (flag & VIS_HTTPSTYLE) {
for (start = dst; len > 0; len--) {
c = *src++;
- HVIS(dst, c, flag, len ? *src : '\0', nextra);
+ dst = do_hvis(dst, c, flag,
+ len > 1 ? *src : '\0', nextra);
}
} else {
for (start = dst; len > 0; len--) {
c = *src++;
- SVIS(dst, c, flag, len ? *src : '\0', nextra);
+ dst = do_svis(dst, c, flag,
+ len > 1 ? *src : '\0', nextra);
}
}
+ free(nextra);
*dst = '\0';
- free(to_be_freed);
return (dst - start);
}
+#endif
-
+#if !HAVE_VIS
/*
* vis - visually encode characters
*/
char *
-vis(dst, c, flag, nextc)
- char *dst;
- int c, flag, nextc;
-
+vis(char *dst, int c, int flag, int nextc)
{
- char *extra, *to_be_freed;
+ char *extra = NULL;
+ unsigned char uc = (unsigned char)c;
_DIAGASSERT(dst != NULL);
- extra= to_be_freed= MAKEEXTRALIST(flag, "");
-
+ MAKEEXTRALIST(flag, extra, "");
+ if (! extra) {
+ *dst = '\0'; /* can't create extra, return "" */
+ return dst;
+ }
if (flag & VIS_HTTPSTYLE)
- HVIS(dst, c, flag, nextc, extra);
+ dst = do_hvis(dst, uc, flag, nextc, extra);
else
- SVIS(dst, c, flag, nextc, extra);
+ dst = do_svis(dst, uc, flag, nextc, extra);
+ free(extra);
*dst = '\0';
- free(to_be_freed);
- return (dst);
+ return dst;
}
/*
* strvis, strvisx - visually encode characters from src into dst
- *
+ *
* Dst must be 4 times the size of src to account for possible
* expansion. The length of dst, not including the trailing NULL,
- * is returned.
+ * is returned.
*
* Strvisx encodes exactly len bytes from src into dst.
* This is useful for encoding a block of data.
*/
int
-strvis(dst, src, flag)
- char *dst;
- const char *src;
- int flag;
+strvis(char *dst, const char *src, int flag)
{
- char *extra;
- int tmp;
+ char *extra = NULL;
+ int rv;
- extra= MAKEEXTRALIST(flag, "");
- tmp= strsvis(dst, src, flag, extra);
+ MAKEEXTRALIST(flag, extra, "");
+ if (!extra) {
+ *dst = '\0'; /* can't create extra, return "" */
+ return 0;
+ }
+ rv = strsvis(dst, src, flag, extra);
free(extra);
- return tmp;
+ return rv;
}
int
-strvisx(dst, src, len, flag)
- char *dst;
- const char *src;
- size_t len;
- int flag;
+strvisx(char *dst, const char *src, size_t len, int flag)
{
- char *extra;
- int tmp;
+ char *extra = NULL;
+ int rv;
- extra= MAKEEXTRALIST(flag, "");
- tmp= strsvisx(dst, src, len, flag, extra);
+ MAKEEXTRALIST(flag, extra, "");
+ if (!extra) {
+ *dst = '\0'; /* can't create extra, return "" */
+ return 0;
+ }
+ rv = strsvisx(dst, src, len, flag, extra);
free(extra);
- return tmp;
+ return rv;
}
#endif
diff --git a/cmd-line-utils/libedit/np/vis.h b/cmd-line-utils/libedit/np/vis.h
index 1a49c9e3ed2..11f5b740e2d 100644
--- a/cmd-line-utils/libedit/np/vis.h
+++ b/cmd-line-utils/libedit/np/vis.h
@@ -1,4 +1,4 @@
-/* $NetBSD: vis.h,v 1.12 2002/03/23 17:39:05 christos Exp $ */
+/* $NetBSD: vis.h,v 1.16 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -12,11 +12,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -38,9 +34,7 @@
#ifndef _VIS_H_
#define _VIS_H_
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
+#include <sys/types.h>
/*
* to select alternate encoding format
@@ -78,6 +72,7 @@
*/
#define UNVIS_END 1 /* no more characters */
+__BEGIN_DECLS
char *vis(char *, int, int, int);
char *svis(char *, int, int, int, const char *);
int strvis(char *, const char *, int);
@@ -86,11 +81,7 @@ int strvisx(char *, const char *, size_t, int);
int strsvisx(char *, const char *, size_t, int, const char *);
int strunvis(char *, const char *);
int strunvisx(char *, const char *, int);
-#ifdef __LIBC12_SOURCE__
int unvis(char *, int, int *, int);
-int __unvis13(char *, int, int *, int);
-#else
-int unvis(char *, int, int *, int) __RENAME(__unvis13);
-#endif
+__END_DECLS
#endif /* !_VIS_H_ */
diff --git a/cmd-line-utils/libedit/parse.c b/cmd-line-utils/libedit/parse.c
index 993cf5b752d..5bdefb5a0e4 100644
--- a/cmd-line-utils/libedit/parse.c
+++ b/cmd-line-utils/libedit/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.20 2003/12/05 13:37:48 lukem Exp $ */
+/* $NetBSD: parse.c,v 1.22 2005/05/29 04:58:15 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* parse.c: parse an editline extended command
@@ -129,7 +135,7 @@ el_parse(EditLine *el, int argc, const char *argv[])
* the appropriate character or -1 if the escape is not valid
*/
protected int
-parse__escape(const char **const ptr)
+parse__escape(const char **ptr)
{
const char *p;
int c;
diff --git a/cmd-line-utils/libedit/parse.h b/cmd-line-utils/libedit/parse.h
index 4b796666b8e..58dced1aeaa 100644
--- a/cmd-line-utils/libedit/parse.h
+++ b/cmd-line-utils/libedit/parse.h
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.h,v 1.5 2003/08/07 16:44:32 agc Exp $ */
+/* $NetBSD: parse.h,v 1.6 2005/05/29 04:58:15 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
#define _h_el_parse
protected int parse_line(EditLine *, const char *);
-protected int parse__escape(const char ** const);
+protected int parse__escape(const char **);
protected char *parse__string(char *, const char *);
protected int parse_cmd(EditLine *, const char *);
diff --git a/cmd-line-utils/libedit/prompt.c b/cmd-line-utils/libedit/prompt.c
index 455dd60331b..982943afd30 100644
--- a/cmd-line-utils/libedit/prompt.c
+++ b/cmd-line-utils/libedit/prompt.c
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* prompt.c: Prompt printing functions
diff --git a/cmd-line-utils/libedit/read.c b/cmd-line-utils/libedit/read.c
index 51848c2038e..ac768142e79 100644
--- a/cmd-line-utils/libedit/read.c
+++ b/cmd-line-utils/libedit/read.c
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.35 2005/03/09 23:55:02 christos Exp $ */
+/* $NetBSD: read.c,v 1.43 2009/02/05 19:15:44 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* read.c: Clean this junk up! This is horrible code.
@@ -50,6 +56,7 @@ private int read__fixio(int, int);
private int read_preread(EditLine *);
private int read_char(EditLine *, char *);
private int read_getcmd(EditLine *, el_action_t *, char *);
+private void read_pop(c_macro_t *);
/* read_init():
* Initialize the read stuff
@@ -205,7 +212,7 @@ read_preread(EditLine *el)
* Push a macro
*/
public void
-el_push(EditLine *el, char *str)
+el_push(EditLine *el, const char *str)
{
c_macro_t *ma = &el->el_chared.c_macro;
@@ -216,7 +223,7 @@ el_push(EditLine *el, char *str)
ma->level--;
}
term_beep(el);
- term__flush();
+ term__flush(el);
}
@@ -294,6 +301,19 @@ read_char(EditLine *el, char *cp)
return (num_read);
}
+/* read_pop():
+ * Pop a macro from the stack
+ */
+private void
+read_pop(c_macro_t *ma)
+{
+ int i;
+
+ el_free(ma->macro[0]);
+ for (i = ma->level--; i > 0; i--)
+ ma->macro[i - 1] = ma->macro[i];
+ ma->offset = 0;
+}
/* el_getc():
* Read a character
@@ -304,26 +324,28 @@ el_getc(EditLine *el, char *cp)
int num_read;
c_macro_t *ma = &el->el_chared.c_macro;
- term__flush();
+ term__flush(el);
for (;;) {
if (ma->level < 0) {
if (!read_preread(el))
break;
}
+
if (ma->level < 0)
break;
- if (ma->macro[ma->level][ma->offset] == '\0') {
- el_free(ma->macro[ma->level--]);
- ma->offset = 0;
+ if (ma->macro[0][ma->offset] == '\0') {
+ read_pop(ma);
continue;
}
- *cp = ma->macro[ma->level][ma->offset++] & 0377;
- if (ma->macro[ma->level][ma->offset] == '\0') {
+
+ *cp = ma->macro[0][ma->offset++] & 0377;
+
+ if (ma->macro[0][ma->offset] == '\0') {
/* Needed for QuoteMode On */
- el_free(ma->macro[ma->level--]);
- ma->offset = 0;
+ read_pop(ma);
}
+
return (1);
}
@@ -357,11 +379,11 @@ read_prepare(EditLine *el)
we have the wrong size. */
el_resize(el);
re_clear_display(el); /* reset the display stuff */
- ch_reset(el);
+ ch_reset(el, 0);
re_refresh(el); /* print the prompt */
if (el->el_flags & UNBUFFERED)
- term__flush();
+ term__flush(el);
}
protected void
@@ -438,7 +460,7 @@ el_gets(EditLine *el, int *nread)
else
cp = el->el_line.lastchar;
- term__flush();
+ term__flush(el);
while ((*el->el_read.read_char)(el, cp) == 1) {
/* make sure there is space next character */
@@ -478,7 +500,7 @@ el_gets(EditLine *el, int *nread)
#endif /* DEBUG_READ */
break;
}
- if ((unsigned int)cmdnum >= el->el_map.nfunc) { /* BUG CHECK command */
+ if ((unsigned int)cmdnum >= (unsigned int)el->el_map.nfunc) { /* BUG CHECK command */
#ifdef DEBUG_EDIT
(void) fprintf(el->el_errfile,
"ERROR: illegal command from key 0%o\r\n", ch);
@@ -570,7 +592,7 @@ el_gets(EditLine *el, int *nread)
#endif /* DEBUG_READ */
/* put (real) cursor in a known place */
re_clear_display(el); /* reset the display stuff */
- ch_reset(el); /* reset the input pointers */
+ ch_reset(el, 1); /* reset the input pointers */
re_refresh(el); /* print the prompt again */
break;
@@ -581,7 +603,7 @@ el_gets(EditLine *el, int *nread)
"*** editor ERROR ***\r\n\n");
#endif /* DEBUG_READ */
term_beep(el);
- term__flush();
+ term__flush(el);
break;
}
el->el_state.argument = 1;
@@ -591,7 +613,7 @@ el_gets(EditLine *el, int *nread)
break;
}
- term__flush(); /* flush any buffered output */
+ term__flush(el); /* flush any buffered output */
/* make sure the tty is set up correctly */
if ((el->el_flags & UNBUFFERED) == 0) {
read_finish(el);
diff --git a/cmd-line-utils/libedit/read.h b/cmd-line-utils/libedit/read.h
index 1982f47253b..bd8d4c1f5bb 100644
--- a/cmd-line-utils/libedit/read.h
+++ b/cmd-line-utils/libedit/read.h
@@ -1,4 +1,4 @@
-/* $NetBSD: read.h,v 1.4 2004/02/27 14:52:18 christos Exp $ */
+/* $NetBSD: read.h,v 1.6 2008/04/29 06:53:01 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -15,13 +15,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
diff --git a/cmd-line-utils/libedit/readline.c b/cmd-line-utils/libedit/readline.c
index 004fcf7d183..ca8796fbd37 100644
--- a/cmd-line-utils/libedit/readline.c
+++ b/cmd-line-utils/libedit/readline.c
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.49 2005/03/10 19:34:46 christos Exp $ */
+/* $NetBSD: readline.c,v 1.78 2009/02/05 19:15:26 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -15,13 +15,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -36,25 +29,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* AIX requires this to be the first thing in the file. */
-#if defined (_AIX) && !defined (__GNUC__)
- #pragma alloca
-#endif
-
-#include <config.h>
-
-#ifdef __GNUC__
-# undef alloca
-# define alloca(n) __builtin_alloca (n)
-#else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifndef _AIX
-extern char *alloca ();
-# endif
-# endif
-#endif
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#endif /* not lint && not SCCSID */
#include <sys/types.h>
#include <sys/stat.h>
@@ -68,12 +45,23 @@ extern char *alloca ();
#include <limits.h>
#include <errno.h>
#include <fcntl.h>
+#include <setjmp.h>
+#ifdef HAVE_VIS_H
#include <vis.h>
-
-#include "readline/readline.h"
+#else
+#include "np/vis.h"
+#endif
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
#include "el.h"
#include "fcns.h" /* for EL_NUM_FCNS */
#include "histedit.h"
+#include "readline/readline.h"
+#include "filecomplete.h"
+
+void rl_prep_terminal(int);
+void rl_deprep_terminal(void);
/* for rl_complete() */
#define TAB '\r'
@@ -94,9 +82,12 @@ FILE *rl_outstream = NULL;
int rl_point = 0;
int rl_end = 0;
char *rl_line_buffer = NULL;
-VFunction *rl_linefunc = NULL;
+VCPFunction *rl_linefunc = NULL;
int rl_done = 0;
VFunction *rl_event_hook = NULL;
+KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
+ emacs_meta_keymap,
+ emacs_ctlx_keymap;
int history_base = 1; /* probably never subject to change */
int history_length = 0;
@@ -112,21 +103,23 @@ int rl_attempted_completion_over = 0;
char *rl_basic_word_break_characters = break_chars;
char *rl_completer_word_break_characters = NULL;
char *rl_completer_quote_characters = NULL;
-CPFunction *rl_completion_entry_function = NULL;
+Function *rl_completion_entry_function = NULL;
CPPFunction *rl_attempted_completion_function = NULL;
Function *rl_pre_input_hook = NULL;
Function *rl_startup1_hook = NULL;
-Function *rl_getc_function = NULL;
+int (*rl_getc_function)(FILE *) = NULL;
char *rl_terminal_name = NULL;
int rl_already_prompted = 0;
int rl_filename_completion_desired = 0;
int rl_ignore_completion_duplicates = 0;
int rl_catch_signals = 1;
+int readline_echoing_p = 1;
+int _rl_print_completions_horizontally = 0;
VFunction *rl_redisplay_function = NULL;
Function *rl_startup_hook = NULL;
VFunction *rl_completion_display_matches_hook = NULL;
-VFunction *rl_prep_term_function = NULL;
-VFunction *rl_deprep_term_function = NULL;
+VFunction *rl_prep_term_function = (VFunction *)rl_prep_terminal;
+VFunction *rl_deprep_term_function = (VFunction *)rl_deprep_terminal;
/*
* The current prompt string.
@@ -150,7 +143,7 @@ int rl_completion_query_items = 100;
* in the parsed text when it is passed to the completion function.
* Shell uses this to help determine what kind of completing to do.
*/
-char *rl_special_prefixes = (char *)NULL;
+char *rl_special_prefixes = NULL;
/*
* This is the character appended to the completed words if at the end of
@@ -160,25 +153,21 @@ int rl_completion_append_character = ' ';
/* stuff below is used internally by libedit for readline emulation */
-/* if not zero, non-unique completions always show list of possible matches */
-static int _rl_complete_show_all = 0;
-
static History *h = NULL;
static EditLine *e = NULL;
static Function *map[256];
-static int el_rl_complete_cmdnum = 0;
+static jmp_buf topbuf;
/* internal functions */
static unsigned char _el_rl_complete(EditLine *, int);
static unsigned char _el_rl_tstp(EditLine *, int);
static char *_get_prompt(EditLine *);
+static int _getc_function(EditLine *, char *);
static HIST_ENTRY *_move_history(int);
static int _history_expand_command(const char *, size_t, size_t,
char **);
static char *_rl_compat_sub(const char *, const char *,
const char *, int);
-static int _rl_complete_internal(int);
-static int _rl_qsort_string_compare(const void *, const void *);
static int _rl_event_read_char(EditLine *, char *);
static void _rl_update_pos(void);
@@ -205,17 +194,50 @@ _move_history(int op)
return (HIST_ENTRY *) NULL;
rl_he.line = ev.str;
- rl_he.data = (histdata_t) &(ev.num);
+ rl_he.data = NULL;
return (&rl_he);
}
/*
+ * read one key from user defined input function
+ */
+static int
+/*ARGSUSED*/
+_getc_function(EditLine *el, char *c)
+{
+ int i;
+
+ i = (*rl_getc_function)(NULL);
+ if (i == -1)
+ return 0;
+ *c = i;
+ return 1;
+}
+
+
+/*
* READLINE compatibility stuff
*/
/*
+ * Set the prompt
+ */
+int
+rl_set_prompt(const char *prompt)
+{
+ if (!prompt)
+ prompt = "";
+ if (rl_prompt != NULL && strcmp(rl_prompt, prompt) == 0)
+ return 0;
+ if (rl_prompt)
+ free(rl_prompt);
+ rl_prompt = strdup(prompt);
+ return rl_prompt == NULL ? -1 : 0;
+}
+
+/*
* initialize rl compat stuff
*/
int
@@ -223,7 +245,6 @@ rl_initialize(void)
{
HistEvent ev;
const LineInfo *li;
- int i;
int editmode = 1;
struct termios t;
@@ -257,9 +278,12 @@ rl_initialize(void)
max_input_history = INT_MAX;
el_set(e, EL_HIST, history, h);
+ /* setup getc function if valid */
+ if (rl_getc_function)
+ el_set(e, EL_GETCFN, _getc_function);
+
/* for proper prompt printing in readline() */
- rl_prompt = strdup("");
- if (rl_prompt == NULL) {
+ if (rl_set_prompt("") == -1) {
history_end(h);
el_end(e);
return -1;
@@ -291,17 +315,6 @@ rl_initialize(void)
"ReadLine compatible suspend function",
_el_rl_tstp);
el_set(e, EL_BIND, "^Z", "rl_tstp", NULL);
-
- /*
- * Find out where the rl_complete function was added; this is
- * used later to detect that lastcmd was also rl_complete.
- */
- for(i=EL_NUM_FCNS; i < e->el_map.nfunc; i++) {
- if (e->el_map.func[i] == _el_rl_complete) {
- el_rl_complete_cmdnum = i;
- break;
- }
- }
/* read settings from configuration file */
el_source(e, NULL);
@@ -327,9 +340,10 @@ rl_initialize(void)
* trailing newline (if there is any)
*/
char *
-readline(const char *prompt)
+readline(const char *p)
{
HistEvent ev;
+ const char * volatile prompt = p;
int count;
const char *ret;
char *buf;
@@ -340,15 +354,11 @@ readline(const char *prompt)
rl_done = 0;
+ (void)setjmp(topbuf);
+
/* update prompt accordingly to what has been passed */
- if (!prompt)
- prompt = "";
- if (strcmp(rl_prompt, prompt) != 0) {
- free(rl_prompt);
- rl_prompt = strdup(prompt);
- if (rl_prompt == NULL)
- return NULL;
- }
+ if (rl_set_prompt(prompt) == -1)
+ return NULL;
if (rl_pre_input_hook)
(*rl_pre_input_hook)(NULL, 0);
@@ -446,7 +456,7 @@ _rl_compat_sub(const char *str, const char *what, const char *with,
} else
*r++ = *s++;
}
- *r = 0;
+ *r = '\0';
return(result);
}
@@ -467,7 +477,7 @@ get_history_event(const char *cmd, int *cindex, int qchar)
return(NULL);
/* find out which event to take */
- if (cmd[idx] == history_expansion_char || cmd[idx] == 0) {
+ if (cmd[idx] == history_expansion_char || cmd[idx] == '\0') {
if (history(h, &ev, H_FIRST) != 0)
return(NULL);
*cindex = cmd[idx]? (idx + 1):idx;
@@ -689,7 +699,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
if (aptr)
free(aptr);
- if (*cmd == 0 || (cmd - (command + offs) >= cmdlen)) {
+ if (*cmd == '\0' || ((size_t)(cmd - (command + offs)) >= cmdlen)) {
*result = tmp;
return(1);
}
@@ -699,7 +709,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
continue;
else if (*cmd == 'h') { /* remove trailing path */
if ((aptr = strrchr(tmp, '/')) != NULL)
- *aptr = 0;
+ *aptr = '\0';
} else if (*cmd == 't') { /* remove leading path */
if ((aptr = strrchr(tmp, '/')) != NULL) {
aptr = strdup(aptr + 1);
@@ -708,7 +718,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
}
} else if (*cmd == 'r') { /* remove trailing suffix */
if ((aptr = strrchr(tmp, '.')) != NULL)
- *aptr = 0;
+ *aptr = '\0';
} else if (*cmd == 'e') { /* remove all but suffix */
if ((aptr = strrchr(tmp, '.')) != NULL) {
aptr = strdup(aptr);
@@ -732,6 +742,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
what = realloc(from, size);
if (what == NULL) {
free(from);
+ free(tmp);
return 0;
}
len = 0;
@@ -744,6 +755,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
(size <<= 1));
if (nwhat == NULL) {
free(what);
+ free(tmp);
return 0;
}
what = nwhat;
@@ -756,10 +768,13 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
free(what);
if (search) {
from = strdup(search);
- if (from == NULL)
+ if (from == NULL) {
+ free(tmp);
return 0;
+ }
} else {
from = NULL;
+ free(tmp);
return (-1);
}
}
@@ -771,6 +786,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
with = realloc(to, size);
if (with == NULL) {
free(to);
+ free(tmp);
return -1;
}
len = 0;
@@ -782,6 +798,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
nwith = realloc(with, size);
if (nwith == NULL) {
free(with);
+ free(tmp);
return -1;
}
with = nwith;
@@ -850,12 +867,14 @@ history_expand(char *str, char **output)
return 0;
}
-#define ADD_STRING(what, len) \
+#define ADD_STRING(what, len, fr) \
{ \
if (idx + len + 1 > size) { \
char *nresult = realloc(result, (size += len + 1));\
if (nresult == NULL) { \
free(*output); \
+ if (/*CONSTCOND*/fr) \
+ free(tmp); \
return 0; \
} \
result = nresult; \
@@ -867,6 +886,7 @@ history_expand(char *str, char **output)
result = NULL;
size = idx = 0;
+ tmp = NULL;
for (i = 0; str[i];) {
int qchar, loop_again;
size_t len, start, j;
@@ -904,13 +924,11 @@ loop:
goto loop;
}
len = i - start;
- tmp = &str[start];
- ADD_STRING(tmp, len);
+ ADD_STRING(&str[start], len, 0);
if (str[i] == '\0' || str[i] != history_expansion_char) {
len = j - i;
- tmp = &str[i];
- ADD_STRING(tmp, len);
+ ADD_STRING(&str[i], len, 0);
if (start == 0)
ret = 0;
else
@@ -920,8 +938,11 @@ loop:
ret = _history_expand_command (str, i, (j - i), &tmp);
if (ret > 0 && tmp) {
len = strlen(tmp);
- ADD_STRING(tmp, len);
+ ADD_STRING(tmp, len, 1);
+ }
+ if (tmp) {
free(tmp);
+ tmp = NULL;
}
i = j;
}
@@ -973,23 +994,23 @@ history_arg_extract(int start, int end, const char *str)
if (start < 0)
start = end;
- if (start < 0 || end < 0 || start > max || end > max || start > end)
+ if (start < 0 || end < 0 || (size_t)start > max || (size_t)end > max || start > end)
return(NULL);
- for (i = start, len = 0; i <= end; i++)
+ for (i = start, len = 0; i <= (size_t)end; i++)
len += strlen(arr[i]) + 1;
len++;
result = malloc(len);
if (result == NULL)
return NULL;
- for (i = start, len = 0; i <= end; i++) {
+ for (i = start, len = 0; i <= (size_t)end; i++) {
(void)strcpy(result + len, arr[i]);
len += strlen(arr[i]);
- if (i < end)
+ if (i < (size_t)end)
result[len++] = ' ';
}
- result[len] = 0;
+ result[len] = '\0';
for (i = 0; arr[i]; i++)
free(arr[i]);
@@ -1152,7 +1173,7 @@ history_get(int num)
return (NULL); /* error */
/* look backwards for event matching specified offset */
- if (history(h, &ev, H_NEXT_EVENT, num))
+ if (history(h, &ev, H_NEXT_EVENT, num + 1))
return (NULL);
she.line = ev.str;
@@ -1185,6 +1206,31 @@ add_history(const char *line)
/*
+ * remove the specified entry from the history list and return it.
+ */
+HIST_ENTRY *
+remove_history(int num)
+{
+ HIST_ENTRY *she;
+ HistEvent ev;
+
+ if (h == NULL || e == NULL)
+ rl_initialize();
+
+ if (history(h, &ev, H_DEL, num) != 0)
+ return NULL;
+
+ if ((she = malloc(sizeof(*she))) == NULL)
+ return NULL;
+
+ she->line = ev.str;
+ she->data = NULL;
+
+ return she;
+}
+
+
+/*
* clear the history list - delete all entries
*/
void
@@ -1377,172 +1423,18 @@ history_search_pos(const char *str,
/********************************/
/* completion functions */
-/*
- * does tilde expansion of strings of type ``~user/foo''
- * if ``user'' isn't valid user name or ``txt'' doesn't start
- * w/ '~', returns pointer to strdup()ed copy of ``txt''
- *
- * it's callers's responsibility to free() returned string
- */
char *
-tilde_expand(char *txt)
+tilde_expand(char *name)
{
- struct passwd *pass;
- char *temp;
- size_t len = 0;
-
- if (txt[0] != '~')
- return (strdup(txt));
-
- temp = strchr(txt + 1, '/');
- if (temp == NULL) {
- temp = strdup(txt + 1);
- if (temp == NULL)
- return NULL;
- } else {
- len = temp - txt + 1; /* text until string after slash */
- temp = malloc(len);
- if (temp == NULL)
- return NULL;
- (void)strncpy(temp, txt + 1, len - 2);
- temp[len - 2] = '\0';
- }
- pass = getpwnam(temp);
- free(temp); /* value no more needed */
- if (pass == NULL)
- return (strdup(txt));
-
- /* update pointer txt to point at string immedially following */
- /* first slash */
- txt += len;
-
- temp = malloc(strlen(pass->pw_dir) + 1 + strlen(txt) + 1);
- if (temp == NULL)
- return NULL;
- (void)sprintf(temp, "%s/%s", pass->pw_dir, txt);
-
- return (temp);
+ return fn_tilde_expand(name);
}
-
-/*
- * return first found file name starting by the ``text'' or NULL if no
- * such file can be found
- * value of ``state'' is ignored
- *
- * it's caller's responsibility to free returned string
- */
char *
-filename_completion_function(const char *text, int state)
+filename_completion_function(const char *name, int state)
{
- static DIR *dir = NULL;
- static char *filename = NULL, *dirname = NULL;
- static size_t filename_len = 0;
- struct dirent *entry;
- char *temp;
- size_t len;
-
- if (state == 0 || dir == NULL) {
- temp = strrchr(text, '/');
- if (temp) {
- char *nptr;
- temp++;
- nptr = realloc(filename, strlen(temp) + 1);
- if (nptr == NULL) {
- free(filename);
- return NULL;
- }
- filename = nptr;
- (void)strcpy(filename, temp);
- len = temp - text; /* including last slash */
- nptr = realloc(dirname, len + 1);
- if (nptr == NULL) {
- free(filename);
- return NULL;
- }
- dirname = nptr;
- (void)strncpy(dirname, text, len);
- dirname[len] = '\0';
- } else {
- if (*text == 0)
- filename = NULL;
- else {
- filename = strdup(text);
- if (filename == NULL)
- return NULL;
- }
- dirname = NULL;
- }
-
- /* support for ``~user'' syntax */
- if (dirname && *dirname == '~') {
- char *nptr;
- temp = tilde_expand(dirname);
- if (temp == NULL)
- return NULL;
- nptr = realloc(dirname, strlen(temp) + 1);
- if (nptr == NULL) {
- free(dirname);
- return NULL;
- }
- dirname = nptr;
- (void)strcpy(dirname, temp); /* safe */
- free(temp); /* no longer needed */
- }
- /* will be used in cycle */
- filename_len = filename ? strlen(filename) : 0;
-
- if (dir != NULL) {
- (void)closedir(dir);
- dir = NULL;
- }
- dir = opendir(dirname ? dirname : ".");
- if (!dir)
- return (NULL); /* cannot open the directory */
- }
- /* find the match */
- while ((entry = readdir(dir)) != NULL) {
- /* skip . and .. */
- if (entry->d_name[0] == '.' && (!entry->d_name[1]
- || (entry->d_name[1] == '.' && !entry->d_name[2])))
- continue;
- if (filename_len == 0)
- break;
- /* otherwise, get first entry where first */
- /* filename_len characters are equal */
- if (entry->d_name[0] == filename[0]
- /* Some dirents have d_namlen, but it is not portable. */
- && strlen(entry->d_name) >= filename_len
- && strncmp(entry->d_name, filename,
- filename_len) == 0)
- break;
- }
-
- if (entry) { /* match found */
-
- struct stat stbuf;
- /* Some dirents have d_namlen, but it is not portable. */
- len = strlen(entry->d_name) +
- ((dirname) ? strlen(dirname) : 0) + 1 + 1;
- temp = malloc(len);
- if (temp == NULL)
- return NULL;
- (void)sprintf(temp, "%s%s",
- dirname ? dirname : "", entry->d_name); /* safe */
-
- /* test, if it's directory */
- if (stat(temp, &stbuf) == 0 && S_ISDIR(stbuf.st_mode))
- strcat(temp, "/"); /* safe */
- } else {
- (void)closedir(dir);
- dir = NULL;
- temp = NULL;
- }
-
- return (temp);
+ return fn_filename_completion_function(name, state);
}
-
/*
* a completion generator for usernames; returns _first_ username
* which starts with supplied text
@@ -1564,6 +1456,7 @@ username_completion_function(const char *text, int state)
if (state == 0)
setpwent();
+ /* XXXMYSQL: just use non-_r functions for now */
while ((pwd = getpwent()) && text[0] == pwd->pw_name[0]
&& strcmp(text, pwd->pw_name) == 0);
@@ -1576,16 +1469,6 @@ username_completion_function(const char *text, int state)
/*
- * el-compatible wrapper around rl_complete; needed for key binding
- */
-/* ARGSUSED */
-static unsigned char
-_el_rl_complete(EditLine *el __attribute__((__unused__)), int ch)
-{
- return (unsigned char) rl_complete(0, ch);
-}
-
-/*
* el-compatible wrapper to send TSTP on ^Z
*/
/* ARGSUSED */
@@ -1597,272 +1480,35 @@ _el_rl_tstp(EditLine *el __attribute__((__unused__)), int ch __attribute__((__un
}
/*
- * returns list of completions for text given
- */
-char **
-completion_matches(const char *text, CPFunction *genfunc)
-{
- char **match_list = NULL, *retstr, *prevstr;
- size_t match_list_len, max_equal, which, i;
- size_t matches;
-
- if (h == NULL || e == NULL)
- rl_initialize();
-
- matches = 0;
- match_list_len = 1;
- while ((retstr = (*genfunc) (text, (int)matches)) != NULL) {
- /* allow for list terminator here */
- if (matches + 3 >= match_list_len) {
- char **nmatch_list;
- while (matches + 3 >= match_list_len)
- match_list_len <<= 1;
- nmatch_list = realloc(match_list,
- match_list_len * sizeof(char *));
- if (nmatch_list == NULL) {
- free(match_list);
- return NULL;
- }
- match_list = nmatch_list;
-
- }
- match_list[++matches] = retstr;
- }
-
- if (!match_list)
- return NULL; /* nothing found */
-
- /* find least denominator and insert it to match_list[0] */
- which = 2;
- prevstr = match_list[1];
- max_equal = strlen(prevstr);
- for (; which <= matches; which++) {
- for (i = 0; i < max_equal &&
- prevstr[i] == match_list[which][i]; i++)
- continue;
- max_equal = i;
- }
-
- retstr = malloc(max_equal + 1);
- if (retstr == NULL) {
- free(match_list);
- return NULL;
- }
- (void)strncpy(retstr, match_list[1], max_equal);
- retstr[max_equal] = '\0';
- match_list[0] = retstr;
-
- /* add NULL as last pointer to the array */
- match_list[matches + 1] = (char *) NULL;
-
- return (match_list);
-}
-
-/*
- * Sort function for qsort(). Just wrapper around strcasecmp().
- */
-static int
-_rl_qsort_string_compare(i1, i2)
- const void *i1, *i2;
-{
- const char *s1 = ((const char * const *)i1)[0];
- const char *s2 = ((const char * const *)i2)[0];
-
- return strcasecmp(s1, s2);
-}
-
-/*
* Display list of strings in columnar format on readline's output stream.
* 'matches' is list of strings, 'len' is number of strings in 'matches',
* 'max' is maximum length of string in 'matches'.
*/
void
-rl_display_match_list (matches, len, max)
- char **matches;
- int len, max;
+rl_display_match_list(char **matches, int len, int max)
{
- int i, idx, limit, count;
- int screenwidth = e->el_term.t_size.h;
- /*
- * Find out how many entries can be put on one line, count
- * with two spaces between strings.
- */
- limit = screenwidth / (max + 2);
- if (limit == 0)
- limit = 1;
-
- /* how many lines of output */
- count = len / limit;
- if (count * limit < len)
- count++;
-
- /* Sort the items if they are not already sorted. */
- qsort(&matches[1], (size_t)(len - 1), sizeof(char *),
- _rl_qsort_string_compare);
-
- idx = 1;
- for(; count > 0; count--) {
- for(i = 0; i < limit && matches[idx]; i++, idx++)
- (void)fprintf(e->el_outfile, "%-*s ", max,
- matches[idx]);
- (void)fprintf(e->el_outfile, "\n");
- }
+ fn_display_match_list(e, matches, len, max);
}
-/*
- * Complete the word at or before point, called by rl_complete()
- * 'what_to_do' says what to do with the completion.
- * `?' means list the possible completions.
- * TAB means do standard completion.
- * `*' means insert all of the possible completions.
- * `!' means to do standard completion, and list all possible completions if
- * there is more than one.
- *
- * Note: '*' support is not implemented
- */
-static int
-_rl_complete_internal(int what_to_do)
+static const char *
+/*ARGSUSED*/
+_rl_completion_append_character_function(const char *dummy
+ __attribute__((__unused__)))
{
- CPFunction *complet_func;
- const LineInfo *li;
- char *temp, **matches;
- const char *ctemp;
- size_t len;
-
- rl_completion_type = what_to_do;
-
- if (h == NULL || e == NULL)
- rl_initialize();
-
- complet_func = rl_completion_entry_function;
- if (!complet_func)
- complet_func = filename_completion_function;
-
- /* We now look backwards for the start of a filename/variable word */
- li = el_line(e);
- ctemp = (const char *) li->cursor;
- while (ctemp > li->buffer
- && !strchr(rl_basic_word_break_characters, ctemp[-1])
- && (!rl_special_prefixes
- || !strchr(rl_special_prefixes, ctemp[-1]) ) )
- ctemp--;
-
- len = li->cursor - ctemp;
- temp = alloca(len + 1);
- (void)strncpy(temp, ctemp, len);
- temp[len] = '\0';
-
- /* these can be used by function called in completion_matches() */
- /* or (*rl_attempted_completion_function)() */
- _rl_update_pos();
-
- if (rl_attempted_completion_function) {
- int end = li->cursor - li->buffer;
- matches = (*rl_attempted_completion_function) (temp, (int)
- (end - len), end);
- } else
- matches = 0;
- if (!rl_attempted_completion_function || !matches)
- matches = completion_matches(temp, complet_func);
-
- if (matches) {
- int i, retval = CC_REFRESH;
- int matches_num, maxlen, match_len, match_display=1;
-
- /*
- * Only replace the completed string with common part of
- * possible matches if there is possible completion.
- */
- if (matches[0][0] != '\0') {
- el_deletestr(e, (int) len);
- el_insertstr(e, matches[0]);
- }
-
- if (what_to_do == '?')
- goto display_matches;
-
- if (matches[2] == NULL && strcmp(matches[0], matches[1]) == 0) {
- /*
- * We found exact match. Add a space after
- * it, unless we do filename completion and the
- * object is a directory.
- */
- size_t alen = strlen(matches[0]);
- if ((complet_func != filename_completion_function
- || (alen > 0 && (matches[0])[alen - 1] != '/'))
- && rl_completion_append_character) {
- char buf[2];
- buf[0] = rl_completion_append_character;
- buf[1] = '\0';
- el_insertstr(e, buf);
- }
- } else if (what_to_do == '!') {
- display_matches:
- /*
- * More than one match and requested to list possible
- * matches.
- */
-
- for(i=1, maxlen=0; matches[i]; i++) {
- match_len = strlen(matches[i]);
- if (match_len > maxlen)
- maxlen = match_len;
- }
- matches_num = i - 1;
-
- /* newline to get on next line from command line */
- (void)fprintf(e->el_outfile, "\n");
-
- /*
- * If there are too many items, ask user for display
- * confirmation.
- */
- if (matches_num > rl_completion_query_items) {
- (void)fprintf(e->el_outfile,
- "Display all %d possibilities? (y or n) ",
- matches_num);
- (void)fflush(e->el_outfile);
- if (getc(stdin) != 'y')
- match_display = 0;
- (void)fprintf(e->el_outfile, "\n");
- }
-
- if (match_display)
- rl_display_match_list(matches, matches_num,
- maxlen);
- retval = CC_REDISPLAY;
- } else if (matches[0][0]) {
- /*
- * There was some common match, but the name was
- * not complete enough. Next tab will print possible
- * completions.
- */
- el_beep(e);
- } else {
- /* lcd is not a valid object - further specification */
- /* is needed */
- el_beep(e);
- retval = CC_NORM;
- }
-
- /* free elements of array and the array itself */
- for (i = 0; matches[i]; i++)
- free(matches[i]);
- free(matches), matches = NULL;
-
- return (retval);
- }
- return (CC_NORM);
+ static char buf[2];
+ buf[0] = rl_completion_append_character;
+ buf[1] = '\0';
+ return buf;
}
/*
* complete word at current point
*/
+/* ARGSUSED */
int
-/*ARGSUSED*/
-rl_complete(int ignore, int invoking_key)
+rl_complete(int ignore __attribute__((__unused__)), int invoking_key)
{
if (h == NULL || e == NULL)
rl_initialize();
@@ -1873,15 +1519,26 @@ rl_complete(int ignore, int invoking_key)
arr[1] = '\0';
el_insertstr(e, arr);
return (CC_REFRESH);
- } else if (e->el_state.lastcmd == el_rl_complete_cmdnum)
- return _rl_complete_internal('?');
- else if (_rl_complete_show_all)
- return _rl_complete_internal('!');
- else
- return _rl_complete_internal(TAB);
+ }
+
+ /* Just look at how many global variables modify this operation! */
+ return fn_complete(e,
+ (CPFunction *)rl_completion_entry_function,
+ rl_attempted_completion_function,
+ rl_basic_word_break_characters, rl_special_prefixes,
+ _rl_completion_append_character_function, rl_completion_query_items,
+ &rl_completion_type, &rl_attempted_completion_over,
+ &rl_point, &rl_end);
}
+/* ARGSUSED */
+static unsigned char
+_el_rl_complete(EditLine *el __attribute__((__unused__)), int ch)
+{
+ return (unsigned char)rl_complete(0, ch);
+}
+
/*
* misc other functions
*/
@@ -1989,7 +1646,7 @@ int
rl_add_defun(const char *name, Function *fun, int c)
{
char dest[8];
- if (c >= sizeof(map) / sizeof(map[0]) || c < 0)
+ if ((size_t)c >= sizeof(map) / sizeof(map[0]) || c < 0)
return -1;
map[(unsigned char)c] = fun;
el_set(e, EL_ADDFN, name, name, rl_bind_wrapper);
@@ -2007,11 +1664,7 @@ rl_callback_read_char()
if (buf == NULL || count-- <= 0)
return;
-#ifdef CTRL2 /* _AIX */
- if (count == 0 && buf[0] == CTRL2('d'))
-#else
- if (count == 0 && buf[0] == CTRL('d'))
-#endif
+ if (count == 0 && buf[0] == e->el_tty.t_c[TS_IO][C_EOF])
done = 1;
if (buf[count] == '\n' || buf[count] == '\r')
done = 2;
@@ -2029,14 +1682,12 @@ rl_callback_read_char()
}
void
-rl_callback_handler_install (const char *prompt, VFunction *linefunc)
+rl_callback_handler_install(const char *prompt, VCPFunction *linefunc)
{
if (e == NULL) {
rl_initialize();
}
- if (rl_prompt)
- free(rl_prompt);
- rl_prompt = prompt ? strdup(strchr(prompt, *prompt)) : NULL;
+ (void)rl_set_prompt(prompt);
rl_linefunc = linefunc;
el_set(e, EL_UNBUFFERED, 1);
}
@@ -2045,17 +1696,14 @@ void
rl_callback_handler_remove(void)
{
el_set(e, EL_UNBUFFERED, 0);
+ rl_linefunc = NULL;
}
void
rl_redisplay(void)
{
char a[2];
-#ifdef CTRL2 /* _AIX */
- a[0] = CTRL2('r');
-#else
- a[0] = CTRL('r');
-#endif
+ a[0] = e->el_tty.t_c[TS_IO][C_REPRINT];
a[1] = '\0';
el_push(e, a);
}
@@ -2079,7 +1727,7 @@ rl_prep_terminal(int meta_flag)
}
void
-rl_deprep_terminal()
+rl_deprep_terminal(void)
{
el_set(e, EL_PREP_TERM, 0);
}
@@ -2104,6 +1752,16 @@ rl_parse_and_bind(const char *line)
return (argc ? 1 : 0);
}
+int
+rl_variable_bind(const char *var, const char *value)
+{
+ /*
+ * The proper return value is undocument, but this is what the
+ * readline source seems to do.
+ */
+ return ((el_set(e, EL_BIND, "", var, value) == -1) ? 1 : 0);
+}
+
void
rl_stuff_char(int c)
{
@@ -2119,7 +1777,7 @@ _rl_event_read_char(EditLine *el, char *cp)
{
int n, num_read = 0;
- *cp = 0;
+ *cp = '\0';
while (rl_event_hook) {
(*rl_event_hook)();
@@ -2164,3 +1822,142 @@ _rl_update_pos(void)
rl_point = li->cursor - li->buffer;
rl_end = li->lastchar - li->buffer;
}
+
+void
+rl_get_screen_size(int *rows, int *cols)
+{
+ if (rows)
+ el_get(e, EL_GETTC, "li", rows);
+ if (cols)
+ el_get(e, EL_GETTC, "co", cols);
+}
+
+void
+rl_set_screen_size(int rows, int cols)
+{
+ char buf[64];
+ (void)snprintf(buf, sizeof(buf), "%d", rows);
+ el_set(e, EL_SETTC, "li", buf);
+ (void)snprintf(buf, sizeof(buf), "%d", cols);
+ el_set(e, EL_SETTC, "co", buf);
+}
+
+char **
+rl_completion_matches(const char *str, rl_compentry_func_t *fun)
+{
+ size_t len, max, i, j, min;
+ char **list, *match, *a, *b;
+
+ len = 1;
+ max = 10;
+ if ((list = malloc(max * sizeof(*list))) == NULL)
+ return NULL;
+
+ while ((match = (*fun)(str, (int)(len - 1))) != NULL) {
+ if (len == max) {
+ char **nl;
+ max += 10;
+ if ((nl = realloc(list, max * sizeof(*nl))) == NULL)
+ goto out;
+ list = nl;
+ }
+ list[len++] = match;
+ }
+ if (len == 1)
+ goto out;
+ list[len] = NULL;
+ if (len == 2) {
+ if ((list[0] = strdup(list[1])) == NULL)
+ goto out;
+ return list;
+ }
+ qsort(&list[1], len - 1, sizeof(*list),
+ (int (*)(const void *, const void *)) strcmp);
+ min = SIZE_T_MAX;
+ for (i = 1, a = list[i]; i < len - 1; i++, a = b) {
+ b = list[i + 1];
+ for (j = 0; a[j] && a[j] == b[j]; j++)
+ continue;
+ if (min > j)
+ min = j;
+ }
+ if (min == 0 && *str) {
+ if ((list[0] = strdup(str)) == NULL)
+ goto out;
+ } else {
+ if ((list[0] = malloc(min + 1)) == NULL)
+ goto out;
+ (void)memcpy(list[0], list[1], min);
+ list[0][min] = '\0';
+ }
+ return list;
+
+out:
+ free(list);
+ return NULL;
+}
+
+char *
+rl_filename_completion_function (const char *text, int state)
+{
+ return fn_filename_completion_function(text, state);
+}
+
+void
+rl_forced_update_display(void)
+{
+ el_set(e, EL_REFRESH);
+}
+
+int
+_rl_abort_internal(void)
+{
+ el_beep(e);
+ longjmp(topbuf, 1);
+ /*NOTREACHED*/
+}
+
+int
+_rl_qsort_string_compare(char **s1, char **s2)
+{
+ return strcoll(*s1, *s2);
+}
+
+int
+/*ARGSUSED*/
+rl_kill_text(int from, int to)
+{
+ return 0;
+}
+
+Keymap
+rl_make_bare_keymap(void)
+{
+ return NULL;
+}
+
+Keymap
+rl_get_keymap(void)
+{
+ return NULL;
+}
+
+void
+/*ARGSUSED*/
+rl_set_keymap(Keymap k)
+{
+}
+
+int
+/*ARGSUSED*/
+rl_generic_bind(int type, const char * keyseq, const char * data, Keymap k)
+{
+ return 0;
+}
+
+int
+/*ARGSUSED*/
+rl_bind_key_in_map(int key, Function *fun, Keymap k)
+{
+ return 0;
+}
diff --git a/cmd-line-utils/libedit/readline/readline.h b/cmd-line-utils/libedit/readline/readline.h
index 6b1fa186512..c4806734bc5 100644
--- a/cmd-line-utils/libedit/readline/readline.h
+++ b/cmd-line-utils/libedit/readline/readline.h
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.h,v 1.12 2004/09/08 18:15:37 christos Exp $ */
+/* $NetBSD: readline.h,v 1.24 2009/02/05 19:15:26 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -15,13 +15,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -45,14 +38,14 @@
/* typedefs */
typedef int Function(const char *, int);
typedef void VFunction(void);
+typedef void VCPFunction(char *);
typedef char *CPFunction(const char *, int);
typedef char **CPPFunction(const char *, int, int);
-
-typedef void *histdata_t;
+typedef char *rl_compentry_func_t(const char *, int);
typedef struct _hist_entry {
const char *line;
- histdata_t *data;
+ const char *data;
} HIST_ENTRY;
typedef struct _keymap_entry {
@@ -73,7 +66,7 @@ typedef KEYMAP_ENTRY *Keymap;
#ifndef CTRL
#include <sys/ioctl.h>
-#if defined(__GLIBC__) || defined(__MWERKS__)
+#if !defined(__sun__) && !defined(__hpux__)
#include <sys/ttydefaults.h>
#endif
#ifndef CTRL
@@ -102,8 +95,9 @@ extern int max_input_history;
extern char *rl_basic_word_break_characters;
extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters;
-extern CPFunction *rl_completion_entry_function;
+extern Function *rl_completion_entry_function;
extern CPPFunction *rl_attempted_completion_function;
+extern int rl_attempted_completion_over;
extern int rl_completion_type;
extern int rl_completion_query_items;
extern char *rl_special_prefixes;
@@ -122,11 +116,13 @@ extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
emacs_ctlx_keymap;
extern int rl_filename_completion_desired;
extern int rl_ignore_completion_duplicates;
-extern Function *rl_getc_function;
+extern int (*rl_getc_function)(FILE *);
extern VFunction *rl_redisplay_function;
extern VFunction *rl_completion_display_matches_hook;
extern VFunction *rl_prep_term_function;
extern VFunction *rl_deprep_term_function;
+extern int readline_echoing_p;
+extern int _rl_print_completions_horizontally;
/* supported functions */
char *readline(const char *);
@@ -141,6 +137,7 @@ int history_is_stifled(void);
int where_history(void);
HIST_ENTRY *current_history(void);
HIST_ENTRY *history_get(int);
+HIST_ENTRY *remove_history(int);
int history_total_bytes(void);
int history_set_pos(int);
HIST_ENTRY *previous_history(void);
@@ -168,7 +165,7 @@ void rl_reset_terminal(const char *);
int rl_bind_key(int, int (*)(int, int));
int rl_newline(int, int);
void rl_callback_read_char(void);
-void rl_callback_handler_install(const char *, VFunction *);
+void rl_callback_handler_install(const char *, VCPFunction *);
void rl_callback_handler_remove(void);
void rl_redisplay(void);
int rl_get_previous_history(int, int);
@@ -176,13 +173,24 @@ void rl_prep_terminal(int);
void rl_deprep_terminal(void);
int rl_read_init_file(const char *);
int rl_parse_and_bind(const char *);
+int rl_variable_bind(const char *, const char *);
void rl_stuff_char(int);
int rl_add_defun(const char *, Function *, int);
+void rl_get_screen_size(int *, int *);
+void rl_set_screen_size(int, int);
+char *rl_filename_completion_function (const char *, int);
+int _rl_abort_internal(void);
+int _rl_qsort_string_compare(char **, char **);
+char **rl_completion_matches(const char *, rl_compentry_func_t *);
+void rl_forced_update_display(void);
+int rl_set_prompt(const char *);
/*
* The following are not implemented
*/
+int rl_kill_text(int, int);
Keymap rl_get_keymap(void);
+void rl_set_keymap(Keymap);
Keymap rl_make_bare_keymap(void);
int rl_generic_bind(int, const char *, const char *, Keymap);
int rl_bind_key_in_map(int, Function *, Keymap);
diff --git a/cmd-line-utils/libedit/refresh.c b/cmd-line-utils/libedit/refresh.c
index 46aca15ef08..5edd1fe78fc 100644
--- a/cmd-line-utils/libedit/refresh.c
+++ b/cmd-line-utils/libedit/refresh.c
@@ -1,4 +1,4 @@
-/* $NetBSD: refresh.c,v 1.26 2003/08/07 16:44:33 agc Exp $ */
+/* $NetBSD: refresh.c,v 1.28 2008/09/10 15:45:37 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* refresh.c: Lower level screen refreshing functions
@@ -49,6 +55,7 @@ private void re_update_line(EditLine *, char *, char *, int);
private void re_insert (EditLine *, char *, int, int, char *, int);
private void re_delete(EditLine *, char *, int, int, int);
private void re_fastputc(EditLine *, int);
+private void re_clear_eol(EditLine *, int, int, int);
private void re__strncopy(char *, char *, size_t);
private void re__copy_and_pad(char *, const char *, size_t);
@@ -315,9 +322,9 @@ re_goto_bottom(EditLine *el)
{
term_move_to_line(el, el->el_refresh.r_oldcv);
- term__putc('\n');
+ term__putc(el, '\n');
re_clear_display(el);
- term__flush();
+ term__flush(el);
}
@@ -340,7 +347,7 @@ re_insert(EditLine *el __attribute__((__unused__)),
ELRE_DEBUG(1,
(__F, "re_insert() starting: %d at %d max %d, d == \"%s\"\n",
num, dat, dlen, d));
- ELRE_DEBUG(1, (__F, "s == \"%s\"n", s));
+ ELRE_DEBUG(1, (__F, "s == \"%s\"\n", s));
/* open up the space for num chars */
if (num > 0) {
@@ -353,7 +360,7 @@ re_insert(EditLine *el __attribute__((__unused__)),
ELRE_DEBUG(1, (__F,
"re_insert() after insert: %d at %d max %d, d == \"%s\"\n",
num, dat, dlen, d));
- ELRE_DEBUG(1, (__F, "s == \"%s\"n", s));
+ ELRE_DEBUG(1, (__F, "s == \"%s\"\n", s));
/* copy the characters */
for (a = d + dat; (a < d + dlen) && (num > 0); num--)
@@ -362,7 +369,7 @@ re_insert(EditLine *el __attribute__((__unused__)),
ELRE_DEBUG(1,
(__F, "re_insert() after copy: %d at %d max %d, %s == \"%s\"\n",
num, dat, dlen, d, s));
- ELRE_DEBUG(1, (__F, "s == \"%s\"n", s));
+ ELRE_DEBUG(1, (__F, "s == \"%s\"\n", s));
}
@@ -411,6 +418,32 @@ re__strncopy(char *a, char *b, size_t n)
*a++ = *b++;
}
+/* re_clear_eol():
+ * Find the number of characters we need to clear till the end of line
+ * in order to make sure that we have cleared the previous contents of
+ * the line. fx and sx is the number of characters inserted or deleted
+ * int the first or second diff, diff is the difference between the
+ * number of characters between the new and old line.
+ */
+private void
+re_clear_eol(EditLine *el, int fx, int sx, int diff)
+{
+
+ ELRE_DEBUG(1, (__F, "re_clear_eol sx %d, fx %d, diff %d\n",
+ sx, fx, diff));
+
+ if (fx < 0)
+ fx = -fx;
+ if (sx < 0)
+ sx = -sx;
+ if (fx > diff)
+ diff = fx;
+ if (sx > diff)
+ diff = sx;
+
+ ELRE_DEBUG(1, (__F, "re_clear_eol %d\n", diff));
+ term_clear_EOL(el, diff);
+}
/*****************************************************************
re_update_line() is based on finding the middle difference of each line
@@ -626,7 +659,7 @@ re_update_line(EditLine *el, char *old, char *new, int i)
fx = (nsb - nfd) - (osb - ofd);
sx = (nls - nse) - (ols - ose);
- ELRE_DEBUG(1, (__F, "\n"));
+ ELRE_DEBUG(1, (__F, "fx %d, sx %d\n", fx, sx));
ELRE_DEBUG(1, (__F, "ofd %d, osb %d, ose %d, ols %d, oe %d\n",
ofd - old, osb - old, ose - old, ols - old, oe - old));
ELRE_DEBUG(1, (__F, "nfd %d, nsb %d, nse %d, nls %d, ne %d\n",
@@ -775,9 +808,7 @@ re_update_line(EditLine *el, char *old, char *new, int i)
* write (nsb-nfd) chars of new starting at nfd
*/
term_overwrite(el, nfd, (nsb - nfd));
- ELRE_DEBUG(1, (__F,
- "cleareol %d\n", (oe - old) - (ne - new)));
- term_clear_EOL(el, (oe - old) - (ne - new));
+ re_clear_eol(el, fx, sx, (oe - old) - (ne - new));
/*
* Done
*/
@@ -818,10 +849,7 @@ re_update_line(EditLine *el, char *old, char *new, int i)
ELRE_DEBUG(1, (__F,
"but with nothing left to save\r\n"));
term_overwrite(el, nse, (nls - nse));
- ELRE_DEBUG(1, (__F,
- "cleareol %d\n", (oe - old) - (ne - new)));
- if ((oe - old) - (ne - new) != 0)
- term_clear_EOL(el, (oe - old) - (ne - new));
+ re_clear_eol(el, fx, sx, (oe - old) - (ne - new));
}
}
/*
@@ -982,7 +1010,7 @@ re_refresh_cursor(EditLine *el)
/* now go there */
term_move_to_line(el, v);
term_move_to_char(el, h);
- term__flush();
+ term__flush(el);
}
@@ -993,7 +1021,7 @@ private void
re_fastputc(EditLine *el, int c)
{
- term__putc(c);
+ term__putc(el, c);
el->el_display[el->el_cursor.v][el->el_cursor.h++] = c;
if (el->el_cursor.h >= el->el_term.t_size.h) {
/* if we must overflow */
@@ -1020,12 +1048,12 @@ re_fastputc(EditLine *el, int c)
}
if (EL_HAS_AUTO_MARGINS) {
if (EL_HAS_MAGIC_MARGINS) {
- term__putc(' ');
- term__putc('\b');
+ term__putc(el, ' ');
+ term__putc(el, '\b');
}
} else {
- term__putc('\r');
- term__putc('\n');
+ term__putc(el, '\r');
+ term__putc(el, '\n');
}
}
}
@@ -1065,7 +1093,7 @@ re_fastaddc(EditLine *el)
re_fastputc(el, (int)(((((unsigned int)c) >> 3) & 7) + '0'));
re_fastputc(el, (c & 7) + '0');
}
- term__flush();
+ term__flush(el);
}
@@ -1104,7 +1132,7 @@ re_clear_lines(EditLine *el)
} else {
term_move_to_line(el, el->el_refresh.r_oldcv);
/* go to last line */
- term__putc('\r'); /* go to BOL */
- term__putc('\n'); /* go to new line */
+ term__putc(el, '\r'); /* go to BOL */
+ term__putc(el, '\n'); /* go to new line */
}
}
diff --git a/cmd-line-utils/libedit/search.c b/cmd-line-utils/libedit/search.c
index 850c5f27140..df50c7e7370 100644
--- a/cmd-line-utils/libedit/search.c
+++ b/cmd-line-utils/libedit/search.c
@@ -32,12 +32,17 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* search.c: History and character search functions
*/
-#include <sys/types.h>
#include <stdlib.h>
#if defined(REGEX)
#include <regex.h>
diff --git a/cmd-line-utils/libedit/sig.c b/cmd-line-utils/libedit/sig.c
index 8e70933d606..5307ee6ec60 100644
--- a/cmd-line-utils/libedit/sig.c
+++ b/cmd-line-utils/libedit/sig.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sig.c,v 1.11 2003/08/07 16:44:33 agc Exp $ */
+/* $NetBSD: sig.c,v 1.12 2008/09/10 15:45:37 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* sig.c: Signal handling stuff.
@@ -51,15 +57,15 @@ private const int sighdl[] = {
- 1
};
-private void sig_handler(int);
+private void el_sig_handler(int);
-/* sig_handler():
+/* el_sig_handler():
* This is the handler called for all signals
* XXX: we cannot pass any data so we just store the old editline
* state in a private variable
*/
private void
-sig_handler(int signo)
+el_sig_handler(int signo)
{
int i;
sigset_t nset, oset;
@@ -73,7 +79,7 @@ sig_handler(int signo)
tty_rawmode(sel);
if (ed_redisplay(sel, 0) == CC_REFRESH)
re_refresh(sel);
- term__flush();
+ term__flush(sel);
break;
case SIGWINCH:
@@ -154,7 +160,7 @@ sig_set(EditLine *el)
for (i = 0; sighdl[i] != -1; i++) {
el_signalhandler_t s;
/* This could happen if we get interrupted */
- if ((s = signal(sighdl[i], sig_handler)) != sig_handler)
+ if ((s = signal(sighdl[i], el_sig_handler)) != el_sig_handler)
el->el_signal[i] = s;
}
sel = el;
diff --git a/cmd-line-utils/libedit/sig.h b/cmd-line-utils/libedit/sig.h
index 0bf1fc37e39..2bd3c516d46 100644
--- a/cmd-line-utils/libedit/sig.h
+++ b/cmd-line-utils/libedit/sig.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sig.h,v 1.5 2003/08/07 16:44:33 agc Exp $ */
+/* $NetBSD: sig.h,v 1.6 2008/07/12 15:27:14 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -51,7 +51,6 @@
#define ALLSIGS \
_DO(SIGINT) \
_DO(SIGTSTP) \
- _DO(SIGSTOP) \
_DO(SIGQUIT) \
_DO(SIGHUP) \
_DO(SIGTERM) \
diff --git a/cmd-line-utils/libedit/strlcpy.c b/cmd-line-utils/libedit/strlcpy.c
deleted file mode 100644
index e38d6cf1c4b..00000000000
--- a/cmd-line-utils/libedit/strlcpy.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* $NetBSD: strlcpy.c,v 1.14 2003/10/27 00:12:42 lukem Exp $ */
-/* $OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $ */
-
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
- * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <config.h>
-
-#include <sys/types.h>
-#include <assert.h>
-#include <string.h>
-
-#ifdef _LIBC
-# ifdef __weak_alias
-__weak_alias(strlcpy, _strlcpy)
-# endif
-#endif
-
-#if !HAVE_STRLCPY
-/*
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
-size_t
-#ifdef _LIBC
-_strlcpy(dst, src, siz)
-#else
-strlcpy(dst, src, siz)
-#endif
- char *dst;
- const char *src;
- size_t siz;
-{
- char *d = dst;
- const char *s = src;
- size_t n = siz;
-
- _DIAGASSERT(dst != NULL);
- _DIAGASSERT(src != NULL);
-
- /* Copy as many bytes as will fit */
- if (n != 0 && --n != 0) {
- do {
- if ((*d++ = *s++) == 0)
- break;
- } while (--n != 0);
- }
-
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++)
- ;
- }
-
- return(s - src - 1); /* count does not include NUL */
-}
-#endif
diff --git a/cmd-line-utils/libedit/strlcpy.h b/cmd-line-utils/libedit/strlcpy.h
deleted file mode 100644
index e4d3a7ffa3f..00000000000
--- a/cmd-line-utils/libedit/strlcpy.h
+++ /dev/null
@@ -1,2 +0,0 @@
-size_t strlcpy(char *dst, const char *src, size_t size);
-size_t strlcat(char *dst, const char *src, size_t size);
diff --git a/cmd-line-utils/libedit/sys.h b/cmd-line-utils/libedit/sys.h
index c8a29dbfb05..a0369affbb0 100644
--- a/cmd-line-utils/libedit/sys.h
+++ b/cmd-line-utils/libedit/sys.h
@@ -48,14 +48,14 @@
# define __attribute__(A)
#endif
-#ifndef __P
-# define __P(x) x
-#endif
-
#ifndef _DIAGASSERT
# define _DIAGASSERT(x)
#endif
+#ifndef SIZE_T_MAX
+# define SIZE_T_MAX UINT_MAX
+#endif
+
#ifndef __BEGIN_DECLS
# ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
@@ -113,6 +113,25 @@ char *fgetln(FILE *fp, size_t *len);
#define REGEX /* Use POSIX.2 regular expression functions */
#undef REGEXP /* Use UNIX V8 regular expression functions */
+#ifdef __SunOS
+extern int tgetent(char *, const char *);
+extern int tgetflag(char *);
+extern int tgetnum(char *);
+extern int tputs(const char *, int, int (*)(int));
+extern char* tgoto(const char*, int, int);
+extern char* tgetstr(char*, char**);
+#endif
+
+/* XXXMYSQL: Bug#10218 Command line recall rolls into segfault */
+#if !HAVE_DECL_TGOTO
+/*
+ 'tgoto' is not declared in the system header files, this causes
+ problems on 64-bit systems. The function returns a 64 bit pointer
+ but caller see it as "int" and it's thus truncated to 32-bit
+*/
+extern char* tgoto(const char*, int, int);
+#endif
+
#ifdef notdef
# undef REGEX
# undef REGEXP
diff --git a/cmd-line-utils/libedit/term.c b/cmd-line-utils/libedit/term.c
index b516d6753c3..488c760da14 100644
--- a/cmd-line-utils/libedit/term.c
+++ b/cmd-line-utils/libedit/term.c
@@ -1,4 +1,4 @@
-/* $NetBSD: term.c,v 1.40 2004/05/22 23:21:28 christos Exp $ */
+/* $NetBSD: term.c,v 1.48 2009/02/06 20:08:13 sketch Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* term.c: Editor/termcap-curses interface
@@ -44,21 +50,28 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
-
+#if 0 /* TODO: do we need this */
+#ifdef HAVE_TERMCAP_H
+#include <termcap.h>
+#endif
+#endif
#ifdef HAVE_CURSES_H
-# include <curses.h>
-#elif HAVE_NCURSES_H
-# include <ncurses.h>
+#include <curses.h>
+#endif
+#ifdef HAVE_NCURSES_H
+#include <ncurses.h>
#endif
-
/* Solaris's term.h does horrid things. */
-#if (defined(HAVE_TERM_H) && !defined(_SUNOS))
-# include <term.h>
+#if (defined(HAVE_TERM_H) && !defined(__SunOS))
+#include <term.h>
#endif
-
#include <sys/types.h>
#include <sys/ioctl.h>
+#ifdef _REENTRANT
+#include <pthread.h>
+#endif
+
#include "el.h"
/*
@@ -263,9 +276,13 @@ private int term_alloc_display(EditLine *);
private void term_alloc(EditLine *, const struct termcapstr *, const char *);
private void term_init_arrow(EditLine *);
private void term_reset_arrow(EditLine *);
+private int term_putc(int);
+private void term_tputs(EditLine *, const char *, int);
-
-private FILE *term_outfile = NULL; /* XXX: How do we fix that? */
+#ifdef _REENTRANT
+private pthread_mutex_t term_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+private FILE *term_outfile = NULL;
/* term_setflags():
@@ -313,7 +330,6 @@ term_setflags(EditLine *el)
#endif /* DEBUG_SCREEN */
}
-
/* term_init():
* Initialize the terminal stuff
*/
@@ -339,7 +355,6 @@ term_init(EditLine *el)
if (el->el_term.t_val == NULL)
return (-1);
(void) memset(el->el_term.t_val, 0, T_val * sizeof(int));
- term_outfile = el->el_outfile;
(void) term_set(el, NULL);
term_init_arrow(el);
return (0);
@@ -390,7 +405,8 @@ term_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
* New string is shorter; no need to allocate space
*/
if (clen <= tlen) {
- (void) strcpy(*str, cap); /* XXX strcpy is safe */
+ if (*str)
+ (void) strcpy(*str, cap); /* XXX strcpy is safe */
return;
}
/*
@@ -464,8 +480,12 @@ term_alloc_display(EditLine *el)
return (-1);
for (i = 0; i < c->v; i++) {
b[i] = (char *) el_malloc((size_t) (sizeof(char) * (c->h + 1)));
- if (b[i] == NULL)
+ if (b[i] == NULL) {
+ while (--i >= 0)
+ el_free((ptr_t) b[i]);
+ el_free((ptr_t) b);
return (-1);
+ }
}
b[c->v] = NULL;
el->el_display = b;
@@ -475,8 +495,12 @@ term_alloc_display(EditLine *el)
return (-1);
for (i = 0; i < c->v; i++) {
b[i] = (char *) el_malloc((size_t) (sizeof(char) * (c->h + 1)));
- if (b[i] == NULL)
+ if (b[i] == NULL) {
+ while (--i >= 0)
+ el_free((ptr_t) b[i]);
+ el_free((ptr_t) b);
return (-1);
+ }
}
b[c->v] = NULL;
el->el_vdisplay = b;
@@ -542,12 +566,12 @@ term_move_to_line(EditLine *el, int where)
del--;
} else {
if ((del > 1) && GoodStr(T_DO)) {
- (void) tputs(tgoto(Str(T_DO), del, del),
- del, term__putc);
+ term_tputs(el, tgoto(Str(T_DO), del,
+ del), del);
del = 0;
} else {
for (; del > 0; del--)
- term__putc('\n');
+ term__putc(el, '\n');
/* because the \n will become \r\n */
el->el_cursor.h = 0;
}
@@ -555,12 +579,11 @@ term_move_to_line(EditLine *el, int where)
}
} else { /* del < 0 */
if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up)))
- (void) tputs(tgoto(Str(T_UP), -del, -del), -del,
- term__putc);
+ term_tputs(el, tgoto(Str(T_UP), -del, -del), -del);
else {
if (GoodStr(T_up))
for (; del < 0; del++)
- (void) tputs(Str(T_up), 1, term__putc);
+ term_tputs(el, Str(T_up), 1);
}
}
el->el_cursor.v = where;/* now where is here */
@@ -587,7 +610,7 @@ mc_again:
return;
}
if (!where) { /* if where is first column */
- term__putc('\r'); /* do a CR */
+ term__putc(el, '\r'); /* do a CR */
el->el_cursor.h = 0;
return;
}
@@ -595,12 +618,11 @@ mc_again:
if ((del < -4 || del > 4) && GoodStr(T_ch))
/* go there directly */
- (void) tputs(tgoto(Str(T_ch), where, where), where, term__putc);
+ term_tputs(el, tgoto(Str(T_ch), where, where), where);
else {
if (del > 0) { /* moving forward */
if ((del > 4) && GoodStr(T_RI))
- (void) tputs(tgoto(Str(T_RI), del, del),
- del, term__putc);
+ term_tputs(el, tgoto(Str(T_RI), del, del), del);
else {
/* if I can do tabs, use them */
if (EL_CAN_TAB) {
@@ -611,7 +633,7 @@ mc_again:
(el->el_cursor.h & 0370);
i < (where & 0370);
i += 8)
- term__putc('\t');
+ term__putc(el, '\t');
/* then tab over */
el->el_cursor.h = where & 0370;
}
@@ -631,8 +653,8 @@ mc_again:
}
} else { /* del < 0 := moving backward */
if ((-del > 4) && GoodStr(T_LE))
- (void) tputs(tgoto(Str(T_LE), -del, -del),
- -del, term__putc);
+ term_tputs(el, tgoto(Str(T_LE), -del, -del),
+ -del);
else { /* can't go directly there */
/*
* if the "cost" is greater than the "cost"
@@ -643,12 +665,12 @@ mc_again:
(((unsigned int) where >> 3) +
(where & 07)))
: (-del > where)) {
- term__putc('\r'); /* do a CR */
+ term__putc(el, '\r'); /* do a CR */
el->el_cursor.h = 0;
goto mc_again; /* and try again */
}
for (i = 0; i < -del; i++)
- term__putc('\b');
+ term__putc(el, '\b');
}
}
}
@@ -673,7 +695,7 @@ term_overwrite(EditLine *el, const char *cp, int n)
return;
}
do {
- term__putc(*cp++);
+ term__putc(el, *cp++);
el->el_cursor.h++;
} while (--n);
@@ -689,7 +711,7 @@ term_overwrite(EditLine *el, const char *cp, int n)
!= '\0')
term_overwrite(el, &c, 1);
else
- term__putc(' ');
+ term__putc(el, ' ');
el->el_cursor.h = 1;
}
} else /* no wrap, but cursor stays on screen */
@@ -723,19 +745,18 @@ term_deletechars(EditLine *el, int num)
if (GoodStr(T_DC)) /* if I have multiple delete */
if ((num > 1) || !GoodStr(T_dc)) { /* if dc would be more
* expen. */
- (void) tputs(tgoto(Str(T_DC), num, num),
- num, term__putc);
+ term_tputs(el, tgoto(Str(T_DC), num, num), num);
return;
}
if (GoodStr(T_dm)) /* if I have delete mode */
- (void) tputs(Str(T_dm), 1, term__putc);
+ term_tputs(el, Str(T_dm), 1);
if (GoodStr(T_dc)) /* else do one at a time */
while (num--)
- (void) tputs(Str(T_dc), 1, term__putc);
+ term_tputs(el, Str(T_dc), 1);
if (GoodStr(T_ed)) /* if I have delete mode */
- (void) tputs(Str(T_ed), 1, term__putc);
+ term_tputs(el, Str(T_ed), 1);
}
@@ -764,37 +785,35 @@ term_insertwrite(EditLine *el, char *cp, int num)
if (GoodStr(T_IC)) /* if I have multiple insert */
if ((num > 1) || !GoodStr(T_ic)) {
/* if ic would be more expensive */
- (void) tputs(tgoto(Str(T_IC), num, num),
- num, term__putc);
+ term_tputs(el, tgoto(Str(T_IC), num, num), num);
term_overwrite(el, cp, num);
/* this updates el_cursor.h */
return;
}
if (GoodStr(T_im) && GoodStr(T_ei)) { /* if I have insert mode */
- (void) tputs(Str(T_im), 1, term__putc);
+ term_tputs(el, Str(T_im), 1);
el->el_cursor.h += num;
do
- term__putc(*cp++);
+ term__putc(el, *cp++);
while (--num);
if (GoodStr(T_ip)) /* have to make num chars insert */
- (void) tputs(Str(T_ip), 1, term__putc);
+ term_tputs(el, Str(T_ip), 1);
- (void) tputs(Str(T_ei), 1, term__putc);
+ term_tputs(el, Str(T_ei), 1);
return;
}
do {
if (GoodStr(T_ic)) /* have to make num chars insert */
- (void) tputs(Str(T_ic), 1, term__putc);
- /* insert a char */
+ term_tputs(el, Str(T_ic), 1);
- term__putc(*cp++);
+ term__putc(el, *cp++);
el->el_cursor.h++;
if (GoodStr(T_ip)) /* have to make num chars insert */
- (void) tputs(Str(T_ip), 1, term__putc);
+ term_tputs(el, Str(T_ip), 1);
/* pad the inserted char */
} while (--num);
@@ -810,10 +829,10 @@ term_clear_EOL(EditLine *el, int num)
int i;
if (EL_CAN_CEOL && GoodStr(T_ce))
- (void) tputs(Str(T_ce), 1, term__putc);
+ term_tputs(el, Str(T_ce), 1);
else {
for (i = 0; i < num; i++)
- term__putc(' ');
+ term__putc(el, ' ');
el->el_cursor.h += num; /* have written num spaces */
}
}
@@ -828,14 +847,14 @@ term_clear_screen(EditLine *el)
if (GoodStr(T_cl))
/* send the clear screen code */
- (void) tputs(Str(T_cl), Val(T_li), term__putc);
+ term_tputs(el, Str(T_cl), Val(T_li));
else if (GoodStr(T_ho) && GoodStr(T_cd)) {
- (void) tputs(Str(T_ho), Val(T_li), term__putc); /* home */
+ term_tputs(el, Str(T_ho), Val(T_li)); /* home */
/* clear to bottom of screen */
- (void) tputs(Str(T_cd), Val(T_li), term__putc);
+ term_tputs(el, Str(T_cd), Val(T_li));
} else {
- term__putc('\r');
- term__putc('\n');
+ term__putc(el, '\r');
+ term__putc(el, '\n');
}
}
@@ -848,9 +867,9 @@ term_beep(EditLine *el)
{
if (GoodStr(T_bl))
/* what termcap says we should use */
- (void) tputs(Str(T_bl), 1, term__putc);
+ term_tputs(el, Str(T_bl), 1);
else
- term__putc('\007'); /* an ASCII bell; ^G */
+ term__putc(el, '\007'); /* an ASCII bell; ^G */
}
@@ -862,9 +881,9 @@ protected void
term_clear_to_bottom(EditLine *el)
{
if (GoodStr(T_cd))
- (void) tputs(Str(T_cd), Val(T_li), term__putc);
+ term_tputs(el, Str(T_cd), Val(T_li));
else if (GoodStr(T_ce))
- (void) tputs(Str(T_ce), Val(T_li), term__putc);
+ term_tputs(el, Str(T_ce), Val(T_li));
}
#endif
@@ -936,7 +955,7 @@ term_set(EditLine *el, const char *term)
Val(T_co) = tgetnum("co");
Val(T_li) = tgetnum("li");
for (t = tstr; t->name != NULL; t++) {
- /* XXX: some systems tgetstr needs non const */
+ /* XXX: some systems' tgetstr needs non const */
term_alloc(el, t, tgetstr(strchr(t->name, *t->name),
&area));
}
@@ -1220,26 +1239,62 @@ term_bind_arrow(EditLine *el)
}
}
+/* term_putc():
+ * Add a character
+ */
+private int
+term_putc(int c)
+{
+
+ if (term_outfile == NULL)
+ return -1;
+ return fputc(c, term_outfile);
+}
+
+private void
+term_tputs(EditLine *el, const char *cap, int affcnt)
+{
+#ifdef _REENTRANT
+ pthread_mutex_lock(&term_mutex);
+#endif
+ term_outfile = el->el_outfile;
+ (void)tputs(cap, affcnt, term_putc);
+#ifdef _REENTRANT
+ pthread_mutex_unlock(&term_mutex);
+#endif
+}
/* term__putc():
* Add a character
*/
protected int
-term__putc(int c)
+term__putc(EditLine *el, int c)
{
- return (fputc(c, term_outfile));
+ return fputc(c, el->el_outfile);
}
-
/* term__flush():
* Flush output
*/
protected void
-term__flush(void)
+term__flush(EditLine *el)
{
- (void) fflush(term_outfile);
+ (void) fflush(el->el_outfile);
+}
+
+/* term_writec():
+ * Write the given character out, in a human readable form
+ */
+protected void
+term_writec(EditLine *el, int c)
+{
+ char buf[8];
+ int cnt = key__decode_char(buf, sizeof(buf), 0, c);
+ buf[cnt] = '\0';
+ term_overwrite(el, buf, cnt);
+ term__flush(el);
}
@@ -1269,11 +1324,17 @@ term_telltc(EditLine *el, int argc __attribute__((__unused__)),
(void) fprintf(el->el_outfile, "\tIt %s magic margins\n",
EL_HAS_MAGIC_MARGINS ? "has" : "does not have");
- for (t = tstr, ts = el->el_term.t_str; t->name != NULL; t++, ts++)
+ for (t = tstr, ts = el->el_term.t_str; t->name != NULL; t++, ts++) {
+ const char *ub;
+ if (*ts && **ts) {
+ (void) key__decode_str(*ts, upbuf, sizeof(upbuf), "");
+ ub = upbuf;
+ } else {
+ ub = "(empty)";
+ }
(void) fprintf(el->el_outfile, "\t%25s (%s) == %s\n",
- t->long_name,
- t->name, *ts && **ts ?
- key__decode_str(*ts, upbuf, "") : "(empty)");
+ t->long_name, t->name, ub);
+ }
(void) fputc('\n', el->el_outfile);
return (0);
}
@@ -1292,7 +1353,7 @@ term_settc(EditLine *el, int argc __attribute__((__unused__)),
const char *what, *how;
if (argv == NULL || argv[1] == NULL || argv[2] == NULL)
- return (-1);
+ return -1;
what = argv[1];
how = argv[2];
@@ -1307,7 +1368,7 @@ term_settc(EditLine *el, int argc __attribute__((__unused__)),
if (ts->name != NULL) {
term_alloc(el, ts, how);
term_setflags(el);
- return (0);
+ return 0;
}
/*
* Do the numeric ones second
@@ -1316,46 +1377,100 @@ term_settc(EditLine *el, int argc __attribute__((__unused__)),
if (strcmp(tv->name, what) == 0)
break;
- if (tv->name != NULL) {
- if (tv == &tval[T_pt] || tv == &tval[T_km] ||
- tv == &tval[T_am] || tv == &tval[T_xn]) {
- if (strcmp(how, "yes") == 0)
- el->el_term.t_val[tv - tval] = 1;
- else if (strcmp(how, "no") == 0)
- el->el_term.t_val[tv - tval] = 0;
- else {
- (void) fprintf(el->el_errfile,
- "settc: Bad value `%s'.\n", how);
- return (-1);
- }
- term_setflags(el);
- if (term_change_size(el, Val(T_li), Val(T_co)) == -1)
- return (-1);
- return (0);
- } else {
- long i;
- char *ep;
+ if (tv->name != NULL)
+ return -1;
- i = strtol(how, &ep, 10);
- if (*ep != '\0') {
- (void) fprintf(el->el_errfile,
- "settc: Bad value `%s'.\n", how);
- return (-1);
- }
- el->el_term.t_val[tv - tval] = (int) i;
- el->el_term.t_size.v = Val(T_co);
- el->el_term.t_size.h = Val(T_li);
- if (tv == &tval[T_co] || tv == &tval[T_li])
- if (term_change_size(el, Val(T_li), Val(T_co))
- == -1)
- return (-1);
- return (0);
+ if (tv == &tval[T_pt] || tv == &tval[T_km] ||
+ tv == &tval[T_am] || tv == &tval[T_xn]) {
+ if (strcmp(how, "yes") == 0)
+ el->el_term.t_val[tv - tval] = 1;
+ else if (strcmp(how, "no") == 0)
+ el->el_term.t_val[tv - tval] = 0;
+ else {
+ (void) fprintf(el->el_errfile,
+ "%s: Bad value `%s'.\n", argv[0], how);
+ return -1;
+ }
+ term_setflags(el);
+ if (term_change_size(el, Val(T_li), Val(T_co)) == -1)
+ return -1;
+ return 0;
+ } else {
+ long i;
+ char *ep;
+
+ i = strtol(how, &ep, 10);
+ if (*ep != '\0') {
+ (void) fprintf(el->el_errfile,
+ "%s: Bad value `%s'.\n", argv[0], how);
+ return -1;
}
+ el->el_term.t_val[tv - tval] = (int) i;
+ el->el_term.t_size.v = Val(T_co);
+ el->el_term.t_size.h = Val(T_li);
+ if (tv == &tval[T_co] || tv == &tval[T_li])
+ if (term_change_size(el, Val(T_li), Val(T_co))
+ == -1)
+ return -1;
+ return 0;
}
- return (-1);
}
+/* term_gettc():
+ * Get the current terminal characteristics
+ */
+protected int
+/*ARGSUSED*/
+term_gettc(EditLine *el, int argc __attribute__((__unused__)), char **argv)
+{
+ const struct termcapstr *ts;
+ const struct termcapval *tv;
+ char *what;
+ void *how;
+
+ if (argv == NULL || argv[1] == NULL || argv[2] == NULL)
+ return (-1);
+
+ what = argv[1];
+ how = argv[2];
+
+ /*
+ * Do the strings first
+ */
+ for (ts = tstr; ts->name != NULL; ts++)
+ if (strcmp(ts->name, what) == 0)
+ break;
+
+ if (ts->name != NULL) {
+ *(char **)how = el->el_term.t_str[ts - tstr];
+ return 0;
+ }
+ /*
+ * Do the numeric ones second
+ */
+ for (tv = tval; tv->name != NULL; tv++)
+ if (strcmp(tv->name, what) == 0)
+ break;
+
+ if (tv->name == NULL)
+ return -1;
+
+ if (tv == &tval[T_pt] || tv == &tval[T_km] ||
+ tv == &tval[T_am] || tv == &tval[T_xn]) {
+ static char yes[] = "yes";
+ static char no[] = "no";
+ if (el->el_term.t_val[tv - tval])
+ *(char **)how = yes;
+ else
+ *(char **)how = no;
+ return 0;
+ } else {
+ *(int *)how = el->el_term.t_val[tv - tval];
+ return 0;
+ }
+}
+
/* term_echotc():
* Print the termcap string out with variable substitution
*/
@@ -1441,7 +1556,7 @@ term_echotc(EditLine *el, int argc __attribute__((__unused__)),
break;
}
if (t->name == NULL) {
- /* XXX: some systems tgetstr needs non const */
+ /* XXX: some systems' tgetstr needs non const */
scap = tgetstr(strchr(*argv, **argv), &area);
}
if (!scap || scap[0] == '\0') {
@@ -1494,7 +1609,7 @@ term_echotc(EditLine *el, int argc __attribute__((__unused__)),
*argv);
return (-1);
}
- (void) tputs(scap, 1, term__putc);
+ term_tputs(el, scap, 1);
break;
case 1:
argv++;
@@ -1522,7 +1637,7 @@ term_echotc(EditLine *el, int argc __attribute__((__unused__)),
*argv);
return (-1);
}
- (void) tputs(tgoto(scap, arg_cols, arg_rows), 1, term__putc);
+ term_tputs(el, tgoto(scap, arg_cols, arg_rows), 1);
break;
default:
/* This is wrong, but I will ignore it... */
@@ -1578,8 +1693,7 @@ term_echotc(EditLine *el, int argc __attribute__((__unused__)),
*argv);
return (-1);
}
- (void) tputs(tgoto(scap, arg_cols, arg_rows), arg_rows,
- term__putc);
+ term_tputs(el, tgoto(scap, arg_cols, arg_rows), arg_rows);
break;
}
return (0);
diff --git a/cmd-line-utils/libedit/tokenizer.c b/cmd-line-utils/libedit/tokenizer.c
index 561b41740f8..5161cdd0a22 100644
--- a/cmd-line-utils/libedit/tokenizer.c
+++ b/cmd-line-utils/libedit/tokenizer.c
@@ -32,7 +32,13 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* tokenize.c: Bourne shell like tokenizer
diff --git a/cmd-line-utils/libedit/tokenizer.h b/cmd-line-utils/libedit/tokenizer.h
deleted file mode 100644
index 7cc7a3346e4..00000000000
--- a/cmd-line-utils/libedit/tokenizer.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* $NetBSD: tokenizer.h,v 1.5 2002/03/18 16:01:00 christos Exp $ */
-
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Christos Zoulas of Cornell University.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)tokenizer.h 8.1 (Berkeley) 6/4/93
- */
-
-/*
- * tokenizer.h: Header file for tokenizer routines
- */
-#ifndef _h_tokenizer
-#define _h_tokenizer
-
-typedef struct tokenizer Tokenizer;
-
-Tokenizer *tok_init(const char *);
-void tok_reset(Tokenizer *);
-void tok_end(Tokenizer *);
-int tok_line(Tokenizer *, const char *, int *, const char ***);
-
-#endif /* _h_tokenizer */
diff --git a/cmd-line-utils/libedit/tty.c b/cmd-line-utils/libedit/tty.c
index 6f73fb4f9e7..3706905fc79 100644
--- a/cmd-line-utils/libedit/tty.c
+++ b/cmd-line-utils/libedit/tty.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tty.c,v 1.21 2004/08/13 12:10:39 mycroft Exp $ */
+/* $NetBSD: tty.c,v 1.28 2009/02/06 19:53:23 sketch Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,18 +32,25 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* tty.c: tty interface stuff
*/
#include <assert.h>
+#include <errno.h>
#include "tty.h"
#include "el.h"
typedef struct ttymodes_t {
const char *m_name;
- u_int m_value;
+ unsigned int m_value;
int m_type;
} ttymodes_t;
@@ -438,13 +445,12 @@ private const ttymodes_t ttymodes[] = {
-#define tty_getty(el, td) tcgetattr((el)->el_infd, (td))
-#define tty_setty(el, td) tcsetattr((el)->el_infd, TCSADRAIN, (td))
-
#define tty__gettabs(td) ((((td)->c_oflag & TAB3) == TAB3) ? 0 : 1)
#define tty__geteightbit(td) (((td)->c_cflag & CSIZE) == CS8)
#define tty__cooked_mode(td) ((td)->c_lflag & ICANON)
+private int tty_getty(EditLine *, struct termios *);
+private int tty_setty(EditLine *, int, const struct termios *);
private int tty__getcharindex(int);
private void tty__getchar(struct termios *, unsigned char *);
private void tty__setchar(struct termios *, unsigned char *);
@@ -453,6 +459,29 @@ private int tty_setup(EditLine *);
#define t_qu t_ts
+/* tty_getty():
+ * Wrapper for tcgetattr to handle EINTR
+ */
+private int
+tty_getty(EditLine *el, struct termios *t)
+{
+ int rv;
+ while ((rv = tcgetattr(el->el_infd, t)) == -1 && errno == EINTR)
+ continue;
+ return rv;
+}
+
+/* tty_setty():
+ * Wrapper for tcsetattr to handle EINTR
+ */
+private int
+tty_setty(EditLine *el, int action, const struct termios *t)
+{
+ int rv;
+ while ((rv = tcsetattr(el->el_infd, action, t)) == -1 && errno == EINTR)
+ continue;
+ return rv;
+}
/* tty_setup():
* Get the tty parameters and initialize the editing state
@@ -514,7 +543,7 @@ tty_setup(EditLine *el)
el->el_tty.t_c[TS_IO][rst];
}
tty__setchar(&el->el_tty.t_ex, el->el_tty.t_c[EX_IO]);
- if (tty_setty(el, &el->el_tty.t_ex) == -1) {
+ if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ex) == -1) {
#ifdef DEBUG_TTY
(void) fprintf(el->el_errfile,
"tty_setup: tty_setty: %s\n",
@@ -522,8 +551,11 @@ tty_setup(EditLine *el)
#endif /* DEBUG_TTY */
return (-1);
}
- } else
+ }
+#ifdef notdef
+ else
tty__setchar(&el->el_tty.t_ex, el->el_tty.t_c[EX_IO]);
+#endif
el->el_tty.t_ed.c_iflag &= ~el->el_tty.t_t[ED_IO][MD_INP].t_clrmask;
el->el_tty.t_ed.c_iflag |= el->el_tty.t_t[ED_IO][MD_INP].t_setmask;
@@ -1040,7 +1072,7 @@ tty_rawmode(EditLine *el)
}
}
}
- if (tty_setty(el, &el->el_tty.t_ed) == -1) {
+ if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ed) == -1) {
#ifdef DEBUG_TTY
(void) fprintf(el->el_errfile, "tty_rawmode: tty_setty: %s\n",
strerror(errno));
@@ -1065,7 +1097,7 @@ tty_cookedmode(EditLine *el)
if (el->el_flags & EDIT_DISABLED)
return (0);
- if (tty_setty(el, &el->el_tty.t_ex) == -1) {
+ if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ex) == -1) {
#ifdef DEBUG_TTY
(void) fprintf(el->el_errfile,
"tty_cookedmode: tty_setty: %s\n",
@@ -1101,7 +1133,7 @@ tty_quotemode(EditLine *el)
el->el_tty.t_qu.c_lflag &= ~el->el_tty.t_t[QU_IO][MD_LIN].t_clrmask;
el->el_tty.t_qu.c_lflag |= el->el_tty.t_t[QU_IO][MD_LIN].t_setmask;
- if (tty_setty(el, &el->el_tty.t_qu) == -1) {
+ if (tty_setty(el, TCSADRAIN, &el->el_tty.t_qu) == -1) {
#ifdef DEBUG_TTY
(void) fprintf(el->el_errfile, "QuoteModeOn: tty_setty: %s\n",
strerror(errno));
@@ -1122,7 +1154,7 @@ tty_noquotemode(EditLine *el)
if (el->el_tty.t_mode != QU_IO)
return (0);
- if (tty_setty(el, &el->el_tty.t_ed) == -1) {
+ if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ed) == -1) {
#ifdef DEBUG_TTY
(void) fprintf(el->el_errfile, "QuoteModeOff: tty_setty: %s\n",
strerror(errno));
@@ -1193,10 +1225,14 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const char **argv)
st = len =
strlen(el->el_tty.t_t[z][m->m_type].t_name);
}
- x = (el->el_tty.t_t[z][i].t_setmask & m->m_value)
- ? '+' : '\0';
- x = (el->el_tty.t_t[z][i].t_clrmask & m->m_value)
- ? '-' : x;
+ if (i != -1) {
+ x = (el->el_tty.t_t[z][i].t_setmask & m->m_value)
+ ? '+' : '\0';
+ x = (el->el_tty.t_t[z][i].t_clrmask & m->m_value)
+ ? '-' : x;
+ } else {
+ x = '\0';
+ }
if (x != '\0' || aflag) {
@@ -1221,7 +1257,7 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const char **argv)
return (0);
}
while (argv && (s = *argv++)) {
- char *p;
+ const char *p;
switch (*s) {
case '+':
case '-':
@@ -1232,10 +1268,10 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const char **argv)
break;
}
d = s;
- if ((p = strchr(s, '=')) != NULL)
- *p++ = '\0';
+ p = strchr(s, '=');
for (m = ttymodes; m->m_name; m++)
- if (strcmp(m->m_name, d) == 0 &&
+ if ((p ? strncmp(m->m_name, d, (size_t)(p - d)) :
+ strcmp(m->m_name, d)) == 0 &&
(p == NULL || m->m_type == MD_CHAR))
break;
@@ -1246,7 +1282,7 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const char **argv)
}
if (p) {
int c = ffs((int)m->m_value);
- int v = *p ? parse__escape((const char **const) &p) :
+ int v = *++p ? parse__escape((const char **) &p) :
el->el_tty.t_vdisable;
assert(c-- != 0);
c = tty__getcharindex(c);
@@ -1269,6 +1305,17 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const char **argv)
break;
}
}
+
+ if (el->el_tty.t_mode == z) {
+ if (tty_setty(el, TCSADRAIN, tios) == -1) {
+#ifdef DEBUG_TTY
+ (void) fprintf(el->el_errfile,
+ "tty_stty: tty_setty: %s\n", strerror(errno));
+#endif /* DEBUG_TTY */
+ return (-1);
+ }
+ }
+
return (0);
}
diff --git a/cmd-line-utils/libedit/tty.h b/cmd-line-utils/libedit/tty.h
index cc7c4ad8c66..10e9b98c953 100644
--- a/cmd-line-utils/libedit/tty.h
+++ b/cmd-line-utils/libedit/tty.h
@@ -1,4 +1,4 @@
-/* $NetBSD: tty.h,v 1.10 2003/08/07 16:44:34 agc Exp $ */
+/* $NetBSD: tty.h,v 1.11 2005/06/01 11:37:52 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -450,8 +450,8 @@
typedef struct {
const char *t_name;
- u_int t_setmask;
- u_int t_clrmask;
+ unsigned int t_setmask;
+ unsigned int t_clrmask;
} ttyperm_t[NN_IO][MD_NN];
typedef unsigned char ttychar_t[NN_IO][C_NCC];
diff --git a/cmd-line-utils/libedit/unvis.c b/cmd-line-utils/libedit/unvis.c
deleted file mode 100644
index ffa8ac4251c..00000000000
--- a/cmd-line-utils/libedit/unvis.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/* $NetBSD: unvis.c,v 1.24 2003/08/07 16:42:59 agc Exp $ */
-
-/*-
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#define __LIBC12_SOURCE__
-
-#include <sys/types.h>
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <vis.h>
-
-#ifdef __weak_alias
-__weak_alias(strunvis,_strunvis)
-__weak_alias(unvis,_unvis)
-#endif
-
-#ifdef __warn_references
-__warn_references(unvis,
- "warning: reference to compatibility unvis(); include <vis.h> for correct reference")
-#endif
-
-#if !HAVE_VIS
-/*
- * decode driven by state machine
- */
-#define S_GROUND 0 /* haven't seen escape char */
-#define S_START 1 /* start decoding special sequence */
-#define S_META 2 /* metachar started (M) */
-#define S_META1 3 /* metachar more, regular char (-) */
-#define S_CTRL 4 /* control char started (^) */
-#define S_OCTAL2 5 /* octal digit 2 */
-#define S_OCTAL3 6 /* octal digit 3 */
-#define S_HEX1 7 /* hex digit */
-#define S_HEX2 8 /* hex digit 2 */
-
-#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
-#define xtod(c) (isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10))
-
-int
-unvis(cp, c, astate, flag)
- char *cp;
- int c;
- int *astate, flag;
-{
- return __unvis13(cp, (int)c, astate, flag);
-}
-
-/*
- * unvis - decode characters previously encoded by vis
- */
-int
-__unvis13(cp, c, astate, flag)
- char *cp;
- int c;
- int *astate, flag;
-{
-
- _DIAGASSERT(cp != NULL);
- _DIAGASSERT(astate != NULL);
-
- if (flag & UNVIS_END) {
- if (*astate == S_OCTAL2 || *astate == S_OCTAL3
- || *astate == S_HEX2) {
- *astate = S_GROUND;
- return (UNVIS_VALID);
- }
- return (*astate == S_GROUND ? UNVIS_NOCHAR : UNVIS_SYNBAD);
- }
-
- switch (*astate) {
-
- case S_GROUND:
- *cp = 0;
- if (c == '\\') {
- *astate = S_START;
- return (0);
- }
- if ((flag & VIS_HTTPSTYLE) && c == '%') {
- *astate = S_HEX1;
- return (0);
- }
- *cp = c;
- return (UNVIS_VALID);
-
- case S_START:
- switch(c) {
- case '\\':
- *cp = c;
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- *cp = (c - '0');
- *astate = S_OCTAL2;
- return (0);
- case 'M':
- *cp = (char)0200;
- *astate = S_META;
- return (0);
- case '^':
- *astate = S_CTRL;
- return (0);
- case 'n':
- *cp = '\n';
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case 'r':
- *cp = '\r';
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case 'b':
- *cp = '\b';
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case 'a':
- *cp = '\007';
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case 'v':
- *cp = '\v';
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case 't':
- *cp = '\t';
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case 'f':
- *cp = '\f';
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case 's':
- *cp = ' ';
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case 'E':
- *cp = '\033';
- *astate = S_GROUND;
- return (UNVIS_VALID);
- case '\n':
- /*
- * hidden newline
- */
- *astate = S_GROUND;
- return (UNVIS_NOCHAR);
- case '$':
- /*
- * hidden marker
- */
- *astate = S_GROUND;
- return (UNVIS_NOCHAR);
- }
- *astate = S_GROUND;
- return (UNVIS_SYNBAD);
-
- case S_META:
- if (c == '-')
- *astate = S_META1;
- else if (c == '^')
- *astate = S_CTRL;
- else {
- *astate = S_GROUND;
- return (UNVIS_SYNBAD);
- }
- return (0);
-
- case S_META1:
- *astate = S_GROUND;
- *cp |= c;
- return (UNVIS_VALID);
-
- case S_CTRL:
- if (c == '?')
- *cp |= 0177;
- else
- *cp |= c & 037;
- *astate = S_GROUND;
- return (UNVIS_VALID);
-
- case S_OCTAL2: /* second possible octal digit */
- if (isoctal(c)) {
- /*
- * yes - and maybe a third
- */
- *cp = (*cp << 3) + (c - '0');
- *astate = S_OCTAL3;
- return (0);
- }
- /*
- * no - done with current sequence, push back passed char
- */
- *astate = S_GROUND;
- return (UNVIS_VALIDPUSH);
-
- case S_OCTAL3: /* third possible octal digit */
- *astate = S_GROUND;
- if (isoctal(c)) {
- *cp = (*cp << 3) + (c - '0');
- return (UNVIS_VALID);
- }
- /*
- * we were done, push back passed char
- */
- return (UNVIS_VALIDPUSH);
- case S_HEX1:
- if (isxdigit(c)) {
- *cp = xtod(c);
- *astate = S_HEX2;
- return (0);
- }
- /*
- * no - done with current sequence, push back passed char
- */
- *astate = S_GROUND;
- return (UNVIS_VALIDPUSH);
- case S_HEX2:
- *astate = S_GROUND;
- if (isxdigit(c)) {
- *cp = xtod(c) | (*cp << 4);
- return (UNVIS_VALID);
- }
- return (UNVIS_VALIDPUSH);
- default:
- /*
- * decoder in unknown state - (probably uninitialized)
- */
- *astate = S_GROUND;
- return (UNVIS_SYNBAD);
- }
-}
-
-/*
- * strunvis - decode src into dst
- *
- * Number of chars decoded into dst is returned, -1 on error.
- * Dst is null terminated.
- */
-
-int
-strunvisx(dst, src, flag)
- char *dst;
- const char *src;
- int flag;
-{
- char c;
- char *start = dst;
- int state = 0;
-
- _DIAGASSERT(src != NULL);
- _DIAGASSERT(dst != NULL);
-
- while ((c = *src++) != '\0') {
- again:
- switch (__unvis13(dst, c, &state, flag)) {
- case UNVIS_VALID:
- dst++;
- break;
- case UNVIS_VALIDPUSH:
- dst++;
- goto again;
- case 0:
- case UNVIS_NOCHAR:
- break;
- default:
- return (-1);
- }
- }
- if (__unvis13(dst, c, &state, UNVIS_END) == UNVIS_VALID)
- dst++;
- *dst = '\0';
- return (dst - start);
-}
-
-int
-strunvis(dst, src)
- char *dst;
- const char *src;
-{
- return strunvisx(dst, src, 0);
-}
-#endif
diff --git a/cmd-line-utils/libedit/vi.c b/cmd-line-utils/libedit/vi.c
index b977ce716c6..602383f3231 100644
--- a/cmd-line-utils/libedit/vi.c
+++ b/cmd-line-utils/libedit/vi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vi.c,v 1.20 2004/08/13 12:10:39 mycroft Exp $ */
+/* $NetBSD: vi.c,v 1.28 2009/02/06 13:14:37 sketch Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -32,11 +32,17 @@
* SUCH DAMAGE.
*/
-#include <config.h>
+#include "config.h"
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
+#else
+#endif
+#endif /* not lint && not SCCSID */
/*
* vi.c: Vi mode commands.
@@ -64,8 +70,10 @@ cv_action(EditLine *el, int c)
el->el_line.lastchar - el->el_line.buffer);
el->el_chared.c_vcmd.action = NOP;
el->el_chared.c_vcmd.pos = 0;
- el->el_line.lastchar = el->el_line.buffer;
- el->el_line.cursor = el->el_line.buffer;
+ if (!(c & YANK)) {
+ el->el_line.lastchar = el->el_line.buffer;
+ el->el_line.cursor = el->el_line.buffer;
+ }
if (c & INSERT)
el->el_map.current = el->el_map.key;
@@ -82,7 +90,6 @@ cv_action(EditLine *el, int c)
private el_action_t
cv_paste(EditLine *el, int c)
{
- char *ptr;
c_kill_t *k = &el->el_chared.c_kill;
int len = k->last - k->buf;
@@ -96,12 +103,12 @@ cv_paste(EditLine *el, int c)
if (!c && el->el_line.cursor < el->el_line.lastchar)
el->el_line.cursor++;
- ptr = el->el_line.cursor;
c_insert(el, len);
if (el->el_line.cursor + len > el->el_line.lastchar)
return (CC_ERROR);
- (void) memcpy(ptr, k->buf, len +0u);
+ (void) memcpy(el->el_line.cursor, k->buf, len +0u);
+
return (CC_REFRESH);
}
@@ -592,13 +599,12 @@ vi_delete_prev_char(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_list_or_eof(EditLine *el, int c __attribute__((__unused__)))
+vi_list_or_eof(EditLine *el, int c)
{
if (el->el_line.cursor == el->el_line.lastchar) {
if (el->el_line.cursor == el->el_line.buffer) {
- term_overwrite(el, STReof, 4); /* then do a EOF */
- term__flush();
+ term_writec(el, c); /* then do a EOF */
return (CC_EOF);
} else {
/*
@@ -888,7 +894,7 @@ vi_yank(EditLine *el, int c)
/* vi_comment_out():
* Vi comment out current command
- * [c]
+ * [#]
*/
protected el_action_t
/*ARGSUSED*/
@@ -905,18 +911,19 @@ vi_comment_out(EditLine *el, int c)
/* vi_alias():
* Vi include shell alias
* [@]
- * NB: posix impiles that we should enter insert mode, however
+ * NB: posix implies that we should enter insert mode, however
* this is against historical precedent...
*/
+#ifdef __weak_reference
+extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
+#endif
protected el_action_t
/*ARGSUSED*/
vi_alias(EditLine *el, int c)
{
-#ifdef __weak_extern
+#ifdef __weak_reference
char alias_name[3];
char *alias_text;
- extern char *get_alias_text(const char *);
- __weak_extern(get_alias_text);
if (get_alias_text == 0) {
return CC_ERROR;
@@ -1014,7 +1021,7 @@ vi_histedit(EditLine *el, int c)
return CC_ERROR;
case 0:
close(fd);
- execlp("vi", "vi", tempfile, (char *) NULL);
+ execlp("vi", "vi", tempfile, (char *)NULL);
exit(0);
/*NOTREACHED*/
default:
diff --git a/cmd-line-utils/libedit/vis.c b/cmd-line-utils/libedit/vis.c
deleted file mode 100644
index 127d28733a8..00000000000
--- a/cmd-line-utils/libedit/vis.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/* $NetBSD: vis.c,v 1.27 2004/02/26 23:01:15 enami Exp $ */
-
-/*-
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*-
- * Copyright (c) 1999 The NetBSD Foundation, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* AIX requires this to be the first thing in the file. */
-#if defined (_AIX) && !defined (__GNUC__)
- #pragma alloca
-#endif
-
-#include <config.h>
-
-#ifdef __GNUC__
-# undef alloca
-# define alloca(n) __builtin_alloca (n)
-#else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifndef _AIX
-extern char *alloca ();
-# endif
-# endif
-#endif
-
-#include <sys/types.h>
-
-#include <assert.h>
-#include <vis.h>
-#include <stdlib.h>
-
-#ifdef __weak_alias
-__weak_alias(strsvis,_strsvis)
-__weak_alias(strsvisx,_strsvisx)
-__weak_alias(strvis,_strvis)
-__weak_alias(strvisx,_strvisx)
-__weak_alias(svis,_svis)
-__weak_alias(vis,_vis)
-#endif
-
-#if !HAVE_VIS || !HAVE_SVIS
-#include <ctype.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-
-#undef BELL
-#define BELL '\a'
-
-#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
-#define iswhite(c) (c == ' ' || c == '\t' || c == '\n')
-#define issafe(c) (c == '\b' || c == BELL || c == '\r')
-#define xtoa(c) "0123456789abcdef"[c]
-
-#define MAXEXTRAS 5
-
-
-#define MAKEEXTRALIST(flag, extra, orig) \
-do { \
- const char *o = orig; \
- char *e; \
- while (*o++) \
- continue; \
- extra = alloca((size_t)((o - orig) + MAXEXTRAS)); \
- for (o = orig, e = extra; (*e++ = *o++) != '\0';) \
- continue; \
- e--; \
- if (flag & VIS_SP) *e++ = ' '; \
- if (flag & VIS_TAB) *e++ = '\t'; \
- if (flag & VIS_NL) *e++ = '\n'; \
- if ((flag & VIS_NOSLASH) == 0) *e++ = '\\'; \
- *e = '\0'; \
-} while (/*CONSTCOND*/0)
-
-
-/*
- * This is HVIS, the macro of vis used to HTTP style (RFC 1808)
- */
-#define HVIS(dst, c, flag, nextc, extra) \
-do \
- if (!isascii(c) || !isalnum(c) || strchr("$-_.+!*'(),", c) != NULL) { \
- *dst++ = '%'; \
- *dst++ = xtoa(((unsigned int)c >> 4) & 0xf); \
- *dst++ = xtoa((unsigned int)c & 0xf); \
- } else { \
- SVIS(dst, c, flag, nextc, extra); \
- } \
-while (/*CONSTCOND*/0)
-
-/*
- * This is SVIS, the central macro of vis.
- * dst: Pointer to the destination buffer
- * c: Character to encode
- * flag: Flag word
- * nextc: The character following 'c'
- * extra: Pointer to the list of extra characters to be
- * backslash-protected.
- */
-#define SVIS(dst, c, flag, nextc, extra) \
-do { \
- int isextra; \
- isextra = strchr(extra, c) != NULL; \
- if (!isextra && isascii(c) && (isgraph(c) || iswhite(c) || \
- ((flag & VIS_SAFE) && issafe(c)))) { \
- *dst++ = c; \
- break; \
- } \
- if (flag & VIS_CSTYLE) { \
- switch (c) { \
- case '\n': \
- *dst++ = '\\'; *dst++ = 'n'; \
- continue; \
- case '\r': \
- *dst++ = '\\'; *dst++ = 'r'; \
- continue; \
- case '\b': \
- *dst++ = '\\'; *dst++ = 'b'; \
- continue; \
- case BELL: \
- *dst++ = '\\'; *dst++ = 'a'; \
- continue; \
- case '\v': \
- *dst++ = '\\'; *dst++ = 'v'; \
- continue; \
- case '\t': \
- *dst++ = '\\'; *dst++ = 't'; \
- continue; \
- case '\f': \
- *dst++ = '\\'; *dst++ = 'f'; \
- continue; \
- case ' ': \
- *dst++ = '\\'; *dst++ = 's'; \
- continue; \
- case '\0': \
- *dst++ = '\\'; *dst++ = '0'; \
- if (isoctal(nextc)) { \
- *dst++ = '0'; \
- *dst++ = '0'; \
- } \
- continue; \
- default: \
- if (isgraph(c)) { \
- *dst++ = '\\'; *dst++ = c; \
- continue; \
- } \
- } \
- } \
- if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { \
- *dst++ = '\\'; \
- *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0'; \
- *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0'; \
- *dst++ = (c & 07) + '0'; \
- } else { \
- if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\'; \
- if (c & 0200) { \
- c &= 0177; *dst++ = 'M'; \
- } \
- if (iscntrl(c)) { \
- *dst++ = '^'; \
- if (c == 0177) \
- *dst++ = '?'; \
- else \
- *dst++ = c + '@'; \
- } else { \
- *dst++ = '-'; *dst++ = c; \
- } \
- } \
-} while (/*CONSTCOND*/0)
-
-
-/*
- * svis - visually encode characters, also encoding the characters
- * pointed to by `extra'
- */
-char *
-svis(dst, c, flag, nextc, extra)
- char *dst;
- int c, flag, nextc;
- const char *extra;
-{
- char *nextra;
- _DIAGASSERT(dst != NULL);
- _DIAGASSERT(extra != NULL);
- MAKEEXTRALIST(flag, nextra, extra);
- if (flag & VIS_HTTPSTYLE)
- HVIS(dst, c, flag, nextc, nextra);
- else
- SVIS(dst, c, flag, nextc, nextra);
- *dst = '\0';
- return(dst);
-}
-
-
-/*
- * strsvis, strsvisx - visually encode characters from src into dst
- *
- * Extra is a pointer to a \0-terminated list of characters to
- * be encoded, too. These functions are useful e. g. to
- * encode strings in such a way so that they are not interpreted
- * by a shell.
- *
- * Dst must be 4 times the size of src to account for possible
- * expansion. The length of dst, not including the trailing NULL,
- * is returned.
- *
- * Strsvisx encodes exactly len bytes from src into dst.
- * This is useful for encoding a block of data.
- */
-int
-strsvis(dst, csrc, flag, extra)
- char *dst;
- const char *csrc;
- int flag;
- const char *extra;
-{
- int c;
- char *start;
- char *nextra;
- const unsigned char *src = (const unsigned char *)csrc;
-
- _DIAGASSERT(dst != NULL);
- _DIAGASSERT(src != NULL);
- _DIAGASSERT(extra != NULL);
- MAKEEXTRALIST(flag, nextra, extra);
- if (flag & VIS_HTTPSTYLE) {
- for (start = dst; (c = *src++) != '\0'; /* empty */)
- HVIS(dst, c, flag, *src, nextra);
- } else {
- for (start = dst; (c = *src++) != '\0'; /* empty */)
- SVIS(dst, c, flag, *src, nextra);
- }
- *dst = '\0';
- return (dst - start);
-}
-
-
-int
-strsvisx(dst, csrc, len, flag, extra)
- char *dst;
- const char *csrc;
- size_t len;
- int flag;
- const char *extra;
-{
- int c;
- char *start;
- char *nextra;
- const unsigned char *src = (const unsigned char *)csrc;
-
- _DIAGASSERT(dst != NULL);
- _DIAGASSERT(src != NULL);
- _DIAGASSERT(extra != NULL);
- MAKEEXTRALIST(flag, nextra, extra);
-
- if (flag & VIS_HTTPSTYLE) {
- for (start = dst; len > 0; len--) {
- c = *src++;
- HVIS(dst, c, flag, len ? *src : '\0', nextra);
- }
- } else {
- for (start = dst; len > 0; len--) {
- c = *src++;
- SVIS(dst, c, flag, len ? *src : '\0', nextra);
- }
- }
- *dst = '\0';
- return (dst - start);
-}
-#endif
-
-#if !HAVE_VIS
-/*
- * vis - visually encode characters
- */
-char *
-vis(dst, c, flag, nextc)
- char *dst;
- int c, flag, nextc;
-
-{
- char *extra;
-
- _DIAGASSERT(dst != NULL);
-
- MAKEEXTRALIST(flag, extra, "");
- if (flag & VIS_HTTPSTYLE)
- HVIS(dst, c, flag, nextc, extra);
- else
- SVIS(dst, c, flag, nextc, extra);
- *dst = '\0';
- return (dst);
-}
-
-
-/*
- * strvis, strvisx - visually encode characters from src into dst
- *
- * Dst must be 4 times the size of src to account for possible
- * expansion. The length of dst, not including the trailing NULL,
- * is returned.
- *
- * Strvisx encodes exactly len bytes from src into dst.
- * This is useful for encoding a block of data.
- */
-int
-strvis(dst, src, flag)
- char *dst;
- const char *src;
- int flag;
-{
- char *extra;
-
- MAKEEXTRALIST(flag, extra, "");
- return (strsvis(dst, src, flag, extra));
-}
-
-
-int
-strvisx(dst, src, len, flag)
- char *dst;
- const char *src;
- size_t len;
- int flag;
-{
- char *extra;
-
- MAKEEXTRALIST(flag, extra, "");
- return (strsvisx(dst, src, len, flag, extra));
-}
-#endif
diff --git a/cmd-line-utils/libedit/vis.h b/cmd-line-utils/libedit/vis.h
deleted file mode 100644
index 44f6fc7d785..00000000000
--- a/cmd-line-utils/libedit/vis.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $NetBSD: vis.h,v 1.15 2005/02/03 04:39:32 perry Exp $ */
-
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)vis.h 8.1 (Berkeley) 6/2/93
- */
-
-#ifndef _VIS_H_
-#define _VIS_H_
-
-#include <config.h>
-
-/*
- * to select alternate encoding format
- */
-#define VIS_OCTAL 0x01 /* use octal \ddd format */
-#define VIS_CSTYLE 0x02 /* use \[nrft0..] where appropiate */
-
-/*
- * to alter set of characters encoded (default is to encode all
- * non-graphic except space, tab, and newline).
- */
-#define VIS_SP 0x04 /* also encode space */
-#define VIS_TAB 0x08 /* also encode tab */
-#define VIS_NL 0x10 /* also encode newline */
-#define VIS_WHITE (VIS_SP | VIS_TAB | VIS_NL)
-#define VIS_SAFE 0x20 /* only encode "unsafe" characters */
-
-/*
- * other
- */
-#define VIS_NOSLASH 0x40 /* inhibit printing '\' */
-#define VIS_HTTPSTYLE 0x80 /* http-style escape % HEX HEX */
-
-/*
- * unvis return codes
- */
-#define UNVIS_VALID 1 /* character valid */
-#define UNVIS_VALIDPUSH 2 /* character valid, push back passed char */
-#define UNVIS_NOCHAR 3 /* valid sequence, no character produced */
-#define UNVIS_SYNBAD -1 /* unrecognized escape sequence */
-#define UNVIS_ERROR -2 /* decoder in unknown state (unrecoverable) */
-
-/*
- * unvis flags
- */
-#define UNVIS_END 1 /* no more characters */
-
-__BEGIN_DECLS
-char *vis(char *, int, int, int);
-char *svis(char *, int, int, int, const char *);
-int strvis(char *, const char *, int);
-int strsvis(char *, const char *, int, const char *);
-int strvisx(char *, const char *, size_t, int);
-int strsvisx(char *, const char *, size_t, int, const char *);
-int strunvis(char *, const char *);
-int strunvisx(char *, const char *, int);
-#ifdef __LIBC12_SOURCE__
-int unvis(char *, int, int *, int);
-int __unvis13(char *, int, int *, int);
-#else
-int unvis(char *, int, int *, int);
-#endif
-__END_DECLS
-
-#endif /* !_VIS_H_ */
diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4
index a9f7bd73858..24bdd92b083 100644
--- a/config/ac-macros/character_sets.m4
+++ b/config/ac-macros/character_sets.m4
@@ -5,6 +5,9 @@ dnl you must also create strings/ctype-$charset_name.c
AC_DIVERT_PUSH(0)
+# Any changes to the available character sets must also go into
+# include/config-win.h
+
define(CHARSETS_AVAILABLE0,binary)
define(CHARSETS_AVAILABLE1,armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257)
define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8)
diff --git a/config/ac-macros/ha_ndbcluster.m4 b/config/ac-macros/ha_ndbcluster.m4
index 9df96a7750b..5ee136f2266 100644
--- a/config/ac-macros/ha_ndbcluster.m4
+++ b/config/ac-macros/ha_ndbcluster.m4
@@ -280,7 +280,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
esac
# libndbclient versioning when linked with GNU ld.
- if $LD --version 2>/dev/null|grep -q GNU; then
+ if $LD --version 2>/dev/null|grep GNU >/dev/null 2>&1 ; then
NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver"
AC_CONFIG_FILES(storage/ndb/src/libndb.ver)
fi
diff --git a/configure.in b/configure.in
index 67f58f05d2b..2a56c6554cb 100644
--- a/configure.in
+++ b/configure.in
@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
#
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
-AM_INIT_AUTOMAKE(mysql, 5.1.31-pv-0.2.1)
+AM_INIT_AUTOMAKE(mysql, 5.1.33-pv-0.2.1)
AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10
@@ -378,7 +378,7 @@ fi
MYSQL_PROG_AR
# libmysqlclient versioning when linked with GNU ld.
-if $LD --version 2>/dev/null|grep -q GNU; then
+if $LD --version 2>/dev/null| grep GNU >/dev/null 2>&1; then
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
AC_CONFIG_FILES(libmysql/libmysql.ver)
fi
@@ -450,11 +450,11 @@ AC_SUBST(PERL5)
# Enable the abi_check rule only if gcc is available
-if expr "$CC" : ".*gcc.*"
+if test "$GCC" != "yes" || expr "$CC" : ".*icc.*"
then
- ABI_CHECK="abi_check"
-else
ABI_CHECK=""
+else
+ ABI_CHECK="abi_check"
fi
AC_SUBST(ABI_CHECK)
@@ -2091,7 +2091,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
- pthread_key_delete pthread_rwlock_rdlock pthread_setprio pthread_setschedprio \
+ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
realpath rename rint rwlock_init setupterm \
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
@@ -2114,6 +2114,15 @@ case "$target" in
;;
esac
+case "$mysql_cv_sys_os" in
+ OS400) # i5/OS (OS/400) emits a SIGILL (Function not implemented) when
+ # unsupported priority values are passed to pthread_setschedprio.
+ # Since the only supported value is 1, treat it as inexistent.
+ ;;
+ *) AC_CHECK_FUNCS(pthread_setschedprio)
+ ;;
+esac
+
# Check that isinf() is available in math.h and can be used in both C and C++
# code
AC_MSG_CHECKING(for isinf in <math.h>)
@@ -2863,8 +2872,8 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl
cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl
libmysqld/Makefile libmysqld/examples/Makefile dnl
- mysql-test/Makefile dnl
- mysql-test/ndb/Makefile netware/Makefile sql-bench/Makefile dnl
+ mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl
+ netware/Makefile sql-bench/Makefile dnl
include/mysql_version.h plugin/Makefile win/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index 5606c17ecf3..447d63890bd 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -290,7 +290,8 @@ static void do_resolve()
char buf[1024], *p;
while (fgets(buf, sizeof(buf), fp_dump))
{
- p = buf;
+ /* skip bracket */
+ p= (p= strchr(buf, '[')) ? p+1 : buf;
/* skip space */
while (my_isspace(&my_charset_latin1,*p))
++p;
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index de09f1ebe4b..05b34a0dc45 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -203,8 +203,8 @@ SSL_CTX* SSL_CTX_new(SSL_METHOD*);
SSL* SSL_new(SSL_CTX*);
int SSL_set_fd (SSL*, YASSL_SOCKET_T);
YASSL_SOCKET_T SSL_get_fd(const SSL*);
-int SSL_connect(SSL*); // if you get an error from connect
- // see note at top of REAMDE
+int SSL_connect(SSL*); /* if you get an error from connect
+ see note at top of REAMDE */
int SSL_write(SSL*, const void*, int);
int SSL_read(SSL*, void*, int);
int SSL_accept(SSL*);
diff --git a/include/config-win.h b/include/config-win.h
index cc2b2767663..ab0926af864 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -197,11 +197,6 @@ typedef uint rf_SetTimer;
#define SIGNAL_WITH_VIO_CLOSE
#endif
-/* Use all character sets in MySQL */
-#define USE_MB 1
-#define USE_MB_IDENT 1
-#define USE_STRCOLL 1
-
/* All windows servers should support .sym files */
#undef USE_SYMDIR
#define USE_SYMDIR
@@ -250,6 +245,15 @@ inline double ulonglong2double(ulonglong value)
#define my_off_t2double(A) ulonglong2double(A)
#endif /* _WIN64 */
+inline ulonglong double2ulonglong(double d)
+{
+ double t= d - (double) 0x8000000000000000ULL;
+
+ if (t >= 0)
+ return ((ulonglong) t) + 0x8000000000000000ULL;
+ return (ulonglong) d;
+}
+
#if SIZEOF_OFF_T > 4
#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
#define tell(A) _telli64(A)
@@ -362,49 +366,63 @@ inline double ulonglong2double(ulonglong value)
#define shared_memory_buffer_length 16000
#define default_shared_memory_base_name "MYSQL"
-#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
-#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
-
#define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1
#define HAVE_OPENSSL 1
#define HAVE_YASSL 1
-/* Define charsets you want */
-/* #undef HAVE_CHARSET_armscii8 */
-/* #undef HAVE_CHARSET_ascii */
+#define COMMUNITY_SERVER 1
+#define ENABLED_PROFILING 1
+
+/*
+ Our Windows binaries include all character sets which MySQL supports.
+ Any changes to the available character sets must also go into
+ config/ac-macros/character_sets.m4
+*/
+
+#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
+#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
+
+#define USE_MB 1
+#define USE_MB_IDENT 1
+#define USE_STRCOLL 1
+
+#define HAVE_CHARSET_armscii8
+#define HAVE_CHARSET_ascii
#define HAVE_CHARSET_big5 1
#define HAVE_CHARSET_cp1250 1
-/* #undef HAVE_CHARSET_cp1251 */
-/* #undef HAVE_CHARSET_cp1256 */
-/* #undef HAVE_CHARSET_cp1257 */
-/* #undef HAVE_CHARSET_cp850 */
-/* #undef HAVE_CHARSET_cp852 */
-/* #undef HAVE_CHARSET_cp866 */
+#define HAVE_CHARSET_cp1251
+#define HAVE_CHARSET_cp1256
+#define HAVE_CHARSET_cp1257
+#define HAVE_CHARSET_cp850
+#define HAVE_CHARSET_cp852
+#define HAVE_CHARSET_cp866
#define HAVE_CHARSET_cp932 1
-/* #undef HAVE_CHARSET_dec8 */
+#define HAVE_CHARSET_dec8
#define HAVE_CHARSET_eucjpms 1
#define HAVE_CHARSET_euckr 1
#define HAVE_CHARSET_gb2312 1
#define HAVE_CHARSET_gbk 1
-/* #undef HAVE_CHARSET_greek */
-/* #undef HAVE_CHARSET_hebrew */
-/* #undef HAVE_CHARSET_hp8 */
-/* #undef HAVE_CHARSET_keybcs2 */
-/* #undef HAVE_CHARSET_koi8r */
-/* #undef HAVE_CHARSET_koi8u */
+#define HAVE_CHARSET_geostd8
+#define HAVE_CHARSET_greek
+#define HAVE_CHARSET_hebrew
+#define HAVE_CHARSET_hp8
+#define HAVE_CHARSET_keybcs2
+#define HAVE_CHARSET_koi8r
+#define HAVE_CHARSET_koi8u
#define HAVE_CHARSET_latin1 1
#define HAVE_CHARSET_latin2 1
-/* #undef HAVE_CHARSET_latin5 */
-/* #undef HAVE_CHARSET_latin7 */
-/* #undef HAVE_CHARSET_macce */
-/* #undef HAVE_CHARSET_macroman */
+#define HAVE_CHARSET_latin5
+#define HAVE_CHARSET_latin7
+#define HAVE_CHARSET_macce
+#define HAVE_CHARSET_macroman
#define HAVE_CHARSET_sjis 1
-/* #undef HAVE_CHARSET_swe7 */
+#define HAVE_CHARSET_swe7
#define HAVE_CHARSET_tis620 1
#define HAVE_CHARSET_ucs2 1
#define HAVE_CHARSET_ujis 1
#define HAVE_CHARSET_utf8 1
+
#define HAVE_UCA_COLLATIONS 1
#define HAVE_BOOL 1
diff --git a/include/hash.h b/include/hash.h
index 1f094d48585..f4b82454b81 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/include/m_ctype.h b/include/m_ctype.h
index b85894e94f5..04cf921dfee 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -472,6 +472,7 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
+uint my_charset_repertoire(CHARSET_INFO *cs);
#define _MY_U 01 /* Upper case */
diff --git a/include/my_global.h b/include/my_global.h
index 4feed96e7d6..4581dd6785c 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -724,7 +724,6 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define UNSINT32 /* unsigned int32 */
/* General constants */
-#define SC_MAXWIDTH 256 /* Max width of screen (for error messages) */
#define FN_LEN 256 /* Max file name len */
#define FN_HEADLEN 253 /* Max length of filepart of file name */
#define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */
@@ -789,6 +788,9 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define ulonglong2double(A) ((double) (ulonglong) (A))
#define my_off_t2double(A) ((double) (my_off_t) (A))
#endif
+#ifndef double2ulonglong
+#define double2ulonglong(A) ((ulonglong) (double) (A))
+#endif
#endif
#ifndef offsetof
@@ -1130,6 +1132,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define dbug_volatile
#endif
+/* Some helper macros */
+#define YESNO(X) ((X) ? "yes" : "no")
+
/* Defines for time function */
#define SCALE_SEC 100
#define SCALE_USEC 10000
diff --git a/include/my_sys.h b/include/my_sys.h
index 60122eab94e..5335b65822f 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -39,8 +39,6 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
#define MY_INIT(name); { my_progname= name; my_init(); }
-#define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */
-#define NRERRBUFFS (2) /* Buffers for parameters */
#define MY_FILE_ERROR ((size_t) -1)
/* General bitmaps for my_func's */
@@ -208,7 +206,6 @@ extern void my_large_free(uchar * ptr, myf my_flags);
extern int errno; /* declare errno */
#endif
#endif /* #ifndef errno */
-extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
extern char *home_dir; /* Home directory for user */
extern const char *my_progname; /* program-name (printed in errors) */
extern char NEAR curr_dir[]; /* Current directory for user */
diff --git a/include/myisam.h b/include/myisam.h
index 16175547367..d7bfdf7191e 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -185,7 +185,7 @@ typedef struct st_mi_keydef /* Key definition with open & info */
uint16 maxlength; /* max length of (packed) key (auto) */
uint16 block_size_index; /* block_size (auto) */
uint32 version; /* For concurrent read/write */
- uint32 ftparser_nr; /* distinct ftparser number */
+ uint32 ftkey_nr; /* full-text index number */
HA_KEYSEG *seg,*end;
struct st_mysql_ftparser *parser; /* Fulltext [pre]parser */
diff --git a/include/thr_lock.h b/include/thr_lock.h
index 77d428d1805..e409df30972 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -159,7 +159,8 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
void thr_print_locks(void); /* For debugging */
-my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data);
+my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data,
+ enum thr_lock_type new_lock_type);
void thr_downgrade_write_lock(THR_LOCK_DATA *data,
enum thr_lock_type new_lock_type);
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data);
diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt
index 346278425a7..fa9711b54da 100644
--- a/libmysqld/examples/CMakeLists.txt
+++ b/libmysqld/examples/CMakeLists.txt
@@ -32,7 +32,7 @@ ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
TARGET_LINK_LIBRARIES(mysql_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
ADD_DEPENDENCIES(mysql_embedded libmysqld)
-ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c)
+ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc)
TARGET_LINK_LIBRARIES(mysqltest_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am
index 3425b48645f..109d33a85ae 100644
--- a/libmysqld/examples/Makefile.am
+++ b/libmysqld/examples/Makefile.am
@@ -41,7 +41,7 @@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \
@NDB_SCI_LIBS@
mysqltest_embedded_LINK = $(CXXLINK)
-nodist_mysqltest_embedded_SOURCES = mysqltest.c
+nodist_mysqltest_embedded_SOURCES = mysqltest.cc
mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a
nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 4d321f53ffa..dc9fbbd9aa5 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -17,132 +17,111 @@
## Process this file with automake to create Makefile.in
-SUBDIRS = ndb
+testdir = $(prefix)/mysql-test
-benchdir_root= $(prefix)
-testdir = $(benchdir_root)/mysql-test
-EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \
- valgrind.supp $(PRESCRIPTS)
-EXTRA_DIST = $(EXTRA_SCRIPTS) suite
-GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run
-PRESCRIPTS = mysql-test-run.pl mysql-stress-test.pl
-test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
-CLEANFILES = $(GENSCRIPTS)
+test_SCRIPTS = mtr \
+ mysql-test-run \
+ mysql-test-run.pl \
+ mysql-stress-test.pl
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
+nobase_test_DATA = \
+ lib/v1/mysql-test-run.pl \
+ lib/v1/mtr_cases.pl \
+ lib/v1/mtr_io.pl \
+ lib/v1/mtr_report.pl \
+ lib/v1/My/Config.pm \
+ lib/v1/mtr_gcov.pl \
+ lib/v1/mtr_match.pl \
+ lib/v1/mtr_stress.pl \
+ lib/v1/ndb_config_1_node.ini \
+ lib/v1/ndb_config_2_node.ini \
+ lib/v1/mtr_gprof.pl \
+ lib/v1/mtr_misc.pl \
+ lib/v1/mtr_timer.pl \
+ lib/v1/mtr_im.pl \
+ lib/v1/mtr_process.pl \
+ lib/v1/mtr_unique.pl \
+\
+ lib/mtr_cases.pm \
+ lib/mtr_gcov.pl \
+ lib/mtr_gprof.pl \
+ lib/mtr_io.pl \
+ lib/mtr_match.pm \
+ lib/mtr_misc.pl \
+ lib/mtr_process.pl \
+ lib/mtr_report.pm \
+ lib/mtr_stress.pl \
+ lib/mtr_unique.pm \
+ lib/My/ConfigFactory.pm \
+ lib/My/Config.pm \
+ lib/My/Find.pm \
+ lib/My/Handles.pm \
+ lib/My/Options.pm \
+ lib/My/Test.pm \
+ lib/My/Platform.pm \
+ lib/My/SafeProcess.pm \
+ lib/My/File/Path.pm \
+ lib/My/SysInfo.pm \
+ lib/My/CoreDump.pm \
+ lib/My/SafeProcess/Base.pm \
+ lib/My/SafeProcess/safe_process.pl
+SUBDIRS = lib/My/SafeProcess
+
+EXTRA_DIST = README \
+ valgrind.supp \
+ $(test_SCRIPTS) \
+ $(nobase_test_DATA)
+
+# List of directories containing test + result files and the
+# related test data files that should be copied
+TEST_DIRS = t r include std_data std_data/parts \
+ std_data/ndb_backup50 std_data/ndb_backup51 \
+ std_data/ndb_backup51_data_be std_data/ndb_backup51_data_le \
+ std_data/funcs_1 \
+ extra/binlog_tests/ extra/rpl_tests \
+ suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \
+ suite/bugs/data suite/bugs/t suite/bugs/r \
+ suite/federated \
+ suite/funcs_1 suite/funcs_1/bitdata \
+ suite/funcs_1/include suite/funcs_1/lib suite/funcs_1/r \
+ suite/funcs_1/t suite/funcs_1/views suite/funcs_1/cursors \
+ suite/funcs_1/datadict suite/funcs_1/storedproc suite/funcs_1/triggers \
+ suite/funcs_2 suite/funcs_2/charset suite/funcs_2/data \
+ suite/funcs_2/include suite/funcs_2/lib suite/funcs_2/r \
+ suite/funcs_2/t \
+ suite/jp suite/jp/t suite/jp/r suite/jp/std_data \
+ suite/manual/t suite/manual/r \
+ suite/ndb_team suite/ndb_team/t suite/ndb_team/r \
+ suite/rpl suite/rpl/data suite/rpl/include suite/rpl/r \
+ suite/rpl/t \
+ suite/stress/include suite/stress/t suite/stress/r \
+ suite/ndb suite/ndb/t suite/ndb/r \
+ suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \
+ suite/parts suite/parts/t suite/parts/r suite/parts/inc
+
+# Used by dist-hook and install-data-local to copy all
+# test files into either dist or install directory
+install_test_files:
+ @if test -z "$(INSTALL_TO_DIR)"; then \
+ echo "Set INSTALL_TO_DIR!" && exit 1; \
+ fi
+ @for dir in $(TEST_DIRS); do \
+ from_dir="$(srcdir)/$$dir"; \
+ to_dir="$(INSTALL_TO_DIR)/$$dir"; \
+ $(mkinstalldirs) "$$to_dir"; \
+ for f in `(cd $$from_dir && ls)`; do \
+ if test -f "$$from_dir/$$f"; then \
+ $(INSTALL_DATA) "$$from_dir/$$f" "$$to_dir/$$f" ; \
+ fi; \
+ done \
+ done
dist-hook:
- mkdir -p \
- $(distdir)/t \
- $(distdir)/extra/binlog_tests \
- $(distdir)/extra/rpl_tests \
- $(distdir)/r \
- $(distdir)/include \
- $(distdir)/std_data \
- $(distdir)/std_data/ndb_backup50 \
- $(distdir)/std_data/ndb_backup51 \
- $(distdir)/std_data/ndb_backup51_data_be \
- $(distdir)/std_data/ndb_backup51_data_le \
- $(distdir)/std_data/parts \
- $(distdir)/lib \
- $(distdir)/std_data/funcs_1 \
- $(distdir)/lib/My
- -$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
- -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests
- $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests
- -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests
- -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(distdir)/extra/rpl_tests
- $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
- $(INSTALL_DATA) $(srcdir)/include/*.sql $(distdir)/include
- $(INSTALL_DATA) $(srcdir)/include/*.test $(distdir)/include
- $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
- $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.txt $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(distdir)/std_data/ndb_backup50
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(distdir)/std_data/ndb_backup51_data_be
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(distdir)/std_data/ndb_backup51_data_le
- $(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(distdir)/std_data/parts
- $(INSTALL_DATA) $(srcdir)/std_data/parts/*.MY* $(distdir)/std_data/parts
- $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(distdir)/std_data/funcs_1
- $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
- $(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(distdir)/lib/My
- -rm -rf `find $(distdir)/suite -type d -name SCCS` $(distdir)/suite/row_lock
+ $(MAKE) INSTALL_TO_DIR="$(distdir)" install_test_files
install-data-local:
- $(mkinstalldirs) \
- $(DESTDIR)$(testdir)/t \
- $(DESTDIR)$(testdir)/extra/binlog_tests \
- $(DESTDIR)$(testdir)/extra/rpl_tests \
- $(DESTDIR)$(testdir)/r \
- $(DESTDIR)$(testdir)/include \
- $(DESTDIR)$(testdir)/std_data \
- $(DESTDIR)$(testdir)/std_data/ndb_backup50 \
- $(DESTDIR)$(testdir)/std_data/ndb_backup51 \
- $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be \
- $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le \
- $(DESTDIR)$(testdir)/std_data/parts \
- $(DESTDIR)$(testdir)/lib \
- $(DESTDIR)$(testdir)/std_data/funcs_1 \
- $(DESTDIR)$(testdir)/lib/My
- $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
- -$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
- -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
- $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
- $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests
- $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(DESTDIR)$(testdir)/extra/rpl_tests
- -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(DESTDIR)$(testdir)/extra/binlog_tests
- -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(DESTDIR)$(testdir)/extra/rpl_tests
- $(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include
- $(INSTALL_DATA) $(srcdir)/include/*.sql $(DESTDIR)$(testdir)/include
- $(INSTALL_DATA) $(srcdir)/include/*.test $(DESTDIR)$(testdir)/include
- $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.txt $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le
- $(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(DESTDIR)$(testdir)/std_data/parts
- $(INSTALL_DATA) $(srcdir)/std_data/parts/*.MY* $(DESTDIR)$(testdir)/std_data/parts
- $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(DESTDIR)$(testdir)/std_data/funcs_1
- $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
- $(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(DESTDIR)$(testdir)/lib/My
- for f in `(cd $(srcdir); find suite -type f | egrep -v 'SCCS|row_lock')`; \
- do \
- d=$(DESTDIR)$(testdir)/`dirname $$f`; \
- mkdir -p $$d ; \
- $(INSTALL_DATA) $(srcdir)/$$f $$d ; \
- done
+ $(MAKE) INSTALL_TO_DIR="$(DESTDIR)$(testdir)" install_test_files
uninstall-local:
@RM@ -f -r $(DESTDIR)$(testdir)
@@ -157,31 +136,5 @@ mysql-test-run:
$(RM) -f mysql-test-run
$(LN_S) mysql-test-run.pl mysql-test-run
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''testdir''@!$(testdir)!g' \
- -e 's!@''bindir''@!$(bindir)!g' \
- -e 's!@''scriptdir''@!$(bindir)!g' \
- -e 's!@''prefix''@!$(prefix)!g' \
- -e 's!@''datadir''@!$(datadir)!g' \
- -e 's!@''localstatedir''@!$(localstatedir)!g' \
- -e 's!@''libexecdir''@!$(libexecdir)!g' \
- -e 's!@''PERL''@!@PERL@!' \
- -e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
- -e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \
- -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
- -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
- -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
- -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
- -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
- -e 's!@''USE_NDBCLUSTER''@!@TEST_NDBCLUSTER@!g' \
- $< > $@-t
- @CHMOD@ +x $@-t
- @MV@ $@-t $@
-
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/mysql-test/create-test-result b/mysql-test/create-test-result
deleted file mode 100755
index ad19cdf08a1..00000000000
--- a/mysql-test/create-test-result
+++ /dev/null
@@ -1,65 +0,0 @@
-#! /bin/sh
-
-# This script is a hack for lazy developers who want to get a quick
-# start on the result file. The code here is rather dirty, but it works
-# If you have a spare moment feel free to improve it - the right way is
-# to start mysqld yourself and run mysqltest -r
-
-RESULT_DIR=r
-if [ -z "$EDITOR" ] ; then
- EDITOR=vi
-fi
-
-function die()
-{
- echo $1
- exit 1
-}
-
-function usage()
-{
- echo "Usage: $0 test_name"
- exit 1
-}
-
-test_name=$1
-
-[ -z "$test_name" ] && usage
-
-result_file=$RESULT_DIR/$test_name.result
-reject_file=$RESULT_DIR/$test_name.reject
-
-[ -f $result_file ] && die "result file $result_file has already been created"
-
-touch $result_file
-echo "Running the test case against empty file, will fail, but don't worry"
-./mysql-test-run --local $test_name
-
-if [ -f $reject_file ] ; then
- echo "Below are the contents of the reject file:"
- echo "-----start---------------------"
- cat $reject_file
- echo "-----end-----------------------"
- echo "Is this the output you expected from your test case?(y/n)[n]"
- read yes_no
- if [ x$yes_no = xy ] ; then
- echo "Press any key to edit it in $EDITOR, or Ctrl-C to abort"
- read junk
- $EDITOR $reject_file
- edited="edited"
- fi
- echo "Save $edited file as master result? (y/n)[y]"
- read yes_no
- if [ x$yes_no != xn ]; then
- mv $reject_file $result_file
- fi
-else
- echo "Your test failed so bad, it did not even produce a reject file"
- echo "You need to fix your bugs in the test case, the code, or both"
- exit 1
-fi
-
-
-
-
-
diff --git a/mysql-test/extra/binlog_tests/binlog_truncate.test b/mysql-test/extra/binlog_tests/binlog_truncate.test
new file mode 100644
index 00000000000..dce33b3cef0
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/binlog_truncate.test
@@ -0,0 +1,27 @@
+# BUG #36763: TRUNCATE TABLE fails to replicate when stmt-based
+# binlogging is not supported.
+
+# This should always be logged as a statement, even when executed as a
+# row-by-row deletion.
+
+# $before_truncate A statement to execute (just) before issuing the
+# TRUNCATE TABLE
+
+
+eval CREATE TABLE t1 (a INT) ENGINE=$engine;
+eval CREATE TABLE t2 (a INT) ENGINE=$engine;
+INSERT INTO t2 VALUES (1),(2),(3);
+let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1);
+if (`select length('$before_truncate') > 0`) {
+ eval $before_truncate;
+}
+--echo **** Truncate of empty table shall be logged
+TRUNCATE TABLE t1;
+
+if (`select length('$before_truncate') > 0`) {
+ eval $before_truncate;
+}
+TRUNCATE TABLE t2;
+source include/show_binlog_events.inc;
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test
index e8671ed2da0..14c15a58e18 100644
--- a/mysql-test/extra/binlog_tests/blackhole.test
+++ b/mysql-test/extra/binlog_tests/blackhole.test
@@ -7,7 +7,7 @@
-- source include/have_log_bin.inc
# The server need to be started in $MYSQLTEST_VARDIR since it
-# uses ../std_data_ln/
+# uses ../../std_data/
-- source include/uses_vardir.inc
--disable_warnings
@@ -114,7 +114,7 @@ insert into t1 values(1);
insert ignore into t1 values(1);
replace into t1 values(100);
create table t2 (a varchar(200)) engine=blackhole;
-eval load data infile '../std_data_ln/words.dat' into table t2;
+eval load data infile '../../std_data/words.dat' into table t2;
alter table t1 add b int;
alter table t1 drop b;
create table t3 like t1;
diff --git a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
index fa374502997..b240109f6e6 100644
--- a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
+++ b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
@@ -16,7 +16,8 @@ source include/show_binlog_events.inc;
# escaped).
flush logs;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001
drop table t2;
# End of 4.1 tests
diff --git a/mysql-test/extra/binlog_tests/database.test b/mysql-test/extra/binlog_tests/database.test
index 2e445f98adf..326ecedb60e 100644
--- a/mysql-test/extra/binlog_tests/database.test
+++ b/mysql-test/extra/binlog_tests/database.test
@@ -28,3 +28,5 @@ enable_warnings;
insert into t1 values (1);
drop table tt1, t1;
source include/show_binlog_events.inc;
+
+FLUSH STATUS;
diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
index 6879089a1b7..5db79e4f848 100644
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
@@ -317,17 +317,18 @@ connection con4;
select get_lock("a",10); # wait for rollback to finish
flush logs;
+let $MYSQLD_DATADIR= `select @@datadir`;
# we check that the error code of the "ROLLBACK" event is 0 and not
# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
# and does not make slave to stop)
if (`select @@binlog_format = 'ROW'`)
{
- --exec $MYSQL_BINLOG --start-position=524 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
+ --exec $MYSQL_BINLOG --start-position=524 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
}
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
- --exec $MYSQL_BINLOG --start-position=555 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
+ --exec $MYSQL_BINLOG --start-position=555 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@@ -618,7 +619,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# execute
--error ER_DUP_ENTRY
- load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+ load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
# check
select * from t4;
select count(*) from t1 /* must be 2 */;
diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
index 0a0bef4ca4d..26a70c4319e 100644
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
@@ -278,7 +278,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# execute
--error ER_DUP_ENTRY
- load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+ load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
# check
select * from t4;
select count(*) from t1 /* must be 2 */;
diff --git a/mysql-test/extra/rpl_tests/rpl_EE_err.test b/mysql-test/extra/rpl_tests/rpl_EE_err.test
index b7b393c3d6f..205bbe79dac 100644
--- a/mysql-test/extra/rpl_tests/rpl_EE_err.test
+++ b/mysql-test/extra/rpl_tests/rpl_EE_err.test
@@ -20,7 +20,8 @@
eval create table t1 (a int) engine=$engine_type;
flush tables;
-remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/t1.MYI ;
drop table if exists t1;
save_master_pos;
connection slave;
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
index 1fa3cf034f6..24448a38408 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
@@ -145,6 +145,23 @@ select * from t3 order by a;
connection master;
drop table t1,t2,t3;
+sync_slave_with_master;
+
+#
+# BUG#41986 Replication slave does not pick up proper AUTO_INCREMENT value for Innodb tables
+#
+connection master;
+set auto_increment_increment=1;
+set auto_increment_offset=1;
+CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+show create table t1;
+
+sync_slave_with_master;
+show create table t1;
+
+connection master;
+drop table t1;
# End cleanup
sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_conflicts.test b/mysql-test/extra/rpl_tests/rpl_conflicts.test
new file mode 100644
index 00000000000..8a98059b0ad
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_conflicts.test
@@ -0,0 +1,168 @@
+# ==== Purpose ====
+#
+# Test that slave behaves well in some conflict situations. The
+# following are tested:
+#
+# - The slave SQL thread sees an 'INSERT' of a row with a key that
+# already exists in the table;
+#
+# - The slave SQL thread sees a 'DELETE' of a row that does not
+# exist in the table.
+#
+# In statement-logging mode, the first conflict type causes the slave
+# to stop with an error and the second conflict is ignored.
+#
+# In row-logging mode, the slave behavior depends the value of
+# @@slave_exec_mode on the slave: if @@slave_exec_mode is IDEMPOTENT,
+# the slave should ignore the conflicting statement and continue
+# normally. If @@slave_exec_mode is STRICT, the slave should stop
+# with an error.
+#
+# This test was previously named rpl_stm_mystery22/rpl_row_mystery22.
+#
+#
+# ==== Method ====
+#
+# Create a table on master and slave, insert a row on slave, and
+# insert the same row on master.
+#
+# Create a table on master and slave, insert a row on master with
+# binlogging turned off, and remove the row on master with binlogging
+# turned on.
+#
+#
+# ==== Related bugs ====
+#
+# BUG#31552: Replication breaks when deleting rows from out-of-sync table without PK
+# BUG#31609: Not all RBR slave errors reported as errors
+#
+# Bug in this test case:
+# BUG#37718: rpl.rpl_stm_mystery22 fails sporadically on pushbuild
+#
+#
+# ==== Usage ====
+#
+# This file assumes the following:
+#
+# - The test language variable $slave_is_idempotent is set to 1 if the
+# slave is expected to stop on duplicate key errors (i.e., if the
+# binlog is in statement mode or
+# @@global.slave_exec_mode=STRICT). It is set to 0 otherwise.
+#
+# - Replication has been initialized by include/master-slave.inc
+#
+# - The test adds a suppression for the following warning:
+# Slave: Can't find record in 't1' Error_code: 1032
+
+
+--echo ==== Initialize ====
+
+--echo [on master]
+connection master;
+CREATE TABLE t1(a INT PRIMARY KEY);
+--echo [on slave]
+sync_slave_with_master;
+
+
+--echo ==== Test: SQL thread sees 'INSERT' of existing key ====
+
+--echo ---- Prepare slave so that it will get duplicate key error ----
+# This row will be in the way of the row inserted by master.
+INSERT INTO t1 VALUES (1);
+
+--echo ---- Insert rows on master ----
+--echo [on master]
+connection master;
+# Insert the same row on master
+INSERT INTO t1 VALUES (1);
+save_master_pos;
+SELECT * FROM t1;
+
+--echo [on slave]
+connection slave;
+
+# If we are statement-logging or if slave_exec_mode=STRICT, we now
+# expect to see an error on the slave. Otherwise (i.e., we are
+# row-logging and slave_exec_mode=IDEMPOTENT), we expect that the
+# duplicate row is ignored by the slave and replication continues.
+if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRICT'`) {
+ --echo ---- Wait until slave stops with an error ----
+ # Wait until the slave tries to run the query, fails with duplicate
+ # key error, and stops the SQL thread.
+ let $slave_sql_errno= 1062; # ER_DUP_ENTRY
+ source include/wait_for_slave_sql_error.inc;
+ let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+ --echo Last_SQL_Error = $err (expected "duplicate key" error)
+ SELECT * FROM t1;
+
+ --echo ---- Resolve the conflict on the slave and restart SQL thread ----
+ DELETE FROM t1 WHERE a = 1;
+ START SLAVE SQL_THREAD;
+ source include/wait_for_slave_sql_to_start.inc;
+}
+
+--echo ---- Sync slave and verify that there is no error ----
+sync_with_master;
+let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+--echo Last_SQL_Error = '$err' (expected no error)
+SELECT * FROM t1;
+
+
+--echo ==== Test: SQL thread sees 'DELETE' of non-existing row ====
+
+--echo ---- On master, insert two rows, the second with binlogging off ----
+--echo [on master]
+connection master;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+
+--echo [on slave]
+sync_slave_with_master;
+DELETE FROM t1 WHERE a = 1;
+
+--echo ---- On master, remove the row that does not exist on slave ----
+--echo [on master]
+connection master;
+DELETE FROM t1 WHERE a = 1;
+SELECT * FROM t1;
+save_master_pos;
+
+--echo [on slave]
+connection slave;
+
+# If we are row-logging and slave_exec_mode is STRICT, we now expect
+# an error since the row to delete does not exist on slave. Otherwise
+# (i.e., either we are statement-logging or slave_exec_mode is
+# IDEMPOTENT), the absence of the row to delete is ignored and
+# replication continues.
+if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRICT'`) {
+ --echo ---- Wait until slave stops with an error ----
+ let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND
+ source include/wait_for_slave_sql_error.inc;
+ let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+ --echo Last_SQL_Error = $err (expected "can't find record" error)
+ SELECT * FROM t1;
+
+ --echo ---- Resolve the conflict on the slave and restart SQL thread ----
+ INSERT INTO t1 VALUES (1);
+ START SLAVE SQL_THREAD;
+ source include/wait_for_slave_sql_to_start.inc;
+}
+
+--echo ---- Sync slave and verify that there is no error ----
+# The slave should sync ok, and SHOW SLAVE STATUS should give no
+# error.
+sync_with_master;
+let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+--echo Last_SQL_Error = $err (expected no error)
+SELECT * FROM t1;
+
+
+--echo ==== Clean up ====
+
+--echo [on master]
+connection master;
+DROP TABLE t1;
+
+--echo [on slave]
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
index 5abd04b98ef..c426ac1fae8 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
@@ -419,7 +419,7 @@ connection master;
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
- update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+ update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
--echo
--echo ** Delete from Master **
@@ -497,7 +497,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
--echo ********************************************
--echo
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -554,7 +554,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
--echo ********************************************
--echo
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -697,7 +697,7 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
# Remove below once fixed
#***************************
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -763,7 +763,7 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
--echo ********************************************
--echo
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -840,7 +840,7 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
--echo *****************
--echo
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
index 7e726828a1e..6890913b7d1 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
@@ -94,7 +94,7 @@ SELECT * FROM t2 ORDER BY a;
--echo *** Start Slave ***
connection slave;
START SLAVE;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -429,6 +429,7 @@ set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
diff --git a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
index ee6b0ed1426..0baf49c9fac 100644
--- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
+++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
@@ -4,8 +4,7 @@
# Test of FLUSH NO_WRITE_TO_BINLOG by the way.
#
-
--- source include/master-slave.inc
+source include/master-slave.inc;
let $SERVER_VERSION=`select version()`;
@@ -34,26 +33,32 @@ flush tables;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
-save_master_pos;
-connection slave;
-sync_with_master;
+
+sync_slave_with_master;
# Check that the slave is not confused.
select * from t3;
# Note that all this confusion may cause warnings 'table xx is open on rename'
# in the .err files; these are not fatal and are not reported by mysql-test-run.
-
stop slave;
+source include/wait_for_slave_to_stop.inc;
+
connection master;
drop table t1;
+
connection slave;
flush tables with read lock;
start slave;
-sleep 1;
+source include/wait_for_slave_to_start.inc;
--error 1192
stop slave;
+# Cleanup
+unlock tables;
+
connection master;
drop table t3, t4, t5;
+sync_slave_with_master;
+
# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index 8f32ee674f8..26916642cae 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -23,12 +23,12 @@ connection master;
select last_insert_id();
create table t1(a int not null auto_increment, b int, primary key(a) );
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
# verify that LAST_INSERT_ID() is set by LOAD DATA INFILE
select last_insert_id();
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2;
@@ -56,7 +56,7 @@ sync_with_master;
insert into t1 values(1,10);
connection master;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
@@ -80,7 +80,7 @@ connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
@@ -105,7 +105,7 @@ connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
@@ -125,7 +125,7 @@ reset master;
eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=$engine_type; # no transactions
--error ER_DUP_ENTRY
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
select * from t2;
@@ -141,24 +141,21 @@ alter table t2 drop key day;
connection master;
delete from t2;
--error ER_DUP_ENTRY
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
-drop table t2;
+drop table t1, t2;
connection master;
-drop table t2;
-drop table t1;
+drop table t1, t2;
# BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
--error ER_DUP_ENTRY
-LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
---disable_warnings
DROP TABLE IF EXISTS t1;
---enable_warnings
# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test
index 60ffab316cf..e4ebfd68761 100644
--- a/mysql-test/extra/rpl_tests/rpl_log.test
+++ b/mysql-test/extra/rpl_tests/rpl_log.test
@@ -9,10 +9,8 @@
# test the slave immediately writes DROP TEMPORARY TABLE this_old_table).
# We wait for the slave to have written all he wants to the binlog
# (otherwise RESET MASTER may come too early).
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
+sync_slave_with_master;
+source include/stop_slave.inc;
--source include/wait_for_slave_to_stop.inc
reset master;
reset slave;
@@ -25,8 +23,13 @@ connection master;
eval create table t1(n int not null auto_increment primary key)ENGINE=$engine_type;
insert into t1 values (NULL);
drop table t1;
+let $LOAD_FILE= ../../std_data/words.dat;
+if (!`SELECT length(load_file('$LOAD_FILE'))`){
+ let $LOAD_FILE= ../$LOAD_FILE;
+}
eval create table t1 (word char(20) not null)ENGINE=$engine_type;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+--replace_result $LOAD_FILE LOAD_FILE
+eval load data infile '$LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
@@ -67,19 +70,13 @@ eval create table t3 (a int)ENGINE=$engine_type;
connection master;
select * from t1 order by 1 asc;
-save_master_pos;
-connection slave;
-# Note that the above 'slave start' will cause a 3rd rotate event (a fake one)
-# to go into the relay log (the master always sends a fake one when replication
-# starts).
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%';
---source include/wait_slave_status.inc
-sync_with_master;
+sync_slave_with_master;
+
#check t1 on slave to ensure whether it's identical with on master
select * from t1 order by 1 asc;
flush logs;
-stop slave;
---source include/wait_for_slave_to_stop.inc
+source include/stop_slave.inc;
+source include/start_slave.inc;
connection master;
# Create some entries for second log
@@ -92,12 +89,11 @@ source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000002';
+--replace_column 2 #
show binary logs;
-save_master_pos;
-connection slave;
-start slave;
+sync_slave_with_master;
--source include/wait_for_slave_to_start.inc
-sync_with_master;
+--replace_column 2 #
show binary logs;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
--replace_column 2 # 5 #
@@ -133,9 +129,13 @@ DROP TABLE t3;
# Bug #6880: LAST_INSERT_ID() within a statement
#
+# Reset binlog so that show binlog events will not show the tests
+# above.
+source include/master-slave-reset.inc;
+connection master;
+
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
-reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
source include/show_binlog_events.inc;
@@ -145,4 +145,3 @@ drop table t1;
# End of 4.1 tests
sync_slave_with_master;
-
diff --git a/mysql-test/extra/rpl_tests/rpl_row_001.test b/mysql-test/extra/rpl_tests/rpl_row_001.test
index 6261659c4ce..8eb684e0dff 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_001.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_001.test
@@ -1,7 +1,9 @@
+let $LOAD_FILE= $MYSQLTEST_VARDIR/std_data/words.dat;
CREATE TABLE t1 (word CHAR(20) NOT NULL);
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval LOAD DATA LOCAL INFILE '$MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
+--replace_result $LOAD_FILE LOAD_FILE
+eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
+--replace_result $LOAD_FILE LOAD_FILE
+eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word LIMIT 10;
#
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp002.test b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
index 47afcce875b..5a2ab1912b8 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp002.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
@@ -206,7 +206,7 @@ START TRANSACTION;
-- disable_query_log
-- disable_result_log
let $n=50;
-while ($n>3)
+while ($n)
{
eval call test.p3($n);
dec $n;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
index 0e391cb0f37..3b03caee35c 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
@@ -122,7 +122,7 @@ INSERT INTO t1_nodef VALUES (1,2);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -142,7 +142,7 @@ sync_slave_with_master;
--echo **** On Slave ****
SELECT * FROM t2;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
connection master;
@@ -154,7 +154,7 @@ INSERT INTO t4 VALUES (4);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -168,7 +168,7 @@ INSERT INTO t5 VALUES (5,10,25);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -182,7 +182,7 @@ INSERT INTO t6 VALUES (6,12,36);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -191,7 +191,7 @@ connection master;
INSERT INTO t9 VALUES (6);
sync_slave_with_master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
# Testing some tables extra field that can be null and cannot be null
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
index d007e433ab6..1f5eb5786dd 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
@@ -2,7 +2,7 @@
-- source include/master-slave.inc
create table t1 (word char(20) not null);
-load data infile '../std_data_ln/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1 limit 10;
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
index 3304a0ff46d..2c396c9a209 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
@@ -18,13 +18,18 @@ eval create table t1 (a int, unique(a)) engine=$engine_type;
set sql_log_bin=0;
insert into t1 values(2);
set sql_log_bin=1;
-save_master_pos;
+
--error ER_DUP_ENTRY
insert into t1 values(1),(2);
drop table t1;
-save_master_pos;
+
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
+let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
+--echo Error: "$error" (expected different error codes on master and slave)
+--echo Errno: "$errno" (expected 0)
+drop table t1;
# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_truncate.test b/mysql-test/extra/rpl_tests/rpl_truncate.test
index bca53336514..7036ab126e1 100644
--- a/mysql-test/extra/rpl_tests/rpl_truncate.test
+++ b/mysql-test/extra/rpl_tests/rpl_truncate.test
@@ -9,27 +9,8 @@
--source include/master-slave.inc
-let $format = STATEMENT;
-let $stmt = TRUNCATE TABLE;
+let $trunc_stmt = TRUNCATE TABLE;
--source extra/rpl_tests/rpl_truncate_helper.test
-let $format = MIXED;
-let $stmt = TRUNCATE TABLE;
+let $trunc_stmt = DELETE FROM;
--source extra/rpl_tests/rpl_truncate_helper.test
-
-let $format = ROW;
-let $stmt = TRUNCATE TABLE;
---source extra/rpl_tests/rpl_truncate_helper.test
-
-let $format = STATEMENT;
-let $stmt = DELETE FROM;
---source extra/rpl_tests/rpl_truncate_helper.test
-
-let $format = MIXED;
-let $stmt = DELETE FROM;
---source extra/rpl_tests/rpl_truncate_helper.test
-
-let $format = ROW;
-let $stmt = DELETE FROM;
---source extra/rpl_tests/rpl_truncate_helper.test
-
diff --git a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
index 76db74acfa1..cd1ce93177a 100644
--- a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
+++ b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
@@ -1,42 +1,35 @@
-connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
-connection master;
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-connection slave;
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-RESET SLAVE;
-START SLAVE;
+source include/reset_master_and_slave.inc;
--echo **** On Master ****
connection master;
-eval SET SESSION BINLOG_FORMAT=$format;
-eval SET GLOBAL BINLOG_FORMAT=$format;
-
eval CREATE TABLE t1 (a INT, b LONG) ENGINE=$engine;
INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
---echo **** On Slave ****
sync_slave_with_master;
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
--echo **** On Master ****
connection master;
-eval $stmt t1;
-SELECT * FROM t1;
---echo **** On Slave ****
+eval $trunc_stmt t1;
+sync_slave_with_master;
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+--echo ==== Test using a table with delete triggers ====
+--echo **** On Master ****
+connection master;
+SET @count := 1;
+eval CREATE TABLE t2 (a INT, b LONG) ENGINE=$engine;
+CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
sync_slave_with_master;
-# Should be empty
-SELECT * FROM t1;
--echo **** On Master ****
connection master;
-DROP TABLE t1;
-let $SERVER_VERSION=`select version()`;
-source include/show_binlog_events.inc;
+eval $trunc_stmt t1;
+sync_slave_with_master;
+
+let $diff_table_1=master:test.t2;
+let $diff_table_2=slave:test.t2;
+source include/diff_tables.inc;
connection master;
-RESET MASTER;
+DROP TABLE t1,t2;
+sync_slave_with_master;
diff --git a/mysql-test/fix-result b/mysql-test/fix-result
deleted file mode 100755
index bd380332ff5..00000000000
--- a/mysql-test/fix-result
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/sh
-
-# Sasha's hack to fix results generated with mysql-test-run --record
-# to be version and test port independent. In some cases, further minor
-# manual edititing may be required, but most of the time it should not
-# happen
-
-#It is assumed we are running the script in mysql-test directory
-
-VERSION=4.0.1-alpha-debug-log
-TEST_CASE=$1
-
-if [ -z "$TEST_CASE" ] ;
-then
- echo "usage: $0 test_case_name"
- exit 1
-fi
-
-../extra/replace $VERSION '$VERSION' 9306 '$MASTER_MYPORT' 9307 \
-'$SLAVE_MYPORT' \\ \\\\ -- r/$TEST_CASE.result
-
-
diff --git a/mysql-test/include/analyze-sync_with_master.test b/mysql-test/include/analyze-sync_with_master.test
new file mode 100644
index 00000000000..684c0dbbab7
--- /dev/null
+++ b/mysql-test/include/analyze-sync_with_master.test
@@ -0,0 +1,6 @@
+SHOW PROCESSLIST;
+
+let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
+eval SHOW BINLOG EVENTS IN '$binlog_name';
+
+exit; \ No newline at end of file
diff --git a/mysql-test/include/analyze-timeout.test b/mysql-test/include/analyze-timeout.test
new file mode 100644
index 00000000000..179ad8f748a
--- /dev/null
+++ b/mysql-test/include/analyze-timeout.test
@@ -0,0 +1,3 @@
+SHOW PROCESSLIST;
+
+exit;
diff --git a/mysql-test/include/analyze_failure_sync_with_master.test b/mysql-test/include/analyze_failure_sync_with_master.test
deleted file mode 100644
index e6fd32d2f46..00000000000
--- a/mysql-test/include/analyze_failure_sync_with_master.test
+++ /dev/null
@@ -1,15 +0,0 @@
-# Connect to both master and slave
-connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
-
-vertical_results;
-
-echo == MASTER ===========================================================;
-connection master;
-show master status;
-show slave status;
-
-echo == SLAVE ===========================================================;
-connection slave;
-show master status;
-show slave status;
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index bf70b66e5df..6dcb01c13cf 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -1,51 +1,15 @@
+
#
# This test is executed twice for each test case if mysql-test-run is passed
-# the flag --check-testcase.
-# Before every testcase it's run with mysqltest in record mode and will
-# thus produce an output file
-# that can be compared to output from after the tescase.
-# In that way it's possible to check that a testcase does not have
+# the flag --check-testcase. Before every testcase it is run with mysqltest
+# in record mode and will thus produce an output file that can be compared
+# to output from after the tescase.
+# In that way its possible to check that a testcase does not have
# any unwanted side affects.
#
-
-#
-# Dump all global variables
-#
-SHOW GLOBAL VARIABLES WHERE variable_name != 'timestamp';
-
-#
-# Dump all databases
-#
-SHOW DATABASES;
-
-#
-# Dump the "test" database, all it's tables and their data
-#
---exec $MYSQL_DUMP --skip-comments --skip-lock-tables test
-
-#
-# Dump the "mysql" database and it's tables
-# Select data separately to add "order by"
-#
---exec $MYSQL_DUMP --skip-comments --skip-lock-tables --no-data mysql
-use mysql;
-SELECT * FROM columns_priv;
-SELECT * FROM db ORDER BY host, db, user;
-SELECT * FROM func;
-SELECT * FROM help_category;
-SELECT * FROM help_keyword;
-SELECT * FROM help_relation;
-SELECT * FROM help_relation;
-SELECT * FROM host;
-SELECT * FROM proc;
-SELECT * FROM procs_priv;
-SELECT * FROM tables_priv;
-SELECT * FROM time_zone;
-SELECT * FROM time_zone_leap_second;
-SELECT * FROM time_zone_name;
-SELECT * FROM time_zone_transition;
-SELECT * FROM time_zone_transition_type;
-SELECT * FROM user;
+--disable_query_log
+call mtr.check_testcase();
+--enable_query_log
diff --git a/mysql-test/include/check-warnings.test b/mysql-test/include/check-warnings.test
new file mode 100644
index 00000000000..2144957f742
--- /dev/null
+++ b/mysql-test/include/check-warnings.test
@@ -0,0 +1,61 @@
+#
+# This test is executed once after each test to check the servers
+# for unexpected warnings found in the servers error log
+#
+# NOTE! mysql-test-run.pl has already done a rough filtering
+# of the file and written any suspicious lines
+# to $error_log.warnings file
+#
+--disable_query_log
+
+# Don't write these queries to binlog
+set SQL_LOG_BIN=0;
+
+# Turn off any debug crashes, allow the variable to be
+# non existent in release builds
+--error 0,1193
+set debug="";
+
+use mtr;
+
+create temporary table error_log (
+ row int auto_increment primary key,
+ suspicious int default 1,
+ file_name varchar(255),
+ line varchar(1024) default null
+) engine=myisam;
+
+# Get the name of servers error log
+let $log_error= query_get_value(show variables like 'log_error', Value, 1);
+let $log_warning= $log_error.warnings;
+
+# Try tload the warnings into a temporary table,
+# it might fail with error saying "The MySQL server is
+# running with the --secure-file-priv" in which case
+# an attempt to load the file using LOAD DATA LOCAL is made
+--error 0,1290
+eval load data infile '$log_warning' into table error_log
+ fields terminated by 'xykls37' escaped by ''
+ ignore 1 lines
+ (line)
+ set file_name='$log_error';
+
+if ($mysql_errno)
+{
+ # Try LOAD DATA LOCAL
+ eval load data local infile '$log_warning' into table error_log
+ fields terminated by 'xykls37' escaped by ''
+ ignore 1 lines
+ (line)
+ set file_name='$log_error';
+}
+
+# Call check_warnings to filter out any warning in
+# the error_log table
+call mtr.check_warnings(@result);
+if (`select @result = 0`){
+ skip OK;
+}
+--enable_query_log
+echo ^ Found warnings!!;
+exit;
diff --git a/mysql-test/include/check_events_off.inc b/mysql-test/include/check_events_off.inc
new file mode 100644
index 00000000000..599a4b9e504
--- /dev/null
+++ b/mysql-test/include/check_events_off.inc
@@ -0,0 +1,31 @@
+########## include/check_events_off.inc ####################################
+# #
+# Purpose: #
+# Wait till we can expect that we have no event activity till the scheduler is #
+# switched on again. #
+# = There will be no modifications of user tables by existing events #
+# except they use "INSERT DELAYED" or the server system variable #
+# "concurrent_inserts" is not switched off. #
+# Only some storage engines support concurrent_inserts" or "INSERT DELAYED". #
+# #
+# Creation: #
+# 2008-12-19 mleich Implement this check needed for bug fixes in tests #
+# #
+################################################################################
+
+# 1. Check that the server system variable shows the state needed
+if (`SELECT @@global.event_scheduler <> 'OFF'`)
+{
+ --echo # Error: We expect here that the event scheduler is switched off.
+ SELECT @@global.event_scheduler;
+ --echo # Thinkable reasons:
+ --echo # 1. SET GLOBAL event_scheduler = OFF had not the expected effect.
+ --echo # 2. Use of the current routine (include/check_events_off.inc)
+ --echo # within the wrong situation
+ --die
+}
+# 2. Wait till we have no event_scheduler session within the processlist
+--source include/no_running_event_scheduler.inc
+# 3. Wait till we have no event executor sessions within the processlist
+--source include/no_running_events.inc
+
diff --git a/mysql-test/include/circular_rpl_for_4_hosts_init.inc b/mysql-test/include/circular_rpl_for_4_hosts_init.inc
new file mode 100644
index 00000000000..ac6654777db
--- /dev/null
+++ b/mysql-test/include/circular_rpl_for_4_hosts_init.inc
@@ -0,0 +1,130 @@
+#############################################################
+#
+# Author: Serge Kozlov <skozlov@mysql.com>
+# Date: 03/11/2008
+# Purpose: Set up circular replication based on schema
+# A->B->C->D->A
+#
+# Notes:
+# 1. --slave-num=3 must be added to *-master.opt file
+# 2. Even the test uses new names for servers but file names
+# of log files are still old:
+# master_a -> master.[log|err]
+# master_b -> slave.[log|err]
+# master_c -> slave1.[log|err]
+# master_d -> slave2.[log|err]
+#
+#############################################################
+--source include/master-slave.inc
+
+#
+# Set up circular ring by schema A->B->C->D->A
+#
+
+--connection slave
+STOP SLAVE;
+RESET SLAVE;
+
+# master a
+--connection master
+--disconnect master
+connect (master_a,127.0.0.1,root,,test,$MASTER_MYPORT,);
+RESET MASTER;
+--disable_warnings
+STOP SLAVE;
+--enable_warnings
+RESET SLAVE;
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 1;
+let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+
+# master b
+--connection slave
+--disconnect slave
+connect (master_b,127.0.0.1,root,,test,$SLAVE_MYPORT,);
+RESET MASTER;
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_A_PORT $_binlog_file MASTER_A_LOG_FILE
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root',MASTER_LOG_FILE='$_binlog_file'
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 2;
+let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+
+# master c
+--connection slave1
+--disconnect slave1
+connect (master_c,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
+RESET MASTER;
+--disable_warnings
+STOP SLAVE;
+--enable_warnings
+RESET SLAVE;
+--replace_result $SLAVE_MYPORT MASTER_B_PORT $_binlog_file MASTER_B_LOG_FILE
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT,master_user='root',MASTER_LOG_FILE='$_binlog_file'
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 3;
+let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+
+# master d
+connect (master_d,127.0.0.1,root,,test,$SLAVE_MYPORT2,);
+RESET MASTER;
+--disable_warnings
+STOP SLAVE;
+--enable_warnings
+RESET SLAVE;
+--replace_result $SLAVE_MYPORT1 MASTER_C_PORT $_binlog_file MASTER_C_LOG_FILE
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT1,master_user='root',MASTER_LOG_FILE='$_binlog_file'
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 4;
+let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+
+# master a
+--connection master_a
+--replace_result $SLAVE_MYPORT2 MASTER_D_PORT $_binlog_file MASTER_D_LOG_FILE
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT2,master_user='root',MASTER_LOG_FILE='$_binlog_file'
+
+
+
+# Check server_ids: they should be different
+--connection master_a
+let $_id_a= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
+SHOW VARIABLES LIKE 'auto_increment_%';
+--connection master_b
+let $_id_b= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
+SHOW VARIABLES LIKE 'auto_increment_%';
+--connection master_c
+let $_id_c= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
+SHOW VARIABLES LIKE 'auto_increment_%';
+--connection master_d
+let $_id_d= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
+SHOW VARIABLES LIKE 'auto_increment_%';
+--connection master_a
+let $_compared_ids= (($_id_a <> $_id_b) AND ($_id_a <> $_id_c) AND ($_id_a <> $_id_d) AND ($_id_b <> $_id_c) AND ($_id_b <> $_id_d) AND ($_id_c <> $_id_d)) AS a;
+let $_compared_ids_result= query_get_value(SELECT $_compared_ids, a, 1);
+--echo $_compared_ids_result
+
+# Start ring
+--connection master_a
+connect(slave,127.0.0.1,root,,test,$MASTER_MYPORT);
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+--disconnect slave
+
+--connection master_b
+connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT1);
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+--disconnect slave
+
+--connection master_c
+connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+--disconnect slave
+
+--connection master_d
+connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+--disconnect slave
+
diff --git a/mysql-test/include/circular_rpl_for_4_hosts_sync.inc b/mysql-test/include/circular_rpl_for_4_hosts_sync.inc
new file mode 100644
index 00000000000..68aede76913
--- /dev/null
+++ b/mysql-test/include/circular_rpl_for_4_hosts_sync.inc
@@ -0,0 +1,23 @@
+#############################################################
+#
+# Author: Serge Kozlov <skozlov@mysql.com>
+# Date: 03/11/2008
+# Purpose: Sync all hosts for circular replication based on
+# schema A->B->C->D->A
+#
+# Notes: see include/circular_rpl_for_4_hosts_init.inc
+#
+#############################################################
+
+# Make the full loop of sync
+--connection master_a
+--disable_query_log
+--sync_slave_with_master master_b
+--sync_slave_with_master master_c
+--sync_slave_with_master master_d
+--sync_slave_with_master master_a
+--sync_slave_with_master master_b
+--sync_slave_with_master master_c
+--save_master_pos
+--connection master_a
+--enable_query_log
diff --git a/mysql-test/include/cleanup_fake_relay_log.inc b/mysql-test/include/cleanup_fake_relay_log.inc
new file mode 100644
index 00000000000..43aa46cb657
--- /dev/null
+++ b/mysql-test/include/cleanup_fake_relay_log.inc
@@ -0,0 +1,16 @@
+# ==== Purpose ====
+#
+# Clean up files create by setup_fake_relay_log.inc.
+#
+# ==== Usage ====
+#
+# See setup_fake_relay_log.inc
+
+--echo Cleaning up after setup_fake_relay_log.inc
+
+# Remove files.
+remove_file $_fake_relay_log;
+remove_file $_fake_relay_index;
+--disable_query_log
+eval SET @@global.relay_log_purge= $_fake_relay_log_purge;
+--enable_query_log
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index 98f9c93b25a..a4e7d9ae601 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -267,7 +267,7 @@ select * from t2;
insert into t2 (a) values (1026);
--replace_result $MYSQLTEST_VARDIR ..
--error ER_DUP_ENTRY
-eval load data infile "../std_data_ln/words.dat" into table t1 (a) set a:=f2(26);
+eval load data infile "../../std_data/words.dat" into table t1 (a) set a:=f2(26);
select * from t2;
rollback;
@@ -617,10 +617,10 @@ call p_verify_status_increment(0, 0, 0, 0);
--echo
--echo # No test because of Bug#8729 "rename table fails on temporary table"
---echo # 24. DDL: TRUNCATE TEMPORARY TABLE, does not start a transaction
+--echo # 24. DDL: TRUNCATE TEMPORARY TABLE
--echo
truncate table t2;
-call p_verify_status_increment(2, 0, 2, 0);
+call p_verify_status_increment(4, 0, 4, 0);
commit;
--echo # There is nothing left to commit
call p_verify_status_increment(0, 0, 0, 0);
@@ -671,8 +671,11 @@ call p_verify_status_increment(2, 2, 2, 2);
savepoint a;
call p_verify_status_increment(0, 0, 0, 0);
insert t1 set a=4;
---echo # Sic: a bug. Binlog did not register itself this time.
-call p_verify_status_increment(1, 0, 1, 0);
+--echo # Binlog does not register itself this time for other than the 1st
+--echo # statement of the transaction with MIXED/STATEMENT binlog_format.
+--echo # It needs registering with the ROW format. Therefore 1,0,2,2 are
+--echo # the correct arguments to this test after bug#40221 fixed.
+call p_verify_status_increment(1, 0, 2, 2);
release savepoint a;
rollback;
call p_verify_status_increment(0, 0, 0, 0);
@@ -730,7 +733,7 @@ call p_verify_status_increment(1, 0, 1, 0);
rename table t4 to t3;
call p_verify_status_increment(1, 0, 1, 0);
truncate table t3;
-call p_verify_status_increment(2, 2, 2, 2);
+call p_verify_status_increment(4, 4, 4, 4);
create view v1 as select * from t2;
call p_verify_status_increment(1, 0, 1, 0);
check table t1;
diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc
index febab1eceb4..3b34a5b1ede 100644
--- a/mysql-test/include/concurrent.inc
+++ b/mysql-test/include/concurrent.inc
@@ -637,7 +637,7 @@ drop table t1;
--echo ** connection default
connection default;
drop table t1;
-
+drop user mysqltest@localhost;
disconnect thread1;
disconnect thread2;
diff --git a/mysql-test/include/count_sessions.inc b/mysql-test/include/count_sessions.inc
new file mode 100644
index 00000000000..4728e39ce74
--- /dev/null
+++ b/mysql-test/include/count_sessions.inc
@@ -0,0 +1,21 @@
+# include/count_sessions.inc
+#
+# SUMMARY
+#
+# Stores the number of current sessions in $count_sessions.
+#
+#
+# USAGE
+#
+# Please look into include/wait_until_count_sessions.inc
+# for examples of typical usage.
+#
+#
+# EXAMPLE
+# backup.test, grant3.test
+#
+#
+# Created: 2009-01-14 mleich
+#
+
+let $count_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf
new file mode 100644
index 00000000000..d77fee0e200
--- /dev/null
+++ b/mysql-test/include/default_my.cnf
@@ -0,0 +1,25 @@
+# Use default setting for mysqld processes
+!include default_mysqld.cnf
+
+[mysqld.1]
+
+# Run the master.sh script before starting this process
+#!run-master-sh
+
+log-bin= master-bin
+
+
+[mysqlbinlog]
+disable-force-if-open
+
+# mysql_fix_privilege_tables.sh does not read from [client] so it
+# need its own section
+[mysql_fix_privilege_tables]
+socket= @client.socket
+port= @client.port
+user= @client.user
+password= @client.password
+
+[ENV]
+MASTER_MYPORT= @mysqld.1.port
+MASTER_MYSOCK= @mysqld.1.socket
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
new file mode 100644
index 00000000000..ad0090aaf36
--- /dev/null
+++ b/mysql-test/include/default_mysqld.cnf
@@ -0,0 +1,21 @@
+# Default values that applies to all MySQL Servers
+[mysqld]
+open-files-limit= 1024
+local-infile
+default-character-set= latin1
+
+# Increase default connect_timeout to avoid intermittent
+# disconnects when test servers are put under load see BUG#28359
+connect-timeout= 60
+
+log-bin-trust-function-creators=1
+key_buffer_size= 1M
+sort_buffer= 256K
+max_heap_table_size= 1M
+
+loose-innodb_data_file_path= ibdata1:10M:autoextend
+
+slave-net-timeout=120
+
+log-bin=mysqld-bin
+
diff --git a/mysql-test/include/default_ndbd.cnf b/mysql-test/include/default_ndbd.cnf
new file mode 100644
index 00000000000..9a88a5936aa
--- /dev/null
+++ b/mysql-test/include/default_ndbd.cnf
@@ -0,0 +1,27 @@
+
+[cluster_config]
+MaxNoOfSavedMessages= 1000
+MaxNoOfConcurrentTransactions= 128
+MaxNoOfConcurrentOperations= 10000
+DataMemory= 20M
+IndexMemory= 1M
+Diskless= 0
+TimeBetweenWatchDogCheck= 30000
+MaxNoOfOrderedIndexes= 32
+MaxNoOfAttributes= 2048
+TimeBetweenGlobalCheckpoints= 500
+NoOfFragmentLogFiles= 4
+FragmentLogFileSize= 12M
+DiskPageBufferMemory= 4M
+
+# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
+#ODirect= 1
+# the following parametes just function as a small regression
+# test that the parameter exists
+InitialNoOfOpenFiles= 27
+
+# Increase timeouts for slow test-machines
+HeartbeatIntervalDbDb= 30000
+HeartbeatIntervalDbApi= 30000
+
+#TransactionDeadlockDetectionTimeout= 7500
diff --git a/mysql-test/include/federated.inc b/mysql-test/include/federated.inc
deleted file mode 100644
index 925ecdd9682..00000000000
--- a/mysql-test/include/federated.inc
+++ /dev/null
@@ -1,28 +0,0 @@
---source include/have_log_bin.inc
---source include/not_embedded.inc
---source ./include/have_federated_db.inc
-
-source ./include/master-slave.inc;
-
-# remote table creation
-
-# We have to sync with master, to ensure slave had time to start properly
-# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
-connection master;
-sync_slave_with_master;
-
-connection slave;
-#--replicate-ignore-db=federated
-stop slave;
-
---disable_warnings
-# at this point, we are connected to master
-DROP DATABASE IF EXISTS federated;
---enable_warnings
-CREATE DATABASE federated;
-
-connection master;
---disable_warnings
-DROP DATABASE IF EXISTS federated;
---enable_warnings
-CREATE DATABASE federated;
diff --git a/mysql-test/include/have_32bit.inc b/mysql-test/include/have_32bit.inc
index b09a813967d..66684fb5325 100644
--- a/mysql-test/include/have_32bit.inc
+++ b/mysql-test/include/have_32bit.inc
@@ -11,6 +11,6 @@ eval SET @@global.sort_buffer_size = $save;
--enable_query_log
if (!$mach32)
{
- skip Need a 32 bit machine;
+ skip Need a 32 bit machine/binary;
}
diff --git a/mysql-test/include/have_64bit.inc b/mysql-test/include/have_64bit.inc
index 31529a0c9d4..cbba5e1d338 100644
--- a/mysql-test/include/have_64bit.inc
+++ b/mysql-test/include/have_64bit.inc
@@ -9,6 +9,6 @@ eval SET @@session.sort_buffer_size = $save;
--enable_query_log
if (!$mach64)
{
- skip Need a 64 bit machine;
+ skip Need a 64 binary ;
}
diff --git a/mysql-test/include/have_blackhole.inc b/mysql-test/include/have_blackhole.inc
index 6c4da01d61d..146f5afb0d5 100644
--- a/mysql-test/include/have_blackhole.inc
+++ b/mysql-test/include/have_blackhole.inc
@@ -1,4 +1,5 @@
-disable_query_log;
---require r/true.require
-select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'blackhole';
-enable_query_log;
+if (!`SELECT count(*) FROM information_schema.engines WHERE
+ (support = 'YES' OR support = 'DEFAULT') AND
+ engine = 'blackhole'`){
+ skip Need blackhole engine;
+}
diff --git a/mysql-test/include/have_bug25714.inc b/mysql-test/include/have_bug25714.inc
deleted file mode 100644
index 1d957bec2ec..00000000000
--- a/mysql-test/include/have_bug25714.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Check if the variable MYSQL_BUG25714 is set
-#
---require r/have_bug25714.require
-disable_query_log;
-eval select LENGTH('$MYSQL_BUG25714') > 0 as 'have_bug25714_exe';
-enable_query_log;
diff --git a/mysql-test/include/have_federated_db.inc b/mysql-test/include/have_federated_db.inc
deleted file mode 100644
index 041a29f460b..00000000000
--- a/mysql-test/include/have_federated_db.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-disable_query_log;
---require r/true.require
-select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'federated';
-enable_query_log;
diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc
index 5bcdb30b3e0..369af9b8e1d 100644
--- a/mysql-test/include/have_log_bin.inc
+++ b/mysql-test/include/have_log_bin.inc
@@ -1,3 +1,11 @@
+# ==== Purpose ====
+#
+# Ensure that the server is running with binlogging on
+#
+# ==== Usage ====
+#
+# source include/have_log_bin.inc;
+
-- require r/have_log_bin.require
disable_query_log;
show variables like 'log_bin';
diff --git a/mysql-test/include/have_ndbapi_examples.inc b/mysql-test/include/have_ndbapi_examples.inc
index df7aa41ec5d..88499d555c0 100644
--- a/mysql-test/include/have_ndbapi_examples.inc
+++ b/mysql-test/include/have_ndbapi_examples.inc
@@ -1,4 +1,4 @@
--require r/have_ndbapi_examples.require
disable_query_log;
-eval select LENGTH('$MY_NDB_EXAMPLES_BINARY') > 0 as 'have_ndb_example';
+eval select LENGTH('$NDB_EXAMPLES_BINARY') > 0 as 'have_ndb_example';
enable_query_log;
diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc
new file mode 100644
index 00000000000..c85786bd524
--- /dev/null
+++ b/mysql-test/include/have_simple_parser.inc
@@ -0,0 +1,16 @@
+#
+# Check if server has support for loading udf's
+# i.e it will support dlopen
+#
+--require r/have_dynamic_loading.require
+disable_query_log;
+show variables like 'have_dynamic_loading';
+enable_query_log;
+
+#
+# Check if the variable SIMPLE_PARSER is set
+#
+--require r/have_simple_parser.require
+disable_query_log;
+eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
+enable_query_log;
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index 023d582065e..5837df67a75 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -501,4 +501,30 @@ SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
DROP TABLE t1;
+--echo #
+--echo # BUG#40974: Incorrect query results when using clause evaluated using range check
+--echo #
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2(a int, b int);
+insert into t2 values (1,1), (2, 1000);
+create table t3 (a int, b int, filler char(100), key(a), key(b));
+
+insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
+insert into t3 values (1,1,'data');
+insert into t3 values (1,1,'data');
+-- echo The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
+explain select * from t1
+where exists (select 1 from t2, t3
+ where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+
+select * from t1
+where exists (select 1 from t2, t3
+ where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+
+drop table t0, t1, t2, t3;
+
--echo End of 5.0 tests
diff --git a/mysql-test/include/linux_sys_vars.inc b/mysql-test/include/linux_sys_vars.inc
index 4401a1e057a..85d7c6df7dc 100644
--- a/mysql-test/include/linux_sys_vars.inc
+++ b/mysql-test/include/linux_sys_vars.inc
@@ -9,7 +9,6 @@ SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size = 131072;
-SET @min_key_buffer_size = 36;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;
diff --git a/mysql-test/include/loaddata_autocom.inc b/mysql-test/include/loaddata_autocom.inc
index cca56709331..bb286fb4169 100644
--- a/mysql-test/include/loaddata_autocom.inc
+++ b/mysql-test/include/loaddata_autocom.inc
@@ -7,16 +7,20 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
drop table if exists t1;
--enable_warnings
+let $load_file= $MYSQLTEST_VARDIR/std_data/loaddata2.dat;
+
# NDB does not support the create option 'Binlog of table with BLOB attribute and no PK'
# So use a dummy PK here.
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
start transaction;
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
+--replace_result $load_file LOAD_FILE
+eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
commit;
select count(*) from t1;
truncate table t1;
start transaction;
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
+--replace_result $load_file LOAD_FILE
+eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
rollback;
select count(*) from t1;
diff --git a/mysql-test/include/master-slave-reset.inc b/mysql-test/include/master-slave-reset.inc
index 1363fab236a..938eb2c074a 100644
--- a/mysql-test/include/master-slave-reset.inc
+++ b/mysql-test/include/master-slave-reset.inc
@@ -1,6 +1,13 @@
+# Reset the master and the slave to start fresh.
+#
+# It is necessary to execute RESET MASTER and RESET SLAVE on both
+# master and slave since the replication setup might be circular.
+#
+# Since we expect STOP SLAVE to produce a warning as the slave is
+# stopped (the server was started with skip-slave-start), we disable
+# warnings when doing STOP SLAVE.
+
connection slave;
-#we expect STOP SLAVE to produce a warning as the slave is stopped
-#(the server was started with skip-slave-start)
--disable_warnings
stop slave;
source include/wait_for_slave_to_stop.inc;
@@ -13,11 +20,17 @@ use test;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
reset master;
+--disable_query_log
+reset slave;
+--enable_query_log
connection slave;
reset slave;
# Clean up old test tables
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
+--disable_query_log
+reset master;
+--enable_query_log
start slave;
source include/wait_for_slave_to_start.inc;
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index d2332edd5dc..cc9183205be 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -623,7 +623,8 @@ DROP TABLE t1,t2,t3;
#
create table t1 (a int) engine=innodb;
-copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/bug29807.frm;
+let $MYSQLD_DATADIR= `select @@datadir`;
+copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/bug29807.frm;
--error 1146
select * from bug29807;
drop table t1;
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
new file mode 100644
index 00000000000..12cb2c870a2
--- /dev/null
+++ b/mysql-test/include/mtr_check.sql
@@ -0,0 +1,59 @@
+delimiter ||;
+
+use mtr||
+
+--
+-- Procedure used to check if server has been properly
+-- restored after testcase has been run
+--
+CREATE DEFINER=root@localhost PROCEDURE check_testcase()
+BEGIN
+
+ -- Dump all global variables except those
+ -- that are supposed to change
+ SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME;
+
+ -- Dump all databases, there should be none
+ -- except those that was created during bootstrap
+ SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
+
+ -- The test database should not contain any tables
+ SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES
+ WHERE table_schema='test';
+
+ -- Show "mysql" database, tables and columns
+ SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql
+ FROM INFORMATION_SCHEMA.TABLES
+ WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
+ ORDER BY tables_in_mysql;
+ SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql,
+ column_name, ordinal_position, column_default, is_nullable,
+ data_type, character_maximum_length, character_octet_length,
+ numeric_precision, numeric_scale, character_set_name,
+ collation_name, column_type, column_key, extra, column_comment
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
+ ORDER BY columns_in_mysql;
+
+ -- Checksum system tables to make sure they have been properly
+ -- restored after test
+ checksum table
+ mysql.columns_priv,
+ mysql.db,
+ mysql.func,
+ mysql.help_category,
+ mysql.help_keyword,
+ mysql.help_relation,
+ mysql.host,
+ mysql.proc,
+ mysql.procs_priv,
+ mysql.tables_priv,
+ mysql.time_zone,
+ mysql.time_zone_leap_second,
+ mysql.time_zone_name,
+ mysql.time_zone_transition,
+ mysql.time_zone_transition_type,
+ mysql.user;
+
+END||
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
new file mode 100644
index 00000000000..73287900f3c
--- /dev/null
+++ b/mysql-test/include/mtr_warnings.sql
@@ -0,0 +1,238 @@
+delimiter ||;
+
+use mtr||
+
+--
+-- Create table where testcases can insert patterns to
+-- be suppressed
+--
+CREATE TABLE test_suppressions (
+ pattern VARCHAR(255)
+) ENGINE=MyISAM||
+
+
+--
+-- Declare a trigger that makes sure
+-- no invalid patterns can be inserted
+-- into test_suppressions
+--
+/*!50002
+CREATE DEFINER=root@localhost TRIGGER ts_insert
+BEFORE INSERT ON test_suppressions
+FOR EACH ROW BEGIN
+ DECLARE dummy INT;
+ SELECT "" REGEXP NEW.pattern INTO dummy;
+END
+*/||
+
+
+--
+-- Load table with patterns that will be suppressed globally(always)
+--
+CREATE TABLE global_suppressions (
+ pattern VARCHAR(255)
+) ENGINE=MyISAM||
+
+
+-- Declare a trigger that makes sure
+-- no invalid patterns can be inserted
+-- into global_suppressions
+--
+/*!50002
+CREATE DEFINER=root@localhost TRIGGER gs_insert
+BEFORE INSERT ON global_suppressions
+FOR EACH ROW BEGIN
+ DECLARE dummy INT;
+ SELECT "" REGEXP NEW.pattern INTO dummy;
+END
+*/||
+
+
+
+--
+-- Insert patterns that should always be suppressed
+--
+INSERT INTO global_suppressions VALUES
+ ("'SELECT UNIX_TIMESTAMP\\(\\)' failed on master"),
+ ("Aborted connection"),
+ ("Client requested master to start replication from impossible position"),
+ ("Could not find first log file name in binary log"),
+ ("Enabling keys got errno"),
+ ("Error reading master configuration"),
+ ("Error reading packet"),
+ ("Event Scheduler"),
+ ("Failed to open log"),
+ ("Failed to open the existing master info file"),
+ ("Forcing shutdown of [0-9]* plugins"),
+ ("Forcing close of thread"),
+
+ /*
+ Due to timing issues, it might be that this warning
+ is printed when the server shuts down and the
+ computer is loaded.
+ */
+
+ ("Got error [0-9]* when reading table"),
+ ("Incorrect definition of table"),
+ ("Incorrect information in file"),
+ ("InnoDB: Warning: we did not need to do crash recovery"),
+ ("Invalid \\(old\\?\\) table or database name"),
+ ("Lock wait timeout exceeded"),
+ ("Log entry on master is longer than max_allowed_packet"),
+ ("unknown option '--loose-"),
+ ("unknown variable 'loose-"),
+ ("You have forced lower_case_table_names to 0 through a command-line option"),
+ ("Setting lower_case_table_names=2"),
+ ("NDB Binlog:"),
+ ("NDB: failed to setup table"),
+ ("NDB: only row based binary logging"),
+ ("Neither --relay-log nor --relay-log-index were used"),
+ ("Query partially completed"),
+ ("Slave I.O thread aborted while waiting for relay log"),
+ ("Slave SQL thread is stopped because UNTIL condition"),
+ ("Slave SQL thread retried transaction"),
+ ("Slave \\(additional info\\)"),
+ ("Slave: .*Duplicate column name"),
+ ("Slave: .*master may suffer from"),
+ ("Slave: According to the master's version"),
+ ("Slave: Column [0-9]* type mismatch"),
+ ("Slave: Error .* doesn't exist"),
+ ("Slave: Error .*Unknown table"),
+ ("Slave: Error in Write_rows event: "),
+ ("Slave: Field .* of table .* has no default value"),
+ ("Slave: Field .* doesn't have a default value"),
+ ("Slave: Query caused different errors on master and slave"),
+ ("Slave: Table .* doesn't exist"),
+ ("Slave: Table width mismatch"),
+ ("Slave: The incident LOST_EVENTS occured on the master"),
+ ("Slave: Unknown error.* 1105"),
+ ("Slave: Can't drop database.* database doesn't exist"),
+ ("Slave SQL:.*(Error_code: \[\[:digit:\]\]+|Query:.*)"),
+ ("Sort aborted"),
+ ("Time-out in NDB"),
+ ("Warning:\s+One can only use the --user.*root"),
+ ("Warning:\s+Setting lower_case_table_names=2"),
+ ("Warning:\s+Table:.* on (delete|rename)"),
+ ("You have an error in your SQL syntax"),
+ ("deprecated"),
+ ("description of time zone"),
+ ("equal MySQL server ids"),
+ ("error .*connecting to master"),
+ ("error reading log entry"),
+ ("lower_case_table_names is set"),
+ ("skip-name-resolve mode"),
+ ("slave SQL thread aborted"),
+ ("Slave: .*Duplicate entry"),
+
+ /*
+ Special case, made as specific as possible, for:
+ Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes
+ server coredump
+ */
+
+ ("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49"),
+
+ ("Statement is not safe to log in statement format"),
+
+ /* test case for Bug#bug29807 copies a stray frm into database */
+ ("InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal"),
+ ("Cannot find or open table test\/bug29807 from"),
+
+ /* innodb foreign key tests that fail in ALTER or RENAME produce this */
+ ("InnoDB: Error: in ALTER TABLE `test`.`t[12]`"),
+ ("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
+ ("InnoDB: Error: table `test`.`t[12]` does not exist in the InnoDB internal"),
+
+ /* Test case for Bug#14233 produces the following warnings: */
+ ("Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc"),
+ ("Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc"),
+ ("Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc"),
+
+ /*
+ BUG#32080 - Excessive warnings on Solaris: setrlimit could not
+ change the size of core files
+ */
+ ("setrlimit could not change the size of core files to 'infinity'"),
+
+ /*
+ rpl_extrColmaster_*.test, the slave thread produces warnings
+ when it get updates to a table that has more columns on the
+ master
+ */
+ ("Slave: Unknown column 'c7' in 't15' Error_code: 1054"),
+ ("Slave: Can't DROP 'c7'.* 1091"),
+ ("Slave: Key column 'c6'.* 1072"),
+
+ /* Test case for Bug#31590 in order_by.test produces the following error */
+ ("Out of sort memory; increase server sort buffer size"),
+
+ /* Special case for Bug #26402 in show_check.test
+ - Question marks are not valid file name parts on Windows. Ignore
+ this error message.
+ */
+ ("Can't find file: '.\\\\test\\\\\\?{8}.frm'"),
+
+ ("THE_LAST_SUPPRESSION")||
+
+
+--
+-- Procedure that uses the above created tables to check
+-- the servers error log for warnings
+--
+CREATE DEFINER=root@localhost PROCEDURE check_warnings(OUT result INT)
+BEGIN
+ DECLARE `pos` bigint unsigned;
+
+ -- Don't write these queries to binlog
+ SET SQL_LOG_BIN=0;
+
+ --
+ -- Remove mark from lines that are suppressed by global suppressions
+ --
+ UPDATE error_log el, global_suppressions gs
+ SET suspicious=0
+ WHERE el.suspicious=1 AND el.line REGEXP gs.pattern;
+
+ --
+ -- Remove mark from lines that are suppressed by test specific suppressions
+ --
+ UPDATE error_log el, test_suppressions ts
+ SET suspicious=0
+ WHERE el.suspicious=1 AND el.line REGEXP ts.pattern;
+
+ --
+ -- Get the number of marked lines and return result
+ --
+ SELECT COUNT(*) INTO @num_warnings FROM error_log
+ WHERE suspicious=1;
+
+ IF @num_warnings > 0 THEN
+ SELECT file_name, line
+ FROM error_log WHERE suspicious=1;
+ --SELECT * FROM test_suppressions;
+ -- Return 2 -> check failed
+ SELECT 2 INTO result;
+ ELSE
+ -- Return 0 -> OK
+ SELECT 0 INTO RESULT;
+ END IF;
+
+ -- Cleanup for next test
+ TRUNCATE test_suppressions;
+ DROP TABLE error_log;
+
+END||
+
+--
+-- Declare a procedure testcases can use to insert test
+-- specific suppressions
+--
+/*!50001
+CREATE DEFINER=root@localhost
+PROCEDURE add_suppression(pattern VARCHAR(255))
+BEGIN
+ INSERT INTO test_suppressions (pattern) VALUES (pattern);
+END
+*/||
+
+
diff --git a/mysql-test/include/mysqlbinlog_row_engine.inc b/mysql-test/include/mysqlbinlog_row_engine.inc
index 8211baea22c..95440ab04a0 100644
--- a/mysql-test/include/mysqlbinlog_row_engine.inc
+++ b/mysql-test/include/mysqlbinlog_row_engine.inc
@@ -1651,7 +1651,7 @@ FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo # Cleanup.
@@ -1731,7 +1731,7 @@ FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo # Cleanup.
@@ -1854,7 +1854,7 @@ FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo # Cleanup.
@@ -1887,7 +1887,7 @@ eval CREATE TABLE t1 (
--echo #
--echo # Load data.
--echo #
-LOAD DATA INFILE '../std_data_ln/loaddata5.dat'
+LOAD DATA INFILE '../../std_data/loaddata5.dat'
INTO TABLE t1 FIELDS TERMINATED BY '' ENCLOSED BY '' (c1,c2)
SET c3 = 'Wow';
@@ -1912,7 +1912,7 @@ FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo # Cleanup.
diff --git a/mysql-test/include/mysqltest-x.inc b/mysql-test/include/mysqltest-x.inc
index dd1468aed07..797c5c39f3f 100644
--- a/mysql-test/include/mysqltest-x.inc
+++ b/mysql-test/include/mysqltest-x.inc
@@ -1,2 +1,3 @@
echo Output from mysqltest-x.inc;
+exit;
diff --git a/mysql-test/include/ndb_backup.inc b/mysql-test/include/ndb_backup.inc
index f0a883d4e11..e6780788fe9 100644
--- a/mysql-test/include/ndb_backup.inc
+++ b/mysql-test/include/ndb_backup.inc
@@ -2,23 +2,21 @@
# By JBM 2006-02-16 So that the code is not repeated #
# in test cases and can be reused. #
######################################################
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
# there is no neat way to find the backupid, this is a hack to find it...
+let $dump_file= $MYSQLTEST_VARDIR/tmp/tmp.dat;
+--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $dump_file
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+--replace_result $dump_file DUMP_FILE
+eval LOAD DATA INFILE '$dump_file' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DELETE FROM test.backup_info;
-
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-
---replace_column 1 <the_backup_id>
-
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
+# Load backup id into environment variable
+let the_backup_id=`SELECT backup_id from test.backup_info`;
+DROP TABLE test.backup_info;
-let the_backup_id=`select @the_backup_id`;
+remove_file $dump_file;
-DROP TABLE test.backup_info;
diff --git a/mysql-test/include/ndb_master-slave_2ch.inc b/mysql-test/include/ndb_master-slave_2ch.inc
new file mode 100644
index 00000000000..52a06c01d86
--- /dev/null
+++ b/mysql-test/include/ndb_master-slave_2ch.inc
@@ -0,0 +1,136 @@
+#############################################################
+# Author: Serge Kozlov <skozlov@mysql.com>
+# Date: 03/17/2008
+# Purpose: Set up circular cluster replication where each
+# cluster has two mysqlds and replication directions are
+# following:
+# master ---> slave
+# / \
+# cluster A cluster B
+# \ /
+# master1 <--- slave1
+#############################################################
+
+--source include/have_log_bin.inc
+
+# Make connections to mysqlds
+
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT1,);
+connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
+connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
+
+# Check that all mysqld compiled with ndb support
+
+--connection master
+--disable_query_log
+--require r/true.require
+SELECT (support = 'YES' or support = 'DEFAULT') AS `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
+--source include/ndb_not_readonly.inc
+--enable_query_log
+
+--connection master1
+--disable_query_log
+--require r/true.require
+SELECT (support = 'YES' or support = 'DEFAULT') AS `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
+--source include/ndb_not_readonly.inc
+--enable_query_log
+
+--connection slave
+--disable_query_log
+--require r/true.require
+SELECT (support = 'YES' or support = 'DEFAULT') AS `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
+--source include/ndb_not_readonly.inc
+--enable_query_log
+
+--connection slave1
+--disable_query_log
+--require r/true.require
+SELECT (support = 'YES' or support = 'DEFAULT') AS `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
+--source include/ndb_not_readonly.inc
+--enable_query_log
+
+# Stop slaves
+
+--connection master
+--disable_warnings
+STOP SLAVE;
+--wait_for_slave_to_stop
+--enable_warnings
+
+--connection master1
+--disable_warnings
+STOP SLAVE;
+--wait_for_slave_to_stop
+--enable_warnings
+
+--connection slave
+--disable_warnings
+STOP SLAVE;
+--wait_for_slave_to_stop
+--enable_warnings
+
+--connection slave1
+--disable_warnings
+STOP SLAVE;
+--wait_for_slave_to_stop
+--enable_warnings
+
+# Reset masters
+
+--connection master
+--disable_warnings
+--disable_query_log
+USE test;
+--enable_query_log
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+--enable_warnings
+RESET MASTER;
+
+--connection master1
+--disable_warnings
+--disable_query_log
+USE test;
+--enable_query_log
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+--enable_warnings
+RESET MASTER;
+
+--connection slave
+--disable_warnings
+--disable_query_log
+USE test;
+--enable_query_log
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+--enable_warnings
+RESET MASTER;
+
+--connection slave1
+--disable_warnings
+--disable_query_log
+USE test;
+--enable_query_log
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+--enable_warnings
+RESET MASTER;
+
+# Start slaves
+
+--connection slave
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root'
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+
+--connection master1
+RESET SLAVE;
+--replace_result $SLAVE_MYPORT1 SLAVE_MYPORT1
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT1,master_user='root'
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+
+
+# Set the default connection to 'master' (cluster A)
+connection master;
+
diff --git a/mysql-test/include/ndb_not_readonly.inc b/mysql-test/include/ndb_not_readonly.inc
index a87ba66f1ef..f50ca0cab66 100644
--- a/mysql-test/include/ndb_not_readonly.inc
+++ b/mysql-test/include/ndb_not_readonly.inc
@@ -17,7 +17,7 @@ while ($mysql_errno)
{
if (!$counter)
{
- die("Failed while waiting for mysqld to come out of readonly mode");
+ die Failed while waiting for mysqld to come out of readonly mode;
}
dec $counter;
--sleep 0.1
diff --git a/mysql-test/include/ndb_restore_master.inc b/mysql-test/include/ndb_restore_master.inc
index b01a0b58ee9..ae5f055b442 100644
--- a/mysql-test/include/ndb_restore_master.inc
+++ b/mysql-test/include/ndb_restore_master.inc
@@ -3,6 +3,6 @@
# in test cases and can be reused. #
######################################################
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -p 8 -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -p 8 -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
diff --git a/mysql-test/include/ndb_restore_slave_eoption.inc b/mysql-test/include/ndb_restore_slave_eoption.inc
index f1f6cf96881..a8657f68c8d 100644
--- a/mysql-test/include/ndb_restore_slave_eoption.inc
+++ b/mysql-test/include/ndb_restore_slave_eoption.inc
@@ -3,9 +3,9 @@
# in test cases and can be reused. #
######################################################
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
diff --git a/mysql-test/include/no_running_event_scheduler.inc b/mysql-test/include/no_running_event_scheduler.inc
new file mode 100644
index 00000000000..92813df9f96
--- /dev/null
+++ b/mysql-test/include/no_running_event_scheduler.inc
@@ -0,0 +1,23 @@
+########## include/no_running_event_scheduler.inc ##########################
+# #
+# Wait till the event scheduler disappeared from processlist. #
+# #
+# The characteristics of the event_scheduler entry within the processlist is #
+# user = 'event_scheduler' and command = 'Daemon'. I am not 100% sure if #
+# ther is no short phase with command <> 'Daemon'. #
+# A query with WHERE user = 'event_scheduler' only will also catch events in #
+# startup phase. This is no problem since this phase is very short. #
+# #
+# A wait_timeout of >= 3 seconds was within experiments sufficient even on a #
+# testing box with heavy parallel load. Therefore 5 seconds should be enough. #
+# #
+# Creation: #
+# 2008-12-19 mleich Implement this check needed for test bug fixes #
+# #
+################################################################################
+
+let $wait_timeout= 5;
+let $wait_condition=
+ SELECT COUNT(*) = 0 FROM information_schema.processlist
+ WHERE user = 'event_scheduler';
+--source include/wait_condition.inc
diff --git a/mysql-test/include/no_running_events.inc b/mysql-test/include/no_running_events.inc
new file mode 100644
index 00000000000..8090b2706b8
--- /dev/null
+++ b/mysql-test/include/no_running_events.inc
@@ -0,0 +1,25 @@
+########## include/no_running_events.inc ###################################
+# #
+# Wait till all event executors have finished their work. #
+# #
+# Different event executors share the characteristics that their entry within #
+# processlist contains command = 'Connect'. #
+# Of course the corresponding query will also catch other connections being #
+# within the connect phase. This is no problem since the connect phase is #
+# usually very short. #
+# #
+# A wait_timeout of >= 3 seconds was during experiments in case of "simple" #
+# SQL commands sufficient even on a testing box with heavy parallel load. #
+# "simple" = no sleeps, no long running commands, no waiting for lock ... #
+# We use here the default of 30 seconds because this wastes some time only in #
+# case of unexpected situations. #
+# #
+# Creation: #
+# 2008-12-19 mleich Implement this check needed for test bug fixes #
+# #
+################################################################################
+
+let $wait_condition=
+ SELECT COUNT(*) = 0 FROM information_schema.processlist
+ WHERE command = 'Connect';
+--source include/wait_condition.inc
diff --git a/mysql-test/include/not_as_root.inc b/mysql-test/include/not_as_root.inc
index e0277ea593e..6c88051d632 100644
--- a/mysql-test/include/not_as_root.inc
+++ b/mysql-test/include/not_as_root.inc
@@ -1,4 +1,3 @@
--- require r/not_as_root.require
-disable_query_log;
-eval select "$MYSQL_TEST_ROOT" as running_as_root;
-enable_query_log;
+if ($MYSQL_TEST_ROOT){
+ skip Not as root;
+}
diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc
index 4cde18b97d1..f66f888261d 100644
--- a/mysql-test/include/ps_modify.inc
+++ b/mysql-test/include/ps_modify.inc
@@ -108,7 +108,6 @@ execute stmt1 using @arg00, @arg01;
select a,b from t1 where a=@arg00;
set @arg00=NULL;
set @arg01=2;
---error 1048
execute stmt1 using @arg00, @arg01;
select a,b from t1 order by a;
set @arg00=0;
diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc
index fdd6bc50eae..77ea0021a5d 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -176,6 +176,7 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
# Final cleanup
+eval set GLOBAL query_cache_size=$save_query_cache_size;
connection default;
drop table t2;
disconnect connection1;
diff --git a/mysql-test/include/report-features.test b/mysql-test/include/report-features.test
index df395f6e3f0..1e4ab232490 100644
--- a/mysql-test/include/report-features.test
+++ b/mysql-test/include/report-features.test
@@ -9,3 +9,4 @@ show engines;
show variables;
--echo ===== STOP =====
--enable_query_log
+exit; \ No newline at end of file
diff --git a/mysql-test/include/reset_master_and_slave.inc b/mysql-test/include/reset_master_and_slave.inc
index c2d4120ddc9..30ba1f07a40 100644
--- a/mysql-test/include/reset_master_and_slave.inc
+++ b/mysql-test/include/reset_master_and_slave.inc
@@ -1,10 +1,8 @@
--echo **** Resetting master and slave ****
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
RESET SLAVE;
connection master;
RESET MASTER;
connection slave;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc
new file mode 100644
index 00000000000..0f363ff1ee3
--- /dev/null
+++ b/mysql-test/include/restart_mysqld.inc
@@ -0,0 +1,25 @@
+
+# Write file to make mysql-test-run.pl expect the "crash", but don't start
+# it until it's told to
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait
+EOF
+
+# Send shutdown to the connected server and give
+# it 10 seconds to die before zapping it
+shutdown_server 10;
+
+# Write file to make mysql-test-run.pl start up the server again
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart
+EOF
+
+# Turn on reconnect
+--enable_reconnect
+
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
+
+# Turn off reconnect again
+--disable_reconnect
+
diff --git a/mysql-test/include/rpl_events.inc b/mysql-test/include/rpl_events.inc
index 34ceba81a38..0effa8c4e5c 100644
--- a/mysql-test/include/rpl_events.inc
+++ b/mysql-test/include/rpl_events.inc
@@ -62,7 +62,9 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name
DROP EVENT IF EXISTS test.slave_once;
--enable_warnings
-CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
+# Create an event on slave and check its state. An event shouldn't be executed
+# so set start time in 1 hour.
+CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
--echo "Checking event status on the slave for originator value = slave's server_id"
@@ -81,8 +83,11 @@ connection master;
DROP EVENT IF EXISTS test.justonce;
--enable_warnings
+# Create an event on master and check its state on slave. An event shouldn't be executed
+# so set start time in 1 hour. Check that changes of event statement replicated to slave
+
--echo "Creating event test.er on the master"
-CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
--echo "Checking event status on the master"
@@ -95,7 +100,7 @@ SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND
connection master;
--echo "Altering event test.er on the master"
-ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
--echo "Checking event status on the master"
@@ -123,8 +128,11 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
# test the DISABLE ON SLAVE for setting event SLAVESIDE_DISABLED as status
# on CREATE EVENT
+# Create an event on slave and check its status. An event shouldn't be executed
+# so set start time in 1 hour.
+
--echo "Creating event test.slave_terminate on the slave"
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
--echo "Checking event status on the slave"
diff --git a/mysql-test/include/rpl_multi_engine.inc b/mysql-test/include/rpl_multi_engine.inc
index f2c837ef90b..b2d1a9c1cef 100644
--- a/mysql-test/include/rpl_multi_engine.inc
+++ b/mysql-test/include/rpl_multi_engine.inc
@@ -9,7 +9,7 @@ select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
sync_slave_with_master;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
connection master;
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
sync_slave_with_master;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
diff --git a/mysql-test/include/running_event_scheduler.inc b/mysql-test/include/running_event_scheduler.inc
new file mode 100644
index 00000000000..296bf842e82
--- /dev/null
+++ b/mysql-test/include/running_event_scheduler.inc
@@ -0,0 +1,30 @@
+############# include/running_event_scheduler.inc ##########################
+# #
+# Wait till the event scheduler reached its final state within the processlist.#
+# #
+# The characteristics of the event_scheduler entry within the processlist is #
+# user = 'event_scheduler' and command = 'Daemon'. I am not 100% sure if #
+# ther is no short phase with command <> 'Daemon'. #
+# A query with WHERE user = 'event_scheduler' only will also catch events in #
+# startup phase. #
+# #
+# Creation: #
+# 2008-12-19 mleich Implement this check needed for test bug fixes #
+# #
+################################################################################
+
+# 1. Check that the server system variable shows the state needed
+if (`SELECT @@global.event_scheduler <> 'ON'`)
+{
+ --echo # Error: We expect here that the event scheduler is switched on.
+ SELECT @@global.event_scheduler;
+ --echo # Thinkable reasons:
+ --echo # 1. SET GLOBAL event_scheduler = ON had not the expected effect.
+ --echo # 2. Use of the current routine (include/running_event_scheduler.inc)
+ --echo # within the wrong situation
+ --die
+}
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE user = 'event_scheduler' AND command = 'Daemon';
+--source include/wait_condition.inc
diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc
new file mode 100644
index 00000000000..79ff7429466
--- /dev/null
+++ b/mysql-test/include/setup_fake_relay_log.inc
@@ -0,0 +1,77 @@
+# ==== Purpose ====
+#
+# Setup replication from an existing relay log in the current
+# connection.
+#
+# ==== Usage ====
+#
+# Make sure the slave is not running and issue:
+#
+# let $fake_relay_log= /path/to/fake-relay-log-file.000001
+# source include/setup_fake_relay_log.inc;
+# START SLAVE SQL_THREAD; # setup_fake_relay_log doesn't start slave
+# ...
+# source include/cleanup_fake_relay_log.inc
+#
+# You must run the server with --relay-log=FILE. You probably want to
+# run with --replicate-same-server-id too.
+#
+# ==== Implementation ====
+#
+# First makes a sanity check, ensuring that the slave threads are not
+# running. Then copies the $fake_relay_log to RELAY_BIN-fake.000001,
+# where RELAY_BIN is the basename of the relay log, and updates
+# RELAY_BIN.index. Finally issues CHANGE MASTER so that it uses the
+# given files.
+#
+# ==== Side effects ====
+#
+# Creates a binlog file and a binlog index file, and sets
+# @@global.relay_log_purge=1. All this is restored when you call
+# cleanup_fake_relay_log.inc.
+#
+# Enables the query log.
+
+
+--disable_query_log
+
+# Print message.
+let $_fake_relay_log_printable= `SELECT REPLACE('$fake_relay_log', '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`;
+--echo Setting up fake replication from $_fake_relay_log_printable
+
+# Sanity check.
+let $_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
+let $_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
+if (`SELECT "$_sql_running" = "Yes" OR "$_io_running" = "Yes"`) {
+ --echo Error: Slave was running when test case sourced
+ --echo include/setup_fake_replication.inc
+ --echo Slave_IO_Running = $_io_running; Slave_SQL_Running = $_sql_running
+ --echo Printing some debug info:
+ SHOW SLAVE STATUS;
+ SHOW MASTER STATUS;
+ SHOW BINLOG EVENTS;
+ SHOW PROCESSLIST;
+}
+
+# Read server variables.
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+let $_fake_filename= query_get_value(SHOW VARIABLES LIKE 'relay_log', Value, 1);
+if (`SELECT '$_fake_filename' = ''`) {
+ --echo Badly written test case: relay_log variable is empty. Please use the
+ --echo server option --relay-log=FILE.
+}
+let $_fake_relay_log= $MYSQLD_DATADIR/$_fake_filename-fake.000001;
+let $_fake_relay_index= $MYSQLD_DATADIR/$_fake_filename.index;
+# Need to restore relay_log_purge in cleanup_fake_relay_log.inc, since
+# CHANGE MASTER modifies it (see the manual for CHANGE MASTER).
+let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
+
+# Create relay log file.
+copy_file $fake_relay_log $_fake_relay_log;
+# Create relay log index.
+--exec echo $_fake_relay_log > $_fake_relay_index
+
+# Setup replication from existing relay log.
+eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_relay_log', RELAY_LOG_POS=4;
+
+--enable_query_log
diff --git a/mysql-test/include/show_rpl_debug_info.inc b/mysql-test/include/show_rpl_debug_info.inc
new file mode 100644
index 00000000000..252d63f1bf4
--- /dev/null
+++ b/mysql-test/include/show_rpl_debug_info.inc
@@ -0,0 +1,87 @@
+# ==== Purpose ====
+#
+# Print status information for replication, typically used to debug
+# test failures.
+#
+# First, the following is printed on slave:
+#
+# SHOW SLAVE STATUS
+# SHOW PROCESSLIST
+# SHOW BINLOG EVENTS IN <binlog_name>
+#
+# Where <binlog_name> is the currently active binlog.
+#
+# Then, the following is printed on master:
+#
+# SHOW MASTER STATUS
+# SHOW PROCESSLIST
+# SHOW BINLOG EVENTS IN <sql_binlog_name>
+# SHOW BINLOG EVENTS IN <io_binlog_name>
+#
+# Where <sql_binlog_name> is the binlog name that the slave sql thread
+# is currently reading from and <io_binlog_name> is the binlog that
+# the slave IO thread is currently reading from.
+#
+# ==== Usage ====
+#
+# [let $master_connection= <connection>;]
+# source include/show_rpl_debug_info.inc;
+#
+# If $master_connection is set, debug info will be retrieved from the
+# connection named $master_connection. Otherwise, it will be
+# retrieved from the 'master' connection if the current connection is
+# 'slave'.
+
+let $_con= $CURRENT_CONNECTION;
+--echo
+--echo [on $_con]
+--echo
+--echo **** SHOW SLAVE STATUS on $_con ****
+query_vertical SHOW SLAVE STATUS;
+--echo
+--echo **** SHOW PROCESSLIST on $_con ****
+SHOW PROCESSLIST;
+--echo
+--echo **** SHOW BINLOG EVENTS on $_con ****
+let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
+eval SHOW BINLOG EVENTS IN '$binlog_name';
+
+let $_master_con= $master_connection;
+if (`SELECT '$_master_con' = ''`)
+{
+ if (`SELECT '$_con' = 'slave'`)
+ {
+ let $_master_con= master;
+ }
+ if (`SELECT '$_master_con' = ''`)
+ {
+ --echo Unable to determine master connection. No debug info printed for master.
+ --echo Please fix the test case by setting $master_connection before sourcing
+ --echo show_rpl_debug_info.inc.
+ }
+}
+
+if (`SELECT '$_master_con' != ''`)
+{
+
+ let $master_binlog_name_io= query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1);
+ let $master_binlog_name_sql= query_get_value("SHOW SLAVE STATUS", Relay_Master_Log_File, 1);
+ --echo
+ --echo [on $_master_con]
+ connection $_master_con;
+ --echo
+ --echo **** SHOW MASTER STATUS on $_master_con ****
+ query_vertical SHOW MASTER STATUS;
+ --echo
+ --echo **** SHOW PROCESSLIST on $_master_con ****
+ SHOW PROCESSLIST;
+ --echo
+ --echo **** SHOW BINLOG EVENTS on $_master_con ****
+ eval SHOW BINLOG EVENTS IN '$master_binlog_name_sql';
+ if (`SELECT '$master_binlog_name_io' != '$master_binlog_name_sql'`)
+ {
+ eval SHOW BINLOG EVENTS IN '$master_binlog_name_io';
+ }
+
+ connection $_con;
+}
diff --git a/mysql-test/include/start_slave.inc b/mysql-test/include/start_slave.inc
new file mode 100644
index 00000000000..78a02736de8
--- /dev/null
+++ b/mysql-test/include/start_slave.inc
@@ -0,0 +1,21 @@
+# ==== Purpose ====
+#
+# Issues START SLAVE on the current connection. Then waits until both
+# the IO and SQL threads have started, or until a timeout is reached.
+#
+# Please use this instead of 'START SLAVE', to reduce the risk of test
+# case bugs.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_to_start.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
+
+--disable_query_log
+START SLAVE;
+--enable_query_log
+--echo include/start_slave.inc
+source include/wait_for_slave_to_start.inc;
diff --git a/mysql-test/include/stop_slave.inc b/mysql-test/include/stop_slave.inc
new file mode 100644
index 00000000000..7161e6fe739
--- /dev/null
+++ b/mysql-test/include/stop_slave.inc
@@ -0,0 +1,21 @@
+# ==== Purpose ====
+#
+# Issues STOP SLAVE on the current connection. Then waits until both
+# the IO and SQL threads have stopped, or until a timeout is reached.
+#
+# Please use this instead of 'STOP SLAVE', to reduce the risk of test
+# case bugs.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_to_start.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
+
+--disable_query_log
+STOP SLAVE;
+--enable_query_log
+--echo include/stop_slave.inc
+source include/wait_for_slave_to_stop.inc;
diff --git a/mysql-test/include/sync_slave_io_with_master.inc b/mysql-test/include/sync_slave_io_with_master.inc
new file mode 100644
index 00000000000..f7dd563039c
--- /dev/null
+++ b/mysql-test/include/sync_slave_io_with_master.inc
@@ -0,0 +1,36 @@
+# ==== Purpose ====
+#
+# Waits until the slave IO thread has been synced, i.e., all events
+# have been copied over to slave. Does not care if the SQL thread is
+# in sync.
+#
+#
+# ==== Usage ====
+#
+# source include/sync_slave_io_with_master.inc;
+#
+# Syncs to the current position on master, as found by SHOW MASTER
+# STATUS.
+#
+# Must be called on the master. Will change connection to the slave.
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
+
+let $_master_file= query_get_value("SHOW MASTER STATUS", File, 1);
+let $_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1);
+
+connection slave;
+
+let $slave_error_message= Failed while waiting for slave IO thread to sync;
+
+let $slave_param= Master_Log_File;
+let $slave_param_value= $_master_file;
+source include/wait_for_slave_param.inc;
+
+let $slave_param= Read_Master_Log_Pos;
+let $slave_param_value= $_master_pos;
+source include/wait_for_slave_param.inc;
+
+let $slave_error_message= ;
diff --git a/mysql-test/include/testdb_only.inc b/mysql-test/include/testdb_only.inc
index ddc3f123d45..528e2f3eb9d 100644
--- a/mysql-test/include/testdb_only.inc
+++ b/mysql-test/include/testdb_only.inc
@@ -19,12 +19,6 @@
# #
###################################################################
---disable_query_log
-eval set @USE_RUNNING_SERVER= '$USE_RUNNING_SERVER';
---require r/testdb_only.require
-SELECT 'use extern server'
- AS "Variable_name ",
- IF(@USE_RUNNING_SERVER= '1','YES',
- IF(@USE_RUNNING_SERVER= '0','NO','UNEXPECTED'))
- AS "Value" ;
---enable_query_log
+if ($USE_RUNNING_SERVER){
+ skip Not with extern server;
+}
diff --git a/mysql-test/include/wait_condition_sp.inc b/mysql-test/include/wait_condition_sp.inc
new file mode 100644
index 00000000000..66301da557c
--- /dev/null
+++ b/mysql-test/include/wait_condition_sp.inc
@@ -0,0 +1,62 @@
+# include/wait_condition.inc
+#
+# SUMMARY
+#
+# Waits until the passed statement returns true, or the operation
+# times out.
+#
+# USAGE
+#
+# let $wait_condition=
+# SELECT c = 3 FROM t;
+# --source include/wait_condition.inc
+#
+# OR
+#
+# let $wait_timeout= 60; # Override default 30 seconds with 60.
+# let $wait_condition=
+# SELECT c = 3 FROM t;
+# --source include/wait_condition.inc
+# --echo Executed the test condition $wait_condition_reps times
+#
+# EXAMPLE
+# events_bugs.test, events_time_zone.test
+#
+
+--disable_query_log
+
+let $wait_counter= 300;
+if ($wait_timeout)
+{
+ let $wait_counter= `SELECT $wait_timeout * 10`;
+}
+# Reset $wait_timeout so that its value won't be used on subsequent
+# calls, and default will be used instead.
+let $wait_timeout= 0;
+
+# Keep track of how many times the wait condition is tested
+# This is used by some tests (e.g., main.status)
+let $wait_condition_reps= 0;
+while ($wait_counter)
+{
+ let $success= `$wait_condition`;
+ inc $wait_condition_reps;
+ if ($success)
+ {
+ let $wait_counter= 0;
+ }
+ if (!$success)
+ {
+ real_sleep 0.1;
+ dec $wait_counter;
+ }
+}
+if (!$success)
+{
+ echo Timeout in wait_condition.inc for $wait_condition;
+ show master status;
+ show slave status;
+}
+
+--enable_query_log
+
diff --git a/mysql-test/include/wait_for_slave_io_to_start.inc b/mysql-test/include/wait_for_slave_io_to_start.inc
new file mode 100644
index 00000000000..abdc8339290
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_io_to_start.inc
@@ -0,0 +1,19 @@
+# ==== Purpose ====
+#
+# Waits until the IO thread of the current connection has started and
+# connected to the master (i.e., until SHOW SLAVE STATUS returns Yes
+# in the Slave_IO_Running field), or until a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_io_to_start.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
+
+let $slave_param= Slave_IO_Running;
+let $slave_param_value= Yes;
+let $slave_error_message= Failed while waiting for slave IO thread to start;
+source include/wait_for_slave_param.inc;
+let $slave_error_message= ;
diff --git a/mysql-test/include/wait_for_slave_io_to_stop.inc b/mysql-test/include/wait_for_slave_io_to_stop.inc
index 6e66d4e7521..f61b0db1ed7 100644
--- a/mysql-test/include/wait_for_slave_io_to_stop.inc
+++ b/mysql-test/include/wait_for_slave_io_to_stop.inc
@@ -1,33 +1,24 @@
-###################################################
-#Author: Jeb
-#Date: 2007-06-11
-#Purpose: used for io errors on the slave. If Slave gets an io
-# error, the io trhead should stop
-#Details:
-# 1) Fill in and setup variables
-# 2) loop through looking for
-# sql threads to stop
-# 3) If loops too long die.
-####################################################
-connection slave;
-let $my_show= SHOW SLAVE STATUS;
-let $sql_running= Slave_IO_Running;
-let $row_number= 1;
-let $run= 1;
-let $counter= 300;
+# ==== Purpose ====
+#
+# Waits until the IO thread of the current connection has stopped, or
+# until a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_io_to_stop.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
-while ($run)
+# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE
+# STATUS will return an empty set.
+let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
+if (`SELECT '$_slave_io_running' != 'No such row'`)
{
- let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
- if (`SELECT '$io_result' = 'No'`){
- let $run= 0;
- }
- sleep 0.1;
- if (!$counter){
- --echo "Failed while waiting for slave IO thread to stop"
- query_vertical SHOW SLAVE STATUS;
- exit;
- }
- dec $counter;
+ let $slave_param= Slave_IO_Running;
+ let $slave_param_value= No;
+ let $slave_error_message= Failed while waiting for slave IO thread to stop;
+ source include/wait_for_slave_param.inc;
+ let $slave_error_message= ;
}
-
diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc
index fed97195aba..82e57922913 100644
--- a/mysql-test/include/wait_for_slave_param.inc
+++ b/mysql-test/include/wait_for_slave_param.inc
@@ -1,26 +1,82 @@
-# include/wait_for_slave_param.inc
+# ==== Purpose ====
#
-# SUMMARY
+# Waits until SHOW SLAVE STATUS has returned a specified value, or
+# until a timeout is reached.
#
-# Waits until SHOW SLAVE STATUS has returned a spicified value.
+# ==== Usage ====
#
-# USAGE
+# let $slave_param= Slave_SQL_Running;
+# let $slave_param_value= No;
+# source include/slave_wait_param.inc;
#
-# let $slave_param= Slave_SQL_Running;
-# let $slave_param_value= No;
-# --source include/slave_wait_param.inc
+# Parameters:
+#
+# $slave_param, $slave_param_value
+# This macro will wait until the column of the output of SHOW SLAVE
+# STATUS named $slave_param gets the value $slave_param_value. See
+# the example above.
+#
+# $slave_param_comparison
+# By default, this file waits until $slave_param becomes equal to
+# $slave_param_value. If you want to wait until $slave_param
+# becomes *unequal* to $slave_param_value, set this parameter to the
+# string '!=', like this:
+# let $slave_param_comparison= !=;
+#
+# $slave_timeout
+# The default timeout is 5 minutes. You can change the timeout by
+# setting $slave_timeout. The unit is tenths of seconds.
+#
+# $master_connection
+# If the timeout is reached, debug info is given by calling SHOW
+# SLAVE STATUS, SHOW PROCESSLIST, and SHOW BINLOG EVENTS. Then, a
+# 'connection master' is then issued, and more debug info is given
+# by calling SHOW MASTER STATUS, SHOW PROCESSLIST, and SHOW BINLOG
+# EVENTS. If $master_connection is set, the latter three commands
+# will be issued on $master_connection instead of on the host named
+# 'master'. See also show_rpl_debug_info.inc
+#
+# $slave_error_message
+# If set, this is printed when a timeout occurs. This is primarily
+# intended to be used by other wait_for_slave_* macros, to indicate
+# what the purpose of the wait was. (A very similar error message is
+# given by default, but the wait_for_slave_* macros use this to give
+# an error message identical to that in previous versions, so that
+# errors are easier searchable in the pushbuild history.)
+
+let $_slave_timeout_counter= $slave_timeout;
+if (!$_slave_timeout_counter)
+{
+ let $_slave_timeout_counter= 3000;
+}
+
+let $_slave_param_comparison= $slave_param_comparison;
+if (`SELECT '$_slave_param_comparison' = ''`)
+{
+ let $_slave_param_comparison= =;
+}
+
+let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
+while (`SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_param_value') AND $_slave_timeout_counter > 0`)
+{
+ dec $_slave_timeout_counter;
+ if ($_slave_timeout_counter)
+ {
+ sleep 0.1;
+ let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
+ }
+}
-let $slave_wait_param_counter= 300;
-let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
-while (`select "$slave_value" != "$slave_param_value"`)
+# This has to be outside the loop until BUG#41913 has been fixed
+if (!$_slave_timeout_counter)
{
- dec $slave_wait_param_counter;
- if (!$slave_wait_param_counter)
+ --echo **** ERROR: timeout after $slave_timeout seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
+ if (`SELECT '$slave_error_message' != ''`)
{
- --echo ERROR: failed while waiting for slave parameter $slave_param: $slave_param_value
- query_vertical show slave status;
- exit;
+ --echo Message: $slave_error_message
}
- sleep 0.1;
- let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
+ --echo Current connection is '$CURRENT_CONNECTION'
+ echo Note: the following output may have changed since the failure was detected;
+ source include/show_rpl_debug_info.inc;
+ exit;
}
diff --git a/mysql-test/include/wait_for_slave_sql_error.inc b/mysql-test/include/wait_for_slave_sql_error.inc
index 6780edbe2f0..ad1d7a9e639 100644
--- a/mysql-test/include/wait_for_slave_sql_error.inc
+++ b/mysql-test/include/wait_for_slave_sql_error.inc
@@ -1,33 +1,39 @@
-###################################################
-#Author: Sven
-#Date: 2007-10-09
-#Purpose: Wait until the slave has an error in the
-# sql thread, as indicated by
-# "SHOW SLAVE STATUS", or at most 30
-# seconds.
-#Details:
-# 1) Fill in and setup variables
-# 2) loop, looking for sql error on slave
-# 3) If it loops too long, die.
-####################################################
-connection slave;
-let $row_number= 1;
-let $run= 1;
-let $counter= 300;
+# ==== Purpose ====
+#
+# Waits until the SQL thread of the current connection has got an
+# error, or until a timeout is reached. Also waits until the SQL
+# thread has completely stopped.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_sql_error.inc;
+#
+# Parameters:
+#
+# $slave_sql_errno
+# The expected SQL error number. This is required.
+# (After BUG#41956 has been fixed, this will be required to be a
+# symbolic name instead of a number.)
+#
+# $slave_timeout
+# See wait_for_slave_param.inc for description.
+#
+# $master_connection
+# See wait_for_slave_param.inc for description.
-while ($run)
-{
- let $sql_result= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, $row_number);
- let $run= `SELECT '$sql_result' = '0'`;
- if ($run) {
- real_sleep 0.1;
- if (!$counter){
- --echo "Failed while waiting for slave to produce an error in its sql thread"
- --replace_result $MASTER_MYPORT MASTER_PORT
- --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
- query_vertical SHOW SLAVE STATUS;
- exit;
- }
- dec $counter;
- }
+if (`SELECT '$slave_sql_errno' = ''`) {
+ --echo !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_fro_slave_sql_error.inc
+ exit;
+}
+
+let $slave_param= Slave_SQL_Running;
+let $slave_param_value= No;
+let $slave_error_message= Failed while waiting for slave to stop the SQL thread (expecting error in the SQL thread);
+source include/wait_for_slave_param.inc;
+
+let $_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
+if (`SELECT '$_error' != '$slave_sql_errno'`) {
+ --echo Slave stopped with wrong error code: $_error (expected $slave_sql_errno)
+ source include/show_rpl_debug_info.inc;
+ exit;
}
diff --git a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc
index 4b4776d2923..247de3a41a1 100644
--- a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc
+++ b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc
@@ -5,8 +5,23 @@
#
# ==== Usage ====
#
-# let show_sql_error=0|1;
+# let $slave_sql_error= <ERRNO>;
# source include/wait_for_slave_sql_error_and_skip.inc;
+#
+# Parameters:
+#
+# $slave_sql_errno
+# The error number to wait for. This is required. (See
+# wait_for_slave_sql_error.inc)
+#
+# $show_sql_error
+# If set, will print the error to the query log.
+#
+# $slave_timeout
+# See wait_for_slave_param.inc for description.
+#
+# $master_connection
+# See wait_for_slave_param.inc for description.
echo --source include/wait_for_slave_sql_error_and_skip.inc;
connection slave;
@@ -17,11 +32,7 @@ if ($show_sql_error)
echo Last_SQL_Error = $error;
}
-# wait for SQL thread to stop after the error
-source include/wait_for_slave_sql_to_stop.inc;
-
# skip the erroneous statement
set global sql_slave_skip_counter=1;
-start slave;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
connection master;
diff --git a/mysql-test/include/wait_for_slave_sql_to_start.inc b/mysql-test/include/wait_for_slave_sql_to_start.inc
index 14134725da4..48744f5dd13 100644
--- a/mysql-test/include/wait_for_slave_sql_to_start.inc
+++ b/mysql-test/include/wait_for_slave_sql_to_start.inc
@@ -1,31 +1,17 @@
-###################################################
-#Author: Mats (based on file written by Jeb)
-#Date: 2008-05-06
-#Purpose: To wait for slave SQL thread to start
-#Details:
-# 1) Fill in and setup variables
-# 2) loop through looking for both
-# io and sql threads to start
-# 3) If loops too long die.
-####################################################
-connection slave;
-let $row_number= 1;
-let $run= 1;
-let $counter= 300;
-
-while ($run)
-{
- let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
- if (`SELECT '$sql_result' = 'Yes'`){
- let $run= 0;
- }
- sleep 0.1;
- if (!$counter){
- --echo "Failed while waiting for slave SQL to start"
- query_vertical SHOW SLAVE STATUS;
- exit;
- }
- dec $counter;
-}
-
+# ==== Purpose ====
+#
+# Waits the SQL thread of the current connection has started, or until
+# a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_sql_to_start.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
+let $slave_param= Slave_SQL_Running;
+let $slave_param_value= Yes;
+let $slave_error_message= Failed while waiting for slave SQL to start;
+source include/wait_for_slave_param.inc;
diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc
index cb5c437a586..6992613b646 100644
--- a/mysql-test/include/wait_for_slave_sql_to_stop.inc
+++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc
@@ -1,33 +1,24 @@
-###################################################
-#Author: Jeb
-#Date: 2007-06-11
-#Purpose: used for SQL errors on the slave. If Slave gets a sql
-# error, the SQL trhead should stop
-#Details:
-# 1) Fill in and setup variables
-# 2) loop through looking for
-# sql threads to stop
-# 3) If loops too long die.
-####################################################
-if (!$keep_connection)
-{
- connection slave;
-}
-let $row_number= 1;
-let $run= 1;
-let $counter= 300;
+# ==== Purpose ====
+#
+# Waits the SQL thread of the current connection has stopped, or until
+# a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_sql_to_stop.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
-while ($run)
+# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE
+# STATUS will return an empty set.
+let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
+if (`SELECT '$_slave_io_running' != 'No such row'`)
{
- let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
- if (`SELECT '$sql_result' = 'No'`){
- let $run= 0;
- }
- sleep 0.1;
- if (!$counter){
- --echo "Failed while waiting for slave SQL thread to stop"
- query_vertical SHOW SLAVE STATUS;
- exit;
- }
- dec $counter;
+ let $slave_param= Slave_SQL_Running;
+ let $slave_param_value= No;
+ let $slave_error_message= Failed while waiting for slave SQL thread to stop;
+ source include/wait_for_slave_param.inc;
+ let $slave_error_message= ;
}
diff --git a/mysql-test/include/wait_for_slave_to_start.inc b/mysql-test/include/wait_for_slave_to_start.inc
index 29d87b58a3c..567950cc6d7 100644
--- a/mysql-test/include/wait_for_slave_to_start.inc
+++ b/mysql-test/include/wait_for_slave_to_start.inc
@@ -1,35 +1,24 @@
-###################################################
-#Author: Jeb
-#Date: 2007-06-11
-#Purpose: To wait a brief time for slave to start
-#Details:
-# 1) Fill in and setup variables
-# 2) loop through looking for both
-# io and sql threads to start
-# 3) If loops too long die.
-####################################################
-connection slave;
-let $row_number= 1;
-let $run= 1;
-let $counter= 300;
+# ==== Purpose ====
+#
+# Waits until both the IO and SQL threads of the current connection
+# have started, or until a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_to_start.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
-while ($run)
-{
- let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
- if (`SELECT '$io_result' = 'Yes'`){
+let $slave_error_message= Failed while waiting for slave to start;
- let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
- if (`SELECT '$sql_result' = 'Yes'`){
- let $run= 0;
- }
- }
- sleep 0.1;
- if (!$counter){
- --echo "Failed while waiting for slave to start"
- query_vertical SHOW SLAVE STATUS;
- exit;
- }
- dec $counter;
-}
+let $slave_param= Slave_IO_Running;
+let $slave_param_value= Yes;
+source include/wait_for_slave_param.inc;
+let $slave_param= Slave_SQL_Running;
+let $slave_param_value= Yes;
+source include/wait_for_slave_param.inc;
+let $slave_error_message= ;
diff --git a/mysql-test/include/wait_for_slave_to_stop.inc b/mysql-test/include/wait_for_slave_to_stop.inc
index 5bd2d0338f8..56d0e7b0c91 100644
--- a/mysql-test/include/wait_for_slave_to_stop.inc
+++ b/mysql-test/include/wait_for_slave_to_stop.inc
@@ -1,39 +1,30 @@
-###################################################
-#Author: Jeb
-#Date: 2007-06-11
-#Purpose: To replace the mysqltest.c executable
-# wait_for_slave_to_stop function and
-# return this to the test language.
-#Details:
-# 1) Fill in and setup variables
-# 2) loop through looking for both
-# io and sql threads to stop
-# 3) If loops too long die.
-####################################################
-connection slave;
-let $row_number= 1;
-let $run= 1;
-let $counter= 300;
+# ==== Purpose ====
+#
+# Waits until both the IO and SQL threads of the current connection
+# have stopped, or until a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_to_stop.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
-while ($run)
+# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE
+# STATUS will return an empty set.
+let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
+if (`SELECT '$_slave_io_running' != 'No such row'`)
{
- let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
- if (`SELECT '$io_result' = 'No'`){
+ let $slave_error_message= Failed while waiting for slave to stop;
- let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
- if (`SELECT '$sql_result' = 'No'`){
- let $run= 0;
- }
- }
- sleep 0.1;
- if (!$counter){
- --echo "Failed while waiting for slave to stop"
- --replace_result $MASTER_MYPORT MASTER_PORT
- --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
- query_vertical SHOW SLAVE STATUS;
- exit;
- }
- dec $counter;
-}
+ let $slave_param= Slave_IO_Running;
+ let $slave_param_value= No;
+ source include/wait_for_slave_param.inc;
+ let $slave_param= Slave_SQL_Running;
+ let $slave_param_value= No;
+ source include/wait_for_slave_param.inc;
+ let $slave_error_message= ;
+}
diff --git a/mysql-test/include/wait_show_pattern.inc b/mysql-test/include/wait_show_pattern.inc
deleted file mode 100644
index c9f84ce7f08..00000000000
--- a/mysql-test/include/wait_show_pattern.inc
+++ /dev/null
@@ -1,51 +0,0 @@
-# include/wait_show_pattern.inc
-#
-# SUMMARY
-#
-# Waits until output produced by SHOW statement which particular type is
-# specified as parameter matches certain pattern or maximum time reached.
-#
-# NOTES
-#
-# Only the first row produced by the parameter statement is checked.
-#
-# USAGE
-#
-# let $show_type= <Tail of SHOW statement>;
-# let $show_pattern= 'Pattern to be used for LIKE matching';
-# --source wait_show_pattern.inc
-#
-# EXAMPLES
-#
-# alter_table-big.test, wait_slave_status.inc
-#
-# SEE ALSO
-#
-# wait_slave_status.inc, wait_condition.inc (>=5.1)
-#
-###############################################################################
-
---disable_query_log
-
-# We accept to wait maximum 30 seconds (0.2 sec/loop).
-let $wait_counter= 150;
-while ($wait_counter)
-{
- let $result= `SHOW $show_type`;
- let $success= `SELECT '$result' LIKE $show_pattern`;
- if ($success)
- {
- let $wait_counter= 0;
- }
- if (!$success)
- {
- real_sleep 0.2;
- dec $wait_counter;
- }
-}
-if (!$success)
-{
- echo Timeout in wait_show_pattern.inc \$show_type= $show_type \$show_pattern= $show_pattern (\$result= '$result');
-}
-
---enable_query_log
diff --git a/mysql-test/include/wait_slave_status.inc b/mysql-test/include/wait_slave_status.inc
deleted file mode 100644
index d8d048527cf..00000000000
--- a/mysql-test/include/wait_slave_status.inc
+++ /dev/null
@@ -1,129 +0,0 @@
-# include/wait_slave_status.inc
-#
-# Created by Matthias Leich
-#
-# SUMMARY
-#
-# Waits until slave has reached certain state or maximum time reached.
-#
-# (This script will not work, when the SHOW command delivers more than one
-# result record, because only the first record will be caught.)
-#
-# USAGE
-#
-# Set $result_pattern in test file and source this file:
-#
-# let $result_pattern= <pattern used for LIKE on the result of
-# SHOW STATUS SLAVE>
-# --include wait_slave_status.inc
-#
-# EXAMPLE
-#
-# The script rpl_until.test:
-# ...
-# --replace_result $MASTER_MYPORT MASTER_MYPORT
-# --replace_column 1 # 9 # 23 # 33 #
-# --vertical_results show slave status;
-#
-# outputs
-# show slave status;
-# Slave_IO_State #
-# Master_Host 127.0.0.1
-# Master_User root
-# Master_Port MASTER_MYPORT
-# Connect_Retry 1
-# Master_Log_File master-bin.000001
-# Read_Master_Log_Pos 776
-# Relay_Log_File slave-relay-bin.000004
-# Relay_Log_Pos #
-# Relay_Master_Log_File master-bin.000001
-# Slave_IO_Running Yes
-# Slave_SQL_Running No
-# Replicate_Do_DB
-# Replicate_Ignore_DB
-# Replicate_Do_Table
-# Replicate_Ignore_Table
-# Replicate_Wild_Do_Table
-# Replicate_Wild_Ignore_Table
-# Last_Errno 0
-# Last_Error
-# Skip_Counter 0
-# Exec_Master_Log_Pos 319
-# Relay_Log_Space #
-# Until_Condition Master
-# Until_Log_File master-bin.000001
-# Until_Log_Pos 319
-# Master_SSL_Allowed No
-# Master_SSL_CA_File
-# Master_SSL_CA_Path
-# Master_SSL_Cert
-# Master_SSL_Cipher
-# Master_SSL_Key
-# Seconds_Behind_Master #
-#
-# The main problem with the "show slave status;" in rpl_until is, that
-# depending on the total test engine power and the current load caused by
-# other processes, the expected slave status might be not reached though
-# it will happen in maybe some seconds.
-#
-# The typical problem with rpl_until is that Slave_IO_Running is "No"
-# instead of "Yes".
-#
-# The expected result follows the LIKE pattern:
-#
-# let $result_pattern= '%127.0.0.1%root%1%master-bin.000001%776%slave-relay-bin.000004%master-bin.000001%Yes%No%0%0%319%Master%master-bin.000001%319%No%';
-#
-# The Slave_IO_Running value is the "Yes" just after the "master-bin.000001".
-#
-# How to get this pattern ?
-#
-# Any lines "--replace_result ..." and "--replace_colum ..." just before
-# the SHOW TABLE STATUS and of course the expected result itself
-# show us columns where the content must be unified, because it is non
-# deterministic or it depends on the current test environment.
-#
-# Unfortunately "--replace_result ..." and "--replace_colum ..." do not
-# affect the result of our assignment let $my_val= `SHOW SLAVE STATUS`;
-# Therefore such content must be covered by '%'.
-#
-# Please be careful. A more simple pattern might be dangerous, because we
-# might get "wrong" matches. Example: There might be several "Yes" and "No"
-# within one result row.
-#
-###############################################################################
-
-# We do not want to print the auxiliary commands, because they are not of
-# interest and their amount will vary depending how fast we get the
-# desired state.
---disable_query_log
-
-# The protocol should show
-# - the setting of $result_pattern and
-# - that this file is sourced ,
-# because this increases the chance to use the protocol as replay script.
-eval SELECT "let \$result_pattern= $result_pattern ;" AS "";
-SELECT '--source include/wait_slave_status.inc' AS "";
-
-let $show_type= SLAVE STATUS;
-let $show_pattern= $result_pattern;
---enable_query_log
-
---source include/wait_show_pattern.inc
-
-if (!$success)
-{
-let $message= ! Attention: Timeout in wait_slave_status.inc.
- | Possible reasons with decreasing probability:
- | - The LIKE pattern is wrong, because the
- | testcase was altered or the layout of the
- | SHOW SLAVE STATUS result set changed.
- | - There is a new bug within the replication.
- | - We met an extreme testing environment and timeout is
- | too small.;
---source include/show_msg80.inc
---echo DEBUG INFO START (wait_slave_status.inc):
---echo $result_pattern
---vertical_results
-show slave status;
---echo DEBUG INFO END
-}
diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc
index dc96f646cb3..c7bb774929a 100644
--- a/mysql-test/include/wait_until_connected_again.inc
+++ b/mysql-test/include/wait_until_connected_again.inc
@@ -4,9 +4,13 @@
--disable_result_log
--disable_query_log
let $counter= 500;
+let $mysql_errno= 9999;
while ($mysql_errno)
{
- --error 0,2002,2006
+ # Strangely enough, the server might return "Too many connections"
+ # while being shutdown, thus 1040 is an "allowed" error
+ # See BUG#36228
+ --error 0,1040,1053,2002,2003,2006,2013
show status;
dec $counter;
diff --git a/mysql-test/include/wait_until_count_sessions.inc b/mysql-test/include/wait_until_count_sessions.inc
new file mode 100644
index 00000000000..36fa9accafe
--- /dev/null
+++ b/mysql-test/include/wait_until_count_sessions.inc
@@ -0,0 +1,112 @@
+# include/wait_until_count_sessions.inc
+#
+# SUMMARY
+#
+# Waits until the passed number ($count_sessions) of concurrent sessions was
+# observed via
+# SHOW STATUS LIKE 'Threads_connected'
+# or the operation times out.
+# Note: Starting with 5.1 we could also use
+# SELECT COUNT(*) FROM information_schema.processlist
+# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
+# runs in all versions 5.0+
+#
+#
+# USAGE
+#
+# let $count_sessions= 3;
+# --source include/wait_until_count_sessions.inc
+#
+# OR typical example of a test which uses more than one session
+# Such a test could harm successing tests if there is no server shutdown
+# and start between.cw
+#
+# If the testing box is slow than the disconnect of sessions belonging to
+# the current test might happen when the successing test gets executed.
+# This means the successing test might see activities like unexpected
+# rows within the general log or the PROCESSLIST.
+# Example from bug http://bugs.mysql.com/bug.php?id=40377
+# --- bzr_mysql-6.0-rpl/.../r/log_state.result
+# +++ bzr_mysql-6.0-rpl/.../r/log_state.reject
+# @@ -25,6 +25,7 @@
+# event_time user_host ... command_type argument
+# TIMESTAMP USER_HOST ... Query create table t1(f1 int)
+# TIMESTAMP USER_HOST ... Query select * from mysql.general_log
+# +TIMESTAMP USER_HOST ... Quit
+# ....
+#
+# What to do?
+# -----------
+# <start of test>
+# # Determine initial number of connections (set $count_sessions)
+# --source include/count_sessions.inc
+# ...
+# connect (con1,.....)
+# ...
+# connection default;
+# ...
+# disconnect con1;
+# ...
+# # Wait until we have reached the initial number of connections
+# # or more than the sleep time above (10 seconds) has passed.
+# # $count_sessions
+# --source include/wait_until_count_sessions.inc
+# <end of test>
+#
+# Important note about tests with unfortunate (= not cooperative
+# to successing tests) architecture:
+# connection con1;
+# send SELECT ..., sleep(10)
+# connection default;
+# ...
+# disconnect con1;
+# <end of test>
+# should be fixed by
+# connection con1;
+# send SELECT ..., sleep(10)
+# connection default;
+# ...
+# connect con1;
+# reap;
+# connection default;
+# disconnect con1;
+# <end of test>
+# and not only by appending include/wait_until_count_sessions.inc etc.
+#
+#
+# EXAMPLE
+#
+# backup.test, grant3.test
+#
+#
+# Created: 2009-01-14 mleich
+#
+
+let $wait_counter= 50;
+if ($wait_timeout)
+{
+ let $wait_counter= `SELECT $wait_timeout * 10`;
+}
+# Reset $wait_timeout so that its value won't be used on subsequent
+# calls, and default will be used instead.
+let $wait_timeout= 0;
+while ($wait_counter)
+{
+ let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+ let $success= `SELECT $current_sessions = $count_sessions`;
+ if ($success)
+ {
+ let $wait_counter= 0;
+ }
+ if (!$success)
+ {
+ real_sleep 0.1;
+ dec $wait_counter;
+ }
+}
+if (!$success)
+{
+ --echo # Timeout in wait_until_count_sessions.inc
+ --echo # Number of sessions expected: $count_sessions found: $current_sessions
+}
+
diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc
new file mode 100644
index 00000000000..a4362e52d01
--- /dev/null
+++ b/mysql-test/include/wait_until_disconnected.inc
@@ -0,0 +1,21 @@
+#
+# Include this script to wait until the connection to the
+# server has been dropped
+--disable_result_log
+--disable_query_log
+let $counter= 500;
+let $mysql_errno= 0;
+while (!$mysql_errno)
+{
+ --error 0,1053,2002,2006,2013
+ show status;
+
+ dec $counter;
+ if (!$counter)
+ {
+ --die Server failed to dissapear
+ }
+ --sleep 0.1
+}
+--enable_query_log
+--enable_result_log
diff --git a/mysql-test/include/windows_sys_vars.inc b/mysql-test/include/windows_sys_vars.inc
index 90ff86fefd1..1d51ddb52f9 100644
--- a/mysql-test/include/windows_sys_vars.inc
+++ b/mysql-test/include/windows_sys_vars.inc
@@ -9,7 +9,6 @@ SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size= 131072;
-SET @min_key_buffer_size= 8;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;
diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh
deleted file mode 100644
index e4df8f619cc..00000000000
--- a/mysql-test/install_test_db.sh
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/sh
-# Copyright (C) 1997-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# This scripts creates the privilege tables db, host, user, tables_priv,
-# columns_priv in the mysql database, as well as the func table.
-
-if [ x$1 = x"--bin" ]; then
- shift 1
- BINARY_DIST=1
-
- bindir=../bin
- scriptdir=bin
- libexecdir=../libexec
-
- # Check if it's a binary distribution or a 'make install'
- if test -x ../libexec/mysqld
- then
- execdir=../libexec
- elif test -x ../../sbin/mysqld # RPM installation
- then
- execdir=../../sbin
- bindir=../../bin
- scriptdir=../bin
- libexecdir=../../libexec
- else
- execdir=../bin
- fi
- fix_bin=mysql-test
-else
- execdir=../sql
- bindir=../client
- fix_bin=.
- scriptdir=scripts
- libexecdir=../libexec
-fi
-
-vardir=var
-logdir=$vardir/log
-if [ x$1 = x"-slave" ]
-then
- shift 1
- data=var/slave-data
-else
- if [ x$1 = x"-1" ]
- then
- data=var/master-data1
- else
- data=var/master-data
- fi
-fi
-ldata=$fix_bin/$data
-
-mdata=$data/mysql
-EXTRA_ARG=""
-
-mysqld=
-if test -x $execdir/mysqld
-then
- mysqld=$execdir/mysqld
-else
- if test ! -x $libexecdir/mysqld
- then
- echo "mysqld is missing - looked in $execdir and in $libexecdir"
- exit 1
- else
- mysqld=$libexecdir/mysqld
- fi
-fi
-
-# On IRIX hostname is in /usr/bsd so add this to the path
-PATH=$PATH:/usr/bsd
-hostname=`hostname` # Install this too in the user table
-hostname="$hostname%" # Fix if not fully qualified hostname
-
-
-#create the directories
-[ -d $vardir ] || mkdir $vardir
-[ -d $logdir ] || mkdir $logdir
-
-# Create database directories mysql & test
-if [ -d $data ] ; then rm -rf $data ; fi
-mkdir $data $data/mysql $data/test
-
-#for error messages
-if [ x$BINARY_DIST = x1 ] ; then
-basedir=..
-else
-basedir=.
-EXTRA_ARG="--windows"
-fi
-
-INSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --basedir=$basedir --datadir=mysql-test/$ldata --srcdir=."
-echo "running $INSTALL_CMD"
-
-cd ..
-if $INSTALL_CMD
-then
- exit 0
-else
- echo "Error executing mysqld --bootstrap"
- exit 1
-fi
diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm
index 5491e341ddc..f8416e3df3a 100644
--- a/mysql-test/lib/My/Config.pm
+++ b/mysql-test/lib/My/Config.pm
@@ -4,6 +4,7 @@ package My::Config::Option;
use strict;
use warnings;
+use Carp;
sub new {
@@ -26,12 +27,22 @@ sub value {
return $self->{value};
}
+sub option {
+ my ($self)= @_;
+ my $name= $self->{name};
+ my $value= $self->{value};
+
+ my $opt= $name;
+ $opt= "$name=$value" if ($value);
+ $opt= "--$opt" unless ($opt =~ /^--/);
+ return $opt;
+}
package My::Config::Group;
use strict;
use warnings;
-
+use Carp;
sub new {
my ($class, $group_name)= @_;
@@ -68,7 +79,7 @@ sub remove {
return undef unless defined $option;
# Remove from the hash
- delete($self->{options_by_name}->{$option_name}) or die;
+ delete($self->{options_by_name}->{$option_name}) or croak;
# Remove from the array
@{$self->{options}}= grep { $_->name ne $option_name } @{$self->{options}};
@@ -88,6 +99,33 @@ sub name {
return $self->{name};
}
+sub suffix {
+ my ($self)= @_;
+ # Everything in name from the last .
+ my @parts= split(/\./, $self->{name});
+ my $suffix= pop(@parts);
+ return ".$suffix";
+}
+
+sub after {
+ my ($self, $prefix)= @_;
+ die unless defined $prefix;
+
+ # everything after $prefix
+ my $name= $self->{name};
+ if ($name =~ /^\Q$prefix\E(.*)$/)
+ {
+ return $1;
+ }
+ die "Failed to extract the value after '$prefix' in $name";
+}
+
+
+sub split {
+ my ($self)= @_;
+ # Return an array with name parts
+ return split(/\./, $self->{name});
+}
#
# Return a specific option in the group
@@ -100,23 +138,37 @@ sub option {
#
-# Return a specific value for an option in the group
+# Return value for an option in the group, fail if it does not exist
#
sub value {
my ($self, $option_name)= @_;
my $option= $self->option($option_name);
- die "No option named '$option_name' in this group"
+ croak "No option named '$option_name' in group '$self->{name}'"
if ! defined($option);
return $option->value();
}
+#
+# Return value for an option if it exist
+#
+sub if_exist {
+ my ($self, $option_name)= @_;
+ my $option= $self->option($option_name);
+
+ return undef if ! defined($option);
+
+ return $option->value();
+}
+
+
package My::Config;
use strict;
use warnings;
+use Carp;
use IO::File;
use File::Basename;
@@ -132,13 +184,13 @@ sub new {
my $self= bless { groups => [] }, $class;
my $F= IO::File->new($path, "<")
- or die "Could not open '$path': $!";
+ or croak "Could not open '$path': $!";
while ( my $line= <$F> ) {
chomp($line);
# [group]
- if ( $line =~ /\[(.*)\]/ ) {
+ if ( $line =~ /^\[(.*)\]/ ) {
# New group found
$group_name= $1;
#print "group: $group_name\n";
@@ -149,7 +201,7 @@ sub new {
# Magic #! comments
elsif ( $line =~ /^#\!/) {
my $magic= $line;
- die "Found magic comment '$magic' outside of group"
+ croak "Found magic comment '$magic' outside of group"
unless $group_name;
#print "$magic\n";
@@ -171,8 +223,13 @@ sub new {
# !include <filename>
elsif ( $line =~ /^\!include\s*(.*?)\s*$/ ) {
my $include_file_name= dirname($path)."/".$1;
- # Check that the file exists
- die "The include file '$include_file_name' does not exist"
+
+ # Check that the file exists relative to path of first config file
+ if (! -f $include_file_name){
+ # Try to include file relativ to current dir
+ $include_file_name= $1;
+ }
+ croak "The include file '$include_file_name' does not exist"
unless -f $include_file_name;
$self->append(My::Config->new($include_file_name));
@@ -182,7 +239,7 @@ sub new {
elsif ( $line =~ /^([\@\w-]+)\s*$/ ) {
my $option= $1;
- die "Found option '$option' outside of group"
+ croak "Found option '$option' outside of group"
unless $group_name;
#print "$option\n";
@@ -194,13 +251,13 @@ sub new {
my $option= $1;
my $value= $2;
- die "Found option '$option=$value' outside of group"
+ croak "Found option '$option=$value' outside of group"
unless $group_name;
#print "$option=$value\n";
$self->insert($group_name, $option, $value);
} else {
- die "Unexpected line '$line' found in '$path'";
+ croak "Unexpected line '$line' found in '$path'";
}
}
@@ -231,6 +288,7 @@ sub insert {
# Add the option to the group
$group->insert($option, $value, $if_not_exist);
}
+ return $group;
}
#
@@ -240,11 +298,11 @@ sub remove {
my ($self, $group_name, $option_name)= @_;
my $group= $self->group($group_name);
- die "group '$group_name' does not exist"
+ croak "group '$group_name' does not exist"
unless defined($group);
$group->remove($option_name) or
- die "option '$option_name' does not exist";
+ croak "option '$option_name' does not exist";
}
@@ -267,10 +325,10 @@ sub group_exists {
#
sub _group_insert {
my ($self, $group_name)= @_;
- caller eq __PACKAGE__ or die;
+ caller eq __PACKAGE__ or croak;
# Check that group does not already exist
- die "Group already exists" if $self->group_exists($group_name);
+ croak "Group already exists" if $self->group_exists($group_name);
my $group= My::Config::Group->new($group_name);
push(@{$self->{groups}}, $group);
@@ -354,11 +412,11 @@ sub value {
my ($self, $group_name, $option_name)= @_;
my $group= $self->group($group_name);
- die "group '$group_name' does not exist"
+ croak "group '$group_name' does not exist"
unless defined($group);
my $option= $group->option($option_name);
- die "option '$option_name' does not exist"
+ croak "option '$option_name' does not exist"
unless defined($option);
return $option->value();
@@ -372,7 +430,7 @@ sub exists {
my ($self, $group_name, $option_name)= @_;
my $group= $self->group($group_name);
- die "group '$group_name' does not exist"
+ croak "group '$group_name' does not exist"
unless defined($group);
my $option= $group->option($option_name);
@@ -412,11 +470,11 @@ sub stringify {
# Save the config to named file
#
sub save {
- my ($self, $path)= @_;
- my $F= IO::File->new($path, ">")
- or die "Could not open '$path': $!";
- print $F $self;
- undef $F; # Close the file
+ my ($self, $path)= @_;
+ my $F= IO::File->new($path, ">")
+ or croak "Could not open '$path': $!";
+ print $F $self;
+ undef $F; # Close the file
}
1;
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
new file mode 100644
index 00000000000..567a05ac7a1
--- /dev/null
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -0,0 +1,655 @@
+# -*- cperl -*-
+package My::ConfigFactory;
+
+use strict;
+use warnings;
+use Carp;
+
+use My::Config;
+use My::Find;
+
+use File::Basename;
+
+
+#
+# Rules to run first of all
+#
+my @pre_rules=
+(
+);
+
+
+my @share_locations= ("share/mysql", "sql/share", "share");
+
+
+sub get_basedir {
+ my ($self, $group)= @_;
+ my $basedir= $group->if_exist('basedir') ||
+ $self->{ARGS}->{basedir};
+ return $basedir;
+}
+
+
+sub fix_charset_dir {
+ my ($self, $config, $group_name, $group)= @_;
+ return my_find_dir($self->get_basedir($group),
+ \@share_locations, "charsets");
+}
+
+sub fix_language {
+ my ($self, $config, $group_name, $group)= @_;
+ return my_find_dir($self->get_basedir($group),
+ \@share_locations, "english");
+}
+
+sub fix_datadir {
+ my ($self, $config, $group_name)= @_;
+ my $vardir= $self->{ARGS}->{vardir};
+ return "$vardir/$group_name/data";
+}
+
+sub fix_pidfile {
+ my ($self, $config, $group_name, $group)= @_;
+ my $vardir= $self->{ARGS}->{vardir};
+ return "$vardir/run/$group_name.pid";
+}
+
+sub fix_port {
+ my ($self, $config, $group_name, $group)= @_;
+ my $hostname= $group->value('#host');
+ return $self->{HOSTS}->{$hostname}++;
+}
+
+sub fix_host {
+ my ($self)= @_;
+ # Get next host from HOSTS array
+ my @hosts= keys(%{$self->{HOSTS}});;
+ my $host_no= $self->{NEXT_HOST}++ % @hosts;
+ return $hosts[$host_no];
+}
+
+sub is_unique {
+ my ($config, $name, $value)= @_;
+
+ foreach my $group ( $config->groups() ) {
+ if ($group->option($name)) {
+ if ($group->value($name) eq $value){
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
+
+sub fix_server_id {
+ my ($self, $config, $group_name, $group)= @_;
+#define in the order that mysqlds are listed in my.cnf
+
+ my $server_id= $group->if_exist('server-id');
+ if (defined $server_id){
+ if (!is_unique($config, 'server-id', $server_id)) {
+ croak "The server-id($server_id) for '$group_name' is not unique";
+ }
+ return $server_id;
+ }
+
+ do {
+ $server_id= $self->{SERVER_ID}++;
+ } while(!is_unique($config, 'server-id', $server_id));
+
+ #print "$group_name: server_id: $server_id\n";
+ return $server_id;
+}
+
+sub fix_socket {
+ my ($self, $config, $group_name, $group)= @_;
+ # Put socket file in tmpdir
+ my $dir= $self->{ARGS}->{tmpdir};
+ return "$dir/$group_name.sock";
+}
+
+sub fix_tmpdir {
+ my ($self, $config, $group_name, $group)= @_;
+ my $dir= $self->{ARGS}->{tmpdir};
+ return "$dir/$group_name";
+}
+
+sub fix_log_error {
+ my ($self, $config, $group_name, $group)= @_;
+ my $dir= dirname($group->value('datadir'));
+ return "$dir/mysqld.err";
+}
+
+sub fix_log {
+ my ($self, $config, $group_name, $group)= @_;
+ my $dir= dirname($group->value('datadir'));
+ return "$dir/mysqld.log";
+}
+
+sub fix_log_slow_queries {
+ my ($self, $config, $group_name, $group)= @_;
+ my $dir= dirname($group->value('datadir'));
+ return "$dir/mysqld-slow.log";
+}
+
+sub fix_secure_file_priv {
+ my ($self)= @_;
+ my $vardir= $self->{ARGS}->{vardir};
+ # By default, prevent the started mysqld to access files outside of vardir
+ return $vardir;
+}
+
+sub fix_std_data {
+ my ($self, $config, $group_name, $group)= @_;
+ my $basedir= $self->get_basedir($group);
+ return "$basedir/mysql-test/std_data";
+}
+
+sub ssl_supported {
+ my ($self)= @_;
+ return $self->{ARGS}->{ssl};
+}
+
+sub fix_skip_ssl {
+ return if !ssl_supported(@_);
+ # Add skip-ssl if ssl is supported to avoid
+ # that mysqltest connects with SSL by default
+ return 1;
+}
+
+sub fix_ssl_ca {
+ return if !ssl_supported(@_);
+ my $std_data= fix_std_data(@_);
+ return "$std_data/cacert.pem"
+}
+
+sub fix_ssl_server_cert {
+ return if !ssl_supported(@_);
+ my $std_data= fix_std_data(@_);
+ return "$std_data/server-cert.pem"
+}
+
+sub fix_ssl_client_cert {
+ return if !ssl_supported(@_);
+ my $std_data= fix_std_data(@_);
+ return "$std_data/client-cert.pem"
+}
+
+sub fix_ssl_server_key {
+ return if !ssl_supported(@_);
+ my $std_data= fix_std_data(@_);
+ return "$std_data/server-key.pem"
+}
+
+sub fix_ssl_client_key {
+ return if !ssl_supported(@_);
+ my $std_data= fix_std_data(@_);
+ return "$std_data/client-key.pem"
+}
+
+
+#
+# Rules to run for each mysqld in the config
+# - will be run in order listed here
+#
+my @mysqld_rules=
+ (
+ { 'basedir' => sub { return shift->{ARGS}->{basedir}; } },
+ { 'tmpdir' => \&fix_tmpdir },
+ { 'character-sets-dir' => \&fix_charset_dir },
+ { 'language' => \&fix_language },
+ { 'datadir' => \&fix_datadir },
+ { 'pid-file' => \&fix_pidfile },
+ { '#host' => \&fix_host },
+ { 'port' => \&fix_port },
+ { 'socket' => \&fix_socket },
+ { 'log-error' => \&fix_log_error },
+ { 'log' => \&fix_log },
+ { 'log-slow-queries' => \&fix_log_slow_queries },
+ { '#user' => sub { return shift->{ARGS}->{user} || ""; } },
+ { '#password' => sub { return shift->{ARGS}->{password} || ""; } },
+ { 'server-id' => \&fix_server_id, },
+ # By default, prevent the started mysqld to access files outside of vardir
+ { 'secure-file-priv' => sub { return shift->{ARGS}->{vardir}; } },
+ { 'ssl-ca' => \&fix_ssl_ca },
+ { 'ssl-cert' => \&fix_ssl_server_cert },
+ { 'ssl-key' => \&fix_ssl_server_key },
+ );
+
+
+sub fix_ndb_mgmd_port {
+ my ($self, $config, $group_name, $group)= @_;
+ my $hostname= $group->value('HostName');
+ return $self->{HOSTS}->{$hostname}++;
+}
+
+
+sub fix_cluster_dir {
+ my ($self, $config, $group_name, $group)= @_;
+ my $vardir= $self->{ARGS}->{vardir};
+ my (undef, $process_type, $idx, $suffix)= split(/\./, $group_name);
+ return "$vardir/mysql_cluster.$suffix/$process_type.$idx";
+}
+
+
+sub fix_cluster_backup_dir {
+ my ($self, $config, $group_name, $group)= @_;
+ my $vardir= $self->{ARGS}->{vardir};
+ my (undef, $process_type, $idx, $suffix)= split(/\./, $group_name);
+ return "$vardir/mysql_cluster.$suffix/";
+}
+
+
+#
+# Rules to run for each ndb_mgmd in the config
+# - will be run in order listed here
+#
+my @ndb_mgmd_rules=
+(
+ { 'PortNumber' => \&fix_ndb_mgmd_port },
+ { 'DataDir' => \&fix_cluster_dir },
+);
+
+
+#
+# Rules to run for each ndbd in the config
+# - will be run in order listed here
+#
+my @ndbd_rules=
+(
+ { 'HostName' => \&fix_host },
+ { 'DataDir' => \&fix_cluster_dir },
+ { 'BackupDataDir' => \&fix_cluster_backup_dir },
+);
+
+
+#
+# Rules to run for each cluster_config section
+# - will be run in order listed here
+#
+my @cluster_config_rules=
+(
+ { 'ndb_mgmd' => \&fix_host },
+ { 'ndbd' => \&fix_host },
+ { 'mysqld' => \&fix_host },
+ { 'ndbapi' => \&fix_host },
+);
+
+
+#
+# Rules to run for [client] section
+# - will be run in order listed here
+#
+my @client_rules=
+(
+);
+
+
+#
+# Rules to run for [mysqltest] section
+# - will be run in order listed here
+#
+my @mysqltest_rules=
+(
+ { 'ssl-ca' => \&fix_ssl_ca },
+ { 'ssl-cert' => \&fix_ssl_client_cert },
+ { 'ssl-key' => \&fix_ssl_client_key },
+ { 'skip-ssl' => \&fix_skip_ssl },
+);
+
+
+#
+# Rules to run for [mysqlbinlog] section
+# - will be run in order listed here
+#
+my @mysqlbinlog_rules=
+(
+ { 'character-sets-dir' => \&fix_charset_dir },
+);
+
+
+#
+# Rules to run for [mysql_upgrade] section
+# - will be run in order listed here
+#
+my @mysql_upgrade_rules=
+(
+ { 'tmpdir' => sub { return shift->{ARGS}->{tmpdir}; } },
+);
+
+
+#
+# Generate a [client.<suffix>] group to be
+# used for connecting to [mysqld.<suffix>]
+#
+sub post_check_client_group {
+ my ($self, $config, $client_group_name, $mysqld_group_name)= @_;
+
+ # Settings needed for client, copied from its "mysqld"
+ my %client_needs=
+ (
+ port => 'port',
+ socket => 'socket',
+ host => '#host',
+ user => '#user',
+ password => '#password',
+ );
+
+ my $group_to_copy_from= $config->group($mysqld_group_name);
+ while (my ($name_to, $name_from)= each( %client_needs )) {
+ my $option= $group_to_copy_from->option($name_from);
+
+ if (! defined $option){
+ #print $config;
+ croak "Could not get value for '$name_from'";
+ }
+ $config->insert($client_group_name, $name_to, $option->value())
+ }
+}
+
+
+sub post_check_client_groups {
+ my ($self, $config)= @_;
+
+ my $first_mysqld= $config->first_like('mysqld.');
+
+ return unless $first_mysqld;
+
+ # Always generate [client] pointing to the first
+ # [mysqld.<suffix>]
+ $self->post_check_client_group($config,
+ 'client',
+ $first_mysqld->name());
+
+ # Then generate [client.<suffix>] for each [mysqld.<suffix>]
+ foreach my $mysqld ( $config->like('mysqld.') ) {
+ $self->post_check_client_group($config,
+ 'client'.$mysqld->after('mysqld'),
+ $mysqld->name())
+ }
+
+}
+
+
+#
+# Generate [embedded] by copying the values
+# needed from the default [mysqld] section
+# and from first [mysqld.<suffix>]
+#
+sub post_check_embedded_group {
+ my ($self, $config)= @_;
+
+ return unless $self->{ARGS}->{embedded};
+
+ my $mysqld= $config->group('mysqld') or
+ croak "Can't run with embedded, config has no default mysqld section";
+
+ my $first_mysqld= $config->first_like('mysqld.') or
+ croak "Can't run with embedded, config has no mysqld";
+
+ my @no_copy =
+ (
+ 'log-error', # Embedded server writes stderr to mysqltest's log file
+ 'slave-net-timeout', # Embedded server are not build with replication
+ );
+
+ foreach my $option ( $mysqld->options(), $first_mysqld->options() ) {
+ # Don't copy options whose name is in "no_copy" list
+ next if grep ( $option->name() eq $_, @no_copy);
+
+ $config->insert('embedded', $option->name(), $option->value())
+ }
+
+}
+
+
+sub resolve_at_variable {
+ my ($self, $config, $group, $option)= @_;
+
+ # Split the options value on last .
+ my @parts= split(/\./, $option->value());
+ my $option_name= pop(@parts);
+ my $group_name= join('.', @parts);
+
+ $group_name =~ s/^\@//; # Remove at
+
+ my $from_group= $config->group($group_name)
+ or croak "There is no group named '$group_name' that ",
+ "can be used to resolve '$option_name'";
+
+ my $from= $from_group->value($option_name);
+ $config->insert($group->name(), $option->name(), $from)
+}
+
+
+sub post_fix_resolve_at_variables {
+ my ($self, $config)= @_;
+
+ foreach my $group ( $config->groups() ) {
+ foreach my $option ( $group->options()) {
+ next unless defined $option->value();
+
+ $self->resolve_at_variable($config, $group, $option)
+ if ($option->value() =~ /^\@/);
+ }
+ }
+}
+
+sub post_fix_mysql_cluster_section {
+ my ($self, $config)= @_;
+
+ # Add a [mysl_cluster.<suffix>] section for each
+ # defined [cluster_config.<suffix>] section
+ foreach my $group ( $config->like('cluster_config\.\w*$') )
+ {
+ my @urls;
+ # Generate ndb_connectstring for this cluster
+ foreach my $ndb_mgmd ( $config->like('cluster_config.ndb_mgmd.')) {
+ if ($ndb_mgmd->suffix() eq $group->suffix()) {
+ my $host= $ndb_mgmd->value('HostName');
+ my $port= $ndb_mgmd->value('PortNumber');
+ push(@urls, "$host:$port");
+ }
+ }
+ croak "Could not generate valid ndb_connectstring for '$group'"
+ unless @urls > 0;
+ my $ndb_connectstring= join(";", @urls);
+
+ # Add ndb_connectstring to [mysql_cluster.<suffix>]
+ $config->insert('mysql_cluster'.$group->suffix(),
+ 'ndb_connectstring', $ndb_connectstring);
+
+ # Add ndb_connectstring to each mysqld connected to this
+ # cluster
+ foreach my $mysqld ( $config->like('cluster_config.mysqld.')) {
+ if ($mysqld->suffix() eq $group->suffix()) {
+ my $after= $mysqld->after('cluster_config.mysqld');
+ $config->insert("mysqld$after",
+ 'ndb_connectstring', $ndb_connectstring);
+ }
+ }
+ }
+}
+
+#
+# Rules to run last of all
+#
+my @post_rules=
+(
+ \&post_check_client_groups,
+ \&post_fix_mysql_cluster_section,
+ \&post_fix_resolve_at_variables,
+ \&post_check_embedded_group,
+);
+
+
+sub run_rules_for_group {
+ my ($self, $config, $group, @rules)= @_;
+ foreach my $hash ( @rules ) {
+ while (my ($option, $rule)= each( %{$hash} )) {
+ # Only run this rule if the value is not already defined
+ if (!$config->exists($group->name(), $option)) {
+ my $value;
+ if (ref $rule eq "CODE") {
+ # Call the rule function
+ $value= &$rule($self, $config, $group->name(),
+ $config->group($group->name()));
+ } else {
+ $value= $rule;
+ }
+ if (defined $value) {
+ $config->insert($group->name(), $option, $value, 1);
+ }
+ }
+ }
+ }
+}
+
+
+sub run_section_rules {
+ my ($self, $config, $name, @rules)= @_;
+
+ foreach my $group ( $config->like($name) ) {
+ $self->run_rules_for_group($config, $group, @rules);
+ }
+}
+
+
+sub run_generate_sections_from_cluster_config {
+ my ($self, $config)= @_;
+
+ my @options= ('ndb_mgmd', 'ndbd',
+ 'mysqld', 'ndbapi');
+
+ foreach my $group ( $config->like('cluster_config\.\w*$') ) {
+
+ # Keep track of current index per process type
+ my %idxes;
+ map { $idxes{$_}= 1; } @options;
+
+ foreach my $option_name ( @options ) {
+ my $value= $group->value($option_name);
+ my @hosts= split(/,/, $value, -1); # -1 => return also empty strings
+
+ # Add at least one host
+ push(@hosts, undef) unless scalar(@hosts);
+
+ # Assign hosts unless already fixed
+ @hosts= map { $self->fix_host() unless $_; } @hosts;
+
+ # Write the hosts value back
+ $group->insert($option_name, join(",", @hosts));
+
+ # Generate sections for each host
+ foreach my $host ( @hosts ){
+ my $idx= $idxes{$option_name}++;
+
+ my $suffix= $group->suffix();
+ # Generate a section for ndb_mgmd to read
+ $config->insert("cluster_config.$option_name.$idx$suffix",
+ "HostName", $host);
+
+ if ($option_name eq 'mysqld'){
+ my $datadir=
+ $self->fix_cluster_dir($config,
+ "cluster_config.mysqld.$idx$suffix",
+ $group);
+ $config->insert("mysqld.$idx$suffix",
+ 'datadir', "$datadir/data");
+ }
+ }
+ }
+ }
+}
+
+
+sub new_config {
+ my ($class, $args)= @_;
+
+ my @required_args= ('basedir', 'baseport', 'vardir', 'template_path');
+
+ foreach my $required ( @required_args ) {
+ croak "you must pass '$required'" unless defined $args->{$required};
+ }
+
+ # Fill in hosts/port hash
+ my $hosts= {};
+ my $baseport= $args->{baseport};
+ $args->{hosts}= [ 'localhost' ] unless exists($args->{hosts});
+ foreach my $host ( @{$args->{hosts}} ) {
+ $hosts->{$host}= $baseport;
+ }
+
+ # Open the config template
+ my $config= My::Config->new($args->{'template_path'});
+ my $extra_template_path= $args->{'extra_template_path'};
+ if ($extra_template_path){
+ $config->append(My::Config->new($extra_template_path));
+ }
+ my $self= bless {
+ CONFIG => $config,
+ ARGS => $args,
+ HOSTS => $hosts,
+ NEXT_HOST => 0,
+ SERVER_ID => 1,
+ }, $class;
+
+
+ {
+ # Run pre rules
+ foreach my $rule ( @pre_rules ) {
+ &$rule($self, $config);
+ }
+ }
+
+
+ $self->run_section_rules($config,
+ 'cluster_config\.\w*$',
+ @cluster_config_rules);
+ $self->run_generate_sections_from_cluster_config($config);
+
+ $self->run_section_rules($config,
+ 'cluster_config.ndb_mgmd.',
+ @ndb_mgmd_rules);
+ $self->run_section_rules($config,
+ 'cluster_config.ndbd',
+ @ndbd_rules);
+
+ $self->run_section_rules($config,
+ 'mysqld.',
+ @mysqld_rules);
+
+ # [mysqlbinlog] need additional settings
+ $self->run_rules_for_group($config,
+ $config->insert('mysqlbinlog'),
+ @mysqlbinlog_rules);
+
+ # [mysql_upgrade] need additional settings
+ $self->run_rules_for_group($config,
+ $config->insert('mysql_upgrade'),
+ @mysql_upgrade_rules);
+
+ # Additional rules required for [client]
+ $self->run_rules_for_group($config,
+ $config->insert('client'),
+ @client_rules);
+
+
+ # Additional rules required for [mysqltest]
+ $self->run_rules_for_group($config,
+ $config->insert('mysqltest'),
+ @mysqltest_rules);
+
+ {
+ # Run post rules
+ foreach my $rule ( @post_rules ) {
+ &$rule($self, $config);
+ }
+ }
+
+ return $config;
+}
+
+
+1;
+
diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm
new file mode 100644
index 00000000000..599f9ccbfca
--- /dev/null
+++ b/mysql-test/lib/My/CoreDump.pm
@@ -0,0 +1,131 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+package My::CoreDump;
+
+use strict;
+use Carp;
+use My::Platform;
+
+use File::Temp qw/ tempfile tempdir /;
+
+sub _gdb {
+ my ($core_name)= @_;
+
+ print "\nTrying 'gdb' to get a backtrace\n";
+
+ return unless -f $core_name;
+
+ # Find out name of binary that generated core
+ `gdb -c '$core_name' --batch 2>&1` =~
+ /Core was generated by `([^\s\'\`]+)/;
+ my $binary= $1 or return;
+ print "Core generated by '$binary'\n";
+
+ # Create tempfile containing gdb commands
+ my ($tmp, $tmp_name) = tempfile();
+ print $tmp
+ "bt\n",
+ "thread apply all bt\n",
+ "quit\n";
+ close $tmp or die "Error closing $tmp_name: $!";
+
+ # Run gdb
+ my $gdb_output=
+ `gdb '$binary' -c '$core_name' -x '$tmp_name' --batch 2>&1`;
+
+ unlink $tmp_name or die "Error removing $tmp_name: $!";
+
+ return if $? >> 8;
+ return unless $gdb_output;
+
+ print <<EOF, $gdb_output, "\n";
+Output from gdb follows. The first stack trace is from the failing thread.
+The following stack traces are from all threads (so the failing one is
+duplicated).
+--------------------------
+EOF
+ return 1;
+}
+
+
+sub _dbx {
+ my ($core_name)= @_;
+
+ print "\nTrying 'dbx' to get a backtrace\n";
+
+ return unless -f $core_name;
+
+ # Find out name of binary that generated core
+ `echo | dbx - '$core_name' 2>&1` =~
+ /Corefile specified executable: "([^"]+)"/;
+ my $binary= $1 or return;
+ print "Core generated by '$binary'\n";
+
+ # Find all threads
+ my @thr_ids = `echo threads | dbx '$binary' '$core_name' 2>&1` =~ /t@\d+/g;
+
+ # Create tempfile containing dbx commands
+ my ($tmp, $tmp_name) = tempfile();
+ foreach my $thread (@thr_ids) {
+ print $tmp "where $thread\n";
+ }
+ print $tmp "exit\n";
+ close $tmp or die "Error closing $tmp_name: $!";
+
+ # Run dbx
+ my $dbx_output=
+ `cat '$tmp_name' | dbx '$binary' '$core_name' 2>&1`;
+
+ unlink $tmp_name or die "Error removing $tmp_name: $!";
+
+ return if $? >> 8;
+ return unless $dbx_output;
+
+ print <<EOF, $dbx_output, "\n";
+Output from dbx follows. Stack trace is printed for all threads in order,
+above this you should see info about which thread was the failing one.
+----------------------------
+EOF
+ return 1;
+}
+
+
+sub show {
+ my ($class, $core_name)= @_;
+
+ # We try dbx first; gdb itself may coredump if run on a Sun Studio
+ # compiled binary on Solaris.
+
+ my @debuggers =
+ (
+ \&_dbx,
+ \&_gdb,
+ # TODO...
+ );
+
+ # Try debuggers until one succeeds
+
+ foreach my $debugger (@debuggers){
+ if ($debugger->($core_name)){
+ return;
+ }
+ }
+ return;
+}
+
+
+1;
diff --git a/mysql-test/lib/My/File/Path.pm b/mysql-test/lib/My/File/Path.pm
new file mode 100644
index 00000000000..99edeecdaf7
--- /dev/null
+++ b/mysql-test/lib/My/File/Path.pm
@@ -0,0 +1,177 @@
+# -*- cperl -*-
+package My::File::Path;
+use strict;
+
+
+#
+# File::Path::rmtree has a problem with deleting files
+# and directories where it hasn't got read permission
+#
+# Patch this by installing a 'rmtree' function in local
+# scope that first chmod all files to 0777 before calling
+# the original rmtree function.
+#
+# This is almost gone in version 1.08 of File::Path -
+# but unfortunately some hosts still suffers
+# from this also in 1.08
+#
+
+use Exporter;
+use base "Exporter";
+our @EXPORT= qw / rmtree mkpath copytree /;
+
+use File::Find;
+use File::Copy;
+use File::Spec;
+use Carp;
+use My::Handles;
+use My::Platform;
+
+sub rmtree {
+ my ($dir)= @_;
+ find( {
+ bydepth => 1,
+ no_chdir => 1,
+ wanted => sub {
+ my $name= $_;
+ if (!-l $name && -d _){
+ return if (rmdir($name) == 1);
+
+ chmod(0777, $name) or carp("couldn't chmod(0777, $name): $!");
+
+ return if (rmdir($name) == 1);
+
+ # Failed to remove the directory, analyze
+ carp("Couldn't remove directory '$name': $!");
+ My::Handles::show_handles($name);
+ } else {
+ return if (unlink($name) == 1);
+
+ chmod(0777, $name) or carp("couldn't chmod(0777, $name): $!");
+
+ return if (unlink($name) == 1);
+
+ carp("Couldn't delete file '$name': $!");
+ My::Handles::show_handles($name);
+ }
+ }
+ }, $dir );
+};
+
+
+use File::Basename;
+sub _mkpath_debug {
+ my ($message, $path, $dir, $err)= @_;
+
+ print "=" x 40, "\n";
+ print $message, "\n";
+ print "err: '$err'\n";
+ print "path: '$path'\n";
+ print "dir: '$dir'\n";
+
+ print "-" x 40, "\n";
+ my $dirname= dirname($path);
+ print "ls -l $dirname\n";
+ print `ls -l $dirname`, "\n";
+ print "-" x 40, "\n";
+ print "dir $dirname\n";
+ print `dir $dirname`, "\n";
+ print "-" x 40, "\n";
+ my $dirname2= dirname($dirname);
+ print "ls -l $dirname2\n";
+ print `ls -l $dirname2`, "\n";
+ print "-" x 40, "\n";
+ print "dir $dirname2\n";
+ print `dir $dirname2`, "\n";
+ print "-" x 40, "\n";
+ print "file exists\n" if (-e $path);
+ print "file is a plain file\n" if (-f $path);
+ print "file is a directory\n" if (-d $path);
+ print "-" x 40, "\n";
+ print "showing handles for $path\n";
+ My::Handles::show_handles($path);
+
+ print "=" x 40, "\n";
+
+}
+
+
+sub mkpath {
+ my $path;
+
+ die "Usage: mkpath(<path>)" unless @_ == 1;
+
+ foreach my $dir ( File::Spec->splitdir( @_ ) ) {
+ #print "dir: $dir\n";
+ if ($dir =~ /^[a-z]:/i){
+ # Found volume ie. C:
+ $path= $dir;
+ next;
+ }
+
+ $path= File::Spec->catdir($path, $dir);
+ #print "path: $path\n";
+
+ next if -d $path; # Path already exists and is a directory
+ croak("File already exists but is not a directory: '$path'") if -e $path;
+ next if mkdir($path);
+ _mkpath_debug("mkdir failed", $path, $dir, $!);
+
+ # mkdir failed, try one more time
+ next if mkdir($path);
+ _mkpath_debug("mkdir failed, second time", $path, $dir, $!);
+
+ # mkdir failed again, try two more time after sleep(s)
+ sleep(1);
+ next if mkdir($path);
+ _mkpath_debug("mkdir failed, third time", $path, $dir, $!);
+
+ sleep(1);
+ next if mkdir($path);
+ _mkpath_debug("mkdir failed, fourth time", $path, $dir, $!);
+
+ # Report failure and die
+ croak("Couldn't create directory '$path' ",
+ " after 4 attempts and 2 sleep(1): $!");
+ }
+};
+
+
+sub copytree {
+ my ($from_dir, $to_dir, $use_umask) = @_;
+
+ die "Usage: copytree(<fromdir>, <todir>, [<umask>])"
+ unless @_ == 2 or @_ == 3;
+
+ my $orig_umask;
+ if ($use_umask){
+ # Set new umask and remember the original
+ $orig_umask= umask(oct($use_umask));
+ }
+
+ mkpath("$to_dir");
+ opendir(DIR, "$from_dir")
+ or croak("Can't find $from_dir$!");
+ for(readdir(DIR)) {
+
+ next if "$_" eq "." or "$_" eq "..";
+
+ # Skip SCCS/ directories
+ next if "$_" eq "SCCS";
+
+ if ( -d "$from_dir/$_" )
+ {
+ copytree("$from_dir/$_", "$to_dir/$_");
+ next;
+ }
+ copy("$from_dir/$_", "$to_dir/$_");
+ }
+ closedir(DIR);
+
+ if ($orig_umask){
+ # Set the original umask
+ umask($orig_umask);
+ }
+}
+
+1;
diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm
new file mode 100644
index 00000000000..8557584bbc8
--- /dev/null
+++ b/mysql-test/lib/My/Find.pm
@@ -0,0 +1,245 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+package My::Find;
+
+#
+# Utility functions to find files in a MySQL source or bindist
+#
+
+use strict;
+use Carp;
+use My::Platform;
+
+use base qw(Exporter);
+our @EXPORT= qw(my_find_bin my_find_dir my_find_file NOT_REQUIRED);
+
+our $vs_config_dir;
+
+my $bin_extension= ".exe" if IS_WINDOWS;
+
+# Helper function to be used for fourth parameter to find functions
+sub NOT_REQUIRED { return 0; }
+
+#
+# my_find_bin - find an executable with "name_1...name_n" in
+# paths "path_1...path_n" and return the full path
+#
+# Example:
+# my $mysqld_exe= my_find_bin($basedir.
+# ["sql", "bin"],
+# ["mysqld", "mysqld-debug"]);
+# my $mysql_exe= my_find_bin($basedir,
+# ["client", "bin"],
+# "mysql");
+#
+#
+# To check if something exists, use the required parameter
+# set to 0, the function will return an empty string if the
+# binary is not found
+# my $mysql_exe= my_find_bin($basedir,
+# ["client", "bin"],
+# "mysql", NOT_REQUIRED);
+#
+# NOTE: The function honours MTR_VS_CONFIG environment variable
+#
+#
+sub my_find_bin {
+ my ($base, $paths, $names, $required)= @_;
+ croak "usage: my_find_bin(<base>, <paths>, <names>, [<required>])"
+ unless @_ == 4 or @_ == 3;
+
+ # -------------------------------------------------------
+ # Find and return the first executable
+ # -------------------------------------------------------
+ foreach my $path (my_find_paths($base, $paths, $names, $bin_extension)) {
+ return $path if ( -x $path or (IS_WINDOWS and -f $path) );
+ }
+ if (defined $required and $required == NOT_REQUIRED){
+ # Return empty string to indicate not found
+ return "";
+ }
+ find_error($base, $paths, $names);
+}
+
+
+#
+# my_find_file - find a file with "name_1...name_n" in
+# paths "path_1...path_n" and return the full path
+#
+# Example:
+# my $mysqld_exe= my_find_file($basedir.
+# ["sql", "bin"],
+# "filename");
+#
+#
+# Also supports NOT_REQUIRED flag
+#
+# NOTE: The function honours MTR_VS_CONFIG environment variable
+#
+#
+sub my_find_file {
+ my ($base, $paths, $names, $required)= @_;
+ croak "usage: my_find_file(<base>, <paths>, <names>, [<required>])"
+ unless @_ == 4 or @_ == 3;
+
+ # -------------------------------------------------------
+ # Find and return the first executable
+ # -------------------------------------------------------
+ foreach my $path (my_find_paths($base, $paths, $names, $bin_extension)) {
+ return $path if ( -f $path );
+ }
+ if (defined $required and $required == NOT_REQUIRED){
+ # Return empty string to indicate not found
+ return "";
+ }
+ find_error($base, $paths, $names);
+}
+
+
+#
+# my_find_dir - find the first existing directory in one of
+# the given paths
+#
+# Example:
+# my $charset_set= my_find_dir($basedir,
+# ["mysql/share","sql/share", "share"],
+# ["charset"]);
+# or
+# my $charset_set= my_find_dir($basedir,
+# ['client_release', 'client_debug',
+# 'client', 'bin']);
+#
+# NOTE: The function honours MTR_VS_CONFIG environment variable
+#
+#
+sub my_find_dir {
+ my ($base, $paths, $dirs, $required)= @_;
+ croak "usage: my_find_dir(<base>, <paths>[, <dirs>])"
+ unless (@_ == 3 or @_ == 2);
+
+ # -------------------------------------------------------
+ # Find and return the first directory
+ # -------------------------------------------------------
+ foreach my $path (my_find_paths($base, $paths, $dirs)) {
+ return $path if ( -d $path );
+ }
+ find_error($base, $paths, $dirs);
+}
+
+
+sub my_find_paths {
+ my ($base, $paths, $names, $extension)= @_;
+
+ # Convert the arguments into two normal arrays to ease
+ # further mappings
+ my (@names, @paths);
+ push(@names, ref $names eq "ARRAY" ? @$names : $names);
+ push(@paths, ref $paths eq "ARRAY" ? @$paths : $paths);
+
+ #print "base: $base\n";
+ #print "names: @names\n";
+ #print "paths: @paths\n";
+
+ # User can select to look in a special build dir
+ # which is a subdirectory of any of the paths
+ my @extra_dirs;
+ my $build_dir= $vs_config_dir || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
+ push(@extra_dirs, $build_dir) if defined $build_dir;
+
+ if (defined $extension){
+ # Append extension to names, if name does not already have extension
+ map { $_.=$extension unless /\.(.*)+$/ } @names;
+ }
+
+ # -------------------------------------------------------
+ # Windows specific
+ # -------------------------------------------------------
+ if (IS_WINDOWS) {
+ # Add the default extra build dirs unless a specific one has
+ # already been selected
+ push(@extra_dirs,
+ ("release",
+ "relwithdebinfo",
+ "debug")) if @extra_dirs == 0;
+ }
+
+ #print "extra_build_dir: @extra_dirs\n";
+
+ # -------------------------------------------------------
+ # Build cross product of "paths * extra_build_dirs"
+ # -------------------------------------------------------
+ push(@paths, map { my $path= $_;
+ map { "$path/$_" } @extra_dirs
+ } @paths);
+ #print "paths: @paths\n";
+
+ # -------------------------------------------------------
+ # Build cross product of "paths * names"
+ # -------------------------------------------------------
+ @paths= map { my $path= $_;
+ map { "$path/$_" } @names
+ } @paths;
+ #print "paths: @paths\n";
+
+ # -------------------------------------------------------
+ # Prepend base to all paths
+ # -------------------------------------------------------
+ @paths= map { "$base/$_" } @paths;
+ #print "paths: @paths\n";
+
+ # -------------------------------------------------------
+ # Glob all paths to expand wildcards
+ # -------------------------------------------------------
+ @paths= map { glob("$_") } @paths;
+ #print "paths: @paths\n";
+
+ # -------------------------------------------------------
+ # Return the list of paths
+ # -------------------------------------------------------
+ return @paths;
+}
+
+
+sub commify {
+ return
+ (@_ == 0) ? '' :
+ (@_ == 1) ? $_[0] :
+ (@_ == 2) ? join(" or ", @_) :
+ join(", ", @_[0..($#_-1)], "or $_[-1]");
+
+}
+
+
+sub fnuttify {
+ return map('\''.$_.'\'', @_);
+}
+
+
+sub find_error {
+ my ($base, $paths, $names)= @_;
+
+ my (@names, @paths);
+ push(@names, ref $names eq "ARRAY" ? @$names : $names);
+ push(@paths, ref $paths eq "ARRAY" ? @$paths : $paths);
+
+ croak "** ERROR: Could not find ",
+ commify(fnuttify(@names)), " in ",
+ commify(fnuttify(my_find_paths($base, $paths, $names))), "\n";
+}
+
+1;
diff --git a/mysql-test/lib/My/Handles.pm b/mysql-test/lib/My/Handles.pm
new file mode 100755
index 00000000000..66ee22b403f
--- /dev/null
+++ b/mysql-test/lib/My/Handles.pm
@@ -0,0 +1,69 @@
+# -*- cperl -*-
+# Copyright (C) 2008 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+package My::Handles;
+
+
+use strict;
+use Carp;
+
+use My::Platform;
+
+my $handle_exe;
+
+
+if (IS_WINDOWS){
+ # Check if handle.exe is available
+ # Pass switch to accept the EULA to avoid hanging
+ # if the program hasn't been run before.
+ my $list= `handle.exe -? -accepteula 2>&1`;
+ foreach my $line (split('\n', $list))
+ {
+ $handle_exe= "$1.$2"
+ if ($line =~ /Handle v([0-9]*)\.([0-9]*)/);
+ }
+ if ($handle_exe){
+ print "Found handle.exe version $handle_exe\n";
+ }
+}
+
+
+sub show_handles
+{
+ my ($dir)= @_;
+ return unless $handle_exe;
+ return unless $dir;
+
+ $dir= native_path($dir);
+
+ # Get a list of open handles in a particular directory
+ my $list= `handle.exe "$dir" 2>&1` or return;
+
+ foreach my $line (split('\n', $list))
+ {
+ return if ($line =~ /No matching handles found/);
+ }
+
+ print "\n";
+ print "=" x 50, "\n";
+ print "Open handles in '$dir':\n";
+ print "$list\n";
+ print "=" x 50, "\n\n";
+
+ return;
+}
+
+1;
diff --git a/mysql-test/lib/My/Options.pm b/mysql-test/lib/My/Options.pm
new file mode 100644
index 00000000000..40f05c41d1c
--- /dev/null
+++ b/mysql-test/lib/My/Options.pm
@@ -0,0 +1,199 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+package My::Options;
+
+#
+# Utility functions to work with list of options
+#
+
+use strict;
+
+
+sub same($$) {
+ my $l1= shift;
+ my $l2= shift;
+ return compare($l1,$l2) == 0;
+}
+
+
+sub compare ($$) {
+ my $l1= shift;
+ my $l2= shift;
+
+ my @l1= @$l1;
+ my @l2= @$l2;
+
+ return -1 if @l1 < @l2;
+ return 1 if @l1 > @l2;
+
+ while ( @l1 ) # Same length
+ {
+ my $e1= shift @l1;
+ my $e2= shift @l2;
+ my $cmp= ($e1 cmp $e2);
+ return $cmp if $cmp != 0;
+ }
+
+ return 0; # They are the same
+}
+
+
+sub _split_option {
+ my ($option)= @_;
+ if ($option=~ /^--(.*)=(.*)$/){
+ return ($1, $2);
+ }
+ elsif ($option=~ /^--(.*)$/){
+ return ($1, undef)
+ }
+ elsif ($option=~ /^\$(.*)$/){ # $VAR
+ return ($1, undef)
+ }
+ elsif ($option=~ /^(.*)=(.*)$/){
+ return ($1, $2)
+ }
+ elsif ($option=~ /^-O$/){
+ return (undef, undef);
+ }
+ die "Unknown option format '$option'";
+}
+
+
+sub _build_option {
+ my ($name, $value)= @_;
+ if ($name =~ /^O, /){
+ return "-".$name."=".$value;
+ }
+ elsif ($value){
+ return "--".$name."=".$value;
+ }
+ return "--".$name;
+}
+
+
+#
+# Compare two list of options and return what would need
+# to be done to get the server running with the new settings
+#
+sub diff {
+ my ($from_opts, $to_opts)= @_;
+
+ my %from;
+ foreach my $from (@$from_opts)
+ {
+ my ($opt, $value)= _split_option($from);
+ next unless defined($opt);
+ $from{$opt}= $value;
+ }
+
+ #print "from: ", %from, "\n";
+
+ my %to;
+ foreach my $to (@$to_opts)
+ {
+ my ($opt, $value)= _split_option($to);
+ next unless defined($opt);
+ $to{$opt}= $value;
+ }
+
+ #print "to: ", %to, "\n";
+
+ # Remove the ones that are in both lists
+ foreach my $name (keys %from){
+ if (exists $to{$name} and $to{$name} eq $from{$name}){
+ #print "removing '$name' from both lists\n";
+ delete $to{$name};
+ delete $from{$name};
+ }
+ }
+
+ #print "from: ", %from, "\n";
+ #print "to: ", %to, "\n";
+
+ # Add all keys in "to" to result
+ my @result;
+ foreach my $name (keys %to){
+ push(@result, _build_option($name, $to{$name}));
+ }
+
+ # Add all keys in "from" that are not in "to"
+ # to result as "set to default"
+ foreach my $name (keys %from){
+ if (not exists $to{$name}) {
+ push(@result, _build_option($name, "default"));
+ }
+ }
+
+ return @result;
+}
+
+
+sub is_set {
+ my ($opts, $set_opts)= @_;
+
+ foreach my $opt (@$opts){
+
+ my ($opt_name1, $value1)= _split_option($opt);
+
+ foreach my $set_opt (@$set_opts){
+ my ($opt_name2, $value2)= _split_option($set_opt);
+
+ if ($opt_name1 eq $opt_name2){
+ # Option already set
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+sub toSQL {
+ my (@options)= @_;
+ my @sql;
+
+ foreach my $option (@options) {
+ my ($name, $value)= _split_option($option);
+ #print "name: $name\n";
+ #print "value: $value\n";
+ if ($name =~ /^O, (.*)/){
+ push(@sql, "SET GLOBAL $1=$value");
+ }
+ elsif ($name =~ /^set-variable=(.*)/){
+ push(@sql, "SET GLOBAL $1=$value");
+ }
+ else {
+ my $sql_name= $name;
+ $sql_name=~ s/-/_/g;
+ push(@sql, "SET GLOBAL $sql_name=$value");
+ }
+ }
+ return join("; ", @sql);
+}
+
+
+sub toStr {
+ my $name= shift;
+ return "$name: ",
+ "['", join("', '", @_), "']\n";
+}
+
+
+1;
+
diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm
new file mode 100644
index 00000000000..3dd5c552b10
--- /dev/null
+++ b/mysql-test/lib/My/Platform.pm
@@ -0,0 +1,156 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+package My::Platform;
+
+use strict;
+use File::Basename;
+use File::Path;
+
+use base qw(Exporter);
+our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL
+ native_path posix_path mixed_path
+ check_socket_path_length process_alive);
+
+BEGIN {
+ if ($^O eq "cygwin") {
+ # Make sure cygpath works
+ if ((system("cygpath > /dev/null 2>&1") >> 8) != 1){
+ die "Could not execute 'cygpath': $!";
+ }
+ eval 'sub IS_CYGWIN { 1 }';
+ }
+ else {
+ eval 'sub IS_CYGWIN { 0 }';
+ }
+ if ($^O eq "MSWin32") {
+ eval 'sub IS_WIN32PERL { 1 }';
+ }
+ else {
+ eval 'sub IS_WIN32PERL { 0 }';
+ }
+}
+
+BEGIN {
+ if (IS_CYGWIN or IS_WIN32PERL) {
+ eval 'sub IS_WINDOWS { 1 }';
+ }
+ else {
+ eval 'sub IS_WINDOWS { 0 }';
+ }
+}
+
+
+#
+# native_path
+# Convert from path format used by perl to the underlying
+# operating systems format
+#
+# NOTE
+# Used when running windows binaries (that expect windows paths)
+# in cygwin perl (that uses unix paths)
+#
+
+use Memoize;
+if (!IS_WIN32PERL){
+ memoize('mixed_path');
+ memoize('native_path');
+ memoize('posix_path');
+}
+
+sub mixed_path {
+ my ($path)= @_;
+ if (IS_CYGWIN){
+ return unless defined $path;
+ my $cmd= "cygpath -m $path";
+ $path= `$cmd` or
+ print "Failed to run: '$cmd', $!\n";
+ chomp $path;
+ }
+ return $path;
+}
+
+sub native_path {
+ my ($path)= @_;
+ $path=~ s/\//\\/g
+ if (IS_CYGWIN or IS_WIN32PERL);
+ return $path;
+}
+
+sub posix_path {
+ my ($path)= @_;
+ if (IS_CYGWIN){
+ return unless defined $path;
+ $path= `cygpath $path`;
+ chomp $path;
+ }
+ return $path;
+}
+
+use File::Temp qw /tempdir/;
+
+sub check_socket_path_length {
+ my ($path)= @_;
+
+ return 0 if IS_WINDOWS;
+
+ require IO::Socket::UNIX;
+
+ my $truncated= 1; # Be negative
+
+ # Create a tempfile name with same length as "path"
+ my $tmpdir = tempdir( CLEANUP => 0);
+ my $len = length($path) - length($tmpdir);
+ my $testfile = $tmpdir . "x" x ($len > 0 ? $len : 1);
+ my $sock;
+ eval {
+ $sock= new IO::Socket::UNIX
+ (
+ Local => $testfile,
+ Listen => 1,
+ );
+
+ die "Could not create UNIX domain socket: $!"
+ unless defined $sock;
+
+ die "UNIX domain socket patch was truncated"
+ unless ($testfile eq $sock->hostpath());
+
+ $truncated= 0; # Yes, it worked!
+
+ };
+ #print "check_socket_path_length, failed: ", $@, '\n' if ($@);
+
+ $sock= undef; # Close socket
+ unlink($testfile); # Remove the physical file
+ rmdir($tmpdir); # Remove the tempdir
+ return $truncated;
+}
+
+
+sub process_alive {
+ my ($pid)= @_;
+ die "usage: process_alive(pid)" unless $pid;
+
+ return kill(0, $pid) unless IS_WINDOWS;
+
+ my @list= split(/,/, `tasklist /FI "PID eq $pid" /NH /FO CSV`);
+ my $ret_pid= eval($list[1]);
+ return ($ret_pid == $pid);
+}
+
+
+1;
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
new file mode 100644
index 00000000000..0e3aa968052
--- /dev/null
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -0,0 +1,580 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+package My::SafeProcess;
+
+#
+# Class that encapsulates process creation, monitoring and cleanup
+#
+# Spawns a monitor process which spawns a new process locally or
+# remote using subclasses My::Process::Local or My::Process::Remote etc.
+#
+# The monitor process runs a simple event loop more or less just
+# waiting for a reason to zap the process it monitors. Thus the user
+# of this class does not need to care about process cleanup, it's
+# handled automatically.
+#
+# The monitor process wait for:
+# - the parent process to close the pipe, in that case it
+# will zap the "monitored process" and exit
+# - the "monitored process" to exit, in which case it will exit
+# itself with same exit code as the "monitored process"
+# - the parent process to send the "shutdown" signal in wich case
+# monitor will kill the "monitored process" hard and exit
+#
+#
+# When used it will look something like this:
+# $> ps
+# [script.pl]
+# - [monitor for `mysqld`]
+# - [mysqld]
+# - [monitor for `mysqld`]
+# - [mysqld]
+# - [monitor for `mysqld`]
+# - [mysqld]
+#
+#
+
+use strict;
+use Carp;
+use POSIX qw(WNOHANG);
+
+use My::SafeProcess::Base;
+use base 'My::SafeProcess::Base';
+
+use My::Find;
+use My::Platform;
+
+my %running;
+my $_verbose= 0;
+
+END {
+ # Kill any children still running
+ for my $proc (values %running){
+ if ( $proc->is_child($$) ){
+ #print "Killing: $proc\n";
+ if ($proc->wait_one(0)){
+ $proc->kill();
+ }
+ }
+ }
+}
+
+
+sub is_child {
+ my ($self, $parent_pid)= @_;
+ croak "usage: \$safe_proc->is_child()" unless (@_ == 2 and ref $self);
+ return ($self->{PARENT} == $parent_pid);
+}
+
+
+# Find the safe process binary or script
+my @safe_process_cmd;
+my $safe_kill;
+if (IS_WIN32PERL or IS_CYGWIN){
+ # Use my_safe_process.exe
+ my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
+ "my_safe_process");
+ push(@safe_process_cmd, $exe);
+
+ # Use my_safe_kill.exe
+ $safe_kill= my_find_bin(".", "lib/My/SafeProcess", "my_safe_kill");
+}
+else
+{
+ # Use my_safe_process
+ my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
+ "my_safe_process");
+ push(@safe_process_cmd, $exe);
+}
+
+
+sub new {
+ my $class= shift;
+
+ my %opts=
+ (
+ verbose => 0,
+ @_
+ );
+
+ my $path = delete($opts{'path'}) or croak "path required @_";
+ my $args = delete($opts{'args'}) or croak "args required @_";
+ my $input = delete($opts{'input'});
+ my $output = delete($opts{'output'});
+ my $error = delete($opts{'error'});
+ my $verbose = delete($opts{'verbose'});
+ my $host = delete($opts{'host'});
+ my $shutdown = delete($opts{'shutdown'});
+ my $user_data= delete($opts{'user_data'});
+
+# if (defined $host) {
+# $safe_script= "lib/My/SafeProcess/safe_process_cpcd.pl";
+# }
+
+ if (IS_CYGWIN){
+ $path= mixed_path($path);
+ $input= mixed_path($input);
+ $output= mixed_path($output);
+ $error= mixed_path($error);
+ }
+
+ my @safe_args;
+ my ($safe_path, $safe_script)= @safe_process_cmd;
+ push(@safe_args, $safe_script) if defined $safe_script;
+
+ push(@safe_args, "--verbose") if $verbose > 0;
+
+ # Point the safe_process at the right parent if running on cygwin
+ push(@safe_args, "--parent-pid=".Cygwin::pid_to_winpid($$)) if IS_CYGWIN;
+
+ push(@safe_args, "--");
+ push(@safe_args, $path); # The program safe_process should execute
+ push(@safe_args, @$$args);
+
+ print "### safe_path: ", $safe_path, " ", join(" ", @safe_args), "\n"
+ if $verbose > 1;
+
+ my $pid= create_process(
+ path => $safe_path,
+ input => $input,
+ output => $output,
+ error => $error,
+ append => $opts{append},
+ args => \@safe_args,
+ );
+
+ my $name = delete($opts{'name'}) || "SafeProcess$pid";
+ my $proc= bless
+ ({
+ SAFE_PID => $pid,
+ SAFE_WINPID => $pid, # Inidicates this is always a real process
+ SAFE_NAME => $name,
+ SAFE_SHUTDOWN => $shutdown,
+ PARENT => $$,
+ SAFE_USER_DATA => $user_data,
+ }, $class);
+
+ # Put the new process in list of running
+ $running{$pid}= $proc;
+ return $proc;
+
+}
+
+
+sub run {
+ my $proc= new(@_);
+ $proc->wait_one();
+ return $proc->exit_status();
+}
+
+#
+# Start a process that returns after "duration" seconds
+# or when it's parent process does not exist anymore
+#
+sub timer {
+ my $class= shift;
+ my $duration= shift or croak "duration required";
+ my $parent_pid= $$;
+
+ my $pid= My::SafeProcess::Base::_safe_fork();
+ if ($pid){
+ # Parent
+ my $proc= bless
+ ({
+ SAFE_PID => $pid,
+ SAFE_NAME => "timer",
+ PARENT => $$,
+ }, $class);
+
+ # Put the new process in list of running
+ $running{$pid}= $proc;
+ return $proc;
+ }
+
+ # Child, install signal handlers and sleep for "duration"
+ $SIG{INT}= 'IGNORE';
+
+ $SIG{TERM}= sub {
+ #print STDERR "timer $$: woken up, exiting!\n";
+ exit(0);
+ };
+
+ $0= "safe_timer($duration)";
+
+ if (IS_WIN32PERL){
+ # Just a thread in same process
+ sleep($duration);
+ print STDERR "timer $$: expired after $duration seconds\n";
+ exit(0);
+ }
+
+ my $count_down= $duration;
+ while($count_down--){
+
+ # Check that parent is still alive
+ if (kill(0, $parent_pid) == 0){
+ #print STDERR "timer $$: parent gone, exiting!\n";
+ exit(0);
+ }
+
+ sleep(1);
+ }
+ print STDERR "timer $$: expired after $duration seconds\n";
+ exit(0);
+}
+
+
+#
+# Shutdown process nicely, and wait for shutdown_timeout seconds
+# If processes hasn't shutdown, kill them hard and wait for return
+#
+sub shutdown {
+ my $shutdown_timeout= shift;
+ my @processes= @_;
+ _verbose("shutdown, timeout: $shutdown_timeout, @processes");
+
+ return if (@processes == 0);
+
+ # Call shutdown function if process has one, else
+ # use kill
+ foreach my $proc (@processes){
+ _verbose(" proc: $proc");
+ my $shutdown= $proc->{SAFE_SHUTDOWN};
+ if ($shutdown_timeout > 0 and defined $shutdown){
+ $shutdown->();
+ $proc->{WAS_SHUTDOWN}= 1;
+ }
+ else {
+ $proc->start_kill();
+ }
+ }
+
+ my @kill_processes= ();
+
+ # Wait max shutdown_timeout seconds for those process
+ # that has been shutdown
+ foreach my $proc (@processes){
+ next unless $proc->{WAS_SHUTDOWN};
+ my $ret= $proc->wait_one($shutdown_timeout);
+ if ($ret != 0) {
+ push(@kill_processes, $proc);
+ }
+ # Only wait for the first process with shutdown timeout
+ $shutdown_timeout= 0;
+ }
+
+ # Wait infinitely for those process
+ # that has been killed
+ foreach my $proc (@processes){
+ next if $proc->{WAS_SHUTDOWN};
+ my $ret= $proc->wait_one(undef);
+ if ($ret != 0) {
+ warn "Wait for killed process failed!";
+ push(@kill_processes, $proc);
+ # Try one more time, best option...
+ }
+ }
+
+ # Return if all servers has exited
+ return if (@kill_processes == 0);
+
+ foreach my $proc (@kill_processes){
+ $proc->start_kill();
+ }
+
+ foreach my $proc (@kill_processes){
+ $proc->wait_one(undef);
+ }
+
+ return;
+}
+
+
+sub _winpid ($) {
+ my ($pid)= @_;
+
+ # In win32 perl, the pid is already the winpid
+ return $pid unless IS_CYGWIN;
+
+ # In cygwin, the pid is the pseudo process ->
+ # get the real winpid of my_safe_process
+ return Cygwin::pid_to_winpid($pid);
+}
+
+
+#
+# Tell the process to die as fast as possible
+#
+sub start_kill {
+ my ($self)= @_;
+ croak "usage: \$safe_proc->start_kill()" unless (@_ == 1 and ref $self);
+ _verbose("start_kill: $self");
+ my $ret= 1;
+
+ my $pid= $self->{SAFE_PID};
+ die "INTERNAL ERROR: no pid" unless defined $pid;
+
+ if (IS_WINDOWS and defined $self->{SAFE_WINPID})
+ {
+ die "INTERNAL ERROR: no safe_kill" unless defined $safe_kill;
+
+ my $winpid= _winpid($pid);
+ $ret= system($safe_kill, $winpid) >> 8;
+
+ if ($ret == 3){
+ print "Couldn't open the winpid: $winpid ",
+ "for pid: $pid, try one more time\n";
+ sleep(1);
+ $winpid= _winpid($pid);
+ $ret= system($safe_kill, $winpid) >> 8;
+ print "Couldn't open the winpid: $winpid ",
+ "for pid: $pid, continue and see what happens...\n";
+ }
+ }
+ else
+ {
+ $pid= $self->{SAFE_PID};
+ die "Can't kill not started process" unless defined $pid;
+ $ret= kill("TERM", $pid);
+ }
+
+ return $ret;
+}
+
+
+sub dump_core {
+ my ($self)= @_;
+ return if IS_WINDOWS;
+ my $pid= $self->{SAFE_PID};
+ die "Can't cet core from not started process" unless defined $pid;
+ _verbose("Sending ABRT to $self");
+ kill ("ABRT", $pid);
+ return 1;
+}
+
+
+#
+# Kill the process as fast as possible
+# and wait for it to return
+#
+sub kill {
+ my ($self)= @_;
+ croak "usage: \$safe_proc->kill()" unless (@_ == 1 and ref $self);
+
+ $self->start_kill();
+ $self->wait_one();
+ return 1;
+}
+
+
+sub _collect {
+ my ($self)= @_;
+
+ $self->{EXIT_STATUS}= $?;
+ _verbose("_collect: $self");
+
+ # Take the process out of running list
+ my $pid= $self->{SAFE_PID};
+ die unless delete($running{$pid});
+}
+
+
+# Wait for process to exit
+# optionally with a timeout
+#
+# timeout
+# undef -> wait blocking infinitely
+# 0 -> just poll with WNOHANG
+# >0 -> wait blocking for max timeout seconds
+#
+# RETURN VALUES
+# 0 Not running
+# 1 Still running
+#
+sub wait_one {
+ my ($self, $timeout)= @_;
+ croak "usage: \$safe_proc->wait_one([timeout])" unless ref $self;
+
+ _verbose("wait_one $self, $timeout");
+
+ if ( ! defined($self->{SAFE_PID}) ) {
+ # No pid => not running
+ _verbose("No pid => not running");
+ return 0;
+ }
+
+ if ( defined $self->{EXIT_STATUS} ) {
+ # Exit status already set => not running
+ _verbose("Exit status already set => not running");
+ return 0;
+ }
+
+ my $pid= $self->{SAFE_PID};
+
+ my $use_alarm;
+ my $blocking;
+ if (defined $timeout)
+ {
+ if ($timeout == 0)
+ {
+ # 0 -> just poll with WNOHANG
+ $blocking= 0;
+ $use_alarm= 0;
+ }
+ else
+ {
+ # >0 -> wait blocking for max timeout seconds
+ $blocking= 1;
+ $use_alarm= 1;
+ }
+ }
+ else
+ {
+ # undef -> wait blocking infinitely
+ $blocking= 1;
+ $use_alarm= 0;
+ }
+ #_verbose("blocking: $blocking, use_alarm: $use_alarm");
+
+ my $retpid;
+ eval
+ {
+ # alarm should break the wait
+ local $SIG{ALRM}= sub { die "waitpid timeout"; };
+
+ alarm($timeout) if $use_alarm;
+
+ $retpid= waitpid($pid, $blocking ? 0 : &WNOHANG);
+
+ alarm(0) if $use_alarm;
+ };
+
+ if ($@)
+ {
+ die "Got unexpected: $@" if ($@ !~ /waitpid timeout/);
+ if (!defined $retpid) {
+ # Got timeout
+ _verbose("Got timeout");
+ return 1;
+ }
+ # Got pid _and_ alarm, continue
+ _verbose("Got pid and alarm, continue");
+ }
+
+ if ( $retpid == 0 ) {
+ # 0 => still running
+ _verbose("0 => still running");
+ return 1;
+ }
+
+ if ( not $blocking and $retpid == -1 ) {
+ # still running
+ _verbose("still running");
+ return 1;
+ }
+
+ #warn "wait_one: expected pid $pid but got $retpid"
+ # unless( $retpid == $pid );
+
+ $self->_collect();
+ return 0;
+}
+
+
+#
+# Wait for any process to exit
+#
+# Returns a reference to the SafeProcess that
+# exited or undefined
+#
+sub wait_any {
+ my $ret_pid;
+ if (IS_WIN32PERL) {
+ # Can't wait for -1 => use a polling loop
+ do {
+ Win32::Sleep(10); # 10 milli seconds
+ foreach my $pid (keys %running){
+ $ret_pid= waitpid($pid, &WNOHANG);
+ last if $pid == $ret_pid;
+ }
+ } while ($ret_pid == 0);
+ }
+ else
+ {
+ $ret_pid= waitpid(-1, 0);
+ if ($ret_pid <= 0){
+ # No more processes to wait for
+ print STDERR "wait_any, got invalid pid: $ret_pid\n";
+ return undef;
+ }
+ }
+
+ # Look it up in "running" table
+ my $proc= $running{$ret_pid};
+ unless (defined $proc){
+ print STDERR "Could not find pid: $ret_pid in running list\n";
+ print STDERR "running: ". join(", ", keys(%running)). "\n";
+ return undef;
+ }
+ $proc->_collect;
+ return $proc;
+}
+
+#
+# Overload string operator
+# and fallback to default functions if no
+# overloaded function is found
+#
+use overload
+ '""' => \&self2str,
+ fallback => 1;
+
+
+#
+# Return the process as a nicely formatted string
+#
+sub self2str {
+ my ($self)= @_;
+ my $pid= $self->{SAFE_PID};
+ my $winpid= $self->{SAFE_WINPID};
+ my $name= $self->{SAFE_NAME};
+ my $exit_status= $self->{EXIT_STATUS};
+
+ my $str= "[$name - pid: $pid";
+ $str.= ", winpid: $winpid" if defined $winpid;
+ $str.= ", exit: $exit_status" if defined $exit_status;
+ $str.= "]";
+}
+
+sub _verbose {
+ return unless $_verbose;
+ print STDERR " ## ", @_, "\n";
+}
+
+
+sub pid {
+ my ($self)= @_;
+ return $self->{SAFE_PID};
+}
+
+sub user_data {
+ my ($self)= @_;
+ return $self->{SAFE_USER_DATA};
+}
+
+
+1;
diff --git a/mysql-test/lib/My/SafeProcess/Base.pm b/mysql-test/lib/My/SafeProcess/Base.pm
new file mode 100644
index 00000000000..3fc1b1be017
--- /dev/null
+++ b/mysql-test/lib/My/SafeProcess/Base.pm
@@ -0,0 +1,212 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+use strict;
+
+package My::SafeProcess::Base;
+
+#
+# Utility functions for Process management
+#
+
+use Carp;
+use IO::Pipe;
+
+use base qw(Exporter);
+our @EXPORT= qw(create_process);
+
+
+
+#
+# safe_fork
+# Retry a couple of times if fork returns EAGAIN
+#
+sub _safe_fork {
+ my $retries= 5;
+ my $pid;
+
+ FORK:
+ {
+ $pid= fork;
+ if ( not defined($pid)) {
+
+ croak("fork failed after: $!") if (!$retries--);
+
+ warn("fork failed sleep 1 second and redo: $!");
+ sleep(1);
+ redo FORK;
+ }
+ }
+
+ return $pid;
+};
+
+
+#
+# Decode exit status
+#
+sub exit_status {
+ my $self= shift;
+ my $raw= $self->{EXIT_STATUS};
+
+ croak("Can't call exit_status before process has died")
+ unless defined $raw;
+
+ if ($raw & 127)
+ {
+ # Killed by signal
+ my $signal_num= $raw & 127;
+ my $dumped_core= $raw & 128;
+ return 1; # Return error code
+ }
+ else
+ {
+ # Normal process exit
+ return $raw >> 8;
+ };
+}
+
+
+#
+# Create a new process
+# Return pid of the new process
+#
+sub create_process {
+ my %opts=
+ (
+ @_
+ );
+
+ my $path = delete($opts{'path'}) or die "path required";
+ my $args = delete($opts{'args'}) or die "args required";
+ my $input = delete($opts{'input'});
+ my $output = delete($opts{'output'});
+ my $error = delete($opts{'error'});
+
+ my $open_mode= $opts{append} ? ">>" : ">";
+
+ if ($^O eq "MSWin32"){
+
+ #printf STDERR "stdin %d, stdout %d, stderr %d\n",
+ # fileno STDIN, fileno STDOUT, fileno STDERR;
+
+ # input output redirect
+ my ($oldin, $oldout, $olderr);
+ open $oldin, '<&', \*STDIN or die "Failed to save old stdin: $!";
+ open $oldout, '>&', \*STDOUT or die "Failed to save old stdout: $!";
+ open $olderr, '>&', \*STDERR or die "Failed to save old stderr: $!";
+
+ if ( $input ) {
+ if ( ! open(STDIN, "<", $input) ) {
+ croak("can't redirect STDIN to '$input': $!");
+ }
+ }
+
+ if ( $output ) {
+ if ( ! open(STDOUT, $open_mode, $output) ) {
+ croak("can't redirect STDOUT to '$output': $!");
+ }
+ }
+
+ if ( $error ) {
+ if ( $output eq $error ) {
+ if ( ! open(STDERR, ">&STDOUT") ) {
+ croak("can't dup STDOUT: $!");
+ }
+ }
+ elsif ( ! open(STDERR, $open_mode, $error) ) {
+ croak("can't redirect STDERR to '$error': $!");
+ }
+ }
+
+
+ # Magic use of 'system(1, @args)' to spawn a process
+ # and get a proper Win32 pid
+ unshift (@$args, $path);
+ my $pid= system(1, @$args);
+ if ( $pid == 0 ){
+ print $olderr "create_process failed: $^E\n";
+ die "create_process failed: $^E";
+ }
+
+ # Retore IO redirects
+ open STDERR, '>&', $olderr
+ or croak("unable to reestablish STDERR");
+ open STDOUT, '>&', $oldout
+ or croak("unable to reestablish STDOUT");
+ open STDIN, '<&', $oldin
+ or croak("unable to reestablish STDIN");
+ #printf STDERR "stdin %d, stdout %d, stderr %d\n",
+ # fileno STDIN, fileno STDOUT, fileno STDERR;
+ return $pid;
+
+ }
+
+ local $SIG{PIPE}= sub { print STDERR "Got signal $@\n"; };
+ my $pipe= IO::Pipe->new();
+ my $pid= _safe_fork();
+ if ($pid){
+ # Parent
+ $pipe->reader();
+ my $line= <$pipe>; # Wait for child to say it's ready
+ return $pid;
+ }
+
+ $SIG{INT}= 'DEFAULT';
+
+ # Make this process it's own process group to be able to kill
+ # it and any childs(that hasn't changed group themself)
+ setpgrp(0,0) if $opts{setpgrp};
+
+ if ( $output and !open(STDOUT, $open_mode, $output) ) {
+ croak("can't redirect STDOUT to '$output': $!");
+ }
+
+ if ( $error ) {
+ if ( defined $output and $output eq $error ) {
+ if ( ! open(STDERR, ">&STDOUT") ) {
+ croak("can't dup STDOUT: $!");
+ }
+ }
+ elsif ( ! open(STDERR, $open_mode, $error) ) {
+ croak("can't redirect STDERR to '$error': $!");
+ }
+ }
+
+ if ( $input ) {
+ if ( ! open(STDIN, "<", $input) ) {
+ croak("can't redirect STDIN to '$input': $!");
+ }
+ }
+
+ # Tell parent to continue
+ $pipe->writer();
+ print $pipe "ready\n";
+
+ if ( !exec($path, @$args) ){
+ croak("Failed to exec '$path': $!");
+ }
+
+ croak("Should never come here");
+
+}
+
+1;
+
diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
new file mode 100644
index 00000000000..97fab820f95
--- /dev/null
+++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ADD_EXECUTABLE(my_safe_process safe_process_win.cc)
+ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc)
diff --git a/mysql-test/lib/My/SafeProcess/Makefile.am b/mysql-test/lib/My/SafeProcess/Makefile.am
new file mode 100644
index 00000000000..623c0e9a87a
--- /dev/null
+++ b/mysql-test/lib/My/SafeProcess/Makefile.am
@@ -0,0 +1,28 @@
+# Copyright (C) 2000-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+safedir = $(prefix)/mysql-test/lib/My/SafeProcess
+#nobase_bin_PROGRAMS = ...
+safe_PROGRAMS = my_safe_process
+
+my_safe_process_SOURCES = safe_process.cc
+
+EXTRA_DIST = safe_kill_win.cc \
+ safe_process_win.cc \
+ CMakeLists.txt
+
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/mysql-test/lib/My/SafeProcess/safe_kill_win.cc b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
new file mode 100755
index 00000000000..c6256fd92e1
--- /dev/null
+++ b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
@@ -0,0 +1,85 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+/*
+ Utility program used to signal a safe_process it's time to shutdown
+
+ Usage:
+ safe_kill <pid>
+*/
+
+#include <windows.h>
+#include <stdio.h>
+#include <signal.h>
+
+int main(int argc, const char** argv )
+{
+ DWORD pid= -1;
+ HANDLE shutdown_event;
+ char safe_process_name[32]= {0};
+ int retry_open_event= 100;
+ /* Ignore any signals */
+ signal(SIGINT, SIG_IGN);
+ signal(SIGBREAK, SIG_IGN);
+ signal(SIGTERM, SIG_IGN);
+
+ if (argc != 2) {
+ fprintf(stderr, "safe_kill <pid>\n");
+ exit(2);
+ }
+ pid= atoi(argv[1]);
+
+ _snprintf(safe_process_name, sizeof(safe_process_name),
+ "safe_process[%d]", pid);
+
+ /* Open the event to signal */
+ while ((shutdown_event=
+ OpenEvent(EVENT_MODIFY_STATE, FALSE, safe_process_name)) == NULL)
+ {
+ /*
+ Check if the process is alive, otherwise there is really
+ no idea to retry the open of the event
+ */
+ HANDLE process;
+ if ((process= OpenProcess(SYNCHRONIZE, FALSE, pid)) == NULL)
+ {
+ fprintf(stderr, "Could not open event or process %d, error: %d\n",
+ pid, GetLastError());
+ exit(3);
+ }
+ CloseHandle(process);
+
+ if (retry_open_event--)
+ Sleep(100);
+ else
+ {
+ fprintf(stderr, "Failed to open shutdown_event '%s', error: %d\n",
+ safe_process_name, GetLastError());
+ exit(3);
+ }
+ }
+
+ if(SetEvent(shutdown_event) == 0)
+ {
+ fprintf(stderr, "Failed to signal shutdown_event '%s', error: %d\n",
+ safe_process_name, GetLastError());
+ CloseHandle(shutdown_event);
+ exit(4);
+ }
+ CloseHandle(shutdown_event);
+ exit(0);
+}
+
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
new file mode 100644
index 00000000000..7932f3fd2d6
--- /dev/null
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -0,0 +1,277 @@
+/* Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+/*
+ Utility program that encapsulates process creation, monitoring
+ and bulletproof process cleanup
+
+ Usage:
+ safe_process [options to safe_process] -- progname arg1 ... argn
+
+ To safeguard mysqld you would invoke safe_process with a few options
+ for safe_process itself followed by a double dash to indicate start
+ of the command line for the program you really want to start
+
+ $> safe_process --output=output.log -- mysqld --datadir=var/data1 ...
+
+ This would redirect output to output.log and then start mysqld,
+ once it has done that it will continue to monitor the child as well
+ as the parent.
+
+ The safe_process then checks the follwing things:
+ 1. Child exits, propagate the childs return code to the parent
+ by exiting with the same return code as the child.
+
+ 2. Parent dies, immediately kill the child and exit, thus the
+ parent does not need to properly cleanup any child, it is handled
+ automatically.
+
+ 3. Signal's recieced by the process will trigger same action as 2)
+
+*/
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <errno.h>
+
+int verbose= 0;
+int terminated= 0;
+pid_t child_pid= -1;
+char safe_process_name[32]= {0};
+
+
+static void message(const char* fmt, ...)
+{
+ if (!verbose)
+ return;
+ va_list args;
+ fprintf(stderr, "%s: ", safe_process_name);
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+ fflush(stderr);
+}
+
+
+static void die(const char* fmt, ...)
+{
+ va_list args;
+ fprintf(stderr, "%s: FATAL ERROR, ", safe_process_name);
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+ if (int last_err= errno)
+ fprintf(stderr, "error: %d, %s\n", last_err, strerror(last_err));
+ exit(1);
+}
+
+
+static void kill_child (void)
+{
+ int status= 0;
+
+ message("Killing child: %d", child_pid);
+ // Terminate whole process group
+ kill(-child_pid, SIGKILL);
+
+ pid_t ret_pid= waitpid(child_pid, &status, 0);
+ if (ret_pid == child_pid)
+ {
+ int exit_code= 1;
+ if (WIFEXITED(status))
+ {
+ // Process has exited, collect return status
+ exit_code= WEXITSTATUS(status);
+ message("Child exit: %d", exit_code);
+ // Exit with exit status of the child
+ exit(exit_code);
+ }
+
+ if (WIFSIGNALED(status))
+ message("Child killed by signal: %d", WTERMSIG(status));
+
+ exit(exit_code);
+ }
+ exit(1);
+}
+
+
+static void handle_abort (int sig)
+{
+ message("Got signal %d, child_pid: %d, sending ABRT", sig, child_pid);
+
+ if (child_pid > 0) {
+ kill (-child_pid, SIGABRT); // Don't wait for it to terminate
+ }
+}
+
+
+static void handle_signal (int sig)
+{
+ message("Got signal %d, child_pid: %d", sig, child_pid);
+ terminated= 1;
+
+ if (child_pid > 0)
+ kill_child();
+
+ // Ignore further signals
+ signal(SIGTERM, SIG_IGN);
+ signal(SIGINT, SIG_IGN);
+
+ // Continune execution, allow the child to be started and
+ // finally terminated by monitor loop
+}
+
+
+int main(int argc, char* const argv[] )
+{
+ char* const* child_argv= 0;
+ pid_t own_pid= getpid();
+ pid_t parent_pid= getppid();
+
+ /* Install signal handlers */
+ signal(SIGTERM, handle_signal);
+ signal(SIGINT, handle_signal);
+ signal(SIGCHLD, handle_signal);
+ signal(SIGABRT, handle_abort);
+
+ sprintf(safe_process_name, "safe_process[%d]", own_pid);
+
+ message("Started");
+
+ /* Parse arguments */
+ for (int i= 1; i < argc; i++) {
+ const char* arg= argv[i];
+ if (strcmp(arg, "--") == 0 && strlen(arg) == 2) {
+ /* Got the "--" delimiter */
+ if (i >= argc)
+ die("No real args -> nothing to do");
+ child_argv= &argv[i+1];
+ break;
+ } else {
+ if ( strcmp(arg, "--verbose") == 0 )
+ verbose++;
+ else if ( strncmp(arg, "--parent-pid", 10) == 0 )
+ {
+ /* Override parent_pid with a value provided by user */
+ const char* start;
+ if ((start= strstr(arg, "=")) == NULL)
+ die("Could not find start of option value in '%s'", arg);
+ start++; /* Step past = */
+ if ((parent_pid= atoi(start)) == 0)
+ die("Invalid value '%s' passed to --parent-id", start);
+ }
+ else
+ die("Unknown option: %s", arg);
+ }
+ }
+ if (!child_argv || *child_argv == 0)
+ die("nothing to do");
+
+ message("parent_pid: %d", parent_pid);
+ if (parent_pid == own_pid)
+ die("parent_pid is equal to own pid!");
+
+ char buf;
+ int pfd[2];
+ if (pipe(pfd) == -1)
+ die("Failed to create pipe");
+
+ /* Create the child process */
+ while((child_pid= fork()) == -1)
+ {
+ message("fork failed");
+ sleep(1);
+ }
+
+ if (child_pid == 0)
+ {
+ close(pfd[0]); // Close unused read end
+
+ // Use default signal handlers in child
+ signal(SIGTERM, SIG_DFL);
+ signal(SIGINT, SIG_DFL);
+ signal(SIGCHLD, SIG_DFL);
+
+ // Make this process it's own process group to be able to kill
+ // it and any childs(that hasn't changed group themself)
+ setpgid(0, 0);
+
+ // Signal that child is ready
+ buf= 37;
+ write(pfd[1], &buf, 1);
+ // Close write end
+ close(pfd[1]);
+
+ if (execvp(child_argv[0], child_argv) < 0)
+ die("Failed to exec child");
+ }
+
+ close(pfd[1]); // Close unused write end
+
+ // Wait for child to signal it's ready
+ read(pfd[0], &buf, 1);
+ if(buf != 37)
+ die("Didn't get 37 from pipe");
+ close(pfd[0]); // Close read end
+
+ /* Monitor loop */
+ message("Started child %d, terminated: %d", child_pid, terminated);
+
+ while(!terminated)
+ {
+ // Check if parent is still alive
+ if (kill(parent_pid, 0) != 0){
+ message("Parent is not alive anymore");
+ break;
+ }
+
+ // Check if child has exited, normally this will be
+ // detected immediately with SIGCHLD handler
+ int status= 0;
+ pid_t ret_pid= waitpid(child_pid, &status, WNOHANG);
+ if (ret_pid == child_pid)
+ {
+ int ret_code= 2;
+ if (WIFEXITED(status))
+ {
+ // Process has exited, collect return status
+ int ret_code= WEXITSTATUS(status);
+ message("Child exit: %d", ret_code);
+ // Exit with exit status of the child
+ exit(ret_code);
+ }
+
+ if (WIFSIGNALED(status))
+ message("Child killed by signal: %d", WTERMSIG(status));
+
+ exit(ret_code);
+ }
+ sleep(1);
+ }
+ kill_child();
+
+ exit(1);
+}
+
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.pl b/mysql-test/lib/My/SafeProcess/safe_process.pl
new file mode 100644
index 00000000000..e3114a749d3
--- /dev/null
+++ b/mysql-test/lib/My/SafeProcess/safe_process.pl
@@ -0,0 +1,151 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+
+use strict;
+use warnings;
+
+use lib 'lib';
+use My::SafeProcess::Base;
+use POSIX qw(WNOHANG);
+
+###########################################################################
+# Util functions
+###########################################################################
+
+#
+#Print message to stderr
+#
+my $verbose= 0;
+sub message {
+ if ($verbose > 0){
+ use Time::localtime;
+ my $tm= localtime();
+ my $timestamp= sprintf("%02d%02d%02d %2d:%02d:%02d",
+ $tm->year % 100, $tm->mon+1, $tm->mday,
+ $tm->hour, $tm->min, $tm->sec);
+ print STDERR $timestamp, " monitor[$$]: ", @_, "\n";
+ }
+}
+
+
+###########################################################################
+# Main program
+###########################################################################
+
+my $terminated= 0;
+
+# Protect against being killed in the middle
+# of child creation, just set the terminated flag
+# to make sure the child will be killed off
+# when program is ready to do that
+$SIG{TERM}= sub { message("!Got signal @_"); $terminated= 1; };
+$SIG{INT}= sub { message("!Got signal @_"); $terminated= 1; };
+
+my $parent_pid= getppid();
+
+my $found_double_dash= 0;
+while (my $arg= shift(@ARGV)){
+
+ if ($arg =~ /^--$/){
+ $found_double_dash= 1;
+ last;
+ }
+ elsif ($arg =~ /^--verbose$/){
+ $verbose= 1;
+ }
+ else {
+ die "Unknown option: $arg";
+ }
+}
+
+my $path= shift(@ARGV); # Executable
+
+die "usage:\n" .
+ " safe_process.pl [opts] -- <path> [<args> [...<args_n>]]"
+ unless defined $path || $found_double_dash;
+
+
+message("started");
+#message("path: '$path'");
+message("parent: $parent_pid");
+
+# Start process to monitor
+my $child_pid=
+ create_process(
+ path => $path,
+ args => \@ARGV,
+ setpgrp => 1,
+ );
+message("Started child $child_pid");
+
+eval {
+ sub handle_signal {
+ $terminated= 1;
+ message("Got signal @_");
+
+ # Ignore all signals
+ foreach my $name (keys %SIG){
+ $SIG{$name}= 'IGNORE';
+ }
+
+ die "signaled\n";
+ };
+ local $SIG{TERM}= \&handle_signal;
+ local $SIG{INT}= \&handle_signal;
+ local $SIG{CHLD}= sub {
+ message("Got signal @_");
+ kill(9, -$child_pid);
+ my $ret= waitpid($child_pid, 0);
+ if ($? & 127){
+ exit(65); # Killed by signal
+ }
+ exit($? >> 8);
+ };
+
+ # Monitoring loop
+ while(!$terminated) {
+
+ # Check if parent is still alive
+ if (kill(0, $parent_pid) < 1){
+ message("Parent is not alive anymore");
+ last;
+ }
+
+ # Wait for child to terminate but wakeup every
+ # second to also check that parent is still alive
+ my $ret_pid;
+ $ret_pid= waitpid($child_pid, &WNOHANG);
+ if ($ret_pid == $child_pid) {
+ # Process has exited, collect return status
+ my $ret_code= $? >> 8;
+ message("Child exit: $ret_code");
+ # Exit with exit status of the child
+ exit ($ret_code);
+ }
+ sleep(1);
+ }
+};
+if ( $@ ) {
+ # The monitoring loop should have been
+ # broken by handle_signal
+ warn "Unexpected: $@" unless ( $@ =~ /signaled/ );
+}
+
+# Use negative pid in order to kill the whole
+# process group
+#
+my $ret= kill(9, -$child_pid);
+message("Killed child: $child_pid, ret: $ret");
+if ($ret > 0) {
+ message("Killed child: $child_pid");
+ # Wait blocking for the child to return
+ my $ret_pid= waitpid($child_pid, 0);
+ if ($ret_pid != $child_pid){
+ message("unexpected pid $ret_pid returned from waitpid($child_pid)");
+ }
+}
+
+message("DONE!");
+exit (1);
+
+
diff --git a/mysql-test/lib/My/SafeProcess/safe_process_win.cc b/mysql-test/lib/My/SafeProcess/safe_process_win.cc
new file mode 100755
index 00000000000..640254875c9
--- /dev/null
+++ b/mysql-test/lib/My/SafeProcess/safe_process_win.cc
@@ -0,0 +1,323 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+/*
+ Utility program that encapsulates process creation, monitoring
+ and bulletproof process cleanup
+
+ Usage:
+ safe_process [options to safe_process] -- progname arg1 ... argn
+
+ To safeguard mysqld you would invoke safe_process with a few options
+ for safe_process itself followed by a double dash to indicate start
+ of the command line for the program you really want to start
+
+ $> safe_process --output=output.log -- mysqld --datadir=var/data1 ...
+
+ This would redirect output to output.log and then start mysqld,
+ once it has done that it will continue to monitor the child as well
+ as the parent.
+
+ The safe_process then checks the follwing things:
+ 1. Child exits, propagate the childs return code to the parent
+ by exiting with the same return code as the child.
+
+ 2. Parent dies, immediately kill the child and exit, thus the
+ parent does not need to properly cleanup any child, it is handled
+ automatically.
+
+ 3. Signal's recieced by the process will trigger same action as 2)
+
+ 4. The named event "safe_process[pid]" can be signaled and will
+ trigger same action as 2)
+
+ WARNING! Be careful when using ProcessExplorer, since it will open
+ a handle to each process(and maybe also the Job), the process
+ spawned by safe_process will not be closed off when safe_process
+ is killed.
+*/
+
+/* Requires Windows 2000 or higher */
+#define _WIN32_WINNT 0x0500
+
+#include <windows.h>
+#include <stdio.h>
+#include <tlhelp32.h>
+#include <signal.h>
+
+static int verbose= 0;
+static char safe_process_name[32]= {0};
+
+static void message(const char* fmt, ...)
+{
+ if (!verbose)
+ return;
+ va_list args;
+ fprintf(stderr, "%s: ", safe_process_name);
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+ fflush(stderr);
+}
+
+
+static void die(const char* fmt, ...)
+{
+ va_list args;
+ fprintf(stderr, "%s: FATAL ERROR, ", safe_process_name);
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+ if (int last_err= GetLastError())
+ fprintf(stderr, "error: %d, %s\n", last_err, strerror(last_err));
+ fflush(stderr);
+ exit(1);
+}
+
+
+DWORD get_parent_pid(DWORD pid)
+{
+ HANDLE snapshot;
+ DWORD parent_pid= -1;
+ PROCESSENTRY32 pe32;
+ pe32.dwSize= sizeof(PROCESSENTRY32);
+
+ snapshot= CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ if (snapshot == INVALID_HANDLE_VALUE)
+ die("CreateToolhelp32Snapshot failed");
+
+ if (!Process32First(snapshot, &pe32))
+ {
+ CloseHandle(snapshot);
+ die("Process32First failed");
+ }
+
+ do
+ {
+ if (pe32.th32ProcessID == pid)
+ parent_pid= pe32.th32ParentProcessID;
+ } while(Process32Next( snapshot, &pe32));
+ CloseHandle(snapshot);
+
+ if (parent_pid == -1)
+ die("Could not find parent pid");
+
+ return parent_pid;
+}
+
+
+enum {
+ PARENT,
+ CHILD,
+ EVENT,
+ NUM_HANDLES
+};
+
+
+HANDLE shutdown_event;
+void handle_signal (int signal)
+{
+ message("Got signal: %d", signal);
+ if(SetEvent(shutdown_event) == 0) {
+ /* exit safe_process and (hopefully) kill off the child */
+ die("Failed to SetEvent");
+ }
+}
+
+
+int main(int argc, const char** argv )
+{
+ char child_args[4096]= {0};
+ DWORD pid= GetCurrentProcessId();
+ DWORD parent_pid= get_parent_pid(pid);
+ HANDLE job_handle;
+ HANDLE wait_handles[NUM_HANDLES]= {0};
+ PROCESS_INFORMATION process_info= {0};
+
+ sprintf(safe_process_name, "safe_process[%d]", pid);
+
+ /* Create an event for the signal handler */
+ if ((shutdown_event=
+ CreateEvent(NULL, TRUE, FALSE, safe_process_name)) == NULL)
+ die("Failed to create shutdown_event");
+ wait_handles[EVENT]= shutdown_event;
+
+ signal(SIGINT, handle_signal);
+ signal(SIGBREAK, handle_signal);
+ signal(SIGTERM, handle_signal);
+
+ message("Started");
+
+ /* Parse arguments */
+ for (int i= 1; i < argc; i++) {
+ const char* arg= argv[i];
+ char* to= child_args;
+ if (strcmp(arg, "--") == 0 && strlen(arg) == 2) {
+ /* Got the "--" delimiter */
+ if (i >= argc)
+ die("No real args -> nothing to do");
+ /* Copy the remaining args to child_arg */
+ for (int j= i+1; j < argc; j++) {
+ to+= _snprintf(to, child_args + sizeof(child_args) - to, "%s ", argv[j]);
+ }
+ break;
+ } else {
+ if ( strcmp(arg, "--verbose") == 0 )
+ verbose++;
+ else if ( strncmp(arg, "--parent-pid", 10) == 0 )
+ {
+ /* Override parent_pid with a value provided by user */
+ const char* start;
+ if ((start= strstr(arg, "=")) == NULL)
+ die("Could not find start of option value in '%s'", arg);
+ start++; /* Step past = */
+ if ((parent_pid= atoi(start)) == 0)
+ die("Invalid value '%s' passed to --parent-id", start);
+ }
+ else
+ die("Unknown option: %s", arg);
+ }
+ }
+ if (*child_args == '\0')
+ die("nothing to do");
+
+ /* Open a handle to the parent process */
+ message("parent_pid: %d", parent_pid);
+ if (parent_pid == pid)
+ die("parent_pid is equal to own pid!");
+
+ if ((wait_handles[PARENT]=
+ OpenProcess(SYNCHRONIZE, FALSE, parent_pid)) == NULL)
+ die("Failed to open parent process with pid: %d", parent_pid);
+
+ /* Create the child process in a job */
+ JOBOBJECT_EXTENDED_LIMIT_INFORMATION jeli = { 0 };
+ STARTUPINFO si = { 0 };
+ si.cb = sizeof(si);
+
+ /*
+ Create the job object to make it possible to kill the process
+ and all of it's children in one go
+ */
+ if ((job_handle= CreateJobObject(NULL, NULL)) == NULL)
+ die("CreateJobObject failed");
+
+ /*
+ Make all processes associated with the job terminate when the
+ last handle to the job is closed.
+ */
+ jeli.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
+ if (SetInformationJobObject(job_handle, JobObjectExtendedLimitInformation,
+ &jeli, sizeof(jeli)) == 0)
+ message("SetInformationJobObject failed, continue anyway...");
+
+#if 0
+ /* Setup stdin, stdout and stderr redirect */
+ si.dwFlags= STARTF_USESTDHANDLES;
+ si.hStdInput= GetStdHandle(STD_INPUT_HANDLE);
+ si.hStdOutput= GetStdHandle(STD_OUTPUT_HANDLE);
+ si.hStdError= GetStdHandle(STD_ERROR_HANDLE);
+#endif
+
+ /*
+ Create the process suspended to make sure it's assigned to the
+ Job before it creates any process of it's own
+
+ Allow the new process to break away from any job that this
+ process is part of so that it can be assigned to the new JobObject
+ we just created. This is safe since the new JobObject is created with
+ the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag, making sure it will be
+ terminated when the last handle to it is closed(which is owned by
+ this process).
+ */
+ if (CreateProcess(NULL, (LPSTR)child_args,
+ NULL,
+ NULL,
+ TRUE, /* inherit handles */
+ CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB,
+ NULL,
+ NULL,
+ &si,
+ &process_info) == 0)
+ die("CreateProcess failed");
+
+ if (AssignProcessToJobObject(job_handle, process_info.hProcess) == 0)
+ {
+ TerminateProcess(process_info.hProcess, 200);
+ die("AssignProcessToJobObject failed");
+ }
+ ResumeThread(process_info.hThread);
+ CloseHandle(process_info.hThread);
+
+ wait_handles[CHILD]= process_info.hProcess;
+
+ message("Started child %d", process_info.dwProcessId);
+
+ /* Monitor loop */
+ DWORD child_exit_code= 1;
+ DWORD wait_res= WaitForMultipleObjects(NUM_HANDLES, wait_handles,
+ FALSE, INFINITE);
+ switch (wait_res)
+ {
+ case WAIT_OBJECT_0 + PARENT:
+ message("Parent exit");
+ break;
+ case WAIT_OBJECT_0 + CHILD:
+ if (GetExitCodeProcess(wait_handles[CHILD], &child_exit_code) == 0)
+ message("Child exit: could not get exit_code");
+ else
+ message("Child exit: exit_code: %d", child_exit_code);
+ break;
+ case WAIT_OBJECT_0 + EVENT:
+ message("Wake up from shutdown_event");
+ break;
+
+ default:
+ message("Unexpected result %d from WaitForMultipleObjects", wait_res);
+ break;
+ }
+ message("Exiting, child: %d", process_info.dwProcessId);
+
+ if (TerminateJobObject(job_handle, 201) == 0)
+ message("TerminateJobObject failed");
+ CloseHandle(job_handle);
+ message("Job terminated and closed");
+ if (wait_res != WAIT_OBJECT_0 + CHILD)
+ {
+ /* The child has not yet returned, wait for it */
+ message("waiting for child to exit");
+ if ((wait_res= WaitForSingleObject(wait_handles[CHILD], INFINITE))
+ != WAIT_OBJECT_0)
+ {
+ message("child wait failed: %d", wait_res);
+ }
+ else
+ {
+ message("child wait succeeded");
+ }
+ /* Child's exit code should now be 201, no need to get it */
+ }
+
+ message("Closing handles");
+ for (int i= 0; i < NUM_HANDLES; i++)
+ CloseHandle(wait_handles[i]);
+
+ message("Exiting, exit_code: %d", child_exit_code);
+ exit(child_exit_code);
+}
+
diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm
new file mode 100644
index 00000000000..f1ba5fb610f
--- /dev/null
+++ b/mysql-test/lib/My/SysInfo.pm
@@ -0,0 +1,211 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+package My::SysInfo;
+
+use strict;
+use Carp;
+use My::Platform;
+
+use constant DEFAULT_BOGO_MIPS => 2000;
+
+sub _cpuinfo {
+ my ($self)= @_;
+
+ my $info_file= "/proc/cpuinfo";
+ if ( !( -e $info_file and -f $info_file) ) {
+ return undef;
+ }
+
+ my $F= IO::File->new($info_file) or return undef;
+
+ # Set input separator to blank line
+ local $/ = '';
+
+ while ( my $cpu_chunk= <$F>) {
+ chomp($cpu_chunk);
+
+ my $cpuinfo = {};
+
+ foreach my $cpuline ( split(/\n/, $cpu_chunk) ) {
+ my ( $attribute, $value ) = split(/\s*:\s*/, $cpuline);
+
+ $attribute =~ s/\s+/_/;
+ $attribute = lc($attribute);
+
+ if ( $value =~ /^(no|not available|yes)$/ ) {
+ $value = $value eq 'yes' ? 1 : 0;
+ }
+
+ if ( $attribute eq 'flags' ) {
+ @{ $cpuinfo->{flags} } = split / /, $value;
+ } else {
+ $cpuinfo->{$attribute} = $value;
+ }
+ }
+
+ # Make sure bogomips is set to some value
+ $cpuinfo->{bogomips} |= DEFAULT_BOGO_MIPS;
+
+ # Cpus reported once, but with 'cpu_count' set to the actual number
+ my $cpu_count= $cpuinfo->{cpu_count} || 1;
+ for(1..$cpu_count){
+ push(@{$self->{cpus}}, $cpuinfo);
+ }
+ }
+ $F= undef; # Close file
+ return $self;
+}
+
+
+sub _kstat {
+ my ($self)= @_;
+ while (1){
+ my $instance_num= $self->{cpus} ? @{$self->{cpus}} : 0;
+ my $list= `kstat -p -m cpu_info -i $instance_num 2> /dev/null`;
+ my @lines= split('\n', $list) or last; # Break loop
+
+ my $cpuinfo= {};
+ foreach my $line (@lines)
+ {
+ my ($module, $instance, $name, $statistic, $value)=
+ $line=~ /(\w*):(\w*):(\w*):(\w*)\t(.*)/;
+
+ $cpuinfo->{$statistic}= $value;
+ }
+
+ # Default value, the actual cpu values can be used to decrease this
+ # on slower cpus
+ $cpuinfo->{bogomips}= DEFAULT_BOGO_MIPS;
+
+ push(@{$self->{cpus}}, $cpuinfo);
+ }
+
+ # At least one cpu should have been found
+ # if this method worked
+ if ( $self->{cpus} ) {
+ return $self;
+ }
+ return undef;
+}
+
+
+sub _unamex {
+ my ($self)= @_;
+ # TODO
+ return undef;
+}
+
+
+sub new {
+ my ($class)= @_;
+
+
+ my $self= bless {
+ cpus => (),
+ }, $class;
+
+ my @info_methods =
+ (
+ \&_cpuinfo,
+ \&_kstat,
+ \&_unamex,
+ );
+
+ # Detect virtual machines
+ my $isvm= 0;
+
+ if (IS_WINDOWS) {
+ # Detect vmware service
+ $isvm= `tasklist` =~ /vmwareservice/i;
+ }
+ $self->{isvm}= $isvm;
+
+ foreach my $method (@info_methods){
+ if ($method->($self)){
+ return $self;
+ }
+ }
+
+ # Push a dummy cpu
+ push(@{$self->{cpus}},
+ {
+ bogomips => DEFAULT_BOGO_MIPS,
+ model_name => "unknown",
+ });
+
+ return $self;
+}
+
+
+# Return the list of cpus found
+sub cpus {
+ my ($self)= @_;
+ return @{$self->{cpus}} or
+ confess "INTERNAL ERROR: No cpus in list";
+}
+
+
+# Return the number of cpus found
+sub num_cpus {
+ my ($self)= @_;
+ return int(@{$self->{cpus}}) or
+ confess "INTERNAL ERROR: No cpus in list";
+}
+
+
+# Return the smallest bogomips value amongst the processors
+sub min_bogomips {
+ my ($self)= @_;
+
+ my $bogomips;
+
+ foreach my $cpu (@{$self->{cpus}}) {
+ if (!defined $bogomips or $bogomips > $cpu->{bogomips}) {
+ $bogomips= $cpu->{bogomips};
+ }
+ }
+
+ return $bogomips;
+}
+
+sub isvm {
+ my ($self)= @_;
+
+ return $self->{isvm};
+}
+
+
+# Prit the cpuinfo
+sub print_info {
+ my ($self)= @_;
+
+ foreach my $cpu (@{$self->{cpus}}) {
+ while ((my ($key, $value)) = each(%$cpu)) {
+ print " ", $key, "= ";
+ if (ref $value eq "ARRAY") {
+ print "[", join(", ", @$value), "]";
+ } else {
+ print $value;
+ }
+ print "\n";
+ }
+ print "\n";
+ }
+}
+
+1;
diff --git a/mysql-test/lib/My/Test.pm b/mysql-test/lib/My/Test.pm
new file mode 100644
index 00000000000..68b100f91af
--- /dev/null
+++ b/mysql-test/lib/My/Test.pm
@@ -0,0 +1,123 @@
+# -*- cperl -*-
+
+
+#
+# One test
+#
+package My::Test;
+
+use strict;
+use warnings;
+use Carp;
+
+
+sub new {
+ my $class= shift;
+ my $self= bless {
+ @_,
+ }, $class;
+ return $self;
+}
+
+
+#
+# Return a unique key that can be used to
+# identify this test in a hash
+#
+sub key {
+ my ($self)= @_;
+ return $self->{key};
+}
+
+
+sub _encode {
+ my ($value)= @_;
+ $value =~ s/([|\\\x{0a}\x{0d}])/sprintf('\%02X', ord($1))/eg;
+ return $value;
+}
+
+sub _decode {
+ my ($value)= @_;
+ $value =~ s/\\([0-9a-fA-F]{2})/chr(hex($1))/ge;
+ return $value;
+}
+
+sub is_failed {
+ my ($self)= @_;
+ my $result= $self->{result};
+ croak "'is_failed' can't be called until test has been run!"
+ unless defined $result;
+
+ return ($result eq 'MTR_RES_FAILED');
+}
+
+
+sub write_test {
+ my ($test, $sock, $header)= @_;
+
+ # Give the test a unique key before serializing it
+ $test->{key}= "$test" unless defined $test->{key};
+
+ print $sock $header, "\n";
+ while ((my ($key, $value)) = each(%$test)) {
+ print $sock $key, "= ";
+ if (ref $value eq "ARRAY") {
+ print $sock "[", _encode(join(", ", @$value)), "]";
+ } else {
+ print $sock _encode($value);
+ }
+ print $sock "\n";
+ }
+ print $sock "\n";
+}
+
+
+sub read_test {
+ my ($sock)= @_;
+ my $test= My::Test->new();
+ # Read the : separated key value pairs until a
+ # single newline on it's own line
+ my $line;
+ while (defined($line= <$sock>)) {
+ # List is terminated by newline on it's own
+ if ($line eq "\n") {
+ # Correctly terminated reply
+ # print "Got newline\n";
+ last;
+ }
+ chomp($line);
+
+ # Split key/value on the first "="
+ my ($key, $value)= split("= ", $line, 2);
+
+ if ($value =~ /^\[(.*)\]/){
+ my @values= split(", ", _decode($1));
+ push(@{$test->{$key}}, @values);
+ }
+ else
+ {
+ $test->{$key}= _decode($value);
+ }
+ }
+ return $test;
+}
+
+
+sub print_test {
+ my ($self)= @_;
+
+ print "[", $self->{name}, "]", "\n";
+ while ((my ($key, $value)) = each(%$self)) {
+ print " ", $key, "= ";
+ if (ref $value eq "ARRAY") {
+ print "[", join(", ", @$value), "]";
+ } else {
+ print $value;
+ }
+ print "\n";
+ }
+ print "\n";
+}
+
+
+1;
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
new file mode 100644
index 00000000000..23a85ef7ecc
--- /dev/null
+++ b/mysql-test/lib/mtr_cases.pm
@@ -0,0 +1,1138 @@
+# -*- cperl -*-
+# Copyright (C) 2005-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+package mtr_cases;
+use strict;
+
+use base qw(Exporter);
+our @EXPORT= qw(collect_option collect_test_cases);
+
+use mtr_report;
+use mtr_match;
+
+# Options used for the collect phase
+our $start_from;
+our $print_testcases;
+our $skip_rpl;
+our $do_test;
+our $skip_test;
+our $opt_skip_combination;
+our $binlog_format;
+our $enable_disabled;
+our $default_storage_engine;
+our $opt_with_ndbcluster_only;
+our $defaults_file;
+our $defaults_extra_file;
+our $reorder= 1;
+
+sub collect_option {
+ my ($opt, $value)= @_;
+
+ # Evaluate $opt as string to use "Getopt::Long::Callback legacy API"
+ my $opt_name = "$opt";
+
+ # Convert - to _ in option name
+ $opt_name =~ s/-/_/g;
+ no strict 'refs';
+ ${$opt_name}= $value;
+}
+
+use File::Basename;
+use File::Spec::Functions qw / splitdir /;
+use IO::File();
+use My::Config;
+use My::Platform;
+use My::Test;
+use My::Find;
+
+require "mtr_misc.pl";
+
+# Precompiled regex's for tests to do or skip
+my $do_test_reg;
+my $skip_test_reg;
+
+sub init_pattern {
+ my ($from, $what)= @_;
+ return undef unless defined $from;
+ if ( $from =~ /^[a-z0-9\.]*$/ ) {
+ # Does not contain any regex (except . that we allow as
+ # separator betwen suite and testname), make the pattern match
+ # beginning of string
+ $from= "^$from";
+ mtr_verbose("$what='$from'");
+ }
+ # Check that pattern is a valid regex
+ eval { "" =~/$from/; 1 } or
+ mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@");
+ return $from;
+}
+
+
+##############################################################################
+#
+# Collect information about test cases to be run
+#
+##############################################################################
+
+sub collect_test_cases ($$) {
+ my $suites= shift; # Semicolon separated list of test suites
+ my $opt_cases= shift;
+ my $cases= []; # Array of hash(one hash for each testcase)
+
+ $do_test_reg= init_pattern($do_test, "--do-test");
+ $skip_test_reg= init_pattern($skip_test, "--skip-test");
+
+ foreach my $suite (split(",", $suites))
+ {
+ push(@$cases, collect_one_suite($suite, $opt_cases));
+ }
+
+ if ( @$opt_cases )
+ {
+ # A list of tests was specified on the command line
+ # Check that the tests specified was found
+ # in at least one suite
+ foreach my $test_name_spec ( @$opt_cases )
+ {
+ my $found= 0;
+ my ($sname, $tname, $extension)= split_testname($test_name_spec);
+ foreach my $test ( @$cases )
+ {
+ # test->{name} is always in suite.name format
+ if ( $test->{name} =~ /.*\.$tname/ )
+ {
+ $found= 1;
+ }
+ }
+ if ( not $found )
+ {
+ mtr_error("Could not find '$tname' in '$suites' suite(s)");
+ }
+ }
+ }
+
+ if ( $reorder )
+ {
+ # Reorder the test cases in an order that will make them faster to run
+ my %sort_criteria;
+
+ # Make a mapping of test name to a string that represents how that test
+ # should be sorted among the other tests. Put the most important criterion
+ # first, then a sub-criterion, then sub-sub-criterion, etc.
+ foreach my $tinfo (@$cases)
+ {
+ my @criteria = ();
+
+ #
+ # Append the criteria for sorting, in order of importance.
+ #
+ push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "A" : "B"));
+ # Group test with equal options together.
+ # Ending with "~" makes empty sort later than filled
+ my $opts= $tinfo->{'master_opt'} ? $tinfo->{'master_opt'} : [];
+ push(@criteria, join("!", sort @{$opts}) . "~");
+
+ $sort_criteria{$tinfo->{name}} = join(" ", @criteria);
+ }
+
+ @$cases = sort {
+ $sort_criteria{$a->{'name'}} . $a->{'name'} cmp
+ $sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
+
+ # For debugging the sort-order
+ # foreach my $tinfo (@$cases)
+ # {
+ # print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
+ # }
+
+ }
+
+ if (defined $print_testcases){
+ print_testcases(@$cases);
+ exit(1);
+ }
+
+ return $cases;
+
+}
+
+
+# Returns (suitename, testname, extension)
+sub split_testname {
+ my ($test_name)= @_;
+
+ # Get rid of directory part and split name on .'s
+ my @parts= split(/\./, basename($test_name));
+
+ if (@parts == 1){
+ # Only testname given, ex: alias
+ return (undef , $parts[0], undef);
+ } elsif (@parts == 2) {
+ # Either testname.test or suite.testname given
+ # Ex. main.alias or alias.test
+
+ if ($parts[1] eq "test")
+ {
+ return (undef , $parts[0], $parts[1]);
+ }
+ else
+ {
+ return ($parts[0], $parts[1], undef);
+ }
+
+ } elsif (@parts == 3) {
+ # Fully specified suitename.testname.test
+ # ex main.alias.test
+ return ( $parts[0], $parts[1], $parts[2]);
+ }
+
+ mtr_error("Illegal format of test name: $test_name");
+}
+
+
+sub collect_one_suite($)
+{
+ my $suite= shift; # Test suite name
+ my $opt_cases= shift;
+ my @cases; # Array of hash
+
+ mtr_verbose("Collecting: $suite");
+
+ my $suitedir= "$::glob_mysql_test_dir"; # Default
+ if ( $suite ne "main" )
+ {
+ # Allow suite to be path to "some dir" if $suite has at least
+ # one directory part
+ if ( -d $suite and splitdir($suite) > 1 ){
+ $suitedir= $suite;
+ mtr_report(" - from '$suitedir'");
+
+ }
+ else
+ {
+ $suitedir= my_find_dir($::basedir,
+ ["mysql-test/suite",
+ "mysql-test",
+ # Look in storage engine specific suite dirs
+ "storage/*/mysql-test-suites"
+ ],
+ [$suite]);
+ }
+ mtr_verbose("suitedir: $suitedir");
+ }
+
+ my $testdir= "$suitedir/t";
+ my $resdir= "$suitedir/r";
+
+ # Check if t/ exists
+ if (-d $testdir){
+ # t/ exists
+
+ if ( -d $resdir )
+ {
+ # r/exists
+ }
+ else
+ {
+ # No r/, use t/ as result dir
+ $resdir= $testdir;
+ }
+
+ }
+ else {
+ # No t/ dir => there can' be any r/ dir
+ mtr_error("Can't have r/ dir without t/") if -d $resdir;
+
+ # No t/ or r/ => use suitedir
+ $resdir= $testdir= $suitedir;
+ }
+
+ mtr_verbose("testdir: $testdir");
+ mtr_verbose("resdir: $resdir");
+
+ # ----------------------------------------------------------------------
+ # Build a hash of disabled testcases for this suite
+ # ----------------------------------------------------------------------
+ my %disabled;
+ if ( open(DISABLED, "$testdir/disabled.def" ) )
+ {
+ while ( <DISABLED> )
+ {
+ chomp;
+ if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
+ {
+ $disabled{$1}= $2;
+ }
+ }
+ close DISABLED;
+ }
+
+ # Read suite.opt file
+ my $suite_opt_file= "$testdir/suite.opt";
+ my $suite_opts= [];
+ if ( -f $suite_opt_file )
+ {
+ $suite_opts= opts_from_file($suite_opt_file);
+ }
+
+ if ( @$opt_cases )
+ {
+ # Collect in specified order
+ foreach my $test_name_spec ( @$opt_cases )
+ {
+ my ($sname, $tname, $extension)= split_testname($test_name_spec);
+
+ # The test name parts have now been defined
+ #print " suite_name: $sname\n";
+ #print " tname: $tname\n";
+ #print " extension: $extension\n";
+
+ # Check cirrect suite if suitename is defined
+ next if (defined $sname and $suite ne $sname);
+
+ if ( defined $extension )
+ {
+ my $full_name= "$testdir/$tname.$extension";
+ # Extension was specified, check if the test exists
+ if ( ! -f $full_name)
+ {
+ # This is only an error if suite was specified, otherwise it
+ # could exist in another suite
+ mtr_error("Test '$full_name' was not found in suite '$sname'")
+ if $sname;
+
+ next;
+ }
+ }
+ else
+ {
+ # No extension was specified, use default
+ $extension= "test";
+ my $full_name= "$testdir/$tname.$extension";
+
+ # Test not found here, could exist in other suite
+ next if ( ! -f $full_name );
+ }
+
+ push(@cases,
+ collect_one_test_case($suitedir,
+ $testdir,
+ $resdir,
+ $suite,
+ $tname,
+ "$tname.$extension",
+ \%disabled,
+ $suite_opts));
+ }
+ }
+ else
+ {
+ opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
+
+ foreach my $elem ( sort readdir(TESTDIR) )
+ {
+ my $tname= mtr_match_extension($elem, 'test');
+
+ next unless defined $tname;
+
+ # Skip tests that does not match the --do-test= filter
+ next if ($do_test_reg and not $tname =~ /$do_test_reg/o);
+
+ push(@cases,
+ collect_one_test_case($suitedir,
+ $testdir,
+ $resdir,
+ $suite,
+ $tname,
+ $elem,
+ \%disabled,
+ $suite_opts));
+ }
+ closedir TESTDIR;
+ }
+
+ # Return empty list if no testcases found
+ return if (@cases == 0);
+
+ # ----------------------------------------------------------------------
+ # Read combinations for this suite and build testcases x combinations
+ # if any combinations exists
+ # ----------------------------------------------------------------------
+ if ( ! $opt_skip_combination )
+ {
+ my @combinations;
+ my $combination_file= "$suitedir/combinations";
+ #print "combination_file: $combination_file\n";
+ if (@::opt_combinations)
+ {
+ # take the combination from command-line
+ mtr_verbose("Take the combination from command line");
+ foreach my $combination (@::opt_combinations) {
+ my $comb= {};
+ $comb->{name}= $combination;
+ push(@{$comb->{comb_opt}}, $combination);
+ push(@combinations, $comb);
+ }
+ }
+ elsif (-f $combination_file )
+ {
+ # Read combinations file in my.cnf format
+ mtr_verbose("Read combinations file");
+ my $config= My::Config->new($combination_file);
+ foreach my $group ($config->groups()) {
+ my $comb= {};
+ $comb->{name}= $group->name();
+ foreach my $option ( $group->options() ) {
+ push(@{$comb->{comb_opt}}, $option->option());
+ }
+ push(@combinations, $comb);
+ }
+ }
+
+ if (@combinations)
+ {
+ print " - adding combinations for $suite\n";
+ #print_testcases(@cases);
+
+ my @new_cases;
+ foreach my $comb (@combinations)
+ {
+ foreach my $test (@cases)
+ {
+
+ next if ( $test->{'skip'} );
+
+ # Skip this combination if the values it provides
+ # already are set in master_opt or slave_opt
+ if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
+ My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){
+ next;
+ }
+
+ # Copy test options
+ my $new_test= My::Test->new();
+ while (my ($key, $value) = each(%$test)) {
+ if (ref $value eq "ARRAY") {
+ push(@{$new_test->{$key}}, @$value);
+ } else {
+ $new_test->{$key}= $value;
+ }
+ }
+
+ # Append the combination options to master_opt and slave_opt
+ push(@{$new_test->{master_opt}}, @{$comb->{comb_opt}});
+ push(@{$new_test->{slave_opt}}, @{$comb->{comb_opt}});
+
+ # Add combination name short name
+ $new_test->{combination}= $comb->{name};
+
+ # Add the new test to new test cases list
+ push(@new_cases, $new_test);
+ }
+ }
+
+ # Add the plain test if it was not already added
+ # as part of a combination
+ my %added;
+ foreach my $new_test (@new_cases){
+ $added{$new_test->{name}}= 1;
+ }
+ foreach my $test (@cases){
+ push(@new_cases, $test) unless $added{$test->{name}};
+ }
+
+
+ #print_testcases(@new_cases);
+ @cases= @new_cases;
+ #print_testcases(@cases);
+ }
+ }
+ optimize_cases(\@cases);
+ #print_testcases(@cases);
+
+ return @cases;
+}
+
+
+
+#
+# Loop through all test cases
+# - optimize which test to run by skipping unnecessary ones
+# - update settings if necessary
+#
+sub optimize_cases {
+ my ($cases)= @_;
+
+ foreach my $tinfo ( @$cases )
+ {
+ # Skip processing if already marked as skipped
+ next if $tinfo->{skip};
+
+ # =======================================================
+ # If a special binlog format was selected with
+ # --mysqld=--binlog-format=x, skip all test that does not
+ # support it
+ # =======================================================
+ #print "binlog_format: $binlog_format\n";
+ if (defined $binlog_format )
+ {
+ # =======================================================
+ # Fixed --binlog-format=x specified on command line
+ # =======================================================
+ if ( defined $tinfo->{'binlog_formats'} )
+ {
+ #print "binlog_formats: ". join(", ", @{$tinfo->{binlog_formats}})."\n";
+
+ # The test supports different binlog formats
+ # check if the selected one is ok
+ my $supported=
+ grep { $_ eq $binlog_format } @{$tinfo->{'binlog_formats'}};
+ if ( !$supported )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}=
+ "Doesn't support --binlog-format='$binlog_format'";
+ }
+ }
+ }
+ else
+ {
+ # =======================================================
+ # Use dynamic switching of binlog format
+ # =======================================================
+
+ # Get binlog-format used by this test from master_opt
+ my $test_binlog_format;
+ foreach my $opt ( @{$tinfo->{master_opt}} ) {
+ $test_binlog_format=
+ mtr_match_prefix($opt, "--binlog-format=") || $test_binlog_format;
+ }
+
+ if (defined $test_binlog_format and
+ defined $tinfo->{binlog_formats} )
+ {
+ my $supported=
+ grep { $_ eq $test_binlog_format } @{$tinfo->{'binlog_formats'}};
+ if ( !$supported )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}=
+ "Doesn't support --binlog-format='$test_binlog_format'";
+ next;
+ }
+ }
+ }
+
+ # =======================================================
+ # Check that engine selected by
+ # --default-storage-engine=<engine> is supported
+ # =======================================================
+ my %builtin_engines = ('myisam' => 1, 'memory' => 1);
+
+ foreach my $opt ( @{$tinfo->{master_opt}} ) {
+ my $default_engine=
+ mtr_match_prefix($opt, "--default-storage-engine=");
+
+ if (defined $default_engine){
+
+ #print " $tinfo->{name}\n";
+ #print " - The test asked to use '$default_engine'\n";
+
+ #my $engine_value= $::mysqld_variables{$default_engine};
+ #print " - The mysqld_variables says '$engine_value'\n";
+
+ if ( ! exists $::mysqld_variables{$default_engine} and
+ ! exists $builtin_engines{$default_engine} )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}=
+ "'$default_engine' not supported";
+ }
+
+ $tinfo->{'ndb_test'}= 1
+ if ( $default_engine =~ /^ndb/i );
+ $tinfo->{'innodb_test'}= 1
+ if ( $default_engine =~ /^innodb/i );
+ }
+ }
+ }
+}
+
+
+#
+# Read options from the given opt file and append them as an array
+# to $tinfo->{$opt_name}
+#
+sub process_opts_file {
+ my ($tinfo, $opt_file, $opt_name)= @_;
+
+ if ( -f $opt_file )
+ {
+ my $opts= opts_from_file($opt_file);
+
+ foreach my $opt ( @$opts )
+ {
+ my $value;
+
+ # The opt file is used both to send special options to the mysqld
+ # as well as pass special test case specific options to this
+ # script
+
+ $value= mtr_match_prefix($opt, "--timezone=");
+ if ( defined $value )
+ {
+ $tinfo->{'timezone'}= $value;
+ next;
+ }
+
+ $value= mtr_match_prefix($opt, "--result-file=");
+ if ( defined $value )
+ {
+ # Specifies the file mysqltest should compare
+ # output against
+ $tinfo->{'result_file'}= "r/$value.result";
+ next;
+ }
+
+ $value= mtr_match_prefix($opt, "--config-file-template=");
+ if ( defined $value)
+ {
+ # Specifies the configuration file to use for this test
+ $tinfo->{'template_path'}= dirname($tinfo->{path})."/$value";
+ next;
+ }
+
+ # If we set default time zone, remove the one we have
+ $value= mtr_match_prefix($opt, "--default-time-zone=");
+ if ( defined $value )
+ {
+ # Set timezone for this test case to something different
+ $tinfo->{'timezone'}= "GMT-8";
+ # Fallthrough, add the --default-time-zone option
+ }
+
+ # The --restart option forces a restart even if no special
+ # option is set. If the options are the same as next testcase
+ # there is no need to restart after the testcase
+ # has completed
+ if ( $opt eq "--force-restart" )
+ {
+ $tinfo->{'force_restart'}= 1;
+ next;
+ }
+
+ # Ok, this was a real option, add it
+ push(@{$tinfo->{$opt_name}}, $opt);
+ }
+ }
+}
+
+##############################################################################
+#
+# Collect information about a single test case
+#
+##############################################################################
+
+sub collect_one_test_case {
+ my $suitedir= shift;
+ my $testdir= shift;
+ my $resdir= shift;
+ my $suitename= shift;
+ my $tname= shift;
+ my $filename= shift;
+ my $disabled= shift;
+ my $suite_opts= shift;
+
+ #print "collect_one_test_case\n";
+ #print " suitedir: $suitedir\n";
+ #print " testdir: $testdir\n";
+ #print " resdir: $resdir\n";
+ #print " suitename: $suitename\n";
+ #print " tname: $tname\n";
+ #print " filename: $filename\n";
+
+ # ----------------------------------------------------------------------
+ # Check --start-from
+ # ----------------------------------------------------------------------
+ if ( $start_from )
+ {
+ # start_from can be specified as [suite.].testname_prefix
+ my ($suite, $test, $ext)= split_testname($start_from);
+
+ if ( $suite and $suitename lt $suite){
+ return; # Skip silently
+ }
+ if ( $tname lt $test ){
+ return; # Skip silently
+ }
+ }
+
+ # ----------------------------------------------------------------------
+ # Set defaults
+ # ----------------------------------------------------------------------
+ my $tinfo= My::Test->new
+ (
+ name => "$suitename.$tname",
+ shortname => $tname,
+ path => "$testdir/$filename",
+
+ );
+
+ my $result_file= "$resdir/$tname.result";
+ if (-f $result_file) {
+ # Allow nonexistsing result file
+ # in that case .test must issue "exit" otherwise test
+ # should fail by default
+ $tinfo->{result_file}= $result_file;
+ }
+ else {
+ # No .result file exist
+ # Remember the path where it should be
+ # saved in case of --record
+ $tinfo->{record_file}= $result_file;
+ }
+
+ # ----------------------------------------------------------------------
+ # Skip some tests but include in list, just mark them as skipped
+ # ----------------------------------------------------------------------
+ if ( $skip_test_reg and $tname =~ /$skip_test_reg/o )
+ {
+ $tinfo->{'skip'}= 1;
+ return $tinfo;
+ }
+
+ # ----------------------------------------------------------------------
+ # Check for disabled tests
+ # ----------------------------------------------------------------------
+ my $marked_as_disabled= 0;
+ if ( $disabled->{$tname} )
+ {
+ # Test was marked as disabled in suites disabled.def file
+ $marked_as_disabled= 1;
+ $tinfo->{'comment'}= $disabled->{$tname};
+ }
+
+ my $disabled_file= "$testdir/$tname.disabled";
+ if ( -f $disabled_file )
+ {
+ $marked_as_disabled= 1;
+ $tinfo->{'comment'}= mtr_fromfile($disabled_file);
+ }
+
+ if ( $marked_as_disabled )
+ {
+ if ( $enable_disabled )
+ {
+ # User has selected to run all disabled tests
+ mtr_report(" - $tinfo->{name} wil be run although it's been disabled\n",
+ " due to '$tinfo->{comment}'");
+ }
+ else
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'disable'}= 1; # Sub type of 'skip'
+ return $tinfo;
+ }
+ }
+
+ # ----------------------------------------------------------------------
+ # Append suite extra options to both master and slave
+ # ----------------------------------------------------------------------
+ push(@{$tinfo->{'master_opt'}}, @$suite_opts);
+ push(@{$tinfo->{'slave_opt'}}, @$suite_opts);
+
+ #-----------------------------------------------------------------------
+ # Check for test specific config file
+ #-----------------------------------------------------------------------
+ my $test_cnf_file= "$testdir/$tname.cnf";
+ if ( -f $test_cnf_file) {
+ # Specifies the configuration file to use for this test
+ $tinfo->{'template_path'}= $test_cnf_file;
+ }
+
+ # ----------------------------------------------------------------------
+ # Check for test specific config file
+ # ----------------------------------------------------------------------
+ my $test_cnf_file= "$testdir/$tname.cnf";
+ if ( -f $test_cnf_file ) {
+ # Specifies the configuration file to use for this test
+ $tinfo->{'template_path'}= $test_cnf_file;
+ }
+
+ # ----------------------------------------------------------------------
+ # master sh
+ # ----------------------------------------------------------------------
+ my $master_sh= "$testdir/$tname-master.sh";
+ if ( -f $master_sh )
+ {
+ if ( IS_WIN32PERL )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "No tests with sh scripts on Windows";
+ return $tinfo;
+ }
+ else
+ {
+ $tinfo->{'master_sh'}= $master_sh;
+ }
+ }
+
+ # ----------------------------------------------------------------------
+ # slave sh
+ # ----------------------------------------------------------------------
+ my $slave_sh= "$testdir/$tname-slave.sh";
+ if ( -f $slave_sh )
+ {
+ if ( IS_WIN32PERL )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "No tests with sh scripts on Windows";
+ return $tinfo;
+ }
+ else
+ {
+ $tinfo->{'slave_sh'}= $slave_sh;
+ }
+ }
+
+ # ----------------------------------------------------------------------
+ # <tname>.slave-mi
+ # ----------------------------------------------------------------------
+ mtr_error("$tname: slave-mi not supported anymore")
+ if ( -f "$testdir/$tname.slave-mi");
+
+
+ tags_from_test_file($tinfo,"$testdir/${tname}.test");
+
+ if ( defined $default_storage_engine )
+ {
+ # Different default engine is used
+ # tag test to require that engine
+ $tinfo->{'ndb_test'}= 1
+ if ( $default_storage_engine =~ /^ndb/i );
+
+ $tinfo->{'innodb_test'}= 1
+ if ( $default_storage_engine =~ /^innodb/i );
+
+ }
+
+ if ( $tinfo->{'big_test'} and ! $::opt_big_test )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "Test need 'big-test' option";
+ return $tinfo
+ }
+
+ if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "Test need debug binaries";
+ return $tinfo
+ }
+
+ if ( $tinfo->{'ndb_test'} )
+ {
+ # This is a NDB test
+ if ( $::opt_skip_ndbcluster == 2 )
+ {
+ # Ndb is not supported, skip it
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "No ndbcluster support";
+ return $tinfo;
+ }
+ elsif ( $::opt_skip_ndbcluster )
+ {
+ # All ndb test's should be skipped
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)";
+ return $tinfo;
+ }
+ }
+ else
+ {
+ # This is not a ndb test
+ if ( $opt_with_ndbcluster_only )
+ {
+ # Only the ndb test should be run, all other should be skipped
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "Only ndbcluster tests";
+ return $tinfo;
+ }
+ }
+
+ if ($tinfo->{'federated_test'})
+ {
+ # This is a test that need federated, enable it
+ push(@{$tinfo->{'master_opt'}}, "--loose-federated");
+ push(@{$tinfo->{'slave_opt'}}, "--loose-federated");
+ }
+
+ if ( $tinfo->{'innodb_test'} )
+ {
+ # This is a test that need innodb
+ if ( $::mysqld_variables{'innodb'} ne "TRUE" )
+ {
+ # innodb is not supported, skip it
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "No innodb support";
+ return $tinfo;
+ }
+ }
+ else
+ {
+ push(@{$tinfo->{'master_opt'}}, "--loose-skip-innodb");
+ push(@{$tinfo->{'slave_opt'}}, "--loose-skip-innodb");
+ }
+
+ if ( $tinfo->{'need_binlog'} )
+ {
+ if (grep(/^--skip-log-bin/, @::opt_extra_mysqld_opt) )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "Test need binlog";
+ return $tinfo;
+ }
+ }
+ else
+ {
+ # Test does not need binlog, add --skip-binlog to
+ # the options used when starting
+ push(@{$tinfo->{'master_opt'}}, "--loose-skip-log-bin");
+ push(@{$tinfo->{'slave_opt'}}, "--loose-skip-log-bin");
+ }
+
+ if ( $tinfo->{'rpl_test'} )
+ {
+ if ( $skip_rpl )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "No replication tests(--skip-rpl)";
+ return $tinfo;
+ }
+ }
+
+ if ( $::opt_embedded_server )
+ {
+ if ( $tinfo->{'not_embedded'} )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "Not run for embedded server";
+ return $tinfo;
+ }
+ }
+
+ # ----------------------------------------------------------------------
+ # Find config file to use if not already selected in <testname>.opt file
+ # ----------------------------------------------------------------------
+ if (defined $defaults_file) {
+ # Using same config file for all tests
+ $tinfo->{template_path}= $defaults_file;
+ }
+ elsif (! $tinfo->{template_path} )
+ {
+ my $config= "$suitedir/my.cnf";
+ if (! -f $config )
+ {
+ # assume default.cnf will be used
+ $config= "include/default_my.cnf";
+
+ # Suite has no config, autodetect which one to use
+ if ( $tinfo->{rpl_test} ){
+ $config= "suite/rpl/my.cnf";
+ if ( $tinfo->{ndb_test} ){
+ $config= "suite/rpl_ndb/my.cnf";
+ }
+ }
+ elsif ( $tinfo->{ndb_test} ){
+ $config= "suite/ndb/my.cnf";
+ }
+ }
+ $tinfo->{template_path}= $config;
+ }
+
+ # Set extra config file to use
+ if (defined $defaults_extra_file) {
+ $tinfo->{extra_template_path}= $defaults_extra_file;
+ }
+
+ # ----------------------------------------------------------------------
+ # Append mysqld extra options to both master and slave
+ # ----------------------------------------------------------------------
+ push(@{$tinfo->{'master_opt'}}, @::opt_extra_mysqld_opt);
+ push(@{$tinfo->{'slave_opt'}}, @::opt_extra_mysqld_opt);
+
+ # ----------------------------------------------------------------------
+ # Add master opts, extra options only for master
+ # ----------------------------------------------------------------------
+ process_opts_file($tinfo, "$testdir/$tname-master.opt", 'master_opt');
+
+ # ----------------------------------------------------------------------
+ # Add slave opts, list of extra option only for slave
+ # ----------------------------------------------------------------------
+ process_opts_file($tinfo, "$testdir/$tname-slave.opt", 'slave_opt');
+
+ return $tinfo;
+}
+
+
+# List of tags in the .test files that if found should set
+# the specified value in "tinfo"
+my @tags=
+(
+ ["include/have_binlog_format_row.inc", "binlog_formats", ["row"]],
+ ["include/have_binlog_format_statement.inc", "binlog_formats", ["statement"]],
+ ["include/have_binlog_format_mixed.inc", "binlog_formats", ["mixed"]],
+ ["include/have_binlog_format_mixed_or_row.inc",
+ "binlog_formats", ["mixed", "row"]],
+ ["include/have_binlog_format_mixed_or_statement.inc",
+ "binlog_formats", ["mixed", "statement"]],
+ ["include/have_binlog_format_row_or_statement.inc",
+ "binlog_formats", ["row", "statement"]],
+
+ ["include/have_log_bin.inc", "need_binlog", 1],
+
+ ["include/have_innodb.inc", "innodb_test", 1],
+ ["include/big_test.inc", "big_test", 1],
+ ["include/have_debug.inc", "need_debug", 1],
+ ["include/have_ndb.inc", "ndb_test", 1],
+ ["include/have_multi_ndb.inc", "ndb_test", 1],
+ ["include/master-slave.inc", "rpl_test", 1],
+ ["include/ndb_master-slave.inc", "rpl_test", 1],
+ ["include/ndb_master-slave.inc", "ndb_test", 1],
+ ["federated.inc", "federated_test", 1],
+ ["include/not_embedded.inc", "not_embedded", 1],
+);
+
+
+sub tags_from_test_file {
+ my $tinfo= shift;
+ my $file= shift;
+ #mtr_verbose("$file");
+ my $F= IO::File->new($file) or mtr_error("can't open file \"$file\": $!");
+
+ while ( my $line= <$F> )
+ {
+
+ # Skip line if it start's with #
+ next if ( $line =~ /^#/ );
+
+ # Match this line against tag in "tags" array
+ foreach my $tag (@tags)
+ {
+ if ( index($line, $tag->[0]) >= 0 )
+ {
+ # Tag matched, assign value to "tinfo"
+ $tinfo->{"$tag->[1]"}= $tag->[2];
+ }
+ }
+
+ # If test sources another file, open it as well
+ if ( $line =~ /^\-\-([[:space:]]*)source(.*)$/ or
+ $line =~ /^([[:space:]]*)source(.*);$/ )
+ {
+ my $value= $2;
+ $value =~ s/^\s+//; # Remove leading space
+ $value =~ s/[[:space:]]+$//; # Remove ending space
+
+ # Sourced file may exist relative to test or
+ # in global location
+ foreach my $sourced_file (dirname($file). "/$value",
+ "$::glob_mysql_test_dir/$value")
+ {
+ if ( -f $sourced_file )
+ {
+ # Only source the file if it exists, we may get
+ # false positives in the regexes above if someone
+ # writes "source nnnn;" in a test case(such as mysqltest.test)
+ tags_from_test_file($tinfo, $sourced_file);
+ last;
+ }
+ }
+ }
+
+ }
+}
+
+sub unspace {
+ my $string= shift;
+ my $quote= shift;
+ $string =~ s/[ \t]/\x11/g;
+ return "$quote$string$quote";
+}
+
+
+sub opts_from_file ($) {
+ my $file= shift;
+
+ open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
+ my @args;
+ while ( <FILE> )
+ {
+ chomp;
+
+ # --set-variable=init_connect=set @a='a\\0c'
+ s/^\s+//; # Remove leading space
+ s/\s+$//; # Remove ending space
+
+ # This is strange, but we need to fill whitespace inside
+ # quotes with something, to remove later. We do this to
+ # be able to split on space. Else, we have trouble with
+ # options like
+ #
+ # --someopt="--insideopt1 --insideopt2"
+ #
+ # But still with this, we are not 100% sure it is right,
+ # we need a shell to do it right.
+
+ s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge;
+ s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge;
+ s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge;
+ s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge;
+
+ foreach my $arg (split(/[ \t]+/))
+ {
+ $arg =~ tr/\x11\x0a\x0b/ \'\"/; # Put back real chars
+ # The outermost quotes has to go
+ $arg =~ s/^([^\'\"]*)\'(.*)\'([^\'\"]*)$/$1$2$3/
+ or $arg =~ s/^([^\'\"]*)\"(.*)\"([^\'\"]*)$/$1$2$3/;
+ $arg =~ s/\\\\/\\/g;
+
+ # Do not pass empty string since my_getopt is not capable to handle it.
+ if (length($arg)) {
+ push(@args, $arg);
+ }
+ }
+ }
+ close FILE;
+ return \@args;
+}
+
+sub print_testcases {
+ my (@cases)= @_;
+
+ print "=" x 60, "\n";
+ foreach my $test (@cases){
+ $test->print_test();
+ }
+ print "=" x 60, "\n";
+}
+
+
+1;
diff --git a/mysql-test/lib/mtr_diff.pl b/mysql-test/lib/mtr_diff.pl
deleted file mode 100644
index 26e556de5e8..00000000000
--- a/mysql-test/lib/mtr_diff.pl
+++ /dev/null
@@ -1,297 +0,0 @@
-# -*- cperl -*-
-# Copyright (C) 2005 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# This is a library file used by the Perl version of mysql-test-run,
-# and is part of the translation of the Bourne shell script with the
-# same name.
-
-#use Data::Dumper;
-use strict;
-
-# $Data::Dumper::Indent= 1;
-
-sub mtr_diff($$);
-
-##############################################################################
-#
-# This is a simplified unified diff, with some special handling
-# of unsorted result sets
-#
-##############################################################################
-
-# FIXME replace die with mtr_error
-
-#require "mtr_report.pl";
-#mtr_diff("a.txt","b.txt");
-
-sub mtr_diff ($$) {
- my $file1 = shift;
- my $file2 = shift;
-
- # ----------------------------------------------------------------------
- # We read in all of the files at once
- # ----------------------------------------------------------------------
-
- unless ( open(FILE1, $file1) )
- {
- mtr_warning("can't open \"$file1\": $!");
- return;
- }
-
- unless ( open(FILE2, $file2) )
- {
- mtr_warning("can't open \"$file2\": $!");
- return;
- }
-
- my $lines1= collect_lines(<FILE1>);
- my $lines2= collect_lines(<FILE2>);
- close FILE1;
- close FILE2;
-
-# print Dumper($lines1);
-# print Dumper($lines2);
-
- # ----------------------------------------------------------------------
- # We compare line by line, but don't shift off elements until we know
- # what to do. This way we use the "restart" method, do simple change
- # and restart by entering the diff loop from the beginning again.
- # ----------------------------------------------------------------------
-
- my @context;
- my @info; # Collect information, and output later
- my $lno1= 1;
- my $lno2= 1;
-
- while ( @$lines1 or @$lines2 )
- {
- unless ( @$lines1 )
- {
- push(@info, map {['+',$lno1,$lno2++,$_]} @$lines2);
- last;
- }
- unless ( @$lines2 )
- {
- push(@info, map {['-',$lno1++,$lno2,$_]} @$lines1);
- last;
- }
-
- # ----------------------------------------------------------------------
- # We know both have lines
- # ----------------------------------------------------------------------
-
- if ( $lines1->[0] eq $lines2->[0] )
- {
- # Simple case, first line match and all is well
- push(@info, ['',$lno1++,$lno2++,$lines1->[0]]);
- shift @$lines1;
- shift @$lines2;
- next;
- }
-
- # ----------------------------------------------------------------------
- # Now, we know they differ
- # ----------------------------------------------------------------------
-
- # How far in the other one, is there a match?
-
- my $idx2= find_next_match($lines1->[0], $lines2);
- my $idx1= find_next_match($lines2->[0], $lines1);
-
- # Here we could test "if ( !defined $idx2 or !defined $idx1 )" and
- # use a more complicated diff algorithm in the case both contains
- # each others lines, just dislocated. But for this application, there
- # should be no need.
-
- if ( !defined $idx2 )
- {
- push(@info, ['-',$lno1++,$lno2,$lines1->[0]]);
- shift @$lines1;
- }
- else
- {
- push(@info, ['+',$lno1,$lno2++,$lines2->[0]]);
- shift @$lines2;
- }
- }
-
- # ----------------------------------------------------------------------
- # Try to output nicely
- # ----------------------------------------------------------------------
-
-# print Dumper(\@info);
-
- # We divide into "chunks" to output
- # We want at least three lines of context
-
- my @chunks;
- my @chunk;
- my $state= 'pre'; # 'pre', 'in' and 'post' difference
- my $post_count= 0;
-
- foreach my $info ( @info )
- {
- if ( $info->[0] eq '' and $state eq 'pre' )
- {
- # Collect no more than three lines of context before diff
- push(@chunk, $info);
- shift(@chunk) if @chunk > 3;
- next;
- }
-
- if ( $info->[0] =~ /(\+|\-)/ and $state =~ /(pre|in)/ )
- {
- # Start/continue collecting diff
- $state= 'in';
- push(@chunk, $info);
- next;
- }
-
- if ( $info->[0] eq '' and $state eq 'in' )
- {
- # Stop collecting diff, and collect context after diff
- $state= 'post';
- $post_count= 1;
- push(@chunk, $info);
- next;
- }
-
- if ( $info->[0] eq '' and $state eq 'post' and $post_count < 6 )
- {
- # We might find a new diff sequence soon, continue to collect
- # non diffs but five up on 6.
- $post_count++;
- push(@chunk, $info);
- next;
- }
-
- if ( $info->[0] eq '' and $state eq 'post' )
- {
- # We put an end to this, giving three non diff lines to
- # the old chunk, and three to the new one.
- my @left= splice(@chunk, -3, 3);
- push(@chunks, [@chunk]);
- $state= 'pre';
- $post_count= 0;
- @chunk= @left;
- next;
- }
-
- if ( $info->[0] =~ /(\+|\-)/ and $state eq 'post' )
- {
- # We didn't split, continue collect diff
- $state= 'in';
- push(@chunk, $info);
- next;
- }
-
- }
-
- if ( $post_count > 3 )
- {
- $post_count -= 3;
- splice(@chunk, -$post_count, $post_count);
- }
- push(@chunks, [@chunk]) if @chunk and $state ne 'pre';
-
- foreach my $chunk ( @chunks )
- {
- my $from_file_start= $chunk->[0]->[1];
- my $to_file_start= $chunk->[0]->[2];
- my $from_file_offset= $chunk->[$#$chunk]->[1] - $from_file_start;
- my $to_file_offset= $chunk->[$#$chunk]->[2] - $to_file_start;
- print "\@\@ -$from_file_start,$from_file_offset ",
- "+$to_file_start,$to_file_offset \@\@\n";
-
- foreach my $info ( @$chunk )
- {
- if ( $info->[0] eq '' )
- {
- print " $info->[3]\n";
- }
- elsif ( $info->[0] eq '-' )
- {
- print "- $info->[3]\n";
- }
- elsif ( $info->[0] eq '+' )
- {
- print "+ $info->[3]\n";
- }
- }
- }
-
-# print Dumper(\@chunks);
-
-}
-
-
-##############################################################################
-# Find if the string is found in the array, return the index if found,
-# if not found, return "undef"
-##############################################################################
-
-sub find_next_match {
- my $line= shift;
- my $lines= shift;
-
- for ( my $idx= 0; $idx < @$lines; $idx++ )
- {
- return $idx if $lines->[$idx] eq $line;
- }
-
- return undef; # No match found
-}
-
-
-##############################################################################
-# Just read the lines, but handle "sets" of lines that are unordered
-##############################################################################
-
-sub collect_lines {
-
- my @recordset;
- my @lines;
-
- while (@_)
- {
- my $line= shift @_;
- chomp($line);
-
- if ( $line =~ /^\Q%unordered%\E\t/ )
- {
- push(@recordset, $line);
- }
- elsif ( @recordset )
- {
- push(@lines, sort @recordset);
- @recordset= (); # Clear it
- }
- else
- {
- push(@lines, $line);
- }
- }
-
- if ( @recordset )
- {
- push(@lines, sort @recordset);
- @recordset= (); # Clear it
- }
-
- return \@lines;
-}
-
-1;
diff --git a/mysql-test/lib/mtr_gcov.pl b/mysql-test/lib/mtr_gcov.pl
index a2de1fcbdff..5049fdd6063 100644
--- a/mysql-test/lib/mtr_gcov.pl
+++ b/mysql-test/lib/mtr_gcov.pl
@@ -20,25 +20,14 @@
use strict;
-# These are not to be prefixed with "mtr_"
+sub gcov_prepare ($) {
+ my ($dir)= @_;
-sub gcov_prepare ();
-sub gcov_collect ();
-
-##############################################################################
-#
-#
-#
-##############################################################################
-
-sub gcov_prepare () {
-
- `find $::glob_basedir -name \*.gcov \
+ `find $dir -name \*.gcov \
-or -name \*.da | xargs rm`;
}
-# Used by gcov
-our @mysqld_src_dirs=
+my @mysqld_src_dirs=
(
"strings",
"mysys",
@@ -53,21 +42,24 @@ our @mysqld_src_dirs=
"sql",
);
-sub gcov_collect () {
+sub gcov_collect ($$$) {
+ my ($dir, $gcov, $gcov_msg, $gcov_err)= @_;
+
+ my $start_dir= cwd();
print "Collecting source coverage info...\n";
- -f $::opt_gcov_msg and unlink($::opt_gcov_msg);
- -f $::opt_gcov_err and unlink($::opt_gcov_err);
+ -f $gcov_msg and unlink($gcov_msg);
+ -f $gcov_err and unlink($gcov_err);
foreach my $d ( @mysqld_src_dirs )
{
- chdir("$::glob_basedir/$d");
+ chdir("$dir/$d");
foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) )
{
- `$::opt_gcov $f 2>>$::opt_gcov_err >>$::opt_gcov_msg`;
+ `$gcov $f 2>>$gcov_err >>$gcov_msg`;
}
- chdir($::glob_mysql_test_dir);
+ chdir($start_dir);
}
- print "gcov info in $::opt_gcov_msg, errors in $::opt_gcov_err\n";
+ print "gcov info in $gcov_msg, errors in $gcov_err\n";
}
diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl
index aa671c0f4f7..21581798ddc 100644
--- a/mysql-test/lib/mtr_io.pl
+++ b/mysql-test/lib/mtr_io.pl
@@ -19,135 +19,15 @@
# same name.
use strict;
+use Carp;
-sub mtr_get_pid_from_file ($);
-sub mtr_get_opts_from_file ($);
sub mtr_fromfile ($);
sub mtr_tofile ($@);
sub mtr_tonewfile($@);
-sub mtr_lastlinefromfile($);
sub mtr_appendfile_to_file ($$);
sub mtr_grab_file($);
-
-
-##############################################################################
-#
-#
-#
-##############################################################################
-
-sub mtr_get_pid_from_file ($) {
- my $pid_file_path= shift;
- my $TOTAL_ATTEMPTS= 30;
- my $timeout= 1;
-
- # We should read from the file until we get correct pid. As it is
- # stated in BUG#21884, pid file can be empty at some moment. So, we should
- # read it until we get valid data.
-
- for (my $cur_attempt= 1; $cur_attempt <= $TOTAL_ATTEMPTS; ++$cur_attempt)
- {
- mtr_debug("Reading pid file '$pid_file_path' " .
- "($cur_attempt of $TOTAL_ATTEMPTS)...");
-
- open(FILE, '<', $pid_file_path)
- or mtr_error("can't open file \"$pid_file_path\": $!");
-
- # Read pid number from file
- my $pid= <FILE>;
- chomp $pid;
- close FILE;
-
- return $pid if $pid=~ /^(\d+)/;
-
- mtr_debug("Pid file '$pid_file_path' does not yet contain pid number.\n" .
- "Sleeping $timeout second(s) more...");
-
- sleep($timeout);
- }
-
- mtr_error("Pid file '$pid_file_path' is corrupted. " .
- "Can not retrieve PID in " .
- ($timeout * $TOTAL_ATTEMPTS) . " seconds.");
-}
-
-sub mtr_get_opts_from_file ($) {
- my $file= shift;
-
- open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
- my @args;
- while ( <FILE> )
- {
- chomp;
-
- # --set-variable=init_connect=set @a='a\\0c'
- s/^\s+//; # Remove leading space
- s/\s+$//; # Remove ending space
-
- # This is strange, but we need to fill whitespace inside
- # quotes with something, to remove later. We do this to
- # be able to split on space. Else, we have trouble with
- # options like
- #
- # --someopt="--insideopt1 --insideopt2"
- #
- # But still with this, we are not 100% sure it is right,
- # we need a shell to do it right.
-
-# print STDERR "\n";
-# print STDERR "AAA: $_\n";
-
- s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge;
- s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge;
- s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge;
- s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge;
-
-# print STDERR "BBB: $_\n";
-
-# foreach my $arg (/(--?\w.*?)(?=\s+--?\w|$)/)
-
- # FIXME ENV vars should be expanded!!!!
-
- foreach my $arg (split(/[ \t]+/))
- {
- $arg =~ tr/\x11\x0a\x0b/ \'\"/; # Put back real chars
- # The outermost quotes has to go
- $arg =~ s/^([^\'\"]*)\'(.*)\'([^\'\"]*)$/$1$2$3/
- or $arg =~ s/^([^\'\"]*)\"(.*)\"([^\'\"]*)$/$1$2$3/;
- $arg =~ s/\\\\/\\/g;
-
- $arg =~ s/\$\{(\w+)\}/envsubst($1)/ge;
- $arg =~ s/\$(\w+)/envsubst($1)/ge;
-
-# print STDERR "ARG: $arg\n";
- # Do not pass empty string since my_getopt is not capable to handle it.
- if (length($arg))
- {
- push(@args, $arg)
- }
- }
- }
- close FILE;
- return \@args;
-}
-
-sub envsubst {
- my $string= shift;
-
- if ( ! defined $ENV{$string} )
- {
- mtr_error("opt file referense \$$string that is unknown");
- }
-
- return $ENV{$string};
-}
-
-sub unspace {
- my $string= shift;
- my $quote= shift;
- $string =~ s/[ \t]/\x11/g;
- return "$quote$string$quote";
-}
+sub mtr_printfile($);
+sub mtr_lastlinesfromfile ($$);
# Read a whole file, stripping leading and trailing whitespace.
sub mtr_fromfile ($) {
@@ -161,19 +41,6 @@ sub mtr_fromfile ($) {
return $text;
}
-sub mtr_lastlinefromfile ($) {
- my $file= shift;
- my $text;
-
- open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
- while (my $line= <FILE>)
- {
- $text= $line;
- }
- close FILE;
- return $text;
-}
-
sub mtr_tofile ($@) {
my $file= shift;
@@ -183,6 +50,7 @@ sub mtr_tofile ($@) {
close FILE;
}
+
sub mtr_tonewfile ($@) {
my $file= shift;
@@ -191,6 +59,7 @@ sub mtr_tonewfile ($@) {
close FILE;
}
+
sub mtr_appendfile_to_file ($$) {
my $from_file= shift;
my $to_file= shift;
@@ -203,6 +72,7 @@ sub mtr_appendfile_to_file ($$) {
close TOFILE;
}
+
# Read a whole file verbatim.
sub mtr_grab_file($) {
my $file= shift;
@@ -215,4 +85,26 @@ sub mtr_grab_file($) {
}
+# Print the file to STDOUT
+sub mtr_printfile($) {
+ my $file= shift;
+ open(FILE, '<', $file)
+ or warn $!;
+ print while(<FILE>);
+ close FILE;
+ return;
+}
+
+sub mtr_lastlinesfromfile ($$) {
+ croak "usage: mtr_lastlinesfromfile(file,numlines)" unless (@_ == 2);
+ my ($file, $num_lines)= @_;
+ my $text;
+ open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
+ my @lines= reverse <FILE>;
+ close FILE;
+ my $size= scalar(@lines);
+ $num_lines= $size unless ($size >= $num_lines);
+ return join("", reverse(splice(@lines, 0, $num_lines)));
+}
+
1;
diff --git a/mysql-test/lib/mtr_match.pm b/mysql-test/lib/mtr_match.pm
new file mode 100644
index 00000000000..40afd4e0336
--- /dev/null
+++ b/mysql-test/lib/mtr_match.pm
@@ -0,0 +1,97 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+package mtr_match;
+use strict;
+
+use base qw(Exporter);
+our @EXPORT= qw(mtr_match_prefix
+ mtr_match_extension
+ mtr_match_substring);
+
+#
+# Match a prefix and return what is after the prefix
+#
+sub mtr_match_prefix ($$) {
+ my $string= shift;
+ my $prefix= shift;
+
+ if ( $string =~ /^\Q$prefix\E(.*)$/ ) # strncmp
+ {
+ return $1;
+ }
+ else
+ {
+ return undef; # NULL
+ }
+}
+
+
+#
+# Match extension and return the name without extension
+#
+sub mtr_match_extension ($$) {
+ my $file= shift;
+ my $ext= shift;
+
+ if ( $file =~ /^(.*)\.\Q$ext\E$/ ) # strchr+strcmp or something
+ {
+ return $1;
+ }
+ else
+ {
+ return undef; # NULL
+ }
+}
+
+
+#
+# Match a substring anywere in a string
+#
+sub mtr_match_substring ($$) {
+ my $string= shift;
+ my $substring= shift;
+
+ if ( $string =~ /(.*)\Q$substring\E(.*)$/ ) # strncmp
+ {
+ return $1;
+ }
+ else
+ {
+ return undef; # NULL
+ }
+}
+
+
+sub mtr_match_any_exact ($$) {
+ my $string= shift;
+ my $mlist= shift;
+
+ foreach my $m (@$mlist)
+ {
+ if ( $string eq $m )
+ {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+1;
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl
index 0173e8b8572..658eb270535 100644
--- a/mysql-test/lib/mtr_misc.pl
+++ b/mysql-test/lib/mtr_misc.pl
@@ -19,45 +19,25 @@
# same name.
use strict;
-use File::Find;
-sub mtr_native_path($);
+use My::Platform;
+
sub mtr_init_args ($);
sub mtr_add_arg ($$@);
+sub mtr_args2str($@);
sub mtr_path_exists(@);
sub mtr_script_exists(@);
sub mtr_file_exists(@);
sub mtr_exe_exists(@);
sub mtr_exe_maybe_exists(@);
-sub mtr_copy_dir($$);
-sub mtr_rmtree($);
-sub mtr_same_opts($$);
-sub mtr_cmp_opts($$);
+
##############################################################################
#
-# Misc
+# Args
#
##############################################################################
-# Convert path to OS native format
-sub mtr_native_path($)
-{
- my $path= shift;
-
- # MySQL version before 5.0 still use cygwin, no need
- # to convert path
- return $path
- if ($::mysql_version_id < 50000);
-
- $path=~ s/\//\\/g
- if ($::glob_win32);
- return $path;
-}
-
-
-# FIXME move to own lib
-
sub mtr_init_args ($) {
my $args = shift;
$$args = []; # Empty list
@@ -68,9 +48,18 @@ sub mtr_add_arg ($$@) {
my $format= shift;
my @fargs = @_;
+ # Quote args if args contain space
+ $format= "\"$format\""
+ if (IS_WINDOWS and grep(/\s/, @fargs));
+
push(@$args, sprintf($format, @fargs));
}
+sub mtr_args2str($@) {
+ my $exe= shift or die;
+ return join(" ", native_path($exe), @_);
+}
+
##############################################################################
#
@@ -100,7 +89,7 @@ sub mtr_path_exists (@) {
sub mtr_script_exists (@) {
foreach my $path ( @_ )
{
- if($::glob_win32)
+ if(IS_WINDOWS)
{
return $path if -f $path;
}
@@ -140,11 +129,10 @@ sub mtr_file_exists (@) {
sub mtr_exe_maybe_exists (@) {
my @path= @_;
- map {$_.= ".exe"} @path if $::glob_win32;
- map {$_.= ".nlm"} @path if $::glob_netware;
+ map {$_.= ".exe"} @path if IS_WINDOWS;
foreach my $path ( @path )
{
- if($::glob_win32)
+ if(IS_WINDOWS)
{
return $path if -f $path;
}
@@ -179,134 +167,11 @@ sub mtr_exe_exists (@) {
}
-sub mtr_copy_dir($$) {
- my $from_dir= shift;
- my $to_dir= shift;
-
- # mtr_verbose("Copying from $from_dir to $to_dir");
-
- mkpath("$to_dir");
- opendir(DIR, "$from_dir")
- or mtr_error("Can't find $from_dir$!");
- for(readdir(DIR)) {
- next if "$_" eq "." or "$_" eq "..";
- if ( -d "$from_dir/$_" )
- {
- mtr_copy_dir("$from_dir/$_", "$to_dir/$_");
- next;
- }
- copy("$from_dir/$_", "$to_dir/$_");
- }
- closedir(DIR);
-
-}
-
-
-sub mtr_rmtree($) {
- my ($dir)= @_;
- mtr_verbose("mtr_rmtree: $dir");
-
- # Try to use File::Path::rmtree. Recent versions
- # handles removal of directories and files that don't
- # have full permissions, while older versions
- # may have a problem with that and we use our own version
-
- eval { rmtree($dir); };
- if ( $@ ) {
- mtr_warning("rmtree($dir) failed, trying with File::Find...");
-
- my $errors= 0;
-
- # chmod
- find( {
- no_chdir => 1,
- wanted => sub {
- chmod(0777, $_)
- or mtr_warning("couldn't chmod(0777, $_): $!") and $errors++;
- }
- },
- $dir
- );
-
- # rm
- finddepth( {
- no_chdir => 1,
- wanted => sub {
- my $file= $_;
- # Use special underscore (_) filehandle, caches stat info
- if (!-l $file and -d _ ) {
- rmdir($file) or
- mtr_warning("couldn't rmdir($file): $!") and $errors++;
- } else {
- unlink($file)
- or mtr_warning("couldn't unlink($file): $!") and $errors++;
- }
- }
- },
- $dir
- );
+sub mtr_milli_sleep {
+ die "usage: mtr_milli_sleep(milliseconds)" unless @_ == 1;
+ my ($millis)= @_;
- mtr_error("Failed to remove '$dir'") if $errors;
-
- mtr_report("OK, that worked!");
- }
-}
-
-
-sub mtr_same_opts ($$) {
- my $l1= shift;
- my $l2= shift;
- return mtr_cmp_opts($l1,$l2) == 0;
-}
-
-sub mtr_cmp_opts ($$) {
- my $l1= shift;
- my $l2= shift;
-
- my @l1= @$l1;
- my @l2= @$l2;
-
- return -1 if @l1 < @l2;
- return 1 if @l1 > @l2;
-
- while ( @l1 ) # Same length
- {
- my $e1= shift @l1;
- my $e2= shift @l2;
- my $cmp= ($e1 cmp $e2);
- return $cmp if $cmp != 0;
- }
-
- return 0; # They are the same
-}
-
-#
-# Compare two arrays and put all unequal elements into a new one
-#
-sub mtr_diff_opts ($$) {
- my $l1= shift;
- my $l2= shift;
- my $f;
- my $l= [];
- foreach my $e1 (@$l1)
- {
- $f= undef;
- foreach my $e2 (@$l2)
- {
- $f= 1 unless ($e1 ne $e2);
- }
- push(@$l, $e1) unless (defined $f);
- }
- foreach my $e2 (@$l2)
- {
- $f= undef;
- foreach my $e1 (@$l1)
- {
- $f= 1 unless ($e1 ne $e2);
- }
- push(@$l, $e2) unless (defined $f);
- }
- return $l;
+ select(undef, undef, undef, ($millis/1000));
}
1;
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 8fd900330da..a99119a199d 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -18,985 +18,13 @@
# and is part of the translation of the Bourne shell script with the
# same name.
+use strict;
use Socket;
use Errno;
-use strict;
-
-use POSIX qw(WNOHANG SIGHUP);
-sub mtr_run ($$$$$$;$);
-sub mtr_spawn ($$$$$$;$);
-sub mtr_check_stop_servers ($);
-sub mtr_kill_leftovers ();
-sub mtr_wait_blocking ($);
-sub mtr_record_dead_children ();
-sub mtr_ndbmgm_start($$);
-sub mtr_mysqladmin_start($$$);
-sub mtr_exit ($);
sub sleep_until_file_created ($$$);
-sub mtr_kill_processes ($);
-sub mtr_ping_with_timeout($);
sub mtr_ping_port ($);
-# Local function
-sub spawn_impl ($$$$$$$);
-
-##############################################################################
-#
-# Execute an external command
-#
-##############################################################################
-
-sub mtr_run ($$$$$$;$) {
- my $path= shift;
- my $arg_list_t= shift;
- my $input= shift;
- my $output= shift;
- my $error= shift;
- my $pid_file= shift; # Not used
- my $spawn_opts= shift;
-
- return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,
- $spawn_opts);
-}
-
-sub mtr_run_test ($$$$$$;$) {
- my $path= shift;
- my $arg_list_t= shift;
- my $input= shift;
- my $output= shift;
- my $error= shift;
- my $pid_file= shift; # Not used
- my $spawn_opts= shift;
-
- return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,
- $spawn_opts);
-}
-
-sub mtr_spawn ($$$$$$;$) {
- my $path= shift;
- my $arg_list_t= shift;
- my $input= shift;
- my $output= shift;
- my $error= shift;
- my $pid_file= shift; # Not used
- my $spawn_opts= shift;
-
- return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,
- $spawn_opts);
-}
-
-
-
-sub spawn_impl ($$$$$$$) {
- my $path= shift;
- my $arg_list_t= shift;
- my $mode= shift;
- my $input= shift;
- my $output= shift;
- my $error= shift;
- my $spawn_opts= shift;
-
- if ( $::opt_script_debug )
- {
- mtr_report("");
- mtr_debug("-" x 73);
- mtr_debug("STDIN $input") if $input;
- mtr_debug("STDOUT $output") if $output;
- mtr_debug("STDERR $error") if $error;
- mtr_debug("$mode: $path ", join(" ",@$arg_list_t));
- mtr_debug("spawn options:");
- if ($spawn_opts)
- {
- foreach my $key (sort keys %{$spawn_opts})
- {
- mtr_debug(" - $key: $spawn_opts->{$key}");
- }
- }
- else
- {
- mtr_debug(" none");
- }
- mtr_debug("-" x 73);
- mtr_report("");
- }
-
- mtr_error("Can't spawn with empty \"path\"") unless defined $path;
-
-
- FORK:
- {
- my $pid= fork();
-
- if ( ! defined $pid )
- {
- if ( $! == $!{EAGAIN} ) # See "perldoc Errno"
- {
- mtr_warning("Got EAGAIN from fork(), sleep 1 second and redo");
- sleep(1);
- redo FORK;
- }
-
- mtr_error("$path ($pid) can't be forked, error: $!");
-
- }
-
- if ( $pid )
- {
- select(STDOUT) if $::glob_win32_perl;
- return spawn_parent_impl($pid,$mode,$path);
- }
- else
- {
- # Child, redirect output and exec
-
- $SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't
-
- my $log_file_open_mode = '>';
-
- if ($spawn_opts and $spawn_opts->{'append_log_file'})
- {
- $log_file_open_mode = '>>';
- }
-
- if ( $output )
- {
- if ( $::glob_win32_perl )
- {
- # Don't redirect stdout on ActiveState perl since this is
- # just another thread in the same process.
- }
- elsif ( ! open(STDOUT,$log_file_open_mode,$output) )
- {
- mtr_child_error("can't redirect STDOUT to \"$output\": $!");
- }
- }
-
- if ( $error )
- {
- if ( !$::glob_win32_perl and $output eq $error )
- {
- if ( ! open(STDERR,">&STDOUT") )
- {
- mtr_child_error("can't dup STDOUT: $!");
- }
- }
- else
- {
- if ( ! open(STDERR,$log_file_open_mode,$error) )
- {
- mtr_child_error("can't redirect STDERR to \"$error\": $!");
- }
- }
- }
-
- if ( $input )
- {
- if ( ! open(STDIN,"<",$input) )
- {
- mtr_child_error("can't redirect STDIN to \"$input\": $!");
- }
- }
-
- if ( ! exec($path,@$arg_list_t) )
- {
- mtr_child_error("failed to execute \"$path\": $!");
- }
- mtr_error("Should never come here 1!");
- }
- mtr_error("Should never come here 2!");
- }
- mtr_error("Should never come here 3!");
-}
-
-
-sub spawn_parent_impl {
- my $pid= shift;
- my $mode= shift;
- my $path= shift;
-
- if ( $mode eq 'run' or $mode eq 'test' )
- {
- if ( $mode eq 'run' )
- {
- # Simple run of command, wait blocking for it to return
- my $ret_pid= waitpid($pid,0);
- if ( $ret_pid != $pid )
- {
- # The "simple" waitpid has failed, print debug info
- # and try to handle the error
- mtr_warning("waitpid($pid, 0) returned $ret_pid " .
- "when waiting for '$path', error: '$!'");
- if ( $ret_pid == -1 )
- {
- # waitpid returned -1, that would indicate the process
- # no longer exist and waitpid couldn't wait for it.
- return 1;
- }
- mtr_error("Error handling failed");
- }
-
- return mtr_process_exit_status($?);
- }
- else
- {
- # We run mysqltest and wait for it to return. But we try to
- # catch dying mysqld processes as well.
- #
- # We do blocking waitpid() until we get the return from the
- # "mysqltest" call. But if a mysqld process dies that we
- # started, we take this as an error, and kill mysqltest.
-
-
- my $exit_value= -1;
- my $saved_exit_value;
- my $ret_pid; # What waitpid() returns
-
- while ( ($ret_pid= waitpid(-1,0)) != -1 )
- {
- # Someone terminated, don't know who. Collect
- # status info first before $? is lost,
- # but not $exit_value, this is flagged from
-
- my $timer_name= mtr_timer_timeout($::glob_timers, $ret_pid);
- if ( $timer_name )
- {
- if ( $timer_name eq "suite" )
- {
- # We give up here
- # FIXME we should only give up the suite, not all of the run?
- print STDERR "\n";
- mtr_error("Test suite timeout");
- }
- elsif ( $timer_name eq "testcase" )
- {
- $saved_exit_value= 63; # Mark as timeout
- kill(9, $pid); # Kill mysqltest
- next; # Go on and catch the termination
- }
- }
-
- if ( $ret_pid == $pid )
- {
- # We got termination of mysqltest, we are done
- $exit_value= mtr_process_exit_status($?);
- last;
- }
-
- # One of the child processes died, unless this was expected
- # mysqltest should be killed and test aborted
-
- check_expected_crash_and_restart($ret_pid);
- }
-
- if ( $ret_pid != $pid )
- {
- # We terminated the waiting because a "mysqld" process died.
- # Kill the mysqltest process.
- mtr_verbose("Kill mysqltest because another process died");
- kill(9,$pid);
-
- $ret_pid= waitpid($pid,0);
-
- if ( $ret_pid != $pid )
- {
- mtr_error("$path ($pid) got lost somehow");
- }
- }
-
- return $saved_exit_value || $exit_value;
- }
- }
- else
- {
- # We spawned a process we don't wait for
- return $pid;
- }
-}
-
-
-# ----------------------------------------------------------------------
-# We try to emulate how an Unix shell calculates the exit code
-# ----------------------------------------------------------------------
-
-sub mtr_process_exit_status {
- my $raw_status= shift;
-
- if ( $raw_status & 127 )
- {
- return ($raw_status & 127) + 128; # Signal num + 128
- }
- else
- {
- return $raw_status >> 8; # Exit code
- }
-}
-
-
-##############################################################################
-#
-# Kill processes left from previous runs
-#
-##############################################################################
-
-
-# Kill all processes(mysqld, ndbd, ndb_mgmd and im) that would conflict with
-# this run
-# Make sure to remove the PID file, if any.
-# kill IM manager first, else it will restart the servers
-sub mtr_kill_leftovers () {
-
- mtr_report("Killing Possible Leftover Processes");
- mtr_debug("mtr_kill_leftovers(): started.");
-
- my @kill_pids;
- my %admin_pids;
-
- foreach my $srv (@{$::master}, @{$::slave})
- {
- mtr_debug(" - mysqld " .
- "(pid: $srv->{pid}; " .
- "pid file: '$srv->{path_pid}'; " .
- "socket: '$srv->{path_sock}'; ".
- "port: $srv->{port})");
-
- my $pid= mtr_mysqladmin_start($srv, "shutdown", 20);
-
- # Save the pid of the mysqladmin process
- $admin_pids{$pid}= 1;
-
- push(@kill_pids,{
- pid => $srv->{'pid'},
- pidfile => $srv->{'path_pid'},
- sockfile => $srv->{'path_sock'},
- port => $srv->{'port'},
- });
- $srv->{'pid'}= 0; # Assume we are done with it
- }
-
- if ( ! $::opt_skip_ndbcluster )
- {
-
- foreach my $cluster (@{$::clusters})
- {
-
- # Don't shut down a "running" cluster
- next if $cluster->{'use_running'};
-
- mtr_debug(" - cluster " .
- "(pid: $cluster->{pid}; " .
- "pid file: '$cluster->{path_pid})");
-
- my $pid= mtr_ndbmgm_start($cluster, "shutdown");
-
- # Save the pid of the ndb_mgm process
- $admin_pids{$pid}= 1;
-
- push(@kill_pids,{
- pid => $cluster->{'pid'},
- pidfile => $cluster->{'path_pid'}
- });
-
- $cluster->{'pid'}= 0; # Assume we are done with it
-
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- mtr_debug(" - ndbd " .
- "(pid: $ndbd->{pid}; " .
- "pid file: '$ndbd->{path_pid})");
-
- push(@kill_pids,{
- pid => $ndbd->{'pid'},
- pidfile => $ndbd->{'path_pid'},
- });
- $ndbd->{'pid'}= 0; # Assume we are done with it
- }
- }
- }
-
- # Wait for all the admin processes to complete
- mtr_wait_blocking(\%admin_pids);
-
- # If we trusted "mysqladmin --shutdown_timeout= ..." we could just
- # terminate now, but we don't (FIXME should be debugged).
- # So we try again to ping and at least wait the same amount of time
- # mysqladmin would for all to die.
-
- mtr_ping_with_timeout(\@kill_pids);
-
- # We now have tried to terminate nice. We have waited for the listen
- # port to be free, but can't really tell if the mysqld process died
- # or not. We now try to find the process PID from the PID file, and
- # send a kill to that process. Note that Perl let kill(0,@pids) be
- # a way to just return the numer of processes the kernel can send
- # signals to. So this can be used (except on Cygwin) to determine
- # if there are processes left running that we cound out might exists.
- #
- # But still after all this work, all we know is that we have
- # the ports free.
-
- # We scan the "var/run/" directory for other process id's to kill
-
- my $rundir= "$::opt_vardir/run";
-
- mtr_debug("Processing PID files in directory '$rundir'...");
-
- if ( -d $rundir )
- {
- opendir(RUNDIR, $rundir)
- or mtr_error("can't open directory \"$rundir\": $!");
-
- my @pids;
-
- while ( my $elem= readdir(RUNDIR) )
- {
- # Only read pid from files that end with .pid
- if ( $elem =~ /.*[.]pid$/)
- {
- my $pidfile= "$rundir/$elem";
-
- if ( -f $pidfile )
- {
- mtr_debug("Processing PID file: '$pidfile'...");
-
- my $pid= mtr_get_pid_from_file($pidfile);
-
- mtr_debug("Got pid: $pid from file '$pidfile'");
-
- if ( $::glob_cygwin_perl or kill(0, $pid) )
- {
- mtr_debug("There is process with pid $pid -- scheduling for kill.");
- push(@pids, $pid); # We know (cygwin guess) it exists
- }
- else
- {
- mtr_debug("There is no process with pid $pid -- skipping.");
- }
- }
- }
- else
- {
- mtr_warning("Found non pid file $elem in $rundir")
- if -f "$rundir/$elem";
- next;
- }
- }
- closedir(RUNDIR);
-
- if ( @pids )
- {
- mtr_debug("Killing the following processes with PID files: " .
- join(' ', @pids) . "...");
-
- start_reap_all();
-
- if ( $::glob_cygwin_perl )
- {
- # We have no (easy) way of knowing the Cygwin controlling
- # process, in the PID file we only have the Windows process id.
- system("kill -f " . join(" ",@pids)); # Hope for the best....
- mtr_debug("Sleep 5 seconds waiting for processes to die");
- sleep(5);
- }
- else
- {
- my $retries= 10; # 10 seconds
- do
- {
- mtr_debug("Sending SIGKILL to pids: " . join(' ', @pids));
- kill(9, @pids);
- mtr_report("Sleep 1 second waiting for processes to die");
- sleep(1) # Wait one second
- } while ( $retries-- and kill(0, @pids) );
-
- if ( kill(0, @pids) ) # Check if some left
- {
- mtr_warning("can't kill process(es) " . join(" ", @pids));
- }
- }
-
- stop_reap_all();
- }
- }
- else
- {
- mtr_debug("Directory for PID files ($rundir) does not exist.");
- }
-
- # We may have failed everything, but we now check again if we have
- # the listen ports free to use, and if they are free, just go for it.
-
- mtr_debug("Checking known mysqld servers...");
-
- foreach my $srv ( @kill_pids )
- {
- if ( defined $srv->{'port'} and mtr_ping_port($srv->{'port'}) )
- {
- mtr_warning("can't kill old process holding port $srv->{'port'}");
- }
- }
-
- mtr_debug("mtr_kill_leftovers(): finished.");
-}
-
-
-#
-# Check that all processes in "spec" are shutdown gracefully
-# else kill them off hard
-#
-sub mtr_check_stop_servers ($) {
- my $spec= shift;
-
- # Return if no processes are defined
- return if ! @$spec;
-
- mtr_verbose("mtr_check_stop_servers");
-
- # ----------------------------------------------------------------------
- # Wait until servers in "spec" has stopped listening
- # to their ports or timeout occurs
- # ----------------------------------------------------------------------
- mtr_ping_with_timeout(\@$spec);
-
- # ----------------------------------------------------------------------
- # Use waitpid() nonblocking for a little while, to see how
- # many process's will exit sucessfully.
- # This is the normal case.
- # ----------------------------------------------------------------------
- my $wait_counter= 50; # Max number of times to redo the loop
- foreach my $srv ( @$spec )
- {
- my $pid= $srv->{'pid'};
- my $ret_pid;
- if ( $pid )
- {
- $ret_pid= waitpid($pid,&WNOHANG);
- if ($ret_pid == $pid)
- {
- mtr_verbose("Caught exit of process $ret_pid");
- $srv->{'pid'}= 0;
- }
- elsif ($ret_pid == 0)
- {
- mtr_verbose("Process $pid is still alive");
- if ($wait_counter-- > 0)
- {
- # Give the processes more time to exit
- select(undef, undef, undef, (0.1));
- redo;
- }
- }
- else
- {
- mtr_warning("caught exit of unknown child $ret_pid");
- }
- }
- }
-
- # ----------------------------------------------------------------------
- # The processes that haven't yet exited need to
- # be killed hard, put them in "kill_pids" hash
- # ----------------------------------------------------------------------
- my %kill_pids;
- foreach my $srv ( @$spec )
- {
- my $pid= $srv->{'pid'};
- if ( $pid )
- {
- # Server is still alive, put it in list to be hard killed
- if ($::glob_win32_perl)
- {
- # Kill the real process if it's known
- $pid= $srv->{'real_pid'} if ($srv->{'real_pid'});
- }
- $kill_pids{$pid}= 1;
-
- # Write a message to the process's error log (if it has one)
- # that it's being killed hard.
- if ( defined $srv->{'errfile'} )
- {
- mtr_tofile($srv->{'errfile'}, "Note: Forcing kill of process $pid\n");
- }
- mtr_warning("Forcing kill of process $pid");
-
- }
- else
- {
- # Server is dead, remove the pidfile if it exists
- #
- # Race, could have been removed between test with -f
- # and the unlink() below, so better check again with -f
- if ( -f $srv->{'pidfile'} and ! unlink($srv->{'pidfile'}) and
- -f $srv->{'pidfile'} )
- {
- mtr_error("can't remove $srv->{'pidfile'}");
- }
- }
- }
-
- if ( ! keys %kill_pids )
- {
- # All processes has exited gracefully
- return;
- }
-
- mtr_kill_processes(\%kill_pids);
-
- # ----------------------------------------------------------------------
- # All processes are killed, cleanup leftover files
- # ----------------------------------------------------------------------
- {
- my $errors= 0;
- foreach my $srv ( @$spec )
- {
- if ( $srv->{'pid'} )
- {
- # Server has been hard killed, clean it's resources
- foreach my $file ($srv->{'pidfile'}, $srv->{'sockfile'})
- {
- # Know it is dead so should be no race, careful anyway
- if ( defined $file and -f $file and ! unlink($file) and -f $file )
- {
- $errors++;
- mtr_warning("couldn't delete $file");
- }
- }
-
- if ($::glob_win32_perl and $srv->{'real_pid'})
- {
- # Wait for the pseudo pid - if the real_pid was known
- # the pseudo pid has not been waited for yet, wai blocking
- # since it's "such a simple program"
- mtr_verbose("Wait for pseudo process $srv->{'pid'}");
- my $ret_pid= waitpid($srv->{'pid'}, 0);
- mtr_verbose("Pseudo process $ret_pid died");
- }
-
- $srv->{'pid'}= 0;
- }
- }
- if ( $errors )
- {
- # There where errors killing processes
- # do one last attempt to ping the servers
- # and if they can't be pinged, assume they are dead
- if ( ! mtr_ping_with_timeout( \@$spec ) )
- {
- mtr_error("we could not kill or clean up all processes");
- }
- else
- {
- mtr_verbose("All ports were free, continuing");
- }
- }
- }
-}
-
-
-# Wait for all the process in the list to terminate
-sub mtr_wait_blocking($) {
- my $admin_pids= shift;
-
-
- # Return if no processes defined
- return if ! %$admin_pids;
-
- mtr_verbose("mtr_wait_blocking");
-
- # Wait for all the started processes to exit
- # As mysqladmin is such a simple program, we trust it to terminate itself.
- # I.e. we wait blocking, and wait for them all before we go on.
- foreach my $pid (keys %{$admin_pids})
- {
- my $ret_pid= waitpid($pid,0);
-
- }
-}
-
-# Start "mysqladmin <command>" for a specific mysqld
-sub mtr_mysqladmin_start($$$) {
- my $srv= shift;
- my $command= shift;
- my $adm_shutdown_tmo= shift;
-
- my $args;
- mtr_init_args(\$args);
-
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--user=%s", $::opt_user);
- mtr_add_arg($args, "--password=");
- mtr_add_arg($args, "--silent");
- if ( -e $srv->{'path_sock'} )
- {
- mtr_add_arg($args, "--socket=%s", $srv->{'path_sock'});
- }
- if ( $srv->{'port'} )
- {
- mtr_add_arg($args, "--port=%s", $srv->{'port'});
- }
- if ( $srv->{'port'} and ! -e $srv->{'path_sock'} )
- {
- mtr_add_arg($args, "--protocol=tcp"); # Needed if no --socket
- }
- mtr_add_arg($args, "--connect_timeout=5");
-
- # Shutdown time must be high as slave may be in reconnect
- mtr_add_arg($args, "--shutdown_timeout=$adm_shutdown_tmo");
- mtr_add_arg($args, "$command");
- my $pid= mtr_spawn($::exe_mysqladmin, $args,
- "", "", "", "",
- { append_log_file => 1 });
- mtr_verbose("mtr_mysqladmin_start, pid: $pid");
- return $pid;
-
-}
-
-# Start "ndb_mgm shutdown" for a specific cluster, it will
-# shutdown all data nodes and leave the ndb_mgmd running
-sub mtr_ndbmgm_start($$) {
- my $cluster= shift;
- my $command= shift;
-
- my $args;
-
- mtr_init_args(\$args);
-
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--core");
- mtr_add_arg($args, "--try-reconnect=1");
- mtr_add_arg($args, "--ndb_connectstring=%s", $cluster->{'connect_string'});
- mtr_add_arg($args, "-e");
- mtr_add_arg($args, "$command");
-
- my $pid= mtr_spawn($::exe_ndb_mgm, $args,
- "", "/dev/null", "/dev/null", "",
- {});
- mtr_verbose("mtr_ndbmgm_start, pid: $pid");
- return $pid;
-
-}
-
-
-# Ping all servers in list, exit when none of them answers
-# or when timeout has passed
-sub mtr_ping_with_timeout($) {
- my $spec= shift;
- my $timeout= 200; # 20 seconds max
- my $res= 1; # If we just fall through, we are done
- # in the sense that the servers don't
- # listen to their ports any longer
-
- mtr_debug("Waiting for mysqld servers to stop...");
-
- TIME:
- while ( $timeout-- )
- {
- foreach my $srv ( @$spec )
- {
- $res= 1; # We are optimistic
- if ( $srv->{'pid'} and defined $srv->{'port'} )
- {
- if ( mtr_ping_port($srv->{'port'}) )
- {
- mtr_verbose("waiting for process $srv->{'pid'} to stop ".
- "using port $srv->{'port'}");
-
- # Millisceond sleep emulated with select
- select(undef, undef, undef, (0.1));
- $res= 0;
- next TIME;
- }
- else
- {
- # Process was not using port
- }
- }
- }
- last; # If we got here, we are done
- }
-
- if ($res)
- {
- mtr_debug("mtr_ping_with_timeout(): All mysqld instances are down.");
- }
- else
- {
- mtr_report("mtr_ping_with_timeout(): At least one server is alive.");
- }
-
- return $res;
-}
-
-
-#
-# Loop through our list of processes and look for and entry
-# with the provided pid
-# Set the pid of that process to 0 if found
-#
-sub mark_process_dead($)
-{
- my $ret_pid= shift;
-
- foreach my $mysqld (@{$::master}, @{$::slave})
- {
- if ( $mysqld->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$mysqld->{'type'} $mysqld->{'idx'} exited, pid: $ret_pid");
- $mysqld->{'pid'}= 0;
- return;
- }
- }
-
- foreach my $cluster (@{$::clusters})
- {
- if ( $cluster->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$cluster->{'name'} cluster ndb_mgmd exited, pid: $ret_pid");
- $cluster->{'pid'}= 0;
- return;
- }
-
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- if ( $ndbd->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$cluster->{'name'} cluster ndbd exited, pid: $ret_pid");
- $ndbd->{'pid'}= 0;
- return;
- }
- }
- }
- mtr_warning("mark_process_dead couldn't find an entry for pid: $ret_pid");
-
-}
-
-#
-# Loop through our list of processes and look for and entry
-# with the provided pid, if found check for the file indicating
-# expected crash and restart it.
-#
-sub check_expected_crash_and_restart($)
-{
- my $ret_pid= shift;
-
- foreach my $mysqld (@{$::master}, @{$::slave})
- {
- if ( $mysqld->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$mysqld->{'type'} $mysqld->{'idx'} exited, pid: $ret_pid");
- $mysqld->{'pid'}= 0;
-
- # Check if crash expected and restart if it was
- my $expect_file= "$::opt_vardir/tmp/" . "$mysqld->{'type'}" .
- "$mysqld->{'idx'}" . ".expect";
- if ( -f $expect_file )
- {
- mtr_verbose("Crash was expected, file $expect_file exists");
- mysqld_start($mysqld, $mysqld->{'start_opts'},
- $mysqld->{'start_slave_master_info'});
- unlink($expect_file);
- }
-
- return;
- }
- }
-
- foreach my $cluster (@{$::clusters})
- {
- if ( $cluster->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$cluster->{'name'} cluster ndb_mgmd exited, pid: $ret_pid");
- $cluster->{'pid'}= 0;
-
- # Check if crash expected and restart if it was
- my $expect_file= "$::opt_vardir/tmp/ndb_mgmd_" . "$cluster->{'type'}" .
- ".expect";
- if ( -f $expect_file )
- {
- mtr_verbose("Crash was expected, file $expect_file exists");
- ndbmgmd_start($cluster);
- unlink($expect_file);
- }
- return;
- }
-
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- if ( $ndbd->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$cluster->{'name'} cluster ndbd exited, pid: $ret_pid");
- $ndbd->{'pid'}= 0;
-
- # Check if crash expected and restart if it was
- my $expect_file= "$::opt_vardir/tmp/ndbd_" . "$cluster->{'type'}" .
- "$ndbd->{'idx'}" . ".expect";
- if ( -f $expect_file )
- {
- mtr_verbose("Crash was expected, file $expect_file exists");
- ndbd_start($cluster, $ndbd->{'idx'},
- $ndbd->{'start_extra_args'});
- unlink($expect_file);
- }
- return;
- }
- }
- }
-
- if ($::instance_manager->{'spawner_pid'} eq $ret_pid)
- {
- return;
- }
-
- mtr_warning("check_expected_crash_and_restart couldn't find an entry for pid: $ret_pid");
-
-}
-
-##############################################################################
-#
-# The operating system will keep information about dead children,
-# we read this information here, and if we have records the process
-# is alive, we mark it as dead.
-#
-##############################################################################
-
-sub mtr_record_dead_children () {
-
- my $process_died= 0;
- my $ret_pid;
-
- # Wait without blockinng to see if any processes had died
- # -1 or 0 means there are no more procesess to wait for
- while ( ($ret_pid= waitpid(-1,&WNOHANG)) != 0 and $ret_pid != -1)
- {
- mtr_warning("mtr_record_dead_children: $ret_pid");
- mark_process_dead($ret_pid);
- $process_died= 1;
- }
- return $process_died;
-}
-
-sub start_reap_all {
- # This causes terminating processes to not become zombies, avoiding
- # the need for (or possibility of) explicit waitpid().
- $SIG{CHLD}= 'IGNORE';
-
- # On some platforms (Linux, QNX, OSX, ...) there is potential race
- # here. If a process terminated before setting $SIG{CHLD} (but after
- # any attempt to waitpid() it), it will still be a zombie. So we
- # have to handle any such process here.
- my $pid;
- while(($pid= waitpid(-1, &WNOHANG)) != 0 and $pid != -1)
- {
- mtr_warning("start_reap_all pid: $pid");
- mark_process_dead($pid);
- };
-}
-
-sub stop_reap_all {
- $SIG{CHLD}= 'DEFAULT';
-}
-
-
sub mtr_ping_port ($) {
my $port= shift;
@@ -1041,7 +69,7 @@ sub mtr_ping_port ($) {
sub sleep_until_file_created ($$$) {
my $pidfile= shift;
my $timeout= shift;
- my $pid= shift;
+ my $proc= shift;
my $sleeptime= 100; # Milliseconds
my $loops= ($timeout * 1000) / $sleeptime;
@@ -1053,9 +81,9 @@ sub sleep_until_file_created ($$$) {
}
# Check if it died after the fork() was successful
- if ( $pid != 0 && waitpid($pid,&WNOHANG) == $pid )
+ if ( defined $proc and ! $proc->wait_one(0) )
{
- mtr_warning("Process $pid died");
+ mtr_warning("Process $proc died");
return 0;
}
@@ -1070,73 +98,12 @@ sub sleep_until_file_created ($$$) {
"still waiting for $left seconds...");
}
- # Millisceond sleep emulated with select
- select(undef, undef, undef, ($sleeptime/1000));
- }
-
- return 0;
-}
-
+ mtr_milli_sleep($sleeptime);
-sub mtr_kill_processes ($) {
- my $pids = shift;
-
- mtr_verbose("mtr_kill_processes (" . join(" ", keys %{$pids}) . ")");
-
- foreach my $pid (keys %{$pids})
- {
-
- if ($pid <= 0)
- {
- mtr_warning("Trying to kill illegal pid: $pid");
- next;
- }
-
- my $signaled_procs= kill(9, $pid);
- if ($signaled_procs == 0)
- {
- # No such process existed, assume it's killed
- mtr_verbose("killed $pid(no such process)");
- }
- else
- {
- my $ret_pid= waitpid($pid,0);
- if ($ret_pid == $pid)
- {
- mtr_verbose("killed $pid(got the pid)");
- }
- elsif ($ret_pid == -1)
- {
- mtr_verbose("killed $pid(got -1)");
- }
- }
}
- mtr_verbose("done killing processes");
-}
-
-
-##############################################################################
-#
-# When we exit, we kill off all children
-#
-##############################################################################
-sub mtr_exit ($) {
- my $code= shift;
- mtr_timer_stop_all($::glob_timers);
- local $SIG{HUP} = 'IGNORE';
- # ToDo: Signalling -$$ will only work if we are the process group
- # leader (in fact on QNX it will signal our session group leader,
- # which might be Do-compile or Pushbuild, causing tests to be
- # aborted). So we only do it if we are the group leader. We might
- # set ourselves as the group leader at startup (with
- # POSIX::setpgrp(0,0)), but then care must be needed to always do
- # proper child process cleanup.
- POSIX::kill(SIGHUP, -$$) if !$::glob_win32_perl and $$ == getpgrp();
-
- exit($code);
+ return 0;
}
-###########################################################################
1;
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm
new file mode 100644
index 00000000000..ce3fba87385
--- /dev/null
+++ b/mysql-test/lib/mtr_report.pm
@@ -0,0 +1,465 @@
+# -*- cperl -*-
+# Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+package mtr_report;
+use strict;
+
+use base qw(Exporter);
+our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line
+ mtr_print_header mtr_report mtr_report_stats
+ mtr_warning mtr_error mtr_debug mtr_verbose
+ mtr_verbose_restart mtr_report_test_passed
+ mtr_report_test_skipped mtr_print
+ mtr_report_test);
+
+use mtr_match;
+require "mtr_io.pl";
+
+my $tot_real_time= 0;
+
+our $timestamp= 0;
+our $timediff= 0;
+our $name;
+our $verbose;
+our $verbose_restart= 0;
+our $timer= 1;
+
+sub report_option {
+ my ($opt, $value)= @_;
+
+ # Evaluate $opt as string to use "Getopt::Long::Callback legacy API"
+ my $opt_name = "$opt";
+
+ # Convert - to _ in option name
+ $opt_name =~ s/-/_/g;
+ no strict 'refs';
+ ${$opt_name}= $value;
+}
+
+sub _name {
+ return $name ? $name." " : undef;
+}
+
+sub _mtr_report_test_name ($) {
+ my $tinfo= shift;
+ my $tname= $tinfo->{name};
+
+ return unless defined $verbose;
+
+ # Add combination name if any
+ $tname.= " '$tinfo->{combination}'"
+ if defined $tinfo->{combination};
+
+ print _name(), _timestamp();
+ printf "%-40s ", $tname;
+}
+
+
+sub mtr_report_test_skipped ($) {
+ my ($tinfo)= @_;
+ $tinfo->{'result'}= 'MTR_RES_SKIPPED';
+
+ mtr_report_test($tinfo);
+}
+
+
+sub mtr_report_test_passed ($) {
+ my ($tinfo)= @_;
+
+ # Save the timer value
+ my $timer_str= "";
+ if ( $timer and -f "$::opt_vardir/log/timer" )
+ {
+ $timer_str= mtr_fromfile("$::opt_vardir/log/timer");
+ $tinfo->{timer}= $timer_str;
+ }
+
+ # Big warning if status already set
+ if ( $tinfo->{'result'} ){
+ mtr_warning("mtr_report_test_passed: Test result",
+ "already set to '", $tinfo->{'result'}, ",");
+ }
+
+ $tinfo->{'result'}= 'MTR_RES_PASSED';
+
+ mtr_report_test($tinfo);
+}
+
+
+sub mtr_report_test ($) {
+ my ($tinfo)= @_;
+ _mtr_report_test_name($tinfo);
+
+ my $comment= $tinfo->{'comment'};
+ my $logfile= $tinfo->{'logfile'};
+ my $warnings= $tinfo->{'warnings'};
+ my $result= $tinfo->{'result'};
+
+ if ($result eq 'MTR_RES_FAILED'){
+
+ my $timest = format_time();
+
+ if ( $warnings )
+ {
+ mtr_report("[ fail ] Found warnings/errors in server log file!");
+ mtr_report(" Test ended at $timest");
+ mtr_report($warnings);
+ return;
+ }
+ my $timeout= $tinfo->{'timeout'};
+ if ( $timeout )
+ {
+ mtr_report("[ fail ] timeout after $timeout seconds");
+ mtr_report(" Test ended at $timest");
+ mtr_report("\n$tinfo->{'comment'}");
+ return;
+ }
+ else
+ {
+ mtr_report("[ fail ]\n Test ended at $timest");
+ }
+
+ if ( $logfile )
+ {
+ # Test failure was detected by test tool and its report
+ # about what failed has been saved to file. Display the report.
+ mtr_report("\n$logfile\n");
+ }
+ if ( $comment )
+ {
+ # The test failure has been detected by mysql-test-run.pl
+ # when starting the servers or due to other error, the reason for
+ # failing the test is saved in "comment"
+ mtr_report("\n$comment\n");
+ }
+
+ if ( !$logfile and !$comment )
+ {
+ # Neither this script or the test tool has recorded info
+ # about why the test has failed. Should be debugged.
+ mtr_report("\nUnknown result, neither 'comment' or 'logfile' set");
+ }
+ }
+ elsif ($result eq 'MTR_RES_SKIPPED')
+ {
+ if ( $tinfo->{'disable'} )
+ {
+ mtr_report("[ disabled ] $comment");
+ }
+ elsif ( $comment )
+ {
+ mtr_report("[ skipped ] $comment");
+ }
+ else
+ {
+ mtr_report("[ skipped ]");
+ }
+ }
+ elsif ($result eq 'MTR_RES_PASSED')
+ {
+ my $timer_str= $tinfo->{timer} || "";
+ $tot_real_time += ($timer_str/1000);
+ mtr_report("[ pass ] ", sprintf("%5s", $timer_str));
+
+ # Show any problems check-testcase found
+ if ( defined $tinfo->{'check'} )
+ {
+ mtr_report($tinfo->{'check'});
+ }
+ }
+}
+
+
+sub mtr_report_stats ($) {
+ my $tests= shift;
+
+ # ----------------------------------------------------------------------
+ # Find out how we where doing
+ # ----------------------------------------------------------------------
+
+ my $tot_skiped= 0;
+ my $tot_passed= 0;
+ my $tot_failed= 0;
+ my $tot_tests= 0;
+ my $tot_restarts= 0;
+ my $found_problems= 0;
+
+ foreach my $tinfo (@$tests)
+ {
+ if ( $tinfo->{failures} )
+ {
+ # Test has failed at least one time
+ $tot_tests++;
+ $tot_failed++;
+ }
+ elsif ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' )
+ {
+ # Test was skipped
+ $tot_skiped++;
+ }
+ elsif ( $tinfo->{'result'} eq 'MTR_RES_PASSED' )
+ {
+ # Test passed
+ $tot_tests++;
+ $tot_passed++;
+ }
+
+ if ( $tinfo->{'restarted'} )
+ {
+ # Servers was restarted
+ $tot_restarts++;
+ }
+
+ # Look for warnings produced by mysqltest
+ my $base_file= mtr_match_extension($tinfo->{'result_file'},
+ "result"); # Trim extension
+ my $warning_file= "$base_file.warnings";
+ if ( -f $warning_file )
+ {
+ $found_problems= 1;
+ mtr_warning("Check myqltest warnings in '$warning_file'");
+ }
+ }
+
+ # ----------------------------------------------------------------------
+ # Print out a summary report to screen
+ # ----------------------------------------------------------------------
+ print "The servers were restarted $tot_restarts times\n";
+
+ if ( $timer )
+ {
+ use English;
+
+ mtr_report("Spent", sprintf("%.3f", $tot_real_time),"of",
+ time - $BASETIME, "seconds executing testcases");
+ }
+
+
+ my $warnlog= "$::opt_vardir/log/warnings";
+ if ( -f $warnlog )
+ {
+ mtr_warning("Got errors/warnings while running tests, please examine",
+ "'$warnlog' for details.");
+ }
+
+ print "\n";
+
+ # Print a list of check_testcases that failed(if any)
+ if ( $::opt_check_testcases )
+ {
+ my %check_testcases;
+
+ foreach my $tinfo (@$tests)
+ {
+ if ( defined $tinfo->{'check_testcase_failed'} )
+ {
+ $check_testcases{$tinfo->{'name'}}= 1;
+ }
+ }
+
+ if ( keys %check_testcases )
+ {
+ print "Check of testcase failed for: ";
+ print join(" ", keys %check_testcases);
+ print "\n\n";
+ }
+ }
+
+ # Print a list of testcases that failed
+ if ( $tot_failed != 0 )
+ {
+
+ # Print each failed test, again
+ #foreach my $test ( @$tests ){
+ # if ( $test->{failures} ) {
+ # mtr_report_test($test);
+ # }
+ #}
+
+ my $ratio= $tot_passed * 100 / $tot_tests;
+ print "Failed $tot_failed/$tot_tests tests, ";
+ printf("%.2f", $ratio);
+ print "\% were successful.\n\n";
+
+ # Print the list of test that failed in a format
+ # that can be copy pasted to rerun only failing tests
+ print "Failing test(s):";
+
+ my %seen= ();
+ foreach my $tinfo (@$tests)
+ {
+ my $tname= $tinfo->{'name'};
+ if ( $tinfo->{failures} and ! $seen{$tname})
+ {
+ print " $tname";
+ $seen{$tname}= 1;
+ }
+ }
+ print "\n\n";
+
+ # Print info about reporting the error
+ print
+ "The log files in var/log may give you some hint of what went wrong.\n\n",
+ "If you want to report this error, please read first ",
+ "the documentation\n",
+ "at http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n\n";
+
+ }
+ else
+ {
+ print "All $tot_tests tests were successful.\n\n";
+ }
+
+ if ( $tot_failed != 0 || $found_problems)
+ {
+ mtr_error("there were failing test cases");
+ }
+}
+
+
+##############################################################################
+#
+# Text formatting
+#
+##############################################################################
+
+sub mtr_print_line () {
+ print '-' x 60, "\n";
+}
+
+
+sub mtr_print_thick_line {
+ my $char= shift || '=';
+ print $char x 78, "\n";
+}
+
+
+sub mtr_print_header () {
+ print "\n";
+ printf "TEST";
+ print " " x 38;
+ print "RESULT ";
+ print "TIME (ms)" if $timer;
+ print "\n";
+ mtr_print_line();
+ print "\n";
+}
+
+
+##############################################################################
+#
+# Log and reporting functions
+#
+##############################################################################
+
+use Time::localtime;
+
+use Time::HiRes qw(gettimeofday);
+
+sub format_time {
+ my $tm= localtime();
+ return sprintf("%4d-%02d-%02d %02d:%02d:%02d",
+ $tm->year + 1900, $tm->mon+1, $tm->mday,
+ $tm->hour, $tm->min, $tm->sec);
+}
+
+my $t0= gettimeofday();
+
+sub _timestamp {
+ return "" unless $timestamp;
+
+ my $diff;
+ if ($timediff){
+ my $t1= gettimeofday();
+ my $elapsed= $t1 - $t0;
+
+ $diff= sprintf(" +%02.3f", $elapsed);
+
+ # Save current time for next lap
+ $t0= $t1;
+
+ }
+
+ my $tm= localtime();
+ return sprintf("%02d%02d%02d %2d:%02d:%02d%s ",
+ $tm->year % 100, $tm->mon+1, $tm->mday,
+ $tm->hour, $tm->min, $tm->sec, $diff);
+}
+
+# Always print message to screen
+sub mtr_print (@) {
+ print _name(), join(" ", @_), "\n";
+}
+
+
+# Print message to screen if verbose is defined
+sub mtr_report (@) {
+ if (defined $verbose)
+ {
+ print _name(), join(" ", @_), "\n";
+ }
+}
+
+
+# Print warning to screen
+sub mtr_warning (@) {
+ print STDERR _name(), _timestamp(),
+ "mysql-test-run: WARNING: ", join(" ", @_), "\n";
+}
+
+
+# Print error to screen and then exit
+sub mtr_error (@) {
+ print STDERR _name(), _timestamp(),
+ "mysql-test-run: *** ERROR: ", join(" ", @_), "\n";
+ exit(1);
+}
+
+
+sub mtr_debug (@) {
+ if ( $verbose > 2 )
+ {
+ print STDERR _name(),
+ _timestamp(), "####: ", join(" ", @_), "\n";
+ }
+}
+
+
+sub mtr_verbose (@) {
+ if ( $verbose )
+ {
+ print STDERR _name(), _timestamp(),
+ "> ",join(" ", @_),"\n";
+ }
+}
+
+
+sub mtr_verbose_restart (@) {
+ my ($server, @args)= @_;
+ my $proc= $server->{proc};
+ if ( $verbose_restart )
+ {
+ print STDERR _name(),_timestamp(),
+ "> Restart $proc - ",join(" ", @args),"\n";
+ }
+}
+
+
+1;
diff --git a/mysql-test/lib/mtr_stress.pl b/mysql-test/lib/mtr_stress.pl
index 93b06b32c5f..cd5c7b0dbb7 100644
--- a/mysql-test/lib/mtr_stress.pl
+++ b/mysql-test/lib/mtr_stress.pl
@@ -135,7 +135,7 @@ sub run_stress_test ()
}
mtr_init_args(\$args);
-
+ mtr_add_args($args, "$::glob_mysql_test_dir/mysql-stress-test.pl");
mtr_add_arg($args, "--server-socket=%s", $::master->[0]->{'path_sock'});
mtr_add_arg($args, "--server-user=%s", $::opt_user);
mtr_add_arg($args, "--server-database=%s", "test");
@@ -181,7 +181,13 @@ sub run_stress_test ()
}
#Run stress test
- mtr_run("$::glob_mysql_test_dir/mysql-stress-test.pl", $args, "", "", "", "");
+ My::SafeProcess->run
+ (
+ name => "stress test",
+ path => $^X,
+ args => \$args,
+ );
+
if ( ! $::glob_use_embedded_server )
{
stop_all_servers();
diff --git a/mysql-test/lib/mtr_unique.pm b/mysql-test/lib/mtr_unique.pm
new file mode 100644
index 00000000000..2ac172883a2
--- /dev/null
+++ b/mysql-test/lib/mtr_unique.pm
@@ -0,0 +1,195 @@
+# -*- cperl -*-
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+package mtr_unique;
+
+use strict;
+use Fcntl ':flock';
+
+use base qw(Exporter);
+our @EXPORT= qw(mtr_get_unique_id mtr_release_unique_id);
+
+use My::Platform;
+
+sub msg {
+ # print "### unique($$) - ", join(" ", @_), "\n";
+}
+
+my $file;
+
+if(!IS_WINDOWS)
+{
+ $file= "/tmp/mysql-test-ports";
+}
+else
+{
+ $file= $ENV{'TEMP'}."/mysql-test-ports";
+}
+
+
+my %mtr_unique_ids;
+
+END {
+ my $allocated_id= $mtr_unique_ids{$$};
+ if (defined $allocated_id)
+ {
+ mtr_release_unique_id($allocated_id);
+ }
+ delete $mtr_unique_ids{$$};
+}
+
+#
+# Get a unique, numerical ID, given a file name (where all
+# requested IDs are stored), a minimum and a maximum value.
+#
+# If no unique ID within the specified parameters can be
+# obtained, return undef.
+#
+sub mtr_get_unique_id($$) {
+ my ($min, $max)= @_;;
+
+ msg("get, '$file', $min-$max");
+
+ die "Can only get one unique id per process!" if $mtr_unique_ids{$$};
+
+ my $ret = undef;
+ my $changed = 0;
+
+ if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
+ die 'lock file is a symbolic link';
+ }
+
+ chmod 0777, "$file.sem";
+ open SEM, ">", "$file.sem" or die "can't write to $file.sem";
+ flock SEM, LOCK_EX or die "can't lock $file.sem";
+ if(! -e $file) {
+ open FILE, ">", $file or die "can't create $file";
+ close FILE;
+ }
+
+ msg("HAVE THE LOCK");
+
+ if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
+ die 'lock file is a symbolic link';
+ }
+
+ chmod 0777, $file;
+ open FILE, "+<", $file or die "can't open $file";
+ #select undef,undef,undef,0.2;
+ seek FILE, 0, 0;
+ my %taken = ();
+ while(<FILE>) {
+ chomp;
+ my ($id, $pid) = split / /;
+ $taken{$id} = $pid;
+ msg("taken: $id, $pid");
+ # Check if process with given pid is alive
+ if(!process_alive($pid)) {
+ print "Removing slot $id used by missing process $pid\n";
+ msg("Removing slot $id used by missing process $pid");
+ delete $taken{$id};
+ $changed++;
+ }
+ }
+ for(my $i=$min; $i<=$max; ++$i) {
+ if(! exists $taken{$i}) {
+ $ret = $i;
+ $taken{$i} = $$;
+ $changed++;
+ # Remember the id this process got
+ $mtr_unique_ids{$$}= $i;
+ msg(" got $i");
+ last;
+ }
+ }
+ if($changed) {
+ seek FILE, 0, 0;
+ truncate FILE, 0 or die "can't truncate $file";
+ for my $k (keys %taken) {
+ print FILE $k . ' ' . $taken{$k} . "\n";
+ }
+ }
+ close FILE;
+
+ msg("RELEASING THE LOCK");
+ flock SEM, LOCK_UN or warn "can't unlock $file.sem";
+ close SEM;
+
+ return $ret;
+}
+
+
+#
+# Release a unique ID.
+#
+sub mtr_release_unique_id($) {
+ my ($myid)= @_;
+
+ msg("release, $myid");
+
+
+ if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
+ die 'lock file is a symbolic link';
+ }
+
+ open SEM, ">", "$file.sem" or die "can't write to $file.sem";
+ flock SEM, LOCK_EX or die "can't lock $file.sem";
+
+ msg("HAVE THE LOCK");
+
+ if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
+ die 'lock file is a symbolic link';
+ }
+
+ if(! -e $file) {
+ open FILE, ">", $file or die "can't create $file";
+ close FILE;
+ }
+ open FILE, "+<", $file or die "can't open $file";
+ #select undef,undef,undef,0.2;
+ seek FILE, 0, 0;
+ my %taken = ();
+ while(<FILE>) {
+ chomp;
+ my ($id, $pid) = split / /;
+ msg(" taken, $id $pid");
+ $taken{$id} = $pid;
+ }
+
+ if ($taken{$myid} != $$)
+ {
+ msg(" The unique id for this process does not match pid");
+ }
+
+
+ msg(" removing $myid");
+ delete $taken{$myid};
+ seek FILE, 0, 0;
+ truncate FILE, 0 or die "can't truncate $file";
+ for my $k (keys %taken) {
+ print FILE $k . ' ' . $taken{$k} . "\n";
+ }
+ close FILE;
+
+ msg("RELEASE THE LOCK");
+
+ flock SEM, LOCK_UN or warn "can't unlock $file.sem";
+ close SEM;
+}
+
+
+1;
+
diff --git a/mysql-test/lib/t/Base.t b/mysql-test/lib/t/Base.t
new file mode 100644
index 00000000000..6ca7657d421
--- /dev/null
+++ b/mysql-test/lib/t/Base.t
@@ -0,0 +1,27 @@
+# -*- cperl -*-
+use Test::More qw(no_plan);
+use strict;
+
+use_ok ("My::SafeProcess::Base");
+
+
+my $count= 0;
+for (1..100){
+ my $pid= My::SafeProcess::Base::_safe_fork();
+ exit unless $pid;
+ (waitpid($pid, 0) == $pid) and $count++;
+}
+ok($count == 100, "safe_fork");
+
+# A nice little forkbomb
+SKIP: {
+ skip("forkbomb", 1);
+ eval {
+ while(1){
+ my $pid= My::SafeProcess::Base::_safe_fork();
+ exit unless $pid;
+ }
+ };
+ ok($@, "forkbomb");
+}
+
diff --git a/mysql-test/lib/t/Find.t b/mysql-test/lib/t/Find.t
new file mode 100644
index 00000000000..90489ba06dd
--- /dev/null
+++ b/mysql-test/lib/t/Find.t
@@ -0,0 +1,33 @@
+# -*- cperl -*-
+use Test::More qw(no_plan);
+use strict;
+
+use_ok ("My::Find");
+my $basedir= "../..";
+
+print "=" x 40, "\n";
+my $mysqld_exe= my_find_bin($basedir,
+ ["sql", "bin"],
+ ["mysqld", "mysqld-debug"]);
+print "mysqld_exe: $mysqld_exe\n";
+print "=" x 40, "\n";
+my $mysql_exe= my_find_bin($basedir,
+ ["client", "bin"],
+ "mysql");
+print "mysql_exe: $mysql_exe\n";
+print "=" x 40, "\n";
+
+my $mtr_build_dir= $ENV{MTR_BUILD_DIR};
+$ENV{MTR_BUILD_DIR}= "debug";
+my $mysql_exe= my_find_bin($basedir,
+ ["client", "bin"],
+ "mysql");
+print "mysql_exe: $mysql_exe\n";
+$ENV{MTR_BUILD_DIR}= $mtr_build_dir;
+print "=" x 40, "\n";
+
+my $charset_dir= my_find_dir($basedir,
+ ["share/mysql", "sql/share", "share"],
+ "charsets");
+print "charset_dir: $charset_dir\n";
+print "=" x 40, "\n";
diff --git a/mysql-test/lib/t/Options.t b/mysql-test/lib/t/Options.t
new file mode 100644
index 00000000000..7012f3da8de
--- /dev/null
+++ b/mysql-test/lib/t/Options.t
@@ -0,0 +1,127 @@
+
+# -*- cperl -*-
+use Test::More qw(no_plan);
+use strict;
+
+use_ok("My::Options");
+
+my @tests=
+(
+ [
+ ['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=ms'],
+ ['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=statement'],
+ ['--binlog-format=statement']
+ ],
+
+ [
+ ['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=statement'],
+ ['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=mixed'],
+ ['--binlog-format=mixed']
+ ],
+
+ [
+ ['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=mixed'],
+ ['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=statement'],
+ ['--binlog-format=statement']
+ ],
+
+ [
+ ['--binlog-format=mixed', '--loose-skip-innodb', '--binlog-format=row'],
+ ['--binlog-format=statement', '--loose-skip-innodb', '--binlog-format=row'],
+ [ ]
+ ],
+
+ [
+ ['--binlog-format=row'],
+ [ ],
+ ['--binlog-format=default']
+ ],
+
+ [
+ [ ],
+ ['--binlog-format=row'],
+ ['--binlog-format=row']
+ ],
+
+ [
+ [ ],
+ ['-O', 'max_binlog_size=1' ],
+ ['--max_binlog_size=1' ]
+ ],
+
+ [
+ ['-O', 'max_binlog_size=1' ],
+ ['-O', 'max_binlog_size=1' ],
+ [ ],
+ ],
+
+ [
+ ['-O', 'max_binlog_size=1' ],
+ [ ],
+ ['--max_binlog_size=default' ]
+ ],
+
+ [
+ [ ],
+ ['-O', 'max_binlog_size=1', '--binlog-format=row' ],
+ ['--max_binlog_size=1', '--binlog-format=row' ]
+ ],
+ [
+ ['--binlog-format=statement' ],
+ ['-O', 'max_binlog_size=1', '--binlog-format=row' ],
+ ['--max_binlog_size=1', '--binlog-format=row']
+ ],
+
+ [
+ [ '--binlog-format=statement' ],
+ ['-O', 'max_binlog_size=1', '--binlog-format=statement' ],
+ ['--max_binlog_size=1' ]
+ ],
+
+ [
+ [ '--binlog-format=statement' ],
+ ['-O', 'max_binlog_size=1', '--binlog-format=statement' ],
+ ['--max_binlog_size=1' ]
+ ],
+
+ [
+ [ '--binlog-format=statement' ],
+ ['--relay-log=/path/to/a/relay-log', '--binlog-format=row'],
+ ['--relay-log=/path/to/a/relay-log', '--binlog-format=row' ]
+ ],
+
+
+ [
+ [ '--binlog-format=statement' ],
+ ['--relay-log=/path/to/a/relay-log', '-O', 'max_binlog_size=1'],
+ ['--max_binlog_size=1', '--relay-log=/path/to/a/relay-log', '--binlog-format=default' ]
+ ],
+
+ [
+ [ '--slow-query-log=0' ],
+ [ '--slow-query-log' ],
+ [ '--slow-query-log' ]
+ ],
+
+
+);
+
+
+my $test_no= 0;
+foreach my $test (@tests){
+ print "test", $test_no++, "\n";
+ foreach my $opts (@$test){
+ print My::Options::toStr("", @$opts);
+ }
+ my $from= $test->[0];
+ my $to= $test->[1];
+ my @result= My::Options::diff($from, $to);
+ ok(My::Options::same(\@result, $test->[2]));
+ if (!My::Options::same(\@result, $test->[2])){
+ print "failed\n";
+ print My::Options::toStr("result", @result);
+ print My::Options::toStr("expect", @{$test->[2]});
+ }
+ print My::Options::toSQL(@result), "\n";
+ print "\n";
+}
diff --git a/mysql-test/lib/t/Platform.t b/mysql-test/lib/t/Platform.t
new file mode 100644
index 00000000000..a8cb7751925
--- /dev/null
+++ b/mysql-test/lib/t/Platform.t
@@ -0,0 +1,18 @@
+# -*- cperl -*-
+use Test::More qw(no_plan);
+use strict;
+
+use_ok ("My::Platform");
+use My::Platform;
+
+use File::Temp qw / tempdir /;
+my $dir = tempdir( CLEANUP => 1 );
+
+print "Running on Windows\n" if (IS_WINDOWS);
+print "Using ActiveState perl\n" if (IS_WIN32PERL);
+print "Using cygwin perl\n" if (IS_CYGWIN);
+
+print "dir: '$dir'\n";
+print "native: '".native_path($dir)."'\n";
+print "mixed: '".mixed_path($dir)."'\n";
+print "posix: '".posix_path($dir)."'\n";
diff --git a/mysql-test/lib/t/SafeProcess.t b/mysql-test/lib/t/SafeProcess.t
new file mode 100644
index 00000000000..d4a62ff8cca
--- /dev/null
+++ b/mysql-test/lib/t/SafeProcess.t
@@ -0,0 +1,102 @@
+# -*- cperl -*-
+
+use strict;
+use FindBin;
+use IO::File;
+
+use Test::More qw(no_plan);
+use_ok ("My::SafeProcess");
+
+
+my $perl_path= $^X;
+
+{
+ # Test exit codes
+ my $count= 32;
+ my $ok_count= 0;
+ for my $code (0..$count-1) {
+
+ my $args= [ "$FindBin::Bin/test_child.pl", "--exit-code=$code" ];
+ my $proc= My::SafeProcess->new
+ (
+ path => $perl_path,
+ args => \$args,
+ output => "/dev/null",
+ error => "/dev/null",
+ );
+ # Wait max 10 seconds for the process to finish
+ $ok_count++ if ($proc->wait_one(10) == 0 and
+ $proc->exit_status() == $code);
+ }
+ ok($count == $ok_count, "check exit_status, $ok_count");
+}
+
+
+{
+ # spawn a number of concurrent processes
+ my $count= 16;
+ my $ok_count= 0;
+ my %procs;
+ for my $code (0..$count-1) {
+
+ my $args= [ "$FindBin::Bin/test_child.pl", "--exit-code=$code" ];
+ $procs{$code}= My::SafeProcess->new
+ (
+ path => $perl_path,
+ args => \$args,
+ output => "/dev/null",
+ error => "/dev/null",
+ );
+ }
+
+ for my $code (0..$count-1) {
+ $ok_count++ if ($procs{$code}->wait_one(10) == 0 and
+ $procs{$code}->exit_status() == $code);
+ }
+ ok($count == $ok_count, "concurrent, $ok_count");
+}
+
+
+#
+# Test stdout, stderr
+#
+{
+ use File::Temp qw / tempdir /;
+ my $dir = tempdir( CLEANUP => 1 );
+
+ my $args= [ "$FindBin::Bin/test_child.pl" ];
+ my $proc= My::SafeProcess->new
+ (
+ path => $perl_path,
+ args => \$args,
+ output => "$dir/output.txt",
+ error => "$dir/error.txt",
+ );
+
+ $proc->wait_one(2); # Wait max 2 seconds for the process to finish
+
+ my $fh= IO::File->new("$dir/output.txt");
+ my @text= <$fh>;
+ ok(grep(/Hello stdout/, @text), "check stdout");
+ $fh= IO::File->new("$dir/error.txt");
+ my @text= <$fh>;
+ ok(grep(/Hello stderr/, @text), "check stderr");
+
+ # To same file
+ $proc= My::SafeProcess->new
+ (
+ path => $perl_path,
+ args => \$args,
+ output => "$dir/output.txt",
+ error => "$dir/output.txt",
+ debug => 1,
+ );
+
+ $proc->wait_one(2); # Wait max 2 seconds for the process to finish
+
+ my $fh= IO::File->new("$dir/output.txt");
+ my @text= <$fh>;
+ ok((grep(/Hello stdout/, @text) and grep(/Hello stderr/, @text)),
+ "check stdout and stderr");
+
+}
diff --git a/mysql-test/lib/t/SafeProcessStress.pl b/mysql-test/lib/t/SafeProcessStress.pl
new file mode 100755
index 00000000000..0f7a59d67f0
--- /dev/null
+++ b/mysql-test/lib/t/SafeProcessStress.pl
@@ -0,0 +1,149 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+
+use strict;
+use FindBin;
+use My::SafeProcess;
+
+#
+# Test longterm running of SafeProcess
+#
+
+my $perl_path= $^X;
+my $verbose= 0;
+my $loops= 100;
+
+print "kill one and wait for one\n";
+for (1...$loops){
+ use File::Temp qw / tempdir /;
+ my $dir = tempdir( CLEANUP => 1 );
+
+ my @procs;
+ for (1..10){
+
+ my $args= [ "$FindBin::Bin/dummyd.pl", "--vardir=$dir" ];
+ my $proc= My::SafeProcess->new
+ (
+ path => $perl_path,
+ args => \$args,
+ verbose => $verbose,
+ );
+ push(@procs, $proc);
+ }
+
+ foreach my $proc (@procs) {
+ $proc->kill();
+ # dummyd will always be killed and thus
+ # exit_status should have been set to 1
+ die "oops, exit_status: ", $proc->exit_status()
+ unless $proc->exit_status() == 1;
+ }
+
+ print "=" x 60, "\n";
+}
+
+
+print "With 1 second sleep in dummyd\n";
+for (1...$loops){
+ use File::Temp qw / tempdir /;
+ my $dir = tempdir( CLEANUP => 1 );
+
+ my @procs;
+ for (1..10){
+
+ my $args= [ "$FindBin::Bin/dummyd.pl",
+ "--vardir=$dir",
+ "--sleep=1" ];
+ my $proc= My::SafeProcess->new
+ (
+ path => $perl_path,
+ args => \$args,
+ verbose => $verbose,
+ );
+ push(@procs, $proc);
+ }
+
+ foreach my $proc (@procs) {
+ $proc->kill();
+ }
+
+ print "=" x 60, "\n";
+}
+
+print "kill all and wait for one\n";
+for (1...$loops){
+ use File::Temp qw / tempdir /;
+ my $dir = tempdir( CLEANUP => 1 );
+
+ my @procs;
+ for (1..10){
+
+ my $args= [ "$FindBin::Bin/dummyd.pl", "--vardir=$dir" ];
+ my $proc= My::SafeProcess->new
+ (
+ path => $perl_path,
+ args => \$args,
+ verbose => $verbose,
+ );
+ push(@procs, $proc);
+ }
+
+ foreach my $proc (@procs) {
+ $proc->start_kill();
+ }
+
+ foreach my $proc (@procs) {
+ $proc->wait_one();
+ }
+
+ print "=" x 60, "\n";
+}
+
+print "kill all using shutdown without callback\n";
+for (1...$loops){
+ use File::Temp qw / tempdir /;
+ my $dir = tempdir( CLEANUP => 1 );
+
+ my @procs;
+ for (1..10){
+
+ my $args= [ "$FindBin::Bin/dummyd.pl", "--vardir=$dir" ];
+ my $proc= My::SafeProcess->new
+ (
+ path => $perl_path,
+ args => \$args,
+ verbose => $verbose,
+ );
+ push(@procs, $proc);
+ }
+
+ My::SafeProcess::shutdown(2, @procs);
+
+ print "=" x 60, "\n";
+}
+
+print "kill all using shutdown\n";
+for (1...$loops){
+ use File::Temp qw / tempdir /;
+ my $dir = tempdir( CLEANUP => 1 );
+
+ my @procs;
+ for (1..10){
+
+ my $args= [ "$FindBin::Bin/dummyd.pl", "--vardir=$dir" ];
+ my $proc= My::SafeProcess->new
+ (
+ path => $perl_path,
+ args => \$args,
+ verbose => $verbose,
+ shutdown => sub { }, # Does nothing
+ );
+ push(@procs, $proc);
+ }
+
+ My::SafeProcess::shutdown(2, @procs);
+
+ print "=" x 60, "\n";
+}
+
+exit(0);
diff --git a/mysql-test/lib/t/copytree.t b/mysql-test/lib/t/copytree.t
new file mode 100644
index 00000000000..15e4d1a7b1b
--- /dev/null
+++ b/mysql-test/lib/t/copytree.t
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+
+use strict;
+
+use My::File::Path;
+
+use Test::Simple tests => 7;
+use File::Temp qw / tempdir /;
+my $dir = tempdir( CLEANUP => 1 );
+my $testdir="$dir/test";
+my $test_todir="$dir/to";
+
+my $subdir= "$testdir/test1/test2/test3";
+
+#
+# 1. Create, copy and remove a directory structure
+#
+mkpath($subdir);
+ok( -d $subdir, "Check '$subdir' is created");
+
+copytree($testdir, $test_todir);
+ok( -d $test_todir, "Check '$test_todir' is created");
+ok( -d "$test_todir/test1", "Check 'test1' is created");
+ok( -d "$test_todir/test1/test2", "Check 'test2' is created");
+ok( -d "$test_todir/test1/test2/test3", "Check 'test3' is created");
+
+
+rmtree($testdir);
+ok( ! -d $testdir, "Check '$testdir' is gone");
+
+rmtree($test_todir);
+ok( ! -d $test_todir, "Check '$test_todir' is gone");
+
diff --git a/mysql-test/lib/t/dummyd.pl b/mysql-test/lib/t/dummyd.pl
new file mode 100644
index 00000000000..07336e3c2d2
--- /dev/null
+++ b/mysql-test/lib/t/dummyd.pl
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+
+use strict;
+use Getopt::Long;
+use IO::File;
+
+my $vardir;
+my $randie= 0;
+my $sleep= 0;
+GetOptions
+ (
+ # Directory where to write files
+ 'vardir=s' => \$vardir,
+ 'die-randomly' => \$randie,
+ 'sleep=i' => \$sleep,
+ );
+
+die("invalid vardir ") unless defined $vardir and -d $vardir;
+
+my $pid= $$;
+while(1){
+ for my $i (1..64){
+ # Write to file
+ my $name= "$vardir/$pid.$i.tmp";
+ my $F= IO::File->new($name, "w")
+ or warn "$$, Could not open $name: $!" and next;
+ print $F rand($.) for (1..1000);
+ $F->close();
+ sleep($sleep);
+ die "ooops!" if $randie and rand() < 0.0001
+ }
+}
+
+
+exit (0);
+
+
diff --git a/mysql-test/lib/t/rmtree.t b/mysql-test/lib/t/rmtree.t
new file mode 100644
index 00000000000..08c9077d001
--- /dev/null
+++ b/mysql-test/lib/t/rmtree.t
@@ -0,0 +1,52 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+
+use strict;
+
+use My::File::Path;
+
+use Test::Simple tests => 8;
+use File::Temp qw / tempdir /;
+my $dir = tempdir( CLEANUP => 1 );
+my $testdir="$dir/test";
+
+my $subdir= "$testdir/test1/test2/test3";
+
+#
+# 1. Create and remove a directory structure
+#
+mkpath($subdir);
+ok( -d $subdir, "Check '$subdir' is created");
+
+rmtree($testdir);
+ok( ! -d $testdir, "Check '$testdir' is gone");
+
+#
+# 2. Create and remove a directory structure
+# where one directory is chmod to 0000
+#
+mkpath($subdir);
+ok( -d $subdir, "Check '$subdir' is created");
+
+ok( chmod(0000, $subdir) == 1 , "Check one dir was chmoded");
+
+rmtree($testdir);
+ok( ! -d $testdir, "Check '$testdir' is gone");
+
+#
+# 3. Create and remove a directory structure
+# where one file is chmod to 0000
+#
+mkpath($subdir);
+ok( -d $subdir, "Check '$subdir' is created");
+
+my $testfile= "$subdir/test.file";
+open(F, ">", $testfile) or die;
+print F "hello\n";
+close(F);
+
+ok( chmod(0000, $testfile) == 1 , "Check one file was chmoded");
+
+rmtree($testdir);
+ok( ! -d $testdir, "Check '$testdir' is gone");
+
diff --git a/mysql-test/lib/t/testMyConfig.t b/mysql-test/lib/t/testMyConfig.t
new file mode 100755
index 00000000000..da08cb8b4d1
--- /dev/null
+++ b/mysql-test/lib/t/testMyConfig.t
@@ -0,0 +1,131 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+
+use strict;
+use warnings;
+use File::Temp qw / tempdir /;
+my $dir = tempdir( CLEANUP => 1 );
+
+use Test::More qw(no_plan);
+
+BEGIN { use_ok ( "My::Config" ) };
+
+my $test_cnf= "$dir/test.cnf";
+
+# Write test config file
+open(OUT, ">", $test_cnf) or die;
+print $test_cnf, "\n";
+
+print OUT <<EOF
+[mysqld]
+# Comment
+option1=values2
+option2= value4
+option4
+basedir=thebasedir
+[mysqld_1]
+[mysqld_2]
+[mysqld.9]
+[client]
+socket =\tasocketpath
+EOF
+;
+close OUT;
+
+my $config= My::Config->new($test_cnf);
+isa_ok( $config, "My::Config" );
+
+print $config;
+
+ok ( $config->group("mysqld_2"), "group mysqld_2 exists");
+ok ( $config->group("mysqld_1"), "group mysqld_1 exists");
+ok ( $config->group("mysqld.9"), "group mysqld.9 exists");
+ok ( $config->group("mysqld.9")->suffix() eq ".9", "group mysqld.9 has suffix .9");
+
+ok ( $config->group("mysqld"), "group mysqld exists");
+ok ( $config->group("client"), "group client exists");
+ok ( !$config->group("mysqld_3"), "group mysqld_3 does not exist");
+
+ok ( $config->options_in_group("mysqld") == 4, "options in [mysqld] is 4");
+ok ( $config->options_in_group("nonexist") == 0, "options in [nonexist] is 0");
+
+{
+ my @groups= $config->groups();
+ ok(@groups == 5, "5 groups");
+ my $idx= 0;
+ foreach my $name ('mysqld', 'mysqld_1', 'mysqld_2', 'mysqld.9', 'client') {
+ is($groups[$idx++]->name(), $name, "checking groups $idx");
+ }
+}
+
+{
+ my @groups= $config->like("mysqld");
+ ok(@groups == 4, "4 groups like mysqld");
+ my $idx= 0;
+ foreach my $name ('mysqld', 'mysqld_1', 'mysqld_2', 'mysqld.9') {
+ is($groups[$idx++]->name(), $name, "checking like(\"mysqld\") $idx");
+ }
+}
+
+{
+ my @groups= $config->like("not");
+ ok(@groups == 0, "checking like(\"not\")");
+}
+
+is($config->first_like("mysqld_")->name(), "mysqld_1", "first_like");
+
+is( $config->value('mysqld', 'option4'), undef,
+ "mysqld_option4 exists, does not have a value");
+
+ok( $config->exists('mysqld', 'option4'),
+ "mysqld_option4 exists");
+ok( $config->exists('mysqld', 'option2'),
+ "mysqld_option2 exists");
+ok( !$config->exists('mysqld', 'option5'),
+ "mysqld_option5 does not exists");
+
+# Save the config to file
+my $test2_cnf= "$dir/test2.cnf";
+$config->save($test2_cnf);
+
+# read it back and check it's the same
+my $config2= My::Config->new($test2_cnf);
+isa_ok( $config2, "My::Config" );
+is_deeply( \$config, \$config2, "test.cnf is equal to test2.cnf");
+
+
+my $test_include_cnf= "$dir/test_include.cnf";
+# Write test config file that includes test.cnf
+open(OUT, ">", $test_include_cnf) or die;
+
+print OUT <<EOF
+[mysqld]
+!include test.cnf
+# Comment
+option1=values3
+basedir=anotherbasedir
+EOF
+;
+close OUT;
+
+# Read the config file
+my $config3= My::Config->new($test_include_cnf);
+isa_ok( $config3, "My::Config" );
+print $config3;
+is( $config3->value('mysqld', 'basedir'), 'anotherbasedir',
+ "mysqld_basedir has been overriden by value in test_include.cnf");
+
+is( $config3->value('mysqld', 'option1'), 'values3',
+ "mysqld_option1 has been overriden by value in test_include.cnf");
+
+is( $config3->value('mysqld', 'option2'), 'value4',
+ "mysqld_option2 is from included file");
+
+is( $config3->value('client', 'socket'), 'asocketpath',
+ "client.socket is from included file");
+
+is( $config3->value('mysqld', 'option4'), undef,
+ "mysqld_option4 exists, does not have a value");
+
+print "$config3\n";
+
diff --git a/mysql-test/lib/t/testMyConfigFactory.t b/mysql-test/lib/t/testMyConfigFactory.t
new file mode 100755
index 00000000000..16fdd9db539
--- /dev/null
+++ b/mysql-test/lib/t/testMyConfigFactory.t
@@ -0,0 +1,98 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+
+use strict;
+use warnings;
+
+use File::Temp qw / tempdir /;
+my $dir = tempdir( CLEANUP => 1 );
+
+use Test::More qw(no_plan);
+
+BEGIN { use_ok ( "My::ConfigFactory" ) };
+
+my $gen1_cnf= "$dir/gen1.cnf";
+open(OUT, ">", $gen1_cnf) or die;
+
+print OUT <<EOF
+[mysqld.master]
+# Comment
+option1=value1
+basedir=abasedir
+
+[mysqld.1]
+# Comment
+option1=value1
+option2=value2
+
+[ENV]
+MASTER_MY_PORT=\@mysqld.master.port
+
+EOF
+;
+close OUT;
+
+my $basedir= "../..";
+
+my $config= My::ConfigFactory->new_config
+(
+ {
+ basedir => $basedir,
+ template_path => $gen1_cnf,
+ vardir => "/path/to/var",
+ baseport => 10987,
+ #hosts => [ 'host1', 'host2' ],
+ }
+);
+
+print $config;
+
+ok ( $config->group("mysqld.master"), "group mysqld.master exists");
+ok ( $config->group("mysqld.1"), "group mysqld.1 exists");
+ok ( $config->group("client"), "group client exists");
+ok ( !$config->group("mysqld.3"), "group mysqld.3 does not exist");
+
+ok ( $config->first_like("mysqld"), "group like 'mysqld' exists");
+
+is( $config->value('mysqld.1', '#host'), 'localhost',
+ "mysqld.1.#host has been generated");
+
+is( $config->value('client', 'host'), 'localhost',
+ "client.host has been generated");
+
+is( $config->value('client', 'host'),
+ $config->value('mysqld.master', '#host'),
+ "client.host is same as mysqld.master.host");
+
+ok ( $config->value("mysqld.1", 'character-sets-dir') =~ /$basedir.*charsets$/,
+ "'character-sets-dir' generated");
+
+ok ( $config->value("mysqld.1", 'language') =~ /$basedir.*english$/,
+ "'language' generated");
+
+ok ( $config->value("ENV", 'MASTER_MY_PORT') =~ /\d/,
+ "'language' generated");
+
+my $gen2_cnf= "$dir/gen2.cnf";
+open(OUT, ">", $gen2_cnf) or die;
+
+print OUT <<EOF
+[mysqld.master]
+EOF
+;
+close OUT;
+
+my $config2= My::ConfigFactory->new_config
+(
+ {
+ basedir => $basedir,
+ template_path => $gen2_cnf,
+ vardir => "/path/to/var",
+ baseport => 10987,
+ #hosts => [ 'host1', 'host2' ],
+ }
+);
+
+print $config2;
+
+ok ( $config2->first_like("mysqld"), "group like 'mysqld' exists");
diff --git a/mysql-test/lib/t/test_child.pl b/mysql-test/lib/t/test_child.pl
new file mode 100755
index 00000000000..99f4e68003d
--- /dev/null
+++ b/mysql-test/lib/t/test_child.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+
+use strict;
+use Getopt::Long;
+
+my $opt_exit_code= 0;
+
+GetOptions
+ (
+ # Exit with the specified exit code
+ 'exit-code=i' => \$opt_exit_code
+ );
+
+
+print "Hello stdout\n";
+print STDERR "Hello stderr\n";
+
+exit ($opt_exit_code);
+
+
diff --git a/mysql-test/lib/v1/My/Config.pm b/mysql-test/lib/v1/My/Config.pm
new file mode 100644
index 00000000000..5491e341ddc
--- /dev/null
+++ b/mysql-test/lib/v1/My/Config.pm
@@ -0,0 +1,422 @@
+# -*- cperl -*-
+
+package My::Config::Option;
+
+use strict;
+use warnings;
+
+
+sub new {
+ my ($class, $option_name, $option_value)= @_;
+ my $self= bless { name => $option_name,
+ value => $option_value
+ }, $class;
+ return $self;
+}
+
+
+sub name {
+ my ($self)= @_;
+ return $self->{name};
+}
+
+
+sub value {
+ my ($self)= @_;
+ return $self->{value};
+}
+
+
+package My::Config::Group;
+
+use strict;
+use warnings;
+
+
+sub new {
+ my ($class, $group_name)= @_;
+ my $self= bless { name => $group_name,
+ options => [],
+ options_by_name => {},
+ }, $class;
+ return $self;
+}
+
+
+sub insert {
+ my ($self, $option_name, $value, $if_not_exist)= @_;
+ my $option= $self->option($option_name);
+ if (defined($option) and !$if_not_exist) {
+ $option->{value}= $value;
+ }
+ else {
+ my $option= My::Config::Option->new($option_name, $value);
+ # Insert option in list
+ push(@{$self->{options}}, $option);
+ # Insert option in hash
+ $self->{options_by_name}->{$option_name}= $option;
+ }
+ return $option;
+}
+
+sub remove {
+ my ($self, $option_name)= @_;
+
+ # Check that option exists
+ my $option= $self->option($option_name);
+
+ return undef unless defined $option;
+
+ # Remove from the hash
+ delete($self->{options_by_name}->{$option_name}) or die;
+
+ # Remove from the array
+ @{$self->{options}}= grep { $_->name ne $option_name } @{$self->{options}};
+
+ return $option;
+}
+
+
+sub options {
+ my ($self)= @_;
+ return @{$self->{options}};
+}
+
+
+sub name {
+ my ($self)= @_;
+ return $self->{name};
+}
+
+
+#
+# Return a specific option in the group
+#
+sub option {
+ my ($self, $option_name)= @_;
+
+ return $self->{options_by_name}->{$option_name};
+}
+
+
+#
+# Return a specific value for an option in the group
+#
+sub value {
+ my ($self, $option_name)= @_;
+ my $option= $self->option($option_name);
+
+ die "No option named '$option_name' in this group"
+ if ! defined($option);
+
+ return $option->value();
+}
+
+
+package My::Config;
+
+use strict;
+use warnings;
+use IO::File;
+use File::Basename;
+
+#
+# Constructor for My::Config
+# - represents a my.cnf config file
+#
+# Array of arrays
+#
+sub new {
+ my ($class, $path)= @_;
+ my $group_name= undef;
+
+ my $self= bless { groups => [] }, $class;
+ my $F= IO::File->new($path, "<")
+ or die "Could not open '$path': $!";
+
+ while ( my $line= <$F> ) {
+ chomp($line);
+
+ # [group]
+ if ( $line =~ /\[(.*)\]/ ) {
+ # New group found
+ $group_name= $1;
+ #print "group: $group_name\n";
+
+ $self->insert($group_name, undef, undef);
+ }
+
+ # Magic #! comments
+ elsif ( $line =~ /^#\!/) {
+ my $magic= $line;
+ die "Found magic comment '$magic' outside of group"
+ unless $group_name;
+
+ #print "$magic\n";
+ $self->insert($group_name, $magic, undef);
+ }
+
+ # Comments
+ elsif ( $line =~ /^#/ || $line =~ /^;/) {
+ # Skip comment
+ next;
+ }
+
+ # Empty lines
+ elsif ( $line =~ /^$/ ) {
+ # Skip empty lines
+ next;
+ }
+
+ # !include <filename>
+ elsif ( $line =~ /^\!include\s*(.*?)\s*$/ ) {
+ my $include_file_name= dirname($path)."/".$1;
+ # Check that the file exists
+ die "The include file '$include_file_name' does not exist"
+ unless -f $include_file_name;
+
+ $self->append(My::Config->new($include_file_name));
+ }
+
+ # <option>
+ elsif ( $line =~ /^([\@\w-]+)\s*$/ ) {
+ my $option= $1;
+
+ die "Found option '$option' outside of group"
+ unless $group_name;
+
+ #print "$option\n";
+ $self->insert($group_name, $option, undef);
+ }
+
+ # <option>=<value>
+ elsif ( $line =~ /^([\@\w-]+)\s*=\s*(.*?)\s*$/ ) {
+ my $option= $1;
+ my $value= $2;
+
+ die "Found option '$option=$value' outside of group"
+ unless $group_name;
+
+ #print "$option=$value\n";
+ $self->insert($group_name, $option, $value);
+ } else {
+ die "Unexpected line '$line' found in '$path'";
+ }
+
+ }
+ undef $F; # Close the file
+
+ return $self;
+}
+
+#
+# Insert a new group if it does not already exist
+# and add option if defined
+#
+sub insert {
+ my ($self, $group_name, $option, $value, $if_not_exist)= @_;
+ my $group;
+
+ # Create empty array for the group if it doesn't exist
+ if ( !$self->group_exists($group_name) ) {
+ $group= $self->_group_insert($group_name);
+ }
+ else {
+ $group= $self->group($group_name);
+ }
+
+ if ( defined $option ) {
+ #print "option: $option, value: $value\n";
+
+ # Add the option to the group
+ $group->insert($option, $value, $if_not_exist);
+ }
+}
+
+#
+# Remove a option, given group and option name
+#
+sub remove {
+ my ($self, $group_name, $option_name)= @_;
+ my $group= $self->group($group_name);
+
+ die "group '$group_name' does not exist"
+ unless defined($group);
+
+ $group->remove($option_name) or
+ die "option '$option_name' does not exist";
+}
+
+
+
+#
+# Check if group with given name exists in config
+#
+sub group_exists {
+ my ($self, $group_name)= @_;
+
+ foreach my $group ($self->groups()) {
+ return 1 if $group->{name} eq $group_name;
+ }
+ return 0;
+}
+
+
+#
+# Insert a new group into config
+#
+sub _group_insert {
+ my ($self, $group_name)= @_;
+ caller eq __PACKAGE__ or die;
+
+ # Check that group does not already exist
+ die "Group already exists" if $self->group_exists($group_name);
+
+ my $group= My::Config::Group->new($group_name);
+ push(@{$self->{groups}}, $group);
+ return $group;
+}
+
+
+#
+# Append a configuration to current config
+#
+sub append {
+ my ($self, $from)= @_;
+
+ foreach my $group ($from->groups()) {
+ foreach my $option ($group->options()) {
+ $self->insert($group->name(), $option->name(), $option->value());
+ }
+
+ }
+}
+
+
+#
+# Return a list with all the groups in config
+#
+sub groups {
+ my ($self)= @_;
+ return ( @{$self->{groups}} );
+}
+
+
+#
+# Return a list of all the groups in config
+# starting with the given string
+#
+sub like {
+ my ($self, $prefix)= @_;
+ return ( grep ( $_->{name} =~ /^$prefix/, $self->groups()) );
+}
+
+
+#
+# Return the first group in config
+# starting with the given string
+#
+sub first_like {
+ my ($self, $prefix)= @_;
+ return ($self->like($prefix))[0];
+}
+
+
+#
+# Return a specific group in the config
+#
+sub group {
+ my ($self, $group_name)= @_;
+
+ foreach my $group ( $self->groups() ) {
+ return $group if $group->{name} eq $group_name;
+ }
+ return undef;
+}
+
+
+#
+# Return a list of all options in a specific group in the config
+#
+sub options_in_group {
+ my ($self, $group_name)= @_;
+
+ my $group= $self->group($group_name);
+ return () unless defined $group;
+ return $group->options();
+}
+
+
+#
+# Return a value given group and option name
+#
+sub value {
+ my ($self, $group_name, $option_name)= @_;
+ my $group= $self->group($group_name);
+
+ die "group '$group_name' does not exist"
+ unless defined($group);
+
+ my $option= $group->option($option_name);
+ die "option '$option_name' does not exist"
+ unless defined($option);
+
+ return $option->value();
+}
+
+
+#
+# Check if an option exists
+#
+sub exists {
+ my ($self, $group_name, $option_name)= @_;
+ my $group= $self->group($group_name);
+
+ die "group '$group_name' does not exist"
+ unless defined($group);
+
+ my $option= $group->option($option_name);
+ return defined($option);
+}
+
+
+# Overload "to string"-operator with 'stringify'
+use overload
+ '""' => \&stringify;
+
+#
+# Return the config as a string in my.cnf file format
+#
+sub stringify {
+ my ($self)= @_;
+ my $res;
+
+ foreach my $group ($self->groups()) {
+ $res .= "[$group->{name}]\n";
+
+ foreach my $option ($group->options()) {
+ $res .= $option->name();
+ my $value= $option->value();
+ if (defined $value) {
+ $res .= "=$value";
+ }
+ $res .= "\n";
+ }
+ $res .= "\n";
+ }
+ return $res;
+}
+
+
+#
+# Save the config to named file
+#
+sub save {
+ my ($self, $path)= @_;
+ my $F= IO::File->new($path, ">")
+ or die "Could not open '$path': $!";
+ print $F $self;
+ undef $F; # Close the file
+}
+
+1;
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/v1/mtr_cases.pl
index 3b47a89d3d2..4d7b1f4ec70 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/v1/mtr_cases.pl
@@ -369,7 +369,7 @@ sub collect_one_suite($)
my $comb= {};
$comb->{name}= $group->name();
foreach my $option ( $group->options() ) {
- push(@{$comb->{comb_opt}}, $option->name()."=".$option->value());
+ push(@{$comb->{comb_opt}}, "--".$option->name()."=".$option->value());
}
push(@combinations, $comb);
}
diff --git a/mysql-test/lib/v1/mtr_gcov.pl b/mysql-test/lib/v1/mtr_gcov.pl
new file mode 100644
index 00000000000..a2de1fcbdff
--- /dev/null
+++ b/mysql-test/lib/v1/mtr_gcov.pl
@@ -0,0 +1,74 @@
+# -*- cperl -*-
+# Copyright (C) 2004, 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+use strict;
+
+# These are not to be prefixed with "mtr_"
+
+sub gcov_prepare ();
+sub gcov_collect ();
+
+##############################################################################
+#
+#
+#
+##############################################################################
+
+sub gcov_prepare () {
+
+ `find $::glob_basedir -name \*.gcov \
+ -or -name \*.da | xargs rm`;
+}
+
+# Used by gcov
+our @mysqld_src_dirs=
+ (
+ "strings",
+ "mysys",
+ "include",
+ "extra",
+ "regex",
+ "isam",
+ "merge",
+ "myisam",
+ "myisammrg",
+ "heap",
+ "sql",
+ );
+
+sub gcov_collect () {
+
+ print "Collecting source coverage info...\n";
+ -f $::opt_gcov_msg and unlink($::opt_gcov_msg);
+ -f $::opt_gcov_err and unlink($::opt_gcov_err);
+ foreach my $d ( @mysqld_src_dirs )
+ {
+ chdir("$::glob_basedir/$d");
+ foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) )
+ {
+ `$::opt_gcov $f 2>>$::opt_gcov_err >>$::opt_gcov_msg`;
+ }
+ chdir($::glob_mysql_test_dir);
+ }
+ print "gcov info in $::opt_gcov_msg, errors in $::opt_gcov_err\n";
+}
+
+
+1;
diff --git a/mysql-test/lib/v1/mtr_gprof.pl b/mysql-test/lib/v1/mtr_gprof.pl
new file mode 100644
index 00000000000..f6615301dd7
--- /dev/null
+++ b/mysql-test/lib/v1/mtr_gprof.pl
@@ -0,0 +1,64 @@
+# -*- cperl -*-
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+use strict;
+
+# These are not to be prefixed with "mtr_"
+
+sub gprof_prepare ();
+sub gprof_collect ();
+
+##############################################################################
+#
+#
+#
+##############################################################################
+
+sub gprof_prepare () {
+
+ rmtree($::opt_gprof_dir);
+ mkdir($::opt_gprof_dir);
+}
+
+# FIXME what about master1 and slave1?!
+sub gprof_collect () {
+
+ if ( -f "$::master->[0]->{'path_myddir'}/gmon.out" )
+ {
+ # FIXME check result code?!
+ mtr_run("gprof",
+ [$::exe_master_mysqld,
+ "$::master->[0]->{'path_myddir'}/gmon.out"],
+ $::opt_gprof_master, "", "", "");
+ print "Master execution profile has been saved in $::opt_gprof_master\n";
+ }
+ if ( -f "$::slave->[0]->{'path_myddir'}/gmon.out" )
+ {
+ # FIXME check result code?!
+ mtr_run("gprof",
+ [$::exe_slave_mysqld,
+ "$::slave->[0]->{'path_myddir'}/gmon.out"],
+ $::opt_gprof_slave, "", "", "");
+ print "Slave execution profile has been saved in $::opt_gprof_slave\n";
+ }
+}
+
+
+1;
diff --git a/mysql-test/lib/mtr_im.pl b/mysql-test/lib/v1/mtr_im.pl
index c8e332498d7..c8e332498d7 100644
--- a/mysql-test/lib/mtr_im.pl
+++ b/mysql-test/lib/v1/mtr_im.pl
diff --git a/mysql-test/lib/v1/mtr_io.pl b/mysql-test/lib/v1/mtr_io.pl
new file mode 100644
index 00000000000..aa671c0f4f7
--- /dev/null
+++ b/mysql-test/lib/v1/mtr_io.pl
@@ -0,0 +1,218 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+use strict;
+
+sub mtr_get_pid_from_file ($);
+sub mtr_get_opts_from_file ($);
+sub mtr_fromfile ($);
+sub mtr_tofile ($@);
+sub mtr_tonewfile($@);
+sub mtr_lastlinefromfile($);
+sub mtr_appendfile_to_file ($$);
+sub mtr_grab_file($);
+
+
+##############################################################################
+#
+#
+#
+##############################################################################
+
+sub mtr_get_pid_from_file ($) {
+ my $pid_file_path= shift;
+ my $TOTAL_ATTEMPTS= 30;
+ my $timeout= 1;
+
+ # We should read from the file until we get correct pid. As it is
+ # stated in BUG#21884, pid file can be empty at some moment. So, we should
+ # read it until we get valid data.
+
+ for (my $cur_attempt= 1; $cur_attempt <= $TOTAL_ATTEMPTS; ++$cur_attempt)
+ {
+ mtr_debug("Reading pid file '$pid_file_path' " .
+ "($cur_attempt of $TOTAL_ATTEMPTS)...");
+
+ open(FILE, '<', $pid_file_path)
+ or mtr_error("can't open file \"$pid_file_path\": $!");
+
+ # Read pid number from file
+ my $pid= <FILE>;
+ chomp $pid;
+ close FILE;
+
+ return $pid if $pid=~ /^(\d+)/;
+
+ mtr_debug("Pid file '$pid_file_path' does not yet contain pid number.\n" .
+ "Sleeping $timeout second(s) more...");
+
+ sleep($timeout);
+ }
+
+ mtr_error("Pid file '$pid_file_path' is corrupted. " .
+ "Can not retrieve PID in " .
+ ($timeout * $TOTAL_ATTEMPTS) . " seconds.");
+}
+
+sub mtr_get_opts_from_file ($) {
+ my $file= shift;
+
+ open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
+ my @args;
+ while ( <FILE> )
+ {
+ chomp;
+
+ # --set-variable=init_connect=set @a='a\\0c'
+ s/^\s+//; # Remove leading space
+ s/\s+$//; # Remove ending space
+
+ # This is strange, but we need to fill whitespace inside
+ # quotes with something, to remove later. We do this to
+ # be able to split on space. Else, we have trouble with
+ # options like
+ #
+ # --someopt="--insideopt1 --insideopt2"
+ #
+ # But still with this, we are not 100% sure it is right,
+ # we need a shell to do it right.
+
+# print STDERR "\n";
+# print STDERR "AAA: $_\n";
+
+ s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge;
+ s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge;
+ s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge;
+ s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge;
+
+# print STDERR "BBB: $_\n";
+
+# foreach my $arg (/(--?\w.*?)(?=\s+--?\w|$)/)
+
+ # FIXME ENV vars should be expanded!!!!
+
+ foreach my $arg (split(/[ \t]+/))
+ {
+ $arg =~ tr/\x11\x0a\x0b/ \'\"/; # Put back real chars
+ # The outermost quotes has to go
+ $arg =~ s/^([^\'\"]*)\'(.*)\'([^\'\"]*)$/$1$2$3/
+ or $arg =~ s/^([^\'\"]*)\"(.*)\"([^\'\"]*)$/$1$2$3/;
+ $arg =~ s/\\\\/\\/g;
+
+ $arg =~ s/\$\{(\w+)\}/envsubst($1)/ge;
+ $arg =~ s/\$(\w+)/envsubst($1)/ge;
+
+# print STDERR "ARG: $arg\n";
+ # Do not pass empty string since my_getopt is not capable to handle it.
+ if (length($arg))
+ {
+ push(@args, $arg)
+ }
+ }
+ }
+ close FILE;
+ return \@args;
+}
+
+sub envsubst {
+ my $string= shift;
+
+ if ( ! defined $ENV{$string} )
+ {
+ mtr_error("opt file referense \$$string that is unknown");
+ }
+
+ return $ENV{$string};
+}
+
+sub unspace {
+ my $string= shift;
+ my $quote= shift;
+ $string =~ s/[ \t]/\x11/g;
+ return "$quote$string$quote";
+}
+
+# Read a whole file, stripping leading and trailing whitespace.
+sub mtr_fromfile ($) {
+ my $file= shift;
+
+ open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
+ my $text= join('', <FILE>);
+ close FILE;
+ $text =~ s/^\s+//; # Remove starting space, incl newlines
+ $text =~ s/\s+$//; # Remove ending space, incl newlines
+ return $text;
+}
+
+sub mtr_lastlinefromfile ($) {
+ my $file= shift;
+ my $text;
+
+ open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
+ while (my $line= <FILE>)
+ {
+ $text= $line;
+ }
+ close FILE;
+ return $text;
+}
+
+
+sub mtr_tofile ($@) {
+ my $file= shift;
+
+ open(FILE,">>",$file) or mtr_error("can't open file \"$file\": $!");
+ print FILE join("", @_);
+ close FILE;
+}
+
+sub mtr_tonewfile ($@) {
+ my $file= shift;
+
+ open(FILE,">",$file) or mtr_error("can't open file \"$file\": $!");
+ print FILE join("", @_);
+ close FILE;
+}
+
+sub mtr_appendfile_to_file ($$) {
+ my $from_file= shift;
+ my $to_file= shift;
+
+ open(TOFILE,">>",$to_file) or mtr_error("can't open file \"$to_file\": $!");
+ open(FROMFILE,"<",$from_file)
+ or mtr_error("can't open file \"$from_file\": $!");
+ print TOFILE while (<FROMFILE>);
+ close FROMFILE;
+ close TOFILE;
+}
+
+# Read a whole file verbatim.
+sub mtr_grab_file($) {
+ my $file= shift;
+ open(FILE, '<', $file)
+ or return undef;
+ local $/= undef;
+ my $data= scalar(<FILE>);
+ close FILE;
+ return $data;
+}
+
+
+1;
diff --git a/mysql-test/lib/mtr_match.pl b/mysql-test/lib/v1/mtr_match.pl
index 96aa43f4fa2..96aa43f4fa2 100644
--- a/mysql-test/lib/mtr_match.pl
+++ b/mysql-test/lib/v1/mtr_match.pl
diff --git a/mysql-test/lib/v1/mtr_misc.pl b/mysql-test/lib/v1/mtr_misc.pl
new file mode 100644
index 00000000000..0173e8b8572
--- /dev/null
+++ b/mysql-test/lib/v1/mtr_misc.pl
@@ -0,0 +1,312 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+use strict;
+use File::Find;
+
+sub mtr_native_path($);
+sub mtr_init_args ($);
+sub mtr_add_arg ($$@);
+sub mtr_path_exists(@);
+sub mtr_script_exists(@);
+sub mtr_file_exists(@);
+sub mtr_exe_exists(@);
+sub mtr_exe_maybe_exists(@);
+sub mtr_copy_dir($$);
+sub mtr_rmtree($);
+sub mtr_same_opts($$);
+sub mtr_cmp_opts($$);
+
+##############################################################################
+#
+# Misc
+#
+##############################################################################
+
+# Convert path to OS native format
+sub mtr_native_path($)
+{
+ my $path= shift;
+
+ # MySQL version before 5.0 still use cygwin, no need
+ # to convert path
+ return $path
+ if ($::mysql_version_id < 50000);
+
+ $path=~ s/\//\\/g
+ if ($::glob_win32);
+ return $path;
+}
+
+
+# FIXME move to own lib
+
+sub mtr_init_args ($) {
+ my $args = shift;
+ $$args = []; # Empty list
+}
+
+sub mtr_add_arg ($$@) {
+ my $args= shift;
+ my $format= shift;
+ my @fargs = @_;
+
+ push(@$args, sprintf($format, @fargs));
+}
+
+##############################################################################
+
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
+sub mtr_path_exists (@) {
+ foreach my $path ( @_ )
+ {
+ return $path if -e $path;
+ }
+ if ( @_ == 1 )
+ {
+ mtr_error("Could not find $_[0]");
+ }
+ else
+ {
+ mtr_error("Could not find any of " . join(" ", @_));
+ }
+}
+
+
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
+sub mtr_script_exists (@) {
+ foreach my $path ( @_ )
+ {
+ if($::glob_win32)
+ {
+ return $path if -f $path;
+ }
+ else
+ {
+ return $path if -x $path;
+ }
+ }
+ if ( @_ == 1 )
+ {
+ mtr_error("Could not find $_[0]");
+ }
+ else
+ {
+ mtr_error("Could not find any of " . join(" ", @_));
+ }
+}
+
+
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
+sub mtr_file_exists (@) {
+ foreach my $path ( @_ )
+ {
+ return $path if -e $path;
+ }
+ return "";
+}
+
+
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
+sub mtr_exe_maybe_exists (@) {
+ my @path= @_;
+
+ map {$_.= ".exe"} @path if $::glob_win32;
+ map {$_.= ".nlm"} @path if $::glob_netware;
+ foreach my $path ( @path )
+ {
+ if($::glob_win32)
+ {
+ return $path if -f $path;
+ }
+ else
+ {
+ return $path if -x $path;
+ }
+ }
+ return "";
+}
+
+
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
+sub mtr_exe_exists (@) {
+ my @path= @_;
+ if (my $path= mtr_exe_maybe_exists(@path))
+ {
+ return $path;
+ }
+ # Could not find exe, show error
+ if ( @path == 1 )
+ {
+ mtr_error("Could not find $path[0]");
+ }
+ else
+ {
+ mtr_error("Could not find any of " . join(" ", @path));
+ }
+}
+
+
+sub mtr_copy_dir($$) {
+ my $from_dir= shift;
+ my $to_dir= shift;
+
+ # mtr_verbose("Copying from $from_dir to $to_dir");
+
+ mkpath("$to_dir");
+ opendir(DIR, "$from_dir")
+ or mtr_error("Can't find $from_dir$!");
+ for(readdir(DIR)) {
+ next if "$_" eq "." or "$_" eq "..";
+ if ( -d "$from_dir/$_" )
+ {
+ mtr_copy_dir("$from_dir/$_", "$to_dir/$_");
+ next;
+ }
+ copy("$from_dir/$_", "$to_dir/$_");
+ }
+ closedir(DIR);
+
+}
+
+
+sub mtr_rmtree($) {
+ my ($dir)= @_;
+ mtr_verbose("mtr_rmtree: $dir");
+
+ # Try to use File::Path::rmtree. Recent versions
+ # handles removal of directories and files that don't
+ # have full permissions, while older versions
+ # may have a problem with that and we use our own version
+
+ eval { rmtree($dir); };
+ if ( $@ ) {
+ mtr_warning("rmtree($dir) failed, trying with File::Find...");
+
+ my $errors= 0;
+
+ # chmod
+ find( {
+ no_chdir => 1,
+ wanted => sub {
+ chmod(0777, $_)
+ or mtr_warning("couldn't chmod(0777, $_): $!") and $errors++;
+ }
+ },
+ $dir
+ );
+
+ # rm
+ finddepth( {
+ no_chdir => 1,
+ wanted => sub {
+ my $file= $_;
+ # Use special underscore (_) filehandle, caches stat info
+ if (!-l $file and -d _ ) {
+ rmdir($file) or
+ mtr_warning("couldn't rmdir($file): $!") and $errors++;
+ } else {
+ unlink($file)
+ or mtr_warning("couldn't unlink($file): $!") and $errors++;
+ }
+ }
+ },
+ $dir
+ );
+
+ mtr_error("Failed to remove '$dir'") if $errors;
+
+ mtr_report("OK, that worked!");
+ }
+}
+
+
+sub mtr_same_opts ($$) {
+ my $l1= shift;
+ my $l2= shift;
+ return mtr_cmp_opts($l1,$l2) == 0;
+}
+
+sub mtr_cmp_opts ($$) {
+ my $l1= shift;
+ my $l2= shift;
+
+ my @l1= @$l1;
+ my @l2= @$l2;
+
+ return -1 if @l1 < @l2;
+ return 1 if @l1 > @l2;
+
+ while ( @l1 ) # Same length
+ {
+ my $e1= shift @l1;
+ my $e2= shift @l2;
+ my $cmp= ($e1 cmp $e2);
+ return $cmp if $cmp != 0;
+ }
+
+ return 0; # They are the same
+}
+
+#
+# Compare two arrays and put all unequal elements into a new one
+#
+sub mtr_diff_opts ($$) {
+ my $l1= shift;
+ my $l2= shift;
+ my $f;
+ my $l= [];
+ foreach my $e1 (@$l1)
+ {
+ $f= undef;
+ foreach my $e2 (@$l2)
+ {
+ $f= 1 unless ($e1 ne $e2);
+ }
+ push(@$l, $e1) unless (defined $f);
+ }
+ foreach my $e2 (@$l2)
+ {
+ $f= undef;
+ foreach my $e1 (@$l1)
+ {
+ $f= 1 unless ($e1 ne $e2);
+ }
+ push(@$l, $e2) unless (defined $f);
+ }
+ return $l;
+}
+
+1;
diff --git a/mysql-test/lib/v1/mtr_process.pl b/mysql-test/lib/v1/mtr_process.pl
new file mode 100644
index 00000000000..8fd900330da
--- /dev/null
+++ b/mysql-test/lib/v1/mtr_process.pl
@@ -0,0 +1,1142 @@
+# -*- cperl -*-
+# Copyright (C) 2004-2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+use Socket;
+use Errno;
+use strict;
+
+use POSIX qw(WNOHANG SIGHUP);
+
+sub mtr_run ($$$$$$;$);
+sub mtr_spawn ($$$$$$;$);
+sub mtr_check_stop_servers ($);
+sub mtr_kill_leftovers ();
+sub mtr_wait_blocking ($);
+sub mtr_record_dead_children ();
+sub mtr_ndbmgm_start($$);
+sub mtr_mysqladmin_start($$$);
+sub mtr_exit ($);
+sub sleep_until_file_created ($$$);
+sub mtr_kill_processes ($);
+sub mtr_ping_with_timeout($);
+sub mtr_ping_port ($);
+
+# Local function
+sub spawn_impl ($$$$$$$);
+
+##############################################################################
+#
+# Execute an external command
+#
+##############################################################################
+
+sub mtr_run ($$$$$$;$) {
+ my $path= shift;
+ my $arg_list_t= shift;
+ my $input= shift;
+ my $output= shift;
+ my $error= shift;
+ my $pid_file= shift; # Not used
+ my $spawn_opts= shift;
+
+ return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,
+ $spawn_opts);
+}
+
+sub mtr_run_test ($$$$$$;$) {
+ my $path= shift;
+ my $arg_list_t= shift;
+ my $input= shift;
+ my $output= shift;
+ my $error= shift;
+ my $pid_file= shift; # Not used
+ my $spawn_opts= shift;
+
+ return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,
+ $spawn_opts);
+}
+
+sub mtr_spawn ($$$$$$;$) {
+ my $path= shift;
+ my $arg_list_t= shift;
+ my $input= shift;
+ my $output= shift;
+ my $error= shift;
+ my $pid_file= shift; # Not used
+ my $spawn_opts= shift;
+
+ return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,
+ $spawn_opts);
+}
+
+
+
+sub spawn_impl ($$$$$$$) {
+ my $path= shift;
+ my $arg_list_t= shift;
+ my $mode= shift;
+ my $input= shift;
+ my $output= shift;
+ my $error= shift;
+ my $spawn_opts= shift;
+
+ if ( $::opt_script_debug )
+ {
+ mtr_report("");
+ mtr_debug("-" x 73);
+ mtr_debug("STDIN $input") if $input;
+ mtr_debug("STDOUT $output") if $output;
+ mtr_debug("STDERR $error") if $error;
+ mtr_debug("$mode: $path ", join(" ",@$arg_list_t));
+ mtr_debug("spawn options:");
+ if ($spawn_opts)
+ {
+ foreach my $key (sort keys %{$spawn_opts})
+ {
+ mtr_debug(" - $key: $spawn_opts->{$key}");
+ }
+ }
+ else
+ {
+ mtr_debug(" none");
+ }
+ mtr_debug("-" x 73);
+ mtr_report("");
+ }
+
+ mtr_error("Can't spawn with empty \"path\"") unless defined $path;
+
+
+ FORK:
+ {
+ my $pid= fork();
+
+ if ( ! defined $pid )
+ {
+ if ( $! == $!{EAGAIN} ) # See "perldoc Errno"
+ {
+ mtr_warning("Got EAGAIN from fork(), sleep 1 second and redo");
+ sleep(1);
+ redo FORK;
+ }
+
+ mtr_error("$path ($pid) can't be forked, error: $!");
+
+ }
+
+ if ( $pid )
+ {
+ select(STDOUT) if $::glob_win32_perl;
+ return spawn_parent_impl($pid,$mode,$path);
+ }
+ else
+ {
+ # Child, redirect output and exec
+
+ $SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't
+
+ my $log_file_open_mode = '>';
+
+ if ($spawn_opts and $spawn_opts->{'append_log_file'})
+ {
+ $log_file_open_mode = '>>';
+ }
+
+ if ( $output )
+ {
+ if ( $::glob_win32_perl )
+ {
+ # Don't redirect stdout on ActiveState perl since this is
+ # just another thread in the same process.
+ }
+ elsif ( ! open(STDOUT,$log_file_open_mode,$output) )
+ {
+ mtr_child_error("can't redirect STDOUT to \"$output\": $!");
+ }
+ }
+
+ if ( $error )
+ {
+ if ( !$::glob_win32_perl and $output eq $error )
+ {
+ if ( ! open(STDERR,">&STDOUT") )
+ {
+ mtr_child_error("can't dup STDOUT: $!");
+ }
+ }
+ else
+ {
+ if ( ! open(STDERR,$log_file_open_mode,$error) )
+ {
+ mtr_child_error("can't redirect STDERR to \"$error\": $!");
+ }
+ }
+ }
+
+ if ( $input )
+ {
+ if ( ! open(STDIN,"<",$input) )
+ {
+ mtr_child_error("can't redirect STDIN to \"$input\": $!");
+ }
+ }
+
+ if ( ! exec($path,@$arg_list_t) )
+ {
+ mtr_child_error("failed to execute \"$path\": $!");
+ }
+ mtr_error("Should never come here 1!");
+ }
+ mtr_error("Should never come here 2!");
+ }
+ mtr_error("Should never come here 3!");
+}
+
+
+sub spawn_parent_impl {
+ my $pid= shift;
+ my $mode= shift;
+ my $path= shift;
+
+ if ( $mode eq 'run' or $mode eq 'test' )
+ {
+ if ( $mode eq 'run' )
+ {
+ # Simple run of command, wait blocking for it to return
+ my $ret_pid= waitpid($pid,0);
+ if ( $ret_pid != $pid )
+ {
+ # The "simple" waitpid has failed, print debug info
+ # and try to handle the error
+ mtr_warning("waitpid($pid, 0) returned $ret_pid " .
+ "when waiting for '$path', error: '$!'");
+ if ( $ret_pid == -1 )
+ {
+ # waitpid returned -1, that would indicate the process
+ # no longer exist and waitpid couldn't wait for it.
+ return 1;
+ }
+ mtr_error("Error handling failed");
+ }
+
+ return mtr_process_exit_status($?);
+ }
+ else
+ {
+ # We run mysqltest and wait for it to return. But we try to
+ # catch dying mysqld processes as well.
+ #
+ # We do blocking waitpid() until we get the return from the
+ # "mysqltest" call. But if a mysqld process dies that we
+ # started, we take this as an error, and kill mysqltest.
+
+
+ my $exit_value= -1;
+ my $saved_exit_value;
+ my $ret_pid; # What waitpid() returns
+
+ while ( ($ret_pid= waitpid(-1,0)) != -1 )
+ {
+ # Someone terminated, don't know who. Collect
+ # status info first before $? is lost,
+ # but not $exit_value, this is flagged from
+
+ my $timer_name= mtr_timer_timeout($::glob_timers, $ret_pid);
+ if ( $timer_name )
+ {
+ if ( $timer_name eq "suite" )
+ {
+ # We give up here
+ # FIXME we should only give up the suite, not all of the run?
+ print STDERR "\n";
+ mtr_error("Test suite timeout");
+ }
+ elsif ( $timer_name eq "testcase" )
+ {
+ $saved_exit_value= 63; # Mark as timeout
+ kill(9, $pid); # Kill mysqltest
+ next; # Go on and catch the termination
+ }
+ }
+
+ if ( $ret_pid == $pid )
+ {
+ # We got termination of mysqltest, we are done
+ $exit_value= mtr_process_exit_status($?);
+ last;
+ }
+
+ # One of the child processes died, unless this was expected
+ # mysqltest should be killed and test aborted
+
+ check_expected_crash_and_restart($ret_pid);
+ }
+
+ if ( $ret_pid != $pid )
+ {
+ # We terminated the waiting because a "mysqld" process died.
+ # Kill the mysqltest process.
+ mtr_verbose("Kill mysqltest because another process died");
+ kill(9,$pid);
+
+ $ret_pid= waitpid($pid,0);
+
+ if ( $ret_pid != $pid )
+ {
+ mtr_error("$path ($pid) got lost somehow");
+ }
+ }
+
+ return $saved_exit_value || $exit_value;
+ }
+ }
+ else
+ {
+ # We spawned a process we don't wait for
+ return $pid;
+ }
+}
+
+
+# ----------------------------------------------------------------------
+# We try to emulate how an Unix shell calculates the exit code
+# ----------------------------------------------------------------------
+
+sub mtr_process_exit_status {
+ my $raw_status= shift;
+
+ if ( $raw_status & 127 )
+ {
+ return ($raw_status & 127) + 128; # Signal num + 128
+ }
+ else
+ {
+ return $raw_status >> 8; # Exit code
+ }
+}
+
+
+##############################################################################
+#
+# Kill processes left from previous runs
+#
+##############################################################################
+
+
+# Kill all processes(mysqld, ndbd, ndb_mgmd and im) that would conflict with
+# this run
+# Make sure to remove the PID file, if any.
+# kill IM manager first, else it will restart the servers
+sub mtr_kill_leftovers () {
+
+ mtr_report("Killing Possible Leftover Processes");
+ mtr_debug("mtr_kill_leftovers(): started.");
+
+ my @kill_pids;
+ my %admin_pids;
+
+ foreach my $srv (@{$::master}, @{$::slave})
+ {
+ mtr_debug(" - mysqld " .
+ "(pid: $srv->{pid}; " .
+ "pid file: '$srv->{path_pid}'; " .
+ "socket: '$srv->{path_sock}'; ".
+ "port: $srv->{port})");
+
+ my $pid= mtr_mysqladmin_start($srv, "shutdown", 20);
+
+ # Save the pid of the mysqladmin process
+ $admin_pids{$pid}= 1;
+
+ push(@kill_pids,{
+ pid => $srv->{'pid'},
+ pidfile => $srv->{'path_pid'},
+ sockfile => $srv->{'path_sock'},
+ port => $srv->{'port'},
+ });
+ $srv->{'pid'}= 0; # Assume we are done with it
+ }
+
+ if ( ! $::opt_skip_ndbcluster )
+ {
+
+ foreach my $cluster (@{$::clusters})
+ {
+
+ # Don't shut down a "running" cluster
+ next if $cluster->{'use_running'};
+
+ mtr_debug(" - cluster " .
+ "(pid: $cluster->{pid}; " .
+ "pid file: '$cluster->{path_pid})");
+
+ my $pid= mtr_ndbmgm_start($cluster, "shutdown");
+
+ # Save the pid of the ndb_mgm process
+ $admin_pids{$pid}= 1;
+
+ push(@kill_pids,{
+ pid => $cluster->{'pid'},
+ pidfile => $cluster->{'path_pid'}
+ });
+
+ $cluster->{'pid'}= 0; # Assume we are done with it
+
+ foreach my $ndbd (@{$cluster->{'ndbds'}})
+ {
+ mtr_debug(" - ndbd " .
+ "(pid: $ndbd->{pid}; " .
+ "pid file: '$ndbd->{path_pid})");
+
+ push(@kill_pids,{
+ pid => $ndbd->{'pid'},
+ pidfile => $ndbd->{'path_pid'},
+ });
+ $ndbd->{'pid'}= 0; # Assume we are done with it
+ }
+ }
+ }
+
+ # Wait for all the admin processes to complete
+ mtr_wait_blocking(\%admin_pids);
+
+ # If we trusted "mysqladmin --shutdown_timeout= ..." we could just
+ # terminate now, but we don't (FIXME should be debugged).
+ # So we try again to ping and at least wait the same amount of time
+ # mysqladmin would for all to die.
+
+ mtr_ping_with_timeout(\@kill_pids);
+
+ # We now have tried to terminate nice. We have waited for the listen
+ # port to be free, but can't really tell if the mysqld process died
+ # or not. We now try to find the process PID from the PID file, and
+ # send a kill to that process. Note that Perl let kill(0,@pids) be
+ # a way to just return the numer of processes the kernel can send
+ # signals to. So this can be used (except on Cygwin) to determine
+ # if there are processes left running that we cound out might exists.
+ #
+ # But still after all this work, all we know is that we have
+ # the ports free.
+
+ # We scan the "var/run/" directory for other process id's to kill
+
+ my $rundir= "$::opt_vardir/run";
+
+ mtr_debug("Processing PID files in directory '$rundir'...");
+
+ if ( -d $rundir )
+ {
+ opendir(RUNDIR, $rundir)
+ or mtr_error("can't open directory \"$rundir\": $!");
+
+ my @pids;
+
+ while ( my $elem= readdir(RUNDIR) )
+ {
+ # Only read pid from files that end with .pid
+ if ( $elem =~ /.*[.]pid$/)
+ {
+ my $pidfile= "$rundir/$elem";
+
+ if ( -f $pidfile )
+ {
+ mtr_debug("Processing PID file: '$pidfile'...");
+
+ my $pid= mtr_get_pid_from_file($pidfile);
+
+ mtr_debug("Got pid: $pid from file '$pidfile'");
+
+ if ( $::glob_cygwin_perl or kill(0, $pid) )
+ {
+ mtr_debug("There is process with pid $pid -- scheduling for kill.");
+ push(@pids, $pid); # We know (cygwin guess) it exists
+ }
+ else
+ {
+ mtr_debug("There is no process with pid $pid -- skipping.");
+ }
+ }
+ }
+ else
+ {
+ mtr_warning("Found non pid file $elem in $rundir")
+ if -f "$rundir/$elem";
+ next;
+ }
+ }
+ closedir(RUNDIR);
+
+ if ( @pids )
+ {
+ mtr_debug("Killing the following processes with PID files: " .
+ join(' ', @pids) . "...");
+
+ start_reap_all();
+
+ if ( $::glob_cygwin_perl )
+ {
+ # We have no (easy) way of knowing the Cygwin controlling
+ # process, in the PID file we only have the Windows process id.
+ system("kill -f " . join(" ",@pids)); # Hope for the best....
+ mtr_debug("Sleep 5 seconds waiting for processes to die");
+ sleep(5);
+ }
+ else
+ {
+ my $retries= 10; # 10 seconds
+ do
+ {
+ mtr_debug("Sending SIGKILL to pids: " . join(' ', @pids));
+ kill(9, @pids);
+ mtr_report("Sleep 1 second waiting for processes to die");
+ sleep(1) # Wait one second
+ } while ( $retries-- and kill(0, @pids) );
+
+ if ( kill(0, @pids) ) # Check if some left
+ {
+ mtr_warning("can't kill process(es) " . join(" ", @pids));
+ }
+ }
+
+ stop_reap_all();
+ }
+ }
+ else
+ {
+ mtr_debug("Directory for PID files ($rundir) does not exist.");
+ }
+
+ # We may have failed everything, but we now check again if we have
+ # the listen ports free to use, and if they are free, just go for it.
+
+ mtr_debug("Checking known mysqld servers...");
+
+ foreach my $srv ( @kill_pids )
+ {
+ if ( defined $srv->{'port'} and mtr_ping_port($srv->{'port'}) )
+ {
+ mtr_warning("can't kill old process holding port $srv->{'port'}");
+ }
+ }
+
+ mtr_debug("mtr_kill_leftovers(): finished.");
+}
+
+
+#
+# Check that all processes in "spec" are shutdown gracefully
+# else kill them off hard
+#
+sub mtr_check_stop_servers ($) {
+ my $spec= shift;
+
+ # Return if no processes are defined
+ return if ! @$spec;
+
+ mtr_verbose("mtr_check_stop_servers");
+
+ # ----------------------------------------------------------------------
+ # Wait until servers in "spec" has stopped listening
+ # to their ports or timeout occurs
+ # ----------------------------------------------------------------------
+ mtr_ping_with_timeout(\@$spec);
+
+ # ----------------------------------------------------------------------
+ # Use waitpid() nonblocking for a little while, to see how
+ # many process's will exit sucessfully.
+ # This is the normal case.
+ # ----------------------------------------------------------------------
+ my $wait_counter= 50; # Max number of times to redo the loop
+ foreach my $srv ( @$spec )
+ {
+ my $pid= $srv->{'pid'};
+ my $ret_pid;
+ if ( $pid )
+ {
+ $ret_pid= waitpid($pid,&WNOHANG);
+ if ($ret_pid == $pid)
+ {
+ mtr_verbose("Caught exit of process $ret_pid");
+ $srv->{'pid'}= 0;
+ }
+ elsif ($ret_pid == 0)
+ {
+ mtr_verbose("Process $pid is still alive");
+ if ($wait_counter-- > 0)
+ {
+ # Give the processes more time to exit
+ select(undef, undef, undef, (0.1));
+ redo;
+ }
+ }
+ else
+ {
+ mtr_warning("caught exit of unknown child $ret_pid");
+ }
+ }
+ }
+
+ # ----------------------------------------------------------------------
+ # The processes that haven't yet exited need to
+ # be killed hard, put them in "kill_pids" hash
+ # ----------------------------------------------------------------------
+ my %kill_pids;
+ foreach my $srv ( @$spec )
+ {
+ my $pid= $srv->{'pid'};
+ if ( $pid )
+ {
+ # Server is still alive, put it in list to be hard killed
+ if ($::glob_win32_perl)
+ {
+ # Kill the real process if it's known
+ $pid= $srv->{'real_pid'} if ($srv->{'real_pid'});
+ }
+ $kill_pids{$pid}= 1;
+
+ # Write a message to the process's error log (if it has one)
+ # that it's being killed hard.
+ if ( defined $srv->{'errfile'} )
+ {
+ mtr_tofile($srv->{'errfile'}, "Note: Forcing kill of process $pid\n");
+ }
+ mtr_warning("Forcing kill of process $pid");
+
+ }
+ else
+ {
+ # Server is dead, remove the pidfile if it exists
+ #
+ # Race, could have been removed between test with -f
+ # and the unlink() below, so better check again with -f
+ if ( -f $srv->{'pidfile'} and ! unlink($srv->{'pidfile'}) and
+ -f $srv->{'pidfile'} )
+ {
+ mtr_error("can't remove $srv->{'pidfile'}");
+ }
+ }
+ }
+
+ if ( ! keys %kill_pids )
+ {
+ # All processes has exited gracefully
+ return;
+ }
+
+ mtr_kill_processes(\%kill_pids);
+
+ # ----------------------------------------------------------------------
+ # All processes are killed, cleanup leftover files
+ # ----------------------------------------------------------------------
+ {
+ my $errors= 0;
+ foreach my $srv ( @$spec )
+ {
+ if ( $srv->{'pid'} )
+ {
+ # Server has been hard killed, clean it's resources
+ foreach my $file ($srv->{'pidfile'}, $srv->{'sockfile'})
+ {
+ # Know it is dead so should be no race, careful anyway
+ if ( defined $file and -f $file and ! unlink($file) and -f $file )
+ {
+ $errors++;
+ mtr_warning("couldn't delete $file");
+ }
+ }
+
+ if ($::glob_win32_perl and $srv->{'real_pid'})
+ {
+ # Wait for the pseudo pid - if the real_pid was known
+ # the pseudo pid has not been waited for yet, wai blocking
+ # since it's "such a simple program"
+ mtr_verbose("Wait for pseudo process $srv->{'pid'}");
+ my $ret_pid= waitpid($srv->{'pid'}, 0);
+ mtr_verbose("Pseudo process $ret_pid died");
+ }
+
+ $srv->{'pid'}= 0;
+ }
+ }
+ if ( $errors )
+ {
+ # There where errors killing processes
+ # do one last attempt to ping the servers
+ # and if they can't be pinged, assume they are dead
+ if ( ! mtr_ping_with_timeout( \@$spec ) )
+ {
+ mtr_error("we could not kill or clean up all processes");
+ }
+ else
+ {
+ mtr_verbose("All ports were free, continuing");
+ }
+ }
+ }
+}
+
+
+# Wait for all the process in the list to terminate
+sub mtr_wait_blocking($) {
+ my $admin_pids= shift;
+
+
+ # Return if no processes defined
+ return if ! %$admin_pids;
+
+ mtr_verbose("mtr_wait_blocking");
+
+ # Wait for all the started processes to exit
+ # As mysqladmin is such a simple program, we trust it to terminate itself.
+ # I.e. we wait blocking, and wait for them all before we go on.
+ foreach my $pid (keys %{$admin_pids})
+ {
+ my $ret_pid= waitpid($pid,0);
+
+ }
+}
+
+# Start "mysqladmin <command>" for a specific mysqld
+sub mtr_mysqladmin_start($$$) {
+ my $srv= shift;
+ my $command= shift;
+ my $adm_shutdown_tmo= shift;
+
+ my $args;
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--user=%s", $::opt_user);
+ mtr_add_arg($args, "--password=");
+ mtr_add_arg($args, "--silent");
+ if ( -e $srv->{'path_sock'} )
+ {
+ mtr_add_arg($args, "--socket=%s", $srv->{'path_sock'});
+ }
+ if ( $srv->{'port'} )
+ {
+ mtr_add_arg($args, "--port=%s", $srv->{'port'});
+ }
+ if ( $srv->{'port'} and ! -e $srv->{'path_sock'} )
+ {
+ mtr_add_arg($args, "--protocol=tcp"); # Needed if no --socket
+ }
+ mtr_add_arg($args, "--connect_timeout=5");
+
+ # Shutdown time must be high as slave may be in reconnect
+ mtr_add_arg($args, "--shutdown_timeout=$adm_shutdown_tmo");
+ mtr_add_arg($args, "$command");
+ my $pid= mtr_spawn($::exe_mysqladmin, $args,
+ "", "", "", "",
+ { append_log_file => 1 });
+ mtr_verbose("mtr_mysqladmin_start, pid: $pid");
+ return $pid;
+
+}
+
+# Start "ndb_mgm shutdown" for a specific cluster, it will
+# shutdown all data nodes and leave the ndb_mgmd running
+sub mtr_ndbmgm_start($$) {
+ my $cluster= shift;
+ my $command= shift;
+
+ my $args;
+
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--core");
+ mtr_add_arg($args, "--try-reconnect=1");
+ mtr_add_arg($args, "--ndb_connectstring=%s", $cluster->{'connect_string'});
+ mtr_add_arg($args, "-e");
+ mtr_add_arg($args, "$command");
+
+ my $pid= mtr_spawn($::exe_ndb_mgm, $args,
+ "", "/dev/null", "/dev/null", "",
+ {});
+ mtr_verbose("mtr_ndbmgm_start, pid: $pid");
+ return $pid;
+
+}
+
+
+# Ping all servers in list, exit when none of them answers
+# or when timeout has passed
+sub mtr_ping_with_timeout($) {
+ my $spec= shift;
+ my $timeout= 200; # 20 seconds max
+ my $res= 1; # If we just fall through, we are done
+ # in the sense that the servers don't
+ # listen to their ports any longer
+
+ mtr_debug("Waiting for mysqld servers to stop...");
+
+ TIME:
+ while ( $timeout-- )
+ {
+ foreach my $srv ( @$spec )
+ {
+ $res= 1; # We are optimistic
+ if ( $srv->{'pid'} and defined $srv->{'port'} )
+ {
+ if ( mtr_ping_port($srv->{'port'}) )
+ {
+ mtr_verbose("waiting for process $srv->{'pid'} to stop ".
+ "using port $srv->{'port'}");
+
+ # Millisceond sleep emulated with select
+ select(undef, undef, undef, (0.1));
+ $res= 0;
+ next TIME;
+ }
+ else
+ {
+ # Process was not using port
+ }
+ }
+ }
+ last; # If we got here, we are done
+ }
+
+ if ($res)
+ {
+ mtr_debug("mtr_ping_with_timeout(): All mysqld instances are down.");
+ }
+ else
+ {
+ mtr_report("mtr_ping_with_timeout(): At least one server is alive.");
+ }
+
+ return $res;
+}
+
+
+#
+# Loop through our list of processes and look for and entry
+# with the provided pid
+# Set the pid of that process to 0 if found
+#
+sub mark_process_dead($)
+{
+ my $ret_pid= shift;
+
+ foreach my $mysqld (@{$::master}, @{$::slave})
+ {
+ if ( $mysqld->{'pid'} eq $ret_pid )
+ {
+ mtr_verbose("$mysqld->{'type'} $mysqld->{'idx'} exited, pid: $ret_pid");
+ $mysqld->{'pid'}= 0;
+ return;
+ }
+ }
+
+ foreach my $cluster (@{$::clusters})
+ {
+ if ( $cluster->{'pid'} eq $ret_pid )
+ {
+ mtr_verbose("$cluster->{'name'} cluster ndb_mgmd exited, pid: $ret_pid");
+ $cluster->{'pid'}= 0;
+ return;
+ }
+
+ foreach my $ndbd (@{$cluster->{'ndbds'}})
+ {
+ if ( $ndbd->{'pid'} eq $ret_pid )
+ {
+ mtr_verbose("$cluster->{'name'} cluster ndbd exited, pid: $ret_pid");
+ $ndbd->{'pid'}= 0;
+ return;
+ }
+ }
+ }
+ mtr_warning("mark_process_dead couldn't find an entry for pid: $ret_pid");
+
+}
+
+#
+# Loop through our list of processes and look for and entry
+# with the provided pid, if found check for the file indicating
+# expected crash and restart it.
+#
+sub check_expected_crash_and_restart($)
+{
+ my $ret_pid= shift;
+
+ foreach my $mysqld (@{$::master}, @{$::slave})
+ {
+ if ( $mysqld->{'pid'} eq $ret_pid )
+ {
+ mtr_verbose("$mysqld->{'type'} $mysqld->{'idx'} exited, pid: $ret_pid");
+ $mysqld->{'pid'}= 0;
+
+ # Check if crash expected and restart if it was
+ my $expect_file= "$::opt_vardir/tmp/" . "$mysqld->{'type'}" .
+ "$mysqld->{'idx'}" . ".expect";
+ if ( -f $expect_file )
+ {
+ mtr_verbose("Crash was expected, file $expect_file exists");
+ mysqld_start($mysqld, $mysqld->{'start_opts'},
+ $mysqld->{'start_slave_master_info'});
+ unlink($expect_file);
+ }
+
+ return;
+ }
+ }
+
+ foreach my $cluster (@{$::clusters})
+ {
+ if ( $cluster->{'pid'} eq $ret_pid )
+ {
+ mtr_verbose("$cluster->{'name'} cluster ndb_mgmd exited, pid: $ret_pid");
+ $cluster->{'pid'}= 0;
+
+ # Check if crash expected and restart if it was
+ my $expect_file= "$::opt_vardir/tmp/ndb_mgmd_" . "$cluster->{'type'}" .
+ ".expect";
+ if ( -f $expect_file )
+ {
+ mtr_verbose("Crash was expected, file $expect_file exists");
+ ndbmgmd_start($cluster);
+ unlink($expect_file);
+ }
+ return;
+ }
+
+ foreach my $ndbd (@{$cluster->{'ndbds'}})
+ {
+ if ( $ndbd->{'pid'} eq $ret_pid )
+ {
+ mtr_verbose("$cluster->{'name'} cluster ndbd exited, pid: $ret_pid");
+ $ndbd->{'pid'}= 0;
+
+ # Check if crash expected and restart if it was
+ my $expect_file= "$::opt_vardir/tmp/ndbd_" . "$cluster->{'type'}" .
+ "$ndbd->{'idx'}" . ".expect";
+ if ( -f $expect_file )
+ {
+ mtr_verbose("Crash was expected, file $expect_file exists");
+ ndbd_start($cluster, $ndbd->{'idx'},
+ $ndbd->{'start_extra_args'});
+ unlink($expect_file);
+ }
+ return;
+ }
+ }
+ }
+
+ if ($::instance_manager->{'spawner_pid'} eq $ret_pid)
+ {
+ return;
+ }
+
+ mtr_warning("check_expected_crash_and_restart couldn't find an entry for pid: $ret_pid");
+
+}
+
+##############################################################################
+#
+# The operating system will keep information about dead children,
+# we read this information here, and if we have records the process
+# is alive, we mark it as dead.
+#
+##############################################################################
+
+sub mtr_record_dead_children () {
+
+ my $process_died= 0;
+ my $ret_pid;
+
+ # Wait without blockinng to see if any processes had died
+ # -1 or 0 means there are no more procesess to wait for
+ while ( ($ret_pid= waitpid(-1,&WNOHANG)) != 0 and $ret_pid != -1)
+ {
+ mtr_warning("mtr_record_dead_children: $ret_pid");
+ mark_process_dead($ret_pid);
+ $process_died= 1;
+ }
+ return $process_died;
+}
+
+sub start_reap_all {
+ # This causes terminating processes to not become zombies, avoiding
+ # the need for (or possibility of) explicit waitpid().
+ $SIG{CHLD}= 'IGNORE';
+
+ # On some platforms (Linux, QNX, OSX, ...) there is potential race
+ # here. If a process terminated before setting $SIG{CHLD} (but after
+ # any attempt to waitpid() it), it will still be a zombie. So we
+ # have to handle any such process here.
+ my $pid;
+ while(($pid= waitpid(-1, &WNOHANG)) != 0 and $pid != -1)
+ {
+ mtr_warning("start_reap_all pid: $pid");
+ mark_process_dead($pid);
+ };
+}
+
+sub stop_reap_all {
+ $SIG{CHLD}= 'DEFAULT';
+}
+
+
+sub mtr_ping_port ($) {
+ my $port= shift;
+
+ mtr_verbose("mtr_ping_port: $port");
+
+ my $remote= "localhost";
+ my $iaddr= inet_aton($remote);
+ if ( ! $iaddr )
+ {
+ mtr_error("can't find IP number for $remote");
+ }
+ my $paddr= sockaddr_in($port, $iaddr);
+ my $proto= getprotobyname('tcp');
+ if ( ! socket(SOCK, PF_INET, SOCK_STREAM, $proto) )
+ {
+ mtr_error("can't create socket: $!");
+ }
+
+ mtr_debug("Pinging server (port: $port)...");
+
+ if ( connect(SOCK, $paddr) )
+ {
+ close(SOCK); # FIXME check error?
+ mtr_verbose("USED");
+ return 1;
+ }
+ else
+ {
+ mtr_verbose("FREE");
+ return 0;
+ }
+}
+
+##############################################################################
+#
+# Wait for a file to be created
+#
+##############################################################################
+
+# FIXME check that the pidfile contains the expected pid!
+
+sub sleep_until_file_created ($$$) {
+ my $pidfile= shift;
+ my $timeout= shift;
+ my $pid= shift;
+ my $sleeptime= 100; # Milliseconds
+ my $loops= ($timeout * 1000) / $sleeptime;
+
+ for ( my $loop= 1; $loop <= $loops; $loop++ )
+ {
+ if ( -r $pidfile )
+ {
+ return 1;
+ }
+
+ # Check if it died after the fork() was successful
+ if ( $pid != 0 && waitpid($pid,&WNOHANG) == $pid )
+ {
+ mtr_warning("Process $pid died");
+ return 0;
+ }
+
+ mtr_debug("Sleep $sleeptime milliseconds waiting for $pidfile");
+
+ # Print extra message every 60 seconds
+ my $seconds= ($loop * $sleeptime) / 1000;
+ if ( $seconds > 1 and int($seconds * 10) % 600 == 0 )
+ {
+ my $left= $timeout - $seconds;
+ mtr_warning("Waited $seconds seconds for $pidfile to be created, " .
+ "still waiting for $left seconds...");
+ }
+
+ # Millisceond sleep emulated with select
+ select(undef, undef, undef, ($sleeptime/1000));
+ }
+
+ return 0;
+}
+
+
+sub mtr_kill_processes ($) {
+ my $pids = shift;
+
+ mtr_verbose("mtr_kill_processes (" . join(" ", keys %{$pids}) . ")");
+
+ foreach my $pid (keys %{$pids})
+ {
+
+ if ($pid <= 0)
+ {
+ mtr_warning("Trying to kill illegal pid: $pid");
+ next;
+ }
+
+ my $signaled_procs= kill(9, $pid);
+ if ($signaled_procs == 0)
+ {
+ # No such process existed, assume it's killed
+ mtr_verbose("killed $pid(no such process)");
+ }
+ else
+ {
+ my $ret_pid= waitpid($pid,0);
+ if ($ret_pid == $pid)
+ {
+ mtr_verbose("killed $pid(got the pid)");
+ }
+ elsif ($ret_pid == -1)
+ {
+ mtr_verbose("killed $pid(got -1)");
+ }
+ }
+ }
+ mtr_verbose("done killing processes");
+}
+
+
+##############################################################################
+#
+# When we exit, we kill off all children
+#
+##############################################################################
+
+sub mtr_exit ($) {
+ my $code= shift;
+ mtr_timer_stop_all($::glob_timers);
+ local $SIG{HUP} = 'IGNORE';
+ # ToDo: Signalling -$$ will only work if we are the process group
+ # leader (in fact on QNX it will signal our session group leader,
+ # which might be Do-compile or Pushbuild, causing tests to be
+ # aborted). So we only do it if we are the group leader. We might
+ # set ourselves as the group leader at startup (with
+ # POSIX::setpgrp(0,0)), but then care must be needed to always do
+ # proper child process cleanup.
+ POSIX::kill(SIGHUP, -$$) if !$::glob_win32_perl and $$ == getpgrp();
+
+ exit($code);
+}
+
+###########################################################################
+
+1;
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/v1/mtr_report.pl
index 3c78c3ca064..3c78c3ca064 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/v1/mtr_report.pl
diff --git a/mysql-test/lib/v1/mtr_stress.pl b/mysql-test/lib/v1/mtr_stress.pl
new file mode 100644
index 00000000000..93b06b32c5f
--- /dev/null
+++ b/mysql-test/lib/v1/mtr_stress.pl
@@ -0,0 +1,191 @@
+# -*- cperl -*-
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is a library file used by the Perl version of mysql-test-run,
+# and is part of the translation of the Bourne shell script with the
+# same name.
+
+use strict;
+use File::Spec;
+
+# These are not to be prefixed with "mtr_"
+
+sub run_stress_test ();
+
+##############################################################################
+#
+# Run tests in the stress mode
+#
+##############################################################################
+
+sub run_stress_test ()
+{
+
+ my $args;
+ my $stress_suitedir;
+
+ mtr_report("Starting stress testing\n");
+
+ if ( ! $::glob_use_embedded_server )
+ {
+ if ( ! mysqld_start($::master->[0],[],[]) )
+ {
+ mtr_error("Can't start the mysqld server");
+ }
+ }
+
+ my $stress_basedir=File::Spec->catdir($::opt_vardir, "stress");
+
+ #Clean up stress dir
+ if ( -d $stress_basedir )
+ {
+ rmtree($stress_basedir);
+ }
+ mkpath($stress_basedir);
+
+ if ($::opt_stress_suite ne 'main' && $::opt_stress_suite ne 'default' )
+ {
+ $stress_suitedir=File::Spec->catdir($::glob_mysql_test_dir, "suite",
+ $::opt_stress_suite);
+ }
+ else
+ {
+ $stress_suitedir=$::glob_mysql_test_dir;
+ }
+
+ if ( -d $stress_suitedir )
+ {
+ #$stress_suite_t_dir=File::Spec->catdir($stress_suitedir, "t");
+ #$stress_suite_r_dir=File::Spec->catdir($stress_suitedir, "r");
+ #FIXME: check dirs above for existence to ensure that test suite
+ # contains tests and results dirs
+ }
+ else
+ {
+ mtr_error("Specified test suite $::opt_stress_suite doesn't exist");
+ }
+
+ if ( @::opt_cases )
+ {
+ $::opt_stress_test_file=File::Spec->catfile($stress_basedir, "stress_tests.txt");
+ open(STRESS_FILE, ">$::opt_stress_test_file");
+ print STRESS_FILE join("\n",@::opt_cases),"\n";
+ close(STRESS_FILE);
+ }
+ elsif ( $::opt_stress_test_file )
+ {
+ $::opt_stress_test_file=File::Spec->catfile($stress_suitedir,
+ $::opt_stress_test_file);
+ if ( ! -f $::opt_stress_test_file )
+ {
+ mtr_error("Specified file $::opt_stress_test_file with list of tests does not exist\n",
+ "Please ensure that file exists and has proper permissions");
+ }
+ }
+ else
+ {
+ $::opt_stress_test_file=File::Spec->catfile($stress_suitedir,
+ "stress_tests.txt");
+ if ( ! -f $::opt_stress_test_file )
+ {
+ mtr_error("Default file $::opt_stress_test_file with list of tests does not exist\n",
+ "Please use --stress-test-file option to specify custom one or you can\n",
+ "just specify name of test for testing as last argument in command line");
+
+ }
+ }
+
+ if ( $::opt_stress_init_file )
+ {
+ $::opt_stress_init_file=File::Spec->catfile($stress_suitedir,
+ $::opt_stress_init_file);
+ if ( ! -f $::opt_stress_init_file )
+ {
+ mtr_error("Specified file $::opt_stress_init_file with list of tests does not exist\n",
+ "Please ensure that file exists and has proper permissions");
+ }
+ }
+ else
+ {
+ $::opt_stress_init_file=File::Spec->catfile($stress_suitedir,
+ "stress_init.txt");
+ if ( ! -f $::opt_stress_init_file )
+ {
+ $::opt_stress_init_file='';
+ }
+ }
+
+ if ( $::opt_stress_mode ne 'random' && $::opt_stress_mode ne 'seq' )
+ {
+ mtr_error("You specified wrong mode $::opt_stress_mode for stress test\n",
+ "Correct values are 'random' or 'seq'");
+ }
+
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--server-socket=%s", $::master->[0]->{'path_sock'});
+ mtr_add_arg($args, "--server-user=%s", $::opt_user);
+ mtr_add_arg($args, "--server-database=%s", "test");
+ mtr_add_arg($args, "--stress-suite-basedir=%s", $::glob_mysql_test_dir);
+ mtr_add_arg($args, "--suite=%s", $::opt_stress_suite);
+ mtr_add_arg($args, "--stress-tests-file=%s", $::opt_stress_test_file);
+ mtr_add_arg($args, "--stress-basedir=%s", $stress_basedir);
+ mtr_add_arg($args, "--server-logs-dir=%s", $stress_basedir);
+ mtr_add_arg($args, "--stress-mode=%s", $::opt_stress_mode);
+ mtr_add_arg($args, "--mysqltest=%s", $::exe_mysqltest);
+ mtr_add_arg($args, "--threads=%s", $::opt_stress_threads);
+ mtr_add_arg($args, "--verbose");
+ mtr_add_arg($args, "--cleanup");
+ mtr_add_arg($args, "--log-error-details");
+ mtr_add_arg($args, "--abort-on-error");
+
+ if ( $::opt_stress_init_file )
+ {
+ mtr_add_arg($args, "--stress-init-file=%s", $::opt_stress_init_file);
+ }
+
+ if ( !$::opt_stress_loop_count && !$::opt_stress_test_count &&
+ !$::opt_stress_test_duration )
+ {
+ #Limit stress testing with 20 loops in case when any limit parameter
+ #was specified
+ $::opt_stress_test_count=20;
+ }
+
+ if ( $::opt_stress_loop_count )
+ {
+ mtr_add_arg($args, "--loop-count=%s", $::opt_stress_loop_count);
+ }
+
+ if ( $::opt_stress_test_count )
+ {
+ mtr_add_arg($args, "--test-count=%s", $::opt_stress_test_count);
+ }
+
+ if ( $::opt_stress_test_duration )
+ {
+ mtr_add_arg($args, "--test-duration=%s", $::opt_stress_test_duration);
+ }
+
+ #Run stress test
+ mtr_run("$::glob_mysql_test_dir/mysql-stress-test.pl", $args, "", "", "", "");
+ if ( ! $::glob_use_embedded_server )
+ {
+ stop_all_servers();
+ }
+}
+
+1;
diff --git a/mysql-test/lib/mtr_timer.pl b/mysql-test/lib/v1/mtr_timer.pl
index 326fbea74ec..326fbea74ec 100644
--- a/mysql-test/lib/mtr_timer.pl
+++ b/mysql-test/lib/v1/mtr_timer.pl
diff --git a/mysql-test/lib/mtr_unique.pl b/mysql-test/lib/v1/mtr_unique.pl
index a668fc097c7..a668fc097c7 100644
--- a/mysql-test/lib/mtr_unique.pl
+++ b/mysql-test/lib/v1/mtr_unique.pl
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
new file mode 100755
index 00000000000..86ad5c485c1
--- /dev/null
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -0,0 +1,5393 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+
+#
+##############################################################################
+#
+# mysql-test-run.pl
+#
+# Tool used for executing a suite of .test file
+#
+# See the "MySQL Test framework manual" for more information
+# http://dev.mysql.com/doc/mysqltest/en/index.html
+#
+# Please keep the test framework tools identical in all versions!
+#
+##############################################################################
+#
+# Coding style directions for this perl script
+#
+# - To make this Perl script easy to alter even for those that not
+# code Perl that often, keeep the coding style as close as possible to
+# the C/C++ MySQL coding standard.
+#
+# - All lists of arguments to send to commands are Perl lists/arrays,
+# not strings we append args to. Within reason, most string
+# concatenation for arguments should be avoided.
+#
+# - Functions defined in the main program are not to be prefixed,
+# functions in "library files" are to be prefixed with "mtr_" (for
+# Mysql-Test-Run). There are some exceptions, code that fits best in
+# the main program, but are put into separate files to avoid
+# clutter, may be without prefix.
+#
+# - All stat/opendir/-f/ is to be kept in collect_test_cases(). It
+# will create a struct that the rest of the program can use to get
+# the information. This separates the "find information" from the
+# "do the work" and makes the program more easy to maintain.
+#
+# - The rule when it comes to the logic of this program is
+#
+# command_line_setup() - is to handle the logic between flags
+# collect_test_cases() - is to do its best to select what tests
+# to run, dig out options, if needs restart etc.
+# run_testcase() - is to run a single testcase, and follow the
+# logic set in both above. No, or rare file
+# system operations. If a test seems complex,
+# it should probably not be here.
+#
+# A nice way to trace the execution of this script while debugging
+# is to use the Devel::Trace package found at
+# "http://www.plover.com/~mjd/perl/Trace/" and run this script like
+# "perl -d:Trace mysql-test-run.pl"
+#
+
+
+use lib "lib/v1/";
+
+$Devel::Trace::TRACE= 0; # Don't trace boring init stuff
+
+#require 5.6.1;
+use File::Path;
+use File::Basename;
+use File::Copy;
+use File::Temp qw /tempdir/;
+use File::Spec::Functions qw /splitdir/;
+use Cwd;
+use Getopt::Long;
+use IO::Socket;
+use IO::Socket::INET;
+use strict;
+use warnings;
+
+select(STDOUT);
+$| = 1; # Automatically flush STDOUT
+
+our $glob_win32_perl= ($^O eq "MSWin32"); # ActiveState Win32 Perl
+our $glob_cygwin_perl= ($^O eq "cygwin"); # Cygwin Perl
+our $glob_win32= ($glob_win32_perl or $glob_cygwin_perl);
+our $glob_netware= ($^O eq "NetWare"); # NetWare
+
+require "lib/v1/mtr_cases.pl";
+require "lib/v1/mtr_im.pl";
+require "lib/v1/mtr_process.pl";
+require "lib/v1/mtr_timer.pl";
+require "lib/v1/mtr_io.pl";
+require "lib/v1/mtr_gcov.pl";
+require "lib/v1/mtr_gprof.pl";
+require "lib/v1/mtr_report.pl";
+require "lib/v1/mtr_match.pl";
+require "lib/v1/mtr_misc.pl";
+require "lib/v1/mtr_stress.pl";
+require "lib/v1/mtr_unique.pl";
+
+$Devel::Trace::TRACE= 1;
+
+##############################################################################
+#
+# Default settings
+#
+##############################################################################
+
+# Misc global variables
+our $mysql_version_id;
+our $glob_mysql_test_dir= undef;
+our $glob_mysql_bench_dir= undef;
+our $glob_scriptname= undef;
+our $glob_timers= undef;
+our $glob_use_embedded_server= 0;
+our @glob_test_mode;
+
+our $glob_basedir;
+
+our $path_charsetsdir;
+our $path_client_bindir;
+our $path_client_libdir;
+our $path_share;
+our $path_language;
+our $path_timefile;
+our $path_snapshot;
+our $path_mysqltest_log;
+our $path_current_test_log;
+our $path_my_basedir;
+
+our $opt_vardir; # A path but set directly on cmd line
+our $path_vardir_trace; # unix formatted opt_vardir for trace files
+our $opt_tmpdir; # A path but set directly on cmd line
+
+# Visual Studio produces executables in different sub-directories based on the
+# configuration used to build them. To make life easier, an environment
+# variable or command-line option may be specified to control which set of
+# executables will be used by the test suite.
+our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
+
+our $default_vardir;
+
+our $opt_usage;
+our $opt_suites;
+our $opt_suites_default= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run
+our $opt_script_debug= 0; # Script debugging, enable with --script-debug
+our $opt_verbose= 0; # Verbose output, enable with --verbose
+
+our $exe_master_mysqld;
+our $exe_mysql;
+our $exe_mysqladmin;
+our $exe_mysql_upgrade;
+our $exe_mysqlbinlog;
+our $exe_mysql_client_test;
+our $exe_bug25714;
+our $exe_mysqld;
+our $exe_mysqlcheck;
+our $exe_mysqldump;
+our $exe_mysqlslap;
+our $exe_mysqlimport;
+our $exe_mysqlshow;
+our $exe_mysql_fix_system_tables;
+our $file_mysql_fix_privilege_tables;
+our $exe_mysqltest;
+our $exe_ndbd;
+our $exe_ndb_mgmd;
+our $exe_slave_mysqld;
+our $exe_im;
+our $exe_my_print_defaults;
+our $exe_perror;
+our $lib_udf_example;
+our $lib_example_plugin;
+our $exe_libtool;
+
+our $opt_bench= 0;
+our $opt_small_bench= 0;
+our $opt_big_test= 0;
+
+our @opt_combinations;
+our $opt_skip_combination;
+
+our @opt_extra_mysqld_opt;
+
+our $opt_compress;
+our $opt_ssl;
+our $opt_skip_ssl;
+our $opt_ssl_supported;
+our $opt_ps_protocol;
+our $opt_sp_protocol;
+our $opt_cursor_protocol;
+our $opt_view_protocol;
+
+our $opt_debug;
+our $opt_do_test;
+our @opt_cases; # The test cases names in argv
+our $opt_embedded_server;
+
+our $opt_extern= 0;
+our $opt_socket;
+
+our $opt_fast;
+our $opt_force;
+our $opt_reorder= 0;
+our $opt_enable_disabled;
+our $opt_mem= $ENV{'MTR_MEM'};
+
+our $opt_gcov;
+our $opt_gcov_err;
+our $opt_gcov_msg;
+
+our $glob_debugger= 0;
+our $opt_gdb;
+our $opt_client_gdb;
+our $opt_ddd;
+our $opt_client_ddd;
+our $opt_manual_gdb;
+our $opt_manual_ddd;
+our $opt_manual_debug;
+our $opt_mtr_build_thread=0;
+our $opt_debugger;
+our $opt_client_debugger;
+
+our $opt_gprof;
+our $opt_gprof_dir;
+our $opt_gprof_master;
+our $opt_gprof_slave;
+
+our $master;
+our $slave;
+our $clusters;
+
+our $instance_manager;
+
+our $opt_master_myport;
+our $opt_slave_myport;
+our $im_port;
+our $im_mysqld1_port;
+our $im_mysqld2_port;
+our $opt_ndbcluster_port;
+our $opt_ndbconnectstring;
+our $opt_ndbcluster_port_slave;
+our $opt_ndbconnectstring_slave;
+
+our $opt_record;
+my $opt_report_features;
+our $opt_check_testcases;
+our $opt_mark_progress;
+
+our $opt_skip_rpl;
+our $max_slave_num= 0;
+our $max_master_num= 1;
+our $use_innodb;
+our $opt_skip_test;
+our $opt_skip_im;
+
+our $opt_sleep;
+
+our $opt_testcase_timeout;
+our $opt_suite_timeout;
+my $default_testcase_timeout= 15; # 15 min max
+my $default_suite_timeout= 300; # 5 hours max
+
+our $opt_start_and_exit;
+our $opt_start_dirty;
+our $opt_start_from;
+
+our $opt_strace_client;
+
+our $opt_timer= 1;
+
+our $opt_user;
+
+my $opt_valgrind= 0;
+my $opt_valgrind_mysqld= 0;
+my $opt_valgrind_mysqltest= 0;
+my @default_valgrind_args= ("--show-reachable=yes");
+my @valgrind_args;
+my $opt_valgrind_path;
+my $opt_callgrind;
+
+our $opt_stress= "";
+our $opt_stress_suite= "main";
+our $opt_stress_mode= "random";
+our $opt_stress_threads= 5;
+our $opt_stress_test_count= 0;
+our $opt_stress_loop_count= 0;
+our $opt_stress_test_duration= 0;
+our $opt_stress_init_file= "";
+our $opt_stress_test_file= "";
+
+our $opt_warnings;
+
+our $opt_skip_ndbcluster= 0;
+our $opt_skip_ndbcluster_slave= 0;
+our $opt_with_ndbcluster= 0;
+our $opt_with_ndbcluster_only= 0;
+our $glob_ndbcluster_supported= 0;
+our $opt_ndb_extra_test= 0;
+our $opt_skip_master_binlog= 0;
+our $opt_skip_slave_binlog= 0;
+
+our $exe_ndb_mgm;
+our $exe_ndb_waiter;
+our $path_ndb_tools_dir;
+our $path_ndb_examples_dir;
+our $exe_ndb_example;
+our $path_ndb_testrun_log;
+
+our $path_sql_dir;
+
+our @data_dir_lst;
+
+our $used_binlog_format;
+our $used_default_engine;
+our $debug_compiled_binaries;
+
+our %mysqld_variables;
+
+my $source_dist= 0;
+
+our $opt_max_save_core= 5;
+my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far.
+
+######################################################################
+#
+# Function declarations
+#
+######################################################################
+
+sub main ();
+sub initial_setup ();
+sub command_line_setup ();
+sub set_mtr_build_thread_ports($);
+sub datadir_list_setup ();
+sub executable_setup ();
+sub environment_setup ();
+sub kill_running_servers ();
+sub remove_stale_vardir ();
+sub setup_vardir ();
+sub check_ssl_support ($);
+sub check_running_as_root();
+sub check_ndbcluster_support ($);
+sub rm_ndbcluster_tables ($);
+sub ndbcluster_start_install ($);
+sub ndbcluster_start ($$);
+sub ndbcluster_wait_started ($$);
+sub mysqld_wait_started($);
+sub run_benchmarks ($);
+sub initialize_servers ();
+sub mysql_install_db ();
+sub install_db ($$);
+sub copy_install_db ($$);
+sub run_testcase ($);
+sub run_testcase_stop_servers ($$$);
+sub run_testcase_start_servers ($);
+sub run_testcase_check_skip_test($);
+sub report_failure_and_restart ($);
+sub do_before_start_master ($);
+sub do_before_start_slave ($);
+sub ndbd_start ($$$);
+sub ndb_mgmd_start ($);
+sub mysqld_start ($$$);
+sub mysqld_arguments ($$$$);
+sub stop_all_servers ();
+sub run_mysqltest ($);
+sub usage ($);
+
+
+######################################################################
+#
+# Main program
+#
+######################################################################
+
+main();
+
+sub main () {
+
+ command_line_setup();
+
+ check_ndbcluster_support(\%mysqld_variables);
+ check_ssl_support(\%mysqld_variables);
+ check_debug_support(\%mysqld_variables);
+
+ executable_setup();
+
+ environment_setup();
+ signal_setup();
+
+ if ( $opt_gcov )
+ {
+ gcov_prepare();
+ }
+
+ if ( $opt_gprof )
+ {
+ gprof_prepare();
+ }
+
+ if ( $opt_bench )
+ {
+ initialize_servers();
+ run_benchmarks(shift); # Shift what? Extra arguments?!
+ }
+ elsif ( $opt_stress )
+ {
+ initialize_servers();
+ run_stress_test()
+ }
+ else
+ {
+ # Figure out which tests we are going to run
+ if (!$opt_suites)
+ {
+ $opt_suites= $opt_suites_default;
+
+ # Check for any extra suites to enable based on the path name
+ my %extra_suites=
+ (
+ "mysql-5.1-new-ndb" => "ndb_team",
+ "mysql-5.1-new-ndb-merge" => "ndb_team",
+ "mysql-5.1-telco-6.2" => "ndb_team",
+ "mysql-5.1-telco-6.2-merge" => "ndb_team",
+ "mysql-5.1-telco-6.3" => "ndb_team",
+ "mysql-6.0-ndb" => "ndb_team",
+ );
+
+ foreach my $dir ( reverse splitdir($glob_basedir) )
+ {
+ my $extra_suite= $extra_suites{$dir};
+ if (defined $extra_suite){
+ mtr_report("Found extra suite: $extra_suite");
+ $opt_suites= "$extra_suite,$opt_suites";
+ last;
+ }
+ }
+ }
+
+ my $tests= collect_test_cases($opt_suites);
+
+ # Turn off NDB and other similar options if no tests use it
+ my ($need_ndbcluster,$need_im);
+ foreach my $test (@$tests)
+ {
+ next if $test->{skip};
+
+ if (!$opt_extern)
+ {
+ $need_ndbcluster||= $test->{ndb_test};
+ $need_im||= $test->{component_id} eq 'im';
+
+ # Count max number of slaves used by a test case
+ if ( $test->{slave_num} > $max_slave_num) {
+ $max_slave_num= $test->{slave_num};
+ mtr_error("Too many slaves") if $max_slave_num > 3;
+ }
+
+ # Count max number of masters used by a test case
+ if ( $test->{master_num} > $max_master_num) {
+ $max_master_num= $test->{master_num};
+ mtr_error("Too many masters") if $max_master_num > 2;
+ mtr_error("Too few masters") if $max_master_num < 1;
+ }
+ }
+ $use_innodb||= $test->{'innodb_test'};
+ }
+
+ # Check if cluster can be skipped
+ if ( !$need_ndbcluster )
+ {
+ $opt_skip_ndbcluster= 1;
+ $opt_skip_ndbcluster_slave= 1;
+ }
+
+ # Check if slave cluster can be skipped
+ if ($max_slave_num == 0)
+ {
+ $opt_skip_ndbcluster_slave= 1;
+ }
+
+ # Check if im can be skipped
+ if ( ! $need_im )
+ {
+ $opt_skip_im= 1;
+ }
+
+ initialize_servers();
+
+ if ( $opt_report_features ) {
+ run_report_features();
+ }
+
+ run_tests($tests);
+ }
+
+ mtr_exit(0);
+}
+
+##############################################################################
+#
+# Default settings
+#
+##############################################################################
+
+#
+# When an option is no longer used by this program, it must be explicitly
+# ignored or else it will be passed through to mysqld. GetOptions will call
+# this subroutine once for each such option on the command line. See
+# Getopt::Long documentation.
+#
+
+sub warn_about_removed_option {
+ my ($option, $value, $hash_value) = @_;
+
+ warn "WARNING: This option is no longer used, and is ignored: --$option\n";
+}
+
+sub command_line_setup () {
+
+ # These are defaults for things that are set on the command line
+
+ my $opt_comment;
+
+ # Magic number -69.4 results in traditional test ports starting from 9306.
+ set_mtr_build_thread_ports(-69.4);
+
+ # If so requested, we try to avail ourselves of a unique build thread number.
+ if ( $ENV{'MTR_BUILD_THREAD'} ) {
+ if ( lc($ENV{'MTR_BUILD_THREAD'}) eq 'auto' ) {
+ print "Requesting build thread... ";
+ $ENV{'MTR_BUILD_THREAD'} = mtr_require_unique_id_and_wait("/tmp/mysql-test-ports", 200, 299);
+ print "got ".$ENV{'MTR_BUILD_THREAD'}."\n";
+ }
+ }
+
+ if ( $ENV{'MTR_BUILD_THREAD'} )
+ {
+ set_mtr_build_thread_ports($ENV{'MTR_BUILD_THREAD'});
+ }
+
+ # This is needed for test log evaluation in "gen-build-status-page"
+ # in all cases where the calling tool does not log the commands
+ # directly before it executes them, like "make test-force-pl" in RPM builds.
+ print "Logging: $0 ", join(" ", @ARGV), "\n";
+
+ # Read the command line
+ # Note: Keep list, and the order, in sync with usage at end of this file
+
+ # Options that are no longer used must still be processed, because all
+ # unprocessed options are passed directly to mysqld. The user will be
+ # warned that the option is being ignored.
+ #
+ # Put the complete option string here. For example, to remove the --suite
+ # option, remove it from GetOptions() below and put 'suite|suites=s' here.
+ my @removed_options = (
+ );
+
+ Getopt::Long::Configure("pass_through");
+ GetOptions(
+ # Control what engine/variation to run
+ 'embedded-server' => \$opt_embedded_server,
+ 'ps-protocol' => \$opt_ps_protocol,
+ 'sp-protocol' => \$opt_sp_protocol,
+ 'view-protocol' => \$opt_view_protocol,
+ 'cursor-protocol' => \$opt_cursor_protocol,
+ 'ssl|with-openssl' => \$opt_ssl,
+ 'skip-ssl' => \$opt_skip_ssl,
+ 'compress' => \$opt_compress,
+ 'bench' => \$opt_bench,
+ 'small-bench' => \$opt_small_bench,
+ 'with-ndbcluster|ndb' => \$opt_with_ndbcluster,
+ 'vs-config' => \$opt_vs_config,
+
+ # Control what test suites or cases to run
+ 'force' => \$opt_force,
+ 'with-ndbcluster-only' => \$opt_with_ndbcluster_only,
+ 'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
+ 'skip-ndbcluster-slave|skip-ndb-slave'
+ => \$opt_skip_ndbcluster_slave,
+ 'ndb-extra-test' => \$opt_ndb_extra_test,
+ 'skip-master-binlog' => \$opt_skip_master_binlog,
+ 'skip-slave-binlog' => \$opt_skip_slave_binlog,
+ 'do-test=s' => \$opt_do_test,
+ 'start-from=s' => \$opt_start_from,
+ 'suite|suites=s' => \$opt_suites,
+ 'skip-rpl' => \$opt_skip_rpl,
+ 'skip-im' => \$opt_skip_im,
+ 'skip-test=s' => \$opt_skip_test,
+ 'big-test' => \$opt_big_test,
+ 'combination=s' => \@opt_combinations,
+ 'skip-combination' => \$opt_skip_combination,
+
+ # Specify ports
+ 'master_port=i' => \$opt_master_myport,
+ 'slave_port=i' => \$opt_slave_myport,
+ 'ndbcluster-port|ndbcluster_port=i' => \$opt_ndbcluster_port,
+ 'ndbcluster-port-slave=i' => \$opt_ndbcluster_port_slave,
+ 'im-port=i' => \$im_port, # Instance Manager port.
+ 'im-mysqld1-port=i' => \$im_mysqld1_port, # Port of mysqld, controlled by IM
+ 'im-mysqld2-port=i' => \$im_mysqld2_port, # Port of mysqld, controlled by IM
+ 'mtr-build-thread=i' => \$opt_mtr_build_thread,
+
+ # Test case authoring
+ 'record' => \$opt_record,
+ 'check-testcases' => \$opt_check_testcases,
+ 'mark-progress' => \$opt_mark_progress,
+
+ # Extra options used when starting mysqld
+ 'mysqld=s' => \@opt_extra_mysqld_opt,
+
+ # Run test on running server
+ 'extern' => \$opt_extern,
+ 'ndb-connectstring=s' => \$opt_ndbconnectstring,
+ 'ndb-connectstring-slave=s' => \$opt_ndbconnectstring_slave,
+
+ # Debugging
+ 'gdb' => \$opt_gdb,
+ 'client-gdb' => \$opt_client_gdb,
+ 'manual-gdb' => \$opt_manual_gdb,
+ 'manual-debug' => \$opt_manual_debug,
+ 'ddd' => \$opt_ddd,
+ 'client-ddd' => \$opt_client_ddd,
+ 'manual-ddd' => \$opt_manual_ddd,
+ 'debugger=s' => \$opt_debugger,
+ 'client-debugger=s' => \$opt_client_debugger,
+ 'strace-client' => \$opt_strace_client,
+ 'master-binary=s' => \$exe_master_mysqld,
+ 'slave-binary=s' => \$exe_slave_mysqld,
+ 'max-save-core=i' => \$opt_max_save_core,
+
+ # Coverage, profiling etc
+ 'gcov' => \$opt_gcov,
+ 'gprof' => \$opt_gprof,
+ 'valgrind|valgrind-all' => \$opt_valgrind,
+ 'valgrind-mysqltest' => \$opt_valgrind_mysqltest,
+ 'valgrind-mysqld' => \$opt_valgrind_mysqld,
+ 'valgrind-options=s' => sub {
+ my ($opt, $value)= @_;
+ # Deprecated option unless it's what we know pushbuild uses
+ if ($value eq "--gen-suppressions=all --show-reachable=yes") {
+ push(@valgrind_args, $_) for (split(' ', $value));
+ return;
+ }
+ die("--valgrind-options=s is deprecated. Use ",
+ "--valgrind-option=s, to be specified several",
+ " times if necessary");
+ },
+ 'valgrind-option=s' => \@valgrind_args,
+ 'valgrind-path=s' => \$opt_valgrind_path,
+ 'callgrind' => \$opt_callgrind,
+
+ # Stress testing
+ 'stress' => \$opt_stress,
+ 'stress-suite=s' => \$opt_stress_suite,
+ 'stress-threads=i' => \$opt_stress_threads,
+ 'stress-test-file=s' => \$opt_stress_test_file,
+ 'stress-init-file=s' => \$opt_stress_init_file,
+ 'stress-mode=s' => \$opt_stress_mode,
+ 'stress-loop-count=i' => \$opt_stress_loop_count,
+ 'stress-test-count=i' => \$opt_stress_test_count,
+ 'stress-test-duration=i' => \$opt_stress_test_duration,
+
+ # Directories
+ 'tmpdir=s' => \$opt_tmpdir,
+ 'vardir=s' => \$opt_vardir,
+ 'benchdir=s' => \$glob_mysql_bench_dir,
+ 'mem' => \$opt_mem,
+ 'client-bindir=s' => \$path_client_bindir,
+ 'client-libdir=s' => \$path_client_libdir,
+
+ # Misc
+ 'report-features' => \$opt_report_features,
+ 'comment=s' => \$opt_comment,
+ 'debug' => \$opt_debug,
+ 'fast' => \$opt_fast,
+ 'reorder' => \$opt_reorder,
+ 'enable-disabled' => \$opt_enable_disabled,
+ 'script-debug' => \$opt_script_debug,
+ 'verbose' => \$opt_verbose,
+ 'sleep=i' => \$opt_sleep,
+ 'socket=s' => \$opt_socket,
+ 'start-dirty' => \$opt_start_dirty,
+ 'start-and-exit' => \$opt_start_and_exit,
+ 'timer!' => \$opt_timer,
+ 'user=s' => \$opt_user,
+ 'testcase-timeout=i' => \$opt_testcase_timeout,
+ 'suite-timeout=i' => \$opt_suite_timeout,
+ 'warnings|log-warnings' => \$opt_warnings,
+
+ # Options which are no longer used
+ (map { $_ => \&warn_about_removed_option } @removed_options),
+
+ 'help|h' => \$opt_usage,
+ ) or usage("Can't read options");
+
+ usage("") if $opt_usage;
+
+ $glob_scriptname= basename($0);
+
+ if ($opt_mtr_build_thread != 0)
+ {
+ set_mtr_build_thread_ports($opt_mtr_build_thread)
+ }
+ elsif ($ENV{'MTR_BUILD_THREAD'})
+ {
+ $opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'};
+ }
+
+ # We require that we are in the "mysql-test" directory
+ # to run mysql-test-run
+ if (! -f $glob_scriptname)
+ {
+ mtr_error("Can't find the location for the mysql-test-run script\n" .
+ "Go to to the mysql-test directory and execute the script " .
+ "as follows:\n./$glob_scriptname");
+ }
+
+ if ( -d "../sql" )
+ {
+ $source_dist= 1;
+ }
+
+ # Find the absolute path to the test directory
+ $glob_mysql_test_dir= cwd();
+ if ( $glob_cygwin_perl )
+ {
+ # Windows programs like 'mysqld' needs Windows paths
+ $glob_mysql_test_dir= `cygpath -m "$glob_mysql_test_dir"`;
+ chomp($glob_mysql_test_dir);
+ }
+ $default_vardir= "$glob_mysql_test_dir/var";
+
+ # In most cases, the base directory we find everything relative to,
+ # is the parent directory of the "mysql-test" directory. For source
+ # distributions, TAR binary distributions and some other packages.
+ $glob_basedir= dirname($glob_mysql_test_dir);
+
+ # In the RPM case, binaries and libraries are installed in the
+ # default system locations, instead of having our own private base
+ # directory. And we install "/usr/share/mysql-test". Moving up one
+ # more directory relative to "mysql-test" gives us a usable base
+ # directory for RPM installs.
+ if ( ! $source_dist and ! -d "$glob_basedir/bin" )
+ {
+ $glob_basedir= dirname($glob_basedir);
+ }
+
+ # Expect mysql-bench to be located adjacent to the source tree, by default
+ $glob_mysql_bench_dir= "$glob_basedir/../mysql-bench"
+ unless defined $glob_mysql_bench_dir;
+ $glob_mysql_bench_dir= undef
+ unless -d $glob_mysql_bench_dir;
+
+ $path_my_basedir=
+ $source_dist ? $glob_mysql_test_dir : $glob_basedir;
+
+ $glob_timers= mtr_init_timers();
+
+ # --------------------------------------------------------------------------
+ # Embedded server flag
+ # --------------------------------------------------------------------------
+ if ( $opt_embedded_server )
+ {
+ $glob_use_embedded_server= 1;
+ # Add the location for libmysqld.dll to the path.
+ if ( $glob_win32 )
+ {
+ my $lib_mysqld=
+ mtr_path_exists(vs_config_dirs('libmysqld',''));
+ $lib_mysqld= $glob_cygwin_perl ? ":".`cygpath "$lib_mysqld"`
+ : ";".$lib_mysqld;
+ chomp($lib_mysqld);
+ $ENV{'PATH'}="$ENV{'PATH'}".$lib_mysqld;
+ }
+
+ push(@glob_test_mode, "embedded");
+ $opt_skip_rpl= 1; # We never run replication with embedded
+ $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
+ $opt_skip_ssl= 1; # Turn off use of SSL
+
+ # Turn off use of bin log
+ push(@opt_extra_mysqld_opt, "--skip-log-bin");
+
+ if ( $opt_extern )
+ {
+ mtr_error("Can't use --extern with --embedded-server");
+ }
+ }
+
+ #
+ # Find the mysqld executable to be able to find the mysqld version
+ # number as early as possible
+ #
+
+ # Look for the client binaries directory
+ if ($path_client_bindir)
+ {
+ # --client-bindir=path set on command line, check that the path exists
+ $path_client_bindir= mtr_path_exists($path_client_bindir);
+ }
+ else
+ {
+ $path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
+ "$glob_basedir/client_debug",
+ vs_config_dirs('client', ''),
+ "$glob_basedir/client",
+ "$glob_basedir/bin");
+ }
+
+ # Look for language files and charsetsdir, use same share
+ $path_share= mtr_path_exists("$glob_basedir/share/mysql",
+ "$glob_basedir/sql/share",
+ "$glob_basedir/share");
+
+ $path_language= mtr_path_exists("$path_share/english");
+ $path_charsetsdir= mtr_path_exists("$path_share/charsets");
+
+
+ if (!$opt_extern)
+ {
+ $exe_mysqld= mtr_exe_exists (vs_config_dirs('sql', 'mysqld'),
+ vs_config_dirs('sql', 'mysqld-debug'),
+ "$glob_basedir/sql/mysqld",
+ "$path_client_bindir/mysqld-max-nt",
+ "$path_client_bindir/mysqld-max",
+ "$path_client_bindir/mysqld-nt",
+ "$path_client_bindir/mysqld",
+ "$path_client_bindir/mysqld-debug",
+ "$path_client_bindir/mysqld-max",
+ "$glob_basedir/libexec/mysqld",
+ "$glob_basedir/bin/mysqld",
+ "$glob_basedir/sbin/mysqld");
+
+ # Use the mysqld found above to find out what features are available
+ collect_mysqld_features();
+ }
+ else
+ {
+ $mysqld_variables{'port'}= 3306;
+ $mysqld_variables{'master-port'}= 3306;
+ }
+
+ if ( $opt_comment )
+ {
+ print "\n";
+ print '#' x 78, "\n";
+ print "# $opt_comment\n";
+ print '#' x 78, "\n\n";
+ }
+
+ foreach my $arg ( @ARGV )
+ {
+ if ( $arg =~ /^--skip-/ )
+ {
+ push(@opt_extra_mysqld_opt, $arg);
+ }
+ elsif ( $arg =~ /^--$/ )
+ {
+ # It is an effect of setting 'pass_through' in option processing
+ # that the lone '--' separating options from arguments survives,
+ # simply ignore it.
+ }
+ elsif ( $arg =~ /^-/ )
+ {
+ usage("Invalid option \"$arg\"");
+ }
+ else
+ {
+ push(@opt_cases, $arg);
+ }
+ }
+
+ # --------------------------------------------------------------------------
+ # Find out type of logging that are being used
+ # --------------------------------------------------------------------------
+ if (!$opt_extern && $mysql_version_id >= 50100 )
+ {
+ foreach my $arg ( @opt_extra_mysqld_opt )
+ {
+ if ( $arg =~ /binlog[-_]format=(\S+)/ )
+ {
+ $used_binlog_format= $1;
+ }
+ }
+ if (defined $used_binlog_format)
+ {
+ mtr_report("Using binlog format '$used_binlog_format'");
+ }
+ else
+ {
+ mtr_report("Using dynamic switching of binlog format");
+ }
+ }
+
+
+ # --------------------------------------------------------------------------
+ # Find out default storage engine being used(if any)
+ # --------------------------------------------------------------------------
+ if ( $opt_with_ndbcluster )
+ {
+ # --ndb or --with-ndbcluster turns on --default-storage-engine=ndbcluster
+ push(@opt_extra_mysqld_opt, "--default-storage-engine=ndbcluster");
+ }
+
+ foreach my $arg ( @opt_extra_mysqld_opt )
+ {
+ if ( $arg =~ /default-storage-engine=(\S+)/ )
+ {
+ $used_default_engine= $1;
+ }
+ }
+ mtr_report("Using default engine '$used_default_engine'")
+ if defined $used_default_engine;
+
+ # --------------------------------------------------------------------------
+ # Check if we should speed up tests by trying to run on tmpfs
+ # --------------------------------------------------------------------------
+ if ( defined $opt_mem )
+ {
+ mtr_error("Can't use --mem and --vardir at the same time ")
+ if $opt_vardir;
+ mtr_error("Can't use --mem and --tmpdir at the same time ")
+ if $opt_tmpdir;
+
+ # Search through list of locations that are known
+ # to be "fast disks" to list to find a suitable location
+ # Use --mem=<dir> as first location to look.
+ my @tmpfs_locations= ($opt_mem, "/dev/shm", "/tmp");
+
+ foreach my $fs (@tmpfs_locations)
+ {
+ if ( -d $fs )
+ {
+ mtr_report("Using tmpfs in $fs");
+ $opt_mem= "$fs/var";
+ $opt_mem .= $opt_mtr_build_thread if $opt_mtr_build_thread;
+ last;
+ }
+ }
+ }
+
+ # --------------------------------------------------------------------------
+ # Set the "var/" directory, as it is the base for everything else
+ # --------------------------------------------------------------------------
+ if ( ! $opt_vardir )
+ {
+ $opt_vardir= $default_vardir;
+ }
+ elsif ( $mysql_version_id < 50000 and
+ $opt_vardir ne $default_vardir)
+ {
+ # Version 4.1 and --vardir was specified
+ # Only supported as a symlink from var/
+ # by setting up $opt_mem that symlink will be created
+ if ( ! $glob_win32 )
+ {
+ # Only platforms that have native symlinks can use the vardir trick
+ $opt_mem= $opt_vardir;
+ mtr_report("Using 4.1 vardir trick");
+ }
+
+ $opt_vardir= $default_vardir;
+ }
+
+ $path_vardir_trace= $opt_vardir;
+ # Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/...
+ $path_vardir_trace=~ s/^\w://;
+
+ # We make the path absolute, as the server will do a chdir() before usage
+ unless ( $opt_vardir =~ m,^/, or
+ ($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) )
+ {
+ # Make absolute path, relative test dir
+ $opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
+ }
+
+ # --------------------------------------------------------------------------
+ # Set tmpdir
+ # --------------------------------------------------------------------------
+ $opt_tmpdir= "$opt_vardir/tmp" unless $opt_tmpdir;
+ $opt_tmpdir =~ s,/+$,,; # Remove ending slash if any
+
+ # --------------------------------------------------------------------------
+ # Check im suport
+ # --------------------------------------------------------------------------
+ if ($opt_extern)
+ {
+ mtr_report("Disable instance manager when running with extern mysqld");
+ $opt_skip_im= 1;
+ }
+ elsif ( $mysql_version_id < 50000 )
+ {
+ # Instance manager is not supported until 5.0
+ $opt_skip_im= 1;
+ }
+ elsif ( $glob_win32 )
+ {
+ mtr_report("Disable Instance manager - testing not supported on Windows");
+ $opt_skip_im= 1;
+ }
+
+ # --------------------------------------------------------------------------
+ # Record flag
+ # --------------------------------------------------------------------------
+ if ( $opt_record and ! @opt_cases )
+ {
+ mtr_error("Will not run in record mode without a specific test case");
+ }
+
+ if ( $opt_record )
+ {
+ $opt_skip_combination = 1;
+ }
+
+ # --------------------------------------------------------------------------
+ # ps protcol flag
+ # --------------------------------------------------------------------------
+ if ( $opt_ps_protocol )
+ {
+ push(@glob_test_mode, "ps-protocol");
+ }
+
+ # --------------------------------------------------------------------------
+ # Bench flags
+ # --------------------------------------------------------------------------
+ if ( $opt_small_bench )
+ {
+ $opt_bench= 1;
+ }
+
+ # --------------------------------------------------------------------------
+ # Big test flags
+ # --------------------------------------------------------------------------
+ if ( $opt_big_test )
+ {
+ $ENV{'BIG_TEST'}= 1;
+ }
+
+ # --------------------------------------------------------------------------
+ # Gcov flag
+ # --------------------------------------------------------------------------
+ if ( $opt_gcov and ! $source_dist )
+ {
+ mtr_error("Coverage test needs the source - please use source dist");
+ }
+
+ # --------------------------------------------------------------------------
+ # Check debug related options
+ # --------------------------------------------------------------------------
+ if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd ||
+ $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug ||
+ $opt_debugger || $opt_client_debugger )
+ {
+ # Indicate that we are using debugger
+ $glob_debugger= 1;
+ if ( $opt_extern )
+ {
+ mtr_error("Can't use --extern when using debugger");
+ }
+ }
+
+ # --------------------------------------------------------------------------
+ # Check if special exe was selected for master or slave
+ # --------------------------------------------------------------------------
+ $exe_master_mysqld= $exe_master_mysqld || $exe_mysqld;
+ $exe_slave_mysqld= $exe_slave_mysqld || $exe_mysqld;
+
+ # --------------------------------------------------------------------------
+ # Check valgrind arguments
+ # --------------------------------------------------------------------------
+ if ( $opt_valgrind or $opt_valgrind_path or @valgrind_args)
+ {
+ mtr_report("Turning on valgrind for all executables");
+ $opt_valgrind= 1;
+ $opt_valgrind_mysqld= 1;
+ $opt_valgrind_mysqltest= 1;
+ }
+ elsif ( $opt_valgrind_mysqld )
+ {
+ mtr_report("Turning on valgrind for mysqld(s) only");
+ $opt_valgrind= 1;
+ }
+ elsif ( $opt_valgrind_mysqltest )
+ {
+ mtr_report("Turning on valgrind for mysqltest and mysql_client_test only");
+ $opt_valgrind= 1;
+ }
+
+ if ( $opt_callgrind )
+ {
+ mtr_report("Turning on valgrind with callgrind for mysqld(s)");
+ $opt_valgrind= 1;
+ $opt_valgrind_mysqld= 1;
+
+ # Set special valgrind options unless options passed on command line
+ push(@valgrind_args, "--trace-children=yes")
+ unless @valgrind_args;
+ }
+
+ if ( $opt_valgrind )
+ {
+ # Set valgrind_options to default unless already defined
+ push(@valgrind_args, @default_valgrind_args)
+ unless @valgrind_args;
+
+ mtr_report("Running valgrind with options \"",
+ join(" ", @valgrind_args), "\"");
+ }
+
+ if ( ! $opt_testcase_timeout )
+ {
+ $opt_testcase_timeout= $default_testcase_timeout;
+ $opt_testcase_timeout*= 10 if $opt_valgrind;
+ $opt_testcase_timeout*= 10 if ($opt_debug and $glob_win32);
+ }
+
+ if ( ! $opt_suite_timeout )
+ {
+ $opt_suite_timeout= $default_suite_timeout;
+ $opt_suite_timeout*= 6 if $opt_valgrind;
+ $opt_suite_timeout*= 6 if ($opt_debug and $glob_win32);
+ }
+
+ if ( ! $opt_user )
+ {
+ if ( $opt_extern )
+ {
+ $opt_user= "test";
+ }
+ else
+ {
+ $opt_user= "root"; # We want to do FLUSH xxx commands
+ }
+ }
+
+ # On QNX, /tmp/dir/master.sock and /tmp/dir//master.sock seem to be
+ # considered different, so avoid the extra slash (/) in the socket
+ # paths.
+ my $sockdir = $opt_tmpdir;
+ $sockdir =~ s|/+$||;
+
+ # On some operating systems, there is a limit to the length of a
+ # UNIX domain socket's path far below PATH_MAX, so try to avoid long
+ # socket path names.
+ $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) >= 70 );
+
+ $master->[0]=
+ {
+ pid => 0,
+ type => "master",
+ idx => 0,
+ path_myddir => "$opt_vardir/master-data",
+ path_myerr => "$opt_vardir/log/master.err",
+ path_pid => "$opt_vardir/run/master.pid",
+ path_sock => "$sockdir/master.sock",
+ port => $opt_master_myport,
+ start_timeout => 400, # enough time create innodb tables
+ cluster => 0, # index in clusters list
+ start_opts => [],
+ };
+
+ $master->[1]=
+ {
+ pid => 0,
+ type => "master",
+ idx => 1,
+ path_myddir => "$opt_vardir/master1-data",
+ path_myerr => "$opt_vardir/log/master1.err",
+ path_pid => "$opt_vardir/run/master1.pid",
+ path_sock => "$sockdir/master1.sock",
+ port => $opt_master_myport + 1,
+ start_timeout => 400, # enough time create innodb tables
+ cluster => 0, # index in clusters list
+ start_opts => [],
+ };
+
+ $slave->[0]=
+ {
+ pid => 0,
+ type => "slave",
+ idx => 0,
+ path_myddir => "$opt_vardir/slave-data",
+ path_myerr => "$opt_vardir/log/slave.err",
+ path_pid => "$opt_vardir/run/slave.pid",
+ path_sock => "$sockdir/slave.sock",
+ port => $opt_slave_myport,
+ start_timeout => 400,
+
+ cluster => 1, # index in clusters list
+ start_opts => [],
+ };
+
+ $slave->[1]=
+ {
+ pid => 0,
+ type => "slave",
+ idx => 1,
+ path_myddir => "$opt_vardir/slave1-data",
+ path_myerr => "$opt_vardir/log/slave1.err",
+ path_pid => "$opt_vardir/run/slave1.pid",
+ path_sock => "$sockdir/slave1.sock",
+ port => $opt_slave_myport + 1,
+ start_timeout => 300,
+ cluster => -1, # index in clusters list
+ start_opts => [],
+ };
+
+ $slave->[2]=
+ {
+ pid => 0,
+ type => "slave",
+ idx => 2,
+ path_myddir => "$opt_vardir/slave2-data",
+ path_myerr => "$opt_vardir/log/slave2.err",
+ path_pid => "$opt_vardir/run/slave2.pid",
+ path_sock => "$sockdir/slave2.sock",
+ port => $opt_slave_myport + 2,
+ start_timeout => 300,
+ cluster => -1, # index in clusters list
+ start_opts => [],
+ };
+
+ $instance_manager=
+ {
+ path_err => "$opt_vardir/log/im.err",
+ path_log => "$opt_vardir/log/im.log",
+ path_pid => "$opt_vardir/run/im.pid",
+ path_angel_pid => "$opt_vardir/run/im.angel.pid",
+ path_sock => "$sockdir/im.sock",
+ port => $im_port,
+ start_timeout => $master->[0]->{'start_timeout'},
+ admin_login => 'im_admin',
+ admin_password => 'im_admin_secret',
+ admin_sha1 => '*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295',
+ password_file => "$opt_vardir/im.passwd",
+ defaults_file => "$opt_vardir/im.cnf",
+ };
+
+ $instance_manager->{'instances'}->[0]=
+ {
+ server_id => 1,
+ port => $im_mysqld1_port,
+ path_datadir => "$opt_vardir/im_mysqld_1.data",
+ path_sock => "$sockdir/mysqld_1.sock",
+ path_pid => "$opt_vardir/run/mysqld_1.pid",
+ start_timeout => 400, # enough time create innodb tables
+ old_log_format => 1
+ };
+
+ $instance_manager->{'instances'}->[1]=
+ {
+ server_id => 2,
+ port => $im_mysqld2_port,
+ path_datadir => "$opt_vardir/im_mysqld_2.data",
+ path_sock => "$sockdir/mysqld_2.sock",
+ path_pid => "$opt_vardir/run/mysqld_2.pid",
+ nonguarded => 1,
+ start_timeout => 400, # enough time create innodb tables
+ old_log_format => 1
+ };
+
+ my $data_dir= "$opt_vardir/ndbcluster-$opt_ndbcluster_port";
+ $clusters->[0]=
+ {
+ name => "Master",
+ nodes => 2,
+ port => "$opt_ndbcluster_port",
+ data_dir => "$data_dir",
+ connect_string => "host=localhost:$opt_ndbcluster_port",
+ path_pid => "$data_dir/ndb_3.pid", # Nodes + 1
+ pid => 0, # pid of ndb_mgmd
+ installed_ok => 0,
+ };
+
+ $data_dir= "$opt_vardir/ndbcluster-$opt_ndbcluster_port_slave";
+ $clusters->[1]=
+ {
+ name => "Slave",
+ nodes => 1,
+ port => "$opt_ndbcluster_port_slave",
+ data_dir => "$data_dir",
+ connect_string => "host=localhost:$opt_ndbcluster_port_slave",
+ path_pid => "$data_dir/ndb_2.pid", # Nodes + 1
+ pid => 0, # pid of ndb_mgmd
+ installed_ok => 0,
+ };
+
+ # Init pids of ndbd's
+ foreach my $cluster ( @{$clusters} )
+ {
+ for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
+ {
+ my $nodeid= $idx+1;
+ $cluster->{'ndbds'}->[$idx]=
+ {
+ pid => 0,
+ nodeid => $nodeid,
+ path_pid => "$cluster->{'data_dir'}/ndb_${nodeid}.pid",
+ path_fs => "$cluster->{'data_dir'}/ndb_${nodeid}_fs",
+ };
+ }
+ }
+
+ # --------------------------------------------------------------------------
+ # extern
+ # --------------------------------------------------------------------------
+ if ( $opt_extern )
+ {
+ # Turn off features not supported when running with extern server
+ $opt_skip_rpl= 1;
+ $opt_skip_ndbcluster= 1;
+
+ # Setup master->[0] with the settings for the extern server
+ $master->[0]->{'path_sock'}= $opt_socket ? $opt_socket : "/tmp/mysql.sock";
+ mtr_report("Using extern server at '$master->[0]->{path_sock}'");
+ }
+ else
+ {
+ mtr_error("--socket can only be used in combination with --extern")
+ if $opt_socket;
+ }
+
+
+ # --------------------------------------------------------------------------
+ # ndbconnectstring and ndbconnectstring_slave
+ # --------------------------------------------------------------------------
+ if ( $opt_ndbconnectstring )
+ {
+ # ndbconnectstring was supplied by user, the tests shoudl be run
+ # against an already started cluster, change settings
+ my $cluster= $clusters->[0]; # Master cluster
+ $cluster->{'connect_string'}= $opt_ndbconnectstring;
+ $cluster->{'use_running'}= 1;
+
+ mtr_error("Can't specify --ndb-connectstring and --skip-ndbcluster")
+ if $opt_skip_ndbcluster;
+ }
+ $ENV{'NDB_CONNECTSTRING'}= $clusters->[0]->{'connect_string'};
+
+
+ if ( $opt_ndbconnectstring_slave )
+ {
+ # ndbconnectstring-slave was supplied by user, the tests should be run
+ # agains an already started slave cluster, change settings
+ my $cluster= $clusters->[1]; # Slave cluster
+ $cluster->{'connect_string'}= $opt_ndbconnectstring_slave;
+ $cluster->{'use_running'}= 1;
+
+ mtr_error("Can't specify ndb-connectstring_slave and " .
+ "--skip-ndbcluster-slave")
+ if $opt_skip_ndbcluster_slave;
+ }
+
+
+ $path_timefile= "$opt_vardir/log/mysqltest-time";
+ $path_mysqltest_log= "$opt_vardir/log/mysqltest.log";
+ $path_current_test_log= "$opt_vardir/log/current_test";
+ $path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
+
+ $path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
+
+ if ( $opt_valgrind and $opt_debug )
+ {
+ # When both --valgrind and --debug is selected, send
+ # all output to the trace file, making it possible to
+ # see the exact location where valgrind complains
+ foreach my $mysqld (@{$master}, @{$slave})
+ {
+ my $sidx= $mysqld->{idx} ? "$mysqld->{idx}" : "";
+ $mysqld->{path_myerr}=
+ "$opt_vardir/log/" . $mysqld->{type} . "$sidx.trace";
+ }
+ }
+}
+
+#
+# To make it easier for different devs to work on the same host,
+# an environment variable can be used to control all ports. A small
+# number is to be used, 0 - 16 or similar.
+#
+# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
+# versions of this script, else a 4.0 test run might conflict with a
+# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
+# all port numbers might not be used in this version of the script.
+#
+# Also note the limitation of ports we are allowed to hand out. This
+# differs between operating systems and configuration, see
+# http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
+# But a fairly safe range seems to be 5001 - 32767
+#
+
+sub set_mtr_build_thread_ports($) {
+ my $mtr_build_thread= shift;
+
+ if ( lc($mtr_build_thread) eq 'auto' ) {
+ print "Requesting build thread... ";
+ $ENV{'MTR_BUILD_THREAD'} = $mtr_build_thread = mtr_require_unique_id_and_wait("/tmp/mysql-test-ports", 200, 299);
+ print "got ".$mtr_build_thread."\n";
+ }
+
+ # Up to two masters, up to three slaves
+ # A magic value in command_line_setup depends on these equations.
+ $opt_master_myport= $mtr_build_thread * 10 + 10000; # and 1
+ $opt_slave_myport= $opt_master_myport + 2; # and 3 4
+ $opt_ndbcluster_port= $opt_master_myport + 5;
+ $opt_ndbcluster_port_slave= $opt_master_myport + 6;
+ $im_port= $opt_master_myport + 7;
+ $im_mysqld1_port= $opt_master_myport + 8;
+ $im_mysqld2_port= $opt_master_myport + 9;
+
+ if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
+ {
+ mtr_error("MTR_BUILD_THREAD number results in a port",
+ "outside 5001 - 32767",
+ "($opt_master_myport - $opt_master_myport + 10)");
+ }
+}
+
+
+sub datadir_list_setup () {
+
+ # Make a list of all data_dirs
+ for (my $idx= 0; $idx < $max_master_num; $idx++)
+ {
+ push(@data_dir_lst, $master->[$idx]->{'path_myddir'});
+ }
+
+ for (my $idx= 0; $idx < $max_slave_num; $idx++)
+ {
+ push(@data_dir_lst, $slave->[$idx]->{'path_myddir'});
+ }
+
+ unless ($opt_skip_im)
+ {
+ foreach my $instance (@{$instance_manager->{'instances'}})
+ {
+ push(@data_dir_lst, $instance->{'path_datadir'});
+ }
+ }
+}
+
+
+##############################################################################
+#
+# Set paths to various executable programs
+#
+##############################################################################
+
+
+sub collect_mysqld_features () {
+ my $found_variable_list_start= 0;
+ my $tmpdir;
+ if ( $opt_tmpdir ) {
+ # Use the requested tmpdir
+ mkpath($opt_tmpdir) if (! -d $opt_tmpdir);
+ $tmpdir= $opt_tmpdir;
+ }
+ else {
+ $tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function
+ }
+
+ #
+ # Execute "mysqld --help --verbose" to get a list
+ # list of all features and settings
+ #
+ # --no-defaults and --skip-grant-tables are to avoid loading
+ # system-wide configs and plugins
+ #
+ # --datadir must exist, mysqld will chdir into it
+ #
+ my $list= `$exe_mysqld --no-defaults --datadir=$tmpdir --language=$path_language --skip-grant-tables --verbose --help`;
+
+ foreach my $line (split('\n', $list))
+ {
+ # First look for version
+ if ( !$mysql_version_id )
+ {
+ # Look for version
+ my $exe_name= basename($exe_mysqld);
+ mtr_verbose("exe_name: $exe_name");
+ if ( $line =~ /^\S*$exe_name\s\sVer\s([0-9]*)\.([0-9]*)\.([0-9]*)/ )
+ {
+ #print "Major: $1 Minor: $2 Build: $3\n";
+ $mysql_version_id= $1*10000 + $2*100 + $3;
+ #print "mysql_version_id: $mysql_version_id\n";
+ mtr_report("MySQL Version $1.$2.$3");
+ }
+ }
+ else
+ {
+ if (!$found_variable_list_start)
+ {
+ # Look for start of variables list
+ if ( $line =~ /[\-]+\s[\-]+/ )
+ {
+ $found_variable_list_start= 1;
+ }
+ }
+ else
+ {
+ # Put variables into hash
+ if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ )
+ {
+ # print "$1=\"$2\"\n";
+ $mysqld_variables{$1}= $2;
+ }
+ else
+ {
+ # The variable list is ended with a blank line
+ if ( $line =~ /^[\s]*$/ )
+ {
+ last;
+ }
+ else
+ {
+ # Send out a warning, we should fix the variables that has no
+ # space between variable name and it's value
+ # or should it be fixed width column parsing? It does not
+ # look like that in function my_print_variables in my_getopt.c
+ mtr_warning("Could not parse variable list line : $line");
+ }
+ }
+ }
+ }
+ }
+ rmtree($tmpdir) if (!$opt_tmpdir);
+ mtr_error("Could not find version of MySQL") unless $mysql_version_id;
+ mtr_error("Could not find variabes list") unless $found_variable_list_start;
+
+}
+
+
+sub run_query($$) {
+ my ($mysqld, $query)= @_;
+
+ my $args;
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--user=%s", $opt_user);
+ mtr_add_arg($args, "--port=%d", $mysqld->{'port'});
+ mtr_add_arg($args, "--socket=%s", $mysqld->{'path_sock'});
+ mtr_add_arg($args, "--silent"); # Tab separated output
+ mtr_add_arg($args, "-e '%s'", $query);
+
+ my $cmd= "$exe_mysql " . join(' ', @$args);
+ mtr_verbose("cmd: $cmd");
+ return `$cmd`;
+}
+
+
+sub collect_mysqld_features_from_running_server ()
+{
+ my $list= run_query($master->[0], "use mysql; SHOW VARIABLES");
+
+ foreach my $line (split('\n', $list))
+ {
+ # Put variables into hash
+ if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ )
+ {
+ print "$1=\"$2\"\n";
+ $mysqld_variables{$1}= $2;
+ }
+ }
+}
+
+sub executable_setup_im () {
+
+ # Look for instance manager binary - mysqlmanager
+ $exe_im=
+ mtr_exe_maybe_exists(
+ "$glob_basedir/server-tools/instance-manager/mysqlmanager",
+ "$glob_basedir/libexec/mysqlmanager",
+ "$glob_basedir/bin/mysqlmanager",
+ "$glob_basedir/sbin/mysqlmanager");
+
+ return ($exe_im eq "");
+}
+
+sub executable_setup_ndb () {
+
+ # Look for ndb tols and binaries
+ my $ndb_path= mtr_file_exists("$glob_basedir/ndb",
+ "$glob_basedir/storage/ndb",
+ "$glob_basedir/bin");
+
+ $exe_ndbd=
+ mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd",
+ "$ndb_path/ndbd",
+ "$glob_basedir/libexec/ndbd");
+ $exe_ndb_mgm=
+ mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm",
+ "$ndb_path/ndb_mgm");
+ $exe_ndb_mgmd=
+ mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd",
+ "$ndb_path/ndb_mgmd",
+ "$glob_basedir/libexec/ndb_mgmd");
+ $exe_ndb_waiter=
+ mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter",
+ "$ndb_path/ndb_waiter");
+
+ # May not exist
+ $path_ndb_tools_dir= mtr_file_exists("$ndb_path/tools",
+ "$ndb_path");
+ # May not exist
+ $path_ndb_examples_dir=
+ mtr_file_exists("$ndb_path/ndbapi-examples",
+ "$ndb_path/examples");
+ # May not exist
+ $exe_ndb_example=
+ mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple");
+
+ return ( $exe_ndbd eq "" or
+ $exe_ndb_mgm eq "" or
+ $exe_ndb_mgmd eq "" or
+ $exe_ndb_waiter eq "");
+}
+
+sub executable_setup () {
+
+ #
+ # Check if libtool is available in this distribution/clone
+ # we need it when valgrinding or debugging non installed binary
+ # Otherwise valgrind will valgrind the libtool wrapper or bash
+ # and gdb will not find the real executable to debug
+ #
+ if ( -x "../libtool")
+ {
+ $exe_libtool= "../libtool";
+ if ($opt_valgrind or $glob_debugger)
+ {
+ mtr_report("Using \"$exe_libtool\" when running valgrind or debugger");
+ }
+ }
+
+ # Look for my_print_defaults
+ $exe_my_print_defaults=
+ mtr_exe_exists(vs_config_dirs('extra', 'my_print_defaults'),
+ "$path_client_bindir/my_print_defaults",
+ "$glob_basedir/extra/my_print_defaults");
+
+ # Look for perror
+ $exe_perror= mtr_exe_exists(vs_config_dirs('extra', 'perror'),
+ "$glob_basedir/extra/perror",
+ "$path_client_bindir/perror");
+
+ # Look for the client binaries
+ $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
+ $exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
+ $exe_mysqlimport= mtr_exe_exists("$path_client_bindir/mysqlimport");
+ $exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
+ $exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
+ $exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
+ $exe_mysql= mtr_exe_exists("$path_client_bindir/mysql");
+
+ if (!$opt_extern)
+ {
+ # Look for SQL scripts directory
+ if ( mtr_file_exists("$path_share/mysql_system_tables.sql") ne "")
+ {
+ # The SQL scripts are in path_share
+ $path_sql_dir= $path_share;
+ }
+ else
+ {
+ $path_sql_dir= mtr_path_exists("$glob_basedir/share",
+ "$glob_basedir/scripts");
+ }
+
+ if ( $mysql_version_id >= 50100 )
+ {
+ $exe_mysqlslap= mtr_exe_exists("$path_client_bindir/mysqlslap");
+ }
+ if ( $mysql_version_id >= 50000 and !$glob_use_embedded_server )
+ {
+ $exe_mysql_upgrade= mtr_exe_exists("$path_client_bindir/mysql_upgrade")
+ }
+ else
+ {
+ $exe_mysql_upgrade= "";
+ }
+
+ if ( ! $glob_win32 )
+ {
+ # Look for mysql_fix_system_table script
+ $exe_mysql_fix_system_tables=
+ mtr_script_exists("$glob_basedir/scripts/mysql_fix_privilege_tables",
+ "$path_client_bindir/mysql_fix_privilege_tables");
+ }
+
+ # Look for mysql_fix_privilege_tables.sql script
+ $file_mysql_fix_privilege_tables=
+ mtr_file_exists("$glob_basedir/scripts/mysql_fix_privilege_tables.sql",
+ "$glob_basedir/share/mysql_fix_privilege_tables.sql",
+ "$glob_basedir/share/mysql/mysql_fix_privilege_tables.sql");
+
+ if ( ! $opt_skip_ndbcluster and executable_setup_ndb())
+ {
+ mtr_warning("Could not find all required ndb binaries, " .
+ "all ndb tests will fail, use --skip-ndbcluster to " .
+ "skip testing it.");
+
+ foreach my $cluster (@{$clusters})
+ {
+ $cluster->{"executable_setup_failed"}= 1;
+ }
+ }
+
+ if ( ! $opt_skip_im and executable_setup_im())
+ {
+ mtr_warning("Could not find all required instance manager binaries, " .
+ "all im tests will fail, use --skip-im to " .
+ "continue without instance manager");
+ $instance_manager->{"executable_setup_failed"}= 1;
+ }
+
+ # Look for the udf_example library
+ $lib_udf_example=
+ mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'),
+ "$glob_basedir/sql/.libs/udf_example.so",);
+
+ # Look for the ha_example library
+ $lib_example_plugin=
+ mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
+ "$glob_basedir/storage/example/.libs/ha_example.so",);
+
+ }
+
+ # Look for mysqltest executable
+ if ( $glob_use_embedded_server )
+ {
+ $exe_mysqltest=
+ mtr_exe_exists(vs_config_dirs('libmysqld/examples','mysqltest_embedded'),
+ "$glob_basedir/libmysqld/examples/mysqltest_embedded",
+ "$path_client_bindir/mysqltest_embedded");
+ }
+ else
+ {
+ $exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
+ }
+
+ # Look for mysql_client_test executable which may _not_ exist in
+ # some versions, test using it should be skipped
+ if ( $glob_use_embedded_server )
+ {
+ $exe_mysql_client_test=
+ mtr_exe_maybe_exists(
+ vs_config_dirs('libmysqld/examples', 'mysql_client_test_embedded'),
+ "$glob_basedir/libmysqld/examples/mysql_client_test_embedded");
+ }
+ else
+ {
+ $exe_mysql_client_test=
+ mtr_exe_maybe_exists(vs_config_dirs('tests', 'mysql_client_test'),
+ "$glob_basedir/tests/mysql_client_test",
+ "$glob_basedir/bin/mysql_client_test");
+ }
+
+ # Look for bug25714 executable which may _not_ exist in
+ # some versions, test using it should be skipped
+ $exe_bug25714=
+ mtr_exe_maybe_exists(vs_config_dirs('tests', 'bug25714'),
+ "$glob_basedir/tests/bug25714");
+}
+
+
+sub generate_cmdline_mysqldump ($) {
+ my($mysqld) = @_;
+ return
+ mtr_native_path($exe_mysqldump) .
+ " --no-defaults -uroot --debug-check " .
+ "--port=$mysqld->{'port'} " .
+ "--socket=$mysqld->{'path_sock'} --password=";
+}
+
+
+##############################################################################
+#
+# Set environment to be used by childs of this process for
+# things that are constant duting the whole lifetime of mysql-test-run.pl
+#
+##############################################################################
+
+sub mysql_client_test_arguments()
+{
+ my $exe= $exe_mysql_client_test;
+
+ my $args;
+ mtr_init_args(\$args);
+ if ( $opt_valgrind_mysqltest )
+ {
+ valgrind_arguments($args, \$exe);
+ }
+
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--testcase");
+ mtr_add_arg($args, "--user=root");
+ mtr_add_arg($args, "--port=$master->[0]->{'port'}");
+ mtr_add_arg($args, "--socket=$master->[0]->{'path_sock'}");
+
+ if ( $opt_extern || $mysql_version_id >= 50000 )
+ {
+ mtr_add_arg($args, "--vardir=$opt_vardir")
+ }
+
+ if ( $opt_debug )
+ {
+ mtr_add_arg($args,
+ "--debug=d:t:A,$path_vardir_trace/log/mysql_client_test.trace");
+ }
+
+ if ( $glob_use_embedded_server )
+ {
+ mtr_add_arg($args,
+ " -A --language=$path_language");
+ mtr_add_arg($args,
+ " -A --datadir=$slave->[0]->{'path_myddir'}");
+ mtr_add_arg($args,
+ " -A --character-sets-dir=$path_charsetsdir");
+ }
+
+ return join(" ", $exe, @$args);
+}
+
+sub mysql_upgrade_arguments()
+{
+ my $exe= $exe_mysql_upgrade;
+
+ my $args;
+ mtr_init_args(\$args);
+# if ( $opt_valgrind_mysql_ugrade )
+# {
+# valgrind_arguments($args, \$exe);
+# }
+
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--user=root");
+ mtr_add_arg($args, "--port=$master->[0]->{'port'}");
+ mtr_add_arg($args, "--socket=$master->[0]->{'path_sock'}");
+ mtr_add_arg($args, "--datadir=$master->[0]->{'path_myddir'}");
+ mtr_add_arg($args, "--basedir=$glob_basedir");
+ mtr_add_arg($args, "--tmpdir=$opt_tmpdir");
+
+ if ( $opt_debug )
+ {
+ mtr_add_arg($args,
+ "--debug=d:t:A,$path_vardir_trace/log/mysql_upgrade.trace");
+ }
+
+ return join(" ", $exe, @$args);
+}
+
+# Note that some env is setup in spawn/run, in "mtr_process.pl"
+
+sub environment_setup () {
+
+ umask(022);
+
+ my @ld_library_paths;
+
+ if ($path_client_libdir)
+ {
+ # Use the --client-libdir passed on commandline
+ push(@ld_library_paths, "$path_client_libdir");
+ }
+ else
+ {
+ # Setup LD_LIBRARY_PATH so the libraries from this distro/clone
+ # are used in favor of the system installed ones
+ if ( $source_dist )
+ {
+ push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
+ "$glob_basedir/libmysql_r/.libs/",
+ "$glob_basedir/zlib.libs/");
+ }
+ else
+ {
+ push(@ld_library_paths, "$glob_basedir/lib");
+ }
+ }
+
+ # --------------------------------------------------------------------------
+ # Add the path where libndbclient can be found
+ # --------------------------------------------------------------------------
+ if ( $glob_ndbcluster_supported )
+ {
+ push(@ld_library_paths, "$glob_basedir/storage/ndb/src/.libs");
+ }
+
+ # --------------------------------------------------------------------------
+ # Valgrind need to be run with debug libraries otherwise it's almost
+ # impossible to add correct supressions, that means if "/usr/lib/debug"
+ # is available, it should be added to
+ # LD_LIBRARY_PATH
+ #
+ # But pthread is broken in libc6-dbg on Debian <= 3.1 (see Debian
+ # bug 399035, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=399035),
+ # so don't change LD_LIBRARY_PATH on that platform.
+ # --------------------------------------------------------------------------
+ my $debug_libraries_path= "/usr/lib/debug";
+ my $deb_version;
+ if ( $opt_valgrind and -d $debug_libraries_path and
+ (! -e '/etc/debian_version' or
+ ($deb_version= mtr_grab_file('/etc/debian_version')) !~ /^[0-9]+\.[0-9]$/ or
+ $deb_version > 3.1 ) )
+ {
+ push(@ld_library_paths, $debug_libraries_path);
+ }
+
+ $ENV{'LD_LIBRARY_PATH'}= join(":", @ld_library_paths,
+ $ENV{'LD_LIBRARY_PATH'} ?
+ split(':', $ENV{'LD_LIBRARY_PATH'}) : ());
+ mtr_debug("LD_LIBRARY_PATH: $ENV{'LD_LIBRARY_PATH'}");
+
+ $ENV{'DYLD_LIBRARY_PATH'}= join(":", @ld_library_paths,
+ $ENV{'DYLD_LIBRARY_PATH'} ?
+ split(':', $ENV{'DYLD_LIBRARY_PATH'}) : ());
+ mtr_debug("DYLD_LIBRARY_PATH: $ENV{'DYLD_LIBRARY_PATH'}");
+
+ # The environment variable used for shared libs on AIX
+ $ENV{'SHLIB_PATH'}= join(":", @ld_library_paths,
+ $ENV{'SHLIB_PATH'} ?
+ split(':', $ENV{'SHLIB_PATH'}) : ());
+ mtr_debug("SHLIB_PATH: $ENV{'SHLIB_PATH'}");
+
+ # The environment variable used for shared libs on hp-ux
+ $ENV{'LIBPATH'}= join(":", @ld_library_paths,
+ $ENV{'LIBPATH'} ?
+ split(':', $ENV{'LIBPATH'}) : ());
+ mtr_debug("LIBPATH: $ENV{'LIBPATH'}");
+
+ # --------------------------------------------------------------------------
+ # Also command lines in .opt files may contain env vars
+ # --------------------------------------------------------------------------
+
+ $ENV{'CHARSETSDIR'}= $path_charsetsdir;
+ $ENV{'UMASK'}= "0660"; # The octal *string*
+ $ENV{'UMASK_DIR'}= "0770"; # The octal *string*
+
+ #
+ # MySQL tests can produce output in various character sets
+ # (especially, ctype_xxx.test). To avoid confusing Perl
+ # with output which is incompatible with the current locale
+ # settings, we reset the current values of LC_ALL and LC_CTYPE to "C".
+ # For details, please see
+ # Bug#27636 tests fails if LC_* variables set to *_*.UTF-8
+ #
+ $ENV{'LC_ALL'}= "C";
+ $ENV{'LC_CTYPE'}= "C";
+
+ $ENV{'LC_COLLATE'}= "C";
+ $ENV{'USE_RUNNING_SERVER'}= $opt_extern;
+ $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;
+ $ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
+ $ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
+ $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_sock'};
+ $ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_sock'};
+ $ENV{'MASTER_MYPORT'}= $master->[0]->{'port'};
+ $ENV{'MASTER_MYPORT1'}= $master->[1]->{'port'};
+ $ENV{'SLAVE_MYSOCK'}= $slave->[0]->{'path_sock'};
+ $ENV{'SLAVE_MYPORT'}= $slave->[0]->{'port'};
+ $ENV{'SLAVE_MYPORT1'}= $slave->[1]->{'port'};
+ $ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'};
+ $ENV{'MYSQL_TCP_PORT'}= $mysqld_variables{'port'};
+ $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'};
+
+ $ENV{'IM_PATH_SOCK'}= $instance_manager->{path_sock};
+ $ENV{'IM_USERNAME'}= $instance_manager->{admin_login};
+ $ENV{'IM_PASSWORD'}= $instance_manager->{admin_password};
+ $ENV{MTR_BUILD_THREAD}= $opt_mtr_build_thread;
+
+ $ENV{'EXE_MYSQL'}= $exe_mysql;
+
+
+ # ----------------------------------------------------
+ # Setup env for NDB
+ # ----------------------------------------------------
+ if ( ! $opt_skip_ndbcluster )
+ {
+ $ENV{'NDB_MGM'}= $exe_ndb_mgm;
+
+ $ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port;
+ $ENV{'NDBCLUSTER_PORT_SLAVE'}= $opt_ndbcluster_port_slave;
+
+ $ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test;
+
+ $ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'};
+ $ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
+ $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
+ $ENV{'NDB_TOOLS_OUTPUT'}= $path_ndb_testrun_log;
+
+ if ( $mysql_version_id >= 50000 )
+ {
+ $ENV{'NDB_EXAMPLES_DIR'}= $path_ndb_examples_dir;
+ $ENV{'MY_NDB_EXAMPLES_BINARY'}= $exe_ndb_example;
+ }
+ $ENV{'NDB_EXAMPLES_OUTPUT'}= $path_ndb_testrun_log;
+ }
+
+ # ----------------------------------------------------
+ # Setup env for IM
+ # ----------------------------------------------------
+ if ( ! $opt_skip_im )
+ {
+ $ENV{'IM_EXE'}= $exe_im;
+ $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid};
+ $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid};
+ $ENV{'IM_PORT'}= $instance_manager->{port};
+ $ENV{'IM_DEFAULTS_PATH'}= $instance_manager->{defaults_file};
+ $ENV{'IM_PASSWORD_PATH'}= $instance_manager->{password_file};
+
+ $ENV{'IM_MYSQLD1_SOCK'}=
+ $instance_manager->{instances}->[0]->{path_sock};
+ $ENV{'IM_MYSQLD1_PORT'}=
+ $instance_manager->{instances}->[0]->{port};
+ $ENV{'IM_MYSQLD1_PATH_PID'}=
+ $instance_manager->{instances}->[0]->{path_pid};
+ $ENV{'IM_MYSQLD2_SOCK'}=
+ $instance_manager->{instances}->[1]->{path_sock};
+ $ENV{'IM_MYSQLD2_PORT'}=
+ $instance_manager->{instances}->[1]->{port};
+ $ENV{'IM_MYSQLD2_PATH_PID'}=
+ $instance_manager->{instances}->[1]->{path_pid};
+ }
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlcheck
+ # ----------------------------------------------------
+ my $cmdline_mysqlcheck=
+ mtr_native_path($exe_mysqlcheck) .
+ " --no-defaults --debug-check -uroot " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'} --password=";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlcheck .=
+ " --debug=d:t:A,$path_vardir_trace/log/mysqlcheck.trace";
+ }
+ $ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck;
+
+ # ----------------------------------------------------
+ # Setup env to childs can execute myqldump
+ # ----------------------------------------------------
+ my $cmdline_mysqldump= generate_cmdline_mysqldump($master->[0]);
+ my $cmdline_mysqldumpslave= generate_cmdline_mysqldump($slave->[0]);
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqldump .=
+ " --debug=d:t:A,$path_vardir_trace/log/mysqldump-master.trace";
+ $cmdline_mysqldumpslave .=
+ " --debug=d:t:A,$path_vardir_trace/log/mysqldump-slave.trace";
+ }
+ $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
+ $ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
+
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlslap
+ # ----------------------------------------------------
+ if ( $exe_mysqlslap )
+ {
+ my $cmdline_mysqlslap=
+ mtr_native_path($exe_mysqlslap) .
+ " -uroot " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'} --password= ";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlslap .=
+ " --debug=d:t:A,$path_vardir_trace/log/mysqlslap.trace";
+ }
+ $ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap;
+ }
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlimport
+ # ----------------------------------------------------
+ my $cmdline_mysqlimport=
+ mtr_native_path($exe_mysqlimport) .
+ " -uroot --debug-check " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'} --password=";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlimport .=
+ " --debug=d:t:A,$path_vardir_trace/log/mysqlimport.trace";
+ }
+ $ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
+
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlshow
+ # ----------------------------------------------------
+ my $cmdline_mysqlshow=
+ mtr_native_path($exe_mysqlshow) .
+ " -uroot --debug-check " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'} --password=";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlshow .=
+ " --debug=d:t:A,$path_vardir_trace/log/mysqlshow.trace";
+ }
+ $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlbinlog
+ # ----------------------------------------------------
+ my $cmdline_mysqlbinlog=
+ mtr_native_path($exe_mysqlbinlog) .
+ " --no-defaults --disable-force-if-open --debug-check";
+ if ( !$opt_extern && $mysql_version_id >= 50000 )
+ {
+ $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
+ }
+ # Always use the given tmpdir for the LOAD files created
+ # by mysqlbinlog
+ $cmdline_mysqlbinlog .=" --local-load=$opt_tmpdir";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlbinlog .=
+ " --debug=d:t:A,$path_vardir_trace/log/mysqlbinlog.trace";
+ }
+ $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysql
+ # ----------------------------------------------------
+ my $cmdline_mysql=
+ mtr_native_path($exe_mysql) .
+ " --no-defaults --debug-check --host=localhost --user=root --password= " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'} ".
+ "--character-sets-dir=$path_charsetsdir";
+
+ $ENV{'MYSQL'}= $cmdline_mysql;
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute bug25714
+ # ----------------------------------------------------
+ $ENV{'MYSQL_BUG25714'}= $exe_bug25714;
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysql_client_test
+ # ----------------------------------------------------
+ $ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments();
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysql_upgrade
+ # ----------------------------------------------------
+ if ( !$opt_extern && $mysql_version_id >= 50000 )
+ {
+ $ENV{'MYSQL_UPGRADE'}= mysql_upgrade_arguments();
+ }
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysql_fix_system_tables
+ # ----------------------------------------------------
+ if ( !$opt_extern && ! $glob_win32 )
+ {
+ my $cmdline_mysql_fix_system_tables=
+ "$exe_mysql_fix_system_tables --no-defaults --host=localhost " .
+ "--user=root --password= " .
+ "--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'}";
+ $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
+
+ }
+ $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute my_print_defaults
+ # ----------------------------------------------------
+ $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= mtr_native_path($exe_my_print_defaults);
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqladmin
+ # ----------------------------------------------------
+ $ENV{'MYSQLADMIN'}= mtr_native_path($exe_mysqladmin);
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute perror
+ # ----------------------------------------------------
+ $ENV{'MY_PERROR'}= mtr_native_path($exe_perror);
+
+ # ----------------------------------------------------
+ # Add the path where mysqld will find udf_example.so
+ # ----------------------------------------------------
+ $ENV{'UDF_EXAMPLE_LIB'}=
+ ($lib_udf_example ? basename($lib_udf_example) : "");
+ $ENV{'UDF_EXAMPLE_LIB_OPT'}=
+ ($lib_udf_example ? "--plugin_dir=" . dirname($lib_udf_example) : "");
+
+ # ----------------------------------------------------
+ # Add the path where mysqld will find ha_example.so
+ # ----------------------------------------------------
+ $ENV{'EXAMPLE_PLUGIN'}=
+ ($lib_example_plugin ? basename($lib_example_plugin) : "");
+ $ENV{'EXAMPLE_PLUGIN_OPT'}=
+ ($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : "");
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute myisampack and myisamchk
+ # ----------------------------------------------------
+ $ENV{'MYISAMCHK'}= mtr_native_path(mtr_exe_exists(
+ vs_config_dirs('storage/myisam', 'myisamchk'),
+ vs_config_dirs('myisam', 'myisamchk'),
+ "$path_client_bindir/myisamchk",
+ "$glob_basedir/storage/myisam/myisamchk",
+ "$glob_basedir/myisam/myisamchk"));
+ $ENV{'MYISAMPACK'}= mtr_native_path(mtr_exe_exists(
+ vs_config_dirs('storage/myisam', 'myisampack'),
+ vs_config_dirs('myisam', 'myisampack'),
+ "$path_client_bindir/myisampack",
+ "$glob_basedir/storage/myisam/myisampack",
+ "$glob_basedir/myisam/myisampack"));
+
+ # ----------------------------------------------------
+ # We are nice and report a bit about our settings
+ # ----------------------------------------------------
+ if (!$opt_extern)
+ {
+ print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n";
+ print "Using MASTER_MYPORT = $ENV{MASTER_MYPORT}\n";
+ print "Using MASTER_MYPORT1 = $ENV{MASTER_MYPORT1}\n";
+ print "Using SLAVE_MYPORT = $ENV{SLAVE_MYPORT}\n";
+ print "Using SLAVE_MYPORT1 = $ENV{SLAVE_MYPORT1}\n";
+ print "Using SLAVE_MYPORT2 = $ENV{SLAVE_MYPORT2}\n";
+ if ( ! $opt_skip_ndbcluster )
+ {
+ print "Using NDBCLUSTER_PORT = $ENV{NDBCLUSTER_PORT}\n";
+ if ( ! $opt_skip_ndbcluster_slave )
+ {
+ print "Using NDBCLUSTER_PORT_SLAVE = $ENV{NDBCLUSTER_PORT_SLAVE}\n";
+ }
+ }
+ if ( ! $opt_skip_im )
+ {
+ print "Using IM_PORT = $ENV{IM_PORT}\n";
+ print "Using IM_MYSQLD1_PORT = $ENV{IM_MYSQLD1_PORT}\n";
+ print "Using IM_MYSQLD2_PORT = $ENV{IM_MYSQLD2_PORT}\n";
+ }
+ }
+
+ # Create an environment variable to make it possible
+ # to detect that valgrind is being used from test cases
+ $ENV{'VALGRIND_TEST'}= $opt_valgrind;
+
+}
+
+
+##############################################################################
+#
+# If we get a ^C, we try to clean up before termination
+#
+##############################################################################
+# FIXME check restrictions what to do in a signal handler
+
+sub signal_setup () {
+ $SIG{INT}= \&handle_int_signal;
+}
+
+
+sub handle_int_signal () {
+ $SIG{INT}= 'DEFAULT'; # If we get a ^C again, we die...
+ mtr_warning("got INT signal, cleaning up.....");
+ stop_all_servers();
+ mtr_error("We die from ^C signal from user");
+}
+
+
+##############################################################################
+#
+# Handle left overs from previous runs
+#
+##############################################################################
+
+sub kill_running_servers () {
+
+ if ( $opt_fast or $glob_use_embedded_server )
+ {
+ # FIXME is embedded server really using PID files?!
+ unlink($master->[0]->{'path_pid'});
+ unlink($master->[1]->{'path_pid'});
+ unlink($slave->[0]->{'path_pid'});
+ unlink($slave->[1]->{'path_pid'});
+ unlink($slave->[2]->{'path_pid'});
+ }
+ else
+ {
+ # Ensure that no old mysqld test servers are running
+ # This is different from terminating processes we have
+ # started from this run of the script, this is terminating
+ # leftovers from previous runs.
+ mtr_kill_leftovers();
+ }
+}
+
+#
+# Remove var and any directories in var/ created by previous
+# tests
+#
+sub remove_stale_vardir () {
+
+ mtr_report("Removing Stale Files");
+
+ # Safety!
+ mtr_error("No, don't remove the vardir when running with --extern")
+ if $opt_extern;
+
+ mtr_verbose("opt_vardir: $opt_vardir");
+ if ( $opt_vardir eq $default_vardir )
+ {
+ #
+ # Running with "var" in mysql-test dir
+ #
+ if ( -l $opt_vardir)
+ {
+ # var is a symlink
+
+ if ( $opt_mem and readlink($opt_vardir) eq $opt_mem )
+ {
+ # Remove the directory which the link points at
+ mtr_verbose("Removing " . readlink($opt_vardir));
+ mtr_rmtree(readlink($opt_vardir));
+
+ # Remove the "var" symlink
+ mtr_verbose("unlink($opt_vardir)");
+ unlink($opt_vardir);
+ }
+ elsif ( $opt_mem )
+ {
+ # Just remove the "var" symlink
+ mtr_report("WARNING: Removing '$opt_vardir' symlink it's wrong");
+
+ mtr_verbose("unlink($opt_vardir)");
+ unlink($opt_vardir);
+ }
+ else
+ {
+ # Some users creates a soft link in mysql-test/var to another area
+ # - allow it, but remove all files in it
+
+ mtr_report("WARNING: Using the 'mysql-test/var' symlink");
+
+ # Make sure the directory where it points exist
+ mtr_error("The destination for symlink $opt_vardir does not exist")
+ if ! -d readlink($opt_vardir);
+
+ foreach my $bin ( glob("$opt_vardir/*") )
+ {
+ mtr_verbose("Removing bin $bin");
+ mtr_rmtree($bin);
+ }
+ }
+ }
+ else
+ {
+ # Remove the entire "var" dir
+ mtr_verbose("Removing $opt_vardir/");
+ mtr_rmtree("$opt_vardir/");
+ }
+
+ if ( $opt_mem )
+ {
+ # A symlink from var/ to $opt_mem will be set up
+ # remove the $opt_mem dir to assure the symlink
+ # won't point at an old directory
+ mtr_verbose("Removing $opt_mem");
+ mtr_rmtree($opt_mem);
+ }
+
+ }
+ else
+ {
+ #
+ # Running with "var" in some other place
+ #
+
+ # Remove the var/ dir in mysql-test dir if any
+ # this could be an old symlink that shouldn't be there
+ mtr_verbose("Removing $default_vardir");
+ mtr_rmtree($default_vardir);
+
+ # Remove the "var" dir
+ mtr_verbose("Removing $opt_vardir/");
+ mtr_rmtree("$opt_vardir/");
+ }
+}
+
+#
+# Create var and the directories needed in var
+#
+sub setup_vardir() {
+ mtr_report("Creating Directories");
+
+ if ( $opt_vardir eq $default_vardir )
+ {
+ #
+ # Running with "var" in mysql-test dir
+ #
+ if ( -l $opt_vardir )
+ {
+ # it's a symlink
+
+ # Make sure the directory where it points exist
+ mtr_error("The destination for symlink $opt_vardir does not exist")
+ if ! -d readlink($opt_vardir);
+ }
+ elsif ( $opt_mem )
+ {
+ # Runinng with "var" as a link to some "memory" location, normally tmpfs
+ mtr_verbose("Creating $opt_mem");
+ mkpath($opt_mem);
+
+ mtr_report("Symlinking 'var' to '$opt_mem'");
+ symlink($opt_mem, $opt_vardir);
+ }
+ }
+
+ if ( ! -d $opt_vardir )
+ {
+ mtr_verbose("Creating $opt_vardir");
+ mkpath($opt_vardir);
+ }
+
+ # Ensure a proper error message if vardir couldn't be created
+ unless ( -d $opt_vardir and -w $opt_vardir )
+ {
+ mtr_error("Writable 'var' directory is needed, use the " .
+ "'--vardir=<path>' option");
+ }
+
+ mkpath("$opt_vardir/log");
+ mkpath("$opt_vardir/run");
+ mkpath("$opt_vardir/tmp");
+ mkpath($opt_tmpdir) if $opt_tmpdir ne "$opt_vardir/tmp";
+
+ # Create new data dirs
+ foreach my $data_dir (@data_dir_lst)
+ {
+ mkpath("$data_dir/mysql");
+ mkpath("$data_dir/test");
+ }
+
+ # Make a link std_data_ln in var/ that points to std_data
+ if ( ! $glob_win32 )
+ {
+ symlink("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
+ }
+ else
+ {
+ # on windows, copy all files from std_data into var/std_data_ln
+ mkpath("$opt_vardir/std_data_ln");
+ mtr_copy_dir("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
+ }
+
+ # Remove old log files
+ foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
+ {
+ unlink($name);
+ }
+}
+
+
+sub check_running_as_root () {
+ # Check if running as root
+ # i.e a file can be read regardless what mode we set it to
+ my $test_file= "$opt_vardir/test_running_as_root.txt";
+ mtr_tofile($test_file, "MySQL");
+ chmod(oct("0000"), $test_file);
+
+ my $result="";
+ if (open(FILE,"<",$test_file))
+ {
+ $result= join('', <FILE>);
+ close FILE;
+ }
+
+ # Some filesystems( for example CIFS) allows reading a file
+ # although mode was set to 0000, but in that case a stat on
+ # the file will not return 0000
+ my $file_mode= (stat($test_file))[2] & 07777;
+
+ $ENV{'MYSQL_TEST_ROOT'}= "NO";
+ mtr_verbose("result: $result, file_mode: $file_mode");
+ if ($result eq "MySQL" && $file_mode == 0)
+ {
+ mtr_warning("running this script as _root_ will cause some " .
+ "tests to be skipped");
+ $ENV{'MYSQL_TEST_ROOT'}= "YES";
+ }
+
+ chmod(oct("0755"), $test_file);
+ unlink($test_file);
+
+}
+
+
+sub check_ssl_support ($) {
+ my $mysqld_variables= shift;
+
+ if ($opt_skip_ssl || $opt_extern)
+ {
+ if (!$opt_extern)
+ {
+ mtr_report("Skipping SSL");
+ }
+ $opt_ssl_supported= 0;
+ $opt_ssl= 0;
+ return;
+ }
+
+ if ( ! $mysqld_variables->{'ssl'} )
+ {
+ if ( $opt_ssl)
+ {
+ mtr_error("Couldn't find support for SSL");
+ return;
+ }
+ mtr_report("Skipping SSL, mysqld not compiled with SSL");
+ $opt_ssl_supported= 0;
+ $opt_ssl= 0;
+ return;
+ }
+ mtr_report("Setting mysqld to support SSL connections");
+ $opt_ssl_supported= 1;
+}
+
+
+sub check_debug_support ($) {
+ my $mysqld_variables= shift;
+
+ if ( ! $mysqld_variables->{'debug'} )
+ {
+ #mtr_report("Binaries are not debug compiled");
+ $debug_compiled_binaries= 0;
+
+ if ( $opt_debug )
+ {
+ mtr_error("Can't use --debug, binaries does not support it");
+ }
+ return;
+ }
+ mtr_report("Binaries are debug compiled");
+ $debug_compiled_binaries= 1;
+}
+
+##############################################################################
+#
+# Helper function to handle configuration-based subdirectories which Visual
+# Studio uses for storing binaries. If opt_vs_config is set, this returns
+# a path based on that setting; if not, it returns paths for the default
+# /release/ and /debug/ subdirectories.
+#
+# $exe can be undefined, if the directory itself will be used
+#
+###############################################################################
+
+sub vs_config_dirs ($$) {
+ my ($path_part, $exe) = @_;
+
+ $exe = "" if not defined $exe;
+
+ if ($opt_vs_config)
+ {
+ return ("$glob_basedir/$path_part/$opt_vs_config/$exe");
+ }
+
+ return ("$glob_basedir/$path_part/release/$exe",
+ "$glob_basedir/$path_part/relwithdebinfo/$exe",
+ "$glob_basedir/$path_part/debug/$exe");
+}
+
+##############################################################################
+#
+# Start the ndb cluster
+#
+##############################################################################
+
+sub check_ndbcluster_support ($) {
+ my $mysqld_variables= shift;
+
+ if ($opt_skip_ndbcluster || $opt_extern)
+ {
+ if (!$opt_extern)
+ {
+ mtr_report("Skipping ndbcluster");
+ }
+ $opt_skip_ndbcluster_slave= 1;
+ return;
+ }
+
+ if ( ! $mysqld_variables->{'ndb-connectstring'} )
+ {
+ mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster");
+ $opt_skip_ndbcluster= 1;
+ $opt_skip_ndbcluster_slave= 1;
+ return;
+ }
+ $glob_ndbcluster_supported= 1;
+ mtr_report("Using ndbcluster when necessary, mysqld supports it");
+
+ if ( $mysql_version_id < 50100 )
+ {
+ # Slave cluster is not supported until 5.1
+ $opt_skip_ndbcluster_slave= 1;
+
+ }
+
+ return;
+}
+
+
+sub ndbcluster_start_install ($) {
+ my $cluster= shift;
+
+ mtr_report("Installing $cluster->{'name'} Cluster");
+
+ mkdir($cluster->{'data_dir'});
+
+ # Create a config file from template
+ my $ndb_no_ord=512;
+ my $ndb_no_attr=2048;
+ my $ndb_con_op=105000;
+ my $ndb_dmem="80M";
+ my $ndb_imem="24M";
+ my $ndb_pbmem="32M";
+ my $nodes= $cluster->{'nodes'};
+ my $ndb_host= "localhost";
+ my $ndb_diskless= 0;
+
+ if (!$opt_bench)
+ {
+ # Use a smaller configuration
+ if ( $mysql_version_id < 50100 )
+ {
+ # 4.1 and 5.0 is using a "larger" --small configuration
+ $ndb_no_ord=128;
+ $ndb_con_op=10000;
+ $ndb_dmem="40M";
+ $ndb_imem="12M";
+ }
+ else
+ {
+ $ndb_no_ord=32;
+ $ndb_con_op=10000;
+ $ndb_dmem="20M";
+ $ndb_imem="1M";
+ $ndb_pbmem="4M";
+ }
+ }
+
+ my $config_file_template= "lib/v1/ndb_config_${nodes}_node.ini";
+ my $config_file= "$cluster->{'data_dir'}/config.ini";
+
+ open(IN, $config_file_template)
+ or mtr_error("Can't open $config_file_template: $!");
+ open(OUT, ">", $config_file)
+ or mtr_error("Can't write to $config_file: $!");
+ while (<IN>)
+ {
+ chomp;
+
+ s/CHOOSE_MaxNoOfAttributes/$ndb_no_attr/;
+ s/CHOOSE_MaxNoOfOrderedIndexes/$ndb_no_ord/;
+ s/CHOOSE_MaxNoOfConcurrentOperations/$ndb_con_op/;
+ s/CHOOSE_DataMemory/$ndb_dmem/;
+ s/CHOOSE_IndexMemory/$ndb_imem/;
+ s/CHOOSE_Diskless/$ndb_diskless/;
+ s/CHOOSE_HOSTNAME_.*/$ndb_host/;
+ s/CHOOSE_FILESYSTEM/$cluster->{'data_dir'}/;
+ s/CHOOSE_PORT_MGM/$cluster->{'port'}/;
+ if ( $mysql_version_id < 50000 )
+ {
+ my $base_port= $cluster->{'port'} + 1;
+ s/CHOOSE_PORT_TRANSPORTER/$base_port/;
+ }
+ s/CHOOSE_DiskPageBufferMemory/$ndb_pbmem/;
+
+ print OUT "$_ \n";
+ }
+ close OUT;
+ close IN;
+
+
+ # Start cluster with "--initial"
+
+ ndbcluster_start($cluster, "--initial");
+
+ return 0;
+}
+
+
+sub ndbcluster_wait_started($$){
+ my $cluster= shift;
+ my $ndb_waiter_extra_opt= shift;
+ my $path_waiter_log= "$cluster->{'data_dir'}/ndb_waiter.log";
+ my $args;
+
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--core");
+ mtr_add_arg($args, "--ndb-connectstring=%s", $cluster->{'connect_string'});
+ mtr_add_arg($args, "--timeout=60");
+
+ if ($ndb_waiter_extra_opt)
+ {
+ mtr_add_arg($args, "$ndb_waiter_extra_opt");
+ }
+
+ # Start the ndb_waiter which will connect to the ndb_mgmd
+ # and poll it for state of the ndbd's, will return when
+ # all nodes in the cluster is started
+ my $res= mtr_run($exe_ndb_waiter, $args,
+ "", $path_waiter_log, $path_waiter_log, "");
+ mtr_verbose("ndbcluster_wait_started, returns: $res") if $res;
+ return $res;
+}
+
+
+
+sub mysqld_wait_started($){
+ my $mysqld= shift;
+
+ if (sleep_until_file_created($mysqld->{'path_pid'},
+ $mysqld->{'start_timeout'},
+ $mysqld->{'pid'}) == 0)
+ {
+ # Failed to wait for pid file
+ return 1;
+ }
+
+ # Get the "real pid" of the process, it will be used for killing
+ # the process in ActiveState's perl on windows
+ $mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
+
+ return 0;
+}
+
+
+sub ndb_mgmd_wait_started($) {
+ my ($cluster)= @_;
+
+ my $retries= 100;
+ while (ndbcluster_wait_started($cluster, "--no-contact") and
+ $retries)
+ {
+ # Millisceond sleep emulated with select
+ select(undef, undef, undef, (0.1));
+
+ $retries--;
+ }
+
+ return $retries == 0;
+
+}
+
+sub ndb_mgmd_start ($) {
+ my $cluster= shift;
+
+ my $args; # Arg vector
+ my $pid= -1;
+
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--core");
+ mtr_add_arg($args, "--nodaemon");
+ mtr_add_arg($args, "--config-file=%s", "$cluster->{'data_dir'}/config.ini");
+
+
+ my $path_ndb_mgmd_log= "$cluster->{'data_dir'}/\l$cluster->{'name'}_ndb_mgmd.log";
+ $pid= mtr_spawn($exe_ndb_mgmd, $args, "",
+ $path_ndb_mgmd_log,
+ $path_ndb_mgmd_log,
+ "",
+ { append_log_file => 1 });
+
+ # FIXME Should not be needed
+ # Unfortunately the cluster nodes will fail to start
+ # if ndb_mgmd has not started properly
+ if (ndb_mgmd_wait_started($cluster))
+ {
+ mtr_error("Failed to wait for start of ndb_mgmd");
+ }
+
+ # Remember pid of ndb_mgmd
+ $cluster->{'pid'}= $pid;
+
+ mtr_verbose("ndb_mgmd_start, pid: $pid");
+
+ return $pid;
+}
+
+
+sub ndbd_start ($$$) {
+ my $cluster= shift;
+ my $idx= shift;
+ my $extra_args= shift;
+
+ my $args; # Arg vector
+ my $pid= -1;
+
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--core");
+ mtr_add_arg($args, "--ndb-connectstring=%s", "$cluster->{'connect_string'}");
+ if ( $mysql_version_id >= 50000)
+ {
+ mtr_add_arg($args, "--character-sets-dir=%s", "$path_charsetsdir");
+ }
+ mtr_add_arg($args, "--nodaemon");
+ mtr_add_arg($args, "$extra_args");
+
+ my $nodeid= $cluster->{'ndbds'}->[$idx]->{'nodeid'};
+ my $path_ndbd_log= "$cluster->{'data_dir'}/ndb_${nodeid}.log";
+ $pid= mtr_spawn($exe_ndbd, $args, "",
+ $path_ndbd_log,
+ $path_ndbd_log,
+ "",
+ { append_log_file => 1 });
+
+ # Add pid to list of pids for this cluster
+ $cluster->{'ndbds'}->[$idx]->{'pid'}= $pid;
+
+ # Rememeber options used when starting
+ $cluster->{'ndbds'}->[$idx]->{'start_extra_args'}= $extra_args;
+ $cluster->{'ndbds'}->[$idx]->{'idx'}= $idx;
+
+ mtr_verbose("ndbd_start, pid: $pid");
+
+ return $pid;
+}
+
+
+sub ndbcluster_start ($$) {
+ my $cluster= shift;
+ my $extra_args= shift;
+
+ mtr_verbose("ndbcluster_start '$cluster->{'name'}'");
+
+ if ( $cluster->{'use_running'} )
+ {
+ return 0;
+ }
+
+ if ( $cluster->{'pid'} )
+ {
+ mtr_error("Cluster '$cluster->{'name'}' already started");
+ }
+
+ ndb_mgmd_start($cluster);
+
+ for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
+ {
+ ndbd_start($cluster, $idx, $extra_args);
+ }
+
+ return 0;
+}
+
+
+sub rm_ndbcluster_tables ($) {
+ my $dir= shift;
+ foreach my $bin ( glob("$dir/mysql/ndb_apply_status*"),
+ glob("$dir/mysql/ndb_schema*"))
+ {
+ unlink($bin);
+ }
+}
+
+
+##############################################################################
+#
+# Run the benchmark suite
+#
+##############################################################################
+
+sub run_benchmarks ($) {
+ my $benchmark= shift;
+
+ my $args;
+
+ if ( ! $glob_use_embedded_server )
+ {
+ mysqld_start($master->[0],[],[]);
+ if ( ! $master->[0]->{'pid'} )
+ {
+ mtr_error("Can't start the mysqld server");
+ }
+ }
+
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'});
+ mtr_add_arg($args, "--user=%s", $opt_user);
+
+ if ( $opt_small_bench )
+ {
+ mtr_add_arg($args, "--small-test");
+ mtr_add_arg($args, "--small-tables");
+ }
+
+ if ( $opt_with_ndbcluster )
+ {
+ mtr_add_arg($args, "--create-options=TYPE=ndb");
+ }
+
+ chdir($glob_mysql_bench_dir)
+ or mtr_error("Couldn't chdir to '$glob_mysql_bench_dir': $!");
+
+ if ( ! $benchmark )
+ {
+ mtr_add_arg($args, "--log");
+ mtr_run("$glob_mysql_bench_dir/run-all-tests", $args, "", "", "", "");
+ # FIXME check result code?!
+ }
+ elsif ( -x $benchmark )
+ {
+ mtr_run("$glob_mysql_bench_dir/$benchmark", $args, "", "", "", "");
+ # FIXME check result code?!
+ }
+ else
+ {
+ mtr_error("Benchmark $benchmark not found");
+ }
+
+ chdir($glob_mysql_test_dir); # Go back
+
+ if ( ! $glob_use_embedded_server )
+ {
+ stop_masters();
+ }
+}
+
+
+##############################################################################
+#
+# Run the tests
+#
+##############################################################################
+
+sub run_tests () {
+ my ($tests)= @_;
+
+ mtr_print_thick_line();
+
+ mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);
+
+ mtr_report_tests_not_skipped_though_disabled($tests);
+
+ mtr_print_header();
+
+ foreach my $tinfo ( @$tests )
+ {
+ if (run_testcase_check_skip_test($tinfo))
+ {
+ next;
+ }
+
+ mtr_timer_start($glob_timers,"testcase", 60 * $opt_testcase_timeout);
+ run_testcase($tinfo);
+ mtr_timer_stop($glob_timers,"testcase");
+ }
+
+ mtr_print_line();
+
+ if ( ! $glob_debugger and
+ ! $opt_extern and
+ ! $glob_use_embedded_server )
+ {
+ stop_all_servers();
+ }
+
+ if ( $opt_gcov )
+ {
+ gcov_collect(); # collect coverage information
+ }
+ if ( $opt_gprof )
+ {
+ gprof_collect(); # collect coverage information
+ }
+
+ mtr_report_stats($tests);
+
+ mtr_timer_stop($glob_timers,"suite");
+}
+
+
+##############################################################################
+#
+# Initiate the test databases
+#
+##############################################################################
+
+sub initialize_servers () {
+
+ datadir_list_setup();
+
+ if ( $opt_extern )
+ {
+ # Running against an already started server, if the specified
+ # vardir does not already exist it should be created
+ if ( ! -d $opt_vardir )
+ {
+ mtr_report("Creating '$opt_vardir'");
+ setup_vardir();
+ }
+ else
+ {
+ mtr_verbose("No need to create '$opt_vardir' it already exists");
+ }
+ }
+ else
+ {
+ kill_running_servers();
+
+ if ( ! $opt_start_dirty )
+ {
+ remove_stale_vardir();
+ setup_vardir();
+
+ mysql_install_db();
+ if ( $opt_force )
+ {
+ # Save a snapshot of the freshly installed db
+ # to make it possible to restore to a known point in time
+ save_installed_db();
+ }
+ }
+ }
+ check_running_as_root();
+
+ mtr_log_init("$opt_vardir/log/mysql-test-run.log");
+
+}
+
+sub mysql_install_db () {
+
+ install_db('master', $master->[0]->{'path_myddir'});
+
+ if ($max_master_num > 1)
+ {
+ copy_install_db('master', $master->[1]->{'path_myddir'});
+ }
+
+ # Install the number of slave databses needed
+ for (my $idx= 0; $idx < $max_slave_num; $idx++)
+ {
+ copy_install_db("slave".($idx+1), $slave->[$idx]->{'path_myddir'});
+ }
+
+ if ( ! $opt_skip_im )
+ {
+ im_prepare_env($instance_manager);
+ }
+
+ my $cluster_started_ok= 1; # Assume it can be started
+
+ my $cluster= $clusters->[0]; # Master cluster
+ if ($opt_skip_ndbcluster ||
+ $cluster->{'use_running'} ||
+ $cluster->{executable_setup_failed})
+ {
+ # Don't install master cluster
+ }
+ elsif (ndbcluster_start_install($cluster))
+ {
+ mtr_warning("Failed to start install of $cluster->{name}");
+ $cluster_started_ok= 0;
+ }
+
+ $cluster= $clusters->[1]; # Slave cluster
+ if ($max_slave_num == 0 ||
+ $opt_skip_ndbcluster_slave ||
+ $cluster->{'use_running'} ||
+ $cluster->{executable_setup_failed})
+ {
+ # Don't install slave cluster
+ }
+ elsif (ndbcluster_start_install($cluster))
+ {
+ mtr_warning("Failed to start install of $cluster->{name}");
+ $cluster_started_ok= 0;
+ }
+
+ foreach $cluster (@{$clusters})
+ {
+
+ next if !$cluster->{'pid'};
+
+ $cluster->{'installed_ok'}= 1; # Assume install suceeds
+
+ if (ndbcluster_wait_started($cluster, ""))
+ {
+ # failed to install, disable usage and flag that its no ok
+ mtr_report("ndbcluster_install of $cluster->{'name'} failed");
+ $cluster->{"installed_ok"}= 0;
+
+ $cluster_started_ok= 0;
+ }
+ }
+
+ if ( ! $cluster_started_ok )
+ {
+ if ( $opt_force)
+ {
+ # Continue without cluster
+ }
+ else
+ {
+ mtr_error("To continue, re-run with '--force'.");
+ }
+ }
+
+ return 0;
+}
+
+
+sub copy_install_db ($$) {
+ my $type= shift;
+ my $data_dir= shift;
+
+ mtr_report("Installing \u$type Database");
+
+ # Just copy the installed db from first master
+ mtr_copy_dir($master->[0]->{'path_myddir'}, $data_dir);
+
+}
+
+
+sub install_db ($$) {
+ my $type= shift;
+ my $data_dir= shift;
+
+ mtr_report("Installing \u$type Database");
+
+
+ my $args;
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--bootstrap");
+ mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
+ mtr_add_arg($args, "--datadir=%s", $data_dir);
+ mtr_add_arg($args, "--loose-skip-innodb");
+ mtr_add_arg($args, "--loose-skip-ndbcluster");
+ mtr_add_arg($args, "--tmpdir=.");
+ mtr_add_arg($args, "--core-file");
+
+ if ( $opt_debug )
+ {
+ mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap_%s.trace",
+ $path_vardir_trace, $type);
+ }
+
+ if ( ! $glob_netware )
+ {
+ mtr_add_arg($args, "--language=%s", $path_language);
+ mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
+ }
+
+ # If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g.,
+ # configure --disable-grant-options), mysqld will not recognize the
+ # --bootstrap or --skip-grant-tables options. The user can set
+ # MYSQLD_BOOTSTRAP to the full path to a mysqld which does accept
+ # --bootstrap, to accommodate this.
+ my $exe_mysqld_bootstrap = $ENV{'MYSQLD_BOOTSTRAP'} || $exe_mysqld;
+
+ # ----------------------------------------------------------------------
+ # export MYSQLD_BOOTSTRAP_CMD variable containing <path>/mysqld <args>
+ # ----------------------------------------------------------------------
+ $ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args);
+
+ # ----------------------------------------------------------------------
+ # Create the bootstrap.sql file
+ # ----------------------------------------------------------------------
+ my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
+
+ # Use the mysql database for system tables
+ mtr_tofile($bootstrap_sql_file, "use mysql");
+
+ # Add the offical mysql system tables
+ # for a production system
+ mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql",
+ $bootstrap_sql_file);
+
+ # Add the mysql system tables initial data
+ # for a production system
+ mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables_data.sql",
+ $bootstrap_sql_file);
+
+ # Add test data for timezone - this is just a subset, on a real
+ # system these tables will be populated either by mysql_tzinfo_to_sql
+ # or by downloading the timezone table package from our website
+ mtr_appendfile_to_file("$path_sql_dir/mysql_test_data_timezone.sql",
+ $bootstrap_sql_file);
+
+ # Fill help tables, just an empty file when running from bk repo
+ # but will be replaced by a real fill_help_tables.sql when
+ # building the source dist
+ mtr_appendfile_to_file("$path_sql_dir/fill_help_tables.sql",
+ $bootstrap_sql_file);
+
+ # Remove anonymous users
+ mtr_tofile($bootstrap_sql_file,
+ "DELETE FROM mysql.user where user= '';");
+
+ # Log bootstrap command
+ my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
+ mtr_tofile($path_bootstrap_log,
+ "$exe_mysqld_bootstrap " . join(" ", @$args) . "\n");
+
+
+ if ( mtr_run($exe_mysqld_bootstrap, $args, $bootstrap_sql_file,
+ $path_bootstrap_log, $path_bootstrap_log,
+ "", { append_log_file => 1 }) != 0 )
+
+ {
+ mtr_error("Error executing mysqld --bootstrap\n" .
+ "Could not install system database from $bootstrap_sql_file\n" .
+ "see $path_bootstrap_log for errors");
+ }
+}
+
+
+sub im_prepare_env($) {
+ my $instance_manager = shift;
+
+ im_create_passwd_file($instance_manager);
+ im_prepare_data_dir($instance_manager);
+}
+
+
+sub im_create_passwd_file($) {
+ my $instance_manager = shift;
+
+ my $pwd_file_path = $instance_manager->{'password_file'};
+
+ mtr_report("Creating IM password file ($pwd_file_path)");
+
+ open(OUT, ">", $pwd_file_path)
+ or mtr_error("Can't write to $pwd_file_path: $!");
+
+ print OUT $instance_manager->{'admin_login'}, ":",
+ $instance_manager->{'admin_sha1'}, "\n";
+
+ close(OUT);
+}
+
+
+sub im_create_defaults_file($) {
+ my $instance_manager = shift;
+
+ my $defaults_file = $instance_manager->{'defaults_file'};
+
+ open(OUT, ">", $defaults_file)
+ or mtr_error("Can't write to $defaults_file: $!");
+
+ print OUT <<EOF
+[mysql]
+
+[manager]
+pid-file = $instance_manager->{path_pid}
+angel-pid-file = $instance_manager->{path_angel_pid}
+socket = $instance_manager->{path_sock}
+port = $instance_manager->{port}
+password-file = $instance_manager->{password_file}
+default-mysqld-path = $exe_mysqld
+
+EOF
+;
+
+ foreach my $instance (@{$instance_manager->{'instances'}})
+ {
+ my $server_id = $instance->{'server_id'};
+
+ print OUT <<EOF
+[mysqld$server_id]
+socket = $instance->{path_sock}
+pid-file = $instance->{path_pid}
+port = $instance->{port}
+datadir = $instance->{path_datadir}
+log = $instance->{path_datadir}/mysqld$server_id.log
+log-error = $instance->{path_datadir}/mysqld$server_id.err.log
+log-slow-queries = $instance->{path_datadir}/mysqld$server_id.slow.log
+language = $path_language
+character-sets-dir = $path_charsetsdir
+basedir = $path_my_basedir
+server_id = $server_id
+shutdown-delay = 10
+skip-stack-trace
+loose-skip-innodb
+loose-skip-ndbcluster
+EOF
+;
+ if ( $mysql_version_id < 50100 )
+ {
+ print OUT "skip-bdb\n";
+ }
+ print OUT "nonguarded\n" if $instance->{'nonguarded'};
+ if ( $mysql_version_id >= 50100 )
+ {
+ print OUT "log-output=FILE\n" if $instance->{'old_log_format'};
+ }
+ print OUT "\n";
+ }
+
+ close(OUT);
+}
+
+
+sub im_prepare_data_dir($) {
+ my $instance_manager = shift;
+
+ foreach my $instance (@{$instance_manager->{'instances'}})
+ {
+ copy_install_db(
+ 'im_mysqld_' . $instance->{'server_id'},
+ $instance->{'path_datadir'});
+ }
+}
+
+
+
+#
+# Restore snapshot of the installed slave databases
+# if the snapshot exists
+#
+sub restore_slave_databases ($) {
+ my ($num_slaves)= @_;
+
+ if ( -d $path_snapshot)
+ {
+ for (my $idx= 0; $idx < $num_slaves; $idx++)
+ {
+ my $data_dir= $slave->[$idx]->{'path_myddir'};
+ my $name= basename($data_dir);
+ mtr_rmtree($data_dir);
+ mtr_copy_dir("$path_snapshot/$name", $data_dir);
+ }
+ }
+}
+
+
+sub run_testcase_check_skip_test($)
+{
+ my ($tinfo)= @_;
+
+ # ----------------------------------------------------------------------
+ # If marked to skip, just print out and return.
+ # Note that a test case not marked as 'skip' can still be
+ # skipped later, because of the test case itself in cooperation
+ # with the mysqltest program tells us so.
+ # ----------------------------------------------------------------------
+
+ if ( $tinfo->{'skip'} )
+ {
+ mtr_report_test_name($tinfo);
+ mtr_report_test_skipped($tinfo);
+ return 1;
+ }
+
+ if ($tinfo->{'ndb_test'})
+ {
+ foreach my $cluster (@{$clusters})
+ {
+ # Slave cluster is skipped and thus not
+ # installed, no need to perform checks
+ last if ($opt_skip_ndbcluster_slave and
+ $cluster->{'name'} eq 'Slave');
+
+ # Using running cluster - no need
+ # to check if test should be skipped
+ # will be done by test itself
+ last if ($cluster->{'use_running'});
+
+ # If test needs this cluster, check binaries was found ok
+ if ( $cluster->{'executable_setup_failed'} )
+ {
+ mtr_report_test_name($tinfo);
+ $tinfo->{comment}=
+ "Failed to find cluster binaries";
+ mtr_report_test_failed($tinfo);
+ return 1;
+ }
+
+ # If test needs this cluster, check it was installed ok
+ if ( !$cluster->{'installed_ok'} )
+ {
+ mtr_report_test_name($tinfo);
+ $tinfo->{comment}=
+ "Cluster $cluster->{'name'} was not installed ok";
+ mtr_report_test_failed($tinfo);
+ return 1;
+ }
+
+ }
+ }
+
+ if ( $tinfo->{'component_id'} eq 'im' )
+ {
+ # If test needs im, check binaries was found ok
+ if ( $instance_manager->{'executable_setup_failed'} )
+ {
+ mtr_report_test_name($tinfo);
+ $tinfo->{comment}=
+ "Failed to find MySQL manager binaries";
+ mtr_report_test_failed($tinfo);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+sub do_before_run_mysqltest($)
+{
+ my $tinfo= shift;
+ my $args;
+
+ # Remove old files produced by mysqltest
+ my $base_file= mtr_match_extension($tinfo->{'result_file'},
+ "result"); # Trim extension
+ unlink("$base_file.reject");
+ unlink("$base_file.progress");
+ unlink("$base_file.log");
+ unlink("$base_file.warnings");
+
+ if (!$opt_extern)
+ {
+ if ( $mysql_version_id < 50000 ) {
+ # Set environment variable NDB_STATUS_OK to 1
+ # if script decided to run mysqltest cluster _is_ installed ok
+ $ENV{'NDB_STATUS_OK'} = "1";
+ } elsif ( $mysql_version_id < 50100 ) {
+ # Set environment variable NDB_STATUS_OK to YES
+ # if script decided to run mysqltest cluster _is_ installed ok
+ $ENV{'NDB_STATUS_OK'} = "YES";
+ }
+ if (defined $tinfo->{binlog_format} and $mysql_version_id > 50100 )
+ {
+ # Dynamically switch binlog format of
+ # master, slave is always restarted
+ foreach my $server ( @$master )
+ {
+ next unless ($server->{'pid'});
+
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--user=root");
+ mtr_add_arg($args, "--port=$server->{'port'}");
+ mtr_add_arg($args, "--socket=$server->{'path_sock'}");
+
+ my $sql= "include/set_binlog_format_".$tinfo->{binlog_format}.".sql";
+ mtr_verbose("Setting binlog format:", $tinfo->{binlog_format});
+ if (mtr_run($exe_mysql, $args, $sql, "", "", "") != 0)
+ {
+ mtr_error("Failed to switch binlog format");
+ }
+ }
+ }
+ }
+}
+
+sub do_after_run_mysqltest($)
+{
+ my $tinfo= shift;
+
+ # Save info from this testcase run to mysqltest.log
+ mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log)
+ if -f $path_current_test_log;
+ mtr_appendfile_to_file($path_timefile, $path_mysqltest_log)
+ if -f $path_timefile;
+}
+
+
+sub run_testcase_mark_logs($$)
+{
+ my ($tinfo, $log_msg)= @_;
+
+ # Write a marker to all log files
+
+ # The file indicating current test name
+ mtr_tonewfile($path_current_test_log, $log_msg);
+
+ # each mysqld's .err file
+ foreach my $mysqld (@{$master}, @{$slave})
+ {
+ mtr_tofile($mysqld->{path_myerr}, $log_msg);
+ }
+
+ if ( $tinfo->{'component_id'} eq 'im')
+ {
+ mtr_tofile($instance_manager->{path_err}, $log_msg);
+ mtr_tofile($instance_manager->{path_log}, $log_msg);
+ }
+
+ # ndbcluster log file
+ mtr_tofile($path_ndb_testrun_log, $log_msg);
+
+}
+
+sub find_testcase_skipped_reason($)
+{
+ my ($tinfo)= @_;
+
+ # Set default message
+ $tinfo->{'comment'}= "Detected by testcase(no log file)";
+
+ # Open mysqltest-time(the mysqltest log file)
+ my $F= IO::File->new($path_timefile)
+ or return;
+ my $reason;
+
+ while ( my $line= <$F> )
+ {
+ # Look for "reason: <reason for skipping test>"
+ if ( $line =~ /reason: (.*)/ )
+ {
+ $reason= $1;
+ }
+ }
+
+ if ( ! $reason )
+ {
+ mtr_warning("Could not find reason for skipping test in $path_timefile");
+ $reason= "Detected by testcase(reason unknown) ";
+ }
+ $tinfo->{'comment'}= $reason;
+}
+
+
+##############################################################################
+#
+# Run a single test case
+#
+##############################################################################
+
+# When we get here, we have already filtered out test cases that doesn't
+# apply to the current setup, for example if we use a running server, test
+# cases that restart the server are dropped. So this function should mostly
+# be about doing things, not a lot of logic.
+
+# We don't start and kill the servers for each testcase. But some
+# testcases needs a restart, because they specify options to start
+# mysqld with. After that testcase, we need to restart again, to set
+# back the normal options.
+
+sub run_testcase ($) {
+ my $tinfo= shift;
+
+ # -------------------------------------------------------
+ # Init variables that can change between each test case
+ # -------------------------------------------------------
+
+ $ENV{'TZ'}= $tinfo->{'timezone'};
+ mtr_verbose("Setting timezone: $tinfo->{'timezone'}");
+
+ my $master_restart= run_testcase_need_master_restart($tinfo);
+ my $slave_restart= run_testcase_need_slave_restart($tinfo);
+
+ if ($master_restart or $slave_restart)
+ {
+ # Can't restart a running server that may be in use
+ if ( $opt_extern )
+ {
+ mtr_report_test_name($tinfo);
+ $tinfo->{comment}= "Can't restart a running server";
+ mtr_report_test_skipped($tinfo);
+ return;
+ }
+
+ run_testcase_stop_servers($tinfo, $master_restart, $slave_restart);
+ }
+
+ # Write to all log files to indicate start of testcase
+ run_testcase_mark_logs($tinfo, "CURRENT_TEST: $tinfo->{name}\n");
+
+ my $died= mtr_record_dead_children();
+ if ($died or $master_restart or $slave_restart)
+ {
+ if (run_testcase_start_servers($tinfo))
+ {
+ mtr_report_test_name($tinfo);
+ report_failure_and_restart($tinfo);
+ return 1;
+ }
+ }
+ elsif ($glob_use_embedded_server)
+ {
+ run_master_init_script($tinfo);
+ }
+
+ # ----------------------------------------------------------------------
+ # If --start-and-exit or --start-dirty given, stop here to let user manually
+ # run tests
+ # ----------------------------------------------------------------------
+ if ( $opt_start_and_exit or $opt_start_dirty )
+ {
+ mtr_timer_stop_all($glob_timers);
+ mtr_report("\nServers started, exiting");
+ if ($glob_win32_perl)
+ {
+ #ActiveState perl hangs when using normal exit, use POSIX::_exit instead
+ use POSIX qw[ _exit ];
+ POSIX::_exit(0);
+ }
+ else
+ {
+ exit(0);
+ }
+ }
+
+ {
+ do_before_run_mysqltest($tinfo);
+
+ my $res= run_mysqltest($tinfo);
+ mtr_report_test_name($tinfo);
+
+ do_after_run_mysqltest($tinfo);
+
+ if ( $res == 0 )
+ {
+ mtr_report_test_passed($tinfo);
+ }
+ elsif ( $res == 62 )
+ {
+ # Testcase itself tell us to skip this one
+
+ # Try to get reason from mysqltest.log
+ find_testcase_skipped_reason($tinfo);
+ mtr_report_test_skipped($tinfo);
+ }
+ elsif ( $res == 63 )
+ {
+ $tinfo->{'timeout'}= 1; # Mark as timeout
+ report_failure_and_restart($tinfo);
+ }
+ elsif ( $res == 1 )
+ {
+ # Test case failure reported by mysqltest
+ report_failure_and_restart($tinfo);
+ }
+ else
+ {
+ # mysqltest failed, probably crashed
+ $tinfo->{comment}=
+ "mysqltest returned unexpected code $res, it has probably crashed";
+ report_failure_and_restart($tinfo);
+ }
+ }
+
+ # Remove the file that mysqltest writes info to
+ unlink($path_timefile);
+
+ # ----------------------------------------------------------------------
+ # Stop Instance Manager if we are processing an IM-test case.
+ # ----------------------------------------------------------------------
+ if ( $tinfo->{'component_id'} eq 'im' and
+ !mtr_im_stop($instance_manager, $tinfo->{'name'}))
+ {
+ mtr_error("Failed to stop Instance Manager.")
+ }
+}
+
+
+#
+# Save a snapshot of the installed test db(s)
+# I.e take a snapshot of the var/ dir
+#
+sub save_installed_db () {
+
+ mtr_report("Saving snapshot of installed databases");
+ mtr_rmtree($path_snapshot);
+
+ foreach my $data_dir (@data_dir_lst)
+ {
+ my $name= basename($data_dir);
+ mtr_copy_dir("$data_dir", "$path_snapshot/$name");
+ }
+}
+
+
+#
+# Save any interesting files in the data_dir
+# before the data dir is removed.
+#
+sub save_files_before_restore($$) {
+ my $test_name= shift;
+ my $data_dir= shift;
+ my $save_name= "$opt_vardir/log/$test_name";
+
+ # Look for core files
+ foreach my $core_file ( glob("$data_dir/core*") )
+ {
+ last if $opt_max_save_core > 0 && $num_saved_cores >= $opt_max_save_core;
+ my $core_name= basename($core_file);
+ mtr_report("Saving $core_name");
+ mkdir($save_name) if ! -d $save_name;
+ rename("$core_file", "$save_name/$core_name");
+ ++$num_saved_cores;
+ }
+}
+
+
+#
+# Restore snapshot of the installed test db(s)
+# if the snapshot exists
+#
+sub restore_installed_db ($) {
+ my $test_name= shift;
+
+ if ( -d $path_snapshot)
+ {
+ mtr_report("Restoring snapshot of databases");
+
+ foreach my $data_dir (@data_dir_lst)
+ {
+ my $name= basename($data_dir);
+ save_files_before_restore($test_name, $data_dir);
+ mtr_rmtree("$data_dir");
+ mtr_copy_dir("$path_snapshot/$name", "$data_dir");
+ }
+
+ # Remove the ndb_*_fs dirs for all ndbd nodes
+ # forcing a clean start of ndb
+ foreach my $cluster (@{$clusters})
+ {
+ foreach my $ndbd (@{$cluster->{'ndbds'}})
+ {
+ mtr_rmtree("$ndbd->{'path_fs'}" );
+ }
+ }
+ }
+ else
+ {
+ # No snapshot existed
+ mtr_error("No snapshot existed");
+ }
+}
+
+sub report_failure_and_restart ($) {
+ my $tinfo= shift;
+
+ mtr_report_test_failed($tinfo);
+ print "\n";
+ if ( $opt_force )
+ {
+ # Stop all servers that are known to be running
+ stop_all_servers();
+
+ # Restore the snapshot of the installed test db
+ restore_installed_db($tinfo->{'name'});
+ mtr_report("Resuming Tests\n");
+ return;
+ }
+
+ my $test_mode= join(" ", @::glob_test_mode) || "default";
+ mtr_report("Aborting: $tinfo->{'name'} failed in $test_mode mode. ");
+ mtr_report("To continue, re-run with '--force'.");
+ if ( ! $glob_debugger and
+ ! $opt_extern and
+ ! $glob_use_embedded_server )
+ {
+ stop_all_servers();
+ }
+ mtr_exit(1);
+
+}
+
+
+sub run_master_init_script ($) {
+ my ($tinfo)= @_;
+ my $init_script= $tinfo->{'master_sh'};
+
+ # Run master initialization shell script if one exists
+ if ( $init_script )
+ {
+ my $ret= mtr_run("/bin/sh", [$init_script], "", "", "", "");
+ if ( $ret != 0 )
+ {
+ # FIXME rewrite those scripts to return 0 if successful
+ # mtr_warning("$init_script exited with code $ret");
+ }
+ }
+}
+
+
+##############################################################################
+#
+# Start and stop servers
+#
+##############################################################################
+
+
+sub do_before_start_master ($) {
+ my ($tinfo)= @_;
+
+ my $tname= $tinfo->{'name'};
+
+ # FIXME what about second master.....
+
+ # Don't delete anything if starting dirty
+ return if ($opt_start_dirty);
+
+ foreach my $bin ( glob("$opt_vardir/log/master*-bin*") )
+ {
+ unlink($bin);
+ }
+
+ # FIXME only remove the ones that are tied to this master
+ # Remove old master.info and relay-log.info files
+ unlink("$master->[0]->{'path_myddir'}/master.info");
+ unlink("$master->[0]->{'path_myddir'}/relay-log.info");
+ unlink("$master->[1]->{'path_myddir'}/master.info");
+ unlink("$master->[1]->{'path_myddir'}/relay-log.info");
+
+ run_master_init_script($tinfo);
+}
+
+
+sub do_before_start_slave ($) {
+ my ($tinfo)= @_;
+
+ my $tname= $tinfo->{'name'};
+ my $init_script= $tinfo->{'master_sh'};
+
+ # Don't delete anything if starting dirty
+ return if ($opt_start_dirty);
+
+ foreach my $bin ( glob("$opt_vardir/log/slave*-bin*") )
+ {
+ unlink($bin);
+ }
+
+ unlink("$slave->[0]->{'path_myddir'}/master.info");
+ unlink("$slave->[0]->{'path_myddir'}/relay-log.info");
+
+ # Run slave initialization shell script if one exists
+ if ( $init_script )
+ {
+ my $ret= mtr_run("/bin/sh", [$init_script], "", "", "", "");
+ if ( $ret != 0 )
+ {
+ # FIXME rewrite those scripts to return 0 if successful
+ # mtr_warning("$init_script exited with code $ret");
+ }
+ }
+
+ foreach my $bin ( glob("$slave->[0]->{'path_myddir'}/log.*") )
+ {
+ unlink($bin);
+ }
+}
+
+
+sub mysqld_arguments ($$$$) {
+ my $args= shift;
+ my $mysqld= shift;
+ my $extra_opt= shift;
+ my $slave_master_info= shift;
+
+ my $idx= $mysqld->{'idx'};
+ my $sidx= ""; # Index as string, 0 is empty string
+ if ( $idx> 0 )
+ {
+ $sidx= $idx;
+ }
+
+ my $prefix= ""; # If mysqltest server arg
+ if ( $glob_use_embedded_server )
+ {
+ $prefix= "--server-arg=";
+ }
+
+ mtr_add_arg($args, "%s--no-defaults", $prefix);
+
+ mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
+ mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
+
+ if ( $mysql_version_id >= 50036)
+ {
+ # By default, prevent the started mysqld to access files outside of vardir
+ mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
+ }
+
+ if ( $mysql_version_id >= 50000 )
+ {
+ mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
+ }
+
+ mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
+ mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
+ mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
+
+ # Increase default connect_timeout to avoid intermittent
+ # disconnects when test servers are put under load
+ # see BUG#28359
+ mtr_add_arg($args, "%s--connect-timeout=60", $prefix);
+
+
+ # When mysqld is run by a root user(euid is 0), it will fail
+ # to start unless we specify what user to run as, see BUG#30630
+ my $euid= $>;
+ if (!$glob_win32 and $euid == 0 and
+ grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) {
+ mtr_add_arg($args, "%s--user=root", $prefix);
+ }
+
+ if ( $opt_valgrind_mysqld )
+ {
+ mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
+
+ if ( $mysql_version_id < 50100 )
+ {
+ mtr_add_arg($args, "%s--skip-bdb", $prefix);
+ }
+ }
+
+ mtr_add_arg($args, "%s--pid-file=%s", $prefix,
+ $mysqld->{'path_pid'});
+
+ mtr_add_arg($args, "%s--port=%d", $prefix,
+ $mysqld->{'port'});
+
+ mtr_add_arg($args, "%s--socket=%s", $prefix,
+ $mysqld->{'path_sock'});
+
+ mtr_add_arg($args, "%s--datadir=%s", $prefix,
+ $mysqld->{'path_myddir'});
+
+
+ if ( $mysql_version_id >= 50106 )
+ {
+ # Turn on logging to bothe tables and file
+ mtr_add_arg($args, "%s--log-output=table,file", $prefix);
+ }
+
+ my $log_base_path= "$opt_vardir/log/$mysqld->{'type'}$sidx";
+ mtr_add_arg($args, "%s--log=%s.log", $prefix, $log_base_path);
+ mtr_add_arg($args,
+ "%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path);
+
+ # Check if "extra_opt" contains --skip-log-bin
+ my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt, @opt_extra_mysqld_opt);
+ if ( $mysqld->{'type'} eq 'master' )
+ {
+ if (! ($opt_skip_master_binlog || $skip_binlog) )
+ {
+ mtr_add_arg($args, "%s--log-bin=%s/log/master-bin%s", $prefix,
+ $opt_vardir, $sidx);
+ }
+
+ mtr_add_arg($args, "%s--server-id=%d", $prefix,
+ $idx > 0 ? $idx + 101 : 1);
+
+ mtr_add_arg($args, "%s--loose-innodb_data_file_path=ibdata1:10M:autoextend",
+ $prefix);
+
+ mtr_add_arg($args, "%s--local-infile", $prefix);
+
+ if ( $idx > 0 or !$use_innodb)
+ {
+ mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
+ }
+
+ my $cluster= $clusters->[$mysqld->{'cluster'}];
+ if ( $cluster->{'pid'} || # Cluster is started
+ $cluster->{'use_running'} ) # Using running cluster
+ {
+ mtr_add_arg($args, "%s--ndbcluster", $prefix);
+ mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
+ $cluster->{'connect_string'});
+ if ( $mysql_version_id >= 50100 )
+ {
+ mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
+ }
+ }
+ else
+ {
+ mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
+ }
+ }
+ else
+ {
+ mtr_error("unknown mysqld type")
+ unless $mysqld->{'type'} eq 'slave';
+
+ mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix);
+ if (! ( $opt_skip_slave_binlog || $skip_binlog ))
+ {
+ mtr_add_arg($args, "%s--log-bin=%s/log/slave%s-bin", $prefix,
+ $opt_vardir, $sidx); # FIXME use own dir for binlogs
+ mtr_add_arg($args, "%s--log-slave-updates", $prefix);
+ }
+
+ mtr_add_arg($args, "%s--master-retry-count=10", $prefix);
+
+ mtr_add_arg($args, "%s--relay-log=%s/log/slave%s-relay-bin", $prefix,
+ $opt_vardir, $sidx);
+ mtr_add_arg($args, "%s--report-host=127.0.0.1", $prefix);
+ mtr_add_arg($args, "%s--report-port=%d", $prefix,
+ $mysqld->{'port'});
+ mtr_add_arg($args, "%s--report-user=root", $prefix);
+ mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
+ mtr_add_arg($args, "%s--skip-slave-start", $prefix);
+
+ # Directory where slaves find the dumps generated by "load data"
+ # on the server. The path need to have constant length otherwise
+ # test results will vary, thus a relative path is used.
+ my $slave_load_path= "../tmp";
+ mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix,
+ $slave_load_path);
+ mtr_add_arg($args, "%s--set-variable=slave_net_timeout=120", $prefix);
+
+ if ( @$slave_master_info )
+ {
+ foreach my $arg ( @$slave_master_info )
+ {
+ mtr_add_arg($args, "%s%s", $prefix, $arg);
+ }
+ }
+ else
+ {
+ if ($mysql_version_id < 50200)
+ {
+ mtr_add_arg($args, "%s--master-user=root", $prefix);
+ mtr_add_arg($args, "%s--master-connect-retry=1", $prefix);
+ mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix);
+ mtr_add_arg($args, "%s--master-password=", $prefix);
+ mtr_add_arg($args, "%s--master-port=%d", $prefix,
+ $master->[0]->{'port'}); # First master
+ }
+ my $slave_server_id= 2 + $idx;
+ my $slave_rpl_rank= $slave_server_id;
+ mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
+ mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
+ }
+
+ my $cluster= $clusters->[$mysqld->{'cluster'}];
+ if ( $cluster->{'pid'} || # Slave cluster is started
+ $cluster->{'use_running'} ) # Using running slave cluster
+ {
+ mtr_add_arg($args, "%s--ndbcluster", $prefix);
+ mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
+ $cluster->{'connect_string'});
+
+ if ( $mysql_version_id >= 50100 )
+ {
+ mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
+ }
+ }
+ else
+ {
+ mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
+ }
+
+ } # end slave
+
+ if ( $opt_debug )
+ {
+ mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/%s%s.trace",
+ $prefix, $path_vardir_trace, $mysqld->{'type'}, $sidx);
+ }
+
+ mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix);
+ mtr_add_arg($args, "%s--sort_buffer=256K", $prefix);
+ mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix);
+
+ if ( $opt_ssl_supported )
+ {
+ mtr_add_arg($args, "%s--ssl-ca=%s/std_data/cacert.pem", $prefix,
+ $glob_mysql_test_dir);
+ mtr_add_arg($args, "%s--ssl-cert=%s/std_data/server-cert.pem", $prefix,
+ $glob_mysql_test_dir);
+ mtr_add_arg($args, "%s--ssl-key=%s/std_data/server-key.pem", $prefix,
+ $glob_mysql_test_dir);
+ }
+
+ if ( $opt_warnings )
+ {
+ mtr_add_arg($args, "%s--log-warnings", $prefix);
+ }
+
+ # Indicate to "mysqld" it will be debugged in debugger
+ if ( $glob_debugger )
+ {
+ mtr_add_arg($args, "%s--gdb", $prefix);
+ }
+
+ my $found_skip_core= 0;
+ foreach my $arg ( @opt_extra_mysqld_opt, @$extra_opt )
+ {
+ # Allow --skip-core-file to be set in <testname>-[master|slave].opt file
+ if ($arg eq "--skip-core-file")
+ {
+ $found_skip_core= 1;
+ }
+ elsif ($skip_binlog and mtr_match_prefix($arg, "--binlog-format"))
+ {
+ ; # Dont add --binlog-format when running without binlog
+ }
+ else
+ {
+ mtr_add_arg($args, "%s%s", $prefix, $arg);
+ }
+ }
+ if ( !$found_skip_core )
+ {
+ mtr_add_arg($args, "%s%s", $prefix, "--core-file");
+ }
+
+ if ( $opt_bench )
+ {
+ mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix);
+ mtr_add_arg($args, "%s--init-rpl-role=master", $prefix);
+ }
+ elsif ( $mysqld->{'type'} eq 'master' )
+ {
+ mtr_add_arg($args, "%s--open-files-limit=1024", $prefix);
+ }
+
+ return $args;
+}
+
+
+##############################################################################
+#
+# Start mysqld and return the PID
+#
+##############################################################################
+
+sub mysqld_start ($$$) {
+ my $mysqld= shift;
+ my $extra_opt= shift;
+ my $slave_master_info= shift;
+
+ my $args; # Arg vector
+ my $exe;
+ my $pid= -1;
+ my $wait_for_pid_file= 1;
+
+ my $type= $mysqld->{'type'};
+ my $idx= $mysqld->{'idx'};
+
+ mtr_error("Internal error: mysqld should never be started for embedded")
+ if $glob_use_embedded_server;
+
+ if ( $type eq 'master' )
+ {
+ $exe= $exe_master_mysqld;
+ }
+ elsif ( $type eq 'slave' )
+ {
+ $exe= $exe_slave_mysqld;
+ }
+ else
+ {
+ mtr_error("Unknown 'type' \"$type\" passed to mysqld_start");
+ }
+
+ mtr_init_args(\$args);
+
+ if ( $opt_valgrind_mysqld )
+ {
+ valgrind_arguments($args, \$exe);
+ }
+
+ mysqld_arguments($args,$mysqld,$extra_opt,$slave_master_info);
+
+ if ( $opt_gdb || $opt_manual_gdb)
+ {
+ gdb_arguments(\$args, \$exe, "$type"."_$idx");
+ }
+ elsif ( $opt_ddd || $opt_manual_ddd )
+ {
+ ddd_arguments(\$args, \$exe, "$type"."_$idx");
+ }
+ elsif ( $opt_debugger )
+ {
+ debugger_arguments(\$args, \$exe, "$type"."_$idx");
+ }
+ elsif ( $opt_manual_debug )
+ {
+ print "\nStart $type in your debugger\n" .
+ "dir: $glob_mysql_test_dir\n" .
+ "exe: $exe\n" .
+ "args: " . join(" ", @$args) . "\n\n" .
+ "Waiting ....\n";
+
+ # Indicate the exe should not be started
+ $exe= undef;
+ }
+ else
+ {
+ # Default to not wait until pid file has been created
+ $wait_for_pid_file= 0;
+ }
+
+ # Remove the pidfile
+ unlink($mysqld->{'path_pid'});
+
+ if ( defined $exe )
+ {
+ $pid= mtr_spawn($exe, $args, "",
+ $mysqld->{'path_myerr'},
+ $mysqld->{'path_myerr'},
+ "",
+ { append_log_file => 1 });
+ }
+
+
+ if ( $wait_for_pid_file && !sleep_until_file_created($mysqld->{'path_pid'},
+ $mysqld->{'start_timeout'},
+ $pid))
+ {
+
+ mtr_error("Failed to start mysqld $mysqld->{'type'}");
+ }
+
+
+ # Remember pid of the started process
+ $mysqld->{'pid'}= $pid;
+
+ # Remember options used when starting
+ $mysqld->{'start_opts'}= $extra_opt;
+ $mysqld->{'start_slave_master_info'}= $slave_master_info;
+
+ mtr_verbose("mysqld pid: $pid");
+ return $pid;
+}
+
+
+sub stop_all_servers () {
+
+ mtr_report("Stopping All Servers");
+
+ if ( ! $opt_skip_im )
+ {
+ mtr_report("Shutting-down Instance Manager");
+ unless (mtr_im_stop($instance_manager, "stop_all_servers"))
+ {
+ mtr_error("Failed to stop Instance Manager.")
+ }
+ }
+
+ my %admin_pids; # hash of admin processes that requests shutdown
+ my @kill_pids; # list of processes to shutdown/kill
+ my $pid;
+
+ # Start shutdown of all started masters
+ foreach my $mysqld (@{$slave}, @{$master})
+ {
+ if ( $mysqld->{'pid'} )
+ {
+ $pid= mtr_mysqladmin_start($mysqld, "shutdown", 70);
+ $admin_pids{$pid}= 1;
+
+ push(@kill_pids,{
+ pid => $mysqld->{'pid'},
+ real_pid => $mysqld->{'real_pid'},
+ pidfile => $mysqld->{'path_pid'},
+ sockfile => $mysqld->{'path_sock'},
+ port => $mysqld->{'port'},
+ errfile => $mysqld->{'path_myerr'},
+ });
+
+ $mysqld->{'pid'}= 0; # Assume we are done with it
+ }
+ }
+
+ # Start shutdown of clusters
+ foreach my $cluster (@{$clusters})
+ {
+ if ( $cluster->{'pid'} )
+ {
+ $pid= mtr_ndbmgm_start($cluster, "shutdown");
+ $admin_pids{$pid}= 1;
+
+ push(@kill_pids,{
+ pid => $cluster->{'pid'},
+ pidfile => $cluster->{'path_pid'}
+ });
+
+ $cluster->{'pid'}= 0; # Assume we are done with it
+
+ foreach my $ndbd (@{$cluster->{'ndbds'}})
+ {
+ if ( $ndbd->{'pid'} )
+ {
+ push(@kill_pids,{
+ pid => $ndbd->{'pid'},
+ pidfile => $ndbd->{'path_pid'},
+ });
+ $ndbd->{'pid'}= 0;
+ }
+ }
+ }
+ }
+
+ # Wait blocking until all shutdown processes has completed
+ mtr_wait_blocking(\%admin_pids);
+
+ # Make sure that process has shutdown else try to kill them
+ mtr_check_stop_servers(\@kill_pids);
+
+ foreach my $mysqld (@{$master}, @{$slave})
+ {
+ rm_ndbcluster_tables($mysqld->{'path_myddir'});
+ }
+}
+
+
+sub run_testcase_need_master_restart($)
+{
+ my ($tinfo)= @_;
+
+ # We try to find out if we are to restart the master(s)
+ my $do_restart= 0; # Assumes we don't have to
+
+ if ( $glob_use_embedded_server )
+ {
+ mtr_verbose("Never start or restart for embedded server");
+ return $do_restart;
+ }
+ elsif ( $tinfo->{'master_sh'} )
+ {
+ $do_restart= 1; # Always restart if script to run
+ mtr_verbose("Restart master: Always restart if script to run");
+ }
+ if ( $tinfo->{'force_restart'} )
+ {
+ $do_restart= 1; # Always restart if --force-restart in -opt file
+ mtr_verbose("Restart master: Restart forced with --force-restart");
+ }
+ elsif ( ! $opt_skip_ndbcluster and
+ !$tinfo->{'ndb_test'} and
+ $clusters->[0]->{'pid'} != 0 )
+ {
+ $do_restart= 1; # Restart without cluster
+ mtr_verbose("Restart master: Test does not need cluster");
+ }
+ elsif ( ! $opt_skip_ndbcluster and
+ $tinfo->{'ndb_test'} and
+ $clusters->[0]->{'pid'} == 0 )
+ {
+ $do_restart= 1; # Restart with cluster
+ mtr_verbose("Restart master: Test need cluster");
+ }
+ elsif( $tinfo->{'component_id'} eq 'im' )
+ {
+ $do_restart= 1;
+ mtr_verbose("Restart master: Always restart for im tests");
+ }
+ elsif ( $master->[0]->{'running_master_options'} and
+ $master->[0]->{'running_master_options'}->{'timezone'} ne
+ $tinfo->{'timezone'})
+ {
+ $do_restart= 1;
+ mtr_verbose("Restart master: Different timezone");
+ }
+ # Check that running master was started with same options
+ # as the current test requires
+ elsif (! mtr_same_opts($master->[0]->{'start_opts'},
+ $tinfo->{'master_opt'}) )
+ {
+ $do_restart= 1;
+ mtr_verbose("Restart master: running with different options '" .
+ join(" ", @{$tinfo->{'master_opt'}}) . "' != '" .
+ join(" ", @{$master->[0]->{'start_opts'}}) . "'" );
+ }
+ elsif( ! $master->[0]->{'pid'} )
+ {
+ if ( $opt_extern )
+ {
+ $do_restart= 0;
+ mtr_verbose("No restart: using extern master");
+ }
+ else
+ {
+ $do_restart= 1;
+ mtr_verbose("Restart master: master is not started");
+ }
+ }
+ return $do_restart;
+}
+
+sub run_testcase_need_slave_restart($)
+{
+ my ($tinfo)= @_;
+
+ # We try to find out if we are to restart the slaves
+ my $do_slave_restart= 0; # Assumes we don't have to
+
+ if ( $glob_use_embedded_server )
+ {
+ mtr_verbose("Never start or restart for embedded server");
+ return $do_slave_restart;
+ }
+ elsif ( $max_slave_num == 0)
+ {
+ mtr_verbose("Skip slave restart: No testcase use slaves");
+ }
+ else
+ {
+
+ # Check if any slave is currently started
+ my $any_slave_started= 0;
+ foreach my $mysqld (@{$slave})
+ {
+ if ( $mysqld->{'pid'} )
+ {
+ $any_slave_started= 1;
+ last;
+ }
+ }
+
+ if ($any_slave_started)
+ {
+ mtr_verbose("Restart slave: Slave is started, always restart");
+ $do_slave_restart= 1;
+ }
+ elsif ( $tinfo->{'slave_num'} )
+ {
+ mtr_verbose("Restart slave: Test need slave");
+ $do_slave_restart= 1;
+ }
+ }
+
+ return $do_slave_restart;
+
+}
+
+# ----------------------------------------------------------------------
+# If not using a running servers we may need to stop and restart.
+# We restart in the case we have initiation scripts, server options
+# etc to run. But we also restart again after the test first restart
+# and test is run, to get back to normal server settings.
+#
+# To make the code a bit more clean, we actually only stop servers
+# here, and mark this to be done. Then a generic "start" part will
+# start up the needed servers again.
+# ----------------------------------------------------------------------
+
+sub run_testcase_stop_servers($$$) {
+ my ($tinfo, $do_restart, $do_slave_restart)= @_;
+ my $pid;
+ my %admin_pids; # hash of admin processes that requests shutdown
+ my @kill_pids; # list of processes to shutdown/kill
+
+ # Remember if we restarted for this test case (count restarts)
+ $tinfo->{'restarted'}= $do_restart;
+
+ if ( $do_restart )
+ {
+ delete $master->[0]->{'running_master_options'}; # Forget history
+
+ # Start shutdown of all started masters
+ foreach my $mysqld (@{$master})
+ {
+ if ( $mysqld->{'pid'} )
+ {
+ $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
+
+ $admin_pids{$pid}= 1;
+
+ push(@kill_pids,{
+ pid => $mysqld->{'pid'},
+ real_pid => $mysqld->{'real_pid'},
+ pidfile => $mysqld->{'path_pid'},
+ sockfile => $mysqld->{'path_sock'},
+ port => $mysqld->{'port'},
+ errfile => $mysqld->{'path_myerr'},
+ });
+
+ $mysqld->{'pid'}= 0; # Assume we are done with it
+ }
+ }
+
+ # Start shutdown of master cluster
+ my $cluster= $clusters->[0];
+ if ( $cluster->{'pid'} )
+ {
+ $pid= mtr_ndbmgm_start($cluster, "shutdown");
+ $admin_pids{$pid}= 1;
+
+ push(@kill_pids,{
+ pid => $cluster->{'pid'},
+ pidfile => $cluster->{'path_pid'}
+ });
+
+ $cluster->{'pid'}= 0; # Assume we are done with it
+
+ foreach my $ndbd (@{$cluster->{'ndbds'}})
+ {
+ push(@kill_pids,{
+ pid => $ndbd->{'pid'},
+ pidfile => $ndbd->{'path_pid'},
+ });
+ $ndbd->{'pid'}= 0; # Assume we are done with it
+ }
+ }
+ }
+
+ if ( $do_restart || $do_slave_restart )
+ {
+
+ delete $slave->[0]->{'running_slave_options'}; # Forget history
+
+ # Start shutdown of all started slaves
+ foreach my $mysqld (@{$slave})
+ {
+ if ( $mysqld->{'pid'} )
+ {
+ $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
+
+ $admin_pids{$pid}= 1;
+
+ push(@kill_pids,{
+ pid => $mysqld->{'pid'},
+ real_pid => $mysqld->{'real_pid'},
+ pidfile => $mysqld->{'path_pid'},
+ sockfile => $mysqld->{'path_sock'},
+ port => $mysqld->{'port'},
+ errfile => $mysqld->{'path_myerr'},
+ });
+
+
+ $mysqld->{'pid'}= 0; # Assume we are done with it
+ }
+ }
+
+ # Start shutdown of slave cluster
+ my $cluster= $clusters->[1];
+ if ( $cluster->{'pid'} )
+ {
+ $pid= mtr_ndbmgm_start($cluster, "shutdown");
+
+ $admin_pids{$pid}= 1;
+
+ push(@kill_pids,{
+ pid => $cluster->{'pid'},
+ pidfile => $cluster->{'path_pid'}
+ });
+
+ $cluster->{'pid'}= 0; # Assume we are done with it
+
+ foreach my $ndbd (@{$cluster->{'ndbds'}} )
+ {
+ push(@kill_pids,{
+ pid => $ndbd->{'pid'},
+ pidfile => $ndbd->{'path_pid'},
+ });
+ $ndbd->{'pid'}= 0; # Assume we are done with it
+ }
+ }
+ }
+
+ # ----------------------------------------------------------------------
+ # Shutdown has now been started and lists for the shutdown processes
+ # and the processes to be killed has been created
+ # ----------------------------------------------------------------------
+
+ # Wait blocking until all shutdown processes has completed
+ mtr_wait_blocking(\%admin_pids);
+
+
+ # Make sure that process has shutdown else try to kill them
+ mtr_check_stop_servers(\@kill_pids);
+
+ foreach my $mysqld (@{$master}, @{$slave})
+ {
+ if ( ! $mysqld->{'pid'} )
+ {
+ # Remove ndbcluster tables if server is stopped
+ rm_ndbcluster_tables($mysqld->{'path_myddir'});
+ }
+ }
+}
+
+
+#
+# run_testcase_start_servers
+#
+# Start the servers needed by this test case
+#
+# RETURN
+# 0 OK
+# 1 Start failed
+#
+
+sub run_testcase_start_servers($) {
+ my $tinfo= shift;
+ my $tname= $tinfo->{'name'};
+
+ if ( $tinfo->{'component_id'} eq 'mysqld' )
+ {
+ if ( ! $opt_skip_ndbcluster and
+ !$clusters->[0]->{'pid'} and
+ $tinfo->{'ndb_test'} )
+ {
+ # Test need cluster, cluster is not started, start it
+ ndbcluster_start($clusters->[0], "");
+ }
+
+ if ( !$master->[0]->{'pid'} )
+ {
+ # Master mysqld is not started
+ do_before_start_master($tinfo);
+
+ mysqld_start($master->[0],$tinfo->{'master_opt'},[]);
+
+ }
+
+ if ( $clusters->[0]->{'pid'} || $clusters->[0]->{'use_running'}
+ and ! $master->[1]->{'pid'} and
+ $tinfo->{'master_num'} > 1 )
+ {
+ # Test needs cluster, start an extra mysqld connected to cluster
+
+ if ( $mysql_version_id >= 50100 )
+ {
+ # First wait for first mysql server to have created ndb system
+ # tables ok FIXME This is a workaround so that only one mysqld
+ # create the tables
+ if ( ! sleep_until_file_created(
+ "$master->[0]->{'path_myddir'}/mysql/ndb_apply_status.ndb",
+ $master->[0]->{'start_timeout'},
+ $master->[0]->{'pid'}))
+ {
+
+ $tinfo->{'comment'}= "Failed to create 'mysql/ndb_apply_status' table";
+ return 1;
+ }
+ }
+ mysqld_start($master->[1],$tinfo->{'master_opt'},[]);
+ }
+
+ # Save this test case information, so next can examine it
+ $master->[0]->{'running_master_options'}= $tinfo;
+ }
+ elsif ( ! $opt_skip_im and $tinfo->{'component_id'} eq 'im' )
+ {
+ # We have to create defaults file every time, in order to ensure that it
+ # will be the same for each test. The problem is that test can change the
+ # file (by SET/UNSET commands), so w/o recreating the file, execution of
+ # one test can affect the other.
+
+ im_create_defaults_file($instance_manager);
+
+ if ( ! mtr_im_start($instance_manager, $tinfo->{im_opts}) )
+ {
+ $tinfo->{'comment'}= "Failed to start Instance Manager. ";
+ return 1;
+ }
+ }
+
+ # ----------------------------------------------------------------------
+ # Start slaves - if needed
+ # ----------------------------------------------------------------------
+ if ( $tinfo->{'slave_num'} )
+ {
+ restore_slave_databases($tinfo->{'slave_num'});
+
+ do_before_start_slave($tinfo);
+
+ if ( ! $opt_skip_ndbcluster_slave and
+ !$clusters->[1]->{'pid'} and
+ $tinfo->{'ndb_test'} )
+ {
+ # Test need slave cluster, cluster is not started, start it
+ ndbcluster_start($clusters->[1], "");
+ }
+
+ for ( my $idx= 0; $idx < $tinfo->{'slave_num'}; $idx++ )
+ {
+ if ( ! $slave->[$idx]->{'pid'} )
+ {
+ mysqld_start($slave->[$idx],$tinfo->{'slave_opt'},
+ $tinfo->{'slave_mi'});
+
+ }
+ }
+
+ # Save this test case information, so next can examine it
+ $slave->[0]->{'running_slave_options'}= $tinfo;
+ }
+
+ # Wait for clusters to start
+ foreach my $cluster (@{$clusters})
+ {
+
+ next if !$cluster->{'pid'};
+
+ if (ndbcluster_wait_started($cluster, ""))
+ {
+ # failed to start
+ $tinfo->{'comment'}= "Start of $cluster->{'name'} cluster failed";
+ return 1;
+ }
+ }
+
+ # Wait for mysqld's to start
+ foreach my $mysqld (@{$master},@{$slave})
+ {
+
+ next if !$mysqld->{'pid'};
+
+ if (mysqld_wait_started($mysqld))
+ {
+ # failed to start
+ $tinfo->{'comment'}=
+ "Failed to start $mysqld->{'type'} mysqld $mysqld->{'idx'}";
+ return 1;
+ }
+ }
+ return 0;
+}
+
+#
+# Run include/check-testcase.test
+# Before a testcase, run in record mode, save result file to var
+# After testcase, run and compare with the recorded file, they should be equal!
+#
+# RETURN VALUE
+# 0 OK
+# 1 Check failed
+#
+sub run_check_testcase ($$) {
+
+ my $mode= shift;
+ my $mysqld= shift;
+
+ my $name= "check-" . $mysqld->{'type'} . $mysqld->{'idx'};
+
+ my $args;
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--silent");
+ mtr_add_arg($args, "--skip-safemalloc");
+ mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
+ mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
+
+ mtr_add_arg($args, "--socket=%s", $mysqld->{'path_sock'});
+ mtr_add_arg($args, "--port=%d", $mysqld->{'port'});
+ mtr_add_arg($args, "--database=test");
+ mtr_add_arg($args, "--user=%s", $opt_user);
+ mtr_add_arg($args, "--password=");
+
+ mtr_add_arg($args, "-R");
+ mtr_add_arg($args, "$opt_vardir/tmp/$name.result");
+
+ if ( $mode eq "before" )
+ {
+ mtr_add_arg($args, "--record");
+ }
+
+ my $res = mtr_run_test($exe_mysqltest,$args,
+ "include/check-testcase.test", "", "", "");
+
+ if ( $res == 1 and $mode eq "after")
+ {
+ mtr_run("diff",["-u",
+ "$opt_vardir/tmp/$name.result",
+ "$opt_vardir/tmp/$name.reject"],
+ "", "", "", "");
+ }
+ elsif ( $res )
+ {
+ mtr_error("Could not execute 'check-testcase' $mode testcase");
+ }
+ return $res;
+}
+
+##############################################################################
+#
+# Report the features that were compiled in
+#
+##############################################################################
+
+sub run_report_features () {
+ my $args;
+
+ if ( ! $glob_use_embedded_server )
+ {
+ mysqld_start($master->[0],[],[]);
+ if ( ! $master->[0]->{'pid'} )
+ {
+ mtr_error("Can't start the mysqld server");
+ }
+ mysqld_wait_started($master->[0]);
+ }
+
+ my $tinfo = {};
+ $tinfo->{'name'} = 'report features';
+ $tinfo->{'result_file'} = undef;
+ $tinfo->{'component_id'} = 'mysqld';
+ $tinfo->{'path'} = 'include/report-features.test';
+ $tinfo->{'timezone'}= "GMT-3";
+ $tinfo->{'slave_num'} = 0;
+ $tinfo->{'master_opt'} = [];
+ $tinfo->{'slave_opt'} = [];
+ $tinfo->{'slave_mi'} = [];
+ $tinfo->{'comment'} = 'report server features';
+ run_mysqltest($tinfo);
+
+ if ( ! $glob_use_embedded_server )
+ {
+ stop_all_servers();
+ }
+}
+
+
+sub run_mysqltest ($) {
+ my ($tinfo)= @_;
+ my $exe= $exe_mysqltest;
+ my $args;
+
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--silent");
+ mtr_add_arg($args, "--skip-safemalloc");
+ mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
+ mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
+ mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
+
+ # Log line number and time for each line in .test file
+ mtr_add_arg($args, "--mark-progress")
+ if $opt_mark_progress;
+
+ if ($tinfo->{'component_id'} eq 'im')
+ {
+ mtr_add_arg($args, "--socket=%s", $instance_manager->{'path_sock'});
+ mtr_add_arg($args, "--port=%d", $instance_manager->{'port'});
+ mtr_add_arg($args, "--user=%s", $instance_manager->{'admin_login'});
+ mtr_add_arg($args, "--password=%s", $instance_manager->{'admin_password'});
+ }
+ else # component_id == mysqld
+ {
+ mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'});
+ mtr_add_arg($args, "--port=%d", $master->[0]->{'port'});
+ mtr_add_arg($args, "--database=test");
+ mtr_add_arg($args, "--user=%s", $opt_user);
+ mtr_add_arg($args, "--password=");
+ }
+
+ if ( $opt_ps_protocol )
+ {
+ mtr_add_arg($args, "--ps-protocol");
+ }
+
+ if ( $opt_sp_protocol )
+ {
+ mtr_add_arg($args, "--sp-protocol");
+ }
+
+ if ( $opt_view_protocol )
+ {
+ mtr_add_arg($args, "--view-protocol");
+ }
+
+ if ( $opt_cursor_protocol )
+ {
+ mtr_add_arg($args, "--cursor-protocol");
+ }
+
+ if ( $opt_strace_client )
+ {
+ $exe= "strace"; # FIXME there are ktrace, ....
+ mtr_add_arg($args, "-o");
+ mtr_add_arg($args, "%s/log/mysqltest.strace", $opt_vardir);
+ mtr_add_arg($args, "$exe_mysqltest");
+ }
+
+ if ( $opt_timer )
+ {
+ mtr_add_arg($args, "--timer-file=%s/log/timer", $opt_vardir);
+ }
+
+ if ( $opt_compress )
+ {
+ mtr_add_arg($args, "--compress");
+ }
+
+ if ( $opt_sleep )
+ {
+ mtr_add_arg($args, "--sleep=%d", $opt_sleep);
+ }
+
+ if ( $opt_debug )
+ {
+ mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace",
+ $path_vardir_trace);
+ }
+
+ if ( $opt_ssl_supported )
+ {
+ mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem",
+ $glob_mysql_test_dir);
+ mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem",
+ $glob_mysql_test_dir);
+ mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem",
+ $glob_mysql_test_dir);
+ }
+
+ if ( $opt_ssl )
+ {
+ # Turn on SSL for _all_ test cases if option --ssl was used
+ mtr_add_arg($args, "--ssl");
+ }
+ elsif ( $opt_ssl_supported )
+ {
+ mtr_add_arg($args, "--skip-ssl");
+ }
+
+ # ----------------------------------------------------------------------
+ # If embedded server, we create server args to give mysqltest to pass on
+ # ----------------------------------------------------------------------
+
+ if ( $glob_use_embedded_server )
+ {
+ mysqld_arguments($args,$master->[0],$tinfo->{'master_opt'},[]);
+ }
+
+ # ----------------------------------------------------------------------
+ # export MYSQL_TEST variable containing <path>/mysqltest <args>
+ # ----------------------------------------------------------------------
+ $ENV{'MYSQL_TEST'}=
+ mtr_native_path($exe_mysqltest) . " " . join(" ", @$args);
+
+ # ----------------------------------------------------------------------
+ # Add arguments that should not go into the MYSQL_TEST env var
+ # ----------------------------------------------------------------------
+
+ if ( $opt_valgrind_mysqltest )
+ {
+ # Prefix the Valgrind options to the argument list.
+ # We do this here, since we do not want to Valgrind the nested invocations
+ # of mysqltest; that would mess up the stderr output causing test failure.
+ my @args_saved = @$args;
+ mtr_init_args(\$args);
+ valgrind_arguments($args, \$exe);
+ mtr_add_arg($args, "%s", $_) for @args_saved;
+ }
+
+ mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});
+
+ # Number of lines of resut to include in failure report
+ mtr_add_arg($args, "--tail-lines=20");
+
+ if ( defined $tinfo->{'result_file'} ) {
+ mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
+ }
+
+ if ( $opt_record )
+ {
+ mtr_add_arg($args, "--record");
+ }
+
+ if ( $opt_client_gdb )
+ {
+ gdb_arguments(\$args, \$exe, "client");
+ }
+ elsif ( $opt_client_ddd )
+ {
+ ddd_arguments(\$args, \$exe, "client");
+ }
+ elsif ( $opt_client_debugger )
+ {
+ debugger_arguments(\$args, \$exe, "client");
+ }
+
+ if ( $opt_check_testcases )
+ {
+ foreach my $mysqld (@{$master}, @{$slave})
+ {
+ if ($mysqld->{'pid'})
+ {
+ run_check_testcase("before", $mysqld);
+ }
+ }
+ }
+
+ my $res = mtr_run_test($exe,$args,"","",$path_timefile,"");
+
+ if ( $opt_check_testcases )
+ {
+ foreach my $mysqld (@{$master}, @{$slave})
+ {
+ if ($mysqld->{'pid'})
+ {
+ if (run_check_testcase("after", $mysqld))
+ {
+ # Check failed, mark the test case with that info
+ $tinfo->{'check_testcase_failed'}= 1;
+ }
+ }
+ }
+ }
+
+ return $res;
+
+}
+
+
+#
+# Modify the exe and args so that program is run in gdb in xterm
+#
+sub gdb_arguments {
+ my $args= shift;
+ my $exe= shift;
+ my $type= shift;
+
+ # Write $args to gdb init file
+ my $str= join(" ", @$$args);
+ my $gdb_init_file= "$opt_tmpdir/gdbinit.$type";
+
+ # Remove the old gdbinit file
+ unlink($gdb_init_file);
+
+ if ( $type eq "client" )
+ {
+ # write init file for client
+ mtr_tofile($gdb_init_file,
+ "set args $str\n" .
+ "break main\n");
+ }
+ else
+ {
+ # write init file for mysqld
+ mtr_tofile($gdb_init_file,
+ "set args $str\n" .
+ "break mysql_parse\n" .
+ "commands 1\n" .
+ "disable 1\n" .
+ "end\n" .
+ "run");
+ }
+
+ if ( $opt_manual_gdb )
+ {
+ print "\nTo start gdb for $type, type in another window:\n";
+ print "gdb -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n";
+
+ # Indicate the exe should not be started
+ $$exe= undef;
+ return;
+ }
+
+ $$args= [];
+ mtr_add_arg($$args, "-title");
+ mtr_add_arg($$args, "$type");
+ mtr_add_arg($$args, "-e");
+
+ if ( $exe_libtool )
+ {
+ mtr_add_arg($$args, $exe_libtool);
+ mtr_add_arg($$args, "--mode=execute");
+ }
+
+ mtr_add_arg($$args, "gdb");
+ mtr_add_arg($$args, "-x");
+ mtr_add_arg($$args, "$gdb_init_file");
+ mtr_add_arg($$args, "$$exe");
+
+ $$exe= "xterm";
+}
+
+
+#
+# Modify the exe and args so that program is run in ddd
+#
+sub ddd_arguments {
+ my $args= shift;
+ my $exe= shift;
+ my $type= shift;
+
+ # Write $args to ddd init file
+ my $str= join(" ", @$$args);
+ my $gdb_init_file= "$opt_tmpdir/gdbinit.$type";
+
+ # Remove the old gdbinit file
+ unlink($gdb_init_file);
+
+ if ( $type eq "client" )
+ {
+ # write init file for client
+ mtr_tofile($gdb_init_file,
+ "set args $str\n" .
+ "break main\n");
+ }
+ else
+ {
+ # write init file for mysqld
+ mtr_tofile($gdb_init_file,
+ "file $$exe\n" .
+ "set args $str\n" .
+ "break mysql_parse\n" .
+ "commands 1\n" .
+ "disable 1\n" .
+ "end");
+ }
+
+ if ( $opt_manual_ddd )
+ {
+ print "\nTo start ddd for $type, type in another window:\n";
+ print "ddd -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n";
+
+ # Indicate the exe should not be started
+ $$exe= undef;
+ return;
+ }
+
+ my $save_exe= $$exe;
+ $$args= [];
+ if ( $exe_libtool )
+ {
+ $$exe= $exe_libtool;
+ mtr_add_arg($$args, "--mode=execute");
+ mtr_add_arg($$args, "ddd");
+ }
+ else
+ {
+ $$exe= "ddd";
+ }
+ mtr_add_arg($$args, "--command=$gdb_init_file");
+ mtr_add_arg($$args, "$save_exe");
+}
+
+
+#
+# Modify the exe and args so that program is run in the selected debugger
+#
+sub debugger_arguments {
+ my $args= shift;
+ my $exe= shift;
+ my $debugger= $opt_debugger || $opt_client_debugger;
+
+ if ( $debugger =~ /vcexpress|vc|devenv/ )
+ {
+ # vc[express] /debugexe exe arg1 .. argn
+
+ # Add /debugexe and name of the exe before args
+ unshift(@$$args, "/debugexe");
+ unshift(@$$args, "$$exe");
+
+ # Set exe to debuggername
+ $$exe= $debugger;
+
+ }
+ elsif ( $debugger =~ /windbg/ )
+ {
+ # windbg exe arg1 .. argn
+
+ # Add name of the exe before args
+ unshift(@$$args, "$$exe");
+
+ # Set exe to debuggername
+ $$exe= $debugger;
+
+ }
+ elsif ( $debugger eq "dbx" )
+ {
+ # xterm -e dbx -r exe arg1 .. argn
+
+ unshift(@$$args, $$exe);
+ unshift(@$$args, "-r");
+ unshift(@$$args, $debugger);
+ unshift(@$$args, "-e");
+
+ $$exe= "xterm";
+
+ }
+ else
+ {
+ mtr_error("Unknown argument \"$debugger\" passed to --debugger");
+ }
+}
+
+
+#
+# Modify the exe and args so that program is run in valgrind
+#
+sub valgrind_arguments {
+ my $args= shift;
+ my $exe= shift;
+
+ if ( $opt_callgrind)
+ {
+ mtr_add_arg($args, "--tool=callgrind");
+ mtr_add_arg($args, "--base=$opt_vardir/log");
+ }
+ else
+ {
+ mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option
+ mtr_add_arg($args, "--alignment=8");
+ mtr_add_arg($args, "--leak-check=yes");
+ mtr_add_arg($args, "--num-callers=16");
+ mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
+ if -f "$glob_mysql_test_dir/valgrind.supp";
+ }
+
+ # Add valgrind options, can be overriden by user
+ mtr_add_arg($args, '%s', $_) for (@valgrind_args);
+
+ mtr_add_arg($args, $$exe);
+
+ $$exe= $opt_valgrind_path || "valgrind";
+
+ if ($exe_libtool)
+ {
+ # Add "libtool --mode-execute" before the test to execute
+ # if running in valgrind(to avoid valgrinding bash)
+ unshift(@$args, "--mode=execute", $$exe);
+ $$exe= $exe_libtool;
+ }
+}
+
+
+##############################################################################
+#
+# Usage
+#
+##############################################################################
+
+sub usage ($) {
+ my $message= shift;
+
+ if ( $message )
+ {
+ print STDERR "$message\n";
+ }
+
+ print <<HERE;
+
+$0 [ OPTIONS ] [ TESTCASE ]
+
+Options to control what engine/variation to run
+
+ embedded-server Use the embedded server, i.e. no mysqld daemons
+ ps-protocol Use the binary protocol between client and server
+ cursor-protocol Use the cursor protocol between client and server
+ (implies --ps-protocol)
+ view-protocol Create a view to execute all non updating queries
+ sp-protocol Create a stored procedure to execute all queries
+ compress Use the compressed protocol between client and server
+ ssl Use ssl protocol between client and server
+ skip-ssl Dont start server with support for ssl connections
+ bench Run the benchmark suite
+ small-bench Run the benchmarks with --small-tests --small-tables
+ ndb|with-ndbcluster Use cluster as default table type
+ vs-config Visual Studio configuration used to create executables
+ (default: MTR_VS_CONFIG environment variable)
+
+Options to control directories to use
+ benchdir=DIR The directory where the benchmark suite is stored
+ (default: ../../mysql-bench)
+ tmpdir=DIR The directory where temporary files are stored
+ (default: ./var/tmp).
+ vardir=DIR The directory where files generated from the test run
+ is stored (default: ./var). Specifying a ramdisk or
+ tmpfs will speed up tests.
+ mem Run testsuite in "memory" using tmpfs or ramdisk
+ Attempts to find a suitable location
+ using a builtin list of standard locations
+ for tmpfs (/dev/shm)
+ The option can also be set using environment
+ variable MTR_MEM=[DIR]
+
+Options to control what test suites or cases to run
+
+ force Continue to run the suite after failure
+ with-ndbcluster-only Run only tests that include "ndb" in the filename
+ skip-ndb[cluster] Skip all tests that need cluster
+ skip-ndb[cluster]-slave Skip all tests that need a slave cluster
+ ndb-extra Run extra tests from ndb directory
+ do-test=PREFIX or REGEX
+ Run test cases which name are prefixed with PREFIX
+ or fulfills REGEX
+ skip-test=PREFIX or REGEX
+ Skip test cases which name are prefixed with PREFIX
+ or fulfills REGEX
+ start-from=PREFIX Run test cases starting from test prefixed with PREFIX
+ suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated
+ list of suite names.
+ The default is: "$opt_suites_default"
+ skip-rpl Skip the replication test cases.
+ skip-im Don't start IM, and skip the IM test cases
+ big-test Set the environment variable BIG_TEST, which can be
+ checked from test cases.
+ combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one
+ combination.
+ skip-combination Skip any combination options and combinations files
+
+Options that specify ports
+
+ master_port=PORT Specify the port number used by the first master
+ slave_port=PORT Specify the port number used by the first slave
+ ndbcluster-port=PORT Specify the port number used by cluster
+ ndbcluster-port-slave=PORT Specify the port number used by slave cluster
+ mtr-build-thread=# Specify unique collection of ports. Can also be set by
+ setting the environment variable MTR_BUILD_THREAD.
+
+Options for test case authoring
+
+ record TESTNAME (Re)genereate the result file for TESTNAME
+ check-testcases Check testcases for sideeffects
+ mark-progress Log line number and elapsed time to <testname>.progress
+
+Options that pass on options
+
+ mysqld=ARGS Specify additional arguments to "mysqld"
+
+Options to run test on running server
+
+ extern Use running server for tests
+ ndb-connectstring=STR Use running cluster, and connect using STR
+ ndb-connectstring-slave=STR Use running slave cluster, and connect using STR
+ user=USER User for connection to extern server
+ socket=PATH Socket for connection to extern server
+
+Options for debugging the product
+
+ client-ddd Start mysqltest client in ddd
+ client-debugger=NAME Start mysqltest in the selected debugger
+ client-gdb Start mysqltest client in gdb
+ ddd Start mysqld in ddd
+ debug Dump trace output for all servers and client programs
+ debugger=NAME Start mysqld in the selected debugger
+ gdb Start the mysqld(s) in gdb
+ manual-debug Let user manually start mysqld in debugger, before
+ running test(s)
+ manual-gdb Let user manually start mysqld in gdb, before running
+ test(s)
+ manual-ddd Let user manually start mysqld in ddd, before running
+ test(s)
+ master-binary=PATH Specify the master "mysqld" to use
+ slave-binary=PATH Specify the slave "mysqld" to use
+ strace-client Create strace output for mysqltest client
+ max-save-core Limit the number of core files saved (to avoid filling
+ up disks for heavily crashing server). Defaults to
+ $opt_max_save_core, set to 0 for no limit.
+
+Options for coverage, profiling etc
+
+ gcov FIXME
+ gprof FIXME
+ valgrind Run the "mysqltest" and "mysqld" executables using
+ valgrind with default options
+ valgrind-all Synonym for --valgrind
+ valgrind-mysqltest Run the "mysqltest" and "mysql_client_test" executable
+ with valgrind
+ valgrind-mysqld Run the "mysqld" executable with valgrind
+ valgrind-options=ARGS Deprecated, use --valgrind-option
+ valgrind-option=ARGS Option to give valgrind, replaces default option(s),
+ can be specified more then once
+ valgrind-path=[EXE] Path to the valgrind executable
+ callgrind Instruct valgrind to use callgrind
+
+Misc options
+
+ comment=STR Write STR to the output
+ notimer Don't show test case execution time
+ script-debug Debug this script itself
+ verbose More verbose output
+ start-and-exit Only initialize and start the servers, using the
+ startup settings for the specified test case (if any)
+ start-dirty Only start the servers (without initialization) for
+ the specified test case (if any)
+ fast Don't try to clean up from earlier runs
+ reorder Reorder tests to get fewer server restarts
+ help Get this help text
+
+ testcase-timeout=MINUTES Max test case run time (default $default_testcase_timeout)
+ suite-timeout=MINUTES Max test suite run time (default $default_suite_timeout)
+ warnings | log-warnings Pass --log-warnings to mysqld
+
+ sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time
+ client-bindir=PATH Path to the directory where client binaries are located
+ client-libdir=PATH Path to the directory where client libraries are located
+
+Deprecated options
+ with-openssl Deprecated option for ssl
+
+
+HERE
+ mtr_exit(1);
+
+}
diff --git a/mysql-test/ndb/ndb_config_1_node.ini b/mysql-test/lib/v1/ndb_config_1_node.ini
index 4e0be7796dc..4e0be7796dc 100644
--- a/mysql-test/ndb/ndb_config_1_node.ini
+++ b/mysql-test/lib/v1/ndb_config_1_node.ini
diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/lib/v1/ndb_config_2_node.ini
index 57e4d049ad6..57e4d049ad6 100644
--- a/mysql-test/ndb/ndb_config_2_node.ini
+++ b/mysql-test/lib/v1/ndb_config_2_node.ini
diff --git a/mysql-test/misc/kill_master.sh b/mysql-test/misc/kill_master.sh
deleted file mode 100644
index 7938c9d3ac2..00000000000
--- a/mysql-test/misc/kill_master.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-kill -9 `cat var/run/master.pid`
-# The kill may fail if process has already gone away,
-# so don't use the exit code of the kill. Use 0.
-exit 0
diff --git a/mysql-test/misc/mysql-test_V1.9.pl b/mysql-test/misc/mysql-test_V1.9.pl
deleted file mode 100644
index 129ec41b4d5..00000000000
--- a/mysql-test/misc/mysql-test_V1.9.pl
+++ /dev/null
@@ -1,1121 +0,0 @@
-#!/usr/bin/perl
-#
-# Tests MySQL. Output is given to the stderr. Use
-# diff to check the possible differencies.
-#
-
-use DBI;
-use Getopt::Long;
-
-$VER = "1.9";
-$| = 1;
-
-$opt_db = "test";
-$opt_user = $opt_password = $opt_without = "";
-$opt_host = "localhost";
-$opt_port = "3306";
-$opt_socket = "/tmp/mysql.sock";
-$opt_help = 0;
-
-$NO_ERR = 0; # No error
-$EXP_ERR = 1; # Expect error
-$MAY_ERR = 2; # Maybe error
-$HS = 0; # Horizontal style of output
-$VS = 1; # Vertical style of output
-$VERBOSE = 0; # Print the results
-$SILENT = 1; # No output
-
-@test_packages = ("FUNC", "PROC", "SHOW");
-
-####
-#### main program
-####
-
-main();
-
-sub main()
-{
- GetOptions("help", "db=s", "port=i", "host=s", "password=s", "user=s", "socket=s",
- "without=s") || usage();
-
- usage() if ($opt_help);
-
- $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host:port=$opt_port:mysql_socket=$opt_socket", $opt_user, $opt_password, { PrintError => 0 })
- || die $DBI::errstr;
-
-## QQ ######################################
-
-$sth = $dbh->prepare("show felds from t2")
-|| die "Couldn't prepare query: $DBI::errstr\n";
-if (!$sth->execute)
-{
- print "Couldn't execute query: $DBI::errstr\n";
- $sth->finish;
- die;
-}
-while (($row = $sth->fetchrow_arrayref))
-{
- print "$row->[1]\n";
-}
-
-
-exit(0);
-
-## QQ ######################################
-
- printf("####\n#### THIS IS mysql-test script RUNNING\n");
- printf("#### mysql-test version $VER\n####\n");
-
- test_mysql_functions() if (&chk_package($opt_without, $test_packages[0]));
- test_mysql_procedures() if (&chk_package($opt_without, $test_packages[1]));
- test_mysql_show() if (&chk_package($opt_without, $test_packages[2]));
-
- print "\n";
- return;
-}
-
-####
-#### test show -command of MySQL
-####
-
-sub test_mysql_show
-{
- my ($query, $i);
-
- $query = create_show_tables();
- &exec_query(["drop table my_t"], $MAY_ERR, $SILENT);
- for ($i = 0; $query[$i]; $i++)
- {
- &exec_query([$query[$i]], $NO_ERR, $VERBOSE, $HS);
- &exec_query(["show fields from my_t"], $NO_ERR, $VERBOSE, $HS);
- &exec_query(["show keys from my_t"], $NO_ERR, $VERBOSE, $HS);
- &exec_query(["drop table my_t"], $NO_ERR, $SILENT);
- }
-}
-
-sub create_show_tables
-{
- my ($query, $i);
-
- $query[0] = <<EOF;
-create table my_t (i int, f float, s char(64), b blob, t text)
-EOF
- $query[1] = <<EOF;
-create table my_t (i int, f float, s char(64), b blob, t text, primary key (i))
-EOF
- $query[2] = <<EOF;
-create table my_t (i int, f float, s char(64), b blob, t text, unique (i), unique(s))
-EOF
- for ($i = 0; $query[$i]; $i++) { chop($query[$i]); }
- return $query;
-}
-
-####
-#### test procedures, currently only procedure analyze()
-####
-
-sub test_mysql_procedures
-{
- test_analyze();
-}
-
-sub test_analyze
-{
- my ($query, $i, $j);
-
- if ($opt_help)
- {
- usage();
- }
- # invalid queries
- &exec_query(["select * from mails procedure analyse(-1)"],
- $EXP_ERR, $VERBOSE, $HS);
- &exec_query(["select * from mails procedure analyse(10, -1)"],
- $EXP_ERR, $VERBOSE, $HS);
- &exec_query(["select * from mails procedure analyse(1, 2, 3)"],
- $EXP_ERR, $VERBOSE, $HS);
- &exec_query(["select * from mails procedure analyse(-10, 10)"],
- $EXP_ERR, $VERBOSE, $HS);
- &exec_query(["select * from mails procedure analyse('a', 'a')"],
- $EXP_ERR, $VERBOSE, $HS);
- # valid queries
-# &exec_query(["select * from mails procedure analyse(10)"], 0, 0);
-# &exec_query(["select * from mails procedure analyse(10, 10)"], 0, 0);
-# &exec_query(["select hash from mails procedure analyse()"], 0, 0);
- &exec_query(["use mysql_test"], $NO_ERR, $VERBOSE, $HS);
-# &exec_query(["select timestamp from w32_user procedure analyse(0)"], 0, 0);
- $query = create_test_tables();
- &exec_query(["drop table my_t"], $MAY_ERR, $SILENT);
- for ($i = 0; $query[$i][0]; $i++)
- {
- &exec_query([$query[$i][0]], $NO_ERR, $SILENT); # create table
- for ($j = 1; $query[$i][$j]; $j++)
- {
- &exec_query([$query[$i][$j]], $NO_ERR, $SILENT); # do inserts
- }
- &exec_query(["select * from my_t procedure analyse(0,0)"],
- $NO_ERR, $VERBOSE, $HS);
- &exec_query(["select * from my_t procedure analyse()"],
- $NO_ERR, $VERBOSE, $HS);
- &exec_query(["drop table my_t"], $NO_ERR, $SILENT);
- }
-}
-
-####
-#### if $opt is found as a part from the '--without=...' option string
-#### return 0, else 1. if zero is returned, then that part of MySQL
-#### won't be tested
-####
-
-sub chk_package
-{
- my ($opt_str, $opt) = @_;
-
- $sub_opt_str = '';
- for ($i = 0, $ptr = substr($opt_str, $i, 1); $ptr || $ptr eq '0';
- $i++, $ptr = substr($opt_str, $i, 1))
- {
- $sub_opt_str .= $ptr;
- if ($sub_opt_str eq $opt)
- {
- $next_chr = substr($opt_str, ($i + 1), 1);
- if ($next_chr eq ',' || (!$next_chr && $next_chr ne '0'))
- {
- return 0;
- }
- }
- if ($ptr eq ',')
- {
- # next word on the opt_str
- $sub_opt_str = '';
- }
- }
- return 1;
-}
-
-####
-#### Tests given function(s) with given value(s) $count rounds
-#### If function doesn't have an arg, test it once and continue.
-#### ulargs (number of unlimited args) is the number of arguments
-#### to be placed in place of '.' . '.' means that any number
-#### of the last argument type is possible to the function.
-#### If force is given, never mind about errors
-#### args: $func: list of functions to be tested
-#### $value: list of values to be used with functions
-#### $count: number of times one function should be tested
-#### $ulargs: number of unlimited args to be used when possible
-#### $table_info: information about the table to be used, contains:
-#### table name, info about the fields in the table, for example:
-#### [mysql_test1, "Zi", "Rd"], where mysql_test1 is the name of the
-#### table, "Zi" tells, that the first field name is 'i' and it is
-#### type 'Z' (integer), see test_mysql_functions, 'Rd' tells that
-#### the second field name is 'd' and the type is 'R' (real number)
-#### $force: if given, never mind about errors
-#### $mix: if 0, use the same argument at a time in a
-#### function that has two or more same type arguments
-#### if 1, use different values
-####
-
-sub test_func()
-{
- my ($func, $value, $count, $ulargs, $table_info, $force, $mix) = @_;
- my ($query, $i, $j, $k, $no_arg, $row, $ulimit, $tbinfo, $tbused, $arg);
-
- if (!$func->[0][0])
- {
- printf("No function found!\n");
- if (!$force) { die; }
- }
-
- for ($i = 0; $func->[$i][0]; $i++)
- {
- $tbused = 0;
- $no_arg = 0;
- for ($j = 0; $j < $count && !$no_arg; $j++)
- {
- if ($tbused || $no_arg) { next; }
- $query = "select $func->[$i][0](";
- #search the values for the args
- for ($k = 0; $k < length($func->[$i][1]) && !$no_arg; $k++)
- {
- if ($mix)
- {
- $arg = $j + 1 + $k;
- }
- else
- {
- $arg = $j + 1;
- }
- if (substr($func->[$i][1], $k, 1) eq 'E')
- {
- $no_arg = 1;
- next;
- }
- if ($k) { $query .= ','; }
-
- if (substr($func->[$i][1], $k, 1) eq 'S')
- {
- $query .= &find_value(\@value, 'S', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'N')
- {
- $query .= &find_value(\@value, 'N', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'Z')
- {
- $query .= &find_value(\@value, 'Z', $arg);
- }
- elsif ((substr($func->[$i][1], $k, 1) eq 'R'))
- {
- $query .= &find_value(\@value, 'R', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'T')
- {
- $query .= &find_value(\@value, 'T', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'D')
- {
- $query .= &find_value(\@value, 'D', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'B')
- {
- $query .= &find_value(\@value, 'B', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'C')
- {
- $query .= &find_value(\@value, 'C', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'F')
- {
- $query .= &find_value(\@value, 'F', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq '.')
- {
- chop($query);
- for ($ulimit = 0; $ulimit < $ulargs; $ulimit++)
- {
- $query .= ',';
- $query .= &find_value(\@value,
- substr($func->[$i][1], $k - 1, 1),
- $j + $ulimit + 2);
- }
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'A')
- {
- for ($tbinfo = 1; substr($table_info->[$tbinfo], 0, 1) ne
- substr($func->[$i][1], $k + 1, 1); $tbinfo++)
- {
- if (!defined($table_info->[$tbinfo]))
- {
- printf("Illegal function structure!\n");
- printf("A table was needed, but no type specified!\n");
- printf("Unready query was: $query\n");
- if (!$force) { die; }
- else { next; }
- }
- }
- if ($k) { $query .= ","; }
- $query .= substr($table_info->[$tbinfo], 1,
- length($table_info->[$tbinfo]) - 1);
- $k++;
- $tbused = 1;
- }
- else
- {
- printf("Not a valid type: \n");
- printf(substr($func->[$i][1], $k, 1));
- printf("\nAttempted to be used with unready query: \n");
- printf("$query\n");
- }
- }
- $query .= ")";
- if ($tbused)
- {
- $query .= " from ";
- $query .= $table_info->[0];
- }
- if (!($sth = $dbh->prepare($query)))
- {
- printf("Couldn't prepare: $query\n");
- if (!$force) { die; }
- }
- if (!$sth->execute)
- {
- printf("Execution failed: $DBI::errstr\n");
- printf("Attempted query was:\n$query\n");
- $sth->finish;
- if (!$force) { die; }
- }
- else
- {
- printf("mysql> $query;\n");
- display($sth, 1);
- printf("Query OK\n\n");
- }
- }
- }
-}
-
-####
-#### mk_str returns a string where the first arg is repeated second arg times
-#### if repeat is 1, return the original str
-####
-
-sub mk_str()
-{
- my ($str, $repeat) = @_;
- my ($res_str);
-
- if ($repeat <= 0)
- {
- die "Invalid repeat times!\n";
- }
-
- for ($repeat--, $res_str = $str; $repeat > 0; $repeat--)
- {
- $res_str .= $str;
- }
- return $res_str;
-}
-
-####
-#### find_value: returns a value from list of values
-#### args: $values: list of values
-#### $type: type of argument (S = string, N = integer etc.)
-#### $ordinal: the ordinal number of an argument in the list
-####
-
-sub find_value()
-{
- my ($values, $type, $ordinal) = @_;
- my ($total, $i, $j, $tmp, $val);
-
- $total = -1; # The first one is the type
-
- for ($i = 0; $values[$i][0]; $i++)
- {
- if ($values[$i][0] eq $type)
- {
- $tmp = $values[$i];
- foreach $val (@$tmp) { $total++; }
- for ( ;$total < $ordinal; )
- {
- $ordinal -= $total;
- }
- return $values[$i][$ordinal];
- }
- }
- printf("No type '$type' found in values\n");
- die;
-}
-
-####
-#### exec_query: execute a query, print information if wanted and exit
-#### args: $queries: list of queries to be executed
-#### $expect_error: if 0, error is not expected. In this case if an
-#### error occurs, inform about it and quit
-#### if 1, error is expected. In this case if sql server
-#### doesn't give an error message, inform about it
-#### and quit
-#### if 2, error may happen or not, don't care
-#### $silent: if true, reduce output
-#### $style: type of output, 0 == horizontal, 1 == vertical
-####
-
-sub exec_query()
-{
- my ($queries, $expect_error, $silent, $style) = @_;
- my ($query);
-
- foreach $query (@$queries)
- {
- if (!($sth = $dbh->prepare($query)))
- {
- printf("Couldn't prepare: $query\n");
- die;
- }
- if (!$sth->execute)
- {
- if ($expect_error == 1)
- {
- printf("An invalid instruction was purposely made,\n");
- printf("server failed succesfully:\n");
- printf("$DBI::errstr\n");
- printf("Everything OK, continuing...\n");
- return;
- }
- if ($expect_error != 2)
- {
- printf("Execution failed: $DBI::errstr\n");
- printf("Attempted query was:\n$query\n");
- die;
- }
- }
- if ($expect_error == 1)
- {
- printf("An invalid instruction was purposely made,\n");
- printf("server didn't note, ALARM!\n");
- printf("The query made was: $query\n");
- printf("The output from the server:\n");
- }
- if ($expect_error == 2) { return; }
- if (!$silent) { printf("mysql> $query;\n"); }
- display($sth, $style);
- if (!$silent) { printf("Query OK\n\n"); }
- if ($expect_error) { die; }
- }
- return;
-}
-
-####
-#### Display to stderr
-#### Args: 1: ($sth) statememt handler
-#### 2: ($style) 0 == horizontal style, 1 == vertical style
-####
-
-sub display()
-{
- my ($sth, $style) = @_;
- my (@data, @max_length, $row, $nr_rows, $nr_cols, $i, $j, $tmp, $mxl);
-
- # Store the field names and values in @data.
- # Store the max field lengths in @max_length
- for ($i = 0; ($row = $sth->fetchrow_arrayref); $i++)
- {
- if (!$i)
- {
- $nr_cols = $#$row;
- for ($j = 0; $j <= $#$row; $j++)
- {
- $data[$i][$j] = $sth->{NAME}->[$j];
- $max_length[$j] = length($data[$i][$j]);
- }
- $i++;
- }
- for ($j = 0; $j <= $#$row; $j++)
- {
- $data[$i][$j] = $row->[$j];
- $max_length[$j] = $tmp if ($max_length[$j] <
- ($tmp = length($data[$i][$j])));
- }
- }
- if (!($nr_rows = $i))
- {
- return;
- }
- # Display data
- if ($style == 0)
- {
- for ($i = 0; $i < $nr_rows; $i++)
- {
- if (!$i)
- {
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print "+"; print "-" x ($max_length[$j] + 2);
- }
- print "+\n";
- }
- print "|";
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print " ";
- if (defined($data[$i][$j]))
- {
- print $data[$i][$j];
- $tmp = length($data[$i][$j]);
- }
- else
- {
- print "NULL";
- $tmp = 4;
- }
- print " " x ($max_length[$j] - $tmp);
- print " |";
- }
- print "\n";
- if (!$i)
- {
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print "+"; print "-" x ($max_length[$j] + 2);
- }
- print "+\n";
- }
- }
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print "+"; print "-" x ($max_length[$j] + 2);
- }
- print "+\n";
- return;
- }
- if ($style == 1)
- {
- for ($i = 0; $max_length[$i]; $i++)
- {
- $mxl = $max_length[$i] if ($mxl < $max_length[$i]);
- }
-
- for ($i = 1; $i < $nr_rows; $i++)
- {
- print "*" x 27;
- print " " . $i . ". row ";
- print "*" x 27;
- print "\n";
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print " " x ($mxl - length($data[0][$j]));
- print "$data[0][$j]: ";
- if (defined($data[$i][$j]))
- {
- print "$data[$i][$j] \n";
- }
- else
- {
- print "NULL\n";
- }
- }
- }
- return;
- }
-}
-
-####
-#### usage
-####
-
-sub usage
-{
- print <<EOF;
-mysql-test $VER by Jani Tolonen
-
-Usage: mysql-test [options]
-
-Options:
---help Show this help
---db= Database to use (Default: $opt_db)
---port= TCP/IP port to use for connection (Default: $opt_port)
---socket= UNIX socket to use for connection (Default: $opt_socket)
---host= Connect to host (Default: $opt_host)
---user= User for login if not current user
---password Password to use when connecting to server
-
---without=PART_NAME1,PART_NAME2,...
- test without a certain part of MySQL, optional parts listed below
-
-Optional parts:
-
-FUNC Ignore MySQL basic functions
-PROC Ignore MySQL procedure functions
-EOF
- exit(0);
-}
-
-
-sub test_mysql_functions
-{
-
- ####
- #### MySQL functions
- ####
- #### Types: S = string (or real number) , N = unsigned integer, Z = integer,
- #### R = real number, T = time_stamp, E = no argument, D = date,
- #### B = boolean, C = character
- #### F = format (usually used with the date-types)
- #### . = any number of the last argument type possible
- #### A = require table for test, the following argument
- #### is the argument for the function
-
- # Muista get_lock,group_unique_users,
- # position, unique_users
-
- # ks. kaikki date function, kerää yhteen, testaa erikseen
- # adddate, date_add, subdate, date_sub, between, benchmark, count
-
- # decode, encode, get_lock, make_set, position
-
- @functions = (["abs","R"],["acos","R"],["ascii","C"],["asin","R"],
- ["atan","R"],["atan2","R"],["avg","AR"],["bin","Z"],
- ["bit_count","Z"],["bit_or","AZ"],["bit_and","AZ"],
- ["ceiling","R"],["char","N."],["char_length","S"],
- ["concat","SS."],["conv","ZZZ"],
- ["cos","R"],["cot","R"],["curdate","E"],
- ["curtime","E"],["database","E"],["date_format","DF"],
- ["dayofmonth","D"],["dayofyear","D"],["dayname","D"],
- ["degrees","R"],["elt","NS."],["encode","SS"],
- ["encrypt","S"],["encrypt","SS"],["exp","R"],["field","SS."],
- ["find_in_set","SS"],["floor","R"],["format","RN"],
- ["from_days","N"],["from_unixtime","N"],
- ["from_unixtime","NF"],["greatest","RR."],["hex","Z"],
- ["hour","D"],["if","ZSS"],["ifnull","SS"],["insert","SNNS"],
- ["instr","SS"],["interval","RR."],["isnull","S"],
- ["last_insert_id","E"],["lcase","S"],["least","RR."],
- ["left","SN"],["length","S"],["locate","SS"],
- ["log","R"],["log10","R"],["lpad","SNS"],["ltrim","S"],
- ["max","AR"],["mid","SNN"],["min","AR"],["minute","D"],
- ["mod","ZZ"],["monthname","D"],
- ["month","D"],["now","E"],["oct","Z"],
- ["octet_length","S"],["password","S"],["period_add","DD"],
- ["period_diff","DD"],["pi","E"],
- ["pow","RR"],["quarter","D"],["radians","R"],
- ["rand","E"],["rand","R"],["release_lock","S"],
- ["repeat","SN"],["replace","SSS"],["reverse","S"],
- ["right","SN"],["round","R"],["round","RN"],
- ["rpad","SNS"],["rtrim","S"],["sec_to_time","N"],
- ["second","T"],["sign","R"],["sin","R"],
- ["space","N"],["soundex","S"],["sqrt","R"],["std","AR"],
- ["strcmp","SS"],["substring","SN"],["substring","SNN"],
- ["substring_index","SSZ"],["sum","AR"],
- ["tan","R"],["time_format","TF"],["time_to_sec","T"],
- ["to_days","D"],["trim","S"],
- ["truncate","RN"],["ucase","S"],
- ["unix_timestamp","E"],["unix_timestamp","D"],["user","E"],
- ["version","E"],["week","D"],["weekday","D"],["year","D"]);
-
- ####
- #### Various tests for the functions above
- ####
-
- &exec_query(["drop table mysql_test1"], $MAY_ERR, $SILENT);
-
- $query .= <<EOF;
-create table mysql_test1 (
- i int,
- d double
-)
-EOF
- chop($query);
- &exec_query([$query], $NO_ERR, $SILENT);
-
- ####
- #### Basic tests
- ####
-
- printf("####\n#### BASIC TESTS FOR FUNCTIONS\n####\n\n");
-
- @bunch = ("insert into mysql_test1 values(-20,-10.5),(20,10.5),(50,100.00)",
- "insert into mysql_test1 values(100,500.333)");
- &exec_query(\@bunch, $NO_ERR, $SILENT);
-
- printf("\n####\n#### First basic test part\n####\n\n");
-
- @values = (["S", "'a'", "'abc'", "'abc def'", "'abcd'", "'QWERTY'",
- "'\\\\'", "'*.!\"#¤%&/()'", "'" . &mk_str('a',1024) . "'",
- "?", "<>", "#__#"],
- ["N", -1000, -500, -100, -1, 0, 1, 40, 50, 70, 90,
- 100, 500, 1000],
- ["Z", -100, -50, 200, 1000],
- ["R", -500.5, -10.333, 100.667, 400.0],
- ["T", 19980728154204, 19980728154205, 19980728154206,
- 19980728154207],
- ["D", "'1997-12-06'", "'1997-12-07'", "'1997-12-08'",
- "'1997-12-09'"],
- ["B", 1, 0, 0, 1],
- ["C", "'a'", "'e'", "'r'", "'q'"],
- ["F", "'%a'", "'%b'", "'%d'", "'%H'"]);
- &test_func(\@functions, \@values, 4, 5, ["mysql_test1","Zi","Rd"]);
-
- printf("\n####\n#### Second basic test part\n####\n\n");
-
- @values = (["S", "'a'", "'BC'", "'def'", "'HIJK'", "'lmnop'", "'QRSTUV'"],
- ["N", 0, 1, 2, 3, 4, 5],
- ["Z", 0, 1, 2, 3, 4, 5],
- ["R", 0, 1, 2, 3, 4, 5],
- ["T", 19990608234530, 20000709014631, 20010810024732,
- 20020911034833, 20031012044934, 20041113055035],
- ["D", "'1999-06-08'", "'2000-07-09'", "'2001-08-10'",
- "'2002-09-11'", "'2003-10-12'", "'2004-11-13'"],
- ["B", 0, 1, 0, 1, 0, 1],
- ["C", "'a'", "'BC'", "'def'", "'HIJK'", "'lmnop'", "'QRSTUV'"],
- ["F", "'%a'", "'%b'", "'%d'", "'%h'", "'%H'", "'%i'"]);
- &test_func(\@functions, \@values, 6, 6, ["mysql_test1","Zi","Rd"], 0, 1);
-
- printf("\n####\n#### Third basic test part\n####\n\n");
-
- @values = (["S", "'Monty'", "'Jani'", "'MySQL'", "''"],
- ["N", 10, 54, -70, -499],
- ["Z", 11.03, "'Abo'", 54.333, "''"],
- ["R", 12, "'gnome'", -34.211, "''"],
- ["T", 3, "'Redhat'", -19984021774433, "''"],
- ["D", "'1990-01-31'", "'-3333-10-23'", -5631_23_12, "''"],
- ["B", 0, "'asb'", -4, "''"],
- ["C", "'a'", 503, -45353453, "''"],
- ["F", "'%a'", -231, "'Mitsubishi'", "''"]);
- &test_func(\@functions, \@values, 3, 3, ["mysql_test1","Zi","Rd"], 0, 1);
-
- &exec_query(["delete from mysql_test1"], $NO_ERR, $SILENT);
-
- ####
- #### Null tests
- ####
-
- printf("\n\n####\n#### NULL TESTS FOR FUNCTIONS\n####\n\n\n");
-
- &exec_query(["insert into mysql_test1 values(null,null)"], $NO_ERR,
- $SILENT);
- @values = (["S", "NULL"],
- ["N", "NULL"],
- ["Z", "NULL"],
- ["R", "NULL"],
- ["T", "NULL"],
- ["D", "NULL"],
- ["B", "NULL"],
- ["C", "NULL"],
- ["F", "NULL"]);
- &test_func(\@functions, \@values, 1, 5, ["mysql_test1","Zi","Rd"], 1);
- &exec_query(["delete from mysql_test1"], $NO_ERR, $SILENT);
-
- ####
- #### Tests to fulfill the main part of function tests above
- ####
-
- printf("\n\n####\n#### FULFILL TESTS \n####\n\n\n");
-
- &exec_query(["drop table my_t"], $MAY_ERR, $SILENT);
- &exec_query(["create table my_t (s1 char(64), s2 char(64))"],
- $NO_ERR, $VERBOSE, $HS);
- $query = <<EOF;
-insert into my_t values('aaa','aaa'),('aaa|qqq','qqq'),('gheis','^[^a-dXYZ]+\$'),('aab','^aa?b'),('Baaan','^Ba*n'),('aaa','qqq|aaa'),('qqq','qqq|aaa'),('bbb','qqq|aaa'),('bbb','qqq'),('aaa','aba'),(null,'abc'),('def',null),(null,null),('ghi','ghi[')
-EOF
- chop($query);
- &exec_query([$query], $NO_ERR, $VERBOSE, $HS);
- &exec_query(["select s1 regexp s2 from my_t"],
- $NO_ERR, $VERBOSE, $HS);
-
-
- ####
- #### ["position","SS"],
- ####
-
-}
-
-sub create_test_tables
-{
- $query[0][0] = <<EOF;
- CREATE TABLE my_t (
- auto int(5) unsigned DEFAULT '0' NOT NULL auto_increment,
- string varchar(10) DEFAULT 'hello',
- binary_string varchar(10) binary DEFAULT '' NOT NULL,
- tiny tinyint(4) DEFAULT '0' NOT NULL,
- short smallint(6) DEFAULT '1' NOT NULL,
- medium mediumint(8) DEFAULT '0' NOT NULL,
- longint int(11) DEFAULT '0' NOT NULL,
- longlong bigint(13) DEFAULT '0' NOT NULL,
- num decimal(5,2) DEFAULT '0.00' NOT NULL,
- num_fill decimal(6,2) unsigned zerofill DEFAULT '0000.00' NOT NULL,
- real_float float(13,1) DEFAULT '0.0' NOT NULL,
- real_double double(13,1),
- utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
- ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
- umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
- ulong int(11) unsigned DEFAULT '0' NOT NULL,
- ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
- zero int(5) unsigned zerofill,
- time_stamp timestamp(14),
- date_field date,
- time_field time,
- date_time datetime,
- blob_col blob,
- tinyblob_col tinyblob,
- mediumblob_col mediumblob NOT NULL,
- longblob_col longblob NOT NULL,
- options enum('one','two','three'),
- flags set('one','two','three'),
- PRIMARY KEY (auto)
-)
-EOF
- chop($query[0][0]);
- $query[0][1] = <<EOF;
- INSERT INTO my_t VALUES (1,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154204,NULL,'01:00:00',
- NULL,NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][1]);
- $query[0][2] = <<EOF;
- INSERT INTO my_t VALUES (2,'hello','',0,1,0,0,0,0.00,0000.00,
- -340282346638528859811704183484516925440.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,NULL,
- NULL,'','',NULL,NULL)
-EOF
- chop($query[0][2]);
- $query[0][3] = <<EOF;
- INSERT INTO my_t VALUES (3,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,00000,
- 0,0,0,NULL,19980728154205,NULL,NULL,
- '2002-12-30 22:04:02',NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][3]);
- $query[0][4] = <<EOF;
- INSERT INTO my_t VALUES (4,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,00000,
- 0,0,0,NULL,19980728154205,'1997-12-06',NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][4]);
- $query[0][5] = <<EOF;
- INSERT INTO my_t VALUES (5,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,00000,
- 0,0,0,NULL,19980728154205,NULL,'20:10:08',NULL,NULL,
- NULL,'','',NULL,NULL)
-EOF
- chop($query[0][5]);
- $query[0][6] = <<EOF;
- INSERT INTO my_t VALUES (6,'hello','',0,1,0,0,0,-0.22,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][6]);
- $query[0][7] = <<EOF;
- INSERT INTO my_t VALUES (7,'hello','',0,1,0,0,0,-0.00,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][7]);
- $query[0][8] = <<EOF;
- INSERT INTO my_t VALUES (8,'hello','',0,1,0,0,0,+0.00,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][8]);
- $query[0][9] = <<EOF;
- INSERT INTO my_t VALUES (9,'hello','',0,1,0,0,0,+0.90,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][9]);
- $query[0][10] = <<EOF;
- INSERT INTO my_t VALUES (10,'hello','',0,1,0,0,0,-999.99,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154206,NULL,NULL,NULL,NULL,
- NULL,'','',NULL,NULL)
-EOF
- chop($query[0][10]);
- $query[0][11] = <<EOF;
- INSERT INTO my_t VALUES (11,'hello','',127,32767,8388607,2147483647,
- 9223372036854775807,9999.99,9999.99,
- 329999996548271212625250308919809540096.0,9.0,255,
- 65535,16777215,4294967295,18446744073709551615,
- 4294967295,00000000000000,'9999-12-31','23:59:59',
- '9999-12-31 23:59:59',NULL,NULL,' ',' ','',
- 'one,two,three')
-EOF
- chop($query[0][11]);
- $query[0][12] = <<EOF;
- INSERT INTO my_t VALUES (12,'hello','',-128,-32768,-8388608,-2147483648,
- -9223372036854775808,-999.99,0000.00,
- -329999996548271212625250308919809540096.0,10.0,0,
- 00000,0,0,0,00000,00000000000000,
- '9999-12-31','23:59:59','9999-12-31 23:59:59',NULL,
- NULL,' ,-',' ,-','','one,two,three')
-EOF
- chop($query[0][12]);
- $query[0][13] = <<EOF;
- INSERT INTO my_t VALUES (13,'hello','',0,1,0,0,0,0.09,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154223,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][13]);
- $query[0][14] = <<EOF;
- INSERT INTO my_t VALUES (14,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154223,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][14]);
- $query[0][15] = <<EOF;
- INSERT INTO my_t VALUES (15,'hello','',0,1,0,0,0,0.00,0044.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154223,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][15]);
- $query[0][16] = <<EOF;
- INSERT INTO my_t VALUES (16,'hello','',0,1,0,0,0,0.00,9999.99,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154223,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][16]);
- $query[0][17] = <<EOF;
- INSERT INTO my_t VALUES (17,'hello','',127,32767,8388607,2147483647,
- 9223372036854775807,9999.99,9999.99,
- 329999996548271212625250308919809540096.0,9.0,255,
- 65535,16777215,4294967295,18446744073709551615,
- 4294967295,00000000000000,'9999-12-31','23:59:59',
- '9999-12-31 23:59:59',NULL,NULL,' ',' ','',
- 'one,two,three')
-EOF
- chop($query[0][17]);
- $query[0][18] = <<EOF;
- INSERT INTO my_t VALUES (18,'hello','',127,32767,8388607,2147483647,
- 9223372036854775807,9999.99,9999.99,0.0,NULL,255,
- 65535,16777215,4294967295,18446744073709551615,
- 4294967295,19980728154224,NULL,NULL,NULL,NULL,
- NULL,'','',NULL,NULL)
-EOF
- chop($query[0][18]);
- $query[0][19] = <<EOF;
- INSERT INTO my_t VALUES (19,'hello','',127,32767,8388607,2147483647,
- 9223372036854775807,9999.99,9999.99,0.0,NULL,255,
- 65535,16777215,4294967295,0,4294967295,
- 19980728154224,NULL,NULL,NULL,NULL,NULL,'','',
- NULL,NULL)
-EOF
- chop($query[0][19]);
- $query[0][20] = <<EOF;
- INSERT INTO my_t VALUES (20,'hello','',-128,-32768,-8388608,-2147483648,
- -9223372036854775808,-999.99,0000.00,0.0,NULL,0,
- 00000,0,0,18446744073709551615,00000,19980728154224,
- NULL,NULL,NULL,NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][20]);
- $query[0][21] = <<EOF;
- INSERT INTO my_t VALUES (21,'hello','',-128,-32768,-8388608,-2147483648,
- -9223372036854775808,-999.99,0000.00,0.0,NULL,0,
- 00000,0,0,0,00000,19980728154225,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][21]);
- $query[0][22] = <<EOF;
- INSERT INTO my_t VALUES (22,NULL,'1',1,1,1,1,1,1.00,0001.00,1.0,NULL,1,00001,
- 1,1,1,00001,19980728154244,NULL,NULL,NULL,NULL,NULL,
- '1','1',NULL,NULL)
-EOF
- chop($query[0][22]);
- $query[0][23] = <<EOF;
- INSERT INTO my_t VALUES (23,'2','2',2,2,2,2,2,2.00,0002.00,2.0,2.0,2,00002,
- 2,2,2,00002,00000000000000,'0000-00-00','02:00:00',
- '0000-00-00 00:00:00','2','2','2','2','','')
-EOF
- chop($query[0][23]);
- $query[0][24] = <<EOF;
- INSERT INTO my_t VALUES (24,'3','3',3,3,3,3,3,3.00,0003.00,3.0,3.0,3,00003,
- 3,3,3,00003,00000000000000,'2000-00-03','00:00:03',
- '0000-00-00 00:00:03','3.00','3.00','3.00','3.00',
- 'three','one,two')
-EOF
- chop($query[0][24]);
- $query[0][25] = <<EOF;
- INSERT INTO my_t VALUES (25,'-4.7','-4.7',-5,-5,-5,-5,-5,-4.70,0000.00,-4.7,
- -4.7,0,00000,0,0,0,00000,00000000000000,'0000-00-00',
- '00:00:00','0000-00-00 00:00:00','-4.70','-4.70',
- '-4.70','-4.70','','three')
-EOF
- chop($query[0][25]);
- $query[0][26] = <<EOF;
- INSERT INTO my_t VALUES (26,'+0.09','+0.09',0,0,0,0,0,+0.09,0000.00,0.1,0.1,
- 0,00000,0,0,0,00000,00000000000000,'0000-00-00',
- '00:09:00','0000-00-00 00:00:00','+0.09','+0.09',
- '+0.09','+0.09','','')
-EOF
- chop($query[0][26]);
- $query[0][27] = <<EOF;
- INSERT INTO my_t VALUES (27,'1','1',1,1,1,1,1,1.00,0001.00,1.0,1.0,1,00001,
- 1,1,1,00001,00000000000000,'2000-00-01','00:00:01',
- '0000-00-00 00:00:01','1','1','1','1','one','one')
-EOF
- chop($query[0][27]);
- $query[0][28] = <<EOF;
- INSERT INTO my_t VALUES (28,'-1','-1',-1,-1,-1,-1,-1,-1.00,0000.00,-1.0,-1.0,
- 0,00000,0,0,18446744073709551615,00000,
- 00000000000000,'0000-00-00','00:00:00',
- '0000-00-00 00:00:00','-1','-1','-1','-1','',
- 'one,two,three')
-EOF
- chop($query[0][28]);
- $query[0][29] = <<EOF;
- INSERT INTO my_t VALUES (29,'','',0,0,0,0,0,0.00,0000.00,0.0,0.0,0,00000,0,0,
- 0,00000,00000000000000,'0000-00-00','00:00:00',
- '0000-00-00 00:00:00','','','','','','')
-EOF
- chop($query[0][29]);
- $query[1][0] = "CREATE TABLE my_t (str char(64))";
- $query[1][1] = "INSERT INTO my_t VALUES ('5.5')";
- $query[1][2] = "INSERT INTO my_t VALUES ('6.8')";
- $query[2][0] = "CREATE TABLE my_t (str char(64))";
- $query[2][1] = <<EOF;
- INSERT INTO my_t VALUES
- ('9999999999993242342442323423443534529999.02235000054213')
-EOF
- chop($query[2][1]);
- $query[3][0] = "CREATE TABLE my_t (str char(64))";
- $query[3][1] = <<EOF;
- INSERT INTO my_t VALUES
- ('8494357934579347593475349579347593845948793454350349543348736453')
-EOF
- chop($query[3][1]);
- $query[4][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[4][1] = "INSERT INTO my_t VALUES (10.0000000000)";
- $query[4][2] = "INSERT INTO my_t VALUES (-10.0000000000)";
- $query[5][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[5][1] = "INSERT INTO my_t VALUES (50000.0000000000)";
- $query[6][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[6][1] = "INSERT INTO my_t VALUES (5000000.0000000000)";
- $query[7][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[7][1] = "INSERT INTO my_t VALUES (500000000.0000000000)";
- $query[8][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[8][1] = "INSERT INTO my_t VALUES (50000000000.0000000000)";
- $query[8][2] = "INSERT INTO my_t VALUES (NULL)";
- $query[9][0] = "CREATE TABLE my_t (d double(60,10))";
- $query[9][1] = "INSERT INTO my_t VALUES (93850983054983462912.0000000000)";
- $query[9][2] = "INSERT INTO my_t VALUES (93850983.3495762944)";
- $query[9][3] = <<EOF;
- INSERT INTO my_t VALUES (938509832438723448371221493568778534912.0000000000)
-EOF
- chop($query[9][3]);
- $query[10][0] = "CREATE TABLE my_t (i int(11))";
- $query[10][1] = "INSERT INTO my_t VALUES (-100)";
- $query[10][2] = "INSERT INTO my_t VALUES (-200)";
- $query[11][0] = "CREATE TABLE my_t (s char(64))";
- $query[11][1] = "INSERT INTO my_t VALUES ('100.')";
- $query[12][0] = "CREATE TABLE my_t (s char(64))";
- $query[12][1] = "INSERT INTO my_t VALUES ('1e+50')";
- $query[13][0] = "CREATE TABLE my_t (s char(64))";
- $query[13][1] = "INSERT INTO my_t VALUES ('1E+50u')";
- $query[14][0] = "CREATE TABLE my_t (s char(64))";
- $query[14][1] = "INSERT INTO my_t VALUES ('1EU50')";
- $query[15][0] = "CREATE TABLE my_t (s char(64))";
- $query[15][1] = "INSERT INTO my_t VALUES ('123.000')";
- $query[15][2] = "INSERT INTO my_t VALUES ('123.000abc')";
- $query[16][0] = "CREATE TABLE my_t (s char(128))";
- $query[16][1] = <<EOF;
- INSERT INTO my_t VALUES
- ('-999999999999999999999999999999999999999999999999999999999999999999999999')
-EOF
- chop($query[16][1]);
- $query[17][0] = "CREATE TABLE my_t (s char(128))";
- $query[17][1] = "INSERT INTO my_t VALUES ('-9999999999999999')";
- $query[18][0] = "CREATE TABLE my_t (s char(128))";
- $query[18][1] = "INSERT INTO my_t VALUES ('28446744073709551615001')";
- $query[18][2] = "INSERT INTO my_t VALUES ('184467440737095516150000000')";
- $query[19][0] = "CREATE TABLE my_t (s char(128))";
- $query[19][1] = "INSERT INTO my_t VALUES ('18446744073709551615')";
- $query[20][0] = "CREATE TABLE my_t (s char(128))";
- $query[20][1] = "INSERT INTO my_t VALUES ('18446744073709551616')";
- $query[21][0] = "CREATE TABLE my_t (s char(64))";
- $query[21][1] = "INSERT INTO my_t VALUES ('00740')";
- $query[21][2] = "INSERT INTO my_t VALUES ('00740.')";
- $query[22][0] = "CREATE TABLE my_t (s char(128))";
- $query[22][1] = "INSERT INTO my_t VALUES ('-18446744073709551615')";
- $query[23][0] = "CREATE TABLE my_t (s char(32))";
- $query[23][1] = "INSERT INTO my_t VALUES ('740')";
- $query[23][2] = "INSERT INTO my_t VALUES ('12345')";
- $query[23][3] = "INSERT INTO my_t VALUES ('12345')";
- $query[24][0] = "CREATE TABLE my_t (s char(32))";
- $query[24][1] = "INSERT INTO my_t VALUES ('00740')";
- $query[24][2] = "INSERT INTO my_t VALUES ('00730')";
- $query[24][3] = "INSERT INTO my_t VALUES ('00720')";
- $query[24][4] = "INSERT INTO my_t VALUES ('12345.02')";
- $query[25][0] = "CREATE TABLE my_t (i bigint(20) unsigned)";
- $query[25][1] = "INSERT INTO my_t VALUES (3000)";
- $query[25][2] = "INSERT INTO my_t VALUES (NULL)";
- $query[25][3] = "INSERT INTO my_t VALUES (900000000003)";
- $query[25][4] = "INSERT INTO my_t VALUES (90)";
- $query[26][0] = "CREATE TABLE my_t (i int(11))";
- $query[26][1] = "INSERT INTO my_t VALUES (NULL)";
- $query[27][0] = "CREATE TABLE my_t (d date)";
- $query[27][1] = "INSERT INTO my_t VALUES ('1999-05-01')";
- $query[28][0] = "CREATE TABLE my_t (y year(4))";
- $query[28][1] = "INSERT INTO my_t VALUES (1999)";
- $query[29][0] = "CREATE TABLE my_t (s char(128))";
- $query[29][1] = "INSERT INTO my_t VALUES ('453453444451.7976')";
- $query[30][0] = "CREATE TABLE my_t (s char(128))";
- $query[30][1] = "INSERT INTO my_t VALUES('')";
- $query[31][0] = "CREATE TABLE my_t (s char(128))";
- $query[31][1] = "INSERT INTO my_t VALUES(' ')";
- return $query;
-}
diff --git a/mysql-test/mysql-test-run-shell.sh b/mysql-test/mysql-test-run-shell.sh
deleted file mode 100644
index ea8ce1b76d4..00000000000
--- a/mysql-test/mysql-test-run-shell.sh
+++ /dev/null
@@ -1,2338 +0,0 @@
-#!/bin/sh
-# mysql-test-run - originally written by Matt Wagner <matt@mysql.com>
-# modified by Sasha Pachev <sasha@mysql.com>
-# Slightly updated by Monty
-# Cleaned up again by Matt
-# Fixed by Sergei
-# List of failed cases (--force) backported from 4.1 by Joerg
-# :-)
-
-#echo "##################################################";
-#echo "This script is deprecated and will soon be removed";
-#echo "Use mysql-test-run.pl instead";
-#echo "##################################################";
-#echo
-
-#++
-# Access Definitions
-#--
-DB=test
-DBPASSWD=""
-VERBOSE=""
-USE_MANAGER=0
-MY_TZ=GMT-3
-TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
-LOCAL_SOCKET=@MYSQL_UNIX_ADDR@
-
-if [ -z "$MYSQL_TCP_PORT" ]; then
- MYSQL_TCP_PORT=@MYSQL_TCP_PORT@
- if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then
- ESP=`getent services mysql/tcp`
- if [ $? -eq 0 ]; then
- MYSQL_TCP_PORT=`echo "$ESP"|sed -e's-^[a-z]*[ ]*\([0-9]*\)/[a-z]*$-\1-g'`
- fi
- fi
-fi
-
-umask 022
-
-# For query_cache test
-case `uname` in
- SCO_SV | UnixWare | OpenUNIX )
- # do nothing (Causes strange behavior)
- ;;
- QNX)
- # do nothing (avoid error message)
- ;;
- * )
- ulimit -n 1024
- ;;
-esac
-
-#++
-# Program Definitions
-#--
-
-LC_COLLATE=C
-export LC_COLLATE
-PATH=/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$PATH
-MASTER_40_ARGS="--rpl-recovery-rank=1 --init-rpl-role=master"
-
-# Standard functions
-
-which ()
-{
- IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
- for file
- do
- for dir in $PATH
- do
- if test -f $dir/$file
- then
- echo "$dir/$file"
- continue 2
- fi
- done
- echo "Fatal error: Cannot find program $file in $PATH" 1>&2
- exit 1
- done
- IFS="$save_ifs"
- exit 0
-}
-
-
-sleep_until_file_deleted ()
-{
- pid=$1;
- file=$2
- loop=$SLEEP_TIME_FOR_DELETE
- while (test $loop -gt 0)
- do
- if [ ! -r $file ]
- then
- if test $pid != "0"
- then
- wait_for_pid $pid
- fi
- return
- fi
- sleep 1
- loop=`expr $loop - 1`
- done
-}
-
-sleep_until_file_created ()
-{
- file=$1
- loop=$2
- org_time=$2
- while (test $loop -gt 0)
- do
- if [ -r $file ]
- then
- return 0
- fi
- sleep 1
- loop=`expr $loop - 1`
- done
- echo "ERROR: $file was not created in $org_time seconds; Aborting"
- exit 1;
-}
-
-# For the future
-
-wait_for_pid()
-{
- pid=$1
- #$WAIT_PID pid $SLEEP_TIME_FOR_DELETE
-}
-
-# Check that valgrind is installed
-find_valgrind()
-{
- FIND_VALGRIND=`which valgrind` # this will print an error if not found
- # Give good warning to the user and stop
- if [ -z "$FIND_VALGRIND" ] ; then
- $ECHO "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://valgrind.kde.org ."
- exit 1
- fi
- # >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
- valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && FIND_VALGRIND="$FIND_VALGRIND --tool=memcheck"
- FIND_VALGRIND="$FIND_VALGRIND --alignment=8 --leak-check=yes --num-callers=16 --suppressions=$MYSQL_TEST_DIR/valgrind.supp"
-}
-
-# No paths below as we can't be sure where the program is!
-
-SED=sed
-
-BASENAME=`which basename`
-if test $? != 0; then exit 1; fi
-DIFF=`which diff | $SED q`
-if test $? != 0; then exit 1; fi
-CAT=cat
-CUT=cut
-HEAD=head
-TAIL=tail
-ECHO=echo # use internal echo if possible
-EXPR=expr # use internal if possible
-FIND=find
-GREP=grep
-if test $? != 0; then exit 1; fi
-PRINTF=printf
-RM=rm
-if test $? != 0; then exit 1; fi
-TR=tr
-XARGS=`which xargs`
-if test $? != 0; then exit 1; fi
-SORT=sort
-
-# Are we using a source or a binary distribution?
-
-testdir=@testdir@
-if [ -d bin/mysqld ] && [ -d mysql-test ] ; then
- cd mysql-test
-else
- if [ -d $testdir/mysql-test ] ; then
- cd $testdir
- fi
-fi
-
-if [ ! -f ./mysql-test-run ] ; then
- $ECHO "Can't find the location for the mysql-test-run script"
-
- $ECHO "Go to to the mysql-test directory and execute the script as follows:"
- $ECHO "./mysql-test-run."
- exit 1
-fi
-
-#++
-# Misc. Definitions
-#--
-
-# BASEDIR is always above mysql-test directory ...
-MYSQL_TEST_DIR=`pwd`
-cd ..
-
-if [ -d ./sql ] ; then
- SOURCE_DIST=1
-else
- BINARY_DIST=1
-
- # ... one level for tar.gz, two levels for a RPM installation
- if [ ! -f ./bin/mysql_upgrade ] ; then
- # Has to be RPM installation
- cd ..
- fi
-fi
-BASEDIR=`pwd`
-
-cd $MYSQL_TEST_DIR
-MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR
-MYSQLTEST_VARDIR=$MYSQL_TEST_DIR/var
-export MYSQL_TEST_DIR MYSQL_TEST_WINDIR MYSQLTEST_VARDIR
-STD_DATA=$MYSQL_TEST_DIR/std_data
-hostname=`hostname` # Installed in the mysql privilege table
-
-MANAGER_QUIET_OPT="-q"
-TESTDIR="$MYSQL_TEST_DIR/t"
-TESTSUFFIX=test
-TOT_SKIP=0
-TOT_PASS=0
-TOT_FAIL=0
-TOT_TEST=0
-GOT_WARNINGS=0
-USERT=0
-SYST=0
-REALT=0
-FAST_START=""
-MYSQL_TMP_DIR=$MYSQL_TEST_DIR/var/tmp
-export MYSQL_TMP_DIR
-
-# Use a relative path for where the slave will find the dumps
-# generated by "LOAD DATA" on the master. The path is relative
-# since it must have fixed length to test logging
-# i.e otherwise the output from "SHOW MASTER STATUS" will vary
-# with the strlen() of MYSQL_TEST_DIR
-SLAVE_LOAD_TMPDIR=../tmp
-
-RES_SPACE=" "
-MYSQLD_SRC_DIRS="strings mysys include extra regex myisam \
- myisammrg heap sql"
-MY_LOG_DIR="$MYSQL_TEST_DIR/var/log"
-#
-# Set LD_LIBRARY_PATH if we are using shared libraries
-#
-LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/libmysql_r/.libs:$BASEDIR/zlib/.libs:$LD_LIBRARY_PATH"
-DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/libmysql_r/.libs:$BASEDIR/zlib/.libs:$DYLD_LIBRARY_PATH"
-export LD_LIBRARY_PATH DYLD_LIBRARY_PATH
-
-#
-# Allow anyone in the group to see the generated database files
-#
-UMASK=0660
-UMASK_DIR=0770
-export UMASK UMASK_DIR
-
-MASTER_RUNNING=0
-MASTER1_RUNNING=0
-MASTER_MYHOST=127.0.0.1
-MASTER_MYPORT=9306
-SLAVE_RUNNING=0
-SLAVE_MYHOST=127.0.0.1
-SLAVE_MYPORT=9308 # leave room for 2 masters for cluster tests
-MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log
-NDBCLUSTER_PORT=9350
-NDBCLUSTER_PORT_SLAVE=9358
-
-#
-# To make it easier for different devs to work on the same host,
-# an environment variable can be used to control all ports. A small
-# number is to be used, 0 - 16 or similar.
-#
-# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
-# versions of this script, else a 4.0 test run might conflict with a
-# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
-# all port numbers might not be used in this version of the script.
-#
-if [ -n "$MTR_BUILD_THREAD" ] ; then
- MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 10 + 10000`
- SLAVE_MYPORT=`expr $MASTER_MYPORT + 3`
- NDBCLUSTER_PORT=`expr $MASTER_MYPORT + 6`
- NDBCLUSTER_PORT_SLAVE=`expr $MASTER_MYPORT + 7`
-
- echo "Using MTR_BUILD_THREAD = $MTR_BUILD_THREAD"
- echo "Using MASTER_MYPORT = $MASTER_MYPORT"
- echo "Using SLAVE_MYPORT = $SLAVE_MYPORT"
- echo "Using NDBCLUSTER_PORT = $NDBCLUSTER_PORT"
- echo "Using NDBCLUSTER_PORT_SLAVE = $NDBCLUSTER_PORT_SLAVE"
-fi
-
-NO_SLAVE=0
-USER_TEST=
-FAILED_CASES=
-
-EXTRA_MASTER_OPT=""
-EXTRA_MYSQL_TEST_OPT=""
-EXTRA_MYSQLCHECK_OPT=""
-EXTRA_MYSQLDUMP_OPT=""
-EXTRA_MYSQLSLAP_OPT=""
-EXTRA_MYSQLSHOW_OPT=""
-EXTRA_MYSQLBINLOG_OPT=""
-USE_RUNNING_SERVER=0
-USE_NDBCLUSTER=@USE_NDBCLUSTER@
-USE_NDBCLUSTER_SLAVE=@USE_NDBCLUSTER@
-USE_NDBCLUSTER_ALL=0
-USE_NDBCLUSTER_ONLY=0
-USE_RUNNING_NDBCLUSTER=""
-USE_RUNNING_NDBCLUSTER_SLAVE=""
-NDB_EXTRA_TEST=0
-NDB_VERBOSE=0
-NDBCLUSTER_EXTRA_OPTS=""
-USE_PURIFY=""
-PURIFY_LOGS=""
-DO_GCOV=""
-DO_GDB=""
-MANUAL_GDB=""
-DO_DDD=""
-DO_CLIENT_GDB=""
-SLEEP_TIME_AFTER_RESTART=1
-SLEEP_TIME_FOR_DELETE=10
-SLEEP_TIME_FOR_FIRST_MASTER=400 # Enough time to create innodb tables
-SLEEP_TIME_FOR_SECOND_MASTER=400
-SLEEP_TIME_FOR_FIRST_SLAVE=400
-SLEEP_TIME_FOR_SECOND_SLAVE=300
-CHARACTER_SET=latin1
-DBUSER=""
-START_WAIT_TIMEOUT=10
-STOP_WAIT_TIMEOUT=10
-MYSQL_TEST_SSL_OPTS=""
-USE_TIMER=""
-USE_EMBEDDED_SERVER=""
-TEST_MODE=""
-
-NDB_MGM_EXTRA_OPTS=
-NDB_MGMD_EXTRA_OPTS=
-NDBD_EXTRA_OPTS=
-MASTER_MYSQLDBINLOG=1
-SLAVE_MYSQLDBINLOG=1
-
-DO_STRESS=""
-STRESS_SUITE="main"
-STRESS_MODE="random"
-STRESS_THREADS=5
-STRESS_TEST_COUNT=""
-STRESS_LOOP_COUNT=""
-STRESS_TEST_DURATION=""
-STRESS_INIT_FILE=""
-STRESS_TEST_FILE=""
-STRESS_TEST=""
-
-$ECHO "Logging: $0 $*" # To ensure we see all arguments in the output, for the test analysis tool
-
-while test $# -gt 0; do
- case "$1" in
- --embedded-server)
- USE_EMBEDDED_SERVER=1
- USE_MANAGER=0 NO_SLAVE=1
- USE_RUNNING_SERVER=0
- USE_NDBCLUSTER=""
- USE_NDBCLUSTER_SLAVE=""
- TEST_MODE="$TEST_MODE embedded" ;;
- --purify)
- USE_PURIFY=1
- USE_MANAGER=0
- USE_RUNNING_SERVER=0
- TEST_MODE="$TEST_MODE purify" ;;
- --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;;
- --force) FORCE=1 ;;
- --timer) USE_TIMER=1 ;;
- --old-master) MASTER_40_ARGS="";;
- --master-binary=*)
- MASTER_MYSQLD=`$ECHO "$1" | $SED -e "s;--master-binary=;;"` ;;
- --slave-binary=*)
- SLAVE_MYSQLD=`$ECHO "$1" | $SED -e "s;--slave-binary=;;"` ;;
- --local) USE_RUNNING_SERVER=0 ;;
- --extern) USE_RUNNING_SERVER=1 ;;
- --with-ndbcluster)
- USE_NDBCLUSTER="--ndbcluster" ;;
- --with-ndbcluster-slave)
- USE_NDBCLUSTER_SLAVE="--ndbcluster" ;;
- --with-ndbcluster-all)
- USE_NDBCLUSTER="--ndbcluster"
- USE_NDBCLUSTER_SLAVE="--ndbcluster"
- USE_NDBCLUSTER_ALL=1 ;;
- --with-ndbcluster-only)
- USE_NDBCLUSTER="--ndbcluster"
- USE_NDBCLUSTER_SLAVE="--ndbcluster"
- USE_NDBCLUSTER_ONLY=1 ;;
- --ndb-connectstring=*)
- USE_NDBCLUSTER="--ndbcluster" ;
- USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;;
- --ndb-connectstring-slave=*)
- USE_NDBCLUSTER_SLAVE="--ndbcluster" ;
- USE_RUNNING_NDBCLUSTER_SLAVE=`$ECHO "$1" | $SED -e "s;--ndb-connectstring-slave=;;"` ;;
- --ndb-extra-test)
- NDBCLUSTER_EXTRA_OPTS=" "
- NDB_EXTRA_TEST=1 ;
- ;;
- --ndb-verbose)
- NDB_VERBOSE=2 ;;
- --ndb_mgm-extra-opts=*)
- NDB_MGM_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgm-extra-opts=;;"` ;;
- --ndb_mgmd-extra-opts=*)
- NDB_MGMD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgmd-extra-opts=;;"` ;;
- --ndbd-extra-opts=*)
- NDBD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndbd-extra-opts=;;"` ;;
- --tmpdir=*) MYSQL_TMP_DIR=`$ECHO "$1" | $SED -e "s;--tmpdir=;;"` ;;
- --local-master)
- MASTER_MYPORT=3306;
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT --host=127.0.0.1 \
- --port=$MYSQL_MYPORT"
- LOCAL_MASTER=1 ;;
- --master_port=*) MASTER_MYPORT=`$ECHO "$1" | $SED -e "s;--master_port=;;"` ;;
- --slave_port=*) SLAVE_MYPORT=`$ECHO "$1" | $SED -e "s;--slave_port=;;"` ;;
- --ndbcluster_port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster_port=;;"` ;;
- --ndbcluster-port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster-port=;;"` ;;
- --ndbcluster-port-slave=*) NDBCLUSTER_PORT_SLAVE=`$ECHO "$1" | $SED -e "s;--ndbcluster-port-slave=;;"` ;;
- --with-openssl)
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT \
- --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
- --ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem \
- --ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \
- --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
- --ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem \
- --ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem"
- MYSQL_TEST_SSL_OPTS="--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
- --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem \
- --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem" ;;
- --start-and-exit)
- START_AND_EXIT=1
- ;;
- --socket=*) LOCAL_SOCKET=`$ECHO "$1" | $SED -e "s;--socket=;;"` ;;
- --skip-rpl) NO_SLAVE=1 ;;
- --skip-test=*) SKIP_TEST=`$ECHO "$1" | $SED -e "s;--skip-test=;;"`;;
- --do-test=*) DO_TEST=`$ECHO "$1" | $SED -e "s;--do-test=;;"`;;
- --start-from=* ) START_FROM=`$ECHO "$1" | $SED -e "s;--start-from=;;"` ;;
- --warnings | --log-warnings)
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --log-warnings"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --log-warnings"
- ;;
- --wait-timeout=*)
- START_WAIT_TIMEOUT=`$ECHO "$1" | $SED -e "s;--wait-timeout=;;"`
- STOP_WAIT_TIMEOUT=$START_WAIT_TIMEOUT;;
- --record)
- RECORD=1;
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
- --small-bench)
- DO_SMALL_BENCH=1
- DO_BENCH=1
- NO_SLAVE=1
- ;;
- --bench)
- DO_BENCH=1
- NO_SLAVE=1
- ;;
- --stress)
- DO_STRESS=1
- NO_SLAVE=1
- SKIP_SLAVE=1
- ;;
- --stress-suite=*)
- STRESS_SUITE=`$ECHO "$1" | $SED -e "s;--stress-suite=;;"`
- ;;
- --stress-threads=*)
- STRESS_THREADS=`$ECHO "$1" | $SED -e "s;--stress-threads=;;"`
- ;;
- --stress-test-file=*)
- STRESS_TEST_FILE=`$ECHO "$1" | $SED -e "s;--stress-test-file=;;"`
- ;;
- --stress-init-file=*)
- STRESS_INIT_FILE=`$ECHO "$1" | $SED -e "s;--stress-init-file=;;"`
- ;;
- --stress-mode=*)
- STRESS_MODE=`$ECHO "$1" | $SED -e "s;--stress-mode=;;"`
- ;;
- --stress-loop-count=*)
- STRESS_LOOP_COUNT=`$ECHO "$1" | $SED -e "s;--stress-loop-count=;;"`
- ;;
- --stress-test-count=*)
- STRESS_TEST_COUNT=`$ECHO "$1" | $SED -e "s;--stress-test-count=;;"`
- ;;
- --stress-test-duration=*)
- STRESS_TEST_DURATION=`$ECHO "$1" | $SED -e "s;--stress-test-duration=;;"`
- ;;
- --big*) # Actually --big-test
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
- --compress)
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
- --sleep=*)
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1"
- SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"`
- ;;
- --ps-protocol)
- TEST_MODE="$TEST_MODE ps-protocol" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
- --user-test=*)
- USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"`
- ;;
- --mysqld=*)
- TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"`
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $TMP"
- ;;
- --gcov )
- if [ x$BINARY_DIST = x1 ] ; then
- $ECHO "Cannot do coverage test without the source - please use source dist"
- exit 1
- fi
- DO_GCOV=1
- GCOV=`which gcov`
- ;;
- --gprof )
- DO_GPROF=1
- ;;
- --gdb )
- START_WAIT_TIMEOUT=300
- STOP_WAIT_TIMEOUT=300
- if [ x$BINARY_DIST = x1 ] ; then
- $ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --gdb option"
- fi
- DO_GDB=1
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
- # This needs to be checked properly
- # USE_MANAGER=1
- USE_RUNNING_SERVER=0
- ;;
- --client-gdb )
- if [ x$BINARY_DIST = x1 ] ; then
- $ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --client-gdb option"
- fi
- DO_CLIENT_GDB=1
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
- ;;
- --manual-gdb )
- DO_GDB=1
- MANUAL_GDB=1
- USE_RUNNING_SERVER=0
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
- ;;
- --ddd )
- if [ x$BINARY_DIST = x1 ] ; then
- $ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --ddd option"
- fi
- DO_DDD=1
- USE_RUNNING_SERVER=0
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
- ;;
- --valgrind | --valgrind-all)
- find_valgrind;
- VALGRIND=$FIND_VALGRIND
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc"
- SLEEP_TIME_AFTER_RESTART=10
- SLEEP_TIME_FOR_DELETE=60
- USE_RUNNING_SERVER=0
- if test "$1" = "--valgrind-all"
- then
- VALGRIND="$VALGRIND -v --show-reachable=yes"
- fi
- ;;
- --valgrind-options=*)
- TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"`
- VALGRIND="$VALGRIND $TMP"
- ;;
- --skip-ndbcluster-slave | --skip-ndb-slave)
- USE_NDBCLUSTER_SLAVE=""
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-ndbcluster"
- ;;
- --valgrind-mysqltest | --valgrind-mysqltest-all)
- find_valgrind;
- VALGRIND_MYSQLTEST=$FIND_VALGRIND
- if test "$1" = "--valgrind-mysqltest-all"
- then
- VALGRIND_MYSQLTEST="$VALGRIND_MYSQLTEST -v --show-reachable=yes"
- fi
- ;;
- --skip-ndbcluster | --skip-ndb)
- USE_NDBCLUSTER=""
- USE_NDBCLUSTER_SLAVE=""
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-ndbcluster"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-ndbcluster"
- ;;
- --skip-master-binlog) MASTER_MYSQLDBINLOG=0 ;;
- --skip-slave-binlog) SLAVE_MYSQLDBINLOG=0 ;;
- --skip-*)
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $1"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $1"
- ;;
- --strace-client )
- STRACE_CLIENT=1
- ;;
- --debug)
- EXTRA_MASTER_MYSQLD_TRACE=" \
- --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/master.trace"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \
- --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace"
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT \
- --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqltest.trace"
- EXTRA_MYSQLCHECK_OPT="$EXTRA_MYSQLCHECK_OPT \
- --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlcheck.trace"
- EXTRA_MYSQLDUMP_OPT="$EXTRA_MYSQLDUMP_OPT \
- --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqldump.trace"
- EXTRA_MYSQLSLAP_OPT="$EXTRA_MYSQLSLAP_OPT \
- --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlslap.trace"
- EXTRA_MYSQLSHOW_OPT="$EXTRA_MYSQLSHOW_OPT \
- --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlshow.trace"
- EXTRA_MYSQLBINLOG_OPT="$EXTRA_MYSQLBINLOG_OPT \
- --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlbinlog.trace"
- EXTRA_MYSQL_CLIENT_TEST_OPT="--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysql_client_test.trace"
- ;;
- --fast)
- FAST_START=1
- ;;
- --use-old-data)
- USE_OLD_DATA=1
- ;;
- --comment=*)
- TMP=`$ECHO "$1" | $SED -e "s;--comment=;;"`
- echo
- echo '############################################'
- echo "# $TMP"
- echo '############################################'
- ;;
- -- ) shift; break ;;
- --* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
- * ) break ;;
- esac
- shift
-done
-
-if [ -z "$TEST_MODE" ] ; then
- TEST_MODE="default"
-else
- # Remove the leading space if any
- TEST_MODE=`echo $TEST_MODE | sed 's/^ *//'`
-fi
-
-#
-# Skip tests that doesn't work with shell version
-#
-SKIP_TEST="$SKIP_TEST bootstrap"
-
-#++
-# mysqld Environment Parameters
-#--
-
-MYRUN_DIR=$MYSQL_TEST_DIR/var/run
-
-MASTER_MYDDIR="$MYSQL_TEST_DIR/var/master-data"
-MASTER_MYSOCK="$MYSQL_TMP_DIR/master.sock"
-MASTER_MYSOCK1=$MYSQL_MYSOCK"1"
-MASTER_MYPID="$MYRUN_DIR/master.pid"
-MASTER_MYLOG="$MYSQL_TEST_DIR/var/log/master.log"
-MASTER_MYERR="$MYSQL_TEST_DIR/var/log/master.err"
-
-SLAVE_MYDDIR="$MYSQL_TEST_DIR/var/slave-data"
-SLAVE_MYSOCK="$MYSQL_TMP_DIR/slave.sock"
-SLAVE_MYPID="$MYRUN_DIR/slave.pid"
-SLAVE_MYLOG="$MYSQL_TEST_DIR/var/log/slave.log"
-SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/slave.err"
-
-CURRENT_TEST="$MYSQL_TEST_DIR/var/log/current_test"
-SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M"
-
-export MASTER_MYHOST MASTER_MYPORT SLAVE_MYHOST SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1
-
-NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgm-extra-opts=$NDB_MGM_EXTRA_OPTS --ndb_mgmd-extra-opts=$NDB_MGMD_EXTRA_OPTS --ndbd-extra-opts=$NDBD_EXTRA_OPTS"
-NDBCLUSTER_OPTS_SLAVE="--port=$NDBCLUSTER_PORT_SLAVE --data-dir=$MYSQL_TEST_DIR/var"
-if [ -n "$USE_NDBCLUSTER_SLAVE" ] ; then
- USE_NDBCLUSTER_SLAVE="$USE_NDBCLUSTER_SLAVE --ndb-connectstring=localhost:$NDBCLUSTER_PORT_SLAVE --ndb-extra-logging"
-fi
-NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT
-NDB_TOOLS_OUTPUT=$MYSQL_TEST_DIR/var/log/ndb_tools.log
-
-if [ x$SOURCE_DIST = x1 ] ; then
- MY_BASEDIR=$MYSQL_TEST_DIR
-else
- MY_BASEDIR=$BASEDIR
-fi
-
-# Create the directories
-
-# This should be fixed to be not be dependent on the contence of MYSQL_TMP_DIR
-# or MYRUN_DIR
-# (mkdir -p is not portable)
-[ -d $MYSQL_TEST_DIR/var ] || mkdir $MYSQL_TEST_DIR/var
-[ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp
-[ -d $MYSQL_TEST_DIR/var/run ] || mkdir $MYSQL_TEST_DIR/var/run
-[ -d $MYSQL_TEST_DIR/var/log ] || mkdir $MYSQL_TEST_DIR/var/log
-
-# Use 'test', not '[' as the shell builtin might not have '-L
-if test ! -L "$MYSQL_TEST_DIR/var/std_data_ln" ; then
- ln -s $MYSQL_TEST_DIR/std_data/ $MYSQL_TEST_DIR/var/std_data_ln
-fi
-
-if test ${COLUMNS:-0} -lt 80 ; then COLUMNS=80 ; fi
-E=`$EXPR $COLUMNS - 8`
-DASH72=`$ECHO '-------------------------------------------------------'|$CUT -c 1-$E`
-
-# on source dist, we pick up freshly build executables
-# on binary, use what is installed
-if [ x$SOURCE_DIST = x1 ] ; then
- if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then
- if [ -f "$BASEDIR/libmysqld/examples/mysqltest_embedded" ] ; then
- MYSQL_TEST="$BASEDIR/libmysqld/examples/mysqltest_embedded"
- else
- echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2
- exit 1
- fi
- MYSQL_CLIENT_TEST="$BASEDIR/libmysqld/examples/mysql_client_test_embedded"
- else
- MYSQLD="$BASEDIR/sql/mysqld"
- if [ -n "$VALGRIND" ] ; then
- MYSQLD="$VALGRIND $MYSQLD"
- fi
- if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then
- MYSQL_TEST="$BASEDIR/client/.libs/lt-mysqltest"
- elif [ -f "$BASEDIR/client/.libs/mysqltest" ] ; then
- MYSQL_TEST="$BASEDIR/client/.libs/mysqltest"
- else
- MYSQL_TEST="$BASEDIR/client/mysqltest"
- fi
- MYSQL_CLIENT_TEST="$BASEDIR/tests/mysql_client_test"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqlcheck" ] ; then
- MYSQL_CHECK="$BASEDIR/client/.libs/mysqlcheck"
- else
- MYSQL_CHECK="$BASEDIR/client/mysqlcheck"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
- MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump"
- else
- MYSQL_DUMP="$BASEDIR/client/mysqldump"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqlslap" ] ; then
- MYSQL_SLAP="$BASEDIR/client/.libs/mysqlslap"
- else
- MYSQL_SLAP="$BASEDIR/client/mysqlslap"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqlimport" ] ; then
- MYSQL_IMPORT="$BASEDIR/client/.libs/mysqlimport"
- else
- MYSQL_IMPORT="$BASEDIR/client/mysqlimport"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqlshow" ] ; then
- MYSQL_SHOW="$BASEDIR/client/.libs/mysqlshow"
- else
- MYSQL_SHOW="$BASEDIR/client/mysqlshow"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqlbinlog" ] ; then
- MYSQL_BINLOG="$BASEDIR/client/.libs/mysqlbinlog"
- else
- MYSQL_BINLOG="$BASEDIR/client/mysqlbinlog"
- fi
- if [ -n "$STRACE_CLIENT" ]; then
- MYSQL_TEST="strace -o $MYSQL_TEST_DIR/var/log/mysqltest.strace $MYSQL_TEST"
- fi
-
- CLIENT_BINDIR="$BASEDIR/client"
- MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
- WAIT_PID="$BASEDIR/extra/mysql_waitpid"
- MYSQL_MY_PRINT_DEFAULTS="$BASEDIR/extra/my_print_defaults"
- MYSQL="$CLIENT_BINDIR/mysql"
- LANGUAGE="$BASEDIR/sql/share/english/"
- CHARSETSDIR="$BASEDIR/sql/share/charsets"
- INSTALL_DB="./install_test_db"
- MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables"
- NDB_TOOLS_DIR="$BASEDIR/storage/ndb/tools"
- NDB_MGM="$BASEDIR/storage/ndb/src/mgmclient/ndb_mgm"
-
- if [ -n "$USE_PURIFY" ] ; then
- PSUP="$MYSQL_TEST_DIR/suppress.purify"
- PURIFYOPTIONS="-windows=no -log-file=%v.purifylog -append-logfile -add-suppression-files=$PSUP"
- if [ -f "${MYSQL_TEST}-purify" ] ; then
- MYSQL_TEST="${MYSQL_TEST}-purify"
- PLOG="$MYSQL_TEST.purifylog"
- if [ -f $PLOG ]; then
- mv $PLOG $PLOG.$$
- fi
- PURIFY_LOGS="$PLOG"
- fi
- if [ -f "${MYSQLD}-purify" ] ; then
- MYSQLD="${MYSQLD}-purify"
- PLOG="$MYSQLD.purifylog"
- if [ -f $PLOG ]; then
- mv $PLOG $PLOG.$$
- fi
- PURIFY_LOGS="$PURIFY_LOGS $PLOG"
- fi
- fi
-
-else
-
- # We have a binary installation. Note that this can be both from
- # unpacking a MySQL AB binary distribution (created using
- # "scripts/make_binary_distribution", and from a "make install".
- # Unfortunately the structure differs a bit, for a "make install"
- # currently all binaries are in "bin", for a MySQL AB packaging
- # some are in "tests".
-
- if test -x "$BASEDIR/libexec/mysqld"
- then
- MYSQLD="$VALGRIND $BASEDIR/libexec/mysqld"
- elif test -x "$BASEDIR/bin/mysqld"
- then
- MYSQLD="$VALGRIND $BASEDIR/bin/mysqld"
- elif test -x "$BASEDIR/sbin/mysqld"
- then
- MYSQLD="$VALGRIND $BASEDIR/sbin/mysqld"
- else
- $ECHO "Fatal error: Cannot find program mysqld in $BASEDIR/{libexec,bin,sbin}" 1>&2
- exit 1
- fi
- CLIENT_BINDIR="$BASEDIR/bin"
- if test -d "$BASEDIR/tests"
- then
- TESTS_BINDIR="$BASEDIR/tests"
- else
- TESTS_BINDIR="$BASEDIR/bin"
- fi
- MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
- MYSQL_CHECK="$CLIENT_BINDIR/mysqlcheck"
- MYSQL_SLAP="$CLIENT_BINDIR/mysqlslap"
- MYSQL_SHOW="$CLIENT_BINDIR/mysqlshow"
- MYSQL_IMPORT="$CLIENT_BINDIR/mysqlimport"
- MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog"
- MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
- WAIT_PID="$CLIENT_BINDIR/mysql_waitpid"
- MYSQL_MY_PRINT_DEFAULTS="$CLIENT_BINDIR/my_print_defaults"
- MYSQL="$CLIENT_BINDIR/mysql"
- INSTALL_DB="./install_test_db --bin"
- MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables"
- NDB_TOOLS_DIR="$CLIENT_BINDIR"
- NDB_MGM="$CLIENT_BINDIR/ndb_mgm"
- if test -d "$BASEDIR/share/mysql/english"
- then
- LANGUAGE="$BASEDIR/share/mysql/english/"
- CHARSETSDIR="$BASEDIR/share/mysql/charsets"
- else
- LANGUAGE="$BASEDIR/share/english/"
- CHARSETSDIR="$BASEDIR/share/charsets"
- fi
- if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then
- if [ -f "$CLIENT_BINDIR/mysqltest_embedded" ] ; then
- MYSQL_TEST="$CLIENT_BINDIR/mysqltest_embedded"
- else
- echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2
- exit 1
- fi
- if [ -d "$BASEDIR/tests/mysql_client_test_embedded" ] ; then
- MYSQL_CLIENT_TEST="$TESTS_BINDIR/mysql_client_test_embedded"
- else
- MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test_embedded"
- fi
- else
- MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
- MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
- MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump"
- elif [ -f "$BASEDIR/client/mysqldump" ] ; then
- MYSQL_DUMP="$BASEDIR/client/mysqldump"
- else
- MYSQL_DUMP="$BASEDIR/bin/mysqldump"
- fi
-fi
-
-if [ -z "$MASTER_MYSQLD" ]
-then
-MASTER_MYSQLD=$MYSQLD
-fi
-
-if [ -z "$SLAVE_MYSQLD" ]
-then
-SLAVE_MYSQLD=$MYSQLD
-fi
-
-# If we should run all tests cases, we will use a local server for that
-
-if [ -z "$1" -a -z "$DO_STRESS" ]
-then
- USE_RUNNING_SERVER=0
-fi
-if [ $USE_RUNNING_SERVER -eq 1 ]
-then
- MASTER_MYSOCK=$LOCAL_SOCKET;
- DBUSER=${DBUSER:-test}
-else
- DBUSER=${DBUSER:-root} # We want to do FLUSH xxx commands
-fi
-
-if [ -w / ]
-then
- # We are running as root; We need to add the --root argument
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --user=root"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root"
-fi
-
-MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent $EXTRA_MYSQL_CLIENT_TEST_OPT"
-# Need to pass additional arguments to MYSQL_CLIENT_TEST for embedded server
-# -A marks each argument for passing to the function which initializes the
-# embedded library
-if [ "x$USE_EMBEDDED_SERVER" = "x1" ]; then
- MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST -A --language=$LANGUAGE -A --datadir=$SLAVE_MYDDIR -A --character-sets-dir=$CHARSETSDIR"
-fi
-# Save path and name of mysqldump
-MYSQL_DUMP_DIR="$MYSQL_DUMP"
-export MYSQL_DUMP_DIR
-MYSQL_CHECK="$MYSQL_CHECK --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLCHECK_OPT"
-MYSQL_DUMP="$MYSQL_DUMP --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
-MYSQL_SLAP="$MYSQL_SLAP -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSLAP_OPT"
-MYSQL_DUMP_SLAVE="$MYSQL_DUMP_DIR --no-defaults -uroot --socket=$SLAVE_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
-MYSQL_SHOW="$MYSQL_SHOW --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
-MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --debug-info --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
-MYSQL_IMPORT="$MYSQL_IMPORT --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
-MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
-MYSQL="$MYSQL --no-defaults --debug-info --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
-export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_DUMP_SLAVE MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES MYSQL_IMPORT
-export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR MYSQL_MY_PRINT_DEFAULTS
-export MYSQL_SLAP
-export NDB_TOOLS_DIR
-export NDB_MGM
-export NDB_BACKUP_DIR
-export NDB_TOOLS_OUTPUT
-export PURIFYOPTIONS
-NDB_STATUS_OK=1
-export NDB_STATUS_OK
-NDB_SLAVE_STATUS_OK=1
-export NDB_SLAVE_STATUS_OK
-export NDB_EXTRA_TEST NDBCLUSTER_PORT NDBCLUSTER_PORT_SLAVE
-
-MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
- --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
- --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT $MYSQL_TEST_SSL_OPTS"
-if [ x$USE_TIMER = x1 ] ; then
- MYSQL_TEST_ARGS="$MYSQL_TEST_ARGS --timer-file=$MY_LOG_DIR/timer"
-fi
-MYSQL_TEST_BIN=$MYSQL_TEST
-MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS"
-
-# Export MYSQL_TEST variable for use from .test files
-export MYSQL_TEST
-
-GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client
-GDB_MASTER_INIT=$MYSQL_TMP_DIR/gdbinit.master
-GDB_SLAVE_INIT=$MYSQL_TMP_DIR/gdbinit.slave
-GCOV_MSG=$MYSQL_TMP_DIR/mysqld-gcov.out
-GCOV_ERR=$MYSQL_TMP_DIR/mysqld-gcov.err
-GPROF_DIR=$MYSQL_TMP_DIR/gprof
-GPROF_MASTER=$GPROF_DIR/master.gprof
-GPROF_SLAVE=$GPROF_DIR/slave.gprof
-TIMEFILE="$MYSQL_TEST_DIR/var/log/mysqltest-time"
-MYSQLTEST_LOG="$MYSQL_TEST_DIR/var/log/mysqltest.log"
-if [ -n "$DO_CLIENT_GDB" -o -n "$DO_GDB" ] ; then
- XTERM=`which xterm`
-fi
-
-export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MASTER_MYSOCK
-
-#++
-# Function Definitions
-#--
-
-prompt_user ()
-{
- $ECHO $1
- read unused
-}
-
-# We can't use diff -u or diff -a as these are not portable
-
-show_failed_diff ()
-{
- reject_file=r/$1.reject
- result_file=r/$1.result
- eval_file=r/$1.eval
-
- if [ -f $eval_file ]
- then
- result_file=$eval_file
- fi
-
- if [ -x "$DIFF" ] && [ -f $reject_file ]
- then
- echo "Below are the diffs between actual and expected results:"
- echo "-------------------------------------------------------"
- $DIFF -c $result_file $reject_file
- echo "-------------------------------------------------------"
- echo "Please follow the instructions outlined at"
- echo "http://forge.mysql.com/wiki/MySQL_Internals_Porting#Debugging_a_MySQL_Server"
- echo "to find the reason to this problem and how to report this."
- echo ""
- fi
-}
-
-do_gdb_test ()
-{
- mysql_test_args="$MYSQL_TEST_ARGS $1"
- $ECHO "set args $mysql_test_args < $2" > $GDB_CLIENT_INIT
- echo "Set breakpoints ( if needed) and type 'run' in gdb window"
- #this xterm should not be backgrounded
- $XTERM -title "Client" -e gdb -x $GDB_CLIENT_INIT $MYSQL_TEST_BIN
-}
-
-error () {
- $ECHO "Error: $1"
- exit 1
-}
-
-error_is () {
- $ECHO "Errors are (from $TIMEFILE) :"
- $CAT < $TIMEFILE
- $ECHO "(the last lines may be the most important ones)"
-}
-
-prefix_to_8() {
- $ECHO " $1" | $SED -e 's:.*\(........\)$:\1:'
-}
-
-pass_inc () {
- TOT_PASS=`$EXPR $TOT_PASS + 1`
-}
-
-fail_inc () {
- TOT_FAIL=`$EXPR $TOT_FAIL + 1`
-}
-
-skip_inc () {
- TOT_SKIP=`$EXPR $TOT_SKIP + 1`
-}
-
-total_inc () {
- TOT_TEST=`$EXPR $TOT_TEST + 1`
-}
-
-
-skip_test() {
- USERT=" ...."
- SYST=" ...."
- REALT=" ...."
- pname=`$ECHO "$1 "|$CUT -c 1-24`
- RES="$pname"
- skip_inc
- $ECHO "$RES$RES_SPACE [ skipped ]"
-}
-
-
-disable_test() {
- USERT=" ...."
- SYST=" ...."
- REALT=" ...."
- pname=`$ECHO "$1 "|$CUT -c 1-24`
- RES="$pname"
- skip_inc
- $ECHO "$RES$RES_SPACE [ disabled ] $2"
-}
-
-
-report_current_test () {
- tname=$1
- echo "CURRENT_TEST: $tname" >> $MASTER_MYERR
- eval "master1_running=\$MASTER1_RUNNING"
- if [ x$master1_running = x1 ] ; then
- echo "CURRENT_TEST: $tname" >> $MASTER_MYERR"1"
- fi
- if [ -n "$PURIFY_LOGS" ] ; then
- for log in $PURIFY_LOGS
- do
- echo "CURRENT_TEST: $tname" >> $log
- done
- fi
-}
-
-
-report_stats () {
- if [ $TOT_FAIL = 0 ]; then
- $ECHO "All $TOT_TEST tests were successful."
- else
- xten=`$EXPR $TOT_PASS \* 10000`
- raw=`$EXPR $xten / $TOT_TEST`
- raw=`$PRINTF %.4d $raw`
- whole=`$PRINTF %.2s $raw`
- xwhole=`$EXPR $whole \* 100`
- deci=`$EXPR $raw - $xwhole`
- $ECHO "Failed ${TOT_FAIL}/${TOT_TEST} tests, ${whole}.${deci}% were successful."
- $ECHO ""
- $ECHO "The log files in $MY_LOG_DIR may give you some hint"
- $ECHO "of what went wrong."
- $ECHO "If you want to report this error, please read first the documentation at"
- $ECHO "http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html"
- fi
-
- if [ $USE_RUNNING_SERVER -eq 0 ]
- then
-
- # Report if there was any fatal warnings/errors in the log files
- #
- $RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp
- # Remove some non fatal warnings from the log files
- $SED -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' -e 's|InnoDB: Warning: we did not need to do crash recovery||g' \
- $MY_LOG_DIR/*.err \
- | $SED -e 's!Warning: Table:.* on rename!!g' \
- > $MY_LOG_DIR/warnings.tmp
-
- # Find errors
- for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN" "mysqld: Warning" "Attempting backtrace" "Assertion .* failed"
- do
- if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
- then
- GOT_WARNINGS=1
- fi
- done
- $RM -f $MY_LOG_DIR/warnings.tmp
- if [ $GOT_WARNINGS = "1" ]
- then
- echo "WARNING: Got errors/warnings while running tests. Please examine"
- echo "$MY_LOG_DIR/warnings for details."
- fi
-
- fi # USE_RUNNING_SERVER
-
- # Check valgrind errors from mysqltest
- if [ ! -z "$VALGRIND_MYSQLTEST" ]
- then
- if $GREP "ERROR SUMMARY" $MYSQLTEST_LOG | $GREP -v "0 errors" > /dev/null
- then
- $ECHO "Valgrind detected errors!"
- $GREP "ERROR SUMMARY" $MYSQLTEST_LOG | $GREP -v "0 errors"
- $ECHO "See $MYSQLTEST_LOG"
- fi
- fi
-}
-
-mysql_install_db () {
- $ECHO "Removing Stale Files"
- if [ -z "$USE_OLD_DATA" ]; then
- $RM -rf $MASTER_MYDDIR $MASTER_MYDDIR"1"
- $ECHO "Installing Master Databases"
- $INSTALL_DB
- if [ $? != 0 ]; then
- error "Could not install master test DBs"
- exit 1
- fi
- fi
- if [ ! -z "$USE_NDBCLUSTER" ]
- then
- $ECHO "Installing Master Databases 1"
-# $INSTALL_DB -1
- $RM -rf var/master-data1
- mkdir var/master-data1
- cp -r var/master-data/* var/master-data1
- if [ $? != 0 ]; then
- error "Could not install master test DBs 1"
- exit 1
- fi
- fi
- $ECHO "Installing Slave Databases"
- $RM -rf $SLAVE_MYDDIR $MY_LOG_DIR/*
-# $INSTALL_DB -slave
- mkdir var/slave-data
- cp -r var/master-data/* var/slave-data
- if [ $? != 0 ]; then
- error "Could not install slave test DBs"
- exit 1
- fi
-
- for slave_num in 1 2 ;
- do
- $RM -rf var/slave$slave_num-data
- mkdir -p var/slave$slave_num-data/mysql
- mkdir -p var/slave$slave_num-data/test
- cp var/slave-data/mysql/* var/slave$slave_num-data/mysql
- done
- return 0
-}
-
-gprof_prepare ()
-{
- $RM -rf $GPROF_DIR
- mkdir -p $GPROF_DIR
-}
-
-gprof_collect ()
-{
- if [ -f $MASTER_MYDDIR/gmon.out ]; then
- gprof $MASTER_MYSQLD $MASTER_MYDDIR/gmon.out > $GPROF_MASTER
- echo "Master execution profile has been saved in $GPROF_MASTER"
- fi
- if [ -f $SLAVE_MYDDIR/gmon.out ]; then
- gprof $SLAVE_MYSQLD $SLAVE_MYDDIR/gmon.out > $GPROF_SLAVE
- echo "Slave execution profile has been saved in $GPROF_SLAVE"
- fi
-}
-
-gcov_prepare () {
- $FIND $BASEDIR -name \*.gcov \
- -or -name \*.da | $XARGS $RM
-}
-
-gcov_collect () {
- $ECHO "Collecting source coverage info..."
- [ -f $GCOV_MSG ] && $RM $GCOV_MSG
- [ -f $GCOV_ERR ] && $RM $GCOV_ERR
- for d in $MYSQLD_SRC_DIRS; do
- cd $BASEDIR/$d
- for f in *.h *.cc *.c; do
- $GCOV $f 2>>$GCOV_ERR >>$GCOV_MSG
- done
- cd $MYSQL_TEST_DIR
- done
-
- $ECHO "gcov info in $GCOV_MSG, errors in $GCOV_ERR"
-}
-
-abort_if_failed()
-{
- if [ ! $? = 0 ] ; then
- echo $1
- exit 1
- fi
-}
-
-launch_in_background()
-{
- shift
- echo $@ | /bin/sh >> $CUR_MYERR 2>&1 &
- sleep 2 #hack
- return
-}
-
-shutdown_mysqld()
-{
- pid=$1
- ident=$2
- # Shutdown time must be high as slave may be in reconnect
- $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=5 --shutdown_timeout=70 shutdown >> $MYSQL_MANAGER_LOG 2>&1
- res=$?
- # Some systems require an extra connect
- $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=1 ping >> $MYSQL_MANAGER_LOG 2>&1
- if test $res = 0
- then
- wait_for_pid $pid
- fi
- return $res
-}
-
-start_ndbcluster()
-{
- if [ ! -n "$USE_NDBCLUSTER" ] ;
- then
- USING_NDBCLUSTER=0
- USE_NDBCLUSTER_OPT=
- fi
-
- if [ x$USING_NDBCLUSTER = x1 -a -z "$USE_NDBCLUSTER_OPT" ]
- then
- rm -f $NDB_TOOLS_OUTPUT
- if [ -z "$USE_RUNNING_NDBCLUSTER" ]
- then
- if [ "$DO_BENCH" != 1 -a -z "$NDBCLUSTER_EXTRA_OPTS" ]
- then
- NDBCLUSTER_EXTRA_OPTS="--small"
- fi
- OPTS="$NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --character-sets-dir=$CHARSETSDIR --verbose=$NDB_VERBOSE --initial --relative-config-data-dir --core"
- if [ "x$NDB_VERBOSE" != "x0" ] ; then
- echo "Starting master ndbcluster " $OPTS
- fi
- ./ndb/ndbcluster $OPTS || NDB_STATUS_OK=0
- if [ x$NDB_STATUS_OK != x1 ] ; then
- if [ x$FORCE != x1 ] ; then
- exit 1
- fi
- USING_NDBCLUSTER=0
- USE_NDBCLUSTER_OPT=
- return
- fi
-
- NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
- else
- NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
- echo "Using ndbcluster at $NDB_CONNECTSTRING"
- fi
- USE_NDBCLUSTER_OPT="$USE_NDBCLUSTER --ndb-connectstring=\"$NDB_CONNECTSTRING\" --ndb-extra-logging"
- export NDB_CONNECTSTRING
- fi
-}
-
-rm_ndbcluster_tables()
-{
- $RM -f $1/mysql/apply_status*
- $RM -f $1/mysql/schema*
-}
-
-stop_ndbcluster()
-{
- if [ -n "$USE_NDBCLUSTER_OPT" ]
- then
- USE_NDBCLUSTER_OPT=
- if [ -z "$USE_RUNNING_NDBCLUSTER" ]
- then
- # Kill any running ndbcluster stuff
- $ECHO "Stopping master cluster"
- ./ndb/ndbcluster $NDBCLUSTER_OPTS --stop
- # remove ndb table the hard way as not to upset later tests
- rm_ndbcluster_tables $MASTER_MYDDIR
- rm_ndbcluster_tables $MASTER_MYDDIR"1"
- fi
- fi
-}
-
-# The embedded server needs the cleanup so we do some of the start work
-# but stop before actually running mysqld or anything.
-
-start_master()
-{
- eval "this_master_running=\$MASTER$1_RUNNING"
- if [ x$this_master_running = x1 ] || [ x$LOCAL_MASTER = x1 ] ; then
- return
- fi
- # Remove stale binary logs except for 2 tests which need them
- if [ "$tname" != "rpl_crash_binlog_ib_1b" ] && [ "$tname" != "rpl_crash_binlog_ib_2b" ] && [ "$tname" != "rpl_crash_binlog_ib_3b" ]
- then
- $RM -f $MYSQL_TEST_DIR/var/log/master-bin$1.*
- fi
-
- # Remove old master.info and relay-log.info files
- $RM -f $MYSQL_TEST_DIR/var/master-data$1/master.info $MYSQL_TEST_DIR/var/master-data$1/relay-log.info
-
- #run master initialization shell script if one exists
-
- if [ -f "$master_init_script" ] ;
- then
- /bin/sh $master_init_script
- fi
- cd $BASEDIR # for gcov
- if [ -n "$1" ] ; then
- id=`$EXPR $1 + 101`;
- this_master_myport=`$EXPR $MASTER_MYPORT + $1`
- NOT_FIRST_MASTER_EXTRA_OPTS="--skip-innodb"
- eval "MASTER_MYPORT$1=$this_master_myport"
- export MASTER_MYPORT$1
- else
- id=1;
- this_master_myport=$MASTER_MYPORT
- NOT_FIRST_MASTER_EXTRA_OPTS=""
- fi
- if [ -n "$EXTRA_MASTER_MYSQLD_TRACE" ]
- then
- CURR_MASTER_MYSQLD_TRACE="$EXTRA_MASTER_MYSQLD_TRACE$1"
- fi
- if [ x$MASTER_MYSQLDBINLOG = x1 ]
- then
- MASTER_MYSQLD_BINLOG_OPT="--log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1"
- fi
- if [ -z "$DO_BENCH" -a -z "$DO_STRESS" ]
- then
- master_args="--no-defaults \
- --server-id=$id \
- --basedir=$MY_BASEDIR \
- --port=$this_master_myport \
- --port-open-timeout=380 \
- --local-infile \
- --exit-info=256 \
- --core \
- $USE_NDBCLUSTER_OPT \
- --datadir=$MASTER_MYDDIR$1 \
- --pid-file=$MASTER_MYPID$1 \
- --socket=$MASTER_MYSOCK$1 \
- --log=$MASTER_MYLOG$1 \
- --character-sets-dir=$CHARSETSDIR \
- --default-character-set=$CHARACTER_SET \
- --tmpdir=$MYSQL_TMP_DIR \
- --language=$LANGUAGE \
- --innodb_data_file_path=ibdata1:128M:autoextend \
- --open-files-limit=1024 \
- --log-bin-trust-function-creators \
- $MASTER_40_ARGS \
- $SMALL_SERVER \
- $MASTER_MYSQLD_BINLOG_OPT \
- $EXTRA_MASTER_MYSQLD_OPT $EXTRA_MASTER_OPT \
- $NOT_FIRST_MASTER_EXTRA_OPTS $CURR_MASTER_MYSQLD_TRACE"
- else
- master_args="--no-defaults \
- --server-id=$id --rpl-recovery-rank=1 \
- --basedir=$MY_BASEDIR --init-rpl-role=master \
- --port=$this_master_myport \
- --port-open-timeout=380 \
- --local-infile \
- --datadir=$MASTER_MYDDIR$1 \
- --pid-file=$MASTER_MYPID$1 \
- --socket=$MASTER_MYSOCK$1 \
- --character-sets-dir=$CHARSETSDIR \
- --default-character-set=$CHARACTER_SET \
- --core \
- $USE_NDBCLUSTER_OPT \
- --tmpdir=$MYSQL_TMP_DIR \
- --language=$LANGUAGE \
- --innodb_data_file_path=ibdata1:128M:autoextend \
- --log-bin-trust-function-creators \
- $MASTER_40_ARGS \
- $SMALL_SERVER \
- $MASTER_MYSQLD_BINLOG_OPT \
- $EXTRA_MASTER_MYSQLD_OPT $EXTRA_MASTER_OPT \
- $NOT_FIRST_MASTER_EXTRA_OPTS"
- fi
-
- CUR_MYERR=$MASTER_MYERR$1
- CUR_MYSOCK=$MASTER_MYSOCK$1
-
- # For embedded server we collect the server flags and return
- if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then
- # Add a -A to each argument to pass it to embedded server
- EMBEDDED_SERVER_OPTS=""
- for opt in $master_args
- do
- EMBEDDED_SERVER_OPTS="$EMBEDDED_SERVER_OPTS -A $opt"
- done
- EXTRA_MYSQL_TEST_OPT="$EMBEDDED_SERVER_OPTS"
- return
- fi
-
- if [ x$DO_DDD = x1 ]
- then
- $ECHO "set args $master_args" > $GDB_MASTER_INIT$1
- launch_in_background master ddd -display $DISPLAY --debugger \
- "gdb -x $GDB_MASTER_INIT$1" $MASTER_MYSQLD
- elif [ x$DO_GDB = x1 ]
- then
- if [ x$MANUAL_GDB = x1 ]
- then
- $ECHO "set args $master_args" > $GDB_MASTER_INIT$1
- $ECHO "To start gdb for the master , type in another window:"
- $ECHO "cd $MYSQL_TEST_DIR ; gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD"
- wait_for_master=1500
- else
- ( $ECHO set args $master_args;
- if [ $USE_MANAGER = 0 ] ; then
- cat <<EOF
-b mysql_parse
-commands 1
-disa 1
-end
-r
-EOF
- fi ) > $GDB_MASTER_INIT$1
- launch_in_background master $XTERM -display $DISPLAY \
- -title "Master" -e gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD
- fi
- else
- launch_in_background master $MASTER_MYSQLD $master_args
- fi
- sleep_until_file_created $MASTER_MYPID$1 $wait_for_master
- wait_for_master=$SLEEP_TIME_FOR_SECOND_MASTER
- eval "MASTER$1_RUNNING=1"
-}
-
-start_slave()
-{
- [ x$SKIP_SLAVE = x1 ] && return
- eval "this_slave_running=\$SLAVE$1_RUNNING"
- [ x$this_slave_running = 1 ] && return
-
- # When testing fail-safe replication, we will have more than one slave
- # in this case, we start secondary slaves with an argument
- slave_ident="slave$1"
- if [ -n "$1" ] ;
- then
- slave_server_id=`$EXPR 2 + $1`
- slave_rpl_rank=$slave_server_id
- slave_port=`expr $SLAVE_MYPORT + $1`
- slave_log="$SLAVE_MYLOG.$1"
- slave_err="$SLAVE_MYERR.$1"
- slave_datadir="$SLAVE_MYDDIR/../$slave_ident-data/"
- slave_pid="$MYRUN_DIR/mysqld-$slave_ident.pid"
- slave_sock="$SLAVE_MYSOCK-$1"
- else
- slave_server_id=2
- slave_rpl_rank=2
- slave_port=$SLAVE_MYPORT
- slave_log=$SLAVE_MYLOG
- slave_err=$SLAVE_MYERR
- slave_datadir=$SLAVE_MYDDIR
- slave_pid=$SLAVE_MYPID
- slave_sock="$SLAVE_MYSOCK"
- fi
-
- #
- if [ x$USING_NDBCLUSTER = x1 -a -n "$USE_NDBCLUSTER_SLAVE" ] ; then
- if [ $slave_server_id -eq 2 ] ; then
- savedir=`pwd`
- cd $MYSQL_TEST_DIR
- if [ "$DO_BENCH" != 1 -a -z "$NDBCLUSTER_EXTRA_OPTS" ]
- then
- NDBCLUSTER_EXTRA_OPTS="--small"
- fi
-
- OPTS="$NDBCLUSTER_OPTS_SLAVE --initial $NDBCLUSTER_EXTRA_OPTS --ndbd-nodes=1 --verbose=$NDB_VERBOSE --relative-config-data-dir --core"
- if [ "x$NDB_VERBOSE" != "x0" ] ; then
- echo "Starting slave ndbcluster " $OPTS
- fi
- ./ndb/ndbcluster $OPTS \
- || NDB_SLAVE_STATUS_OK=0
- # > /dev/null 2>&1 || NDB_SLAVE_STATUS_OK=0
- cd $savedir
- if [ x$NDB_SLAVE_STATUS_OK != x1 ] ; then
- if [ x$FORCE != x1 ] ; then
- exit 1
- fi
- USE_NDBCLUSTER_SLAVE_OPT=
- USE_NDBCLUSTER_SLAVE=
- fi
- USE_NDBCLUSTER_SLAVE_OPT=$USE_NDBCLUSTER_SLAVE
- fi
- else
- USE_NDBCLUSTER_SLAVE_OPT=
- fi
-
- # Remove stale binary logs and old master.info files
- # except for too tests which need them
- if [ "$tname" != "rpl_crash_binlog_ib_1b" ] && [ "$tname" != "rpl_crash_binlog_ib_2b" ] && [ "$tname" != "rpl_crash_binlog_ib_3b" ]
- then
- $RM -f $MYSQL_TEST_DIR/var/log/$slave_ident-*bin.*
- $RM -f $slave_datadir/master.info $slave_datadir/relay-log.info
- fi
-
- #run slave initialization shell script if one exists
- if [ -f "$slave_init_script" ] ;
- then
- /bin/sh $slave_init_script
- fi
-
- if [ -z "$SLAVE_MASTER_INFO" ] ; then
- master_info="--master-user=root \
- --master-connect-retry=1 \
- --master-host=127.0.0.1 \
- --master-password="" \
- --master-port=$MASTER_MYPORT \
- --server-id=$slave_server_id --rpl-recovery-rank=$slave_rpl_rank"
- else
- master_info=$SLAVE_MASTER_INFO
- fi
-
- if [ x$SLAVE_MYSQLDBINLOG = x1 ]
- then
- SLAVE_MYSQLD_BINLOG_OPT="--log-bin=$MYSQL_TEST_DIR/var/log/$slave_ident-bin --log-slave-updates"
- fi
-
- $RM -f $slave_datadir/log.*
- slave_args="--no-defaults $master_info \
- --exit-info=256 \
- $SLAVE_MYSQLDBINLOG_OPT \
- --relay-log=$MYSQL_TEST_DIR/var/log/$slave_ident-relay-bin \
- --log=$slave_log \
- --basedir=$MY_BASEDIR \
- --datadir=$slave_datadir \
- --pid-file=$slave_pid \
- --port=$slave_port \
- --port-open-timeout=380 \
- --socket=$slave_sock \
- --character-sets-dir=$CHARSETSDIR \
- --default-character-set=$CHARACTER_SET \
- --core --init-rpl-role=slave \
- --tmpdir=$MYSQL_TMP_DIR \
- --language=$LANGUAGE \
- --skip-innodb --skip-ndbcluster --skip-slave-start \
- --slave-load-tmpdir=$SLAVE_LOAD_TMPDIR \
- --report-host=127.0.0.1 --report-user=root \
- --report-port=$slave_port \
- --master-retry-count=10 \
- -O slave_net_timeout=10 \
- --log-bin-trust-function-creators \
- $SMALL_SERVER \
- $SLAVE_MYSQLD_BINLOG_OPT \
- $EXTRA_SLAVE_MYSQLD_OPT $EXTRA_SLAVE_OPT \
- $USE_NDBCLUSTER_SLAVE_OPT"
- CUR_MYERR=$slave_err
- CUR_MYSOCK=$slave_sock
-
- if [ x$DO_DDD = x1 ]
- then
- $ECHO "set args $slave_args" > $GDB_SLAVE_INIT
- launch_in_background $slave_ident ddd -display $DISPLAY --debugger \
- "gdb -x $GDB_SLAVE_INIT" $SLAVE_MYSQLD
- elif [ x$DO_GDB = x1 ]
- then
- if [ x$MANUAL_GDB = x1 ]
- then
- $ECHO "set args $slave_args" > $GDB_SLAVE_INIT
- echo "To start gdb for the slave, type in another window:"
- echo "cd $MYSQL_TEST_DIR ; gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD"
- wait_for_slave=1500
- else
- ( $ECHO set args $slave_args;
- if [ $USE_MANAGER = 0 ] ; then
- cat <<EOF
-b mysql_parse
-commands 1
-disa 1
-end
-r
-EOF
- fi ) > $GDB_SLAVE_INIT
- launch_in_background $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \
- gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD
- fi
- else
- launch_in_background $slave_ident $SLAVE_MYSQLD $slave_args
- fi
- eval "SLAVE$1_RUNNING=1"
- sleep_until_file_created $slave_pid $wait_for_slave
- wait_for_slave=$SLEEP_TIME_FOR_SECOND_SLAVE
-}
-
-mysql_start ()
-{
-# We should not start the daemon here as we don't know the arguments
-# for the test. Better to let the test start the daemon
-
-# $ECHO "Starting MySQL daemon"
-# start_master
-# start_slave
- cd $MYSQL_TEST_DIR
- return 1
-}
-
-stop_slave ()
-{
- eval "this_slave_running=\$SLAVE$1_RUNNING"
- slave_ident="slave$1"
- if [ -n "$1" ] ;
- then
- slave_pid="$MYRUN_DIR/mysqld-$slave_ident.pid"
- else
- slave_pid=$SLAVE_MYPID
- fi
- if [ x$this_slave_running = x1 ]
- then
- pid=`$CAT $slave_pid`
- shutdown_mysqld $pid $slave_ident
- if [ $? != 0 ] && [ -f $slave_pid ]
- then # try harder!
- $ECHO "slave not cooperating with mysqladmin, will try manual kill"
- kill $pid
- sleep_until_file_deleted $pid $slave_pid
- if [ -f $slave_pid ] ; then
- $ECHO "slave refused to die. Sending SIGKILL"
- kill -9 `$CAT $slave_pid`
- $RM -f $slave_pid
- else
- $ECHO "slave responded to SIGTERM "
- fi
- else
- sleep $SLEEP_TIME_AFTER_RESTART
- fi
- eval "SLAVE$1_RUNNING=0"
- if [ -n "$USE_NDBCLUSTER_SLAVE_OPT" ] ; then
- savedir=`pwd`
- cd $MYSQL_TEST_DIR
- $ECHO "Stopping slave cluster"
- ./ndb/ndbcluster $NDBCLUSTER_OPTS_SLAVE --stop
- rm_ndbcluster_tables $SLAVE_MYDDIR
- cd $savedir
- fi
- fi
-}
-
-stop_slave_threads ()
-{
- eval "this_slave_running=\$SLAVE$1_RUNNING"
- slave_ident="slave$1"
- if [ x$this_slave_running = x1 ]
- then
- $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$slave_ident.sock stop-slave > /dev/null 2>&1
- fi
-}
-
-stop_master ()
-{
- eval "this_master_running=\$MASTER$1_RUNNING"
- if [ x$this_master_running = x1 ]
- then
- # For embedded server we don't stop anyting but mark that
- # MASTER_RUNNING=0 to get cleanup when calling start_master().
- if [ x$USE_EMBEDDED_SERVER != x1 ] ; then
- pid=`$CAT $MASTER_MYPID$1`
- shutdown_mysqld $pid master $1
- if [ $? != 0 ] && [ -f $MASTER_MYPID$1 ]
- then # try harder!
- $ECHO "master not cooperating with mysqladmin, will try manual kill"
- kill $pid
- sleep_until_file_deleted $pid $MASTER_MYPID$1
- if [ -f $MASTER_MYPID$1 ] ; then
- $ECHO "master refused to die. Sending SIGKILL"
- kill -9 `$CAT $MASTER_MYPID$1`
- $RM -f $MASTER_MYPID$1
- else
- $ECHO "master responded to SIGTERM "
- fi
- else
- sleep $SLEEP_TIME_AFTER_RESTART
- fi
- fi
- eval "MASTER$1_RUNNING=0"
- fi
-}
-
-mysql_stop ()
-{
- if [ "$MASTER_RUNNING" = 1 ]
- then
- $ECHO "Ending Tests"
- $ECHO "Shutting-down MySQL daemon"
- $ECHO ""
- stop_master
- stop_master 1
- $ECHO "Master shutdown finished"
- stop_slave
- stop_slave 1
- stop_slave 2
- $ECHO "Slave shutdown finished"
- stop_ndbcluster
- fi
- return 1
-}
-
-mysql_restart ()
-{
- mysql_stop
- mysql_start
- return 1
-}
-
-mysql_loadstd () {
-
- # cp $STD_DATA/*.frm $STD_DATA/*.MRG $MASTER_MYDDIR/test
- return 1
-}
-
-run_testcase ()
-{
- tf=$1
- tname=`$BASENAME $tf .test`
- master_opt_file=$TESTDIR/$tname-master.opt
- slave_opt_file=$TESTDIR/$tname-slave.opt
- master_init_script=$TESTDIR/$tname-master.sh
- slave_init_script=$TESTDIR/$tname-slave.sh
- slave_master_info_file=$TESTDIR/$tname.slave-mi
- tsrcdir=$TESTDIR/$tname-src
- result_file="r/$tname.result"
- echo $tname > $CURRENT_TEST
- SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0 \& \( $tname : federated \) = 0`
- NDBCLUSTER_TEST=`$EXPR \( $tname : '.*ndb.*' \) != 0`
- if [ "x$USE_NDBCLUSTER_ALL" = "x1" ] ; then
- NDBCLUSTER_TEST=1
- fi
- if [ "x$USE_NDBCLUSTER_ONLY" = "x1" -a "x$NDBCLUSTER_TEST" != "x1" ] ; then
- skip_test $tname
- return
- fi
- if [ "$USE_MANAGER" = 1 ] ; then
- many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)`
- fi
- if $EXPR "$tname" '<' "$START_FROM" > /dev/null ; then
- #skip_test $tname
- return
- fi
-
- if [ "$SKIP_TEST" ] ; then
- if $EXPR \( "$tname" : "$SKIP_TEST" \) > /dev/null ; then
- skip_test $tname
- return
- fi
- fi
-
- if [ "$DO_TEST" ] ; then
- if $EXPR \( "$tname" : "$DO_TEST" \) > /dev/null ; then
- : #empty command to keep some shells happy
- else
- #skip_test $tname
- return
- fi
- fi
-
- if [ x${NO_SLAVE}x$SKIP_SLAVE = x1x0 ] ; then
- skip_test $tname
- return
- fi
-
-# if [ -f "$TESTDIR/$tname.disabled" ]
-# then
-# comment=`$CAT $TESTDIR/$tname.disabled`;
-# disable_test $tname "$comment"
-# return
-# fi
- if [ -f "$TESTDIR/disabled.def" ] ; then
- comment=`$GREP "^$tname *: *" $TESTDIR/disabled.def`;
- if [ -n "$comment" ]
- then
- comment=`echo $comment | sed 's/^[^:]*: *//'`
- disable_test $tname "$comment"
- return
- fi
- fi
-
- if [ "x$USE_EMBEDDED_SERVER" != "x1" ] ; then
- # Stop all slave threads, so that we don't have useless reconnection
- # attempts and error messages in case the slave and master servers restart.
- stop_slave_threads
- stop_slave_threads 1
- stop_slave_threads 2
- fi
-
- # FIXME temporary solution, we will get a new C version of this
- # script soon anyway so it is not worth it spending the time
- if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then
- for t in \
- "init_connect" \
- "init_file"
- do
- if [ "$tname" = "$t" ] ; then
- skip_test $tname
- return
- fi
- done
- fi
-
- if [ $USE_RUNNING_SERVER -eq 0 ] ;
- then
- if [ -f $master_opt_file ] ;
- then
- EXTRA_MASTER_OPT=`$CAT $master_opt_file | $SED -e "s;\\$MYSQL_TEST_DIR;$MYSQL_TEST_DIR;"`
- case "$EXTRA_MASTER_OPT" in
- --timezone=*)
- TZ=`$ECHO "$EXTRA_MASTER_OPT" | $SED -e "s;--timezone=;;"`
- export TZ
- # Note that this must be set to space, not "" for test-reset to work
- EXTRA_MASTER_OPT=" "
- ;;
- --result-file=*)
- result_file=`$ECHO "$EXTRA_MASTER_OPT" | $SED -e "s;--result-file=;;"`
- result_file="r/$result_file.result"
- # Note that this must be set to space, not "" for test-reset to work
- EXTRA_MASTER_OPT=" "
- ;;
- --force-restart)
- # Note that this must be set to space, not "" for test-reset to work
- EXTRA_MASTER_OPT=" "
- ;;
- esac
- stop_master
- stop_master 1
-
- # only stop the cluster if this test will not use cluster
- if [ x$NDBCLUSTER_TEST != x1 ] ;
- then
- stop_ndbcluster
- fi
-
- report_current_test $tname
- USING_NDBCLUSTER=$NDBCLUSTER_TEST
- # start_ndbcluster knows if cluster is already started
- start_ndbcluster
- start_master
- if [ x$USING_NDBCLUSTER = x1 -a -z "$DO_BENCH" -a -z "$DO_STRESS" ] ; then
- echo "CURRENT_TEST: $tname" >> $MASTER_MYERR"1"
- start_master 1
- fi
- TZ=$MY_TZ; export TZ
- else
- # If we had extra master opts to the previous run
- # or there is no master running (FIXME strange.....)
- # or there is a master init script
- if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] || \
- [ -f $master_init_script ] || \
- [ -n "$USE_NDBCLUSTER" -a x$NDBCLUSTER_TEST != x$USING_NDBCLUSTER ]
- then
- EXTRA_MASTER_OPT=""
- stop_master
- stop_master 1
-
- # only stop the cluster if this test will not use cluster
- if [ x$NDBCLUSTER_TEST != x1 ] ;
- then
- stop_ndbcluster
- fi
-
- report_current_test $tname
- USING_NDBCLUSTER=$NDBCLUSTER_TEST
- # start_ndbcluster knows if cluster is already started
- start_ndbcluster
- start_master
- if [ x$USING_NDBCLUSTER = x1 -a -z "$DO_BENCH" -a -z "$DO_STRESS" ] ; then
- echo "CURRENT_TEST: $tname" >> $MASTER_MYERR"1"
- start_master 1
- fi
- else
- report_current_test $tname
- fi
- fi
-
- # We never start a slave if embedded server is used
- if [ "x$USE_EMBEDDED_SERVER" != "x1" ] ; then
- do_slave_restart=0
- if [ -f $slave_opt_file ] ;
- then
- EXTRA_SLAVE_OPT=`$CAT $slave_opt_file | $SED -e "s;\\$MYSQL_TEST_DIR;$MYSQL_TEST_DIR;"`
- do_slave_restart=1
- else
- if [ ! -z "$EXTRA_SLAVE_OPT" ] || [ x$SLAVE_RUNNING != x1 ] ;
- then
- EXTRA_SLAVE_OPT=""
- do_slave_restart=1
- fi
- fi
-
- if [ -f $slave_master_info_file ] ; then
- SLAVE_MASTER_INFO=`$CAT $slave_master_info_file`
- do_slave_restart=1
- else
- if [ ! -z "$SLAVE_MASTER_INFO" ] || [ x$SLAVE_RUNNING != x1 ] ;
- then
- SLAVE_MASTER_INFO=""
- do_slave_restart=1
- fi
- fi
-
- USING_NDBCLUSTER=$NDBCLUSTER_TEST
- if [ -n "$USE_NDBCLUSTER_SLAVE_OPT" ] ; then
- if [ x$USING_NDBCLUSTER != x1 ] ; then
- do_slave_restart=1
- fi
- else
- if [ x$USING_NDBCLUSTER = x1 ] ; then
- do_slave_restart=1
- fi
- fi
-
-
- if [ x$do_slave_restart = x1 ] ; then
- stop_slave
- echo "CURRENT_TEST: $tname" >> $SLAVE_MYERR
- start_slave
- else
- echo "CURRENT_TEST: $tname" >> $SLAVE_MYERR
- fi
- if [ x$many_slaves = x1 ]; then
- start_slave 1
- start_slave 2
- fi
- fi
- fi
-
- if [ "x$START_AND_EXIT" = "x1" ] ; then
- echo "Servers started, exiting"
- exit
- fi
-
- cd $MYSQL_TEST_DIR
-
- if [ -f $tf ] ; then
- $RM -f r/$tname.*reject
- mysql_test_args="-R $result_file $EXTRA_MYSQL_TEST_OPT"
- if [ -z "$DO_CLIENT_GDB" ] ; then
- `$VALGRIND_MYSQLTEST $MYSQL_TEST $mysql_test_args < $tf 2> $TIMEFILE`;
- else
- do_gdb_test "$mysql_test_args" "$tf"
- fi
-
- res=$?
-
- # Save the testcase log to mysqltest log file
- echo "CURRENT_TEST: $tname" >> $MYSQLTEST_LOG
- cat $TIMEFILE >> $MYSQLTEST_LOG
-
- pname=`$ECHO "$tname "|$CUT -c 1-24`
- RES="$pname"
-
- if [ x$many_slaves = x1 ] ; then
- stop_slave 1
- stop_slave 2
- fi
-
- if [ $res = 0 ]; then
- total_inc
- pass_inc
- TIMER=""
- if [ x$USE_TIMER = x1 -a -f "$MY_LOG_DIR/timer" ]; then
- TIMER=`cat $MY_LOG_DIR/timer`
- TIMER=`$PRINTF "%13s" $TIMER`
- fi
- $ECHO "$RES$RES_SPACE [ pass ] $TIMER"
- else
- # why the following ``if'' ? That is why res==1 is special ?
- if [ $res = 62 ]; then
- skip_inc
- $ECHO "$RES$RES_SPACE [ skipped ]"
- else
- if [ $res -ne 1 ]; then
- $ECHO "mysqltest returned unexpected code $res, it has probably crashed" >> $TIMEFILE
- fi
- total_inc
- fail_inc
- $ECHO "$RES$RES_SPACE [ fail ]"
- $ECHO
- error_is
- show_failed_diff $tname
- $ECHO
- if [ x$FORCE != x1 ] ; then
- $ECHO "Aborting: $tname failed in $TEST_MODE mode. To continue, re-run with '--force'."
- $ECHO
- if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && \
- [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ]
- then
- mysql_stop
- fi
- exit 1
- fi
- FAILED_CASES="$FAILED_CASES $tname"
- if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && \
- [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ]
- then
- mysql_restart
- fi
- fi
- fi
- fi
-}
-
-run_stress_test()
-{
-
- STRESS_BASEDIR="$MYSQL_TEST_DIR/var/stress"
-
- #Clean-up old stress test basedir
- if [ -d $STRESS_BASEDIR ] ; then
- $RM -rf $STRESS_BASEDIR
- fi
- #Create stress test basedir
- mkdir $STRESS_BASEDIR
-
- if [ "$STRESS_SUITE" != "main" -a "$STRESS_SUITE" != "default" ] ; then
- STRESS_SUITE_DIR="$MYSQL_TEST_DIR/suite/$STRESS_SUITE"
- else
- STRESS_SUITE_DIR="$MYSQL_TEST_DIR"
- fi
-
- if [ -d "$STRESS_SUITE_DIR" ] ; then
- STRESS_SUITE_T_DIR="$STRESS_SUITE_DIR/t"
- STRESS_SUITE_R_DIR="$STRESS_SUITE_DIR/r"
- #FIXME: check that dirs above are exist
- else
- echo "Directory $STRESS_SUITE_DIR with test suite doesn't exists. Abort stress testing"
- exit 1
- fi
-
- if [ -n "$STRESS_TEST" ] ; then
- STRESS_TEST_FILE="$STRESS_BASEDIR/stress_tests.txt"
- echo $STRESS_TEST > $STRESS_TEST_FILE
- elif [ -n "$STRESS_TEST_FILE" ] ; then
- STRESS_TEST_FILE="$STRESS_SUITE_DIR/$STRESS_TEST_FILE"
- if [ ! -f "$STRESS_TEST_FILE" ] ; then
- echo "Specified file $STRESS_TEST_FILE with list of tests does not exist"
- echo "Please ensure that file exists and has proper permissions"
- exit 1
- fi
- else
- STRESS_TEST_FILE="$STRESS_SUITE_DIR/stress_tests.txt"
- if [ ! -f "$STRESS_TEST_FILE" ] ; then
- echo "Default file $STRESS_TEST_FILE with list of tests does not exist."
- echo "Please use --stress-test-file option to specify custom one or you can"
- echo "just specify name of test for testing as last argument in command line"
- exit 1
- fi
- fi
-
- if [ -n "$STRESS_INIT_FILE" ] ; then
- STRESS_INIT_FILE="$STRESS_SUITE_DIR/$STRESS_INIT_FILE"
- if [ ! -f "$STRESS_INIT_FILE" ] ; then
- echo "Specified file $STRESS_INIT_FILE with list of tests doesn't exist."
- echo "Please ensure that file exists and has proper permissions"
- exit 1
- fi
- else
- STRESS_INIT_FILE="$STRESS_SUITE_DIR/stress_init.txt"
- #Check for default init file
- if [ ! -f "$STRESS_INIT_FILE" ] ; then
- STRESS_INIT_FILE=""
- fi
- fi
-
- if [ "$STRESS_MODE" != "random" -a "$STRESS_MODE" != "seq" ] ; then
- echo "You specified wrong mode '$STRESS_MODE' for stress test."
- echo "Correct values are 'random' or 'seq'"
- exit 1
- fi
-
- STRESS_TEST_ARGS="--server-socket=$MASTER_MYSOCK \
- --server-user=$DBUSER \
- --server-database=$DB \
- --stress-suite-basedir=$MYSQL_TEST_DIR \
- --suite=$STRESS_SUITE \
- --stress-tests-file=$STRESS_TEST_FILE \
- --stress-basedir=$STRESS_BASEDIR \
- --server-logs-dir=$STRESS_BASEDIR \
- --stress-mode=$STRESS_MODE \
- --mysqltest=$CLIENT_BINDIR/mysqltest \
- --threads=$STRESS_THREADS \
- --verbose \
- --cleanup \
- --log-error-details \
- --abort-on-error"
-
- if [ -n "$STRESS_INIT_FILE" ] ; then
- STRESS_TEST_ARGS="$STRESS_TEST_ARGS --stress-init-file=$STRESS_INIT_FILE"
- fi
-
- if [ -z "$STRESS_LOOP_COUNT" -a -z "$STRESS_TEST_COUNT" -a
- -z "$STRESS_TEST_DURATION" ] ; then
-
- #Limit stress testing with 20 loops in case when any limit parameter
- #was specified
- STRESS_TEST_COUNT=20
- fi
-
- if [ -n "$STRESS_LOOP_COUNT" ] ; then
- STRESS_TEST_ARGS="$STRESS_TEST_ARGS --loop-count=$STRESS_LOOP_COUNT"
- fi
-
- if [ -n "$STRESS_TEST_COUNT" ] ; then
- STRESS_TEST_ARGS="$STRESS_TEST_ARGS --test-count=$STRESS_TEST_COUNT"
- fi
-
- if [ -n "$STRESS_TEST_DURATION" ] ; then
- STRESS_TEST_ARGS="$STRESS_TEST_ARGS --test-duration=$STRESS_TEST_DURATION"
- fi
-
- echo "Stress test related variables:"
- echo "TESTS - $1"
- echo "STRESS - $DO_STRESS"
- echo "STRESS_SUITE - $STRESS_SUITE"
- echo "STRESS_TEST_FILE - $STRESS_TEST_FILE"
- echo "STRESS_INIT_FILE - $STRESS_INIT_FILE"
- echo "STRESS_THREADS - $STRESS_THREADS"
- echo "STRESS_MODE - $STRESS_MODE"
- echo "STRESS_TEST_COUNT - $STRESS_TEST_COUNT"
- echo "STRESS_LOOP_COUNT - $STRESS_LOOP_COUNT"
- echo "STRESS_TEST_DURATION - $STRESS_TEST_DURATION"
-
- #echo "$STRESS_TEST_ARGS";
- #Run stress test
- $MYSQL_TEST_DIR/mysql-stress-test.pl $STRESS_TEST_ARGS
-
-
-}
-
-######################################################################
-# Main script starts here
-######################################################################
-
-[ "$DO_GCOV" -a ! -x "$GCOV" ] && error "No gcov found"
-
-[ "$DO_GCOV" ] && gcov_prepare
-[ "$DO_GPROF" ] && gprof_prepare
-
-if [ $USE_RUNNING_SERVER -eq 0 ]
-then
- if [ -z "$FAST_START" ]
- then
- # Ensure that no old mysqld test servers are running
- $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
- $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK1 -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
- $MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
- $MYSQLADMIN --no-defaults --host=$hostname --port=$MASTER_MYPORT --protocol=tcp -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
- $MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=`expr $MASTER_MYPORT + 1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
- $MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=$SLAVE_MYPORT -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
- $MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=`expr $SLAVE_MYPORT + 1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
- sleep_until_file_deleted 0 $MASTER_MYPID
- sleep_until_file_deleted 0 $MASTER_MYPID"1"
- sleep_until_file_deleted 0 $SLAVE_MYPID
- else
- rm $MASTER_MYPID $MASTER_MYPID"1" $SLAVE_MYPID
- fi
-
- # just to force stopping anything from previous runs
- USE_NDBCLUSTER_OPT=$USE_NDBCLUSTER
- stop_ndbcluster
-
- # Remove files that can cause problems
- $RM -rf $MYSQL_TEST_DIR/var/ndbcluster
- $RM -rf $MYSQL_TEST_DIR/var/tmp/snapshot*
- $RM -rf $MYSQL_TEST_DIR/var/run/* $MYSQL_TEST_DIR/var/tmp/*
-
- # Remove old berkeley db log files that can confuse the server
- $RM -f $MASTER_MYDDIR/log.*
- $RM -f $MASTER_MYDDIR"1"/log.*
-
- # Remove old log and reject files
- $RM -f r/*.reject r/*.progress r/*.log r/*.warnings
-
- wait_for_master=$SLEEP_TIME_FOR_FIRST_MASTER
- wait_for_slave=$SLEEP_TIME_FOR_FIRST_SLAVE
- $ECHO "Installing Test Databases"
- mysql_install_db
-
- if [ -n "$1" -a `expr "X$*" : '.*ndb'` -eq 0 ]
- then
- USING_NDBCLUSTER=0
- USE_NDBCLUSTER_OPT=
- fi
-
- mysql_start
- $ECHO "Loading Standard Test Databases"
- mysql_loadstd
-fi
-
-$ECHO "Starting Tests"
-
-# Some test cases need USE_RUNNING_SERVER
-export USE_RUNNING_SERVER
-
-#
-# This can probably be deleted
-#
-if [ "$DO_BENCH" = 1 ]
-then
- start_master
-
- if [ "$DO_SMALL_BENCH" = 1 ]
- then
- EXTRA_BENCH_ARGS="--small-test --small-tables"
- fi
-
- if [ x$USING_NDBCLUSTER = x1 ]
- then
- EXTRA_BENCH_ARGS="--create-options=TYPE=ndb $EXTRA_BENCH_ARGS"
- fi
-
- BENCHDIR=$BASEDIR/sql-bench/
- savedir=`pwd`
- cd $BENCHDIR
- if [ -z "$1" ]
- then
- ./run-all-tests --socket=$MASTER_MYSOCK --user=root $EXTRA_BENCH_ARGS --log
- else
- if [ -x "./$1" ]
- then
- ./$1 --socket=$MASTER_MYSOCK --user=root $EXTRA_BENCH_ARGS
- else
- echo "benchmark $1 not found"
- fi
- fi
- cd $savedir
- mysql_stop
- exit
-fi
-
-#
-# Stress testing
-#
-if [ "$DO_STRESS" = 1 ]
-then
-
- if [ -n "$1" ] ; then
- STRESS_TEST="$1";
- fi
-
- if [ $USE_RUNNING_SERVER -eq 0 ] ; then
- start_master
- fi
-
- run_stress_test
-
- if [ $USE_RUNNING_SERVER -eq 0 ] ; then
- mysql_stop
- fi
-
- exit
-
-fi
-
-
-$ECHO
-if [ x$USE_TIMER = x1 ] ; then
-$ECHO "TEST RESULT TIME (ms)"
-else
-$ECHO "TEST RESULT"
-fi
-$ECHO $DASH72
-
-if [ -z "$1" ] ;
-then
- if [ x$RECORD = x1 ]; then
- $ECHO "Will not run in record mode without a specific test case."
- else
- for tf in $TESTDIR/*.$TESTSUFFIX
- do
- run_testcase $tf
- done
- $RM -f $TIMEFILE # Remove for full test
- fi
-else
- while [ ! -z "$1" ]; do
- tname=`$BASENAME $1 .test`
- tf=$TESTDIR/$tname.$TESTSUFFIX
- if [ -f $tf ] ; then
- run_testcase $tf
- else
- $ECHO "Test case $tf does not exist."
- fi
- shift
- done
-fi
-
-$ECHO $DASH72
-$ECHO
-
-if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && [ -z "$DO_DDD" ]
-then
- mysql_stop
-fi
-report_stats
-$ECHO
-
-[ "$DO_GCOV" ] && gcov_collect # collect coverage information
-[ "$DO_GPROF" ] && gprof_collect # collect coverage information
-
-if [ $TOT_FAIL -ne 0 ]; then
- $ECHO "mysql-test-run in $TEST_MODE mode: *** Failing the test(s):$FAILED_CASES"
- $ECHO
- exit 1
-fi
-if [ $GOT_WARNINGS -ne 0 ]; then
- exit 1
-fi
-exit 0
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index b342421ca2e..ba426446075 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -6,124 +6,108 @@
#
# mysql-test-run.pl
#
-# Tool used for executing a suite of .test file
+# Tool used for executing a suite of .test files
#
# See the "MySQL Test framework manual" for more information
# http://dev.mysql.com/doc/mysqltest/en/index.html
#
-# Please keep the test framework tools identical in all versions!
#
##############################################################################
-#
-# Coding style directions for this perl script
-#
-# - To make this Perl script easy to alter even for those that not
-# code Perl that often, keeep the coding style as close as possible to
-# the C/C++ MySQL coding standard.
-#
-# - All lists of arguments to send to commands are Perl lists/arrays,
-# not strings we append args to. Within reason, most string
-# concatenation for arguments should be avoided.
-#
-# - Functions defined in the main program are not to be prefixed,
-# functions in "library files" are to be prefixed with "mtr_" (for
-# Mysql-Test-Run). There are some exceptions, code that fits best in
-# the main program, but are put into separate files to avoid
-# clutter, may be without prefix.
-#
-# - All stat/opendir/-f/ is to be kept in collect_test_cases(). It
-# will create a struct that the rest of the program can use to get
-# the information. This separates the "find information" from the
-# "do the work" and makes the program more easy to maintain.
-#
-# - The rule when it comes to the logic of this program is
-#
-# command_line_setup() - is to handle the logic between flags
-# collect_test_cases() - is to do its best to select what tests
-# to run, dig out options, if needs restart etc.
-# run_testcase() - is to run a single testcase, and follow the
-# logic set in both above. No, or rare file
-# system operations. If a test seems complex,
-# it should probably not be here.
-#
-# A nice way to trace the execution of this script while debugging
-# is to use the Devel::Trace package found at
-# "http://www.plover.com/~mjd/perl/Trace/" and run this script like
-# "perl -d:Trace mysql-test-run.pl"
-#
+use strict;
+use warnings;
-use lib "lib/";
+BEGIN {
+ # Check that mysql-test-run.pl is started from mysql-test/
+ unless ( -f "mysql-test-run.pl" )
+ {
+ print "**** ERROR **** ",
+ "You must start mysql-test-run from the mysql-test/ directory\n";
+ exit(1);
+ }
+ # Check that lib exist
+ unless ( -d "lib/" )
+ {
+ print "**** ERROR **** ",
+ "Could not find the lib/ directory \n";
+ exit(1);
+ }
+}
-$Devel::Trace::TRACE= 0; # Don't trace boring init stuff
+BEGIN {
+ # Check backward compatibility support
+ # By setting the environment variable MTR_VERSION
+ # it's possible to use a previous version of
+ # mysql-test-run.pl
+ my $version= $ENV{MTR_VERSION} || 2;
+ if ( $version == 1 )
+ {
+ print "=======================================================\n";
+ print " WARNING: Using mysql-test-run.pl version 1! \n";
+ print "=======================================================\n";
+ # Should use exec() here on *nix but this appears not to work on Windows
+ exit(system($^X, "lib/v1/mysql-test-run.pl", @ARGV) >> 8);
+ }
+ elsif ( $version == 2 )
+ {
+ # This is the current version, just continue
+ ;
+ }
+ else
+ {
+ print "ERROR: Version $version of mysql-test-run does not exist!\n";
+ exit(1);
+ }
+}
+
+use lib "lib";
-#require 5.6.1;
-use File::Path;
-use File::Basename;
-use File::Copy;
-use File::Temp qw /tempdir/;
-use File::Spec::Functions qw /splitdir/;
use Cwd;
use Getopt::Long;
-use IO::Socket;
+use My::File::Path; # Patched version of File::Path
+use File::Basename;
+use File::Copy;
+use File::Find;
+use File::Temp qw / tempdir /;
+use File::Spec::Functions qw / splitdir /;
+use My::Platform;
+use My::SafeProcess;
+use My::ConfigFactory;
+use My::Options;
+use My::Find;
+use My::SysInfo;
+use My::CoreDump;
+use mtr_cases;
+use mtr_report;
+use mtr_match;
+use mtr_unique;
use IO::Socket::INET;
-use strict;
-use warnings;
-
-select(STDOUT);
-$| = 1; # Automatically flush STDOUT
+use IO::Select;
-our $glob_win32_perl= ($^O eq "MSWin32"); # ActiveState Win32 Perl
-our $glob_cygwin_perl= ($^O eq "cygwin"); # Cygwin Perl
-our $glob_win32= ($glob_win32_perl or $glob_cygwin_perl);
-our $glob_netware= ($^O eq "NetWare"); # NetWare
-
-require "lib/mtr_cases.pl";
-require "lib/mtr_im.pl";
require "lib/mtr_process.pl";
-require "lib/mtr_timer.pl";
require "lib/mtr_io.pl";
require "lib/mtr_gcov.pl";
-require "lib/mtr_gprof.pl";
-require "lib/mtr_report.pl";
-require "lib/mtr_match.pl";
require "lib/mtr_misc.pl";
-require "lib/mtr_stress.pl";
-require "lib/mtr_unique.pl";
-
-$Devel::Trace::TRACE= 1;
-##############################################################################
-#
-# Default settings
-#
-##############################################################################
+$SIG{INT}= sub { mtr_error("Got ^C signal"); };
-# Misc global variables
our $mysql_version_id;
-our $glob_mysql_test_dir= undef;
-our $glob_mysql_bench_dir= undef;
-our $glob_scriptname= undef;
-our $glob_timers= undef;
-our $glob_use_embedded_server= 0;
-our @glob_test_mode;
-
-our $glob_basedir;
+our $glob_mysql_test_dir;
+our $basedir;
our $path_charsetsdir;
our $path_client_bindir;
our $path_client_libdir;
-our $path_share;
our $path_language;
-our $path_timefile;
-our $path_snapshot;
-our $path_mysqltest_log;
-our $path_current_test_log;
-our $path_my_basedir;
-our $opt_vardir; # A path but set directly on cmd line
-our $path_vardir_trace; # unix formatted opt_vardir for trace files
-our $opt_tmpdir; # A path but set directly on cmd line
+our $path_current_testlog;
+our $path_testlog;
+
+our $default_vardir;
+our $opt_vardir; # Path to use for var/ dir
+my $path_vardir_trace; # unix formatted opt_vardir for trace files
+my $opt_tmpdir; # Path to use for tmp/ dir
+my $path_config_file; # The generated config file, var/my.cnf
# Visual Studio produces executables in different sub-directories based on the
# configuration used to build them. To make life easier, an environment
@@ -131,70 +115,40 @@ our $opt_tmpdir; # A path but set directly on cmd line
# executables will be used by the test suite.
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
-our $default_vardir;
+my $DEFAULT_SUITES= "main,binlog,federated,rpl,rpl_ndb,ndb";
+my $opt_suites;
-our $opt_usage;
-our $opt_suites;
-our $opt_suites_default= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run
-our $opt_script_debug= 0; # Script debugging, enable with --script-debug
our $opt_verbose= 0; # Verbose output, enable with --verbose
-
-our $exe_master_mysqld;
our $exe_mysql;
our $exe_mysqladmin;
-our $exe_mysql_upgrade;
-our $exe_mysqlbinlog;
-our $exe_mysql_client_test;
-our $exe_bug25714;
-our $exe_mysqld;
-our $exe_mysqlcheck;
-our $exe_mysqldump;
-our $exe_mysqlslap;
-our $exe_mysqlimport;
-our $exe_mysqlshow;
-our $exe_mysql_fix_system_tables;
-our $file_mysql_fix_privilege_tables;
our $exe_mysqltest;
-our $exe_ndbd;
-our $exe_ndb_mgmd;
-our $exe_slave_mysqld;
-our $exe_im;
-our $exe_my_print_defaults;
-our $exe_perror;
-our $lib_udf_example;
-our $lib_example_plugin;
our $exe_libtool;
-our $opt_bench= 0;
-our $opt_small_bench= 0;
our $opt_big_test= 0;
our @opt_combinations;
-our $opt_skip_combination;
our @opt_extra_mysqld_opt;
-our $opt_compress;
-our $opt_ssl;
-our $opt_skip_ssl;
-our $opt_ssl_supported;
-our $opt_ps_protocol;
-our $opt_sp_protocol;
-our $opt_cursor_protocol;
-our $opt_view_protocol;
+my $opt_compress;
+my $opt_ssl;
+my $opt_skip_ssl;
+my $opt_ssl_supported;
+my $opt_ps_protocol;
+my $opt_sp_protocol;
+my $opt_cursor_protocol;
+my $opt_view_protocol;
our $opt_debug;
-our $opt_do_test;
our @opt_cases; # The test cases names in argv
our $opt_embedded_server;
-our $opt_extern= 0;
-our $opt_socket;
+# Options used when connecting to an already running server
+my %opts_extern;
+sub using_extern { return (keys %opts_extern > 0);};
-our $opt_fast;
+our $opt_fast= 0;
our $opt_force;
-our $opt_reorder= 0;
-our $opt_enable_disabled;
our $opt_mem= $ENV{'MTR_MEM'};
our $opt_gcov;
@@ -209,59 +163,41 @@ our $opt_client_ddd;
our $opt_manual_gdb;
our $opt_manual_ddd;
our $opt_manual_debug;
-our $opt_mtr_build_thread=0;
our $opt_debugger;
our $opt_client_debugger;
-our $opt_gprof;
-our $opt_gprof_dir;
-our $opt_gprof_master;
-our $opt_gprof_slave;
-
-our $master;
-our $slave;
-our $clusters;
-
-our $instance_manager;
+my $config; # The currently running config
+my $current_config_name; # The currently running config file template
-our $opt_master_myport;
-our $opt_slave_myport;
-our $im_port;
-our $im_mysqld1_port;
-our $im_mysqld2_port;
-our $opt_ndbcluster_port;
-our $opt_ndbconnectstring;
-our $opt_ndbcluster_port_slave;
-our $opt_ndbconnectstring_slave;
+my $baseport;
+my $opt_build_thread= $ENV{'MTR_BUILD_THREAD'} || "auto";
-our $opt_record;
+my $opt_record;
my $opt_report_features;
-our $opt_check_testcases;
-our $opt_mark_progress;
-our $opt_skip_rpl;
-our $max_slave_num= 0;
-our $max_master_num= 1;
-our $use_innodb;
-our $opt_skip_test;
-our $opt_skip_im;
+our $opt_check_testcases= 1;
+my $opt_mark_progress;
-our $opt_sleep;
+my $opt_sleep;
-our $opt_testcase_timeout;
-our $opt_suite_timeout;
-my $default_testcase_timeout= 15; # 15 min max
-my $default_suite_timeout= 300; # 5 hours max
+my $opt_testcase_timeout= 15; # minutes
+my $opt_suite_timeout = 300; # minutes
+my $opt_shutdown_timeout= 10; # seconds
+my $opt_start_timeout = 180; # seconds
-our $opt_start_and_exit;
-our $opt_start_dirty;
-our $opt_start_from;
+sub testcase_timeout { return $opt_testcase_timeout * 60; };
+sub suite_timeout { return $opt_suite_timeout * 60; };
+sub check_timeout { return $opt_testcase_timeout * 6; };
-our $opt_strace_client;
+my $opt_start;
+my $opt_start_dirty;
+my $opt_repeat= 1;
+my $opt_retry= 3;
+my $opt_retry_failure= 2;
-our $opt_timer= 1;
+my $opt_strace_client;
-our $opt_user;
+our $opt_user = "root";
my $opt_valgrind= 0;
my $opt_valgrind_mysqld= 0;
@@ -271,283 +207,558 @@ my @valgrind_args;
my $opt_valgrind_path;
my $opt_callgrind;
-our $opt_stress= "";
-our $opt_stress_suite= "main";
-our $opt_stress_mode= "random";
-our $opt_stress_threads= 5;
-our $opt_stress_test_count= 0;
-our $opt_stress_loop_count= 0;
-our $opt_stress_test_duration= 0;
-our $opt_stress_init_file= "";
-our $opt_stress_test_file= "";
-
-our $opt_warnings;
+our $opt_warnings= 1;
our $opt_skip_ndbcluster= 0;
-our $opt_skip_ndbcluster_slave= 0;
-our $opt_with_ndbcluster= 0;
-our $opt_with_ndbcluster_only= 0;
-our $glob_ndbcluster_supported= 0;
-our $opt_ndb_extra_test= 0;
-our $opt_skip_master_binlog= 0;
-our $opt_skip_slave_binlog= 0;
-
-our $exe_ndb_mgm;
-our $exe_ndb_waiter;
-our $path_ndb_tools_dir;
-our $path_ndb_examples_dir;
-our $exe_ndb_example;
-our $path_ndb_testrun_log;
-
-our $path_sql_dir;
-
-our @data_dir_lst;
-
-our $used_binlog_format;
-our $used_default_engine;
+
+my $exe_ndbd;
+my $exe_ndb_mgmd;
+my $exe_ndb_waiter;
+
our $debug_compiled_binaries;
our %mysqld_variables;
my $source_dist= 0;
-our $opt_max_save_core= 5;
-my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far.
+my $opt_max_save_core= $ENV{MTR_MAX_SAVE_CORE} || 5;
+my $opt_max_save_datadir= $ENV{MTR_MAX_SAVE_DATADIR} || 20;
+my $opt_max_test_fail= $ENV{MTR_MAX_TEST_FAIL} || 10;
-######################################################################
-#
-# Function declarations
-#
-######################################################################
-
-sub main ();
-sub initial_setup ();
-sub command_line_setup ();
-sub set_mtr_build_thread_ports($);
-sub datadir_list_setup ();
-sub executable_setup ();
-sub environment_setup ();
-sub kill_running_servers ();
-sub remove_stale_vardir ();
-sub setup_vardir ();
-sub check_ssl_support ($);
-sub check_running_as_root();
-sub check_ndbcluster_support ($);
-sub rm_ndbcluster_tables ($);
-sub ndbcluster_start_install ($);
-sub ndbcluster_start ($$);
-sub ndbcluster_wait_started ($$);
-sub mysqld_wait_started($);
-sub run_benchmarks ($);
-sub initialize_servers ();
-sub mysql_install_db ();
-sub install_db ($$);
-sub copy_install_db ($$);
-sub run_testcase ($);
-sub run_testcase_stop_servers ($$$);
-sub run_testcase_start_servers ($);
-sub run_testcase_check_skip_test($);
-sub report_failure_and_restart ($);
-sub do_before_start_master ($);
-sub do_before_start_slave ($);
-sub ndbd_start ($$$);
-sub ndb_mgmd_start ($);
-sub mysqld_start ($$$);
-sub mysqld_arguments ($$$$);
-sub stop_all_servers ();
-sub run_mysqltest ($);
-sub usage ($);
-
-
-######################################################################
-#
-# Main program
-#
-######################################################################
+my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
+
+select(STDOUT);
+$| = 1; # Automatically flush STDOUT
main();
-sub main () {
+
+sub main {
+ # Default, verbosity on
+ report_option('verbose', 0);
+
+ # This is needed for test log evaluation in "gen-build-status-page"
+ # in all cases where the calling tool does not log the commands
+ # directly before it executes them, like "make test-force-pl" in RPM builds.
+ mtr_report("Logging: $0 ", join(" ", @ARGV));
command_line_setup();
- check_ndbcluster_support(\%mysqld_variables);
- check_ssl_support(\%mysqld_variables);
- check_debug_support(\%mysqld_variables);
+ if ( $opt_gcov ) {
+ gcov_prepare($basedir);
+ }
+
+ if (!$opt_suites) {
+ $opt_suites= $DEFAULT_SUITES;
+
+ # Check for any extra suites to enable based on the path name
+ my %extra_suites=
+ (
+ "mysql-5.1-new-ndb" => "ndb_team",
+ "mysql-5.1-new-ndb-merge" => "ndb_team",
+ "mysql-5.1-telco-6.2" => "ndb_team",
+ "mysql-5.1-telco-6.2-merge" => "ndb_team",
+ "mysql-5.1-telco-6.3" => "ndb_team",
+ "mysql-6.0-ndb" => "ndb_team",
+ );
+
+ foreach my $dir ( reverse splitdir($basedir) ) {
+ my $extra_suite= $extra_suites{$dir};
+ if (defined $extra_suite) {
+ mtr_report("Found extra suite: $extra_suite");
+ $opt_suites= "$extra_suite,$opt_suites";
+ last;
+ }
+ }
+ }
- executable_setup();
+ mtr_report("Collecting tests...");
+ my $tests= collect_test_cases($opt_suites, \@opt_cases);
- environment_setup();
- signal_setup();
+ if ( $opt_report_features ) {
+ # Put "report features" as the first test to run
+ my $tinfo = My::Test->new
+ (
+ name => 'report_features',
+ # No result_file => Prints result
+ path => 'include/report-features.test',
+ template_path => "include/default_my.cnf",
+ master_opt => [],
+ slave_opt => [],
+ );
+ unshift(@$tests, $tinfo);
+ }
- if ( $opt_gcov )
- {
- gcov_prepare();
+ print "vardir: $opt_vardir\n";
+ initialize_servers();
+
+ #######################################################################
+ my $num_tests= @$tests;
+ if ( not defined $opt_parallel ) {
+ # Try to find a suitable value for number of workers
+ my $sys_info= My::SysInfo->new();
+
+ $opt_parallel= $sys_info->num_cpus();
+ for my $limit (2000, 1500, 1000, 500){
+ $opt_parallel-- if ($sys_info->min_bogomips() < $limit);
+ }
+ $opt_parallel= 8 if ($opt_parallel > 8);
+ $opt_parallel= $num_tests if ($opt_parallel > $num_tests);
+ $opt_parallel= 1 if (IS_WINDOWS and $sys_info->isvm());
+ $opt_parallel= 1 if ($opt_parallel < 1);
+ mtr_report("Using parallel: $opt_parallel");
+ }
+
+ # Create server socket on any free port
+ my $server = new IO::Socket::INET
+ (
+ LocalAddr => 'localhost',
+ Proto => 'tcp',
+ Listen => $opt_parallel,
+ );
+ mtr_error("Could not create testcase server port: $!") unless $server;
+ my $server_port = $server->sockport();
+ mtr_report("Using server port $server_port");
+
+ # Create child processes
+ my %children;
+ for my $child_num (1..$opt_parallel){
+ my $child_pid= My::SafeProcess::Base::_safe_fork();
+ if ($child_pid == 0){
+ $server= undef; # Close the server port in child
+ $tests= {}; # Don't need the tests list in child
+
+ # Use subdir of var and tmp unless only one worker
+ if ($opt_parallel > 1) {
+ set_vardir("$opt_vardir/$child_num");
+ $opt_tmpdir= "$opt_tmpdir/$child_num";
+ }
+
+ run_worker($server_port, $child_num);
+ exit(1);
+ }
+
+ $children{$child_pid}= 1;
}
+ #######################################################################
+
+ mtr_report();
+ mtr_print_thick_line();
+ mtr_print_header();
- if ( $opt_gprof )
+ my $completed= run_test_server($server, $tests, $opt_parallel);
+
+ # Send Ctrl-C to any children still running
+ kill("INT", keys(%children));
+
+ # Wait for childs to exit
+ foreach my $pid (keys %children)
{
- gprof_prepare();
+ my $ret_pid= waitpid($pid, 0);
+ if ($ret_pid != $pid){
+ mtr_report("Unknown process $ret_pid exited");
+ }
+ else {
+ delete $children{$ret_pid};
+ }
}
- if ( $opt_bench )
- {
- initialize_servers();
- run_benchmarks(shift); # Shift what? Extra arguments?!
+ if ( not defined @$completed ) {
+ mtr_error("Test suite aborted");
}
- elsif ( $opt_stress )
- {
- initialize_servers();
- run_stress_test()
+
+ if ( @$completed != $num_tests){
+
+ if ($opt_force){
+ # All test should have been run, print any that are still in $tests
+ #foreach my $test ( @$tests ){
+ # $test->print_test();
+ #}
+ }
+
+ # Not all tests completed, failure
+ mtr_report();
+ mtr_report("Only ", int(@$completed), " of $num_tests completed.");
+ mtr_error("Not all tests completed");
}
- else
- {
- # Figure out which tests we are going to run
- if (!$opt_suites)
- {
- $opt_suites= $opt_suites_default;
-
- # Check for any extra suites to enable based on the path name
- my %extra_suites=
- (
- "mysql-5.1-new-ndb" => "ndb_team",
- "mysql-5.1-new-ndb-merge" => "ndb_team",
- "mysql-5.1-telco-6.2" => "ndb_team",
- "mysql-5.1-telco-6.2-merge" => "ndb_team",
- "mysql-5.1-telco-6.3" => "ndb_team",
- "mysql-6.0-ndb" => "ndb_team",
- );
- foreach my $dir ( reverse splitdir($glob_basedir) )
- {
- my $extra_suite= $extra_suites{$dir};
- if (defined $extra_suite){
- mtr_report("Found extra suite: $extra_suite");
- $opt_suites= "$extra_suite,$opt_suites";
- last;
- }
+ mtr_print_line();
+
+ if ( $opt_gcov ) {
+ gcov_collect($basedir, $opt_gcov,
+ $opt_gcov_msg, $opt_gcov_err);
+ }
+
+ mtr_report_stats($completed);
+
+ exit(0);
+}
+
+
+sub run_test_server ($$$) {
+ my ($server, $tests, $childs) = @_;
+
+ my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far.
+ my $num_saved_datadir= 0; # Number of datadirs saved in vardir/log/ so far.
+ my $num_failed_test= 0; # Number of tests failed so far
+
+ # Scheduler variables
+ my $max_ndb= $childs / 2;
+ $max_ndb = 4 if $max_ndb > 4;
+ $max_ndb = 1 if $max_ndb < 1;
+ my $num_ndb_tests= 0;
+
+ my $completed= [];
+ my %running;
+ my $result;
+
+ my $suite_timeout_proc= My::SafeProcess->timer(suite_timeout());
+
+ my $s= IO::Select->new();
+ $s->add($server);
+ while (1) {
+ my @ready = $s->can_read(1); # Wake up once every second
+ foreach my $sock (@ready) {
+ if ($sock == $server) {
+ # New client connected
+ my $child= $sock->accept();
+ mtr_verbose("Client connected");
+ $s->add($child);
+ print $child "HELLO\n";
}
- }
+ else {
+ my $line= <$sock>;
+ if (!defined $line) {
+ # Client disconnected
+ mtr_verbose("Child closed socket");
+ $s->remove($sock);
+ if (--$childs == 0){
+ $suite_timeout_proc->kill();
+ return $completed;
+ }
+ next;
+ }
+ chomp($line);
+
+ if ($line eq 'TESTRESULT'){
+ $result= My::Test::read_test($sock);
+ # $result->print_test();
+
+ # Report test status
+ mtr_report_test($result);
+
+ if ( $result->is_failed() ) {
+
+ # Save the workers "savedir" in var/log
+ my $worker_savedir= $result->{savedir};
+ my $worker_savename= basename($worker_savedir);
+ my $savedir= "$opt_vardir/log/$worker_savename";
+
+ if ($opt_max_save_datadir > 0 &&
+ $num_saved_datadir >= $opt_max_save_datadir)
+ {
+ mtr_report(" - skipping '$worker_savedir/'");
+ rmtree($worker_savedir);
+ }
+ else {
+ mtr_report(" - saving '$worker_savedir/' to '$savedir/'");
+ rename($worker_savedir, $savedir);
+ # Move any core files from e.g. mysqltest
+ foreach my $coref (glob("core*"), glob("*.dmp"))
+ {
+ mtr_report(" - found '$coref', moving it to '$savedir'");
+ move($coref, $savedir);
+ }
+ if ($opt_max_save_core > 0) {
+ # Limit number of core files saved
+ find({ no_chdir => 1,
+ wanted => sub {
+ my $core_file= $File::Find::name;
+ my $core_name= basename($core_file);
+
+ if ($core_name =~ /^core/ or # Starting with core
+ (IS_WINDOWS and $core_name =~ /\.dmp$/)){
+ # Ending with .dmp
+ mtr_report(" - found '$core_name'",
+ "($num_saved_cores/$opt_max_save_core)");
+
+ My::CoreDump->show($core_file);
+
+ if ($num_saved_cores >= $opt_max_save_core) {
+ mtr_report(" - deleting it, already saved",
+ "$opt_max_save_core");
+ unlink("$core_file");
+ }
+ ++$num_saved_cores;
+ }
+ }
+ },
+ $savedir);
+ }
+ }
+ $num_saved_datadir++;
+
+ if ( !$opt_force ) {
+ # Test has failed, force is off
+ $suite_timeout_proc->kill();
+ push(@$completed, $result);
+ return $completed;
+ }
+ elsif ($opt_max_test_fail > 0 and
+ $num_failed_test >= $opt_max_test_fail) {
+ $suite_timeout_proc->kill();
+ mtr_report("Too many tests($num_failed_test) failed!",
+ "Terminating...");
+ return undef;
+ }
+ $num_failed_test++;
+ }
+
+ # Retry test run after test failure
+ my $retries= $result->{retries} || 2;
+ my $test_has_failed= $result->{failures} || 0;
+ if ($test_has_failed and $retries <= $opt_retry){
+ # Test should be run one more time unless it has failed
+ # too many times already
+ my $failures= $result->{failures};
+ if ($opt_retry > 1 and $failures >= $opt_retry_failure){
+ mtr_report("\nTest has failed $failures times,",
+ "no more retries!\n");
+ }
+ else {
+ mtr_report("\nRetrying test, attempt($retries/$opt_retry)...\n");
+ delete($result->{result});
+ $result->{retries}= $retries+1;
+ $result->write_test($sock, 'TESTCASE');
+ next;
+ }
+ }
- my $tests= collect_test_cases($opt_suites);
+ # Repeat test $opt_repeat number of times
+ my $repeat= $result->{repeat} || 1;
+ if ($repeat < $opt_repeat)
+ {
+ $result->{retries}= 0;
+ $result->{failures}= 0;
+ delete($result->{result});
+ $result->{repeat}= $repeat+1;
+ $result->write_test($sock, 'TESTCASE');
+ next;
+ }
- # Turn off NDB and other similar options if no tests use it
- my ($need_ndbcluster,$need_im);
- foreach my $test (@$tests)
- {
- next if $test->{skip};
+ # Remove from list of running
+ mtr_error("'", $result->{name},"' is not known to be running")
+ unless delete $running{$result->key()};
- if (!$opt_extern)
- {
- $need_ndbcluster||= $test->{ndb_test};
- $need_im||= $test->{component_id} eq 'im';
+ # Update scheduler variables
+ $num_ndb_tests-- if ($result->{ndb_test});
+
+ # Save result in completed list
+ push(@$completed, $result);
- # Count max number of slaves used by a test case
- if ( $test->{slave_num} > $max_slave_num) {
- $max_slave_num= $test->{slave_num};
- mtr_error("Too many slaves") if $max_slave_num > 3;
}
+ elsif ($line eq 'START'){
+ ; # Send first test
+ }
+ else {
+ mtr_error("Unknown response: '$line' from client");
+ }
+
+ # Find next test to schedule
+ # - Try to use same configuration as worker used last time
+ # - Limit number of parallel ndb tests
+
+ my $next;
+ my $second_best;
+ for(my $i= 0; $i <= @$tests; $i++)
+ {
+ my $t= $tests->[$i];
- # Count max number of masters used by a test case
- if ( $test->{master_num} > $max_master_num) {
- $max_master_num= $test->{master_num};
- mtr_error("Too many masters") if $max_master_num > 2;
- mtr_error("Too few masters") if $max_master_num < 1;
+ last unless defined $t;
+
+ if (run_testcase_check_skip_test($t)){
+ # Move the test to completed list
+ #mtr_report("skip - Moving test $i to completed");
+ push(@$completed, splice(@$tests, $i, 1));
+
+ # Since the test at pos $i was taken away, next
+ # test will also be at $i -> redo
+ redo;
+ }
+
+ # Limit number of parallell NDB tests
+ if ($t->{ndb_test} and $num_ndb_tests >= $max_ndb){
+ #mtr_report("Skipping, num ndb is already at max, $num_ndb_tests");
+ next;
+ }
+
+ # Prefer same configuration
+ if (defined $result and
+ $result->{template_path} eq $t->{template_path})
+ {
+ #mtr_report("Test uses same config => good match");
+ # Test uses same config => good match
+ $next= splice(@$tests, $i, 1);
+ last;
+ }
+
+ # Second best choice is the first that does not fulfill
+ # any of the above conditions
+ if (!defined $second_best){
+ #mtr_report("Setting second_best to $i");
+ $second_best= $i;
+ }
+ }
+
+ # Use second best choice if no other test has been found
+ if (!$next and defined $second_best){
+ #mtr_report("Take second best choice $second_best");
+ mtr_error("Internal error, second best too large($second_best)")
+ if $second_best > $#$tests;
+ $next= splice(@$tests, $second_best, 1);
+ }
+
+ if ($next) {
+ #$next->print_test();
+ $next->write_test($sock, 'TESTCASE');
+ $running{$next->key()}= $next;
+ $num_ndb_tests++ if ($next->{ndb_test});
+ }
+ else {
+ # No more test, tell child to exit
+ #mtr_report("Saying BYE to child");
+ print $sock "BYE\n";
}
}
- $use_innodb||= $test->{'innodb_test'};
}
- # Check if cluster can be skipped
- if ( !$need_ndbcluster )
+ # ----------------------------------------------------
+ # Check if test suite timer expired
+ # ----------------------------------------------------
+ if ( ! $suite_timeout_proc->wait_one(0) )
{
- $opt_skip_ndbcluster= 1;
- $opt_skip_ndbcluster_slave= 1;
+ mtr_report("Test suite timeout! Terminating...");
+ return undef;
}
+ }
+}
- # Check if slave cluster can be skipped
- if ($max_slave_num == 0)
- {
- $opt_skip_ndbcluster_slave= 1;
- }
- # Check if im can be skipped
- if ( ! $need_im )
- {
- $opt_skip_im= 1;
- }
+sub run_worker ($) {
+ my ($server_port, $thread_num)= @_;
- initialize_servers();
+ $SIG{INT}= sub { exit(1); };
- if ( $opt_report_features ) {
- run_report_features();
- }
+ # Connect to server
+ my $server = new IO::Socket::INET
+ (
+ PeerAddr => 'localhost',
+ PeerPort => $server_port,
+ Proto => 'tcp'
+ );
+ mtr_error("Could not connect to server at port $server_port: $!")
+ unless $server;
- run_tests($tests);
- }
+ # --------------------------------------------------------------------------
+ # Set worker name
+ # --------------------------------------------------------------------------
+ report_option('name',"worker[$thread_num]");
- mtr_exit(0);
-}
+ # --------------------------------------------------------------------------
+ # Use auto build thread in all but first worker
+ # --------------------------------------------------------------------------
+ set_build_thread_ports($thread_num > 1 ? 'auto' : $opt_build_thread);
-##############################################################################
-#
-# Default settings
-#
-##############################################################################
+ if (check_ports_free()){
+ # Some port was not free(which one has already been printed)
+ mtr_error("Some port(s) was not free")
+ }
-#
-# When an option is no longer used by this program, it must be explicitly
-# ignored or else it will be passed through to mysqld. GetOptions will call
-# this subroutine once for each such option on the command line. See
-# Getopt::Long documentation.
-#
+ # --------------------------------------------------------------------------
+ # Turn off verbosity in workers, unless explicitly specified
+ # --------------------------------------------------------------------------
+ report_option('verbose', undef) if ($opt_verbose == 0);
-sub warn_about_removed_option {
- my ($option, $value, $hash_value) = @_;
+ environment_setup();
- warn "WARNING: This option is no longer used, and is ignored: --$option\n";
-}
+ # Read hello from server which it will send when shared
+ # resources have been setup
+ my $hello= <$server>;
-sub command_line_setup () {
+ setup_vardir();
+ check_running_as_root();
- # These are defaults for things that are set on the command line
+ if ( using_extern() ) {
+ create_config_file_for_extern(%opts_extern);
+ }
- my $opt_comment;
+ # Ask server for first test
+ print $server "START\n";
+
+ while(my $line= <$server>){
+ chomp($line);
+ if ($line eq 'TESTCASE'){
+ my $test= My::Test::read_test($server);
+ #$test->print_test();
- # Magic number -69.4 results in traditional test ports starting from 9306.
- set_mtr_build_thread_ports(-69.4);
+ # Clear comment and logfile, to avoid
+ # reusing them from previous test
+ delete($test->{'comment'});
+ delete($test->{'logfile'});
- # If so requested, we try to avail ourselves of a unique build thread number.
- if ( $ENV{'MTR_BUILD_THREAD'} ) {
- if ( lc($ENV{'MTR_BUILD_THREAD'}) eq 'auto' ) {
- print "Requesting build thread... ";
- $ENV{'MTR_BUILD_THREAD'} = mtr_require_unique_id_and_wait("/tmp/mysql-test-ports", 200, 299);
- print "got ".$ENV{'MTR_BUILD_THREAD'}."\n";
+ run_testcase($test);
+ #$test->{result}= 'MTR_RES_PASSED';
+ # Send it back, now with results set
+ #$test->print_test();
+ $test->write_test($server, 'TESTRESULT');
+ }
+ elsif ($line eq 'BYE'){
+ mtr_report("Server said BYE");
+ exit(0);
+ }
+ else {
+ mtr_error("Could not understand server, '$line'");
}
}
- if ( $ENV{'MTR_BUILD_THREAD'} )
- {
- set_mtr_build_thread_ports($ENV{'MTR_BUILD_THREAD'});
- }
+ stop_all_servers();
- # This is needed for test log evaluation in "gen-build-status-page"
- # in all cases where the calling tool does not log the commands
- # directly before it executes them, like "make test-force-pl" in RPM builds.
- print "Logging: $0 ", join(" ", @ARGV), "\n";
+ exit(1);
+}
- # Read the command line
- # Note: Keep list, and the order, in sync with usage at end of this file
- # Options that are no longer used must still be processed, because all
- # unprocessed options are passed directly to mysqld. The user will be
- # warned that the option is being ignored.
- #
- # Put the complete option string here. For example, to remove the --suite
- # option, remove it from GetOptions() below and put 'suite|suites=s' here.
- my @removed_options = (
- );
+sub ignore_option {
+ my ($opt, $value)= @_;
+ mtr_report("Ignoring option '$opt'");
+}
+
+
+
+# Setup any paths that are $opt_vardir related
+sub set_vardir {
+ my ($vardir)= @_;
+
+ $opt_vardir= $vardir;
+ $path_vardir_trace= $opt_vardir;
+ # Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/...
+ $path_vardir_trace=~ s/^\w://;
+
+ # Location of my.cnf that all clients use
+ $path_config_file= "$opt_vardir/my.cnf";
+
+ $path_testlog= "$opt_vardir/log/mysqltest.log";
+ $path_current_testlog= "$opt_vardir/log/current_test";
+
+}
+
+
+sub command_line_setup {
+ my $opt_comment;
+ my $opt_usage;
+
+ # Read the command line options
+ # Note: Keep list, and the order, in sync with usage at end of this file
Getopt::Long::Configure("pass_through");
GetOptions(
# Control what engine/variation to run
@@ -559,54 +770,47 @@ sub command_line_setup () {
'ssl|with-openssl' => \$opt_ssl,
'skip-ssl' => \$opt_skip_ssl,
'compress' => \$opt_compress,
- 'bench' => \$opt_bench,
- 'small-bench' => \$opt_small_bench,
- 'with-ndbcluster|ndb' => \$opt_with_ndbcluster,
- 'vs-config' => \$opt_vs_config,
+ 'vs-config' => \$opt_vs_config,
+
+ # Max number of parallel threads to use
+ 'parallel=i' => \$opt_parallel,
+
+ # Config file to use as template for all tests
+ 'defaults-file=s' => \&collect_option,
+ # Extra config file to append to all generated configs
+ 'defaults-extra-file=s' => \&collect_option,
# Control what test suites or cases to run
'force' => \$opt_force,
- 'with-ndbcluster-only' => \$opt_with_ndbcluster_only,
+ 'with-ndbcluster-only' => \&collect_option,
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
- 'skip-ndbcluster-slave|skip-ndb-slave'
- => \$opt_skip_ndbcluster_slave,
- 'ndb-extra-test' => \$opt_ndb_extra_test,
- 'skip-master-binlog' => \$opt_skip_master_binlog,
- 'skip-slave-binlog' => \$opt_skip_slave_binlog,
- 'do-test=s' => \$opt_do_test,
- 'start-from=s' => \$opt_start_from,
'suite|suites=s' => \$opt_suites,
- 'skip-rpl' => \$opt_skip_rpl,
- 'skip-im' => \$opt_skip_im,
- 'skip-test=s' => \$opt_skip_test,
+ 'skip-rpl' => \&collect_option,
+ 'skip-test=s' => \&collect_option,
+ 'do-test=s' => \&collect_option,
+ 'start-from=s' => \&collect_option,
'big-test' => \$opt_big_test,
- 'combination=s' => \@opt_combinations,
- 'skip-combination' => \$opt_skip_combination,
+ 'combination=s' => \@opt_combinations,
+ 'skip-combinations' => \&collect_option,
+
+ 'skip-im' => \&ignore_option,
# Specify ports
- 'master_port=i' => \$opt_master_myport,
- 'slave_port=i' => \$opt_slave_myport,
- 'ndbcluster-port|ndbcluster_port=i' => \$opt_ndbcluster_port,
- 'ndbcluster-port-slave=i' => \$opt_ndbcluster_port_slave,
- 'im-port=i' => \$im_port, # Instance Manager port.
- 'im-mysqld1-port=i' => \$im_mysqld1_port, # Port of mysqld, controlled by IM
- 'im-mysqld2-port=i' => \$im_mysqld2_port, # Port of mysqld, controlled by IM
- 'mtr-build-thread=i' => \$opt_mtr_build_thread,
+ 'build-thread|mtr-build-thread=i' => \$opt_build_thread,
# Test case authoring
'record' => \$opt_record,
- 'check-testcases' => \$opt_check_testcases,
+ 'check-testcases!' => \$opt_check_testcases,
'mark-progress' => \$opt_mark_progress,
# Extra options used when starting mysqld
'mysqld=s' => \@opt_extra_mysqld_opt,
# Run test on running server
- 'extern' => \$opt_extern,
- 'ndb-connectstring=s' => \$opt_ndbconnectstring,
- 'ndb-connectstring-slave=s' => \$opt_ndbconnectstring_slave,
+ 'extern=s' => \%opts_extern, # Append to hash
# Debugging
+ 'debug' => \$opt_debug,
'gdb' => \$opt_gdb,
'client-gdb' => \$opt_client_gdb,
'manual-gdb' => \$opt_manual_gdb,
@@ -616,14 +820,13 @@ sub command_line_setup () {
'manual-ddd' => \$opt_manual_ddd,
'debugger=s' => \$opt_debugger,
'client-debugger=s' => \$opt_client_debugger,
- 'strace-client' => \$opt_strace_client,
- 'master-binary=s' => \$exe_master_mysqld,
- 'slave-binary=s' => \$exe_slave_mysqld,
+ 'strace-client:s' => \$opt_strace_client,
'max-save-core=i' => \$opt_max_save_core,
+ 'max-save-datadir=i' => \$opt_max_save_datadir,
+ 'max-test-fail=i' => \$opt_max_test_fail,
# Coverage, profiling etc
'gcov' => \$opt_gcov,
- 'gprof' => \$opt_gprof,
'valgrind|valgrind-all' => \$opt_valgrind,
'valgrind-mysqltest' => \$opt_valgrind_mysqltest,
'valgrind-mysqld' => \$opt_valgrind_mysqld,
@@ -642,21 +845,9 @@ sub command_line_setup () {
'valgrind-path=s' => \$opt_valgrind_path,
'callgrind' => \$opt_callgrind,
- # Stress testing
- 'stress' => \$opt_stress,
- 'stress-suite=s' => \$opt_stress_suite,
- 'stress-threads=i' => \$opt_stress_threads,
- 'stress-test-file=s' => \$opt_stress_test_file,
- 'stress-init-file=s' => \$opt_stress_init_file,
- 'stress-mode=s' => \$opt_stress_mode,
- 'stress-loop-count=i' => \$opt_stress_loop_count,
- 'stress-test-count=i' => \$opt_stress_test_count,
- 'stress-test-duration=i' => \$opt_stress_test_duration,
-
# Directories
'tmpdir=s' => \$opt_tmpdir,
'vardir=s' => \$opt_vardir,
- 'benchdir=s' => \$glob_mysql_bench_dir,
'mem' => \$opt_mem,
'client-bindir=s' => \$path_client_bindir,
'client-libdir=s' => \$path_client_libdir,
@@ -664,48 +855,37 @@ sub command_line_setup () {
# Misc
'report-features' => \$opt_report_features,
'comment=s' => \$opt_comment,
- 'debug' => \$opt_debug,
'fast' => \$opt_fast,
- 'reorder' => \$opt_reorder,
- 'enable-disabled' => \$opt_enable_disabled,
- 'script-debug' => \$opt_script_debug,
- 'verbose' => \$opt_verbose,
+ 'reorder!' => \&collect_option,
+ 'enable-disabled' => \&collect_option,
+ 'verbose+' => \$opt_verbose,
+ 'verbose-restart' => \&report_option,
'sleep=i' => \$opt_sleep,
- 'socket=s' => \$opt_socket,
'start-dirty' => \$opt_start_dirty,
- 'start-and-exit' => \$opt_start_and_exit,
- 'timer!' => \$opt_timer,
+ 'start' => \$opt_start,
+ 'print-testcases' => \&collect_option,
+ 'repeat=i' => \$opt_repeat,
+ 'retry=i' => \$opt_retry,
+ 'retry-failure=i' => \$opt_retry_failure,
+ 'timer!' => \&report_option,
'user=s' => \$opt_user,
'testcase-timeout=i' => \$opt_testcase_timeout,
'suite-timeout=i' => \$opt_suite_timeout,
- 'warnings|log-warnings' => \$opt_warnings,
-
- # Options which are no longer used
- (map { $_ => \&warn_about_removed_option } @removed_options),
+ 'shutdown-timeout=i' => \$opt_shutdown_timeout,
+ 'warnings!' => \$opt_warnings,
+ 'timestamp' => \&report_option,
+ 'timediff' => \&report_option,
'help|h' => \$opt_usage,
) or usage("Can't read options");
usage("") if $opt_usage;
- $glob_scriptname= basename($0);
-
- if ($opt_mtr_build_thread != 0)
- {
- set_mtr_build_thread_ports($opt_mtr_build_thread)
- }
- elsif ($ENV{'MTR_BUILD_THREAD'})
- {
- $opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'};
- }
-
- # We require that we are in the "mysql-test" directory
- # to run mysql-test-run
- if (! -f $glob_scriptname)
- {
- mtr_error("Can't find the location for the mysql-test-run script\n" .
- "Go to to the mysql-test directory and execute the script " .
- "as follows:\n./$glob_scriptname");
+ # --------------------------------------------------------------------------
+ # Setup verbosity
+ # --------------------------------------------------------------------------
+ if ($opt_verbose != 0){
+ report_option('verbose', $opt_verbose);
}
if ( -d "../sql" )
@@ -714,77 +894,28 @@ sub command_line_setup () {
}
# Find the absolute path to the test directory
- $glob_mysql_test_dir= cwd();
- if ( $glob_cygwin_perl )
+ $glob_mysql_test_dir= cwd();
+ if (IS_CYGWIN)
{
- # Windows programs like 'mysqld' needs Windows paths
- $glob_mysql_test_dir= `cygpath -m "$glob_mysql_test_dir"`;
- chomp($glob_mysql_test_dir);
+ # Use mixed path format i.e c:/path/to/
+ $glob_mysql_test_dir= mixed_path($glob_mysql_test_dir);
}
- $default_vardir= "$glob_mysql_test_dir/var";
# In most cases, the base directory we find everything relative to,
# is the parent directory of the "mysql-test" directory. For source
# distributions, TAR binary distributions and some other packages.
- $glob_basedir= dirname($glob_mysql_test_dir);
+ $basedir= dirname($glob_mysql_test_dir);
# In the RPM case, binaries and libraries are installed in the
# default system locations, instead of having our own private base
# directory. And we install "/usr/share/mysql-test". Moving up one
# more directory relative to "mysql-test" gives us a usable base
# directory for RPM installs.
- if ( ! $source_dist and ! -d "$glob_basedir/bin" )
- {
- $glob_basedir= dirname($glob_basedir);
- }
-
- # Expect mysql-bench to be located adjacent to the source tree, by default
- $glob_mysql_bench_dir= "$glob_basedir/../mysql-bench"
- unless defined $glob_mysql_bench_dir;
- $glob_mysql_bench_dir= undef
- unless -d $glob_mysql_bench_dir;
-
- $path_my_basedir=
- $source_dist ? $glob_mysql_test_dir : $glob_basedir;
-
- $glob_timers= mtr_init_timers();
-
- # --------------------------------------------------------------------------
- # Embedded server flag
- # --------------------------------------------------------------------------
- if ( $opt_embedded_server )
+ if ( ! $source_dist and ! -d "$basedir/bin" )
{
- $glob_use_embedded_server= 1;
- # Add the location for libmysqld.dll to the path.
- if ( $glob_win32 )
- {
- my $lib_mysqld=
- mtr_path_exists(vs_config_dirs('libmysqld',''));
- $lib_mysqld= $glob_cygwin_perl ? ":".`cygpath "$lib_mysqld"`
- : ";".$lib_mysqld;
- chomp($lib_mysqld);
- $ENV{'PATH'}="$ENV{'PATH'}".$lib_mysqld;
- }
-
- push(@glob_test_mode, "embedded");
- $opt_skip_rpl= 1; # We never run replication with embedded
- $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
- $opt_skip_ssl= 1; # Turn off use of SSL
-
- # Turn off use of bin log
- push(@opt_extra_mysqld_opt, "--skip-log-bin");
-
- if ( $opt_extern )
- {
- mtr_error("Can't use --extern with --embedded-server");
- }
+ $basedir= dirname($basedir);
}
- #
- # Find the mysqld executable to be able to find the mysqld version
- # number as early as possible
- #
-
# Look for the client binaries directory
if ($path_client_bindir)
{
@@ -793,52 +924,39 @@ sub command_line_setup () {
}
else
{
- $path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
- "$glob_basedir/client_debug",
+ $path_client_bindir= mtr_path_exists("$basedir/client_release",
+ "$basedir/client_debug",
vs_config_dirs('client', ''),
- "$glob_basedir/client",
- "$glob_basedir/bin");
+ "$basedir/client",
+ "$basedir/bin");
}
-
+
# Look for language files and charsetsdir, use same share
- $path_share= mtr_path_exists("$glob_basedir/share/mysql",
- "$glob_basedir/sql/share",
- "$glob_basedir/share");
+ my $path_share= mtr_path_exists("$basedir/share/mysql",
+ "$basedir/sql/share",
+ "$basedir/share");
+
$path_language= mtr_path_exists("$path_share/english");
$path_charsetsdir= mtr_path_exists("$path_share/charsets");
-
- if (!$opt_extern)
+ if (using_extern())
{
- $exe_mysqld= mtr_exe_exists (vs_config_dirs('sql', 'mysqld'),
- vs_config_dirs('sql', 'mysqld-debug'),
- "$glob_basedir/sql/mysqld",
- "$path_client_bindir/mysqld-max-nt",
- "$path_client_bindir/mysqld-max",
- "$path_client_bindir/mysqld-nt",
- "$path_client_bindir/mysqld",
- "$path_client_bindir/mysqld-debug",
- "$path_client_bindir/mysqld-max",
- "$glob_basedir/libexec/mysqld",
- "$glob_basedir/bin/mysqld",
- "$glob_basedir/sbin/mysqld");
-
- # Use the mysqld found above to find out what features are available
- collect_mysqld_features();
+ # Connect to the running mysqld and find out what it supports
+ collect_mysqld_features_from_running_server();
}
else
{
- $mysqld_variables{'port'}= 3306;
- $mysqld_variables{'master-port'}= 3306;
+ # Run the mysqld to find out what features are available
+ collect_mysqld_features();
}
if ( $opt_comment )
{
- print "\n";
- print '#' x 78, "\n";
- print "# $opt_comment\n";
- print '#' x 78, "\n\n";
+ mtr_report();
+ mtr_print_thick_line('#');
+ mtr_report("# $opt_comment");
+ mtr_print_thick_line('#');
}
foreach my $arg ( @ARGV )
@@ -866,22 +984,13 @@ sub command_line_setup () {
# --------------------------------------------------------------------------
# Find out type of logging that are being used
# --------------------------------------------------------------------------
- if (!$opt_extern && $mysql_version_id >= 50100 )
+ foreach my $arg ( @opt_extra_mysqld_opt )
{
- foreach my $arg ( @opt_extra_mysqld_opt )
- {
- if ( $arg =~ /binlog[-_]format=(\S+)/ )
- {
- $used_binlog_format= $1;
- }
- }
- if (defined $used_binlog_format)
+ if ( $arg =~ /binlog[-_]format=(\S+)/ )
{
- mtr_report("Using binlog format '$used_binlog_format'");
- }
- else
- {
- mtr_report("Using dynamic switching of binlog format");
+ # Save this for collect phase
+ collect_option('binlog-format', $1);
+ mtr_report("Using binlog format '$1'");
}
}
@@ -889,26 +998,20 @@ sub command_line_setup () {
# --------------------------------------------------------------------------
# Find out default storage engine being used(if any)
# --------------------------------------------------------------------------
- if ( $opt_with_ndbcluster )
- {
- # --ndb or --with-ndbcluster turns on --default-storage-engine=ndbcluster
- push(@opt_extra_mysqld_opt, "--default-storage-engine=ndbcluster");
- }
-
foreach my $arg ( @opt_extra_mysqld_opt )
{
if ( $arg =~ /default-storage-engine=(\S+)/ )
{
- $used_default_engine= $1;
+ # Save this for collect phase
+ collect_option('default-storage-engine', $1);
+ mtr_report("Using default engine '$1'")
}
}
- mtr_report("Using default engine '$used_default_engine'")
- if defined $used_default_engine;
# --------------------------------------------------------------------------
# Check if we should speed up tests by trying to run on tmpfs
# --------------------------------------------------------------------------
- if ( defined $opt_mem )
+ if ( defined $opt_mem)
{
mtr_error("Can't use --mem and --vardir at the same time ")
if $opt_vardir;
@@ -916,7 +1019,7 @@ sub command_line_setup () {
if $opt_tmpdir;
# Search through list of locations that are known
- # to be "fast disks" to list to find a suitable location
+ # to be "fast disks" to find a suitable location
# Use --mem=<dir> as first location to look.
my @tmpfs_locations= ($opt_mem, "/dev/shm", "/tmp");
@@ -924,72 +1027,56 @@ sub command_line_setup () {
{
if ( -d $fs )
{
- mtr_report("Using tmpfs in $fs");
- $opt_mem= "$fs/var";
- $opt_mem .= $opt_mtr_build_thread if $opt_mtr_build_thread;
+ my $template= "var_${opt_build_thread}_XXXX";
+ $opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0);
last;
}
}
}
# --------------------------------------------------------------------------
- # Set the "var/" directory, as it is the base for everything else
+ # Set the "var/" directory, the base for everything else
# --------------------------------------------------------------------------
+ $default_vardir= "$glob_mysql_test_dir/var";
if ( ! $opt_vardir )
{
$opt_vardir= $default_vardir;
}
- elsif ( $mysql_version_id < 50000 and
- $opt_vardir ne $default_vardir)
- {
- # Version 4.1 and --vardir was specified
- # Only supported as a symlink from var/
- # by setting up $opt_mem that symlink will be created
- if ( ! $glob_win32 )
- {
- # Only platforms that have native symlinks can use the vardir trick
- $opt_mem= $opt_vardir;
- mtr_report("Using 4.1 vardir trick");
- }
-
- $opt_vardir= $default_vardir;
- }
-
- $path_vardir_trace= $opt_vardir;
- # Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/...
- $path_vardir_trace=~ s/^\w://;
# We make the path absolute, as the server will do a chdir() before usage
unless ( $opt_vardir =~ m,^/, or
- ($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) )
+ (IS_WINDOWS and $opt_vardir =~ m,^[a-z]:/,i) )
{
# Make absolute path, relative test dir
$opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
}
+ set_vardir($opt_vardir);
+
# --------------------------------------------------------------------------
- # Set tmpdir
+ # Set the "tmp" directory
# --------------------------------------------------------------------------
- $opt_tmpdir= "$opt_vardir/tmp" unless $opt_tmpdir;
+ if ( ! $opt_tmpdir )
+ {
+ $opt_tmpdir= "$opt_vardir/tmp" unless $opt_tmpdir;
+
+ if (check_socket_path_length("$opt_tmpdir/mysql_testsocket.sock"))
+ {
+ mtr_report("Too long tmpdir path '$opt_tmpdir'",
+ " creating a shorter one...");
+
+ # Create temporary directory in standard location for temporary files
+ $opt_tmpdir= tempdir( TMPDIR => 1, CLEANUP => 1 );
+ mtr_report(" - using tmpdir: '$opt_tmpdir'\n");
+ }
+ }
$opt_tmpdir =~ s,/+$,,; # Remove ending slash if any
# --------------------------------------------------------------------------
- # Check im suport
+ # fast option
# --------------------------------------------------------------------------
- if ($opt_extern)
- {
- mtr_report("Disable instance manager when running with extern mysqld");
- $opt_skip_im= 1;
- }
- elsif ( $mysql_version_id < 50000 )
- {
- # Instance manager is not supported until 5.0
- $opt_skip_im= 1;
- }
- elsif ( $glob_win32 )
- {
- mtr_report("Disable Instance manager - testing not supported on Windows");
- $opt_skip_im= 1;
+ if ($opt_fast){
+ $opt_shutdown_timeout= 0; # Kill processes instead of nice shutdown
}
# --------------------------------------------------------------------------
@@ -1000,25 +1087,68 @@ sub command_line_setup () {
mtr_error("Will not run in record mode without a specific test case");
}
- if ( $opt_record )
- {
- $opt_skip_combination = 1;
+ if ( $opt_record ) {
+ # Use only one worker with --record
+ $opt_parallel= 1;
}
# --------------------------------------------------------------------------
- # ps protcol flag
+ # Embedded server flag
# --------------------------------------------------------------------------
- if ( $opt_ps_protocol )
+ if ( $opt_embedded_server )
{
- push(@glob_test_mode, "ps-protocol");
- }
+ if ( IS_WINDOWS )
+ {
+ # Add the location for libmysqld.dll to the path.
+ my $separator= ";";
+ my $lib_mysqld=
+ mtr_path_exists(vs_config_dirs('libmysqld',''));
+ if ( IS_CYGWIN )
+ {
+ $lib_mysqld= posix_path($lib_mysqld);
+ $separator= ":";
+ }
+ $ENV{'PATH'}= "$ENV{'PATH'}".$separator.$lib_mysqld;
+ }
+ $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
+ $opt_skip_ssl= 1; # Turn off use of SSL
- # --------------------------------------------------------------------------
- # Bench flags
- # --------------------------------------------------------------------------
- if ( $opt_small_bench )
- {
- $opt_bench= 1;
+ # Turn off use of bin log
+ push(@opt_extra_mysqld_opt, "--skip-log-bin");
+
+ if ( using_extern() )
+ {
+ mtr_error("Can't use --extern with --embedded-server");
+ }
+
+
+ if ($opt_gdb)
+ {
+ mtr_warning("Silently converting --gdb to --client-gdb in embedded mode");
+ $opt_client_gdb= $opt_gdb;
+ $opt_gdb= undef;
+ }
+
+ if ($opt_ddd)
+ {
+ mtr_warning("Silently converting --ddd to --client-ddd in embedded mode");
+ $opt_client_ddd= $opt_ddd;
+ $opt_ddd= undef;
+ }
+
+ if ($opt_debugger)
+ {
+ mtr_warning("Silently converting --debugger to --client-debugger in embedded mode");
+ $opt_client_debugger= $opt_debugger;
+ $opt_debugger= undef;
+ }
+
+ if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd ||
+ $opt_manual_debug || $opt_debugger )
+ {
+ mtr_error("You need to use the client debug options for the",
+ "embedded server. Ex: --client-gdb");
+ }
}
# --------------------------------------------------------------------------
@@ -1046,17 +1176,22 @@ sub command_line_setup () {
{
# Indicate that we are using debugger
$glob_debugger= 1;
- if ( $opt_extern )
+ if ( using_extern() )
{
mtr_error("Can't use --extern when using debugger");
}
}
# --------------------------------------------------------------------------
- # Check if special exe was selected for master or slave
+ # Check timeout arguments
# --------------------------------------------------------------------------
- $exe_master_mysqld= $exe_master_mysqld || $exe_mysqld;
- $exe_slave_mysqld= $exe_slave_mysqld || $exe_mysqld;
+
+ mtr_error("Invalid value '$opt_testcase_timeout' supplied ".
+ "for option --testcase-timeout")
+ if ($opt_testcase_timeout <= 0);
+ mtr_error("Invalid value '$opt_suite_timeout' supplied ".
+ "for option --testsuite-timeout")
+ if ($opt_suite_timeout <= 0);
# --------------------------------------------------------------------------
# Check valgrind arguments
@@ -1067,6 +1202,12 @@ sub command_line_setup () {
$opt_valgrind= 1;
$opt_valgrind_mysqld= 1;
$opt_valgrind_mysqltest= 1;
+
+ # Increase the timeouts when running with valgrind
+ $opt_testcase_timeout*= 10;
+ $opt_suite_timeout*= 6;
+ $opt_start_timeout*= 10;
+
}
elsif ( $opt_valgrind_mysqld )
{
@@ -1100,272 +1241,17 @@ sub command_line_setup () {
join(" ", @valgrind_args), "\"");
}
- if ( ! $opt_testcase_timeout )
- {
- $opt_testcase_timeout= $default_testcase_timeout;
- $opt_testcase_timeout*= 10 if $opt_valgrind;
- $opt_testcase_timeout*= 10 if ($opt_debug and $glob_win32);
- }
-
- if ( ! $opt_suite_timeout )
- {
- $opt_suite_timeout= $default_suite_timeout;
- $opt_suite_timeout*= 6 if $opt_valgrind;
- $opt_suite_timeout*= 6 if ($opt_debug and $glob_win32);
- }
+ mtr_report("Checking supported features...");
- if ( ! $opt_user )
- {
- if ( $opt_extern )
- {
- $opt_user= "test";
- }
- else
- {
- $opt_user= "root"; # We want to do FLUSH xxx commands
- }
- }
-
- # On QNX, /tmp/dir/master.sock and /tmp/dir//master.sock seem to be
- # considered different, so avoid the extra slash (/) in the socket
- # paths.
- my $sockdir = $opt_tmpdir;
- $sockdir =~ s|/+$||;
-
- # On some operating systems, there is a limit to the length of a
- # UNIX domain socket's path far below PATH_MAX, so try to avoid long
- # socket path names.
- $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) >= 70 );
-
- $master->[0]=
- {
- pid => 0,
- type => "master",
- idx => 0,
- path_myddir => "$opt_vardir/master-data",
- path_myerr => "$opt_vardir/log/master.err",
- path_pid => "$opt_vardir/run/master.pid",
- path_sock => "$sockdir/master.sock",
- port => $opt_master_myport,
- start_timeout => 400, # enough time create innodb tables
- cluster => 0, # index in clusters list
- start_opts => [],
- };
-
- $master->[1]=
- {
- pid => 0,
- type => "master",
- idx => 1,
- path_myddir => "$opt_vardir/master1-data",
- path_myerr => "$opt_vardir/log/master1.err",
- path_pid => "$opt_vardir/run/master1.pid",
- path_sock => "$sockdir/master1.sock",
- port => $opt_master_myport + 1,
- start_timeout => 400, # enough time create innodb tables
- cluster => 0, # index in clusters list
- start_opts => [],
- };
-
- $slave->[0]=
- {
- pid => 0,
- type => "slave",
- idx => 0,
- path_myddir => "$opt_vardir/slave-data",
- path_myerr => "$opt_vardir/log/slave.err",
- path_pid => "$opt_vardir/run/slave.pid",
- path_sock => "$sockdir/slave.sock",
- port => $opt_slave_myport,
- start_timeout => 400,
-
- cluster => 1, # index in clusters list
- start_opts => [],
- };
-
- $slave->[1]=
- {
- pid => 0,
- type => "slave",
- idx => 1,
- path_myddir => "$opt_vardir/slave1-data",
- path_myerr => "$opt_vardir/log/slave1.err",
- path_pid => "$opt_vardir/run/slave1.pid",
- path_sock => "$sockdir/slave1.sock",
- port => $opt_slave_myport + 1,
- start_timeout => 300,
- cluster => -1, # index in clusters list
- start_opts => [],
- };
-
- $slave->[2]=
- {
- pid => 0,
- type => "slave",
- idx => 2,
- path_myddir => "$opt_vardir/slave2-data",
- path_myerr => "$opt_vardir/log/slave2.err",
- path_pid => "$opt_vardir/run/slave2.pid",
- path_sock => "$sockdir/slave2.sock",
- port => $opt_slave_myport + 2,
- start_timeout => 300,
- cluster => -1, # index in clusters list
- start_opts => [],
- };
-
- $instance_manager=
- {
- path_err => "$opt_vardir/log/im.err",
- path_log => "$opt_vardir/log/im.log",
- path_pid => "$opt_vardir/run/im.pid",
- path_angel_pid => "$opt_vardir/run/im.angel.pid",
- path_sock => "$sockdir/im.sock",
- port => $im_port,
- start_timeout => $master->[0]->{'start_timeout'},
- admin_login => 'im_admin',
- admin_password => 'im_admin_secret',
- admin_sha1 => '*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295',
- password_file => "$opt_vardir/im.passwd",
- defaults_file => "$opt_vardir/im.cnf",
- };
-
- $instance_manager->{'instances'}->[0]=
- {
- server_id => 1,
- port => $im_mysqld1_port,
- path_datadir => "$opt_vardir/im_mysqld_1.data",
- path_sock => "$sockdir/mysqld_1.sock",
- path_pid => "$opt_vardir/run/mysqld_1.pid",
- start_timeout => 400, # enough time create innodb tables
- old_log_format => 1
- };
-
- $instance_manager->{'instances'}->[1]=
- {
- server_id => 2,
- port => $im_mysqld2_port,
- path_datadir => "$opt_vardir/im_mysqld_2.data",
- path_sock => "$sockdir/mysqld_2.sock",
- path_pid => "$opt_vardir/run/mysqld_2.pid",
- nonguarded => 1,
- start_timeout => 400, # enough time create innodb tables
- old_log_format => 1
- };
-
- my $data_dir= "$opt_vardir/ndbcluster-$opt_ndbcluster_port";
- $clusters->[0]=
- {
- name => "Master",
- nodes => 2,
- port => "$opt_ndbcluster_port",
- data_dir => "$data_dir",
- connect_string => "host=localhost:$opt_ndbcluster_port",
- path_pid => "$data_dir/ndb_3.pid", # Nodes + 1
- pid => 0, # pid of ndb_mgmd
- installed_ok => 0,
- };
-
- $data_dir= "$opt_vardir/ndbcluster-$opt_ndbcluster_port_slave";
- $clusters->[1]=
- {
- name => "Slave",
- nodes => 1,
- port => "$opt_ndbcluster_port_slave",
- data_dir => "$data_dir",
- connect_string => "host=localhost:$opt_ndbcluster_port_slave",
- path_pid => "$data_dir/ndb_2.pid", # Nodes + 1
- pid => 0, # pid of ndb_mgmd
- installed_ok => 0,
- };
-
- # Init pids of ndbd's
- foreach my $cluster ( @{$clusters} )
- {
- for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
- {
- my $nodeid= $idx+1;
- $cluster->{'ndbds'}->[$idx]=
- {
- pid => 0,
- nodeid => $nodeid,
- path_pid => "$cluster->{'data_dir'}/ndb_${nodeid}.pid",
- path_fs => "$cluster->{'data_dir'}/ndb_${nodeid}_fs",
- };
- }
- }
-
- # --------------------------------------------------------------------------
- # extern
- # --------------------------------------------------------------------------
- if ( $opt_extern )
- {
- # Turn off features not supported when running with extern server
- $opt_skip_rpl= 1;
- $opt_skip_ndbcluster= 1;
-
- # Setup master->[0] with the settings for the extern server
- $master->[0]->{'path_sock'}= $opt_socket ? $opt_socket : "/tmp/mysql.sock";
- mtr_report("Using extern server at '$master->[0]->{path_sock}'");
- }
- else
- {
- mtr_error("--socket can only be used in combination with --extern")
- if $opt_socket;
- }
-
-
- # --------------------------------------------------------------------------
- # ndbconnectstring and ndbconnectstring_slave
- # --------------------------------------------------------------------------
- if ( $opt_ndbconnectstring )
- {
- # ndbconnectstring was supplied by user, the tests shoudl be run
- # against an already started cluster, change settings
- my $cluster= $clusters->[0]; # Master cluster
- $cluster->{'connect_string'}= $opt_ndbconnectstring;
- $cluster->{'use_running'}= 1;
-
- mtr_error("Can't specify --ndb-connectstring and --skip-ndbcluster")
- if $opt_skip_ndbcluster;
- }
- $ENV{'NDB_CONNECTSTRING'}= $clusters->[0]->{'connect_string'};
-
-
- if ( $opt_ndbconnectstring_slave )
- {
- # ndbconnectstring-slave was supplied by user, the tests should be run
- # agains an already started slave cluster, change settings
- my $cluster= $clusters->[1]; # Slave cluster
- $cluster->{'connect_string'}= $opt_ndbconnectstring_slave;
- $cluster->{'use_running'}= 1;
-
- mtr_error("Can't specify ndb-connectstring_slave and " .
- "--skip-ndbcluster-slave")
- if $opt_skip_ndbcluster_slave;
- }
-
-
- $path_timefile= "$opt_vardir/log/mysqltest-time";
- $path_mysqltest_log= "$opt_vardir/log/mysqltest.log";
- $path_current_test_log= "$opt_vardir/log/current_test";
- $path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
+ check_ndbcluster_support(\%mysqld_variables);
+ check_ssl_support(\%mysqld_variables);
+ check_debug_support(\%mysqld_variables);
- $path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
+ executable_setup();
- if ( $opt_valgrind and $opt_debug )
- {
- # When both --valgrind and --debug is selected, send
- # all output to the trace file, making it possible to
- # see the exact location where valgrind complains
- foreach my $mysqld (@{$master}, @{$slave})
- {
- my $sidx= $mysqld->{idx} ? "$mysqld->{idx}" : "";
- $mysqld->{path_myerr}=
- "$opt_vardir/log/" . $mysqld->{type} . "$sidx.trace";
- }
- }
}
+
#
# To make it easier for different devs to work on the same host,
# an environment variable can be used to control all ports. A small
@@ -1381,79 +1267,47 @@ sub command_line_setup () {
# http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
# But a fairly safe range seems to be 5001 - 32767
#
-
-sub set_mtr_build_thread_ports($) {
- my $mtr_build_thread= shift;
-
- if ( lc($mtr_build_thread) eq 'auto' ) {
- print "Requesting build thread... ";
- $ENV{'MTR_BUILD_THREAD'} = $mtr_build_thread = mtr_require_unique_id_and_wait("/tmp/mysql-test-ports", 200, 299);
- print "got ".$mtr_build_thread."\n";
+sub set_build_thread_ports($) {
+ my $build_thread= shift || 0;
+
+ if ( lc($build_thread) eq 'auto' ) {
+ #mtr_report("Requesting build thread... ");
+ $build_thread= mtr_get_unique_id(250, 299);
+ if ( !defined $build_thread ) {
+ mtr_error("Could not get a unique build thread id");
+ }
+ #mtr_report(" - got $build_thread");
}
+ $ENV{MTR_BUILD_THREAD}= $build_thread;
+ $opt_build_thread= $build_thread;
- # Up to two masters, up to three slaves
- # A magic value in command_line_setup depends on these equations.
- $opt_master_myport= $mtr_build_thread * 10 + 10000; # and 1
- $opt_slave_myport= $opt_master_myport + 2; # and 3 4
- $opt_ndbcluster_port= $opt_master_myport + 5;
- $opt_ndbcluster_port_slave= $opt_master_myport + 6;
- $im_port= $opt_master_myport + 7;
- $im_mysqld1_port= $opt_master_myport + 8;
- $im_mysqld2_port= $opt_master_myport + 9;
-
- if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
+ # Calculate baseport
+ $baseport= $build_thread * 10 + 10000;
+ if ( $baseport < 5001 or $baseport + 9 >= 32767 )
{
mtr_error("MTR_BUILD_THREAD number results in a port",
"outside 5001 - 32767",
- "($opt_master_myport - $opt_master_myport + 10)");
- }
-}
-
-
-sub datadir_list_setup () {
-
- # Make a list of all data_dirs
- for (my $idx= 0; $idx < $max_master_num; $idx++)
- {
- push(@data_dir_lst, $master->[$idx]->{'path_myddir'});
+ "($baseport - $baseport + 9)");
}
- for (my $idx= 0; $idx < $max_slave_num; $idx++)
- {
- push(@data_dir_lst, $slave->[$idx]->{'path_myddir'});
- }
+ mtr_report("Using MTR_BUILD_THREAD $build_thread,",
+ "with reserved ports $baseport..".($baseport+9));
- unless ($opt_skip_im)
- {
- foreach my $instance (@{$instance_manager->{'instances'}})
- {
- push(@data_dir_lst, $instance->{'path_datadir'});
- }
- }
}
-##############################################################################
-#
-# Set paths to various executable programs
-#
-##############################################################################
-
-
-sub collect_mysqld_features () {
+sub collect_mysqld_features {
my $found_variable_list_start= 0;
- my $tmpdir;
- if ( $opt_tmpdir ) {
- # Use the requested tmpdir
- mkpath($opt_tmpdir) if (! -d $opt_tmpdir);
- $tmpdir= $opt_tmpdir;
- }
- else {
- $tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function
+ my $use_tmpdir;
+ if ( defined $opt_tmpdir and -d $opt_tmpdir){
+ # Create the tempdir in $opt_tmpdir
+ $use_tmpdir= $opt_tmpdir;
}
+ my $tmpdir= tempdir(CLEANUP => 0, # Directory removed by this function
+ DIR => $use_tmpdir);
#
- # Execute "mysqld --help --verbose" to get a list
+ # Execute "mysqld --no-defaults --help --verbose" to get a
# list of all features and settings
#
# --no-defaults and --skip-grant-tables are to avoid loading
@@ -1461,7 +1315,18 @@ sub collect_mysqld_features () {
#
# --datadir must exist, mysqld will chdir into it
#
- my $list= `$exe_mysqld --no-defaults --datadir=$tmpdir --language=$path_language --skip-grant-tables --verbose --help`;
+ my $args;
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--datadir=%s", mixed_path($tmpdir));
+ mtr_add_arg($args, "--language=%s", $path_language);
+ mtr_add_arg($args, "--skip-grant-tables");
+ mtr_add_arg($args, "--verbose");
+ mtr_add_arg($args, "--help");
+
+ my $exe_mysqld= find_mysqld($basedir);
+ my $cmd= join(" ", $exe_mysqld, @$args);
+ my $list= `$cmd`;
foreach my $line (split('\n', $list))
{
@@ -1516,99 +1381,75 @@ sub collect_mysqld_features () {
}
}
}
- rmtree($tmpdir) if (!$opt_tmpdir);
+ rmtree($tmpdir);
mtr_error("Could not find version of MySQL") unless $mysql_version_id;
mtr_error("Could not find variabes list") unless $found_variable_list_start;
}
-sub run_query($$) {
- my ($mysqld, $query)= @_;
+
+sub collect_mysqld_features_from_running_server ()
+{
+ my $mysql= mtr_exe_exists("$path_client_bindir/mysql");
my $args;
mtr_init_args(\$args);
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--user=%s", $opt_user);
- mtr_add_arg($args, "--port=%d", $mysqld->{'port'});
- mtr_add_arg($args, "--socket=%s", $mysqld->{'path_sock'});
- mtr_add_arg($args, "--silent"); # Tab separated output
- mtr_add_arg($args, "-e '%s'", $query);
-
- my $cmd= "$exe_mysql " . join(' ', @$args);
- mtr_verbose("cmd: $cmd");
- return `$cmd`;
-}
+ while (my ($option, $value)= each( %opts_extern )) {
+ mtr_add_arg($args, "--$option=$value");
+ }
-sub collect_mysqld_features_from_running_server ()
-{
- my $list= run_query($master->[0], "use mysql; SHOW VARIABLES");
+ mtr_add_arg($args, "--silent"); # Tab separated output
+ mtr_add_arg($args, "-e '%s'", "use mysql; SHOW VARIABLES");
+ my $cmd= "$mysql " . join(' ', @$args);
+ mtr_verbose("cmd: $cmd");
- foreach my $line (split('\n', $list))
+ my $list = `$cmd` or
+ mtr_error("Could not connect to extern server using command: '$cmd'");
+ foreach my $line (split('\n', $list ))
{
# Put variables into hash
if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ )
{
- print "$1=\"$2\"\n";
+ # print "$1=\"$2\"\n";
$mysqld_variables{$1}= $2;
}
}
+
+ # Parse version
+ my $version_str= $mysqld_variables{'version'};
+ if ( $version_str =~ /^([0-9]*)\.([0-9]*)\.([0-9]*)/ )
+ {
+ #print "Major: $1 Minor: $2 Build: $3\n";
+ $mysql_version_id= $1*10000 + $2*100 + $3;
+ #print "mysql_version_id: $mysql_version_id\n";
+ mtr_report("MySQL Version $1.$2.$3");
+ }
+ mtr_error("Could not find version of MySQL") unless $mysql_version_id;
}
-sub executable_setup_im () {
+sub find_mysqld {
+ my ($mysqld_basedir)= @_;
- # Look for instance manager binary - mysqlmanager
- $exe_im=
- mtr_exe_maybe_exists(
- "$glob_basedir/server-tools/instance-manager/mysqlmanager",
- "$glob_basedir/libexec/mysqlmanager",
- "$glob_basedir/bin/mysqlmanager",
- "$glob_basedir/sbin/mysqlmanager");
+ my @mysqld_names= ("mysqld", "mysqld-max-nt", "mysqld-max",
+ "mysqld-nt");
- return ($exe_im eq "");
-}
+ if ( $opt_debug ){
+ # Put mysqld-debug first in the list of binaries to look for
+ mtr_verbose("Adding mysqld-debug first in list of binaries to look for");
+ unshift(@mysqld_names, "mysqld-debug");
+ }
-sub executable_setup_ndb () {
-
- # Look for ndb tols and binaries
- my $ndb_path= mtr_file_exists("$glob_basedir/ndb",
- "$glob_basedir/storage/ndb",
- "$glob_basedir/bin");
-
- $exe_ndbd=
- mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd",
- "$ndb_path/ndbd",
- "$glob_basedir/libexec/ndbd");
- $exe_ndb_mgm=
- mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm",
- "$ndb_path/ndb_mgm");
- $exe_ndb_mgmd=
- mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd",
- "$ndb_path/ndb_mgmd",
- "$glob_basedir/libexec/ndb_mgmd");
- $exe_ndb_waiter=
- mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter",
- "$ndb_path/ndb_waiter");
-
- # May not exist
- $path_ndb_tools_dir= mtr_file_exists("$ndb_path/tools",
- "$ndb_path");
- # May not exist
- $path_ndb_examples_dir=
- mtr_file_exists("$ndb_path/ndbapi-examples",
- "$ndb_path/examples");
- # May not exist
- $exe_ndb_example=
- mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple");
-
- return ( $exe_ndbd eq "" or
- $exe_ndb_mgm eq "" or
- $exe_ndb_mgmd eq "" or
- $exe_ndb_waiter eq "");
+ return my_find_bin($mysqld_basedir,
+ ["sql", "libexec", "sbin", "bin"],
+ [@mysqld_names]);
}
+
sub executable_setup () {
#
@@ -1626,105 +1467,35 @@ sub executable_setup () {
}
}
- # Look for my_print_defaults
- $exe_my_print_defaults=
- mtr_exe_exists(vs_config_dirs('extra', 'my_print_defaults'),
- "$path_client_bindir/my_print_defaults",
- "$glob_basedir/extra/my_print_defaults");
-
- # Look for perror
- $exe_perror= mtr_exe_exists(vs_config_dirs('extra', 'perror'),
- "$glob_basedir/extra/perror",
- "$path_client_bindir/perror");
-
# Look for the client binaries
- $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
- $exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
- $exe_mysqlimport= mtr_exe_exists("$path_client_bindir/mysqlimport");
- $exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
- $exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
$exe_mysql= mtr_exe_exists("$path_client_bindir/mysql");
- if (!$opt_extern)
+ if ( ! $opt_skip_ndbcluster )
{
- # Look for SQL scripts directory
- if ( mtr_file_exists("$path_share/mysql_system_tables.sql") ne "")
- {
- # The SQL scripts are in path_share
- $path_sql_dir= $path_share;
- }
- else
- {
- $path_sql_dir= mtr_path_exists("$glob_basedir/share",
- "$glob_basedir/scripts");
- }
+ $exe_ndbd=
+ my_find_bin($basedir,
+ ["storage/ndb/src/kernel", "libexec", "sbin", "bin"],
+ "ndbd");
- if ( $mysql_version_id >= 50100 )
- {
- $exe_mysqlslap= mtr_exe_exists("$path_client_bindir/mysqlslap");
- }
- if ( $mysql_version_id >= 50000 and !$glob_use_embedded_server )
- {
- $exe_mysql_upgrade= mtr_exe_exists("$path_client_bindir/mysql_upgrade")
- }
- else
- {
- $exe_mysql_upgrade= "";
- }
+ $exe_ndb_mgmd=
+ my_find_bin($basedir,
+ ["storage/ndb/src/mgmsrv", "libexec", "sbin", "bin"],
+ "ndb_mgmd");
- if ( ! $glob_win32 )
- {
- # Look for mysql_fix_system_table script
- $exe_mysql_fix_system_tables=
- mtr_script_exists("$glob_basedir/scripts/mysql_fix_privilege_tables",
- "$path_client_bindir/mysql_fix_privilege_tables");
- }
-
- # Look for mysql_fix_privilege_tables.sql script
- $file_mysql_fix_privilege_tables=
- mtr_file_exists("$glob_basedir/scripts/mysql_fix_privilege_tables.sql",
- "$glob_basedir/share/mysql_fix_privilege_tables.sql",
- "$glob_basedir/share/mysql/mysql_fix_privilege_tables.sql");
-
- if ( ! $opt_skip_ndbcluster and executable_setup_ndb())
- {
- mtr_warning("Could not find all required ndb binaries, " .
- "all ndb tests will fail, use --skip-ndbcluster to " .
- "skip testing it.");
-
- foreach my $cluster (@{$clusters})
- {
- $cluster->{"executable_setup_failed"}= 1;
- }
- }
-
- if ( ! $opt_skip_im and executable_setup_im())
- {
- mtr_warning("Could not find all required instance manager binaries, " .
- "all im tests will fail, use --skip-im to " .
- "continue without instance manager");
- $instance_manager->{"executable_setup_failed"}= 1;
- }
-
- # Look for the udf_example library
- $lib_udf_example=
- mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'),
- "$glob_basedir/sql/.libs/udf_example.so",);
-
- # Look for the ha_example library
- $lib_example_plugin=
- mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
- "$glob_basedir/storage/example/.libs/ha_example.so",);
+ $exe_ndb_waiter=
+ my_find_bin($basedir,
+ ["storage/ndb/tools/", "bin"],
+ "ndb_waiter");
}
# Look for mysqltest executable
- if ( $glob_use_embedded_server )
+ if ( $opt_embedded_server )
{
$exe_mysqltest=
mtr_exe_exists(vs_config_dirs('libmysqld/examples','mysqltest_embedded'),
- "$glob_basedir/libmysqld/examples/mysqltest_embedded",
+ "$basedir/libmysqld/examples/mysqltest_embedded",
"$path_client_bindir/mysqltest_embedded");
}
else
@@ -1732,120 +1503,115 @@ sub executable_setup () {
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
}
- # Look for mysql_client_test executable which may _not_ exist in
- # some versions, test using it should be skipped
- if ( $glob_use_embedded_server )
- {
- $exe_mysql_client_test=
- mtr_exe_maybe_exists(
- vs_config_dirs('libmysqld/examples', 'mysql_client_test_embedded'),
- "$glob_basedir/libmysqld/examples/mysql_client_test_embedded");
- }
- else
- {
- $exe_mysql_client_test=
- mtr_exe_maybe_exists(vs_config_dirs('tests', 'mysql_client_test'),
- "$glob_basedir/tests/mysql_client_test",
- "$glob_basedir/bin/mysql_client_test");
- }
-
- # Look for bug25714 executable which may _not_ exist in
- # some versions, test using it should be skipped
- $exe_bug25714=
- mtr_exe_maybe_exists(vs_config_dirs('tests', 'bug25714'),
- "$glob_basedir/tests/bug25714");
}
-sub generate_cmdline_mysqldump ($) {
- my($mysqld) = @_;
- return
- mtr_native_path($exe_mysqldump) .
- " --no-defaults -uroot --debug-check " .
- "--port=$mysqld->{'port'} " .
- "--socket=$mysqld->{'path_sock'} --password=";
+sub client_debug_arg($$) {
+ my ($args, $client_name)= @_;
+
+ if ( $opt_debug ) {
+ mtr_add_arg($args,
+ "--debug=d:t:A,%s/log/%s.trace",
+ $path_vardir_trace, $client_name)
+ }
}
-##############################################################################
-#
-# Set environment to be used by childs of this process for
-# things that are constant duting the whole lifetime of mysql-test-run.pl
-#
-##############################################################################
+sub mysql_fix_arguments () {
-sub mysql_client_test_arguments()
-{
- my $exe= $exe_mysql_client_test;
+ return "" if ( IS_WINDOWS );
+ my $exe=
+ mtr_script_exists("$basedir/scripts/mysql_fix_privilege_tables",
+ "$path_client_bindir/mysql_fix_privilege_tables");
my $args;
mtr_init_args(\$args);
- if ( $opt_valgrind_mysqltest )
- {
- valgrind_arguments($args, \$exe);
- }
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--testcase");
- mtr_add_arg($args, "--user=root");
- mtr_add_arg($args, "--port=$master->[0]->{'port'}");
- mtr_add_arg($args, "--socket=$master->[0]->{'path_sock'}");
+ mtr_add_arg($args, "--basedir=%s", $basedir);
+ mtr_add_arg($args, "--bindir=%s", $path_client_bindir);
+ mtr_add_arg($args, "--verbose");
+ return mtr_args2str($exe, @$args);
+}
- if ( $opt_extern || $mysql_version_id >= 50000 )
- {
- mtr_add_arg($args, "--vardir=$opt_vardir")
- }
- if ( $opt_debug )
- {
- mtr_add_arg($args,
- "--debug=d:t:A,$path_vardir_trace/log/mysql_client_test.trace");
- }
+sub client_arguments ($) {
+ my $client_name= shift;
+ my $client_exe= mtr_exe_exists("$path_client_bindir/$client_name");
- if ( $glob_use_embedded_server )
- {
- mtr_add_arg($args,
- " -A --language=$path_language");
- mtr_add_arg($args,
- " -A --datadir=$slave->[0]->{'path_myddir'}");
- mtr_add_arg($args,
- " -A --character-sets-dir=$path_charsetsdir");
+ my $args;
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ client_debug_arg($args, $client_name);
+ return mtr_args2str($client_exe, @$args);
+}
+
+
+sub mysqlslap_arguments () {
+ my $exe= mtr_exe_maybe_exists("$path_client_bindir/mysqlslap");
+ if ( $exe eq "" ) {
+ # mysqlap was not found
+
+ if (defined $mysql_version_id and $mysql_version_id >= 50100 ) {
+ mtr_error("Could not find the mysqlslap binary");
+ }
+ return ""; # Don't care about mysqlslap
}
- return join(" ", $exe, @$args);
+ my $args;
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ client_debug_arg($args, "mysqlslap");
+ return mtr_args2str($exe, @$args);
}
-sub mysql_upgrade_arguments()
-{
- my $exe= $exe_mysql_upgrade;
+
+sub mysqldump_arguments ($) {
+ my($group_suffix) = @_;
+ my $exe= mtr_exe_exists("$path_client_bindir/mysqldump");
my $args;
mtr_init_args(\$args);
-# if ( $opt_valgrind_mysql_ugrade )
-# {
-# valgrind_arguments($args, \$exe);
-# }
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $group_suffix);
+ client_debug_arg($args, "mysqldump-$group_suffix");
+ return mtr_args2str($exe, @$args);
+}
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--user=root");
- mtr_add_arg($args, "--port=$master->[0]->{'port'}");
- mtr_add_arg($args, "--socket=$master->[0]->{'path_sock'}");
- mtr_add_arg($args, "--datadir=$master->[0]->{'path_myddir'}");
- mtr_add_arg($args, "--basedir=$glob_basedir");
- mtr_add_arg($args, "--tmpdir=$opt_tmpdir");
- if ( $opt_debug )
- {
- mtr_add_arg($args,
- "--debug=d:t:A,$path_vardir_trace/log/mysql_upgrade.trace");
+sub mysql_client_test_arguments(){
+ my $exe;
+ # mysql_client_test executable may _not_ exist
+ if ( $opt_embedded_server ) {
+ $exe= mtr_exe_maybe_exists(
+ vs_config_dirs('libmysqld/examples','mysql_client_test_embedded'),
+ "$basedir/libmysqld/examples/mysql_client_test_embedded",
+ "$basedir/bin/mysql_client_test_embedded");
+ } else {
+ $exe= mtr_exe_maybe_exists(vs_config_dirs('tests', 'mysql_client_test'),
+ "$basedir/tests/mysql_client_test",
+ "$basedir/bin/mysql_client_test");
}
- return join(" ", $exe, @$args);
+ my $args;
+ mtr_init_args(\$args);
+ if ( $opt_valgrind_mysqltest ) {
+ valgrind_arguments($args, \$exe);
+ }
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--testcase");
+ mtr_add_arg($args, "--vardir=$opt_vardir");
+ client_debug_arg($args,"mysql_client_test");
+
+ return mtr_args2str($exe, @$args);
}
-# Note that some env is setup in spawn/run, in "mtr_process.pl"
-sub environment_setup () {
+#
+# Set environment to be used by childs of this process for
+# things that are constant during the whole lifetime of mysql-test-run
+#
+sub environment_setup {
umask(022);
@@ -1862,24 +1628,67 @@ sub environment_setup () {
# are used in favor of the system installed ones
if ( $source_dist )
{
- push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
- "$glob_basedir/libmysql_r/.libs/",
- "$glob_basedir/zlib.libs/");
+ push(@ld_library_paths, "$basedir/libmysql/.libs/",
+ "$basedir/libmysql_r/.libs/",
+ "$basedir/zlib.libs/");
}
else
{
- push(@ld_library_paths, "$glob_basedir/lib");
+ push(@ld_library_paths, "$basedir/lib");
}
}
- # --------------------------------------------------------------------------
+ # --------------------------------------------------------------------------
# Add the path where libndbclient can be found
# --------------------------------------------------------------------------
- if ( $glob_ndbcluster_supported )
+ if ( !$opt_skip_ndbcluster )
{
- push(@ld_library_paths, "$glob_basedir/storage/ndb/src/.libs");
+ push(@ld_library_paths, "$basedir/storage/ndb/src/.libs");
+ }
+
+ # --------------------------------------------------------------------------
+ # Add the path where mysqld will find udf_example.so
+ # --------------------------------------------------------------------------
+ my $lib_udf_example=
+ mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'),
+ "$basedir/sql/.libs/udf_example.so",);
+
+ if ( $lib_udf_example )
+ {
+ push(@ld_library_paths, dirname($lib_udf_example));
+ }
+
+ $ENV{'UDF_EXAMPLE_LIB'}=
+ ($lib_udf_example ? basename($lib_udf_example) : "");
+ $ENV{'UDF_EXAMPLE_LIB_OPT'}= "--plugin-dir=".
+ ($lib_udf_example ? dirname($lib_udf_example) : "");
+
+ # --------------------------------------------------------------------------
+ # Add the path where mysqld will find ha_example.so
+ # --------------------------------------------------------------------------
+ if ($mysql_version_id >= 50100) {
+ my $lib_example_plugin=
+ mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
+ "$basedir/storage/example/.libs/ha_example.so",);
+ $ENV{'EXAMPLE_PLUGIN'}=
+ ($lib_example_plugin ? basename($lib_example_plugin) : "");
+ $ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
+ ($lib_example_plugin ? dirname($lib_example_plugin) : "");
+
}
+ # ----------------------------------------------------
+ # Add the path where mysqld will find mypluglib.so
+ # ----------------------------------------------------
+ my $lib_simple_parser=
+ mtr_file_exists(vs_config_dirs('plugin/fulltext', 'mypluglib.dll'),
+ "$basedir/plugin/fulltext/.libs/mypluglib.so",);
+
+ $ENV{'SIMPLE_PARSER'}=
+ ($lib_simple_parser ? basename($lib_simple_parser) : "");
+ $ENV{'SIMPLE_PARSER_OPT'}= "--plugin-dir=".
+ ($lib_simple_parser ? dirname($lib_simple_parser) : "");
+
# --------------------------------------------------------------------------
# Valgrind need to be run with debug libraries otherwise it's almost
# impossible to add correct supressions, that means if "/usr/lib/debug"
@@ -1894,7 +1703,8 @@ sub environment_setup () {
my $deb_version;
if ( $opt_valgrind and -d $debug_libraries_path and
(! -e '/etc/debian_version' or
- ($deb_version= mtr_grab_file('/etc/debian_version')) !~ /^[0-9]+\.[0-9]$/ or
+ ($deb_version=
+ mtr_grab_file('/etc/debian_version')) !~ /^[0-9]+\.[0-9]$/ or
$deb_version > 3.1 ) )
{
push(@ld_library_paths, $debug_libraries_path);
@@ -1922,14 +1732,10 @@ sub environment_setup () {
split(':', $ENV{'LIBPATH'}) : ());
mtr_debug("LIBPATH: $ENV{'LIBPATH'}");
- # --------------------------------------------------------------------------
- # Also command lines in .opt files may contain env vars
- # --------------------------------------------------------------------------
-
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
$ENV{'UMASK'}= "0660"; # The octal *string*
$ENV{'UMASK_DIR'}= "0770"; # The octal *string*
-
+
#
# MySQL tests can produce output in various character sets
# (especially, ctype_xxx.test). To avoid confusing Perl
@@ -1940,307 +1746,109 @@ sub environment_setup () {
#
$ENV{'LC_ALL'}= "C";
$ENV{'LC_CTYPE'}= "C";
-
+
$ENV{'LC_COLLATE'}= "C";
- $ENV{'USE_RUNNING_SERVER'}= $opt_extern;
+ $ENV{'USE_RUNNING_SERVER'}= using_extern();
$ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;
- $ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
+ $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'} || 3306;
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
- $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_sock'};
- $ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_sock'};
- $ENV{'MASTER_MYPORT'}= $master->[0]->{'port'};
- $ENV{'MASTER_MYPORT1'}= $master->[1]->{'port'};
- $ENV{'SLAVE_MYSOCK'}= $slave->[0]->{'path_sock'};
- $ENV{'SLAVE_MYPORT'}= $slave->[0]->{'port'};
- $ENV{'SLAVE_MYPORT1'}= $slave->[1]->{'port'};
- $ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'};
- $ENV{'MYSQL_TCP_PORT'}= $mysqld_variables{'port'};
- $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'};
-
- $ENV{'IM_PATH_SOCK'}= $instance_manager->{path_sock};
- $ENV{'IM_USERNAME'}= $instance_manager->{admin_login};
- $ENV{'IM_PASSWORD'}= $instance_manager->{admin_password};
- $ENV{MTR_BUILD_THREAD}= $opt_mtr_build_thread;
-
- $ENV{'EXE_MYSQL'}= $exe_mysql;
-
+ $ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
# ----------------------------------------------------
# Setup env for NDB
# ----------------------------------------------------
if ( ! $opt_skip_ndbcluster )
{
- $ENV{'NDB_MGM'}= $exe_ndb_mgm;
+ $ENV{'NDB_MGM'}=
+ my_find_bin($basedir,
+ ["storage/ndb/src/mgmclient", "bin"],
+ "ndb_mgm");
- $ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port;
- $ENV{'NDBCLUSTER_PORT_SLAVE'}= $opt_ndbcluster_port_slave;
+ $ENV{'NDB_TOOLS_DIR'}=
+ my_find_dir($basedir,
+ ["storage/ndb/tools", "bin"]);
- $ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test;
+ $ENV{'NDB_EXAMPLES_DIR'}=
+ my_find_dir($basedir,
+ ["storage/ndb/ndbapi-examples", "bin"]);
- $ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'};
- $ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
- $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
- $ENV{'NDB_TOOLS_OUTPUT'}= $path_ndb_testrun_log;
+ $ENV{'NDB_EXAMPLES_BINARY'}=
+ my_find_bin($basedir,
+ ["storage/ndb/ndbapi-examples/ndbapi_simple", "bin"],
+ "ndbapi_simple", NOT_REQUIRED);
- if ( $mysql_version_id >= 50000 )
- {
- $ENV{'NDB_EXAMPLES_DIR'}= $path_ndb_examples_dir;
- $ENV{'MY_NDB_EXAMPLES_BINARY'}= $exe_ndb_example;
- }
+ my $path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
+ $ENV{'NDB_TOOLS_OUTPUT'}= $path_ndb_testrun_log;
$ENV{'NDB_EXAMPLES_OUTPUT'}= $path_ndb_testrun_log;
}
# ----------------------------------------------------
- # Setup env for IM
+ # mysql clients
# ----------------------------------------------------
- if ( ! $opt_skip_im )
- {
- $ENV{'IM_EXE'}= $exe_im;
- $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid};
- $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid};
- $ENV{'IM_PORT'}= $instance_manager->{port};
- $ENV{'IM_DEFAULTS_PATH'}= $instance_manager->{defaults_file};
- $ENV{'IM_PASSWORD_PATH'}= $instance_manager->{password_file};
-
- $ENV{'IM_MYSQLD1_SOCK'}=
- $instance_manager->{instances}->[0]->{path_sock};
- $ENV{'IM_MYSQLD1_PORT'}=
- $instance_manager->{instances}->[0]->{port};
- $ENV{'IM_MYSQLD1_PATH_PID'}=
- $instance_manager->{instances}->[0]->{path_pid};
- $ENV{'IM_MYSQLD2_SOCK'}=
- $instance_manager->{instances}->[1]->{path_sock};
- $ENV{'IM_MYSQLD2_PORT'}=
- $instance_manager->{instances}->[1]->{port};
- $ENV{'IM_MYSQLD2_PATH_PID'}=
- $instance_manager->{instances}->[1]->{path_pid};
- }
-
- # ----------------------------------------------------
- # Setup env so childs can execute mysqlcheck
- # ----------------------------------------------------
- my $cmdline_mysqlcheck=
- mtr_native_path($exe_mysqlcheck) .
- " --no-defaults --debug-check -uroot " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'} --password=";
-
- if ( $opt_debug )
- {
- $cmdline_mysqlcheck .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlcheck.trace";
- }
- $ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck;
-
- # ----------------------------------------------------
- # Setup env to childs can execute myqldump
- # ----------------------------------------------------
- my $cmdline_mysqldump= generate_cmdline_mysqldump($master->[0]);
- my $cmdline_mysqldumpslave= generate_cmdline_mysqldump($slave->[0]);
-
- if ( $opt_debug )
- {
- $cmdline_mysqldump .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqldump-master.trace";
- $cmdline_mysqldumpslave .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqldump-slave.trace";
- }
- $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
- $ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
-
-
- # ----------------------------------------------------
- # Setup env so childs can execute mysqlslap
- # ----------------------------------------------------
- if ( $exe_mysqlslap )
- {
- my $cmdline_mysqlslap=
- mtr_native_path($exe_mysqlslap) .
- " -uroot " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'} --password= ";
+ $ENV{'MYSQL_CHECK'}= client_arguments("mysqlcheck");
+ $ENV{'MYSQL_DUMP'}= mysqldump_arguments(".1");
+ $ENV{'MYSQL_DUMP_SLAVE'}= mysqldump_arguments(".2");
+ $ENV{'MYSQL_SLAP'}= mysqlslap_arguments();
+ $ENV{'MYSQL_IMPORT'}= client_arguments("mysqlimport");
+ $ENV{'MYSQL_SHOW'}= client_arguments("mysqlshow");
+ $ENV{'MYSQL_BINLOG'}= client_arguments("mysqlbinlog");
+ $ENV{'MYSQL'}= client_arguments("mysql");
+ $ENV{'MYSQL_UPGRADE'}= client_arguments("mysql_upgrade");
+ $ENV{'MYSQLADMIN'}= native_path($exe_mysqladmin);
+ $ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments();
+ $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= mysql_fix_arguments();
+ $ENV{'EXE_MYSQL'}= $exe_mysql;
- if ( $opt_debug )
- {
- $cmdline_mysqlslap .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlslap.trace";
- }
- $ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap;
- }
-
- # ----------------------------------------------------
- # Setup env so childs can execute mysqlimport
# ----------------------------------------------------
- my $cmdline_mysqlimport=
- mtr_native_path($exe_mysqlimport) .
- " -uroot --debug-check " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'} --password=";
-
- if ( $opt_debug )
- {
- $cmdline_mysqlimport .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlimport.trace";
- }
- $ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
-
-
- # ----------------------------------------------------
- # Setup env so childs can execute mysqlshow
- # ----------------------------------------------------
- my $cmdline_mysqlshow=
- mtr_native_path($exe_mysqlshow) .
- " -uroot --debug-check " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'} --password=";
-
- if ( $opt_debug )
- {
- $cmdline_mysqlshow .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlshow.trace";
- }
- $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
-
- # ----------------------------------------------------
- # Setup env so childs can execute mysqlbinlog
- # ----------------------------------------------------
- my $cmdline_mysqlbinlog=
- mtr_native_path($exe_mysqlbinlog) .
- " --no-defaults --disable-force-if-open --debug-check";
- if ( !$opt_extern && $mysql_version_id >= 50000 )
- {
- $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
- }
- # Always use the given tmpdir for the LOAD files created
- # by mysqlbinlog
- $cmdline_mysqlbinlog .=" --local-load=$opt_tmpdir";
-
- if ( $opt_debug )
- {
- $cmdline_mysqlbinlog .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlbinlog.trace";
- }
- $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
-
- # ----------------------------------------------------
- # Setup env so childs can execute mysql
- # ----------------------------------------------------
- my $cmdline_mysql=
- mtr_native_path($exe_mysql) .
- " --no-defaults --debug-check --host=localhost --user=root --password= " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'} ".
- "--character-sets-dir=$path_charsetsdir";
-
- $ENV{'MYSQL'}= $cmdline_mysql;
-
- # ----------------------------------------------------
- # Setup env so childs can execute bug25714
- # ----------------------------------------------------
- $ENV{'MYSQL_BUG25714'}= $exe_bug25714;
-
- # ----------------------------------------------------
- # Setup env so childs can execute mysql_client_test
- # ----------------------------------------------------
- $ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments();
-
- # ----------------------------------------------------
- # Setup env so childs can execute mysql_upgrade
+ # bug25714 executable may _not_ exist in
+ # some versions, test using it should be skipped
# ----------------------------------------------------
- if ( !$opt_extern && $mysql_version_id >= 50000 )
- {
- $ENV{'MYSQL_UPGRADE'}= mysql_upgrade_arguments();
- }
+ my $exe_bug25714=
+ mtr_exe_maybe_exists(vs_config_dirs('tests', 'bug25714'),
+ "$basedir/tests/bug25714");
+ $ENV{'MYSQL_BUG25714'}= native_path($exe_bug25714);
# ----------------------------------------------------
- # Setup env so childs can execute mysql_fix_system_tables
+ # mysql_fix_privilege_tables.sql
# ----------------------------------------------------
- if ( !$opt_extern && ! $glob_win32 )
- {
- my $cmdline_mysql_fix_system_tables=
- "$exe_mysql_fix_system_tables --no-defaults --host=localhost " .
- "--user=root --password= " .
- "--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'}";
- $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
-
- }
+ my $file_mysql_fix_privilege_tables=
+ mtr_file_exists("$basedir/scripts/mysql_fix_privilege_tables.sql",
+ "$basedir/share/mysql_fix_privilege_tables.sql",
+ "$basedir/share/mysql/mysql_fix_privilege_tables.sql");
$ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
# ----------------------------------------------------
- # Setup env so childs can execute my_print_defaults
- # ----------------------------------------------------
- $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= mtr_native_path($exe_my_print_defaults);
-
- # ----------------------------------------------------
- # Setup env so childs can execute mysqladmin
- # ----------------------------------------------------
- $ENV{'MYSQLADMIN'}= mtr_native_path($exe_mysqladmin);
-
- # ----------------------------------------------------
- # Setup env so childs can execute perror
+ # my_print_defaults
# ----------------------------------------------------
- $ENV{'MY_PERROR'}= mtr_native_path($exe_perror);
-
- # ----------------------------------------------------
- # Add the path where mysqld will find udf_example.so
- # ----------------------------------------------------
- $ENV{'UDF_EXAMPLE_LIB'}=
- ($lib_udf_example ? basename($lib_udf_example) : "");
- $ENV{'UDF_EXAMPLE_LIB_OPT'}=
- ($lib_udf_example ? "--plugin_dir=" . dirname($lib_udf_example) : "");
-
- # ----------------------------------------------------
- # Add the path where mysqld will find ha_example.so
- # ----------------------------------------------------
- $ENV{'EXAMPLE_PLUGIN'}=
- ($lib_example_plugin ? basename($lib_example_plugin) : "");
- $ENV{'EXAMPLE_PLUGIN_OPT'}=
- ($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : "");
+ my $exe_my_print_defaults=
+ mtr_exe_exists(vs_config_dirs('extra', 'my_print_defaults'),
+ "$path_client_bindir/my_print_defaults",
+ "$basedir/extra/my_print_defaults");
+ $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= native_path($exe_my_print_defaults);
# ----------------------------------------------------
# Setup env so childs can execute myisampack and myisamchk
# ----------------------------------------------------
- $ENV{'MYISAMCHK'}= mtr_native_path(mtr_exe_exists(
+ $ENV{'MYISAMCHK'}= native_path(mtr_exe_exists(
vs_config_dirs('storage/myisam', 'myisamchk'),
vs_config_dirs('myisam', 'myisamchk'),
"$path_client_bindir/myisamchk",
- "$glob_basedir/storage/myisam/myisamchk",
- "$glob_basedir/myisam/myisamchk"));
- $ENV{'MYISAMPACK'}= mtr_native_path(mtr_exe_exists(
+ "$basedir/storage/myisam/myisamchk",
+ "$basedir/myisam/myisamchk"));
+ $ENV{'MYISAMPACK'}= native_path(mtr_exe_exists(
vs_config_dirs('storage/myisam', 'myisampack'),
vs_config_dirs('myisam', 'myisampack'),
"$path_client_bindir/myisampack",
- "$glob_basedir/storage/myisam/myisampack",
- "$glob_basedir/myisam/myisampack"));
+ "$basedir/storage/myisam/myisampack",
+ "$basedir/myisam/myisampack"));
# ----------------------------------------------------
- # We are nice and report a bit about our settings
+ # perror
# ----------------------------------------------------
- if (!$opt_extern)
- {
- print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n";
- print "Using MASTER_MYPORT = $ENV{MASTER_MYPORT}\n";
- print "Using MASTER_MYPORT1 = $ENV{MASTER_MYPORT1}\n";
- print "Using SLAVE_MYPORT = $ENV{SLAVE_MYPORT}\n";
- print "Using SLAVE_MYPORT1 = $ENV{SLAVE_MYPORT1}\n";
- print "Using SLAVE_MYPORT2 = $ENV{SLAVE_MYPORT2}\n";
- if ( ! $opt_skip_ndbcluster )
- {
- print "Using NDBCLUSTER_PORT = $ENV{NDBCLUSTER_PORT}\n";
- if ( ! $opt_skip_ndbcluster_slave )
- {
- print "Using NDBCLUSTER_PORT_SLAVE = $ENV{NDBCLUSTER_PORT_SLAVE}\n";
- }
- }
- if ( ! $opt_skip_im )
- {
- print "Using IM_PORT = $ENV{IM_PORT}\n";
- print "Using IM_MYSQLD1_PORT = $ENV{IM_MYSQLD1_PORT}\n";
- print "Using IM_MYSQLD2_PORT = $ENV{IM_MYSQLD2_PORT}\n";
- }
- }
+ my $exe_perror= mtr_exe_exists(vs_config_dirs('extra', 'perror'),
+ "$basedir/extra/perror",
+ "$path_client_bindir/perror");
+ $ENV{'MY_PERROR'}= native_path($exe_perror);
# Create an environment variable to make it possible
# to detect that valgrind is being used from test cases
@@ -2249,52 +1857,6 @@ sub environment_setup () {
}
-##############################################################################
-#
-# If we get a ^C, we try to clean up before termination
-#
-##############################################################################
-# FIXME check restrictions what to do in a signal handler
-
-sub signal_setup () {
- $SIG{INT}= \&handle_int_signal;
-}
-
-
-sub handle_int_signal () {
- $SIG{INT}= 'DEFAULT'; # If we get a ^C again, we die...
- mtr_warning("got INT signal, cleaning up.....");
- stop_all_servers();
- mtr_error("We die from ^C signal from user");
-}
-
-
-##############################################################################
-#
-# Handle left overs from previous runs
-#
-##############################################################################
-
-sub kill_running_servers () {
-
- if ( $opt_fast or $glob_use_embedded_server )
- {
- # FIXME is embedded server really using PID files?!
- unlink($master->[0]->{'path_pid'});
- unlink($master->[1]->{'path_pid'});
- unlink($slave->[0]->{'path_pid'});
- unlink($slave->[1]->{'path_pid'});
- unlink($slave->[2]->{'path_pid'});
- }
- else
- {
- # Ensure that no old mysqld test servers are running
- # This is different from terminating processes we have
- # started from this run of the script, this is terminating
- # leftovers from previous runs.
- mtr_kill_leftovers();
- }
-}
#
# Remove var and any directories in var/ created by previous
@@ -2302,11 +1864,11 @@ sub kill_running_servers () {
#
sub remove_stale_vardir () {
- mtr_report("Removing Stale Files");
+ mtr_report("Removing old var directory...");
# Safety!
mtr_error("No, don't remove the vardir when running with --extern")
- if $opt_extern;
+ if using_extern();
mtr_verbose("opt_vardir: $opt_vardir");
if ( $opt_vardir eq $default_vardir )
@@ -2318,30 +1880,22 @@ sub remove_stale_vardir () {
{
# var is a symlink
- if ( $opt_mem and readlink($opt_vardir) eq $opt_mem )
+ if ( $opt_mem )
{
# Remove the directory which the link points at
mtr_verbose("Removing " . readlink($opt_vardir));
- mtr_rmtree(readlink($opt_vardir));
+ rmtree(readlink($opt_vardir));
# Remove the "var" symlink
mtr_verbose("unlink($opt_vardir)");
unlink($opt_vardir);
}
- elsif ( $opt_mem )
- {
- # Just remove the "var" symlink
- mtr_report("WARNING: Removing '$opt_vardir' symlink it's wrong");
-
- mtr_verbose("unlink($opt_vardir)");
- unlink($opt_vardir);
- }
else
{
# Some users creates a soft link in mysql-test/var to another area
# - allow it, but remove all files in it
- mtr_report("WARNING: Using the 'mysql-test/var' symlink");
+ mtr_report(" - WARNING: Using the 'mysql-test/var' symlink");
# Make sure the directory where it points exist
mtr_error("The destination for symlink $opt_vardir does not exist")
@@ -2350,7 +1904,7 @@ sub remove_stale_vardir () {
foreach my $bin ( glob("$opt_vardir/*") )
{
mtr_verbose("Removing bin $bin");
- mtr_rmtree($bin);
+ rmtree($bin);
}
}
}
@@ -2358,7 +1912,7 @@ sub remove_stale_vardir () {
{
# Remove the entire "var" dir
mtr_verbose("Removing $opt_vardir/");
- mtr_rmtree("$opt_vardir/");
+ rmtree("$opt_vardir/");
}
if ( $opt_mem )
@@ -2367,7 +1921,7 @@ sub remove_stale_vardir () {
# remove the $opt_mem dir to assure the symlink
# won't point at an old directory
mtr_verbose("Removing $opt_mem");
- mtr_rmtree($opt_mem);
+ rmtree($opt_mem);
}
}
@@ -2380,19 +1934,24 @@ sub remove_stale_vardir () {
# Remove the var/ dir in mysql-test dir if any
# this could be an old symlink that shouldn't be there
mtr_verbose("Removing $default_vardir");
- mtr_rmtree($default_vardir);
+ rmtree($default_vardir);
# Remove the "var" dir
mtr_verbose("Removing $opt_vardir/");
- mtr_rmtree("$opt_vardir/");
+ rmtree("$opt_vardir/");
}
+ # Remove the "tmp" dir
+ mtr_verbose("Removing $opt_tmpdir/");
+ rmtree("$opt_tmpdir/");
}
+
+
#
# Create var and the directories needed in var
#
sub setup_vardir() {
- mtr_report("Creating Directories");
+ mtr_report("Creating var directory '$opt_vardir'...");
if ( $opt_vardir eq $default_vardir )
{
@@ -2413,7 +1972,7 @@ sub setup_vardir() {
mtr_verbose("Creating $opt_mem");
mkpath($opt_mem);
- mtr_report("Symlinking 'var' to '$opt_mem'");
+ mtr_report(" - symlinking 'var' to '$opt_mem'");
symlink($opt_mem, $opt_vardir);
}
}
@@ -2433,33 +1992,23 @@ sub setup_vardir() {
mkpath("$opt_vardir/log");
mkpath("$opt_vardir/run");
+
+ # Create var/tmp and tmp - they might be different
mkpath("$opt_vardir/tmp");
- mkpath($opt_tmpdir) if $opt_tmpdir ne "$opt_vardir/tmp";
+ mkpath($opt_tmpdir) if ($opt_tmpdir ne "$opt_vardir/tmp");
- if ($master->[0]->{'path_sock'} !~ m/^$opt_tmpdir/)
- {
- mtr_report("Symlinking $master->[0]->{'path_sock'}");
- symlink($master->[0]->{'path_sock'}, "$opt_tmpdir/master.sock");
+ # On some operating systems, there is a limit to the length of a
+ # UNIX domain socket's path far below PATH_MAX.
+ # Don't allow that to happen
+ if (check_socket_path_length("$opt_tmpdir/testsocket.sock")){
+ mtr_error("Socket path '$opt_tmpdir' too long, it would be ",
+ "truncated and thus not possible to use for connection to ",
+ "MySQL Server. Set a shorter with --tmpdir=<path> option");
}
- # Create new data dirs
- foreach my $data_dir (@data_dir_lst)
- {
- mkpath("$data_dir/mysql");
- mkpath("$data_dir/test");
- }
-
- # Make a link std_data_ln in var/ that points to std_data
- if ( ! $glob_win32 )
- {
- symlink("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
- }
- else
- {
- # on windows, copy all files from std_data into var/std_data_ln
- mkpath("$opt_vardir/std_data_ln");
- mtr_copy_dir("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
- }
+ # copy all files from std_data into var/std_data
+ # and make them world readable
+ copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022");
# Remove old log files
foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
@@ -2469,9 +2018,11 @@ sub setup_vardir() {
}
+#
+# Check if running as root
+# i.e a file can be read regardless what mode we set it to
+#
sub check_running_as_root () {
- # Check if running as root
- # i.e a file can be read regardless what mode we set it to
my $test_file= "$opt_vardir/test_running_as_root.txt";
mtr_tofile($test_file, "MySQL");
chmod(oct("0000"), $test_file);
@@ -2488,7 +2039,6 @@ sub check_running_as_root () {
# the file will not return 0000
my $file_mode= (stat($test_file))[2] & 07777;
- $ENV{'MYSQL_TEST_ROOT'}= "NO";
mtr_verbose("result: $result, file_mode: $file_mode");
if ($result eq "MySQL" && $file_mode == 0)
{
@@ -2499,19 +2049,15 @@ sub check_running_as_root () {
chmod(oct("0755"), $test_file);
unlink($test_file);
-
}
sub check_ssl_support ($) {
my $mysqld_variables= shift;
- if ($opt_skip_ssl || $opt_extern)
+ if ($opt_skip_ssl)
{
- if (!$opt_extern)
- {
- mtr_report("Skipping SSL");
- }
+ mtr_report(" - skipping SSL");
$opt_ssl_supported= 0;
$opt_ssl= 0;
return;
@@ -2524,12 +2070,12 @@ sub check_ssl_support ($) {
mtr_error("Couldn't find support for SSL");
return;
}
- mtr_report("Skipping SSL, mysqld not compiled with SSL");
+ mtr_report(" - skipping SSL, mysqld not compiled with SSL");
$opt_ssl_supported= 0;
$opt_ssl= 0;
return;
}
- mtr_report("Setting mysqld to support SSL connections");
+ mtr_report(" - SSL connections supported");
$opt_ssl_supported= 1;
}
@@ -2539,7 +2085,7 @@ sub check_debug_support ($) {
if ( ! $mysqld_variables->{'debug'} )
{
- #mtr_report("Binaries are not debug compiled");
+ #mtr_report(" - binaries are not debug compiled");
$debug_compiled_binaries= 0;
if ( $opt_debug )
@@ -2548,11 +2094,11 @@ sub check_debug_support ($) {
}
return;
}
- mtr_report("Binaries are debug compiled");
+ mtr_report(" - binaries are debug compiled");
$debug_compiled_binaries= 1;
}
-##############################################################################
+
#
# Helper function to handle configuration-based subdirectories which Visual
# Studio uses for storing binaries. If opt_vs_config is set, this returns
@@ -2561,155 +2107,57 @@ sub check_debug_support ($) {
#
# $exe can be undefined, if the directory itself will be used
#
-###############################################################################
-
sub vs_config_dirs ($$) {
my ($path_part, $exe) = @_;
$exe = "" if not defined $exe;
+ # Don't look in these dirs when not on windows
+ return () unless IS_WINDOWS;
+
if ($opt_vs_config)
{
- return ("$glob_basedir/$path_part/$opt_vs_config/$exe");
+ return ("$basedir/$path_part/$opt_vs_config/$exe");
}
- return ("$glob_basedir/$path_part/release/$exe",
- "$glob_basedir/$path_part/relwithdebinfo/$exe",
- "$glob_basedir/$path_part/debug/$exe");
+ return ("$basedir/$path_part/release/$exe",
+ "$basedir/$path_part/relwithdebinfo/$exe",
+ "$basedir/$path_part/debug/$exe");
}
-##############################################################################
-#
-# Start the ndb cluster
-#
-##############################################################################
sub check_ndbcluster_support ($) {
my $mysqld_variables= shift;
- if ($opt_skip_ndbcluster || $opt_extern)
+ if ($opt_skip_ndbcluster)
{
- if (!$opt_extern)
- {
- mtr_report("Skipping ndbcluster");
- }
- $opt_skip_ndbcluster_slave= 1;
+ mtr_report(" - skipping ndbcluster");
return;
}
- if ( ! $mysqld_variables->{'ndb-connectstring'} )
+ if ( ! $mysqld_variables{'ndb-connectstring'} )
{
- mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster");
- $opt_skip_ndbcluster= 1;
- $opt_skip_ndbcluster_slave= 1;
+ mtr_report(" - skipping ndbcluster, mysqld not compiled with ndbcluster");
+ $opt_skip_ndbcluster= 2;
return;
}
- $glob_ndbcluster_supported= 1;
- mtr_report("Using ndbcluster when necessary, mysqld supports it");
- if ( $mysql_version_id < 50100 )
- {
- # Slave cluster is not supported until 5.1
- $opt_skip_ndbcluster_slave= 1;
-
- }
+ mtr_report(" - using ndbcluster when necessary, mysqld supports it");
return;
}
-sub ndbcluster_start_install ($) {
- my $cluster= shift;
-
- mtr_report("Installing $cluster->{'name'} Cluster");
-
- mkdir($cluster->{'data_dir'});
-
- # Create a config file from template
- my $ndb_no_ord=512;
- my $ndb_no_attr=2048;
- my $ndb_con_op=105000;
- my $ndb_dmem="80M";
- my $ndb_imem="24M";
- my $ndb_pbmem="32M";
- my $nodes= $cluster->{'nodes'};
- my $ndb_host= "localhost";
- my $ndb_diskless= 0;
-
- if (!$opt_bench)
- {
- # Use a smaller configuration
- if ( $mysql_version_id < 50100 )
- {
- # 4.1 and 5.0 is using a "larger" --small configuration
- $ndb_no_ord=128;
- $ndb_con_op=10000;
- $ndb_dmem="40M";
- $ndb_imem="12M";
- }
- else
- {
- $ndb_no_ord=32;
- $ndb_con_op=10000;
- $ndb_dmem="20M";
- $ndb_imem="1M";
- $ndb_pbmem="4M";
- }
- }
-
- my $config_file_template= "ndb/ndb_config_${nodes}_node.ini";
- my $config_file= "$cluster->{'data_dir'}/config.ini";
-
- open(IN, $config_file_template)
- or mtr_error("Can't open $config_file_template: $!");
- open(OUT, ">", $config_file)
- or mtr_error("Can't write to $config_file: $!");
- while (<IN>)
- {
- chomp;
-
- s/CHOOSE_MaxNoOfAttributes/$ndb_no_attr/;
- s/CHOOSE_MaxNoOfOrderedIndexes/$ndb_no_ord/;
- s/CHOOSE_MaxNoOfConcurrentOperations/$ndb_con_op/;
- s/CHOOSE_DataMemory/$ndb_dmem/;
- s/CHOOSE_IndexMemory/$ndb_imem/;
- s/CHOOSE_Diskless/$ndb_diskless/;
- s/CHOOSE_HOSTNAME_.*/$ndb_host/;
- s/CHOOSE_FILESYSTEM/$cluster->{'data_dir'}/;
- s/CHOOSE_PORT_MGM/$cluster->{'port'}/;
- if ( $mysql_version_id < 50000 )
- {
- my $base_port= $cluster->{'port'} + 1;
- s/CHOOSE_PORT_TRANSPORTER/$base_port/;
- }
- s/CHOOSE_DiskPageBufferMemory/$ndb_pbmem/;
-
- print OUT "$_ \n";
- }
- close OUT;
- close IN;
-
-
- # Start cluster with "--initial"
-
- ndbcluster_start($cluster, "--initial");
-
- return 0;
-}
-
-
sub ndbcluster_wait_started($$){
my $cluster= shift;
my $ndb_waiter_extra_opt= shift;
- my $path_waiter_log= "$cluster->{'data_dir'}/ndb_waiter.log";
- my $args;
+ my $path_waitlog= join('/', $opt_vardir, $cluster->name(), "ndb_waiter.log");
+ my $args;
mtr_init_args(\$args);
-
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--core");
- mtr_add_arg($args, "--ndb-connectstring=%s", $cluster->{'connect_string'});
- mtr_add_arg($args, "--timeout=60");
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix());
+ mtr_add_arg($args, "--timeout=%d", $opt_start_timeout);
if ($ndb_waiter_extra_opt)
{
@@ -2719,29 +2167,45 @@ sub ndbcluster_wait_started($$){
# Start the ndb_waiter which will connect to the ndb_mgmd
# and poll it for state of the ndbd's, will return when
# all nodes in the cluster is started
- my $res= mtr_run($exe_ndb_waiter, $args,
- "", $path_waiter_log, $path_waiter_log, "");
- mtr_verbose("ndbcluster_wait_started, returns: $res") if $res;
- return $res;
-}
-
+ my $res= My::SafeProcess->run
+ (
+ name => "ndb_waiter ".$cluster->name(),
+ path => $exe_ndb_waiter,
+ args => \$args,
+ output => $path_waitlog,
+ error => $path_waitlog,
+ append => 1,
+ );
+
+ # Check that ndb_mgmd(s) are still alive
+ foreach my $ndb_mgmd ( in_cluster($cluster, ndb_mgmds()) )
+ {
+ my $proc= $ndb_mgmd->{proc};
+ if ( ! $proc->wait_one(0) )
+ {
+ mtr_warning("$proc died");
+ return 2;
+ }
+ }
-sub mysqld_wait_started($){
- my $mysqld= shift;
+ # Check that all started ndbd(s) are still alive
+ foreach my $ndbd ( in_cluster($cluster, ndbds()) )
+ {
+ my $proc= $ndbd->{proc};
+ next unless defined $proc;
+ if ( ! $proc->wait_one(0) )
+ {
+ mtr_warning("$proc died");
+ return 3;
+ }
+ }
- if (sleep_until_file_created($mysqld->{'path_pid'},
- $mysqld->{'start_timeout'},
- $mysqld->{'pid'}) == 0)
+ if ($res)
{
- # Failed to wait for pid file
+ mtr_verbose("ndbcluster_wait_started failed");
return 1;
}
-
- # Get the "real pid" of the process, it will be used for killing
- # the process in ActiveState's perl on windows
- $mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
-
return 0;
}
@@ -2750,267 +2214,252 @@ sub ndb_mgmd_wait_started($) {
my ($cluster)= @_;
my $retries= 100;
- while (ndbcluster_wait_started($cluster, "--no-contact") and
- $retries)
+ while ($retries)
{
- # Millisceond sleep emulated with select
- select(undef, undef, undef, (0.1));
+ my $result= ndbcluster_wait_started($cluster, "--no-contact");
+ if ($result == 0)
+ {
+ # ndb_mgmd is started
+ mtr_verbose("ndb_mgmd is started");
+ return 0;
+ }
+ elsif ($result > 1)
+ {
+ mtr_warning("Cluster process failed while waiting for start");
+ return $result;
+ }
+ mtr_milli_sleep(100);
$retries--;
}
- return $retries == 0;
-
+ return 1;
}
-sub ndb_mgmd_start ($) {
- my $cluster= shift;
- my $args; # Arg vector
- my $pid= -1;
+sub ndb_mgmd_start ($$) {
+ my ($cluster, $ndb_mgmd)= @_;
+
+ mtr_verbose("ndb_mgmd_start");
+ my $dir= $ndb_mgmd->value("DataDir");
+ mkpath($dir) unless -d $dir;
+
+ my $args;
mtr_init_args(\$args);
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--core");
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix());
+ mtr_add_arg($args, "--mycnf");
mtr_add_arg($args, "--nodaemon");
- mtr_add_arg($args, "--config-file=%s", "$cluster->{'data_dir'}/config.ini");
+ my $path_ndb_mgmd_log= "$dir/ndb_mgmd.log";
- my $path_ndb_mgmd_log= "$cluster->{'data_dir'}/\l$cluster->{'name'}_ndb_mgmd.log";
- $pid= mtr_spawn($exe_ndb_mgmd, $args, "",
- $path_ndb_mgmd_log,
- $path_ndb_mgmd_log,
- "",
- { append_log_file => 1 });
+ $ndb_mgmd->{'proc'}= My::SafeProcess->new
+ (
+ name => $ndb_mgmd->after('cluster_config.'),
+ path => $exe_ndb_mgmd,
+ args => \$args,
+ output => $path_ndb_mgmd_log,
+ error => $path_ndb_mgmd_log,
+ append => 1,
+ verbose => $opt_verbose,
+ );
+ mtr_verbose("Started $ndb_mgmd->{proc}");
# FIXME Should not be needed
# Unfortunately the cluster nodes will fail to start
# if ndb_mgmd has not started properly
if (ndb_mgmd_wait_started($cluster))
{
- mtr_error("Failed to wait for start of ndb_mgmd");
+ mtr_warning("Failed to wait for start of ndb_mgmd");
+ return 1;
}
- # Remember pid of ndb_mgmd
- $cluster->{'pid'}= $pid;
-
- mtr_verbose("ndb_mgmd_start, pid: $pid");
-
- return $pid;
+ return 0;
}
-sub ndbd_start ($$$) {
- my $cluster= shift;
- my $idx= shift;
- my $extra_args= shift;
+sub ndbd_start {
+ my ($cluster, $ndbd)= @_;
+
+ mtr_verbose("ndbd_start");
- my $args; # Arg vector
- my $pid= -1;
+ my $dir= $ndbd->value("DataDir");
+ mkpath($dir) unless -d $dir;
+ my $args;
mtr_init_args(\$args);
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--core");
- mtr_add_arg($args, "--ndb-connectstring=%s", "$cluster->{'connect_string'}");
- if ( $mysql_version_id >= 50000)
- {
- mtr_add_arg($args, "--character-sets-dir=%s", "$path_charsetsdir");
- }
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix());
mtr_add_arg($args, "--nodaemon");
- mtr_add_arg($args, "$extra_args");
- my $nodeid= $cluster->{'ndbds'}->[$idx]->{'nodeid'};
- my $path_ndbd_log= "$cluster->{'data_dir'}/ndb_${nodeid}.log";
- $pid= mtr_spawn($exe_ndbd, $args, "",
- $path_ndbd_log,
- $path_ndbd_log,
- "",
- { append_log_file => 1 });
+# > 5.0 { 'character-sets-dir' => \&fix_charset_dir },
- # Add pid to list of pids for this cluster
- $cluster->{'ndbds'}->[$idx]->{'pid'}= $pid;
- # Rememeber options used when starting
- $cluster->{'ndbds'}->[$idx]->{'start_extra_args'}= $extra_args;
- $cluster->{'ndbds'}->[$idx]->{'idx'}= $idx;
+ my $path_ndbd_log= "$dir/ndbd.log";
+ my $proc= My::SafeProcess->new
+ (
+ name => $ndbd->after('cluster_config.'),
+ path => $exe_ndbd,
+ args => \$args,
+ output => $path_ndbd_log,
+ error => $path_ndbd_log,
+ append => 1,
+ verbose => $opt_verbose,
+ );
+ mtr_verbose("Started $proc");
- mtr_verbose("ndbd_start, pid: $pid");
+ $ndbd->{proc}= $proc;
- return $pid;
+ return;
}
-sub ndbcluster_start ($$) {
+sub ndbcluster_start ($) {
my $cluster= shift;
- my $extra_args= shift;
- mtr_verbose("ndbcluster_start '$cluster->{'name'}'");
+ mtr_verbose("ndbcluster_start '".$cluster->name()."'");
- if ( $cluster->{'use_running'} )
+ foreach my $ndb_mgmd ( in_cluster($cluster, ndb_mgmds()) )
{
- return 0;
+ next if started($ndb_mgmd);
+ ndb_mgmd_start($cluster, $ndb_mgmd);
}
- if ( $cluster->{'pid'} )
+ foreach my $ndbd ( in_cluster($cluster, ndbds()) )
{
- mtr_error("Cluster '$cluster->{'name'}' already started");
- }
-
- ndb_mgmd_start($cluster);
-
- for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
- {
- ndbd_start($cluster, $idx, $extra_args);
+ next if started($ndbd);
+ ndbd_start($cluster, $ndbd);
}
return 0;
}
-sub rm_ndbcluster_tables ($) {
- my $dir= shift;
- foreach my $bin ( glob("$dir/mysql/ndb_apply_status*"),
- glob("$dir/mysql/ndb_schema*"))
- {
- unlink($bin);
- }
-}
-
-
-##############################################################################
-#
-# Run the benchmark suite
-#
-##############################################################################
+sub create_config_file_for_extern {
+ my %opts=
+ (
+ socket => '/tmp/mysqld.sock',
+ port => 3306,
+ user => $opt_user,
+ password => '',
+ @_
+ );
-sub run_benchmarks ($) {
- my $benchmark= shift;
+ mtr_report("Creating my.cnf file for extern server...");
+ my $F= IO::File->new($path_config_file, "w")
+ or mtr_error("Can't write to $path_config_file: $!");
- my $args;
-
- if ( ! $glob_use_embedded_server )
- {
- mysqld_start($master->[0],[],[]);
- if ( ! $master->[0]->{'pid'} )
- {
- mtr_error("Can't start the mysqld server");
- }
+ print $F "[client]\n";
+ while (my ($option, $value)= each( %opts )) {
+ print $F "$option= $value\n";
+ mtr_report(" $option= $value");
}
- mtr_init_args(\$args);
-
- mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'});
- mtr_add_arg($args, "--user=%s", $opt_user);
+ print $F <<EOF
- if ( $opt_small_bench )
- {
- mtr_add_arg($args, "--small-test");
- mtr_add_arg($args, "--small-tables");
- }
+# binlog reads from [client] and [mysqlbinlog]
+[mysqlbinlog]
+character-sets-dir= $path_charsetsdir
- if ( $opt_with_ndbcluster )
- {
- mtr_add_arg($args, "--create-options=TYPE=ndb");
- }
-
- chdir($glob_mysql_bench_dir)
- or mtr_error("Couldn't chdir to '$glob_mysql_bench_dir': $!");
+# mysql_fix_privilege_tables.sh don't read from [client]
+[mysql_fix_privilege_tables]
+socket = $opts{'socket'}
+port = $opts{'port'}
+user = $opts{'user'}
+password = $opts{'password'}
- if ( ! $benchmark )
- {
- mtr_add_arg($args, "--log");
- mtr_run("$glob_mysql_bench_dir/run-all-tests", $args, "", "", "", "");
- # FIXME check result code?!
- }
- elsif ( -x $benchmark )
- {
- mtr_run("$glob_mysql_bench_dir/$benchmark", $args, "", "", "", "");
- # FIXME check result code?!
- }
- else
- {
- mtr_error("Benchmark $benchmark not found");
- }
- chdir($glob_mysql_test_dir); # Go back
+EOF
+;
- if ( ! $glob_use_embedded_server )
- {
- stop_masters();
- }
+ $F= undef; # Close file
}
-##############################################################################
#
-# Run the tests
+# Kill processes left from previous runs, normally
+# there should be none so make sure to warn
+# if there is one
#
-##############################################################################
+sub kill_leftovers ($) {
+ my $rundir= shift;
+ return unless ( -d $rundir );
-sub run_tests () {
- my ($tests)= @_;
+ mtr_report("Checking leftover processes...");
- mtr_print_thick_line();
-
- mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);
-
- mtr_report_tests_not_skipped_though_disabled($tests);
-
- mtr_print_header();
-
- foreach my $tinfo ( @$tests )
+ # Scan the "run" directory for process id's to kill
+ opendir(RUNDIR, $rundir)
+ or mtr_error("kill_leftovers, can't open dir \"$rundir\": $!");
+ while ( my $elem= readdir(RUNDIR) )
{
- if (run_testcase_check_skip_test($tinfo))
+ # Only read pid from files that end with .pid
+ if ( $elem =~ /.*[.]pid$/ )
{
- next;
- }
-
- mtr_timer_start($glob_timers,"testcase", 60 * $opt_testcase_timeout);
- run_testcase($tinfo);
- mtr_timer_stop($glob_timers,"testcase");
- }
-
- mtr_print_line();
+ my $pidfile= "$rundir/$elem";
+ next unless -f $pidfile;
+ my $pid= mtr_fromfile($pidfile);
+ unlink($pidfile);
+ unless ($pid=~ /^(\d+)/){
+ # The pid was not a valid number
+ mtr_warning("Got invalid pid '$pid' from '$elem'");
+ next;
+ }
+ mtr_report(" - found old pid $pid in '$elem', killing it...");
- if ( ! $glob_debugger and
- ! $opt_extern and
- ! $glob_use_embedded_server )
- {
- stop_all_servers();
- }
+ my $ret= kill("KILL", $pid);
+ if ($ret == 0) {
+ mtr_report(" process did not exist!");
+ next;
+ }
- if ( $opt_gcov )
- {
- gcov_collect(); # collect coverage information
- }
- if ( $opt_gprof )
- {
- gprof_collect(); # collect coverage information
+ my $check_counter= 100;
+ while ($ret > 0 and $check_counter--) {
+ mtr_milli_sleep(100);
+ $ret= kill(0, $pid);
+ }
+ mtr_report($check_counter ? " ok!" : " failed!");
+ }
+ else
+ {
+ mtr_warning("Found non pid file '$elem' in '$rundir'")
+ if -f "$rundir/$elem";
+ }
}
-
- mtr_report_stats($tests);
-
- mtr_timer_stop($glob_timers,"suite");
+ closedir(RUNDIR);
}
-
-##############################################################################
#
-# Initiate the test databases
+# Check that all the ports that are going to
+# be used are free
#
-##############################################################################
+sub check_ports_free
+{
+ my @ports_to_check;
+ for ($baseport..$baseport+9){
+ push(@ports_to_check, $_);
+ }
+ #mtr_report("Checking ports...");
+ # print "@ports_to_check\n";
+ foreach my $port (@ports_to_check){
+ if (mtr_ping_port($port)){
+ mtr_report(" - 'localhost:$port' was not free");
+ return 1; # One port was not free
+ }
+ }
-sub initialize_servers () {
+ return 0; # All ports free
+}
- datadir_list_setup();
- if ( $opt_extern )
+sub initialize_servers {
+
+ if ( using_extern() )
{
# Running against an already started server, if the specified
# vardir does not already exist it should be created
if ( ! -d $opt_vardir )
{
- mtr_report("Creating '$opt_vardir'");
setup_vardir();
}
else
@@ -3020,208 +2469,225 @@ sub initialize_servers () {
}
else
{
- kill_running_servers();
+ # Kill leftovers from previous run
+ # using any pidfiles found in var/run
+ kill_leftovers("$opt_vardir/run");
if ( ! $opt_start_dirty )
{
remove_stale_vardir();
setup_vardir();
- mysql_install_db();
- if ( $opt_force )
- {
- # Save a snapshot of the freshly installed db
- # to make it possible to restore to a known point in time
- save_installed_db();
- }
+ mysql_install_db(default_mysqld(), "$opt_vardir/install.db");
}
}
- check_running_as_root();
-
- mtr_log_init("$opt_vardir/log/mysql-test-run.log");
-
}
-sub mysql_install_db () {
-
- install_db('master', $master->[0]->{'path_myddir'});
-
- if ($max_master_num > 1)
- {
- copy_install_db('master', $master->[1]->{'path_myddir'});
- }
-
- # Install the number of slave databses needed
- for (my $idx= 0; $idx < $max_slave_num; $idx++)
- {
- copy_install_db("slave".($idx+1), $slave->[$idx]->{'path_myddir'});
- }
-
- if ( ! $opt_skip_im )
- {
- im_prepare_env($instance_manager);
- }
-
- my $cluster_started_ok= 1; # Assume it can be started
-
- my $cluster= $clusters->[0]; # Master cluster
- if ($opt_skip_ndbcluster ||
- $cluster->{'use_running'} ||
- $cluster->{executable_setup_failed})
- {
- # Don't install master cluster
- }
- elsif (ndbcluster_start_install($cluster))
- {
- mtr_warning("Failed to start install of $cluster->{name}");
- $cluster_started_ok= 0;
- }
-
- $cluster= $clusters->[1]; # Slave cluster
- if ($max_slave_num == 0 ||
- $opt_skip_ndbcluster_slave ||
- $cluster->{'use_running'} ||
- $cluster->{executable_setup_failed})
- {
- # Don't install slave cluster
- }
- elsif (ndbcluster_start_install($cluster))
- {
- mtr_warning("Failed to start install of $cluster->{name}");
- $cluster_started_ok= 0;
- }
- foreach $cluster (@{$clusters})
- {
-
- next if !$cluster->{'pid'};
-
- $cluster->{'installed_ok'}= 1; # Assume install suceeds
-
- if (ndbcluster_wait_started($cluster, ""))
- {
- # failed to install, disable usage and flag that its no ok
- mtr_report("ndbcluster_install of $cluster->{'name'} failed");
- $cluster->{"installed_ok"}= 0;
-
- $cluster_started_ok= 0;
+#
+# Remove all newline characters expect after semicolon
+#
+sub sql_to_bootstrap {
+ my ($sql) = @_;
+ my @lines= split(/\n/, $sql);
+ my $result= "\n";
+ my $delimiter= ';';
+
+ foreach my $line (@lines) {
+
+ # Change current delimiter if line starts with "delimiter"
+ if ( $line =~ /^delimiter (.*)/ ) {
+ my $new= $1;
+ # Remove old delimiter from end of new
+ $new=~ s/\Q$delimiter\E$//;
+ $delimiter = $new;
+ mtr_debug("changed delimiter to $delimiter");
+ # No need to add the delimiter to result
+ next;
}
- }
- if ( ! $cluster_started_ok )
- {
- if ( $opt_force)
- {
- # Continue without cluster
+ # Add newline if line ends with $delimiter
+ # and convert the current delimiter to semicolon
+ if ( $line =~ /\Q$delimiter\E$/ ){
+ $line =~ s/\Q$delimiter\E$/;/;
+ $result.= "$line\n";
+ mtr_debug("Added default delimiter");
+ next;
}
- else
- {
- mtr_error("To continue, re-run with '--force'.");
+
+ # Remove comments starting with --
+ if ( $line =~ /^\s*--/ ) {
+ mtr_debug("Discarded $line");
+ next;
}
- }
- return 0;
-}
+ # Replace @HOSTNAME with localhost
+ $line=~ s/\'\@HOSTNAME\@\'/localhost/;
+ # Default, just add the line without newline
+ # but with a space as separator
+ $result.= "$line ";
-sub copy_install_db ($$) {
- my $type= shift;
- my $data_dir= shift;
+ }
+ return $result;
+}
- mtr_report("Installing \u$type Database");
- # Just copy the installed db from first master
- mtr_copy_dir($master->[0]->{'path_myddir'}, $data_dir);
+sub default_mysqld {
+ # Generate new config file from template
+ my $config= My::ConfigFactory->new_config
+ ( {
+ basedir => $basedir,
+ template_path => "include/default_my.cnf",
+ vardir => $opt_vardir,
+ tmpdir => $opt_tmpdir,
+ baseport => 0,
+ user => $opt_user,
+ password => '',
+ }
+ );
+ my $mysqld= $config->group('mysqld.1')
+ or mtr_error("Couldn't find mysqld.1 in default config");
+ return $mysqld;
}
-sub install_db ($$) {
- my $type= shift;
- my $data_dir= shift;
+sub mysql_install_db {
+ my ($mysqld, $datadir)= @_;
- mtr_report("Installing \u$type Database");
+ my $install_datadir= $datadir || $mysqld->value('datadir');
+ my $install_basedir= $mysqld->value('basedir');
+ my $install_lang= $mysqld->value('language');
+ my $install_chsdir= $mysqld->value('character-sets-dir');
+ mtr_report("Installing system database...");
my $args;
mtr_init_args(\$args);
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--bootstrap");
- mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
- mtr_add_arg($args, "--datadir=%s", $data_dir);
+ mtr_add_arg($args, "--basedir=%s", $install_basedir);
+ mtr_add_arg($args, "--datadir=%s", $install_datadir);
mtr_add_arg($args, "--loose-skip-innodb");
+ mtr_add_arg($args, "--loose-skip-falcon");
mtr_add_arg($args, "--loose-skip-ndbcluster");
- mtr_add_arg($args, "--tmpdir=.");
+ mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/");
mtr_add_arg($args, "--core-file");
if ( $opt_debug )
{
- mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap_%s.trace",
- $path_vardir_trace, $type);
+ mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap.trace",
+ $path_vardir_trace);
}
- if ( ! $glob_netware )
- {
- mtr_add_arg($args, "--language=%s", $path_language);
- mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
- }
+ mtr_add_arg($args, "--language=%s", $install_lang);
+ mtr_add_arg($args, "--character-sets-dir=%s", $install_chsdir);
# If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g.,
# configure --disable-grant-options), mysqld will not recognize the
# --bootstrap or --skip-grant-tables options. The user can set
# MYSQLD_BOOTSTRAP to the full path to a mysqld which does accept
# --bootstrap, to accommodate this.
- my $exe_mysqld_bootstrap = $ENV{'MYSQLD_BOOTSTRAP'} || $exe_mysqld;
+ my $exe_mysqld_bootstrap =
+ $ENV{'MYSQLD_BOOTSTRAP'} || find_mysqld($install_basedir);
# ----------------------------------------------------------------------
# export MYSQLD_BOOTSTRAP_CMD variable containing <path>/mysqld <args>
# ----------------------------------------------------------------------
$ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args);
+
+
# ----------------------------------------------------------------------
# Create the bootstrap.sql file
# ----------------------------------------------------------------------
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
- # Use the mysql database for system tables
- mtr_tofile($bootstrap_sql_file, "use mysql");
+ my $path_sql= my_find_file($install_basedir,
+ ["mysql", "sql/share", "share/mysql",
+ "share", "scripts"],
+ "mysql_system_tables.sql",
+ NOT_REQUIRED);
- # Add the offical mysql system tables
- # for a production system
- mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql",
- $bootstrap_sql_file);
+ if (-f $path_sql )
+ {
+ my $sql_dir= dirname($path_sql);
+ # Use the mysql database for system tables
+ mtr_tofile($bootstrap_sql_file, "use mysql\n");
- # Add the mysql system tables initial data
- # for a production system
- mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables_data.sql",
- $bootstrap_sql_file);
+ # Add the offical mysql system tables
+ # for a production system
+ mtr_appendfile_to_file("$sql_dir/mysql_system_tables.sql",
+ $bootstrap_sql_file);
- # Add test data for timezone - this is just a subset, on a real
- # system these tables will be populated either by mysql_tzinfo_to_sql
- # or by downloading the timezone table package from our website
- mtr_appendfile_to_file("$path_sql_dir/mysql_test_data_timezone.sql",
- $bootstrap_sql_file);
+ # Add the mysql system tables initial data
+ # for a production system
+ mtr_appendfile_to_file("$sql_dir/mysql_system_tables_data.sql",
+ $bootstrap_sql_file);
- # Fill help tables, just an empty file when running from bk repo
- # but will be replaced by a real fill_help_tables.sql when
- # building the source dist
- mtr_appendfile_to_file("$path_sql_dir/fill_help_tables.sql",
- $bootstrap_sql_file);
+ # Add test data for timezone - this is just a subset, on a real
+ # system these tables will be populated either by mysql_tzinfo_to_sql
+ # or by downloading the timezone table package from our website
+ mtr_appendfile_to_file("$sql_dir/mysql_test_data_timezone.sql",
+ $bootstrap_sql_file);
+
+ # Fill help tables, just an empty file when running from bk repo
+ # but will be replaced by a real fill_help_tables.sql when
+ # building the source dist
+ mtr_appendfile_to_file("$sql_dir/fill_help_tables.sql",
+ $bootstrap_sql_file);
+
+ }
+ else
+ {
+ # Install db from init_db.sql that exist in early 5.1 and 5.0
+ # versions of MySQL
+ my $init_file= "$install_basedir/mysql-test/lib/init_db.sql";
+ mtr_report(" - from '$init_file'");
+ my $text= mtr_grab_file($init_file) or
+ mtr_error("Can't open '$init_file': $!");
+
+ mtr_tofile($bootstrap_sql_file,
+ sql_to_bootstrap($text));
+ }
# Remove anonymous users
mtr_tofile($bootstrap_sql_file,
- "DELETE FROM mysql.user where user= '';");
+ "DELETE FROM mysql.user where user= '';\n");
+
+ # Create mtr database
+ mtr_tofile($bootstrap_sql_file,
+ "CREATE DATABASE mtr;\n");
+
+ # Add help tables and data for warning detection and supression
+ mtr_tofile($bootstrap_sql_file,
+ sql_to_bootstrap(mtr_grab_file("include/mtr_warnings.sql")));
+
+ # Add procedures for checking server is restored after testcase
+ mtr_tofile($bootstrap_sql_file,
+ sql_to_bootstrap(mtr_grab_file("include/mtr_check.sql")));
# Log bootstrap command
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
mtr_tofile($path_bootstrap_log,
"$exe_mysqld_bootstrap " . join(" ", @$args) . "\n");
-
- if ( mtr_run($exe_mysqld_bootstrap, $args, $bootstrap_sql_file,
- $path_bootstrap_log, $path_bootstrap_log,
- "", { append_log_file => 1 }) != 0 )
-
+ # Create directories mysql and test
+ mkpath("$install_datadir/mysql");
+ mkpath("$install_datadir/test");
+
+ if ( My::SafeProcess->run
+ (
+ name => "bootstrap",
+ path => $exe_mysqld_bootstrap,
+ args => \$args,
+ input => $bootstrap_sql_file,
+ output => $path_bootstrap_log,
+ error => $path_bootstrap_log,
+ append => 1,
+ verbose => $opt_verbose,
+ ) != 0)
{
mtr_error("Error executing mysqld --bootstrap\n" .
"Could not install system database from $bootstrap_sql_file\n" .
@@ -3230,284 +2696,327 @@ sub install_db ($$) {
}
-sub im_prepare_env($) {
- my $instance_manager = shift;
+sub run_testcase_check_skip_test($)
+{
+ my ($tinfo)= @_;
- im_create_passwd_file($instance_manager);
- im_prepare_data_dir($instance_manager);
-}
+ # ----------------------------------------------------------------------
+ # If marked to skip, just print out and return.
+ # Note that a test case not marked as 'skip' can still be
+ # skipped later, because of the test case itself in cooperation
+ # with the mysqltest program tells us so.
+ # ----------------------------------------------------------------------
+ if ( $tinfo->{'skip'} )
+ {
+ mtr_report_test_skipped($tinfo);
+ return 1;
+ }
-sub im_create_passwd_file($) {
- my $instance_manager = shift;
+ return 0;
+}
- my $pwd_file_path = $instance_manager->{'password_file'};
- mtr_report("Creating IM password file ($pwd_file_path)");
+sub run_query {
+ my ($tinfo, $mysqld, $query)= @_;
- open(OUT, ">", $pwd_file_path)
- or mtr_error("Can't write to $pwd_file_path: $!");
+ my $args;
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
- print OUT $instance_manager->{'admin_login'}, ":",
- $instance_manager->{'admin_sha1'}, "\n";
+ mtr_add_arg($args, "-e %s", $query);
- close(OUT);
-}
+ my $res= My::SafeProcess->run
+ (
+ name => "run_query -> ".$mysqld->name(),
+ path => $exe_mysql,
+ args => \$args,
+ output => '/dev/null',
+ error => '/dev/null'
+ );
+ return $res
+}
-sub im_create_defaults_file($) {
- my $instance_manager = shift;
- my $defaults_file = $instance_manager->{'defaults_file'};
+sub do_before_run_mysqltest($)
+{
+ my $tinfo= shift;
- open(OUT, ">", $defaults_file)
- or mtr_error("Can't write to $defaults_file: $!");
+ # Remove old files produced by mysqltest
+ my $base_file= mtr_match_extension($tinfo->{result_file},
+ "result"); # Trim extension
+ if (defined $base_file ){
+ unlink("$base_file.reject");
+ unlink("$base_file.progress");
+ unlink("$base_file.log");
+ unlink("$base_file.warnings");
+ }
+
+ if ( $mysql_version_id < 50000 ) {
+ # Set environment variable NDB_STATUS_OK to 1
+ # if script decided to run mysqltest cluster _is_ installed ok
+ $ENV{'NDB_STATUS_OK'} = "1";
+ } elsif ( $mysql_version_id < 50100 ) {
+ # Set environment variable NDB_STATUS_OK to YES
+ # if script decided to run mysqltest cluster _is_ installed ok
+ $ENV{'NDB_STATUS_OK'} = "YES";
+ }
+}
- print OUT <<EOF
-[mysql]
-[manager]
-pid-file = $instance_manager->{path_pid}
-angel-pid-file = $instance_manager->{path_angel_pid}
-socket = $instance_manager->{path_sock}
-port = $instance_manager->{port}
-password-file = $instance_manager->{password_file}
-default-mysqld-path = $exe_mysqld
+#
+# Check all server for sideffects
+#
+# RETURN VALUE
+# 0 ok
+# 1 Check failed
+# >1 Fatal errro
-EOF
-;
+sub check_testcase($$)
+{
+ my ($tinfo, $mode)= @_;
+ my $tname= $tinfo->{name};
- foreach my $instance (@{$instance_manager->{'instances'}})
- {
- my $server_id = $instance->{'server_id'};
-
- print OUT <<EOF
-[mysqld$server_id]
-socket = $instance->{path_sock}
-pid-file = $instance->{path_pid}
-port = $instance->{port}
-datadir = $instance->{path_datadir}
-log = $instance->{path_datadir}/mysqld$server_id.log
-log-error = $instance->{path_datadir}/mysqld$server_id.err.log
-log-slow-queries = $instance->{path_datadir}/mysqld$server_id.slow.log
-language = $path_language
-character-sets-dir = $path_charsetsdir
-basedir = $path_my_basedir
-server_id = $server_id
-shutdown-delay = 10
-skip-stack-trace
-loose-skip-innodb
-loose-skip-ndbcluster
-EOF
-;
- if ( $mysql_version_id < 50100 )
- {
- print OUT "skip-bdb\n";
- }
- print OUT "nonguarded\n" if $instance->{'nonguarded'};
- if ( $mysql_version_id >= 50100 )
+ # Start the mysqltest processes in parallel to save time
+ # also makes it possible to wait for any process to exit during the check
+ my %started;
+ foreach my $mysqld ( mysqlds() )
+ {
+ if ( defined $mysqld->{'proc'} )
{
- print OUT "log-output=FILE\n" if $instance->{'old_log_format'};
+ my $proc= start_check_testcase($tinfo, $mode, $mysqld);
+ $started{$proc->pid()}= $proc;
}
- print OUT "\n";
}
- close(OUT);
-}
+ # Return immediately if no check proceess was started
+ return 0 unless ( keys %started );
+ my $timeout_proc= My::SafeProcess->timer(check_timeout());
-sub im_prepare_data_dir($) {
- my $instance_manager = shift;
+ while (1){
+ my $result;
+ my $proc= My::SafeProcess->wait_any();
+ mtr_report("Got $proc");
- foreach my $instance (@{$instance_manager->{'instances'}})
- {
- copy_install_db(
- 'im_mysqld_' . $instance->{'server_id'},
- $instance->{'path_datadir'});
- }
-}
+ if ( delete $started{$proc->pid()} ) {
+ my $err_file= $proc->user_data();
+ my $base_file= mtr_match_extension($err_file, "err"); # Trim extension
+ # One check testcase process returned
+ my $res= $proc->exit_status();
-#
-# Restore snapshot of the installed slave databases
-# if the snapshot exists
-#
-sub restore_slave_databases ($) {
- my ($num_slaves)= @_;
+ if ( $res == 0){
+ # Check completed without problem
- if ( -d $path_snapshot)
- {
- for (my $idx= 0; $idx < $num_slaves; $idx++)
- {
- my $data_dir= $slave->[$idx]->{'path_myddir'};
- my $name= basename($data_dir);
- mtr_rmtree($data_dir);
- mtr_copy_dir("$path_snapshot/$name", $data_dir);
- }
- }
-}
+ # Remove the .err file the check generated
+ unlink($err_file);
+ # Remove the .result file the check generated
+ if ( $mode eq 'after' ){
+ unlink("$base_file.result");
+ }
-sub run_testcase_check_skip_test($)
-{
- my ($tinfo)= @_;
+ if ( keys(%started) == 0){
+ # All checks completed
- # ----------------------------------------------------------------------
- # If marked to skip, just print out and return.
- # Note that a test case not marked as 'skip' can still be
- # skipped later, because of the test case itself in cooperation
- # with the mysqltest program tells us so.
- # ----------------------------------------------------------------------
-
- if ( $tinfo->{'skip'} )
- {
- mtr_report_test_name($tinfo);
- mtr_report_test_skipped($tinfo);
- return 1;
- }
+ $timeout_proc->kill();
- if ($tinfo->{'ndb_test'})
- {
- foreach my $cluster (@{$clusters})
- {
- # Slave cluster is skipped and thus not
- # installed, no need to perform checks
- last if ($opt_skip_ndbcluster_slave and
- $cluster->{'name'} eq 'Slave');
-
- # Using running cluster - no need
- # to check if test should be skipped
- # will be done by test itself
- last if ($cluster->{'use_running'});
-
- # If test needs this cluster, check binaries was found ok
- if ( $cluster->{'executable_setup_failed'} )
- {
- mtr_report_test_name($tinfo);
- $tinfo->{comment}=
- "Failed to find cluster binaries";
- mtr_report_test_failed($tinfo);
- return 1;
+ return 0;
+ }
+ # Wait for next process to exit
+ next;
}
-
- # If test needs this cluster, check it was installed ok
- if ( !$cluster->{'installed_ok'} )
+ else
{
- mtr_report_test_name($tinfo);
- $tinfo->{comment}=
- "Cluster $cluster->{'name'} was not installed ok";
- mtr_report_test_failed($tinfo);
- return 1;
- }
+ if ( $mode eq "after" and $res == 1 )
+ {
+ # Test failed, grab the report mysqltest has created
+ my $report= mtr_grab_file($err_file);
+ $tinfo->{check}.=
+ "\nMTR's internal check of the test case '$tname' failed.
+This means that the test case does not preserve the state that existed
+before the test case was executed. Most likely the test case did not
+do a proper clean-up.
+This is the diff of the states of the servers before and after the
+test case was executed:\n";
+ $tinfo->{check}.= $report;
- }
- }
+ # Check failed, mark the test case with that info
+ $tinfo->{'check_testcase_failed'}= 1;
+ $result= 1;
+ }
+ elsif ( $res )
+ {
+ my $report= mtr_grab_file($err_file);
+ $tinfo->{comment}.=
+ "Could not execute 'check-testcase' $mode ".
+ "testcase '$tname' (res: $res):\n";
+ $tinfo->{comment}.= $report;
- if ( $tinfo->{'component_id'} eq 'im' )
- {
- # If test needs im, check binaries was found ok
- if ( $instance_manager->{'executable_setup_failed'} )
- {
- mtr_report_test_name($tinfo);
+ $result= 2;
+ }
+
+ # Remove the .err file the check generated
+ unlink($err_file);
+
+ # Remove the .result file the check generated
+ unlink("$base_file.result");
+
+ }
+ }
+ elsif ( $proc eq $timeout_proc ) {
+ $tinfo->{comment}.= "Timeout $timeout_proc for ".
+ "'check-testcase' expired after ".check_timeout().
+ " seconds";
+ $result= 4;
+ }
+ else {
+ # Unknown process returned, most likley a crash, abort everything
$tinfo->{comment}=
- "Failed to find MySQL manager binaries";
- mtr_report_test_failed($tinfo);
- return 1;
+ "The server $proc crashed while running ".
+ "'check testcase $mode test'";
+ $result= 3;
}
+
+ # Kill any check processes still running
+ map($_->kill(), values(%started));
+
+ $timeout_proc->kill();
+
+ return $result;
}
- return 0;
+ mtr_error("INTERNAL_ERROR: check_testcase");
}
-sub do_before_run_mysqltest($)
-{
- my $tinfo= shift;
+# Start run mysqltest on one server
+#
+# RETURN VALUE
+# 0 OK
+# 1 Check failed
+#
+sub start_run_one ($$) {
+ my ($mysqld, $run)= @_;
+
+ my $name= "$run-".$mysqld->name();
+
my $args;
+ mtr_init_args(\$args);
- # Remove old files produced by mysqltest
- my $base_file= mtr_match_extension($tinfo->{'result_file'},
- "result"); # Trim extension
- unlink("$base_file.reject");
- unlink("$base_file.progress");
- unlink("$base_file.log");
- unlink("$base_file.warnings");
-
- if (!$opt_extern)
- {
- if ( $mysql_version_id < 50000 ) {
- # Set environment variable NDB_STATUS_OK to 1
- # if script decided to run mysqltest cluster _is_ installed ok
- $ENV{'NDB_STATUS_OK'} = "1";
- } elsif ( $mysql_version_id < 50100 ) {
- # Set environment variable NDB_STATUS_OK to YES
- # if script decided to run mysqltest cluster _is_ installed ok
- $ENV{'NDB_STATUS_OK'} = "YES";
- }
- if (defined $tinfo->{binlog_format} and $mysql_version_id > 50100 )
- {
- # Dynamically switch binlog format of
- # master, slave is always restarted
- foreach my $server ( @$master )
- {
- next unless ($server->{'pid'});
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
- mtr_init_args(\$args);
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--user=root");
- mtr_add_arg($args, "--port=$server->{'port'}");
- mtr_add_arg($args, "--socket=$server->{'path_sock'}");
+ mtr_add_arg($args, "--silent");
+ mtr_add_arg($args, "--skip-safemalloc");
+ mtr_add_arg($args, "--test-file=%s", "include/$run.test");
+
+ my $errfile= "$opt_vardir/tmp/$name.err";
+ my $proc= My::SafeProcess->new
+ (
+ name => $name,
+ path => $exe_mysqltest,
+ error => $errfile,
+ output => $errfile,
+ args => \$args,
+ user_data => $errfile,
+ verbose => $opt_verbose,
+ );
+ mtr_verbose("Started $proc");
+ return $proc;
+}
- my $sql= "include/set_binlog_format_".$tinfo->{binlog_format}.".sql";
- mtr_verbose("Setting binlog format:", $tinfo->{binlog_format});
- if (mtr_run($exe_mysql, $args, $sql, "", "", "") != 0)
- {
- mtr_error("Failed to switch binlog format");
- }
- }
+
+#
+# Run script on all servers, collect results
+#
+# RETURN VALUE
+# 0 ok
+# 1 Failure
+
+sub run_on_all($$)
+{
+ my ($tinfo, $run)= @_;
+
+ # Start the mysqltest processes in parallel to save time
+ # also makes it possible to wait for any process to exit during the check
+ # and to have a timeout process
+ my %started;
+ foreach my $mysqld ( mysqlds() )
+ {
+ if ( defined $mysqld->{'proc'} )
+ {
+ my $proc= start_run_one($mysqld, $run);
+ $started{$proc->pid()}= $proc;
}
}
-}
-sub do_after_run_mysqltest($)
-{
- my $tinfo= shift;
+ # Return immediately if no check proceess was started
+ return 0 unless ( keys %started );
- # Save info from this testcase run to mysqltest.log
- mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log)
- if -f $path_current_test_log;
- mtr_appendfile_to_file($path_timefile, $path_mysqltest_log)
- if -f $path_timefile;
-}
+ my $timeout_proc= My::SafeProcess->timer(check_timeout());
+ while (1){
+ my $result;
+ my $proc= My::SafeProcess->wait_any();
+ mtr_report("Got $proc");
-sub run_testcase_mark_logs($$)
-{
- my ($tinfo, $log_msg)= @_;
+ if ( delete $started{$proc->pid()} ) {
- # Write a marker to all log files
+ # One mysqltest process returned
+ my $err_file= $proc->user_data();
+ my $res= $proc->exit_status();
- # The file indicating current test name
- mtr_tonewfile($path_current_test_log, $log_msg);
+ # Append the report from .err file
+ $tinfo->{comment}.= " == $err_file ==\n";
+ $tinfo->{comment}.= mtr_grab_file($err_file);
+ $tinfo->{comment}.= "\n";
- # each mysqld's .err file
- foreach my $mysqld (@{$master}, @{$slave})
- {
- mtr_tofile($mysqld->{path_myerr}, $log_msg);
- }
+ # Remove the .err file
+ unlink($err_file);
- if ( $tinfo->{'component_id'} eq 'im')
- {
- mtr_tofile($instance_manager->{path_err}, $log_msg);
- mtr_tofile($instance_manager->{path_log}, $log_msg);
+ if ( keys(%started) == 0){
+ # All completed
+ $timeout_proc->kill();
+ return 0;
+ }
+
+ # Wait for next process to exit
+ next;
+ }
+ elsif ( $proc eq $timeout_proc ) {
+ $tinfo->{comment}.= "Timeout $timeout_proc for '$run' ".
+ "expired after ". check_timeout().
+ " seconds";
+ }
+ else {
+ # Unknown process returned, most likley a crash, abort everything
+ $tinfo->{comment}.=
+ "The server $proc crashed while running '$run'";
+ }
+
+ # Kill any check processes still running
+ map($_->kill(), values(%started));
+
+ $timeout_proc->kill();
+
+ return 1;
}
+ mtr_error("INTERNAL_ERROR: run_on_all");
+}
- # ndbcluster log file
- mtr_tofile($path_ndb_testrun_log, $log_msg);
+sub mark_log {
+ my ($log, $tinfo)= @_;
+ my $log_msg= "CURRENT_TEST: $tinfo->{name}\n";
+ mtr_tofile($log, $log_msg);
}
+
sub find_testcase_skipped_reason($)
{
my ($tinfo)= @_;
@@ -3515,8 +3024,8 @@ sub find_testcase_skipped_reason($)
# Set default message
$tinfo->{'comment'}= "Detected by testcase(no log file)";
- # Open mysqltest-time(the mysqltest log file)
- my $F= IO::File->new($path_timefile)
+ # Open the test log file
+ my $F= IO::File->new($path_current_testlog)
or return;
my $reason;
@@ -3531,573 +3040,893 @@ sub find_testcase_skipped_reason($)
if ( ! $reason )
{
- mtr_warning("Could not find reason for skipping test in $path_timefile");
+ mtr_warning("Could not find reason for skipping test in $path_current_testlog");
$reason= "Detected by testcase(reason unknown) ";
}
$tinfo->{'comment'}= $reason;
}
-##############################################################################
-#
-# Run a single test case
-#
-##############################################################################
+sub find_analyze_request
+{
+ # Open the test log file
+ my $F= IO::File->new($path_current_testlog)
+ or return;
+ my $analyze;
-# When we get here, we have already filtered out test cases that doesn't
-# apply to the current setup, for example if we use a running server, test
-# cases that restart the server are dropped. So this function should mostly
-# be about doing things, not a lot of logic.
+ while ( my $line= <$F> )
+ {
+ # Look for "reason: <reason for skipping test>"
+ if ( $line =~ /analyze: (.*)/ )
+ {
+ $analyze= $1;
+ }
+ }
+
+ return $analyze;
+}
-# We don't start and kill the servers for each testcase. But some
-# testcases needs a restart, because they specify options to start
-# mysqld with. After that testcase, we need to restart again, to set
-# back the normal options.
+
+# Return timezone value of tinfo or default value
+sub timezone {
+ my ($tinfo)= @_;
+ return $tinfo->{timezone} || "GMT-3";
+}
+
+
+# Storage for changed environment variables
+my %old_env;
+
+#
+# Run a single test case
+#
+# RETURN VALUE
+# 0 OK
+# > 0 failure
+#
sub run_testcase ($) {
my $tinfo= shift;
+ mtr_verbose("Running test:", $tinfo->{name});
+
# -------------------------------------------------------
# Init variables that can change between each test case
# -------------------------------------------------------
+ my $timezone= timezone($tinfo);
+ $ENV{'TZ'}= $timezone;
+ mtr_verbose("Setting timezone: $timezone");
- $ENV{'TZ'}= $tinfo->{'timezone'};
- mtr_verbose("Setting timezone: $tinfo->{'timezone'}");
-
- my $master_restart= run_testcase_need_master_restart($tinfo);
- my $slave_restart= run_testcase_need_slave_restart($tinfo);
-
- if ($master_restart or $slave_restart)
+ if ( ! using_extern() )
{
- # Can't restart a running server that may be in use
- if ( $opt_extern )
- {
- mtr_report_test_name($tinfo);
- $tinfo->{comment}= "Can't restart a running server";
- mtr_report_test_skipped($tinfo);
- return;
+ my @restart= servers_need_restart($tinfo);
+ if ( @restart != 0) {
+ stop_servers($tinfo, @restart );
}
- run_testcase_stop_servers($tinfo, $master_restart, $slave_restart);
- }
+ if ( started(all_servers()) == 0 )
+ {
- # Write to all log files to indicate start of testcase
- run_testcase_mark_logs($tinfo, "CURRENT_TEST: $tinfo->{name}\n");
+ # Remove old datadirs
+ clean_datadir();
- my $died= mtr_record_dead_children();
- if ($died or $master_restart or $slave_restart)
- {
- if (run_testcase_start_servers($tinfo))
+ # Restore old ENV
+ while (my ($option, $value)= each( %old_env )) {
+ if (defined $value){
+ mtr_verbose("Restoring $option to $value");
+ $ENV{$option}= $value;
+
+ } else {
+ mtr_verbose("Removing $option");
+ delete($ENV{$option});
+ }
+ }
+ %old_env= ();
+
+ mtr_verbose("Generating my.cnf from '$tinfo->{template_path}'");
+
+ # Generate new config file from template
+ $config= My::ConfigFactory->new_config
+ ( {
+ basedir => $basedir,
+ template_path => $tinfo->{template_path},
+ extra_template_path => $tinfo->{extra_template_path},
+ vardir => $opt_vardir,
+ tmpdir => $opt_tmpdir,
+ baseport => $baseport,
+ #hosts => [ 'host1', 'host2' ],
+ user => $opt_user,
+ password => '',
+ ssl => $opt_ssl_supported,
+ embedded => $opt_embedded_server,
+ }
+ );
+
+ # Write the new my.cnf
+ $config->save($path_config_file);
+
+ # Remember current config so a restart can occur when a test need
+ # to use a different one
+ $current_config_name= $tinfo->{template_path};
+
+ #
+ # Set variables in the ENV section
+ #
+ foreach my $option ($config->options_in_group("ENV"))
+ {
+ # Save old value to restore it before next time
+ $old_env{$option->name()}= $ENV{$option->name()};
+
+ mtr_verbose($option->name(), "=",$option->value());
+ $ENV{$option->name()}= $option->value();
+ }
+ }
+
+ # Write start of testcase to log
+ mark_log($path_current_testlog, $tinfo);
+
+ if (start_servers($tinfo))
{
- mtr_report_test_name($tinfo);
report_failure_and_restart($tinfo);
return 1;
}
}
- elsif ($glob_use_embedded_server)
- {
- run_master_init_script($tinfo);
- }
- # ----------------------------------------------------------------------
- # If --start-and-exit or --start-dirty given, stop here to let user manually
+ # --------------------------------------------------------------------
+ # If --start or --start-dirty given, stop here to let user manually
# run tests
# ----------------------------------------------------------------------
- if ( $opt_start_and_exit or $opt_start_dirty )
+ if ( $opt_start or $opt_start_dirty )
{
- mtr_timer_stop_all($glob_timers);
- mtr_report("\nServers started, exiting");
- if ($glob_win32_perl)
- {
- #ActiveState perl hangs when using normal exit, use POSIX::_exit instead
- use POSIX qw[ _exit ];
- POSIX::_exit(0);
- }
- else
+ mtr_print("\nStarted", started(all_servers()));
+ mtr_print("Waiting for server(s) to exit...");
+ my $proc= My::SafeProcess->wait_any();
+ if ( grep($proc eq $_, started(all_servers())) )
{
- exit(0);
+ mtr_print("Server $proc died");
+ exit(1);
}
+ mtr_print("Unknown process $proc died");
+ exit(1);
}
- {
- do_before_run_mysqltest($tinfo);
+ my $test_timeout_proc= My::SafeProcess->timer(testcase_timeout());
- my $res= run_mysqltest($tinfo);
- mtr_report_test_name($tinfo);
+ do_before_run_mysqltest($tinfo);
- do_after_run_mysqltest($tinfo);
+ if ( $opt_check_testcases and check_testcase($tinfo, "before") ){
+ # Failed to record state of server or server crashed
+ report_failure_and_restart($tinfo);
- if ( $res == 0 )
+ # Stop the test case timer
+ $test_timeout_proc->kill();
+
+ return 1;
+ }
+
+ my $test= start_mysqltest($tinfo);
+
+ while (1)
+ {
+ my $proc= My::SafeProcess->wait_any();
+ unless ( defined $proc )
{
- mtr_report_test_passed($tinfo);
+ mtr_error("wait_any failed");
}
- elsif ( $res == 62 )
+ mtr_verbose("Got $proc");
+
+ # ----------------------------------------------------
+ # Was it the test program that exited
+ # ----------------------------------------------------
+ if ($proc eq $test)
{
- # Testcase itself tell us to skip this one
+ # Stop the test case timer
+ $test_timeout_proc->kill();
+
+ my $res= $test->exit_status();
+
+ if ($res == 0 and $opt_warnings and check_warnings($tinfo) )
+ {
+ # Test case suceeded, but it has produced unexpected
+ # warnings, continue in $res == 1
+ $res= 1;
+ }
+
+ if ( $res == 0 )
+ {
+ my $check_res;
+ if ( $opt_check_testcases and
+ $check_res= check_testcase($tinfo, "after"))
+ {
+ if ($check_res == 1) {
+ # Test case had sideeffects, not fatal error, just continue
+ stop_all_servers();
+ mtr_report("Resuming tests...\n");
+ }
+ else {
+ # Test case check failed fatally, probably a server crashed
+ report_failure_and_restart($tinfo);
+ return 1;
+ }
+ }
+ mtr_report_test_passed($tinfo);
+ }
+ elsif ( $res == 62 )
+ {
+ # Testcase itself tell us to skip this one
+ $tinfo->{skip_detected_by_test}= 1;
+ # Try to get reason from test log file
+ find_testcase_skipped_reason($tinfo);
+ mtr_report_test_skipped($tinfo);
+ }
+ elsif ( $res == 65 )
+ {
+ # Testprogram killed by signal
+ $tinfo->{comment}=
+ "testprogram crashed(returned code $res)";
+ report_failure_and_restart($tinfo);
+ }
+ elsif ( $res == 1 )
+ {
+ # Check if the test tool requests that
+ # an analyze script should be run
+ my $analyze= find_analyze_request();
+ if ($analyze){
+ run_on_all($tinfo, "analyze-$analyze");
+ }
+
+ # Test case failure reported by mysqltest
+ report_failure_and_restart($tinfo);
+ }
+ else
+ {
+ # mysqltest failed, probably crashed
+ $tinfo->{comment}=
+ "mysqltest failed with unexpected return code $res";
+ report_failure_and_restart($tinfo);
+ }
+
+ # Save info from this testcase run to mysqltest.log
+ if( -f $path_current_testlog)
+ {
+ mtr_appendfile_to_file($path_current_testlog, $path_testlog);
+ unlink($path_current_testlog);
+ }
+
+ return ($res == 62) ? 0 : $res;
- # Try to get reason from mysqltest.log
- find_testcase_skipped_reason($tinfo);
- mtr_report_test_skipped($tinfo);
}
- elsif ( $res == 63 )
+
+ # ----------------------------------------------------
+ # Check if it was an expected crash
+ # ----------------------------------------------------
+ if ( check_expected_crash_and_restart($proc) )
{
- $tinfo->{'timeout'}= 1; # Mark as timeout
- report_failure_and_restart($tinfo);
+ next;
}
- elsif ( $res == 1 )
+
+ # ----------------------------------------------------
+ # Stop the test case timer
+ # ----------------------------------------------------
+ $test_timeout_proc->kill();
+
+ # ----------------------------------------------------
+ # Check if it was a server that died
+ # ----------------------------------------------------
+ if ( grep($proc eq $_, started(all_servers())) )
{
- # Test case failure reported by mysqltest
+ # Server failed, probably crashed
+ $tinfo->{comment}=
+ "Server $proc failed during test run";
+
+ # ----------------------------------------------------
+ # It's not mysqltest that has exited, kill it
+ # ----------------------------------------------------
+ $test->kill();
+
report_failure_and_restart($tinfo);
+ return 1;
}
- else
+
+ # Try to dump core for mysqltest and all servers
+ foreach my $proc ($test, started(all_servers()))
+ {
+ mtr_print("Trying to dump core for $proc");
+ if ($proc->dump_core())
+ {
+ $proc->wait_one(20);
+ }
+ }
+
+ # ----------------------------------------------------
+ # It's not mysqltest that has exited, kill it
+ # ----------------------------------------------------
+ $test->kill();
+
+ # ----------------------------------------------------
+ # Check if testcase timer expired
+ # ----------------------------------------------------
+ if ( $proc eq $test_timeout_proc )
{
- # mysqltest failed, probably crashed
+ my $log_file_name= $opt_vardir."/log/".$tinfo->{shortname}.".log";
$tinfo->{comment}=
- "mysqltest returned unexpected code $res, it has probably crashed";
+ "Test case timeout after ".testcase_timeout().
+ " seconds\n\n";
+ # Add 20 last executed commands from test case log file
+ if (-e $log_file_name)
+ {
+ $tinfo->{comment}.=
+ "== $log_file_name == \n".
+ mtr_lastlinesfromfile($log_file_name, 20)."\n";
+ }
+ $tinfo->{'timeout'}= testcase_timeout(); # Mark as timeout
+ run_on_all($tinfo, 'analyze-timeout');
+
report_failure_and_restart($tinfo);
+ return 1;
}
- }
-
- # Remove the file that mysqltest writes info to
- unlink($path_timefile);
- # ----------------------------------------------------------------------
- # Stop Instance Manager if we are processing an IM-test case.
- # ----------------------------------------------------------------------
- if ( $tinfo->{'component_id'} eq 'im' and
- !mtr_im_stop($instance_manager, $tinfo->{'name'}))
- {
- mtr_error("Failed to stop Instance Manager.")
+ mtr_error("Unhandled process $proc exited");
}
+ mtr_error("Should never come here");
}
#
-# Save a snapshot of the installed test db(s)
-# I.e take a snapshot of the var/ dir
+# Perform a rough examination of the servers
+# error log and write all lines that look
+# suspicious into $error_log.warnings
#
-sub save_installed_db () {
+sub extract_warning_lines ($) {
+ my ($error_log) = @_;
+
+ # Open the servers .err log file and read all lines
+ # belonging to current tets into @lines
+ my $Ferr = IO::File->new($error_log)
+ or mtr_error("Could not open file '$error_log' for reading: $!");
- mtr_report("Saving snapshot of installed databases");
- mtr_rmtree($path_snapshot);
+ my @lines;
+ while ( my $line = <$Ferr> )
+ {
+ if ( $line =~ /^CURRENT_TEST:/ )
+ {
+ # Throw away lines from previous tests
+ @lines = ();
+ }
+ push(@lines, $line);
+ }
+ $Ferr = undef; # Close error log file
- foreach my $data_dir (@data_dir_lst)
+ # mysql_client_test.test sends a COM_DEBUG packet to the server
+ # to provoke a SAFEMALLOC leak report, ignore any warnings
+ # between "Begin/end safemalloc memory dump"
+ if ( grep(/Begin safemalloc memory dump:/, @lines) > 0)
{
- my $name= basename($data_dir);
- mtr_copy_dir("$data_dir", "$path_snapshot/$name");
+ my $discard_lines= 1;
+ foreach my $line ( @lines )
+ {
+ if ($line =~ /Begin safemalloc memory dump:/){
+ $discard_lines = 1;
+ } elsif ($line =~ /End safemalloc memory dump./){
+ $discard_lines = 0;
+ }
+
+ if ($discard_lines){
+ $line = "ignored";
+ }
+ }
+ }
+
+ # Write all suspicious lines to $error_log.warnings file
+ my $warning_log = "$error_log.warnings";
+ my $Fwarn = IO::File->new($warning_log, "w")
+ or die("Could not open file '$warning_log' for writing: $!");
+ print $Fwarn "Suspicious lines from $error_log\n";
+
+ my @patterns =
+ (
+ # The patterns for detection of [Warning] and [ERROR]
+ # in the server log files have been faulty for a longer period
+ # and correcting them shows a few additional harmless warnings.
+ # Thus those patterns are temporarily removed from the list
+ # of patterns. For more info see BUG#42408
+ # qr/^Warning:|mysqld: Warning|\[Warning\]/,
+ # qr/^Error:|\[ERROR\]/,
+ qr/^Warning:|mysqld: Warning/,
+ qr/^Error:/,
+ qr/^==.* at 0x/,
+ qr/InnoDB: Warning|InnoDB: Error/,
+ qr/^safe_mutex:|allocated at line/,
+ qr/missing DBUG_RETURN/,
+ qr/Attempting backtrace/,
+ qr/Assertion .* failed/,
+ );
+
+ foreach my $line ( @lines )
+ {
+ foreach my $pat ( @patterns )
+ {
+ if ( $line =~ /$pat/ )
+ {
+ print $Fwarn $line;
+ last;
+ }
+ }
}
+ $Fwarn = undef; # Close file
+
}
+# Run include/check-warnings.test
#
-# Save any interesting files in the data_dir
-# before the data dir is removed.
+# RETURN VALUE
+# 0 OK
+# 1 Check failed
#
-sub save_files_before_restore($$) {
- my $test_name= shift;
- my $data_dir= shift;
- my $save_name= "$opt_vardir/log/$test_name";
+sub start_check_warnings ($$) {
+ my $tinfo= shift;
+ my $mysqld= shift;
+
+ my $name= "warnings-".$mysqld->name();
+
+ extract_warning_lines($mysqld->value('log-error'));
+
+ my $args;
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
+
+ mtr_add_arg($args, "--skip-safemalloc");
+ mtr_add_arg($args, "--test-file=%s", "include/check-warnings.test");
- # Look for core files
- foreach my $core_file ( glob("$data_dir/core*") )
+ if ( $opt_embedded_server )
{
- last if $opt_max_save_core > 0 && $num_saved_cores >= $opt_max_save_core;
- my $core_name= basename($core_file);
- mtr_report("Saving $core_name");
- mkdir($save_name) if ! -d $save_name;
- rename("$core_file", "$save_name/$core_name");
- ++$num_saved_cores;
- }
+
+ # Get the args needed for the embedded server
+ # and append them to args prefixed
+ # with --sever-arg=
+
+ my $mysqld= $config->group('embedded')
+ or mtr_error("Could not get [embedded] section");
+
+ my $mysqld_args;
+ mtr_init_args(\$mysqld_args);
+ my $extra_opts= get_extra_opts($mysqld, $tinfo);
+ mysqld_arguments($mysqld_args, $mysqld, $extra_opts);
+ mtr_add_arg($args, "--server-arg=%s", $_) for @$mysqld_args;
+ }
+
+ my $errfile= "$opt_vardir/tmp/$name.err";
+ my $proc= My::SafeProcess->new
+ (
+ name => $name,
+ path => $exe_mysqltest,
+ error => $errfile,
+ output => $errfile,
+ args => \$args,
+ user_data => $errfile,
+ verbose => $opt_verbose,
+ );
+ mtr_verbose("Started $proc");
+ return $proc;
}
#
-# Restore snapshot of the installed test db(s)
-# if the snapshot exists
+# Loop through our list of processes and check the error log
+# for unexepcted errors and warnings
#
-sub restore_installed_db ($) {
- my $test_name= shift;
+sub check_warnings ($) {
+ my ($tinfo)= @_;
+ my $res= 0;
- if ( -d $path_snapshot)
- {
- mtr_report("Restoring snapshot of databases");
+ my $tname= $tinfo->{name};
- foreach my $data_dir (@data_dir_lst)
- {
- my $name= basename($data_dir);
- save_files_before_restore($test_name, $data_dir);
- mtr_rmtree("$data_dir");
- mtr_copy_dir("$path_snapshot/$name", "$data_dir");
- }
+ # Clear previous warnings
+ delete($tinfo->{warnings});
- # Remove the ndb_*_fs dirs for all ndbd nodes
- # forcing a clean start of ndb
- foreach my $cluster (@{$clusters})
+ # Start the mysqltest processes in parallel to save time
+ # also makes it possible to wait for any process to exit during the check
+ my %started;
+ foreach my $mysqld ( mysqlds() )
+ {
+ if ( defined $mysqld->{'proc'} )
{
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- mtr_rmtree("$ndbd->{'path_fs'}" );
- }
+ my $proc= start_check_warnings($tinfo, $mysqld);
+ $started{$proc->pid()}= $proc;
}
}
- else
- {
- # No snapshot existed
- mtr_error("No snapshot existed");
- }
-}
-sub report_failure_and_restart ($) {
- my $tinfo= shift;
+ # Return immediately if no check proceess was started
+ return 0 unless ( keys %started );
- mtr_report_test_failed($tinfo);
- print "\n";
- if ( $opt_force )
- {
- # Stop all servers that are known to be running
- stop_all_servers();
+ my $timeout_proc= My::SafeProcess->timer(check_timeout());
- # Restore the snapshot of the installed test db
- restore_installed_db($tinfo->{'name'});
- mtr_report("Resuming Tests\n");
- return;
- }
+ while (1){
+ my $result= 0;
+ my $proc= My::SafeProcess->wait_any();
+ mtr_report("Got $proc");
- my $test_mode= join(" ", @::glob_test_mode) || "default";
- mtr_report("Aborting: $tinfo->{'name'} failed in $test_mode mode. ");
- mtr_report("To continue, re-run with '--force'.");
- if ( ! $glob_debugger and
- ! $opt_extern and
- ! $glob_use_embedded_server )
- {
- stop_all_servers();
- }
- mtr_exit(1);
+ if ( delete $started{$proc->pid()} ) {
+ # One check warning process returned
+ my $res= $proc->exit_status();
+ my $err_file= $proc->user_data();
-}
+ if ( $res == 0 or $res == 62 ){
+ if ( $res == 0 ) {
+ # Check completed with problem
+ my $report= mtr_grab_file($err_file);
+ # Log to var/log/warnings file
+ mtr_tofile("$opt_vardir/log/warnings",
+ $tname."\n".$report);
-sub run_master_init_script ($) {
- my ($tinfo)= @_;
- my $init_script= $tinfo->{'master_sh'};
+ $tinfo->{'warnings'}.= $report;
+ $result= 1;
+ }
- # Run master initialization shell script if one exists
- if ( $init_script )
- {
- my $ret= mtr_run("/bin/sh", [$init_script], "", "", "", "");
- if ( $ret != 0 )
- {
- # FIXME rewrite those scripts to return 0 if successful
- # mtr_warning("$init_script exited with code $ret");
+ if ( $res == 62 ) {
+ # Test case was ok and called "skip"
+ ;
+ }
+ # Remove the .err file the check generated
+ unlink($err_file);
+
+ if ( keys(%started) == 0){
+ # All checks completed
+
+ $timeout_proc->kill();
+
+ return $result;
+ }
+ # Wait for next process to exit
+ next;
+ }
+ else
+ {
+ my $report= mtr_grab_file($err_file);
+ $tinfo->{comment}.=
+ "Could not execute 'check-warnings' for ".
+ "testcase '$tname' (res: $res):\n";
+ $tinfo->{comment}.= $report;
+
+ $result= 2;
+ }
+ # Remove the .err file the check generated
+ unlink($err_file);
+ }
+ elsif ( $proc eq $timeout_proc ) {
+ $tinfo->{comment}.= "Timeout $timeout_proc for ".
+ "'check warnings' expired after ".check_timeout().
+ " seconds";
+ $result= 4;
+ }
+ else {
+ # Unknown process returned, most likley a crash, abort everything
+ $tinfo->{comment}=
+ "The server $proc crashed while running 'check warnings'";
+ $result= 3;
}
+
+ # Kill any check processes still running
+ map($_->kill(), values(%started));
+
+ $timeout_proc->kill();
+
+ return $result;
}
+
+ mtr_error("INTERNAL_ERROR: check_warnings");
}
-##############################################################################
#
-# Start and stop servers
+# Loop through our list of processes and look for and entry
+# with the provided pid, if found check for the file indicating
+# expected crash and restart it.
#
-##############################################################################
+sub check_expected_crash_and_restart {
+ my ($proc)= @_;
+ foreach my $mysqld ( mysqlds() )
+ {
+ next unless ( $mysqld->{proc} eq $proc );
-sub do_before_start_master ($) {
- my ($tinfo)= @_;
+ # Check if crash expected by looking at the .expect file
+ # in var/tmp
+ my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
+ if ( -f $expect_file )
+ {
+ mtr_verbose("Crash was expected, file '$expect_file' exists");
+
+ while (1){
- my $tname= $tinfo->{'name'};
+ # If last line in expect file starts with "wait"
+ # sleep a little and try again, thus allowing the
+ # test script to control when the server should start
+ # up again
+ my $last_line= mtr_lastlinesfromfile($expect_file, 1);
+ if ($last_line =~ /^wait/ )
+ {
+ mtr_verbose("Test says wait before restart");
+ mtr_milli_sleep(100);
+ next;
+ }
- # FIXME what about second master.....
+ unlink($expect_file);
- # Don't delete anything if starting dirty
- return if ($opt_start_dirty);
+ # Start server with same settings as last time
+ mysqld_start($mysqld, $mysqld->{'started_opts'});
- foreach my $bin ( glob("$opt_vardir/log/master*-bin*") )
- {
- unlink($bin);
+ last;
+ }
+ }
+
+ return 1;
}
- # FIXME only remove the ones that are tied to this master
- # Remove old master.info and relay-log.info files
- unlink("$master->[0]->{'path_myddir'}/master.info");
- unlink("$master->[0]->{'path_myddir'}/relay-log.info");
- unlink("$master->[1]->{'path_myddir'}/master.info");
- unlink("$master->[1]->{'path_myddir'}/relay-log.info");
+ # Not an expected crash
+ return 0;
+}
+
- run_master_init_script($tinfo);
+# Remove all files and subdirectories of a directory
+sub clean_dir {
+ my ($dir)= @_;
+ mtr_verbose("clean_dir: $dir");
+ finddepth(
+ { no_chdir => 1,
+ wanted => sub {
+ if (-d $_){
+ # A dir
+ if ($_ eq $dir){
+ # The dir to clean
+ return;
+ } else {
+ mtr_verbose("rmdir: '$_'");
+ rmdir($_) or mtr_warning("rmdir($_) failed: $!");
+ }
+ } else {
+ # Hopefully a file
+ mtr_verbose("unlink: '$_'");
+ unlink($_) or mtr_warning("unlink($_) failed: $!");
+ }
+ }
+ },
+ $dir);
}
-sub do_before_start_slave ($) {
- my ($tinfo)= @_;
+sub clean_datadir {
- my $tname= $tinfo->{'name'};
- my $init_script= $tinfo->{'master_sh'};
+ mtr_verbose("Cleaning datadirs...");
- # Don't delete anything if starting dirty
- return if ($opt_start_dirty);
+ if (started(all_servers()) != 0){
+ mtr_error("Trying to clean datadir before all servers stopped");
+ }
- foreach my $bin ( glob("$opt_vardir/log/slave*-bin*") )
+ foreach my $cluster ( clusters() )
{
- unlink($bin);
- }
+ my $cluster_dir= "$opt_vardir/".$cluster->{name};
+ mtr_verbose(" - removing '$cluster_dir'");
+ rmtree($cluster_dir);
- unlink("$slave->[0]->{'path_myddir'}/master.info");
- unlink("$slave->[0]->{'path_myddir'}/relay-log.info");
+ }
- # Run slave initialization shell script if one exists
- if ( $init_script )
+ foreach my $mysqld ( mysqlds() )
{
- my $ret= mtr_run("/bin/sh", [$init_script], "", "", "", "");
- if ( $ret != 0 )
- {
- # FIXME rewrite those scripts to return 0 if successful
- # mtr_warning("$init_script exited with code $ret");
+ my $mysqld_dir= dirname($mysqld->value('datadir'));
+ if (-d $mysqld_dir ) {
+ mtr_verbose(" - removing '$mysqld_dir'");
+ rmtree($mysqld_dir);
}
}
- foreach my $bin ( glob("$slave->[0]->{'path_myddir'}/log.*") )
- {
- unlink($bin);
+ # Remove all files in tmp and var/tmp
+ clean_dir("$opt_vardir/tmp");
+ if ($opt_tmpdir ne "$opt_vardir/tmp"){
+ clean_dir($opt_tmpdir);
}
}
-sub mysqld_arguments ($$$$) {
- my $args= shift;
- my $mysqld= shift;
- my $extra_opt= shift;
- my $slave_master_info= shift;
+#
+# Save datadir before it's removed
+#
+sub save_datadir_after_failure($$) {
+ my ($dir, $savedir)= @_;
- my $idx= $mysqld->{'idx'};
- my $sidx= ""; # Index as string, 0 is empty string
- if ( $idx> 0 )
- {
- $sidx= $idx;
- }
+ mtr_report(" - saving '$dir'");
+ my $dir_name= basename($dir);
+ rename("$dir", "$savedir/$dir_name");
+}
- my $prefix= ""; # If mysqltest server arg
- if ( $glob_use_embedded_server )
+
+sub remove_ndbfs_from_ndbd_datadir {
+ my ($ndbd_datadir)= @_;
+ # Remove the ndb_*_fs directory from ndbd.X/ dir
+ foreach my $ndbfs_dir ( glob("$ndbd_datadir/ndb_*_fs") )
{
- $prefix= "--server-arg=";
+ next unless -d $ndbfs_dir; # Skip if not a directory
+ rmtree($ndbfs_dir);
}
+}
- mtr_add_arg($args, "%s--no-defaults", $prefix);
- mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
- mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
+sub after_failure ($) {
+ my ($tinfo)= @_;
- if ( $mysql_version_id >= 50036)
- {
- # By default, prevent the started mysqld to access files outside of vardir
- mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
- }
+ mtr_report("Saving datadirs...");
- if ( $mysql_version_id >= 50000 )
- {
- mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
- }
+ my $save_dir= "$opt_vardir/log/";
+ $save_dir.= $tinfo->{name};
+ # Add combination name if any
+ $save_dir.= "-$tinfo->{combination}"
+ if defined $tinfo->{combination};
- mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
- mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
- mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
+ # Save savedir path for server
+ $tinfo->{savedir}= $save_dir;
- # Increase default connect_timeout to avoid intermittent
- # disconnects when test servers are put under load
- # see BUG#28359
- mtr_add_arg($args, "%s--connect-timeout=60", $prefix);
+ mkpath($save_dir) if ! -d $save_dir;
+ # Save the used my.cnf file
+ copy($path_config_file, $save_dir);
- # When mysqld is run by a root user(euid is 0), it will fail
- # to start unless we specify what user to run as, see BUG#30630
- my $euid= $>;
- if (!$glob_win32 and $euid == 0 and
- grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) {
- mtr_add_arg($args, "%s--user=root", $prefix);
- }
+ # Copy the tmp dir
+ copytree("$opt_vardir/tmp/", "$save_dir/tmp/");
- if ( $opt_valgrind_mysqld )
- {
- mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
+ if ( clusters() ) {
+ foreach my $cluster ( clusters() ) {
+ my $cluster_dir= "$opt_vardir/".$cluster->{name};
- if ( $mysql_version_id < 50100 )
- {
- mtr_add_arg($args, "%s--skip-bdb", $prefix);
+ # Remove the fileystem of each ndbd
+ foreach my $ndbd ( in_cluster($cluster, ndbds()) )
+ {
+ my $ndbd_datadir= $ndbd->value("DataDir");
+ remove_ndbfs_from_ndbd_datadir($ndbd_datadir);
+ }
+
+ save_datadir_after_failure($cluster_dir, $save_dir);
+ }
+ }
+ else {
+ foreach my $mysqld ( mysqlds() ) {
+ my $data_dir= $mysqld->value('datadir');
+ save_datadir_after_failure(dirname($data_dir), $save_dir);
}
}
+}
- mtr_add_arg($args, "%s--pid-file=%s", $prefix,
- $mysqld->{'path_pid'});
- mtr_add_arg($args, "%s--port=%d", $prefix,
- $mysqld->{'port'});
+sub report_failure_and_restart ($) {
+ my $tinfo= shift;
- mtr_add_arg($args, "%s--socket=%s", $prefix,
- $mysqld->{'path_sock'});
+ stop_all_servers();
- mtr_add_arg($args, "%s--datadir=%s", $prefix,
- $mysqld->{'path_myddir'});
+ $tinfo->{'result'}= 'MTR_RES_FAILED';
+ my $test_failures= $tinfo->{'failures'} || 0;
+ $tinfo->{'failures'}= $test_failures + 1;
- if ( $mysql_version_id >= 50106 )
+
+ if ( $tinfo->{comment} )
{
- # Turn on logging to bothe tables and file
- mtr_add_arg($args, "%s--log-output=table,file", $prefix);
+ # The test failure has been detected by mysql-test-run.pl
+ # when starting the servers or due to other error, the reason for
+ # failing the test is saved in "comment"
+ ;
}
- my $log_base_path= "$opt_vardir/log/$mysqld->{'type'}$sidx";
- mtr_add_arg($args, "%s--log=%s.log", $prefix, $log_base_path);
- mtr_add_arg($args,
- "%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path);
-
- # Check if "extra_opt" contains --skip-log-bin
- my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt, @opt_extra_mysqld_opt);
- if ( $mysqld->{'type'} eq 'master' )
+ if ( !defined $tinfo->{logfile} )
{
- if (! ($opt_skip_master_binlog || $skip_binlog) )
+ my $logfile= $path_current_testlog;
+ if ( defined $logfile )
{
- mtr_add_arg($args, "%s--log-bin=%s/log/master-bin%s", $prefix,
- $opt_vardir, $sidx);
+ if ( -f $logfile )
+ {
+ # Test failure was detected by test tool and its report
+ # about what failed has been saved to file. Save the report
+ # in tinfo
+ $tinfo->{logfile}= mtr_fromfile($logfile);
+ }
+ else
+ {
+ # The test tool report didn't exist, display an
+ # error message
+ $tinfo->{logfile}= "Could not open test tool report '$logfile'";
+ }
}
+ }
- mtr_add_arg($args, "%s--server-id=%d", $prefix,
- $idx > 0 ? $idx + 101 : 1);
+ after_failure($tinfo);
- mtr_add_arg($args, "%s--loose-innodb_data_file_path=ibdata1:10M:autoextend",
- $prefix);
+ mtr_report_test($tinfo);
- mtr_add_arg($args, "%s--local-infile", $prefix);
+}
- if ( $idx > 0 or !$use_innodb)
- {
- mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
- }
- my $cluster= $clusters->[$mysqld->{'cluster'}];
- if ( $cluster->{'pid'} || # Cluster is started
- $cluster->{'use_running'} ) # Using running cluster
- {
- mtr_add_arg($args, "%s--ndbcluster", $prefix);
- mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
- $cluster->{'connect_string'});
- if ( $mysql_version_id >= 50100 )
- {
- mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
- }
- }
- else
- {
- mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
- }
- }
- else
- {
- mtr_error("unknown mysqld type")
- unless $mysqld->{'type'} eq 'slave';
+sub run_sh_script {
+ my ($script)= @_;
- mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix);
- if (! ( $opt_skip_slave_binlog || $skip_binlog ))
- {
- mtr_add_arg($args, "%s--log-bin=%s/log/slave%s-bin", $prefix,
- $opt_vardir, $sidx); # FIXME use own dir for binlogs
- mtr_add_arg($args, "%s--log-slave-updates", $prefix);
- }
+ return 0 unless defined $script;
- mtr_add_arg($args, "%s--master-retry-count=10", $prefix);
-
- mtr_add_arg($args, "%s--relay-log=%s/log/slave%s-relay-bin", $prefix,
- $opt_vardir, $sidx);
- mtr_add_arg($args, "%s--report-host=127.0.0.1", $prefix);
- mtr_add_arg($args, "%s--report-port=%d", $prefix,
- $mysqld->{'port'});
- mtr_add_arg($args, "%s--report-user=root", $prefix);
- mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
- mtr_add_arg($args, "%s--skip-slave-start", $prefix);
-
- # Directory where slaves find the dumps generated by "load data"
- # on the server. The path need to have constant length otherwise
- # test results will vary, thus a relative path is used.
- my $slave_load_path= "../tmp";
- mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix,
- $slave_load_path);
- mtr_add_arg($args, "%s--set-variable=slave_net_timeout=120", $prefix);
-
- if ( @$slave_master_info )
- {
- foreach my $arg ( @$slave_master_info )
- {
- mtr_add_arg($args, "%s%s", $prefix, $arg);
- }
- }
- else
- {
- if ($mysql_version_id < 50200)
- {
- mtr_add_arg($args, "%s--master-user=root", $prefix);
- mtr_add_arg($args, "%s--master-connect-retry=1", $prefix);
- mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix);
- mtr_add_arg($args, "%s--master-password=", $prefix);
- mtr_add_arg($args, "%s--master-port=%d", $prefix,
- $master->[0]->{'port'}); # First master
- }
- my $slave_server_id= 2 + $idx;
- my $slave_rpl_rank= $slave_server_id;
- mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
- mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
- }
+ mtr_verbose("Running '$script'");
+ my $ret= system("/bin/sh $script") >> 8;
+ return $ret;
+}
- my $cluster= $clusters->[$mysqld->{'cluster'}];
- if ( $cluster->{'pid'} || # Slave cluster is started
- $cluster->{'use_running'} ) # Using running slave cluster
- {
- mtr_add_arg($args, "%s--ndbcluster", $prefix);
- mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
- $cluster->{'connect_string'});
- if ( $mysql_version_id >= 50100 )
- {
- mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
- }
- }
- else
- {
- mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
- }
+sub mysqld_stop {
+ my $mysqld= shift or die "usage: mysqld_stop(<mysqld>)";
- } # end slave
+ my $args;
+ mtr_init_args(\$args);
- if ( $opt_debug )
- {
- mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/%s%s.trace",
- $prefix, $path_vardir_trace, $mysqld->{'type'}, $sidx);
- }
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--user=%s", $opt_user);
+ mtr_add_arg($args, "--password=");
+ mtr_add_arg($args, "--port=%d", $mysqld->value('port'));
+ mtr_add_arg($args, "--host=%s", $mysqld->value('#host'));
+ mtr_add_arg($args, "--connect_timeout=20");
+ mtr_add_arg($args, "--protocol=tcp");
+
+ mtr_add_arg($args, "shutdown");
+
+ My::SafeProcess->run
+ (
+ name => "mysqladmin shutdown ".$mysqld->name(),
+ path => $exe_mysqladmin,
+ args => \$args,
+ error => "/dev/null",
+
+ );
+}
- mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix);
- mtr_add_arg($args, "%s--sort_buffer=256K", $prefix);
- mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix);
- if ( $opt_ssl_supported )
+sub mysqld_arguments ($$$) {
+ my $args= shift;
+ my $mysqld= shift;
+ my $extra_opts= shift;
+
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+
+ # When mysqld is run by a root user(euid is 0), it will fail
+ # to start unless we specify what user to run as, see BUG#30630
+ my $euid= $>;
+ if (!IS_WINDOWS and $euid == 0 and
+ (grep(/^--user/, @$extra_opts)) == 0) {
+ mtr_add_arg($args, "--user=root");
+ }
+
+ if ( $opt_valgrind_mysqld )
{
- mtr_add_arg($args, "%s--ssl-ca=%s/std_data/cacert.pem", $prefix,
- $glob_mysql_test_dir);
- mtr_add_arg($args, "%s--ssl-cert=%s/std_data/server-cert.pem", $prefix,
- $glob_mysql_test_dir);
- mtr_add_arg($args, "%s--ssl-key=%s/std_data/server-key.pem", $prefix,
- $glob_mysql_test_dir);
+ mtr_add_arg($args, "--skip-safemalloc");
+
+ if ( $mysql_version_id < 50100 )
+ {
+ mtr_add_arg($args, "--skip-bdb");
+ }
}
- if ( $opt_warnings )
+ if ( $mysql_version_id >= 50106 )
{
- mtr_add_arg($args, "%s--log-warnings", $prefix);
+ # Turn on logging to both tables and file
+ mtr_add_arg($args, "--log-output=table,file");
}
- # Indicate to "mysqld" it will be debugged in debugger
+ # Check if "extra_opt" contains skip-log-bin
+ my $skip_binlog= grep(/^(--|--loose-)skip-log-bin/, @$extra_opts);
+
+ # Indicate to mysqld it will be debugged in debugger
if ( $glob_debugger )
{
- mtr_add_arg($args, "%s--gdb", $prefix);
+ mtr_add_arg($args, "--gdb");
}
my $found_skip_core= 0;
- foreach my $arg ( @opt_extra_mysqld_opt, @$extra_opt )
+ foreach my $arg ( @$extra_opts )
{
# Allow --skip-core-file to be set in <testname>-[master|slave].opt file
if ($arg eq "--skip-core-file")
@@ -4108,65 +3937,39 @@ sub mysqld_arguments ($$$$) {
{
; # Dont add --binlog-format when running without binlog
}
+ elsif ($arg eq "--loose-skip-log-bin" and
+ $mysqld->option("log-slave-updates"))
+ {
+ ; # Dont add --skip-log-bin when mysqld have --log-slave-updates in config
+ }
else
{
- mtr_add_arg($args, "%s%s", $prefix, $arg);
+ mtr_add_arg($args, "%s", $arg);
}
}
if ( !$found_skip_core )
{
- mtr_add_arg($args, "%s%s", $prefix, "--core-file");
- }
-
- if ( $opt_bench )
- {
- mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix);
- mtr_add_arg($args, "%s--init-rpl-role=master", $prefix);
- }
- elsif ( $mysqld->{'type'} eq 'master' )
- {
- mtr_add_arg($args, "%s--open-files-limit=1024", $prefix);
+ mtr_add_arg($args, "%s", "--core-file");
}
return $args;
}
-##############################################################################
-#
-# Start mysqld and return the PID
-#
-##############################################################################
-sub mysqld_start ($$$) {
+sub mysqld_start ($$) {
my $mysqld= shift;
- my $extra_opt= shift;
- my $slave_master_info= shift;
+ my $extra_opts= shift;
- my $args; # Arg vector
- my $exe;
- my $pid= -1;
- my $wait_for_pid_file= 1;
+ mtr_verbose(My::Options::toStr("mysqld_start", @$extra_opts));
- my $type= $mysqld->{'type'};
- my $idx= $mysqld->{'idx'};
+ my $exe= find_mysqld($mysqld->value('basedir'));
+ my $wait_for_pid_file= 1;
mtr_error("Internal error: mysqld should never be started for embedded")
- if $glob_use_embedded_server;
-
- if ( $type eq 'master' )
- {
- $exe= $exe_master_mysqld;
- }
- elsif ( $type eq 'slave' )
- {
- $exe= $exe_slave_mysqld;
- }
- else
- {
- mtr_error("Unknown 'type' \"$type\" passed to mysqld_start");
- }
+ if $opt_embedded_server;
+ my $args;
mtr_init_args(\$args);
if ( $opt_valgrind_mysqld )
@@ -4174,23 +3977,30 @@ sub mysqld_start ($$$) {
valgrind_arguments($args, \$exe);
}
- mysqld_arguments($args,$mysqld,$extra_opt,$slave_master_info);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
+ mysqld_arguments($args,$mysqld,$extra_opts);
- if ( $opt_gdb || $opt_manual_gdb)
+ if ( $opt_debug )
{
- gdb_arguments(\$args, \$exe, "$type"."_$idx");
+ mtr_add_arg($args, "--debug=d:t:i:A,%s/log/%s.trace",
+ $path_vardir_trace, $mysqld->name());
+ }
+
+ if ( $opt_gdb || $opt_manual_gdb )
+ {
+ gdb_arguments(\$args, \$exe, $mysqld->name());
}
elsif ( $opt_ddd || $opt_manual_ddd )
{
- ddd_arguments(\$args, \$exe, "$type"."_$idx");
+ ddd_arguments(\$args, \$exe, $mysqld->name());
}
elsif ( $opt_debugger )
{
- debugger_arguments(\$args, \$exe, "$type"."_$idx");
+ debugger_arguments(\$args, \$exe, $mysqld->name());
}
elsif ( $opt_manual_debug )
{
- print "\nStart $type in your debugger\n" .
+ print "\nStart " .$mysqld->name()." in your debugger\n" .
"dir: $glob_mysql_test_dir\n" .
"exe: $exe\n" .
"args: " . join(" ", @$args) . "\n\n" .
@@ -4205,629 +4015,506 @@ sub mysqld_start ($$$) {
$wait_for_pid_file= 0;
}
- # Remove the pidfile
- unlink($mysqld->{'path_pid'});
+ # Remove the old pidfile if any
+ unlink($mysqld->value('pid-file'));
- if ( defined $exe )
+ my $output= $mysqld->value('log-error');
+ if ( $opt_valgrind and $opt_debug )
{
- $pid= mtr_spawn($exe, $args, "",
- $mysqld->{'path_myerr'},
- $mysqld->{'path_myerr'},
- "",
- { append_log_file => 1 });
+ # When both --valgrind and --debug is selected, send
+ # all output to the trace file, making it possible to
+ # see the exact location where valgrind complains
+ $output= "$opt_vardir/log/".$mysqld->name().".trace";
}
-
- if ( $wait_for_pid_file && !sleep_until_file_created($mysqld->{'path_pid'},
- $mysqld->{'start_timeout'},
- $pid))
+ if ( defined $exe )
{
-
- mtr_error("Failed to start mysqld $mysqld->{'type'}");
+ $mysqld->{'proc'}= My::SafeProcess->new
+ (
+ name => $mysqld->name(),
+ path => $exe,
+ args => \$args,
+ output => $output,
+ error => $output,
+ append => 1,
+ verbose => $opt_verbose,
+ host => undef,
+ shutdown => sub { mysqld_stop($mysqld) },
+ );
+ mtr_verbose("Started $mysqld->{proc}");
}
-
- # Remember pid of the started process
- $mysqld->{'pid'}= $pid;
+ if ( $wait_for_pid_file &&
+ !sleep_until_file_created($mysqld->value('pid-file'),
+ $opt_start_timeout,
+ $mysqld->{'proc'}))
+ {
+ mtr_error("Failed to start mysqld $mysqld->name()");
+ }
# Remember options used when starting
- $mysqld->{'start_opts'}= $extra_opt;
- $mysqld->{'start_slave_master_info'}= $slave_master_info;
+ $mysqld->{'started_opts'}= $extra_opts;
- mtr_verbose("mysqld pid: $pid");
- return $pid;
+ return;
}
sub stop_all_servers () {
- mtr_report("Stopping All Servers");
+ mtr_verbose("Stopping all servers...");
- if ( ! $opt_skip_im )
- {
- mtr_report("Shutting-down Instance Manager");
- unless (mtr_im_stop($instance_manager, "stop_all_servers"))
- {
- mtr_error("Failed to stop Instance Manager.")
- }
- }
+ # Kill all started servers
+ My::SafeProcess::shutdown(0, # shutdown timeout 0 => kill
+ started(all_servers()));
- my %admin_pids; # hash of admin processes that requests shutdown
- my @kill_pids; # list of processes to shutdown/kill
- my $pid;
-
- # Start shutdown of all started masters
- foreach my $mysqld (@{$slave}, @{$master})
+ # Remove pidfiles
+ foreach my $server ( all_servers() )
{
- if ( $mysqld->{'pid'} )
- {
- $pid= mtr_mysqladmin_start($mysqld, "shutdown", 70);
- $admin_pids{$pid}= 1;
-
- push(@kill_pids,{
- pid => $mysqld->{'pid'},
- real_pid => $mysqld->{'real_pid'},
- pidfile => $mysqld->{'path_pid'},
- sockfile => $mysqld->{'path_sock'},
- port => $mysqld->{'port'},
- errfile => $mysqld->{'path_myerr'},
- });
-
- $mysqld->{'pid'}= 0; # Assume we are done with it
- }
- }
-
- # Start shutdown of clusters
- foreach my $cluster (@{$clusters})
- {
- if ( $cluster->{'pid'} )
- {
- $pid= mtr_ndbmgm_start($cluster, "shutdown");
- $admin_pids{$pid}= 1;
-
- push(@kill_pids,{
- pid => $cluster->{'pid'},
- pidfile => $cluster->{'path_pid'}
- });
-
- $cluster->{'pid'}= 0; # Assume we are done with it
-
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- if ( $ndbd->{'pid'} )
- {
- push(@kill_pids,{
- pid => $ndbd->{'pid'},
- pidfile => $ndbd->{'path_pid'},
- });
- $ndbd->{'pid'}= 0;
- }
- }
- }
+ my $pid_file= $server->if_exist('pid-file');
+ unlink($pid_file) if defined $pid_file;
}
- # Wait blocking until all shutdown processes has completed
- mtr_wait_blocking(\%admin_pids);
+ # Mark servers as stopped
+ map($_->{proc}= undef, all_servers());
- # Make sure that process has shutdown else try to kill them
- mtr_check_stop_servers(\@kill_pids);
-
- foreach my $mysqld (@{$master}, @{$slave})
- {
- rm_ndbcluster_tables($mysqld->{'path_myddir'});
- }
}
-sub run_testcase_need_master_restart($)
-{
- my ($tinfo)= @_;
+# Find out if server should be restarted for this test
+sub server_need_restart {
+ my ($tinfo, $server)= @_;
- # We try to find out if we are to restart the master(s)
- my $do_restart= 0; # Assumes we don't have to
-
- if ( $glob_use_embedded_server )
- {
- mtr_verbose("Never start or restart for embedded server");
- return $do_restart;
- }
- elsif ( $tinfo->{'master_sh'} )
+ if ( using_extern() )
{
- $do_restart= 1; # Always restart if script to run
- mtr_verbose("Restart master: Always restart if script to run");
- }
- if ( $tinfo->{'force_restart'} )
- {
- $do_restart= 1; # Always restart if --force-restart in -opt file
- mtr_verbose("Restart master: Restart forced with --force-restart");
+ mtr_verbose_restart($server, "no restart for --extern server");
+ return 0;
}
- elsif ( ! $opt_skip_ndbcluster and
- !$tinfo->{'ndb_test'} and
- $clusters->[0]->{'pid'} != 0 )
+
+ if ( $opt_embedded_server )
{
- $do_restart= 1; # Restart without cluster
- mtr_verbose("Restart master: Test does not need cluster");
+ mtr_verbose_restart($server, "no start or restart for embedded server");
+ return 0;
}
- elsif ( ! $opt_skip_ndbcluster and
- $tinfo->{'ndb_test'} and
- $clusters->[0]->{'pid'} == 0 )
- {
- $do_restart= 1; # Restart with cluster
- mtr_verbose("Restart master: Test need cluster");
+
+ if ( $tinfo->{'force_restart'} ) {
+ mtr_verbose_restart($server, "forced in .opt file");
+ return 1;
}
- elsif( $tinfo->{'component_id'} eq 'im' )
+
+ if ( $tinfo->{template_path} ne $current_config_name)
{
- $do_restart= 1;
- mtr_verbose("Restart master: Always restart for im tests");
+ mtr_verbose_restart($server, "using different config file");
+ return 1;
}
- elsif ( $master->[0]->{'running_master_options'} and
- $master->[0]->{'running_master_options'}->{'timezone'} ne
- $tinfo->{'timezone'})
+
+ if ( $tinfo->{'master_sh'} || $tinfo->{'slave_sh'} )
{
- $do_restart= 1;
- mtr_verbose("Restart master: Different timezone");
+ mtr_verbose_restart($server, "sh script to run");
+ return 1;
}
- # Check that running master was started with same options
- # as the current test requires
- elsif (! mtr_same_opts($master->[0]->{'start_opts'},
- $tinfo->{'master_opt'}) )
+
+ if ( ! started($server) )
{
- $do_restart= 1;
- mtr_verbose("Restart master: running with different options '" .
- join(" ", @{$tinfo->{'master_opt'}}) . "' != '" .
- join(" ", @{$master->[0]->{'start_opts'}}) . "'" );
+ mtr_verbose_restart($server, "not started");
+ return 1;
}
- elsif( ! $master->[0]->{'pid'} )
+
+ my $started_tinfo= $server->{'started_tinfo'};
+ if ( defined $started_tinfo )
{
- if ( $opt_extern )
- {
- $do_restart= 0;
- mtr_verbose("No restart: using extern master");
- }
- else
+
+ # Check if timezone of test that server was started
+ # with differs from timezone of next test
+ if ( timezone($started_tinfo) ne timezone($tinfo) )
{
- $do_restart= 1;
- mtr_verbose("Restart master: master is not started");
+ mtr_verbose_restart($server, "different timezone");
+ return 1;
}
}
- return $do_restart;
-}
-sub run_testcase_need_slave_restart($)
-{
- my ($tinfo)= @_;
-
- # We try to find out if we are to restart the slaves
- my $do_slave_restart= 0; # Assumes we don't have to
-
- if ( $glob_use_embedded_server )
- {
- mtr_verbose("Never start or restart for embedded server");
- return $do_slave_restart;
- }
- elsif ( $max_slave_num == 0)
- {
- mtr_verbose("Skip slave restart: No testcase use slaves");
+ # Temporary re-enable the "always restart slave" hack
+ # this should be removed asap, but will require that each rpl
+ # testcase cleanup better after itself - ie. stop and reset
+ # replication
+ # Use the "#!use-slave-opt" marker to detect that this is a "slave"
+ # server
+ if ( $server->option("#!use-slave-opt") ){
+ mtr_verbose_restart($server, "Always restart slave(s)");
+ return 1;
}
- else
+
+ my $is_mysqld= grep ($server eq $_, mysqlds());
+ if ($is_mysqld)
{
- # Check if any slave is currently started
- my $any_slave_started= 0;
- foreach my $mysqld (@{$slave})
+ # Check that running process was started with same options
+ # as the current test requires
+ my $extra_opts= get_extra_opts($server, $tinfo);
+ my $started_opts= $server->{'started_opts'};
+
+ if (!My::Options::same($started_opts, $extra_opts) )
{
- if ( $mysqld->{'pid'} )
+ my $use_dynamic_option_switch= 0;
+ if (!$use_dynamic_option_switch)
{
- $any_slave_started= 1;
- last;
+ mtr_verbose_restart($server, "running with different options '" .
+ join(" ", @{$extra_opts}) . "' != '" .
+ join(" ", @{$started_opts}) . "'" );
+ return 1;
}
- }
- if ($any_slave_started)
- {
- mtr_verbose("Restart slave: Slave is started, always restart");
- $do_slave_restart= 1;
- }
- elsif ( $tinfo->{'slave_num'} )
- {
- mtr_verbose("Restart slave: Test need slave");
- $do_slave_restart= 1;
+ mtr_verbose(My::Options::toStr("started_opts", @$started_opts));
+ mtr_verbose(My::Options::toStr("extra_opts", @$extra_opts));
+
+ # Get diff and check if dynamic switch is possible
+ my @diff_opts= My::Options::diff($started_opts, $extra_opts);
+ mtr_verbose(My::Options::toStr("diff_opts", @diff_opts));
+
+ my $query= My::Options::toSQL(@diff_opts);
+ mtr_verbose("Attempting dynamic switch '$query'");
+ if (run_query($tinfo, $server, $query)){
+ mtr_verbose("Restart: running with different options '" .
+ join(" ", @{$extra_opts}) . "' != '" .
+ join(" ", @{$started_opts}) . "'" );
+ return 1;
+ }
+
+ # Remember the dynamically set options
+ $server->{'started_opts'}= $extra_opts;
}
}
- return $do_slave_restart;
-
+ # Default, no restart
+ return 0;
}
-# ----------------------------------------------------------------------
-# If not using a running servers we may need to stop and restart.
-# We restart in the case we have initiation scripts, server options
-# etc to run. But we also restart again after the test first restart
-# and test is run, to get back to normal server settings.
-#
-# To make the code a bit more clean, we actually only stop servers
-# here, and mark this to be done. Then a generic "start" part will
-# start up the needed servers again.
-# ----------------------------------------------------------------------
-sub run_testcase_stop_servers($$$) {
- my ($tinfo, $do_restart, $do_slave_restart)= @_;
- my $pid;
- my %admin_pids; # hash of admin processes that requests shutdown
- my @kill_pids; # list of processes to shutdown/kill
+sub servers_need_restart($) {
+ my ($tinfo)= @_;
+ return grep { server_need_restart($tinfo, $_); } all_servers();
+}
- # Remember if we restarted for this test case (count restarts)
- $tinfo->{'restarted'}= $do_restart;
- if ( $do_restart )
- {
- delete $master->[0]->{'running_master_options'}; # Forget history
- # Start shutdown of all started masters
- foreach my $mysqld (@{$master})
- {
- if ( $mysqld->{'pid'} )
- {
- $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
+#
+# Return list of specific servers
+# - there is no servers in an empty config
+#
+sub _like { return $config ? $config->like($_[0]) : (); }
+sub mysqlds { return _like('mysqld.'); }
+sub ndbds { return _like('cluster_config.ndbd.');}
+sub ndb_mgmds { return _like('cluster_config.ndb_mgmd.'); }
+sub clusters { return _like('mysql_cluster.'); }
+sub all_servers { return ( mysqlds(), ndb_mgmds(), ndbds() ); }
- $admin_pids{$pid}= 1;
- push(@kill_pids,{
- pid => $mysqld->{'pid'},
- real_pid => $mysqld->{'real_pid'},
- pidfile => $mysqld->{'path_pid'},
- sockfile => $mysqld->{'path_sock'},
- port => $mysqld->{'port'},
- errfile => $mysqld->{'path_myerr'},
- });
+#
+# Filter a list of servers and return only those that are part
+# of the specified cluster
+#
+sub in_cluster {
+ my ($cluster)= shift;
+ # Return only processes for a specific cluster
+ return grep { $_->suffix() eq $cluster->suffix() } @_;
+}
- $mysqld->{'pid'}= 0; # Assume we are done with it
- }
- }
- # Start shutdown of master cluster
- my $cluster= $clusters->[0];
- if ( $cluster->{'pid'} )
- {
- $pid= mtr_ndbmgm_start($cluster, "shutdown");
- $admin_pids{$pid}= 1;
- push(@kill_pids,{
- pid => $cluster->{'pid'},
- pidfile => $cluster->{'path_pid'}
- });
+#
+# Filter a list of servers and return the SafeProcess
+# for only those that are started or stopped
+#
+sub started { return grep(defined $_, map($_->{proc}, @_)); }
+sub stopped { return grep(!defined $_, map($_->{proc}, @_)); }
- $cluster->{'pid'}= 0; # Assume we are done with it
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- push(@kill_pids,{
- pid => $ndbd->{'pid'},
- pidfile => $ndbd->{'path_pid'},
- });
- $ndbd->{'pid'}= 0; # Assume we are done with it
- }
- }
- }
+sub envsubst {
+ my $string= shift;
- if ( $do_restart || $do_slave_restart )
+ if ( ! defined $ENV{$string} )
{
+ mtr_error(".opt file references '$string' which is not set");
+ }
- delete $slave->[0]->{'running_slave_options'}; # Forget history
-
- # Start shutdown of all started slaves
- foreach my $mysqld (@{$slave})
- {
- if ( $mysqld->{'pid'} )
- {
- $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
-
- $admin_pids{$pid}= 1;
+ return $ENV{$string};
+}
- push(@kill_pids,{
- pid => $mysqld->{'pid'},
- real_pid => $mysqld->{'real_pid'},
- pidfile => $mysqld->{'path_pid'},
- sockfile => $mysqld->{'path_sock'},
- port => $mysqld->{'port'},
- errfile => $mysqld->{'path_myerr'},
- });
+sub get_extra_opts {
+ my ($mysqld, $tinfo)= @_;
- $mysqld->{'pid'}= 0; # Assume we are done with it
- }
- }
+ my $opts=
+ $mysqld->option("#!use-slave-opt") ?
+ $tinfo->{slave_opt} : $tinfo->{master_opt};
- # Start shutdown of slave cluster
- my $cluster= $clusters->[1];
- if ( $cluster->{'pid'} )
- {
- $pid= mtr_ndbmgm_start($cluster, "shutdown");
+ # Expand environment variables
+ foreach my $opt ( @$opts )
+ {
+ $opt =~ s/\$\{(\w+)\}/envsubst($1)/ge;
+ $opt =~ s/\$(\w+)/envsubst($1)/ge;
+ }
+ return $opts;
+}
- $admin_pids{$pid}= 1;
- push(@kill_pids,{
- pid => $cluster->{'pid'},
- pidfile => $cluster->{'path_pid'}
- });
+sub stop_servers($$) {
+ my ($tinfo, @servers)= @_;
- $cluster->{'pid'}= 0; # Assume we are done with it
+ # Remember if we restarted for this test case (count restarts)
+ $tinfo->{'restarted'}= 1;
- foreach my $ndbd (@{$cluster->{'ndbds'}} )
- {
- push(@kill_pids,{
- pid => $ndbd->{'pid'},
- pidfile => $ndbd->{'path_pid'},
- });
- $ndbd->{'pid'}= 0; # Assume we are done with it
- }
- }
- }
+ if ( join('|', @servers) eq join('|', all_servers()) )
+ {
+ # All servers are going down, use some kind of order to
+ # avoid too many warnings in the log files
- # ----------------------------------------------------------------------
- # Shutdown has now been started and lists for the shutdown processes
- # and the processes to be killed has been created
- # ----------------------------------------------------------------------
+ mtr_report("Restarting all servers");
- # Wait blocking until all shutdown processes has completed
- mtr_wait_blocking(\%admin_pids);
+ # mysqld processes
+ My::SafeProcess::shutdown( $opt_shutdown_timeout, started(mysqlds()) );
+ # cluster processes
+ My::SafeProcess::shutdown( $opt_shutdown_timeout,
+ started(ndbds(), ndb_mgmds()) );
+ }
+ else
+ {
+ mtr_report("Restarting ", started(@servers));
- # Make sure that process has shutdown else try to kill them
- mtr_check_stop_servers(\@kill_pids);
+ # Stop only some servers
+ My::SafeProcess::shutdown( $opt_shutdown_timeout,
+ started(@servers) );
+ }
- foreach my $mysqld (@{$master}, @{$slave})
+ foreach my $server (@servers)
{
- if ( ! $mysqld->{'pid'} )
- {
- # Remove ndbcluster tables if server is stopped
- rm_ndbcluster_tables($mysqld->{'path_myddir'});
- }
+ # Mark server as stopped
+ $server->{proc}= undef;
+
+ # Forget history
+ delete $server->{'started_tinfo'};
+ delete $server->{'started_opts'};
+ delete $server->{'started_cnf'};
}
}
#
-# run_testcase_start_servers
+# start_servers
#
-# Start the servers needed by this test case
+# Start servers not already started
#
# RETURN
# 0 OK
# 1 Start failed
#
+sub start_servers($) {
+ my ($tinfo)= @_;
-sub run_testcase_start_servers($) {
- my $tinfo= shift;
- my $tname= $tinfo->{'name'};
+ # Start clusters
+ foreach my $cluster ( clusters() )
+ {
+ ndbcluster_start($cluster);
+ }
- if ( $tinfo->{'component_id'} eq 'mysqld' )
+ # Start mysqlds
+ foreach my $mysqld ( mysqlds() )
{
- if ( ! $opt_skip_ndbcluster and
- !$clusters->[0]->{'pid'} and
- $tinfo->{'ndb_test'} )
+ if ( $mysqld->{proc} )
{
- # Test need cluster, cluster is not started, start it
- ndbcluster_start($clusters->[0], "");
+ # Already started
+
+ # Write start of testcase to log file
+ mark_log($mysqld->value('log-error'), $tinfo);
+
+ next;
}
- if ( !$master->[0]->{'pid'} )
+ my $datadir= $mysqld->value('datadir');
+ if ($opt_start_dirty)
{
- # Master mysqld is not started
- do_before_start_master($tinfo);
+ # Don't delete anything if starting dirty
+ ;
+ }
+ else
+ {
+
+ my @options= ('log-bin', 'relay-log');
+ foreach my $option_name ( @options ) {
+ next unless $mysqld->option($option_name);
- mysqld_start($master->[0],$tinfo->{'master_opt'},[]);
+ my $file_name= $mysqld->value($option_name);
+ next unless
+ defined $file_name and
+ -e $file_name;
+ mtr_debug(" -removing '$file_name'");
+ unlink($file_name) or die ("unable to remove file '$file_name'");
+ }
+
+ if (-d $datadir ) {
+ mtr_verbose(" - removing '$datadir'");
+ rmtree($datadir);
+ }
}
- if ( $clusters->[0]->{'pid'} || $clusters->[0]->{'use_running'}
- and ! $master->[1]->{'pid'} and
- $tinfo->{'master_num'} > 1 )
+ my $mysqld_basedir= $mysqld->value('basedir');
+ if ( $basedir eq $mysqld_basedir )
{
- # Test needs cluster, start an extra mysqld connected to cluster
+ # Copy datadir from installed system db
+ for my $path ( "$opt_vardir", "$opt_vardir/..") {
+ my $install_db= "$path/install.db";
+ copytree($install_db, $datadir)
+ if -d $install_db;
+ }
+ mtr_error("Failed to copy system db to '$datadir'")
+ unless -d $datadir;
+ }
+ else
+ {
+ mysql_install_db($mysqld); # For versional testing
- if ( $mysql_version_id >= 50100 )
- {
- # First wait for first mysql server to have created ndb system
- # tables ok FIXME This is a workaround so that only one mysqld
- # create the tables
- if ( ! sleep_until_file_created(
- "$master->[0]->{'path_myddir'}/mysql/ndb_apply_status.ndb",
- $master->[0]->{'start_timeout'},
- $master->[0]->{'pid'}))
- {
+ mtr_error("Failed to install system db to '$datadir'")
+ unless -d $datadir;
- $tinfo->{'comment'}= "Failed to create 'mysql/ndb_apply_status' table";
- return 1;
- }
- }
- mysqld_start($master->[1],$tinfo->{'master_opt'},[]);
}
- # Save this test case information, so next can examine it
- $master->[0]->{'running_master_options'}= $tinfo;
- }
- elsif ( ! $opt_skip_im and $tinfo->{'component_id'} eq 'im' )
- {
- # We have to create defaults file every time, in order to ensure that it
- # will be the same for each test. The problem is that test can change the
- # file (by SET/UNSET commands), so w/o recreating the file, execution of
- # one test can affect the other.
+ # Create the servers tmpdir
+ my $tmpdir= $mysqld->value('tmpdir');
+ mkpath($tmpdir) unless -d $tmpdir;
- im_create_defaults_file($instance_manager);
+ # Write start of testcase to log file
+ mark_log($mysqld->value('log-error'), $tinfo);
- if ( ! mtr_im_start($instance_manager, $tinfo->{im_opts}) )
+ # Run <tname>-master.sh
+ if ($mysqld->option('#!run-master-sh') and
+ run_sh_script($tinfo->{master_sh}) )
{
- $tinfo->{'comment'}= "Failed to start Instance Manager. ";
+ $tinfo->{'comment'}= "Failed to execute '$tinfo->{master_sh}'";
return 1;
}
- }
-
- # ----------------------------------------------------------------------
- # Start slaves - if needed
- # ----------------------------------------------------------------------
- if ( $tinfo->{'slave_num'} )
- {
- restore_slave_databases($tinfo->{'slave_num'});
- do_before_start_slave($tinfo);
-
- if ( ! $opt_skip_ndbcluster_slave and
- !$clusters->[1]->{'pid'} and
- $tinfo->{'ndb_test'} )
+ # Run <tname>-slave.sh
+ if ($mysqld->option('#!run-slave-sh') and
+ run_sh_script($tinfo->{slave_sh}))
{
- # Test need slave cluster, cluster is not started, start it
- ndbcluster_start($clusters->[1], "");
+ $tinfo->{'comment'}= "Failed to execute '$tinfo->{slave_sh}'";
+ return 1;
}
- for ( my $idx= 0; $idx < $tinfo->{'slave_num'}; $idx++ )
+ if (!$opt_embedded_server)
{
- if ( ! $slave->[$idx]->{'pid'} )
- {
- mysqld_start($slave->[$idx],$tinfo->{'slave_opt'},
- $tinfo->{'slave_mi'});
+ my $extra_opts= get_extra_opts($mysqld, $tinfo);
+ mysqld_start($mysqld,$extra_opts);
- }
+ # Save this test case information, so next can examine it
+ $mysqld->{'started_tinfo'}= $tinfo;
}
- # Save this test case information, so next can examine it
- $slave->[0]->{'running_slave_options'}= $tinfo;
}
# Wait for clusters to start
- foreach my $cluster (@{$clusters})
+ foreach my $cluster ( clusters() )
{
-
- next if !$cluster->{'pid'};
-
if (ndbcluster_wait_started($cluster, ""))
{
# failed to start
- $tinfo->{'comment'}= "Start of $cluster->{'name'} cluster failed";
+ $tinfo->{'comment'}= "Start of '".$cluster->name()."' cluster failed";
return 1;
}
}
- # Wait for mysqld's to start
- foreach my $mysqld (@{$master},@{$slave})
+ # Wait for mysqlds to start
+ foreach my $mysqld ( mysqlds() )
{
+ next if !started($mysqld);
- next if !$mysqld->{'pid'};
+ if (sleep_until_file_created($mysqld->value('pid-file'),
+ $opt_start_timeout,
+ $mysqld->{'proc'}) == 0) {
+ $tinfo->{comment}=
+ "Failed to start ".$mysqld->name();
- if (mysqld_wait_started($mysqld))
- {
- # failed to start
- $tinfo->{'comment'}=
- "Failed to start $mysqld->{'type'} mysqld $mysqld->{'idx'}";
+ my $logfile= $mysqld->value('log-error');
+ if ( defined $logfile and -f $logfile )
+ {
+ $tinfo->{logfile}= mtr_fromfile($logfile);
+ }
+ else
+ {
+ $tinfo->{logfile}= "Could not open server logfile: '$logfile'";
+ }
return 1;
}
}
return 0;
}
+
#
# Run include/check-testcase.test
-# Before a testcase, run in record mode, save result file to var
+# Before a testcase, run in record mode and save result file to var/tmp
# After testcase, run and compare with the recorded file, they should be equal!
#
# RETURN VALUE
-# 0 OK
-# 1 Check failed
+# The newly started process
#
-sub run_check_testcase ($$) {
-
+sub start_check_testcase ($$$) {
+ my $tinfo= shift;
my $mode= shift;
my $mysqld= shift;
- my $name= "check-" . $mysqld->{'type'} . $mysqld->{'idx'};
+ my $name= "check-".$mysqld->name();
+ # Replace dots in name with underscore to avoid that mysqltest
+ # misinterpret's what the filename extension is :(
+ $name=~ s/\./_/g;
my $args;
mtr_init_args(\$args);
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--silent");
- mtr_add_arg($args, "--skip-safemalloc");
- mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
- mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
- mtr_add_arg($args, "--socket=%s", $mysqld->{'path_sock'});
- mtr_add_arg($args, "--port=%d", $mysqld->{'port'});
- mtr_add_arg($args, "--database=test");
- mtr_add_arg($args, "--user=%s", $opt_user);
- mtr_add_arg($args, "--password=");
+ mtr_add_arg($args, "--skip-safemalloc");
- mtr_add_arg($args, "-R");
- mtr_add_arg($args, "$opt_vardir/tmp/$name.result");
+ mtr_add_arg($args, "--result-file=%s", "$opt_vardir/tmp/$name.result");
+ mtr_add_arg($args, "--test-file=%s", "include/check-testcase.test");
if ( $mode eq "before" )
{
mtr_add_arg($args, "--record");
}
-
- my $res = mtr_run_test($exe_mysqltest,$args,
- "include/check-testcase.test", "", "", "");
-
- if ( $res == 1 and $mode eq "after")
- {
- mtr_run("diff",["-u",
- "$opt_vardir/tmp/$name.result",
- "$opt_vardir/tmp/$name.reject"],
- "", "", "", "");
- }
- elsif ( $res )
- {
- mtr_error("Could not execute 'check-testcase' $mode testcase");
- }
- return $res;
+ my $errfile= "$opt_vardir/tmp/$name.err";
+ my $proc= My::SafeProcess->new
+ (
+ name => $name,
+ path => $exe_mysqltest,
+ error => $errfile,
+ output => $errfile,
+ args => \$args,
+ user_data => $errfile,
+ verbose => $opt_verbose,
+ );
+
+ mtr_report("Started $proc");
+ return $proc;
}
-##############################################################################
-#
-# Report the features that were compiled in
-#
-##############################################################################
-
-sub run_report_features () {
- my $args;
-
- if ( ! $glob_use_embedded_server )
- {
- mysqld_start($master->[0],[],[]);
- if ( ! $master->[0]->{'pid'} )
- {
- mtr_error("Can't start the mysqld server");
- }
- mysqld_wait_started($master->[0]);
- }
- my $tinfo = {};
- $tinfo->{'name'} = 'report features';
- $tinfo->{'result_file'} = undef;
- $tinfo->{'component_id'} = 'mysqld';
- $tinfo->{'path'} = 'include/report-features.test';
- $tinfo->{'timezone'}= "GMT-3";
- $tinfo->{'slave_num'} = 0;
- $tinfo->{'master_opt'} = [];
- $tinfo->{'slave_opt'} = [];
- $tinfo->{'slave_mi'} = [];
- $tinfo->{'comment'} = 'report server features';
- run_mysqltest($tinfo);
-
- if ( ! $glob_use_embedded_server )
- {
- stop_all_servers();
- }
+sub run_mysqltest ($) {
+ my $proc= start_mysqltest(@_);
+ $proc->wait();
}
-sub run_mysqltest ($) {
+sub start_mysqltest ($) {
my ($tinfo)= @_;
my $exe= $exe_mysqltest;
my $args;
mtr_init_args(\$args);
- mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
mtr_add_arg($args, "--silent");
mtr_add_arg($args, "--skip-safemalloc");
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
@@ -4838,21 +4525,7 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--mark-progress")
if $opt_mark_progress;
- if ($tinfo->{'component_id'} eq 'im')
- {
- mtr_add_arg($args, "--socket=%s", $instance_manager->{'path_sock'});
- mtr_add_arg($args, "--port=%d", $instance_manager->{'port'});
- mtr_add_arg($args, "--user=%s", $instance_manager->{'admin_login'});
- mtr_add_arg($args, "--password=%s", $instance_manager->{'admin_password'});
- }
- else # component_id == mysqld
- {
- mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'});
- mtr_add_arg($args, "--port=%d", $master->[0]->{'port'});
- mtr_add_arg($args, "--database=test");
- mtr_add_arg($args, "--user=%s", $opt_user);
- mtr_add_arg($args, "--password=");
- }
+ mtr_add_arg($args, "--database=test");
if ( $opt_ps_protocol )
{
@@ -4876,16 +4549,13 @@ sub run_mysqltest ($) {
if ( $opt_strace_client )
{
- $exe= "strace"; # FIXME there are ktrace, ....
+ $exe= $opt_strace_client || "strace";
mtr_add_arg($args, "-o");
mtr_add_arg($args, "%s/log/mysqltest.strace", $opt_vardir);
mtr_add_arg($args, "$exe_mysqltest");
}
- if ( $opt_timer )
- {
- mtr_add_arg($args, "--timer-file=%s/log/timer", $opt_vardir);
- }
+ mtr_add_arg($args, "--timer-file=%s/log/timer", $opt_vardir);
if ( $opt_compress )
{
@@ -4897,51 +4567,43 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--sleep=%d", $opt_sleep);
}
- if ( $opt_debug )
- {
- mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace",
- $path_vardir_trace);
- }
-
- if ( $opt_ssl_supported )
- {
- mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem",
- $glob_mysql_test_dir);
- mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem",
- $glob_mysql_test_dir);
- mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem",
- $glob_mysql_test_dir);
- }
-
if ( $opt_ssl )
{
# Turn on SSL for _all_ test cases if option --ssl was used
mtr_add_arg($args, "--ssl");
}
- elsif ( $opt_ssl_supported )
+
+ if ( $opt_embedded_server )
{
- mtr_add_arg($args, "--skip-ssl");
- }
- # ----------------------------------------------------------------------
- # If embedded server, we create server args to give mysqltest to pass on
- # ----------------------------------------------------------------------
+ # Get the args needed for the embedded server
+ # and append them to args prefixed
+ # with --sever-arg=
- if ( $glob_use_embedded_server )
- {
- mysqld_arguments($args,$master->[0],$tinfo->{'master_opt'},[]);
+ my $mysqld= $config->group('embedded')
+ or mtr_error("Could not get [embedded] section");
+
+ my $mysqld_args;
+ mtr_init_args(\$mysqld_args);
+ my $extra_opts= get_extra_opts($mysqld, $tinfo);
+ mysqld_arguments($mysqld_args, $mysqld, $extra_opts);
+ mtr_add_arg($args, "--server-arg=%s", $_) for @$mysqld_args;
+
+ if (IS_WINDOWS)
+ {
+ # Trick the server to send output to stderr, with --console
+ mtr_add_arg($args, "--server-arg=--console");
+ }
}
# ----------------------------------------------------------------------
# export MYSQL_TEST variable containing <path>/mysqltest <args>
# ----------------------------------------------------------------------
- $ENV{'MYSQL_TEST'}=
- mtr_native_path($exe_mysqltest) . " " . join(" ", @$args);
+ $ENV{'MYSQL_TEST'}= mtr_args2str($exe_mysqltest, @$args);
# ----------------------------------------------------------------------
# Add arguments that should not go into the MYSQL_TEST env var
# ----------------------------------------------------------------------
-
if ( $opt_valgrind_mysqltest )
{
# Prefix the Valgrind options to the argument list.
@@ -4962,9 +4624,17 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
}
+ client_debug_arg($args, "mysqltest");
+
if ( $opt_record )
{
mtr_add_arg($args, "--record");
+
+ # When recording to a non existing result file
+ # the name of that file is in "record_file"
+ if ( defined $tinfo->{'record_file'} ) {
+ mtr_add_arg($args, "--result-file=%s", $tinfo->{record_file});
+ }
}
if ( $opt_client_gdb )
@@ -4978,38 +4648,20 @@ sub run_mysqltest ($) {
elsif ( $opt_client_debugger )
{
debugger_arguments(\$args, \$exe, "client");
- }
-
- if ( $opt_check_testcases )
- {
- foreach my $mysqld (@{$master}, @{$slave})
- {
- if ($mysqld->{'pid'})
- {
- run_check_testcase("before", $mysqld);
- }
- }
- }
-
- my $res = mtr_run_test($exe,$args,"","",$path_timefile,"");
-
- if ( $opt_check_testcases )
- {
- foreach my $mysqld (@{$master}, @{$slave})
- {
- if ($mysqld->{'pid'})
- {
- if (run_check_testcase("after", $mysqld))
- {
- # Check failed, mark the test case with that info
- $tinfo->{'check_testcase_failed'}= 1;
- }
- }
- }
- }
-
- return $res;
-
+ }
+
+
+ my $proc= My::SafeProcess->new
+ (
+ name => "mysqltest",
+ path => $exe,
+ args => \$args,
+ append => 1,
+ error => $path_current_testlog,
+ verbose => $opt_verbose,
+ );
+ mtr_verbose("Started $proc");
+ return $proc;
}
@@ -5023,7 +4675,7 @@ sub gdb_arguments {
# Write $args to gdb init file
my $str= join(" ", @$$args);
- my $gdb_init_file= "$opt_tmpdir/gdbinit.$type";
+ my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file
unlink($gdb_init_file);
@@ -5087,7 +4739,7 @@ sub ddd_arguments {
# Write $args to ddd init file
my $str= join(" ", @$$args);
- my $gdb_init_file= "$opt_tmpdir/gdbinit.$type";
+ my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file
unlink($gdb_init_file);
@@ -5227,14 +4879,11 @@ sub valgrind_arguments {
}
-##############################################################################
#
-# Usage
+# Usage
#
-##############################################################################
-
sub usage ($) {
- my $message= shift;
+ my ($message)= @_;
if ( $message )
{
@@ -5256,15 +4905,15 @@ Options to control what engine/variation to run
compress Use the compressed protocol between client and server
ssl Use ssl protocol between client and server
skip-ssl Dont start server with support for ssl connections
- bench Run the benchmark suite
- small-bench Run the benchmarks with --small-tests --small-tables
- ndb|with-ndbcluster Use cluster as default table type
vs-config Visual Studio configuration used to create executables
(default: MTR_VS_CONFIG environment variable)
+ config|defaults-file=<config template> Use fixed config template for all
+ tests
+ defaults_extra_file=<config template> Extra config template to add to
+ all generated configs
+
Options to control directories to use
- benchdir=DIR The directory where the benchmark suite is stored
- (default: ../../mysql-bench)
tmpdir=DIR The directory where temporary files are stored
(default: ./var/tmp).
vardir=DIR The directory where files generated from the test run
@@ -5276,6 +4925,9 @@ Options to control directories to use
for tmpfs (/dev/shm)
The option can also be set using environment
variable MTR_MEM=[DIR]
+ client-bindir=PATH Path to the directory where client binaries are located
+ client-libdir=PATH Path to the directory where client libraries are located
+
Options to control what test suites or cases to run
@@ -5283,33 +4935,27 @@ Options to control what test suites or cases to run
with-ndbcluster-only Run only tests that include "ndb" in the filename
skip-ndb[cluster] Skip all tests that need cluster
skip-ndb[cluster]-slave Skip all tests that need a slave cluster
- ndb-extra Run extra tests from ndb directory
do-test=PREFIX or REGEX
Run test cases which name are prefixed with PREFIX
or fulfills REGEX
skip-test=PREFIX or REGEX
Skip test cases which name are prefixed with PREFIX
or fulfills REGEX
- start-from=PREFIX Run test cases starting from test prefixed with PREFIX
- suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated
+ start-from=PREFIX Run test cases starting test prefixed with PREFIX where
+ prefix may be suite.testname or just testname
+ suite[s]=NAME1,..,NAMEN
+ Collect tests in suites from the comma separated
list of suite names.
- The default is: "$opt_suites_default"
+ The default is: "$DEFAULT_SUITES"
skip-rpl Skip the replication test cases.
- skip-im Don't start IM, and skip the IM test cases
- big-test Set the environment variable BIG_TEST, which can be
- checked from test cases.
- combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one
- combination.
- skip-combination Skip any combination options and combinations files
+ big-test Also run tests marked as "big"
Options that specify ports
- master_port=PORT Specify the port number used by the first master
- slave_port=PORT Specify the port number used by the first slave
- ndbcluster-port=PORT Specify the port number used by cluster
- ndbcluster-port-slave=PORT Specify the port number used by slave cluster
- mtr-build-thread=# Specify unique collection of ports. Can also be set by
- setting the environment variable MTR_BUILD_THREAD.
+ mtr-build-thread=# Specify unique number to calculate port number(s) from.
+ build-thread=# Can be set in environment variable MTR_BUILD_THREAD.
+ Set MTR_BUILD_THREAD="auto" to automatically aquire
+ a build thread id that is unique to current host
Options for test case authoring
@@ -5323,11 +4969,11 @@ Options that pass on options
Options to run test on running server
- extern Use running server for tests
- ndb-connectstring=STR Use running cluster, and connect using STR
- ndb-connectstring-slave=STR Use running slave cluster, and connect using STR
- user=USER User for connection to extern server
- socket=PATH Socket for connection to extern server
+ extern option=value Run only the tests against an already started server
+ the options to use for connection to the extern server
+ must be specified using name-value pair notation
+ For example:
+ ./$0 --extern socket=/tmp/mysqld.sock
Options for debugging the product
@@ -5344,17 +4990,24 @@ Options for debugging the product
test(s)
manual-ddd Let user manually start mysqld in ddd, before running
test(s)
- master-binary=PATH Specify the master "mysqld" to use
- slave-binary=PATH Specify the slave "mysqld" to use
- strace-client Create strace output for mysqltest client
+ strace-client=[path] Create strace output for mysqltest client, optionally
+ specifying name and path to the trace program to use.
+ Example: $0 --strace-client=ktrace
max-save-core Limit the number of core files saved (to avoid filling
up disks for heavily crashing server). Defaults to
- $opt_max_save_core, set to 0 for no limit.
+ $opt_max_save_core, set to 0 for no limit. Set
+ it's default with MTR_MAX_SAVE_CORE
+ max-save-datadir Limit the number of datadir saved (to avoid filling
+ up disks for heavily crashing server). Defaults to
+ $opt_max_save_datadir, set to 0 for no limit. Set
+ it's default with MTR_MAX_SAVE_DATDIR
+ max-test-fail Limit the number of test failurs before aborting
+ the current test run. Defaults to
+ $opt_max_test_fail, set to 0 for no limit. Set
+ it's default with MTR_MAX_TEST_FAIL
-Options for coverage, profiling etc
+Options for valgrind
- gcov FIXME
- gprof FIXME
valgrind Run the "mysqltest" and "mysqld" executables using
valgrind with default options
valgrind-all Synonym for --valgrind
@@ -5368,32 +5021,36 @@ Options for coverage, profiling etc
callgrind Instruct valgrind to use callgrind
Misc options
-
+ user=USER User for connecting to mysqld(default: $opt_user)
comment=STR Write STR to the output
notimer Don't show test case execution time
- script-debug Debug this script itself
- verbose More verbose output
- start-and-exit Only initialize and start the servers, using the
- startup settings for the specified test case (if any)
+ verbose More verbose output(use multiple times for even more)
+ start Only initialize and start the servers, using the
+ startup settings for the first specified test case
+ Example:
+ $0 --start alias &
start-dirty Only start the servers (without initialization) for
- the specified test case (if any)
- fast Don't try to clean up from earlier runs
+ the first specified test case
+ fast Run as fast as possible, dont't wait for servers
+ to shutdown etc.
+ repeat=N Run each test N number of times
+ retry=N Retry tests that fail N times, limit number of failures
+ to $opt_retry_failure
+ retry-failure=N Limit number of retries for a failed test
reorder Reorder tests to get fewer server restarts
help Get this help text
- testcase-timeout=MINUTES Max test case run time (default $default_testcase_timeout)
- suite-timeout=MINUTES Max test suite run time (default $default_suite_timeout)
- warnings | log-warnings Pass --log-warnings to mysqld
+ testcase-timeout=MINUTES Max test case run time (default $opt_testcase_timeout)
+ suite-timeout=MINUTES Max test suite run time (default $opt_suite_timeout)
+ shutdown-timeout=SECONDS Max number of seconds to wait for server shutdown
+ before killing servers (default $opt_shutdown_timeout)
+ warnings Scan the log files for warnings. Use --nowarnings
+ to turn off.
sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time
- client-bindir=PATH Path to the directory where client binaries are located
- client-libdir=PATH Path to the directory where client libraries are located
-
-Deprecated options
- with-openssl Deprecated option for ssl
-
HERE
- mtr_exit(1);
+ exit(1);
}
+
diff --git a/mysql-test/ndb/Makefile.am b/mysql-test/ndb/Makefile.am
deleted file mode 100644
index 4ddf61cf5cc..00000000000
--- a/mysql-test/ndb/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-
-benchdir_root= $(prefix)
-testdir = $(benchdir_root)/mysql-test/ndb
-
-EXTRA_DIST = ndbcluster.sh
-CLEANFILES = ndbcluster
-dist_test_DATA = ndb_config_2_node.ini ndb_config_1_node.ini
-test_SCRIPTS = ndbcluster
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''ndb_port''@!$(ndb_port)!g' \
- -e 's!@''ndbbindir''@!$(ndbbindir)!g' \
- -e 's!@''ndbtoolsdir''@!$(ndbtoolsdir)!g' \
- $< > $@-t
- @CHMOD@ +x $@-t
- @MV@ $@-t $@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result
deleted file mode 100644
index 9d2b18881b9..00000000000
--- a/mysql-test/ndb/basic.result
+++ /dev/null
@@ -1,69 +0,0 @@
--- NDB Cluster -- Management Client --
----------------------------------------------------------------------------
- NDB Cluster -- Management Client -- Help
----------------------------------------------------------------------------
-HELP Print help text
-HELP SHOW Help for SHOW command
-HELP DEBUG Help for debug compiled version
-SHOW Print information about cluster
-START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]
- Start backup (default WAIT COMPLETED)
-ABORT BACKUP <backup id> Abort backup
-SHUTDOWN Shutdown all processes in cluster
-CLUSTERLOG ON [<severity>] ... Enable Cluster logging
-CLUSTERLOG OFF [<severity>] ... Disable Cluster logging
-CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off
-CLUSTERLOG INFO Print cluster log information
-<id> START Start DB node (started with -n)
-<id> RESTART [-n] [-i] Restart DB node
-<id> STOP Stop DB node
-ENTER SINGLE USER MODE <api-node> Enter single user mode
-EXIT SINGLE USER MODE Exit single user mode
-<id> STATUS Print status
-<id> CLUSTERLOG {<category>=<level>}+ Set log level for cluster log
-PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server
-CONNECT [<connectstring>] Connect to management server (reconnect if already connected)
-QUIT Quit management client
-
-<severity> = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG
-<category> = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | CONGESTION | DEBUG | BACKUP
-<level> = 0 - 15
-<id> = ALL | Any database node id
-
-Connected to Management Server at: localhost:1186
-Node 1: started (Version 5.0.3)
-Node 2: started (Version 5.0.3)
-
-Node 1: started (Version 5.0.3)
-
-Node 2: started (Version 5.0.3)
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Cluster logging is disabled
-Cluster logging is enabled.
-Cluster logging is disabled
-ALL disabled
-ALL enabled
diff --git a/mysql-test/ndb/basic.test b/mysql-test/ndb/basic.test
deleted file mode 100644
index 945bda94ff6..00000000000
--- a/mysql-test/ndb/basic.test
+++ /dev/null
@@ -1,17 +0,0 @@
-help
-all status
-1 status
-2 status
-all clusterlog connection=8
-all clusterlog startup=7
-all clusterlog checkpoint=7
-all clusterlog noderestart=15
-all clusterlog statistics=7
-all clusterlog error=7
-all clusterlog info=7
-all clusterlog backup=15
-clusterlog off
-clusterlog toggle
-clusterlog off
-clusterlog off all
-clusterlog on all
diff --git a/mysql-test/ndb/basic_log.result b/mysql-test/ndb/basic_log.result
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mysql-test/ndb/basic_log.result
+++ /dev/null
diff --git a/mysql-test/ndb/ndb_config_4_node.ini b/mysql-test/ndb/ndb_config_4_node.ini
deleted file mode 100644
index d7c66cf177a..00000000000
--- a/mysql-test/ndb/ndb_config_4_node.ini
+++ /dev/null
@@ -1,55 +0,0 @@
-[ndbd default]
-NoOfReplicas= 2
-MaxNoOfConcurrentTransactions= 64
-MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations
-DataMemory= CHOOSE_DataMemory
-IndexMemory= CHOOSE_IndexMemory
-Diskless= CHOOSE_Diskless
-TimeBetweenWatchDogCheck= 30000
-DataDir= CHOOSE_FILESYSTEM
-MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
-MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
-TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 3
-DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
-
-#
-# Increase timeouts to cater for slow test-machines
-# (possibly running several tests in parallell)
-#
-HeartbeatIntervalDbDb= 30000
-HeartbeatIntervalDbApi= 30000
-#TransactionDeadlockDetectionTimeout= 7500
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_2 # hostname is a valid network adress
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_3 # hostname is a valid network adress
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_4 # hostname is a valid network adress
-
-[ndb_mgmd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-DataDir= CHOOSE_FILESYSTEM #
-PortNumber= CHOOSE_PORT_MGM
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh
deleted file mode 100644
index 2d550294c84..00000000000
--- a/mysql-test/ndb/ndbcluster.sh
+++ /dev/null
@@ -1,414 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2004 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# This scripts starts the table handler ndbcluster
-
-# configurable parameters, make sure to change in mysqlcluterd as well
-port=@ndb_port@
-fsdir=`pwd`
-# end configurable parameters
-
-#BASEDIR is always one above mysql-test directory
-CWD=`pwd`
-cd ..
-BASEDIR=`pwd`
-cd $CWD
-
-# Are we using a source or a binary distribution?
-if [ -d ../sql ] ; then
- SOURCE_DIST=1
- ndbtop=$BASEDIR/storage/ndb
- exec_ndb=$ndbtop/src/kernel/ndbd
- exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd
- exec_waiter=$ndbtop/tools/ndb_waiter
- exec_test=$ndbtop/tools/ndb_test_platform
- exec_test_ndberror=$ndbtop/src/ndbapi/ndberror_check
- exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgm
-else
- BINARY_DIST=1
- if test -x "$BASEDIR/libexec/ndbd"
- then
- exec_ndb=$BASEDIR/libexec/ndbd
- exec_mgmtsrvr=$BASEDIR/libexec/ndb_mgmd
- else
- exec_ndb=$BASEDIR/bin/ndbd
- exec_mgmtsrvr=$BASEDIR/bin/ndb_mgmd
- fi
- exec_waiter=$BASEDIR/bin/ndb_waiter
- exec_test=$BASEDIR/bin/ndb_test_platform
- exec_test_ndberror=
- exec_mgmtclient=$BASEDIR/bin/ndb_mgm
-fi
-
-if $exec_test ; then :; else
- echo "ndb not correctly compiled to support this platform"
- exit 1
-fi
-
-if [ $exec_test_ndberror ] ; then
-if $exec_test_ndberror ; then :; else
- echo "please fix in ndberror.c"
- exit 1
-fi
-fi
-
-pidfile=ndbcluster.pid
-cfgfile=Ndb.cfg
-test_ndb=
-stop_ndb=
-initial_ndb=
-status_ndb=
-ndb_diskless=0
-ndbd_nodes=2
-relative_config_data_dir=
-opt_core=
-
-ndb_no_ord=512
-ndb_no_attr=2048
-ndb_con_op=105000
-ndb_dmem=80M
-ndb_imem=24M
-ndb_pbmem=32M
-
-VERBOSE=100
-NDB_MGM_EXTRA_OPTS=
-NDB_MGMD_EXTRA_OPTS=
-NDBD_EXTRA_OPTS=
-CHARSETSDIR=
-
-while test $# -gt 0; do
- case "$1" in
- --test)
- test_ndb=1
- ;;
- --stop)
- stop_ndb=1
- ;;
- --initial)
- flags_ndb="$flags_ndb --initial"
- initial_ndb=1
- ;;
- --debug*)
- flags_ndb="$flags_ndb $1"
- ;;
- --ndbd-nodes=*)
- ndbd_nodes=`echo "$1" | sed -e "s;--ndbd-nodes=;;"`
- ;;
- --status)
- status_ndb=1
- ;;
- --small)
- ndb_no_ord=32
- ndb_con_op=5000
- ndb_dmem=20M
- ndb_imem=1M
- ndb_pbmem=4M
- ;;
- --diskless)
- ndb_diskless=1
- ;;
- --data-dir=*)
- fsdir=`echo "$1" | sed -e "s;--data-dir=;;"`
- ;;
- --relative-config-data-dir)
- relative_config_data_dir=1
- ;;
- --port=*)
- port=`echo "$1" | sed -e "s;--port=;;"`
- ;;
- --port-base=*)
- $ECHO "--port-base option depricated. Ignored."
- ;;
- --ndb_mgm-extra-opts=*)
- NDB_MGM_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgm-extra-opts=;;"`
- ;;
- --ndb_mgmd-extra-opts=*)
- NDB_MGMD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgmd-extra-opts=;;"`
- ;;
- --ndbd-extra-opts=*)
- NDBD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndbd-extra-opts=;;"`
- ;;
- --character-sets-dir=*)
- CHARSETSDIR=`echo "$1" | sed -e "s;--character-sets-dir=;;"`
- ;;
- --core)
- opt_core="--core"
- ;;
- --verbose=*)
- VERBOSE=`echo "$1" | sed -e "s;--verbose=;;"`
- ;;
- -- ) shift; break ;;
- --* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
- * ) break ;;
- esac
- shift
-done
-
-fs_ndb="$fsdir/ndbcluster-$port"
-config_ini=ndb/ndb_config_${ndbd_nodes}_node.ini
-
-NDB_HOME=
-if [ ! -d "$fsdir" ]; then
- echo "$fsdir missing"
- exit 1
-fi
-if [ ! -x "$exec_ndb" ]; then
- echo "$exec_ndb missing"
- exit 1
-fi
-if [ ! -x "$exec_mgmtsrvr" ]; then
- echo "$exec_mgmtsrvr missing"
- exit 1
-fi
-if [ ! -x "$exec_waiter" ]; then
- echo "$exec_waiter missing"
- exit 1
-fi
-if [ ! -f "$config_ini" ]; then
- echo "$config_ini missing, unsupported number of nodes"
- exit 1
-fi
-
-exec_mgmtclient="$exec_mgmtclient --no-defaults $opt_core $NDB_MGM_EXTRA_OPTS"
-exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $opt_core $NDB_MGMD_EXTRA_OPTS"
-exec_ndb="$exec_ndb --no-defaults $opt_core $NDBD_EXTRA_OPTS --character-sets-dir=$CHARSETSDIR"
-exec_waiter="$exec_waiter --no-defaults $opt_core"
-
-ndb_host="localhost"
-ndb_mgmd_port=$port
-NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port"
-export NDB_CONNECTSTRING
-
-sleep_until_file_created () {
- file=$1
- loop=$2
- org_time=$2
- message=$3
- while (test $loop -gt 0)
- do
- if [ -r $file ]
- then
- return 0
- fi
- sleep 1
- loop=`expr $loop - 1`
- done
- if [ $message ]
- then
- echo $message
- fi
- echo "ERROR: $file was not created in $org_time seconds; Aborting"
- return 1;
-}
-
-start_default_ndbcluster() {
-
-# do some checks
-
-if [ "$initial_ndb" ] ; then
- [ -d "$fs_ndb" ] || mkdir "$fs_ndb"
-fi
-if [ -d "$fs_ndb" ]; then :; else
- echo "$fs_ndb filesystem directory does not exist"
- exit 1
-fi
-
-# Start management server as deamon
-
-# Edit file system path and ports in config file
-if [ $relative_config_data_dir ] ; then
- config_fs_ndb="."
-else
- config_fs_ndb=$fs_ndb
-fi
-if [ $initial_ndb ] ; then
- rm -rf $fs_ndb/ndb_* 2>&1 | cat > /dev/null
- sed \
- -e s,"CHOOSE_MaxNoOfAttributes","$ndb_no_attr",g \
- -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \
- -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \
- -e s,"CHOOSE_DataMemory","$ndb_dmem",g \
- -e s,"CHOOSE_IndexMemory","$ndb_imem",g \
- -e s,"CHOOSE_Diskless","$ndb_diskless",g \
- -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \
- -e s,"CHOOSE_FILESYSTEM","$config_fs_ndb",g \
- -e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \
- -e s,"CHOOSE_DiskPageBufferMemory","$ndb_pbmem",g \
- < "$config_ini" \
- > "$fs_ndb/config.ini"
-fi
-
-rm -f "$cfgfile" 2>&1 | cat > /dev/null
-rm -f "$fs_ndb/$cfgfile" 2>&1 | cat > /dev/null
-
-if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else
- echo "Unable to start $exec_mgmtsrvr from `pwd`"
- exit 1
-fi
-if sleep_until_file_created $fs_ndb/ndb_`expr $ndbd_nodes + 1`.pid 120
-then :; else
- exit 1
-fi
-cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
-
-# Start database node
-
-id=1
-while [ $id -le $ndbd_nodes ]
-do
- if [ `expr $VERBOSE \> 1` = 1 ] ; then
- echo "Starting ndbd $id($ndbd_nodes)"
- fi
- ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & )
- if sleep_until_file_created $fs_ndb/ndb_${id}.pid 120
- then :; else
- stop_default_ndbcluster
- exit 1
- fi
- cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
- id=`expr $id + 1`
-done
-
-# test if Ndb Cluster starts properly
-
-if [ `expr $VERBOSE \> 1` = 1 ] ; then
- echo "Waiting for NDB data nodes to start..."
-fi
-if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK" > /dev/null 2>&1 ; then :; else
- if [ `expr $VERBOSE \> 0` = 1 ] ; then
- echo "Ndbcluster startup failed"
- fi
- stop_default_ndbcluster
- exit 1
-fi
-if [ `expr $VERBOSE \> 1` = 1 ] ; then
- echo "Ok"
-fi
-
-cat `find "$fs_ndb" -name 'ndb_*.pid'` > $fs_ndb/$pidfile
-
-if [ `expr $VERBOSE \> 2` = 1 ] ; then
- status_ndbcluster
-fi
-}
-
-status_ndbcluster() {
- # Start management client
- $exec_mgmtclient -e show
-}
-
-stop_default_ndbcluster() {
-
-# Start management client
-
-exec_mgmtclient="$exec_mgmtclient --try-reconnect=1"
-
-$exec_mgmtclient -e shutdown 2>&1 | cat > /dev/null
-
-if [ -f "$fs_ndb/$pidfile" ] ; then
- kill_pids=`cat "$fs_ndb/$pidfile"`
- attempt=0
- while [ $attempt -lt 10 ] ; do
- new_kill_pid=""
- kill_pids2=""
- for p in $kill_pids ; do
- kill -0 $p 2> /dev/null
- if [ $? -eq 0 ] ; then
- new_kill_pid="$p $new_kill_pid"
- kill_pids2="-$p $kill_pids2"
- fi
- done
- kill_pids=$new_kill_pid
- if [ -z "$kill_pids" ] ; then
- break
- fi
- sleep 1
- attempt=`expr $attempt + 1`
- done
- if [ "$kill_pids2" != "" ] ; then
- echo "Failed to shutdown ndbcluster, executing kill "$kill_pids2
- kill -9 -- $kill_pids2 2> /dev/null
- /bin/kill -9 -- $kill_pids2 2> /dev/null
- /usr/bin/kill -9 -- $kill_pids2 2> /dev/null
- kill -9 $kill_pids2 2> /dev/null
- /bin/kill -9 $kill_pids2 2> /dev/null
- /usr/bin/kill -9 $kill_pids2 2> /dev/null
- fi
- rm "$fs_ndb/$pidfile"
-fi
-}
-
-initialize_ndb_test ()
-{
- fs_result=$fs_ndb/r
- rm -rf $fs_result
- mkdir $fs_result
- echo ------------------
- echo starting ndb tests
- echo ------------------
-}
-
-do_ndb_test ()
-{
- test_name=$1
-
- clusterlog=$fs_ndb/ndb_3_cluster.log
-
- test_log_result=$fs_result/${test_name}_log.result
- test_log_reject=$fs_result/${test_name}_log.reject
- test_result=$fs_result/${test_name}.result
- test_reject=$fs_result/${test_name}.reject
-
- clean_log='s/.*\[MgmSrvr\]//'
-
- cat $clusterlog ndb/${test_name}_log.result | sed -e $clean_log > $test_log_result
-
- cp ndb/${test_name}.result $test_result
-
- cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject
- cat $clusterlog | sed -e $clean_log > $test_log_reject
-
- t="pass"
- diff -C 5 $test_result $test_reject || t="fail"
- printf "ndb_mgm output %20s [%s]\n" $test_name $t
- t="pass"
- diff -C 5 $test_log_result $test_log_reject || t="fail"
- printf "clusterlog output %20s [%s]\n" $test_name $t
-}
-
-if [ $status_ndb ] ; then
- status_ndbcluster
- exit 0
-fi
-
-if [ $stop_ndb ] ; then
- stop_default_ndbcluster
-else
- start_default_ndbcluster
-fi
-
-if [ $test_ndb ] ; then
- initialize_ndb_test
- all_tests=`ls ndb/*.test | sed "s#ndb/##" | sed "s#.test##"`
- for a in $all_tests ; do
- do_ndb_test $a
- done
- echo ------------------
- echo shutting down cluster
- stop_default_ndbcluster
-fi
-
-exit 0
diff --git a/mysql-test/ndb/restart.result b/mysql-test/ndb/restart.result
deleted file mode 100644
index efa1399b5d9..00000000000
--- a/mysql-test/ndb/restart.result
+++ /dev/null
@@ -1,16 +0,0 @@
--- NDB Cluster -- Management Client --
-Connected to Management Server at: localhost:1186
-ALL disabled
-Cluster logging is enabled.
-ALERT enabled
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Node 1 is being restarted.
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Node 1 is being restarted.
-
-ALL enabled
diff --git a/mysql-test/ndb/restart.test b/mysql-test/ndb/restart.test
deleted file mode 100644
index 4b4584dd739..00000000000
--- a/mysql-test/ndb/restart.test
+++ /dev/null
@@ -1,12 +0,0 @@
-clusterlog off all
-clusterlog on
-clusterlog on alert
-all clusterlog connection=0
-sleep 1
-1 restart
-sleep 5
-all clusterlog connection=8
-sleep 1
-1 restart
-sleep 10
-clusterlog on all
diff --git a/mysql-test/ndb/restart_log.result b/mysql-test/ndb/restart_log.result
deleted file mode 100644
index 2b25fc7b5b6..00000000000
--- a/mysql-test/ndb/restart_log.result
+++ /dev/null
@@ -1,20 +0,0 @@
- ALERT -- Node 2: Network partitioning - arbitration required
- ALERT -- Node 2: Arbitration won - positive reply from node 3
- ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
- ALERT -- Node 2: Node failure of 1 DBLQH completed
- ALERT -- Node 2: Node failure of 1 DBDICT completed
- ALERT -- Node 2: Node failure of 1 DBDIH completed
- ALERT -- Node 2: Node failure of 1 DBTC completed
- ALERT -- Node 2: Node 2 completed failure of Node 1
- ALERT -- Node 2: All nodes completed failure of Node 1
- ALERT -- Node 3: Node 1 Disconnected
- ALERT -- Node 2: Node 1 Disconnected
- ALERT -- Node 2: Network partitioning - arbitration required
- ALERT -- Node 2: Arbitration won - positive reply from node 3
- ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
- ALERT -- Node 2: Node failure of 1 DBLQH completed
- ALERT -- Node 2: Node failure of 1 DBDICT completed
- ALERT -- Node 2: Node failure of 1 DBDIH completed
- ALERT -- Node 2: Node failure of 1 DBTC completed
- ALERT -- Node 2: Node 2 completed failure of Node 1
- ALERT -- Node 2: All nodes completed failure of Node 1
diff --git a/mysql-test/r/1st.result b/mysql-test/r/1st.result
index 60190629dd0..4a82f8c66e9 100644
--- a/mysql-test/r/1st.result
+++ b/mysql-test/r/1st.result
@@ -1,6 +1,7 @@
show databases;
Database
information_schema
+mtr
mysql
test
show tables in mysql;
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index f0edfc9bb59..5a115e9ea99 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -996,6 +996,22 @@ SELECT * FROM t1;
v b
abc 5
DROP TABLE t1;
+create table t1 (a tinytext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+drop table t1;
+create table t1 (a mediumtext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+drop table t1;
End of 5.0 tests
drop table if exists t1, t2, t3;
create table t1 (i int);
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index e9eb50fc805..8c26ea1ff82 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12694,3 +12694,4 @@ SELECT * FROM t1 ORDER BY a;
a b
1 NULL
2 NULL
+DROP TABLE t1;
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index a39b424827c..21e6347cb47 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -231,7 +231,8 @@ a b
204 7
delete from t1 where a=0;
update t1 set a=NULL where b=6;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning 1048 Column 'a' cannot be null
update t1 set a=300 where b=7;
SET SQL_MODE='';
insert into t1(a,b)values(NULL,8);
@@ -246,7 +247,7 @@ a b
1 1
200 2
201 4
-203 6
+0 6
300 7
301 8
400 9
@@ -262,7 +263,6 @@ a b
1 1
200 2
201 4
-203 6
300 7
301 8
400 9
@@ -273,20 +273,20 @@ a b
405 14
delete from t1 where a=0;
update t1 set a=NULL where b=13;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning 1048 Column 'a' cannot be null
update t1 set a=500 where b=14;
select * from t1 order by b;
a b
1 1
200 2
201 4
-203 6
300 7
301 8
400 9
401 10
402 11
-404 13
+0 13
500 14
drop table t1;
create table t1 (a bigint);
diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result
index 4de599f3af7..b657c620805 100644
--- a/mysql-test/r/backup.result
+++ b/mysql-test/r/backup.result
@@ -1,24 +1,24 @@
set SQL_LOG_BIN=0;
drop table if exists t1, t2, t3, t4;
create table t4(n int);
-backup table t4 to '../bogus';
+backup table t4 to '../../bogus';
Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X)
test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X)
test.t4 backup status Operation failed
-backup table t4 to '../tmp';
+backup table t4 to '../../tmp';
Table Op Msg_type Msg_text
test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup status OK
-backup table t4 to '../tmp';
+backup table t4 to '../../tmp';
Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X)
test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X)
test.t4 backup status Operation failed
drop table t4;
-restore table t4 from '../tmp';
+restore table t4 from '../../tmp';
Table Op Msg_type Msg_text
test.t4 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 restore status OK
@@ -27,18 +27,18 @@ count(*)
0
create table t1(n int);
insert into t1 values (23),(45),(67);
-backup table t1 to '../tmp';
+backup table t1 to '../../tmp';
Table Op Msg_type Msg_text
test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 backup status OK
drop table t1;
-restore table t1 from '../bogus';
+restore table t1 from '../../bogus';
Table Op Msg_type Msg_text
t1 restore error Failed copying .frm file
Warnings:
Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X)
-restore table t1 from '../tmp';
+restore table t1 from '../../tmp';
Table Op Msg_type Msg_text
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
@@ -51,13 +51,13 @@ create table t2(m int not null primary key);
create table t3(k int not null primary key);
insert into t2 values (123),(145),(167);
insert into t3 values (223),(245),(267);
-backup table t2,t3 to '../tmp';
+backup table t2,t3 to '../../tmp';
Table Op Msg_type Msg_text
test.t2 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t2 backup status OK
test.t3 backup status OK
drop table t1,t2,t3;
-restore table t1,t2,t3 from '../tmp';
+restore table t1,t2,t3 from '../../tmp';
Table Op Msg_type Msg_text
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
@@ -79,13 +79,13 @@ k
245
267
drop table t1,t2,t3,t4;
-restore table t1 from '../tmp';
+restore table t1 from '../../tmp';
Table Op Msg_type Msg_text
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
rename table t1 to t5;
lock tables t5 write;
-backup table t5 to '../tmp';
+backup table t5 to '../../tmp';
unlock tables;
Table Op Msg_type Msg_text
test.t5 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
@@ -94,12 +94,12 @@ drop table t5;
DROP TABLE IF EXISTS `t+1`;
CREATE TABLE `t+1` (c1 INT);
INSERT INTO `t+1` VALUES (1), (2), (3);
-BACKUP TABLE `t+1` TO '../tmp';
+BACKUP TABLE `t+1` TO '../../tmp';
Table Op Msg_type Msg_text
test.t+1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t+1 backup status OK
DROP TABLE `t+1`;
-RESTORE TABLE `t+1` FROM '../tmp';
+RESTORE TABLE `t+1` FROM '../../tmp';
Table Op Msg_type Msg_text
test.t+1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t+1 restore status OK
diff --git a/mysql-test/r/cache_innodb.result b/mysql-test/r/cache_innodb.result
index 17cfcd69ec3..b59298727c5 100644
--- a/mysql-test/r/cache_innodb.result
+++ b/mysql-test/r/cache_innodb.result
@@ -67,10 +67,10 @@ a
2
show status like "Qcache_queries_in_cache";
Variable_name Value
-Qcache_queries_in_cache 3
+Qcache_queries_in_cache 6
show status like "Qcache_hits";
Variable_name Value
-Qcache_hits 3
+Qcache_hits 0
insert into t1 values (3);
insert into t2 values (3);
insert into t1 values (4);
@@ -91,14 +91,14 @@ a
2
show status like "Qcache_queries_in_cache";
Variable_name Value
-Qcache_queries_in_cache 1
+Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
-Qcache_hits 4
+Qcache_hits 1
commit;
show status like "Qcache_queries_in_cache";
Variable_name Value
-Qcache_queries_in_cache 1
+Qcache_queries_in_cache 2
drop table t3,t2,t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id));
select count(*) from t1;
@@ -217,5 +217,6 @@ Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
-Qcache_hits 2
+Qcache_hits 1
+set GLOBAL query_cache_size=1048576;
drop table t2;
diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result
index a075c01fe61..f8d5d900a80 100644
--- a/mysql-test/r/change_user.result
+++ b/mysql-test/r/change_user.result
@@ -44,3 +44,5 @@ IS_FREE_LOCK('bug31418')
SELECT IS_USED_LOCK('bug31418');
IS_USED_LOCK('bug31418')
NULL
+FLUSH STATUS;
+Value of com_select did not change
diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result
index a2c1eb9a82e..de80dba47c1 100644
--- a/mysql-test/r/commit_1innodb.result
+++ b/mysql-test/r/commit_1innodb.result
@@ -263,7 +263,7 @@ rollback;
select * from t2;
a
insert into t2 (a) values (1026);
-load data infile "../std_data_ln/words.dat" into table t1 (a) set a:=f2(26);
+load data infile "../../std_data/words.dat" into table t1 (a) set a:=f2(26);
ERROR 23000: Duplicate entry '26' for key 'a'
select * from t2;
a
@@ -683,12 +683,12 @@ SUCCESS
# 23. DDL: RENAME TEMPORARY TABLE, does not start a transaction
# No test because of Bug#8729 "rename table fails on temporary table"
-# 24. DDL: TRUNCATE TEMPORARY TABLE, does not start a transaction
+# 24. DDL: TRUNCATE TEMPORARY TABLE
truncate table t2;
-call p_verify_status_increment(2, 0, 2, 0);
-SUCCESS
-
+call p_verify_status_increment(4, 0, 4, 0);
+ERROR
+Expected commit increment: 4 actual: 2
commit;
# There is nothing left to commit
call p_verify_status_increment(0, 0, 0, 0);
@@ -770,8 +770,11 @@ call p_verify_status_increment(0, 0, 0, 0);
SUCCESS
insert t1 set a=4;
-# Sic: a bug. Binlog did not register itself this time.
-call p_verify_status_increment(1, 0, 1, 0);
+# Binlog does not register itself this time for other than the 1st
+# statement of the transaction with MIXED/STATEMENT binlog_format.
+# It needs registering with the ROW format. Therefore 1,0,2,2 are
+# the correct arguments to this test after bug#40221 fixed.
+call p_verify_status_increment(1, 0, 2, 2);
SUCCESS
release savepoint a;
@@ -850,9 +853,9 @@ call p_verify_status_increment(1, 0, 1, 0);
SUCCESS
truncate table t3;
-call p_verify_status_increment(2, 2, 2, 2);
-SUCCESS
-
+call p_verify_status_increment(4, 4, 4, 4);
+ERROR
+Expected commit increment: 4 actual: 2
create view v1 as select * from t2;
call p_verify_status_increment(1, 0, 1, 0);
SUCCESS
diff --git a/mysql-test/r/concurrent_innodb_safelog.result b/mysql-test/r/concurrent_innodb_safelog.result
index 98e1205901a..92d274993d9 100644
--- a/mysql-test/r/concurrent_innodb_safelog.result
+++ b/mysql-test/r/concurrent_innodb_safelog.result
@@ -801,3 +801,4 @@ eta tipo c
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
** connection default
drop table t1;
+drop user mysqltest@localhost;
diff --git a/mysql-test/r/concurrent_innodb_unsafelog.result b/mysql-test/r/concurrent_innodb_unsafelog.result
index 14973fe07d9..2a6c15d38c1 100644
--- a/mysql-test/r/concurrent_innodb_unsafelog.result
+++ b/mysql-test/r/concurrent_innodb_unsafelog.result
@@ -797,3 +797,4 @@ eta tipo c
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
** connection default
drop table t1;
+drop user mysqltest@localhost;
diff --git a/mysql-test/r/concurrent_insert_func.result b/mysql-test/r/concurrent_insert_func.result
deleted file mode 100644
index 87573bb2873..00000000000
--- a/mysql-test/r/concurrent_insert_func.result
+++ /dev/null
@@ -1,73 +0,0 @@
-drop table if exists t1;
-## Creating new table ##
-CREATE TABLE t1
-(
-name varchar(30)
-);
-'#--------------------FN_DYNVARS_018_01-------------------------#'
-## Setting initial value of variable to 1 ##
-SET @@global.concurrent_insert = 1;
-INSERT into t1(name) values('Record_1');
-INSERT into t1(name) values('Record_2');
-INSERT into t1(name) values('Record_3');
-## locking table ##
-lock table t1 read local;
-## Creating new connection to insert some rows in table ##
-## New records should come at the end of all rows ##
-INSERT into t1(name) values('Record_4');
-SELECT * from t1;
-name
-Record_1
-Record_2
-Record_3
-Record_4
-## unlocking tables ##
-unlock tables;
-## deleting record to create hole in table ##
-DELETE from t1 where name ='Record_2';
-'#--------------------FN_DYNVARS_018_02-------------------------#'
-'#--------------------FN_DYNVARS_018_03-------------------------#'
-## lock table and connect with connection1 ##
-lock table t1 read local;
-## setting value of concurrent_insert to 2 ##
-SET @@global.concurrent_insert=2;
-## Inserting record in table, record should go at the end of the table ##
-INSERT into t1(name) values('Record_5');
-SELECT * from t1;
-name
-Record_1
-Record_3
-Record_4
-Record_5
-SELECT @@concurrent_insert;
-@@concurrent_insert
-2
-## Switching to default connection ##
-## Unlocking table ##
-unlock tables;
-SELECT * from t1;
-name
-Record_1
-Record_3
-Record_4
-Record_5
-## Inserting new row, this should go in the hole ##
-INSERT into t1(name) values('Record_6');
-SELECT * from t1;
-name
-Record_1
-Record_6
-Record_3
-Record_4
-Record_5
-## connection test_con1 ##
-DELETE from t1 where name ='Record_3';
-SELECT * from t1;
-name
-Record_1
-Record_6
-Record_4
-Record_5
-## Dropping table ##
-DROP table t1;
-## Disconnecting connection ##
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 947890d2085..057a8600ca2 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1803,6 +1803,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+DROP TABLE t1;
# -- End of test case for Bug#21380.
@@ -1890,5 +1891,7 @@ c1 c2
DROP TABLE t1;
# -- End of Bug#34274
+create table `me:i`(id int);
+drop table `me:i`;
End of 5.1 tests
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index 8bc6114dbc2..4b96f5a5ed0 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5391,7 +5391,20 @@ drop table t1;
create table t1 (a int not null) engine=csv;
lock tables t1 read;
select * from t1;
-ERROR HY000: File './test/t1.CSV' not found (Errcode: 2)
+ERROR HY000: File 'MYSQLD_DATADIR/test/t1.CSV' not found (Errcode: 2)
unlock tables;
drop table t1;
+create table t1(a enum ('a') not null) engine=csv;
+insert into t1 values (2);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select * from t1 limit 1;
+ERROR HY000: Table 't1' is marked as crashed and should be repaired
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair Warning Data truncated for column 'a' at row 1
+test.t1 repair status OK
+select * from t1 limit 1;
+a
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/csv_not_null.result b/mysql-test/r/csv_not_null.result
index 77026b8f056..af583a36837 100644
--- a/mysql-test/r/csv_not_null.result
+++ b/mysql-test/r/csv_not_null.result
@@ -46,8 +46,9 @@ SELECT * FROM t1;
a b
0 new_value
UPDATE t1 set b = NULL where b = 'new_value';
-ERROR 23000: Column 'b' cannot be null
+Warnings:
+Warning 1048 Column 'b' cannot be null
SELECT * FROM t1;
a b
-0 new_value
+0
DROP TABLE t1;
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index 2c8059a8afc..2efcf549608 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -268,8 +268,8 @@ create table t1 (a blob);
insert into t1 values (0xEE00);
select * into outfile 'test/t1.txt' from t1;
delete from t1;
-select hex(load_file('MYSQLTEST_VARDIR/master-data/test/t1.txt'));;
-hex(load_file('MYSQLTEST_VARDIR/master-data/test/t1.txt'))
+select hex(load_file('MYSQLD_DATADIR/test/t1.txt'));;
+hex(load_file('MYSQLD_DATADIR/test/t1.txt'))
5CEE5C300A
load data infile 't1.txt' into table t1;
select hex(a) from t1;
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result
index f3d3ff700f0..5dc9ea35cc3 100644
--- a/mysql-test/r/ctype_ldml.result
+++ b/mysql-test/r/ctype_ldml.result
@@ -21,6 +21,25 @@ select * from t1 where c1='b';
c1
a
drop table t1;
+CREATE TABLE t1 (
+col1 varchar(100) character set utf8 collate utf8_test_ci
+);
+INSERT INTO t1 (col1) VALUES ('abcd'),('efgh'),('ijkl');
+ALTER TABLE t1 ADD FULLTEXT INDEX (col1);
+SELECT * FROM t1 where match (col1) against ('abcd');
+col1
+abcd
+SELECT * FROM t1 where match (col1) against ('abcd' IN BOOLEAN MODE);
+col1
+abcd
+ALTER TABLE t1 ADD (col2 varchar(100) character set latin1);
+UPDATE t1 SET col2=col1;
+SELECT * FROM t1 WHERE col1=col2 ORDER BY col1;
+col1 col2
+abcd abcd
+efgh efgh
+ijkl ijkl
+DROP TABLE t1;
show collation like 'ucs2_vn_ci';
Collation Charset Id Default Compiled Sortlen
ucs2_vn_ci ucs2 242 8
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index ec2182a3304..428629e7e9e 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -1157,4 +1157,57 @@ set names latin1;
select hex(char(0x41 using ucs2));
hex(char(0x41 using ucs2))
0041
+SET character_set_connection=ucs2;
+SELECT CHARSET(DAYNAME(19700101));
+CHARSET(DAYNAME(19700101))
+ucs2
+SELECT CHARSET(MONTHNAME(19700101));
+CHARSET(MONTHNAME(19700101))
+ucs2
+SELECT LOWER(DAYNAME(19700101));
+LOWER(DAYNAME(19700101))
+thursday
+SELECT LOWER(MONTHNAME(19700101));
+LOWER(MONTHNAME(19700101))
+january
+SELECT UPPER(DAYNAME(19700101));
+UPPER(DAYNAME(19700101))
+THURSDAY
+SELECT UPPER(MONTHNAME(19700101));
+UPPER(MONTHNAME(19700101))
+JANUARY
+SELECT HEX(MONTHNAME(19700101));
+HEX(MONTHNAME(19700101))
+004A0061006E0075006100720079
+SELECT HEX(DAYNAME(19700101));
+HEX(DAYNAME(19700101))
+00540068007500720073006400610079
+SET LC_TIME_NAMES=ru_RU;
+SET NAMES utf8;
+SET character_set_connection=ucs2;
+SELECT CHARSET(DAYNAME(19700101));
+CHARSET(DAYNAME(19700101))
+ucs2
+SELECT CHARSET(MONTHNAME(19700101));
+CHARSET(MONTHNAME(19700101))
+ucs2
+SELECT LOWER(DAYNAME(19700101));
+LOWER(DAYNAME(19700101))
+четверг
+SELECT LOWER(MONTHNAME(19700101));
+LOWER(MONTHNAME(19700101))
+ÑнварÑ
+SELECT UPPER(DAYNAME(19700101));
+UPPER(DAYNAME(19700101))
+ЧЕТВЕРГ
+SELECT UPPER(MONTHNAME(19700101));
+UPPER(MONTHNAME(19700101))
+ЯÐÐ’ÐРЯ
+SELECT HEX(MONTHNAME(19700101));
+HEX(MONTHNAME(19700101))
+042F043D043204300440044F
+SELECT HEX(DAYNAME(19700101));
+HEX(DAYNAME(19700101))
+0427043504420432043504400433
+SET character_set_connection=latin1;
End of 5.0 tests
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index dfd8244ef77..7e185daa668 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -1,14 +1,20 @@
drop table if exists t1;
-SHOW GLOBAL VARIABLES LIKE "%e_format";
-Variable_name Value
-date_format %d.%m.%Y
-datetime_format %Y-%m-%d %H:%i:%s
-time_format %H.%i.%s
-SHOW SESSION VARIABLES LIKE "%e_format";
-Variable_name Value
-date_format %d.%m.%Y
-datetime_format %Y-%m-%d %H:%i:%s
-time_format %H.%i.%s
+SELECT variable_name, variable_value
+FROM information_schema.global_variables
+WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+ORDER BY variable_name;
+variable_name variable_value
+DATETIME_FORMAT %Y-%m-%d %H:%i:%s
+DATE_FORMAT %d.%m.%Y
+TIME_FORMAT %H.%i.%s
+SELECT variable_name, variable_value
+FROM information_schema.session_variables
+WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+ORDER BY variable_name;
+variable_name variable_value
+DATETIME_FORMAT %Y-%m-%d %H:%i:%s
+DATE_FORMAT %d.%m.%Y
+TIME_FORMAT %H.%i.%s
SET time_format='%H%i%s';
SET time_format='%H:%i:%s.%f';
SET time_format='%h-%i-%s.%f%p';
@@ -26,11 +32,14 @@ set datetime_format= '%H:%i:%s %Y-%m-%d';
set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
set datetime_format= '%h:%i:%s %p %Y-%m-%d';
set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
-SHOW SESSION VARIABLES LIKE "%e_format";
-Variable_name Value
-date_format %m-%d-%Y
-datetime_format %h:%i:%s.%f %p %Y-%m-%d
-time_format %h:%i:%s%p
+SELECT variable_name, variable_value
+FROM information_schema.session_variables
+WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+ORDER BY variable_name;
+variable_name variable_value
+DATETIME_FORMAT %h:%i:%s.%f %p %Y-%m-%d
+DATE_FORMAT %m-%d-%Y
+TIME_FORMAT %h:%i:%s%p
SET time_format='%h:%i:%s';
ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s'
SET time_format='%H %i:%s';
@@ -590,3 +599,13 @@ select str_to_date('04/30/2004 ', '%m/%d/%Y ');
str_to_date('04/30/2004 ', '%m/%d/%Y ')
2004-04-30
"End of 4.1 tests"
+SELECT DATE_FORMAT("0000-01-01",'%W %d %M %Y') as valid_date;
+valid_date
+Sunday 01 January 0000
+SELECT DATE_FORMAT("0000-02-28",'%W %d %M %Y') as valid_date;
+valid_date
+Tuesday 28 February 0000
+SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
+valid_date
+Thursday 01 January 2009
+"End of 5.0 tests"
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index bcda6ddb6ab..4d5d656f3ce 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -284,4 +284,30 @@ ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1
DROP TABLE t1,t2;
+set @old_delayed_updates = @@global.low_priority_updates;
+set global low_priority_updates = 1;
+select @@global.low_priority_updates;
+@@global.low_priority_updates
+1
+drop table if exists t1;
+create table t1 (a int, b int);
+insert into t1 values (1,1);
+lock table t1 read;
+connection: update
+insert delayed into t1 values (2,2);;
+connection: select
+select * from t1;
+a b
+1 1
+connection: default
+select * from t1;
+a b
+1 1
+unlock tables;
+select * from t1;
+a b
+1 1
+2 2
+drop table t1;
+set global low_priority_updates = @old_delayed_updates;
End of 5.1 tests
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index 6a06a9661aa..f71bbd175e3 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -653,11 +653,11 @@ DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
default NULL);
SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
-'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
-LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
+'../../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../../tmp/data1.tmp' INTO TABLE t2;
SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
-'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
-LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
+'../../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../../tmp/data2.tmp' INTO TABLE t2;
SELECT @v19, @v20;
@v19 @v20
2 APPLE
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index cd6877b2967..b798b49dd34 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -47,6 +47,7 @@ create database mysqltest;
show databases;
Database
information_schema
+mtr
mysql
mysqltest
test
@@ -58,6 +59,7 @@ drop database mysqltest;
show databases;
Database
information_schema
+mtr
mysql
test
drop database mysqltest;
diff --git a/mysql-test/r/error_simulation.result b/mysql-test/r/error_simulation.result
index 77599ba303b..6153dad2534 100644
--- a/mysql-test/r/error_simulation.result
+++ b/mysql-test/r/error_simulation.result
@@ -13,6 +13,7 @@ INSERT INTO t1 VALUES
('AAAAAAAAAH','AAAAAAAAAH'), ('AAAAAAAAAI','AAAAAAAAAI'),
('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
set tmp_table_size=1024;
+set session debug="d,raise_error";
SELECT MAX(a) FROM t1 GROUP BY a,b;
ERROR 23000: Can't write; duplicate key in table 'tmp_table'
set tmp_table_size=default;
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index c698531dfec..83030a00179 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -3,6 +3,8 @@ drop database if exists mysqltest_db1;
drop database if exists mysqltest_db2;
create database events_test;
use events_test;
+set @concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert = 0;
select * from information_schema.global_variables where variable_name like 'event_scheduler';
VARIABLE_NAME VARIABLE_VALUE
EVENT_SCHEDULER ON
@@ -60,7 +62,7 @@ select get_lock('test_bug16407', 60);
end|
"Now if everything is fine the event has compiled and is locked"
select /*1*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'test_bug16407\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)';
user host db info
root localhost events_test select get_lock('test_bug16407', 60)
select release_lock('test_bug16407');
@@ -84,7 +86,7 @@ get_lock('ee_16407_2', 60)
set global event_scheduler= 1;
"Another sql_mode test"
set sql_mode="traditional";
-create table events_smode_test(ev_name char(10), a date) engine=myisam;
+create table events_smode_test(ev_name char(10), a date);
"This should never insert something"
create event ee_16407_2 on schedule every 60 second do
begin
@@ -92,7 +94,7 @@ select get_lock('ee_16407_2', 60) /*ee_16407_2*/;
select release_lock('ee_16407_2');
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
end|
-insert into events_smode_test values ('test','1980-19-02')|
+insert into events_test.events_smode_test values ('test','1980-19-02')|
ERROR 22007: Incorrect date value: '1980-19-02' for column 'a' at row 1
"This is ok"
create event ee_16407_3 on schedule every 60 second do
@@ -116,7 +118,7 @@ events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_
events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
events_test ee_16407_4
select /*2*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'ee_16407_2\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info
root localhost events_test select get_lock('ee_16407_2', 60)
root localhost events_test select get_lock('ee_16407_2', 60)
@@ -125,10 +127,10 @@ select release_lock('ee_16407_2');
release_lock('ee_16407_2')
1
select /*3*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'ee_16407_2\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info
set global event_scheduler= off;
-select * from events_smode_test order by ev_name, a;
+select * from events_test.events_smode_test order by ev_name, a;
ev_name a
ee_16407_3 1980-02-19
ee_16407_3 1980-02-29
@@ -143,7 +145,7 @@ drop event ee_16407_2;
drop event ee_16407_3;
drop event ee_16407_4;
"And now one last test regarding sql_mode and call of SP from an event"
-delete from events_smode_test;
+delete from events_test.events_smode_test;
set sql_mode='ansi';
select get_lock('ee_16407_5', 60);
get_lock('ee_16407_5', 60)
@@ -166,10 +168,8 @@ call events_test.ee_16407_6_pendant();
end|
"Should have 2 locked processes"
select /*4*/ user, host, db, info from information_schema.processlist
-where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
-order by info;
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
user host db info
-event_scheduler localhost NULL NULL
root localhost events_test select get_lock('ee_16407_5', 60)
root localhost events_test select get_lock('ee_16407_5', 60)
select release_lock('ee_16407_5');
@@ -177,11 +177,9 @@ release_lock('ee_16407_5')
1
"Should have 0 processes locked"
select /*5*/ user, host, db, info from information_schema.processlist
-where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
-order by info;
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
user host db info
-event_scheduler localhost NULL NULL
-select * from events_smode_test order by ev_name, a;
+select * from events_test.events_smode_test order by ev_name, a;
ev_name a
ee_16407_6 2004-02-29
"And here we check one more time before we drop the events"
@@ -739,4 +737,5 @@ select name from mysql.event where name = 'p' and sql_mode = @full_mode;
name
drop event e1;
DROP DATABASE events_test;
-SET GLOBAL event_scheduler = 'ON';
+SET GLOBAL event_scheduler= 'ON';
+SET @@global.concurrent_insert= @concurrent_insert;
diff --git a/mysql-test/r/events_restart_phase2.result b/mysql-test/r/events_restart.result
index 60ddf06bf23..4db61d357ce 100644
--- a/mysql-test/r/events_restart_phase2.result
+++ b/mysql-test/r/events_restart.result
@@ -1,3 +1,19 @@
+set global event_scheduler=off;
+drop database if exists events_test;
+create database events_test;
+use events_test;
+create table execution_log(name char(10));
+create event abc1 on schedule every 1 second do
+insert into execution_log value('abc1');
+create event abc2 on schedule every 1 second do
+insert into execution_log value('abc2');
+create event abc3 on schedule every 1 second do
+insert into execution_log value('abc3');
+create table event_like like mysql.event;
+insert into event_like select * from mysql.event;
+alter table mysql.event
+change column body body longtext character set utf8 collate utf8_bin;
+"Now we restart the server"
use events_test;
select @@event_scheduler;
@@event_scheduler
@@ -40,3 +56,9 @@ Restore the original mysql.event table
drop table mysql.event;
rename table event_like to mysql.event;
Now let's restart the server again
+use events_test;
+select @@event_scheduler;
+@@event_scheduler
+ON
+drop table execution_log;
+drop database events_test;
diff --git a/mysql-test/r/events_restart_phase1.result b/mysql-test/r/events_restart_phase1.result
deleted file mode 100644
index 7b1de62f2ef..00000000000
--- a/mysql-test/r/events_restart_phase1.result
+++ /dev/null
@@ -1,16 +0,0 @@
-set global event_scheduler=off;
-drop database if exists events_test;
-create database events_test;
-use events_test;
-create table execution_log(name char(10));
-create event abc1 on schedule every 1 second do
-insert into execution_log value('abc1');
-create event abc2 on schedule every 1 second do
-insert into execution_log value('abc2');
-create event abc3 on schedule every 1 second do
-insert into execution_log value('abc3');
-create table event_like like mysql.event;
-insert into event_like select * from mysql.event;
-alter table mysql.event
-change column body body longtext character set utf8 collate utf8_bin;
-"Now we restart the server"
diff --git a/mysql-test/r/events_restart_phase3.result b/mysql-test/r/events_restart_phase3.result
deleted file mode 100644
index abed0a2babc..00000000000
--- a/mysql-test/r/events_restart_phase3.result
+++ /dev/null
@@ -1,6 +0,0 @@
-use events_test;
-select @@event_scheduler;
-@@event_scheduler
-ON
-drop table execution_log;
-drop database events_test;
diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result
index 63140bffaa4..7dfd10a53f8 100644
--- a/mysql-test/r/events_scheduling.result
+++ b/mysql-test/r/events_scheduling.result
@@ -62,18 +62,6 @@ CREATE EVENT event_4 ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 1 SECOND
ON COMPLETION PRESERVE
DO
INSERT INTO table_4 VALUES (1);
-SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
-IF(SUM(a) >= 4, 'OK', 'ERROR')
-OK
-SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2;
-IF(SUM(a) >= 4, 'OK', 'ERROR')
-OK
-SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
-IF(SUM(a) >= 1, 'OK', 'ERROR')
-OK
-SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4;
-IF(SUM(a) >= 1, 'OK', 'ERROR')
-OK
SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 0124ced40ce..8633bd61681 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -522,3 +522,12 @@ WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 5 const 4 Using where
DROP TABLE t1;
+CREATE TABLE t1(a CHAR(10));
+INSERT INTO t1 VALUES('aaa15');
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1;
+MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE)
+1
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
+MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
+2
+DROP TABLE t1;
diff --git a/mysql-test/r/fulltext_plugin.result b/mysql-test/r/fulltext_plugin.result
new file mode 100644
index 00000000000..69ebbe07e9e
--- /dev/null
+++ b/mysql-test/r/fulltext_plugin.result
@@ -0,0 +1,5 @@
+INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
+CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
+ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
+DROP TABLE t1;
+UNINSTALL PLUGIN simple_parser;
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index def03deb351..8e14b7695ee 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -72,6 +72,7 @@ set @@global.max_allowed_packet=1048576*100;
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
0
+set @@global.max_allowed_packet=default;
create table t1(a blob);
insert into t1 values(NULL), (compress('a'));
select uncompress(a), uncompressed_length(a) from t1;
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index 62d34c5ce8f..955a784f04c 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -176,4 +176,13 @@ IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((R
DROP TABLE t1;
+CREATE TABLE t1 (c LONGTEXT);
+INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890');
+SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
+MAX(IF(1, CAST(c AS UNSIGNED), 0))
+12345678901234567890
+SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
+MAX(IFNULL(CAST(c AS UNSIGNED), 0))
+12345678901234567890
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index e761fb851fb..1e967b668c5 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -575,4 +575,16 @@ id
select * from t1 where NOT id in (null, 1);
id
drop table t1;
+CREATE TABLE t1(c0 INTEGER, c1 INTEGER, c2 INTEGER);
+INSERT INTO t1 VALUES(1, 1, 1), (1, 1, 1);
+SELECT CASE AVG (c0) WHEN c1 * c2 THEN 1 END FROM t1;
+CASE AVG (c0) WHEN c1 * c2 THEN 1 END
+1
+SELECT CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END FROM t1;
+CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END
+2
+SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
+CASE c1 WHEN c1 + 1 THEN 1 END ABS(AVG(c0))
+NULL 1.0000
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index a3df23138e8..3b864cd5804 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -324,6 +324,11 @@ select @my_uuid_date - @my_uuid_synthetic;
@my_uuid_date - @my_uuid_synthetic
0
set @@session.time_zone=@save_tz;
+CREATE TABLE t1 (a DATE);
+SELECT * FROM t1 WHERE a = NAME_CONST('reportDate',
+_binary'2009-01-09' COLLATE 'binary');
+a
+DROP TABLE t1;
End of 5.0 tests
select connection_id() > 0;
connection_id() > 0
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index 63f9ac71e74..bbc5390895b 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -268,3 +268,17 @@ timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00')
SELECT CAST(time('-73:42:12') AS DECIMAL);
CAST(time('-73:42:12') AS DECIMAL)
-734212
+SELECT TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1Eq,
+TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq1,
+TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq2,
+TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))= '00:00:00' AS 2Eq,
+TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq1,
+TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq2,
+TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME(0) AS 3Eq,
+TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME(0) AS 3NEq1,
+TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME(0) AS 3NEq2,
+TIME(0) AS Time0, TIME('00:00:00') AS Time00, '00:00:00' AS Literal0000,
+TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')),
+TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'));
+1Eq 1NEq1 1NEq2 2Eq 2NEq1 2NEq2 3Eq 3NEq1 3NEq2 Time0 Time00 Literal0000 TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')) TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'))
+1 0 0 1 0 0 1 0 0 00:00:00 00:00:00 00:00:00 00:59:00 -00:59:00
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 78748a4622f..0824f13cafc 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -717,8 +717,6 @@ insert(_latin2'abcd',2,3,_latin2'ef'),
replace(_latin2'abcd',_latin2'b',_latin2'B'),
encode('abcd','ab')
;
-Warnings:
-Warning 1265 Data truncated for column 'format(130,10)' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -727,7 +725,7 @@ t1 CREATE TABLE `t1` (
`conv(130,16,10)` varchar(64) DEFAULT NULL,
`hex(130)` varchar(6) NOT NULL DEFAULT '',
`char(130)` varbinary(4) NOT NULL DEFAULT '',
- `format(130,10)` varchar(4) NOT NULL DEFAULT '',
+ `format(130,10)` varchar(37) NOT NULL DEFAULT '',
`left(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
`right(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
`lcase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
@@ -2513,4 +2511,12 @@ SELECT HEX(c1) from v1;
HEX(c1)
414243
DROP VIEW v1;
+create table t1(a float);
+insert into t1 values (1.33);
+select format(a, 2) from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def format(a, 2) 253 49 4 Y 0 31 8
+format(a, 2)
+1.33
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index cc0fb88b791..0fa143d95bc 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -592,6 +592,21 @@ unix_timestamp('1970-01-01 03:00:01')
select unix_timestamp('2038-01-19 07:14:07');
unix_timestamp('2038-01-19 07:14:07')
0
+SELECT CHARSET(DAYNAME(19700101));
+CHARSET(DAYNAME(19700101))
+latin1
+SELECT CHARSET(MONTHNAME(19700101));
+CHARSET(MONTHNAME(19700101))
+latin1
+SELECT LOWER(DAYNAME(19700101));
+LOWER(DAYNAME(19700101))
+thursday
+SELECT LOWER(MONTHNAME(19700101));
+LOWER(MONTHNAME(19700101))
+january
+SELECT COERCIBILITY(MONTHNAME('1970-01-01')),COERCIBILITY(DAYNAME('1970-01-01'));
+COERCIBILITY(MONTHNAME('1970-01-01')) COERCIBILITY(DAYNAME('1970-01-01'))
+4 4
CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time);
INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08");
SELECT * from t1;
@@ -1078,6 +1093,7 @@ Note 1003 select timestampdiff(WEEK,'2001-02-01','2001-05-01') AS `a1`,timestamp
select time_format('100:00:00', '%H %k %h %I %l');
time_format('100:00:00', '%H %k %h %I %l')
100 100 04 04 4
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (a timestamp default '2005-05-05 01:01:01',
b timestamp default '2005-05-05 01:01:01');
@@ -1121,6 +1137,7 @@ call t_sysdate();
@a != @b
1
drop procedure t_sysdate;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
select timestampdiff(month,'2004-09-11','2004-09-11');
timestampdiff(month,'2004-09-11','2004-09-11')
0
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index d91e21e9399..fdcde4e8739 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -685,7 +685,7 @@ asbinary(g)
drop table t1;
create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
alter table t1 disable keys;
-load data infile '../std_data_ln/bad_gis_data.dat' into table t1;
+load data infile '../../std_data/bad_gis_data.dat' into table t1;
ERROR 22004: Column set to default value; NULL supplied to NOT NULL column 'b' at row 1
alter table t1 enable keys;
drop table t1;
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 16be3eb966d..18f11ebcc71 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1,3 +1,4 @@
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
drop table if exists t1;
drop database if exists mysqltest;
@@ -1246,6 +1247,11 @@ drop user 'greg'@'localhost';
drop view v1;
drop table test;
drop function test_function;
+SELECT CURRENT_USER();
+CURRENT_USER()
+root@localhost
+SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
+SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
End of 5.0 tests
set names utf8;
grant select on test.* to юзер_юзер@localhost;
@@ -1351,4 +1357,4 @@ DROP PROCEDURE sp3;
DROP USER 'userbug33464'@'localhost';
use test;
DROP DATABASE dbbug33464;
-End of 5.1 tests
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 03c4ea042f6..7c2023127f0 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -365,22 +365,23 @@ insert into mysql.user select * from t1;
drop table t1, t2;
drop database TESTDB;
flush privileges;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
-grant all privileges on test.* to `a@`@localhost;
-grant execute on * to `a@`@localhost;
-create table t2 (s1 int);
-insert into t2 values (1);
-drop function if exists f2;
-create function f2 () returns int
-begin declare v int; select s1 from t2 into v; return v; end//
-select f2();
+GRANT ALL PRIVILEGES ON test.* TO `a@`@localhost;
+GRANT EXECUTE ON * TO `a@`@localhost;
+CREATE TABLE t2 (s1 INT);
+INSERT INTO t2 VALUES (1);
+DROP FUNCTION IF EXISTS f2;
+CREATE FUNCTION f2 () RETURNS INT
+BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END//
+SELECT f2();
f2()
1
-drop function f2;
-drop table t2;
+DROP FUNCTION f2;
+DROP TABLE t2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
-drop user `a@`@localhost;
-SET GLOBAL log_bin_trust_function_creators = 0;
+DROP USER `a@`@localhost;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database if exists mysqltest_1;
drop database if exists mysqltest_2;
drop user mysqltest_u1@localhost;
@@ -437,6 +438,7 @@ SELECT * FROM t2;
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for table 't2'
SELECT * FROM t1 JOIN t2 USING (b);
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
+USE test;
DROP TABLE db1.t1, db1.t2;
DROP USER mysqltest1@localhost;
DROP DATABASE db1;
diff --git a/mysql-test/r/greedy_optimizer.result b/mysql-test/r/greedy_optimizer.result
index 9e8c66722e3..c0012c297d1 100644
--- a/mysql-test/r/greedy_optimizer.result
+++ b/mysql-test/r/greedy_optimizer.result
@@ -655,3 +655,80 @@ show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
drop table t1,t2,t3,t4,t5,t6,t7;
+CREATE TABLE t1 (a int, b int, d int, i int);
+INSERT INTO t1 VALUES (1,1,1,1);
+CREATE TABLE t2 (b int, c int, j int);
+INSERT INTO t2 VALUES (1,1,1);
+CREATE TABLE t2_1 (j int);
+INSERT INTO t2_1 VALUES (1);
+CREATE TABLE t3 (c int, f int);
+INSERT INTO t3 VALUES (1,1);
+CREATE TABLE t3_1 (f int);
+INSERT INTO t3_1 VALUES (1);
+CREATE TABLE t4 (d int, e int, k int);
+INSERT INTO t4 VALUES (1,1,1);
+CREATE TABLE t4_1 (k int);
+INSERT INTO t4_1 VALUES (1);
+CREATE TABLE t5 (g int, d int, h int, l int);
+INSERT INTO t5 VALUES (1,1,1,1);
+CREATE TABLE t5_1 (l int);
+INSERT INTO t5_1 VALUES (1);
+SET optimizer_search_depth = 3;
+SELECT 1
+FROM t1
+LEFT JOIN (
+t2 JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+t4 JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+1
+1
+SELECT 1
+FROM t1
+LEFT JOIN (
+t2 LEFT JOIN (t3 JOIN t3_1 ON t3.f = t3_1.f) ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+t4 JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+1
+1
+SELECT 1
+FROM t1
+LEFT JOIN (
+(t2 JOIN t2_1 ON t2.j = t2_1.j) JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+t4 JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+1
+1
+SELECT 1
+FROM t1
+LEFT JOIN (
+t2 JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+(t4 JOIN t4_1 ON t4.k = t4_1.k) LEFT JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+1
+1
+SELECT 1
+FROM t1
+LEFT JOIN (
+t2 JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+t4 LEFT JOIN (t5 JOIN t5_1 ON t5.l = t5_1.l) ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+1
+1
+SET optimizer_search_depth = DEFAULT;
+DROP TABLE t1,t2,t2_1,t3,t3_1,t4,t4_1,t5,t5_1;
+End of 5.0 tests
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 12e1460e128..48f97aeb428 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1654,6 +1654,7 @@ NULL
1
2
DROP TABLE t1;
+DROP TABLE t2;
CREATE TABLE t1 ( a INT, b INT );
SELECT b c, (SELECT a FROM t1 WHERE b = c)
FROM t1;
diff --git a/mysql-test/r/have_bug25714.require b/mysql-test/r/have_bug25714.require
deleted file mode 100644
index 5acc378dcf7..00000000000
--- a/mysql-test/r/have_bug25714.require
+++ /dev/null
@@ -1,2 +0,0 @@
-have_bug25714_exe
-1
diff --git a/mysql-test/r/have_outfile.require b/mysql-test/r/have_outfile.require
index 9fc2f8fdb5a..71137a69a91 100644
--- a/mysql-test/r/have_outfile.require
+++ b/mysql-test/r/have_outfile.require
@@ -1,3 +1,3 @@
-load_file(concat(@tmpdir,"/outfile.test"))
+load_file(concat(@tmpdir,'/outfile.test'))
Outfile OK
diff --git a/mysql-test/r/have_simple_parser.require b/mysql-test/r/have_simple_parser.require
new file mode 100644
index 00000000000..0e023bd6983
--- /dev/null
+++ b/mysql-test/r/have_simple_parser.require
@@ -0,0 +1,2 @@
+have_simple_parser
+1
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index a5a96fd4958..9c3cc8fc89e 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -424,3 +424,10 @@ select f1 from t1 group by f1 having max(f1)=f1;
f1
set session sql_mode='';
drop table t1;
+CREATE TABLE t1 ( a INT, b INT);
+INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL);
+SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
+b COUNT(DISTINCT a)
+NULL 1
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index 45d335bba9e..19826aca43a 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -529,6 +529,34 @@ b a
y
z
DROP TABLE t1;
+#
+# BUG#40974: Incorrect query results when using clause evaluated using range check
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2(a int, b int);
+insert into t2 values (1,1), (2, 1000);
+create table t3 (a int, b int, filler char(100), key(a), key(b));
+insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
+insert into t3 values (1,1,'data');
+insert into t3 values (1,1,'data');
+The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
+explain select * from t1
+where exists (select 1 from t2, t3
+where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t3 ALL a,b NULL NULL NULL 1002 Range checked for each record (index map: 0x3)
+select * from t1
+where exists (select 1 from t2, t3
+where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+a
+1
+2
+drop table t0, t1, t2, t3;
End of 5.0 tests
#---------------- ROR-index_merge tests -----------------------
SET SESSION STORAGE_ENGINE = MyISAM;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 85af461eb14..f8deef15819 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -9,11 +9,13 @@ create user mysqltest_3@localhost;
create user mysqltest_3;
select * from information_schema.SCHEMATA where schema_name > 'm';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
+NULL mtr latin1 latin1_swedish_ci NULL
NULL mysql latin1 latin1_swedish_ci NULL
NULL test latin1 latin1_swedish_ci NULL
select schema_name from information_schema.schemata;
schema_name
information_schema
+mtr
mysql
test
show databases like 't%';
@@ -22,6 +24,7 @@ test
show databases;
Database
information_schema
+mtr
mysql
test
show databases where `database` = 't%';
@@ -33,7 +36,11 @@ create table t3(a int, KEY a_data (a));
create table mysqltest.t4(a int);
create table t5 (id int auto_increment primary key);
insert into t5 values (10);
-create view v1 (c) as select table_name from information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status';
+create view v1 (c) as
+SELECT table_name FROM information_schema.TABLES
+WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND
+table_name<>'ndb_binlog_index' AND
+table_name<>'ndb_apply_status';
select * from v1;
c
CHARACTER_SETS
@@ -269,19 +276,19 @@ select * from t1;
select * from t2;
end|
select parameter_style, sql_data_access, dtd_identifier
-from information_schema.routines;
+from information_schema.routines where routine_schema='test';
parameter_style sql_data_access dtd_identifier
SQL CONTAINS SQL NULL
SQL CONTAINS SQL int(11)
-show procedure status;
+show procedure status where db='test';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test sel2 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-show function status;
+show function status where db='test';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test sub1 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
select a.ROUTINE_NAME from information_schema.ROUTINES a,
information_schema.SCHEMATA b where
-a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
+a.ROUTINE_SCHEMA = b.SCHEMA_NAME AND b.SCHEMA_NAME='test';
ROUTINE_NAME
sel2
sub1
@@ -292,14 +299,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE # ALL NULL NULL NULL NULL NULL
1 SIMPLE # ALL NULL NULL NULL NULL NULL Using where; Using join buffer
select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
-mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) order by 1;
+mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) AND a.ROUTINE_SCHEMA='test' order by 1;
ROUTINE_NAME name
sel2 sel2
sub1 sub1
-select count(*) from information_schema.ROUTINES;
+select count(*) from information_schema.ROUTINES where routine_schema='test';
count(*)
2
-create view v1 as select routine_schema, routine_name from information_schema.routines
+create view v1 as select routine_schema, routine_name from information_schema.routines where routine_schema='test'
order by routine_schema, routine_name;
select * from v1;
routine_schema routine_name
@@ -351,6 +358,7 @@ create view v0 (c) as select schema_name from information_schema.schemata;
select * from v0;
c
information_schema
+mtr
mysql
test
explain select * from v0;
@@ -842,7 +850,7 @@ VIEWS TABLE_NAME select
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
flush privileges;
-SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
+SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
table_schema count(*)
information_schema 28
mysql 22
@@ -882,7 +890,7 @@ if new.j = -1 then
set @fired:= "Yes";
end if;
end AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-select * from information_schema.triggers;
+select * from information_schema.triggers where trigger_schema in ('mysql', 'information_schema', 'test', 'mysqltest');
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
NULL test trg1 INSERT NULL test t1 0 NULL begin
if new.j > 10 then
@@ -1071,7 +1079,7 @@ BEGIN
SELECT 'foo' FROM DUAL;
END |
ERROR 42000: Unknown database 'information_schema'
-select ROUTINE_NAME from routines;
+select ROUTINE_NAME from routines where ROUTINE_SCHEMA='information_schema';
ROUTINE_NAME
grant all on information_schema.* to 'user1'@'localhost';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -1153,7 +1161,7 @@ use mysql;
INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL',
'NO','DEFINER','','','BEGIN\r\n \r\nEND','root@%','2006-03-02 18:40:03',
'2006-03-02 18:40:03','','','utf8','utf8_general_ci','utf8_general_ci','n/a');
-select routine_name from information_schema.routines;
+select routine_name from information_schema.routines where ROUTINE_SCHEMA='test';
routine_name
delete from proc where name='';
@@ -1187,7 +1195,7 @@ CREATE FUNCTION f1() RETURNS INT RETURN @a + 1;
CREATE USER mysql_bug20230@localhost;
GRANT EXECUTE ON PROCEDURE p1 TO mysql_bug20230@localhost;
GRANT EXECUTE ON FUNCTION f1 TO mysql_bug20230@localhost;
-SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES;
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test';
ROUTINE_NAME ROUTINE_DEFINITION
f1 RETURN @a + 1
p1 SET @a= 1
@@ -1199,7 +1207,7 @@ SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN @a + 1 latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES;
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test';
ROUTINE_NAME ROUTINE_DEFINITION
f1 NULL
p1 NULL
@@ -1302,12 +1310,12 @@ TABLE_PRIVILEGES TABLE_SCHEMA
TRIGGERS TRIGGER_SCHEMA
USER_PRIVILEGES GRANTEE
VIEWS TABLE_SCHEMA
-SELECT MAX(table_name) FROM information_schema.tables;
+SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
MAX(table_name)
VIEWS
SELECT table_name from information_schema.tables
WHERE table_name=(SELECT MAX(table_name)
-FROM information_schema.tables);
+FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test'));
table_name
VIEWS
DROP TABLE IF EXISTS bug23037;
@@ -1707,4 +1715,9 @@ where a.VARIABLE_NAME = b.VARIABLE_NAME;
a.VARIABLE_VALUE - b.VARIABLE_VALUE
2
drop table t0;
+CREATE TABLE t1(a INT) KEY_BLOCK_SIZE=1;
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+CREATE_OPTIONS
+KEY_BLOCK_SIZE=1
+DROP TABLE t1;
End of 5.1 tests.
diff --git a/mysql-test/r/init_file.result b/mysql-test/r/init_file.result
index 6394014f3e5..8e014815a9c 100644
--- a/mysql-test/r/init_file.result
+++ b/mysql-test/r/init_file.result
@@ -4,7 +4,6 @@ SELECT * INTO @Y FROM init_file.startup limit 1,1;
SELECT YEAR(@X)-YEAR(@Y);
YEAR(@X)-YEAR(@Y)
0
-DROP DATABASE init_file;
ok
end of 4.1 tests
select * from t1;
@@ -20,4 +19,3 @@ y
3
11
13
-drop table t1, t2;
diff --git a/mysql-test/r/innodb-autoinc-optimize.result b/mysql-test/r/innodb-autoinc-optimize.result
index 2896411a42f..c6da43555b2 100644
--- a/mysql-test/r/innodb-autoinc-optimize.result
+++ b/mysql-test/r/innodb-autoinc-optimize.result
@@ -5,3 +5,5 @@ optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
+==== clean up ====
+DROP TABLE t1;
diff --git a/mysql-test/r/innodb-autoinc.result b/mysql-test/r/innodb-autoinc.result
index e000f910772..1e4b088c6cd 100644
--- a/mysql-test/r/innodb-autoinc.result
+++ b/mysql-test/r/innodb-autoinc.result
@@ -169,3 +169,413 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL, 1);
+DELETE FROM t1 WHERE c1 = 1;
+INSERT INTO t1 VALUES (2,1);
+INSERT INTO t1 VALUES (NULL,8);
+SELECT * FROM t1;
+c1 c2
+2 1
+3 8
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL, 1);
+DELETE FROM t1 WHERE c1 = 1;
+INSERT INTO t1 VALUES (2,1), (NULL, 8);
+INSERT INTO t1 VALUES (NULL,9);
+SELECT * FROM t1;
+c1 c2
+2 1
+3 8
+5 9
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 100
+auto_increment_offset 10
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(5),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+c1
+5
+10
+110
+250
+310
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+c1
+5
+10
+110
+250
+310
+400
+410
+1000
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(0);
+SELECT * FROM t1;
+c1
+1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+c1
+-1
+1
+2
+10
+110
+250
+410
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+Got one of the listed errors
+SELECT * FROM t1;
+c1
+-1
+1
+2
+10
+110
+250
+410
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+SELECT * FROM t1;
+c1
+-1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 100
+auto_increment_offset 10
+INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+c1
+-2
+-1
+1
+2
+10
+250
+310
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+c1
+-2
+-1
+1
+2
+10
+250
+310
+400
+410
+1000
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+SELECT * FROM t1;
+c1
+1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 100
+auto_increment_offset 10
+INSERT INTO t1 VALUES (-2);
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (250);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+c1
+1
+2
+10
+110
+210
+250
+310
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+c1
+1
+2
+10
+110
+210
+250
+310
+400
+1000
+1010
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+SELECT * FROM t1;
+c1
+1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 100
+auto_increment_offset 10
+INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+c1
+1
+2
+10
+110
+210
+250
+410
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+Got one of the listed errors
+SELECT * FROM t1;
+c1
+1
+2
+10
+110
+210
+250
+410
+1000
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (9223372036854775794);
+SELECT * FROM t1;
+c1
+1
+9223372036854775794
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 2
+auto_increment_offset 10
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+SELECT * FROM t1;
+c1
+1
+9223372036854775794
+9223372036854775796
+9223372036854775798
+9223372036854775800
+9223372036854775802
+9223372036854775804
+9223372036854775806
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551603);
+SELECT * FROM t1;
+c1
+1
+18446744073709551603
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 2
+auto_increment_offset 10
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+SELECT * FROM t1;
+c1
+1
+18446744073709551603
+18446744073709551604
+18446744073709551606
+18446744073709551608
+18446744073709551610
+18446744073709551612
+18446744073709551614
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551603);
+SELECT * FROM t1;
+c1
+1
+18446744073709551603
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 5
+auto_increment_offset 7
+INSERT INTO t1 VALUES (NULL),(NULL);
+SELECT * FROM t1;
+c1
+1
+18446744073709551603
+18446744073709551607
+18446744073709551612
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES(-9223372036854775806);
+INSERT INTO t1 VALUES(-9223372036854775807);
+INSERT INTO t1 VALUES(-9223372036854775808);
+SELECT * FROM t1;
+c1
+-9223372036854775808
+-9223372036854775807
+-9223372036854775806
+1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 3
+auto_increment_offset 3
+INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
+SELECT * FROM t1;
+c1
+-9223372036854775808
+-9223372036854775807
+-9223372036854775806
+1
+3
+6
+9
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551610);
+SELECT * FROM t1;
+c1
+1
+18446744073709551610
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
+Warnings:
+Warning 1292 Truncated incorrect auto_increment_increment value: '1152921504606846976'
+Warning 1292 Truncated incorrect auto_increment_offset value: '1152921504606846976'
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 65535
+auto_increment_offset 65535
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+c1
+1
+18446744073709551610
+18446744073709551615
+DROP TABLE t1;
diff --git a/mysql-test/r/innodb-semi-consistent.result b/mysql-test/r/innodb-semi-consistent.result
index 6173048c320..55e3cb5c7b4 100644
--- a/mysql-test/r/innodb-semi-consistent.result
+++ b/mysql-test/r/innodb-semi-consistent.result
@@ -1,6 +1,6 @@
drop table if exists t1;
set binlog_format=mixed;
-set session transaction isolation level read committed;
+set session transaction isolation level repeatable read;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
set autocommit=0;
@@ -8,11 +8,12 @@ select * from t1 where a=3 lock in share mode;
a
3
set binlog_format=mixed;
-set session transaction isolation level read committed;
+set session transaction isolation level repeatable read;
set autocommit=0;
update t1 set a=10 where a=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
+set session transaction isolation level read committed;
update t1 set a=10 where a=5;
select * from t1 where a=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 508bc00a6be..56c8fe2fda8 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1781,6 +1781,7 @@ set global innodb_sync_spin_loops=20;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 20
+SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 0
@@ -1798,6 +1799,7 @@ set global innodb_thread_concurrency=16;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 16
+SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 500
@@ -3295,3 +3297,11 @@ info: Records: 5 Duplicates: 0 Warnings: 0
TRUNCATE TABLE t1;
affected rows: 0
DROP TABLE t1;
+Variable_name Value
+Handler_update 0
+Variable_name Value
+Handler_delete 0
+Variable_name Value
+Handler_update 1
+Variable_name Value
+Handler_delete 1
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result b/mysql-test/r/innodb_bug30919.result
index 42aa4ff302b..42aa4ff302b 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result
+++ b/mysql-test/r/innodb_bug30919.result
diff --git a/mysql-test/r/innodb_bug34300.result b/mysql-test/r/innodb_bug34300.result
index ae9fee81ad7..03ae355de7b 100644
--- a/mysql-test/r/innodb_bug34300.result
+++ b/mysql-test/r/innodb_bug34300.result
@@ -1,4 +1,9 @@
+SELECT f4, f8 FROM bug34300;
f4 f8
xxx zzz
+ALTER TABLE bug34300 ADD COLUMN (f10 INT);
+SELECT f4, f8 FROM bug34300;
f4 f8
xxx zzz
+DROP TABLE bug34300;
+SET @@global.max_allowed_packet=default;
diff --git a/mysql-test/r/innodb_bug38231.result b/mysql-test/r/innodb_bug38231.result
new file mode 100644
index 00000000000..2f909779755
--- /dev/null
+++ b/mysql-test/r/innodb_bug38231.result
@@ -0,0 +1,11 @@
+SET storage_engine=InnoDB;
+INSERT INTO bug38231 VALUES (1), (10), (300);
+SET autocommit=0;
+SELECT * FROM bug38231 FOR UPDATE;
+a
+1
+10
+300
+TRUNCATE TABLE bug38231;
+COMMIT;
+DROP TABLE bug38231;
diff --git a/mysql-test/r/innodb_bug39438.result b/mysql-test/r/innodb_bug39438.result
new file mode 100644
index 00000000000..195775f74c8
--- /dev/null
+++ b/mysql-test/r/innodb_bug39438.result
@@ -0,0 +1 @@
+SET storage_engine=InnoDB;
diff --git a/mysql-test/r/innodb_ignore_builtin.result b/mysql-test/r/innodb_ignore_builtin.result
new file mode 100644
index 00000000000..4694a61b20a
--- /dev/null
+++ b/mysql-test/r/innodb_ignore_builtin.result
@@ -0,0 +1,9 @@
+show variables like 'ignore_builtin_innodb';
+Variable_name Value
+ignore_builtin_innodb ON
+select PLUGIN_NAME from information_schema.plugins
+where PLUGIN_NAME = "InnoDb";
+PLUGIN_NAME
+select ENGINE from information_schema.engines
+where ENGINE = "InnoDB";
+ENGINE
diff --git a/mysql-test/r/innodb_max_dirty_pages_pct_func.result b/mysql-test/r/innodb_max_dirty_pages_pct_func.result
deleted file mode 100644
index 4f6d42fb716..00000000000
--- a/mysql-test/r/innodb_max_dirty_pages_pct_func.result
+++ /dev/null
@@ -1,30 +0,0 @@
-'#--------------------FN_DYNVARS_044_02-------------------------#'
-SET @@global.innodb_max_dirty_pages_pct = 80;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
-SELECT @@global.innodb_max_dirty_pages_pct;
-@@global.innodb_max_dirty_pages_pct
-80
-SET @@global.innodb_max_dirty_pages_pct = 70;
-'connect (con2,localhost,root,,,,)'
-'connection con2'
-SELECT @@global.innodb_max_dirty_pages_pct;
-@@global.innodb_max_dirty_pages_pct
-70
-'#--------------------FN_DYNVARS_044_02-------------------------#'
-'connection default'
-'---Check when innodb_max_dirty_pages_pct is 10---'
-SET @@global.innodb_max_dirty_pages_pct = 10;
-FLUSH STATUS;
-CALL add_until(10);
-FLUSH TABLES;
-CALL add_records(500);
-'--sleep 5'
-'We expect dirty pages pct to be BELOW_MAX'
-CALL check_pct(10);
-PCT_VALUE
-BELOW_MAX
-DROP PROCEDURE add_records;
-DROP PROCEDURE add_until;
-DROP PROCEDURE check_pct;
-DROP FUNCTION dirty_pct;
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index aeacd054511..6fcc9415d12 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1683,3 +1683,167 @@ CREATE INDEX i1 on t1 (a(3));
SELECT * FROM t1 WHERE a = 'abcde';
a
DROP TABLE t1;
+CREATE TABLE foo (a int, b int, c char(10),
+PRIMARY KEY (c(3)),
+KEY b (b)
+) engine=innodb;
+CREATE TABLE foo2 (a int, b int, c char(10),
+PRIMARY KEY (c),
+KEY b (b)
+) engine=innodb;
+CREATE TABLE bar (a int, b int, c char(10),
+PRIMARY KEY (c(3)),
+KEY b (b)
+) engine=myisam;
+INSERT INTO foo VALUES
+(1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'),
+(4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe');
+INSERT INTO bar SELECT * FROM foo;
+INSERT INTO foo2 SELECT * FROM foo;
+EXPLAIN SELECT c FROM bar WHERE b>2;;
+id 1
+select_type SIMPLE
+table bar
+type ALL
+possible_keys b
+key NULL
+key_len NULL
+ref NULL
+rows 6
+Extra Using where
+EXPLAIN SELECT c FROM foo WHERE b>2;;
+id 1
+select_type SIMPLE
+table foo
+type ALL
+possible_keys b
+key NULL
+key_len NULL
+ref NULL
+rows 6
+Extra Using where
+EXPLAIN SELECT c FROM foo2 WHERE b>2;;
+id 1
+select_type SIMPLE
+table foo2
+type range
+possible_keys b
+key b
+key_len 5
+ref NULL
+rows 3
+Extra Using where; Using index
+EXPLAIN SELECT c FROM bar WHERE c>2;;
+id 1
+select_type SIMPLE
+table bar
+type ALL
+possible_keys PRIMARY
+key NULL
+key_len NULL
+ref NULL
+rows 6
+Extra Using where
+EXPLAIN SELECT c FROM foo WHERE c>2;;
+id 1
+select_type SIMPLE
+table foo
+type ALL
+possible_keys PRIMARY
+key NULL
+key_len NULL
+ref NULL
+rows 6
+Extra Using where
+EXPLAIN SELECT c FROM foo2 WHERE c>2;;
+id 1
+select_type SIMPLE
+table foo2
+type index
+possible_keys PRIMARY
+key b
+key_len 5
+ref NULL
+rows 6
+Extra Using where; Using index
+DROP TABLE foo, bar, foo2;
+DROP TABLE IF EXISTS t1,t3,t2;
+DROP FUNCTION IF EXISTS f1;
+CREATE FUNCTION f1() RETURNS VARCHAR(250)
+BEGIN
+return 'hhhhhhh' ;
+END|
+CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20), c VARCHAR(20)) ENGINE=INNODB;
+BEGIN WORK;
+CREATE TEMPORARY TABLE t2 (a VARCHAR(20), b VARCHAR(20), c varchar(20)) ENGINE=INNODB;
+CREATE TEMPORARY TABLE t3 LIKE t2;
+INSERT INTO t1 VALUES ('a','b',NULL),('c','d',NULL),('e','f',NULL);
+SET @stmt := CONCAT('INSERT INTO t2 SELECT tbl.a, tbl.b, f1()',' FROM t1 tbl');
+PREPARE stmt1 FROM @stmt;
+SET @stmt := CONCAT('INSERT INTO t3', ' SELECT * FROM t2');
+PREPARE stmt3 FROM @stmt;
+EXECUTE stmt1;
+COMMIT;
+DEALLOCATE PREPARE stmt1;
+DEALLOCATE PREPARE stmt3;
+DROP TABLE t1,t3,t2;
+DROP FUNCTION f1;
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY,
+t1_id INT, INDEX par_ind (t1_id),
+FOREIGN KEY (t1_id) REFERENCES t1(id)) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (3,2);
+SET AUTOCOMMIT = 0;
+START TRANSACTION;
+TRUNCATE TABLE t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
+SELECT * FROM t1;
+id
+1
+2
+COMMIT;
+SELECT * FROM t1;
+id
+1
+2
+START TRANSACTION;
+TRUNCATE TABLE t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
+SELECT * FROM t1;
+id
+1
+2
+ROLLBACK;
+SELECT * FROM t1;
+id
+1
+2
+SET AUTOCOMMIT = 1;
+START TRANSACTION;
+SELECT * FROM t1;
+id
+1
+2
+COMMIT;
+TRUNCATE TABLE t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
+SELECT * FROM t1;
+id
+1
+2
+DELETE FROM t2 WHERE id = 3;
+START TRANSACTION;
+SELECT * FROM t1;
+id
+1
+2
+TRUNCATE TABLE t1;
+ROLLBACK;
+SELECT * FROM t1;
+id
+TRUNCATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/innodb_mysql_rbk.result b/mysql-test/r/innodb_mysql_rbk.result
new file mode 100644
index 00000000000..21ac4295325
--- /dev/null
+++ b/mysql-test/r/innodb_mysql_rbk.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1(a INT, b INT NOT NULL, PRIMARY KEY (a)) ENGINE=innodb
+DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
+a b
+3 3
+START TRANSACTION;
+UPDATE t1 SET b=b+12 WHERE a > 2 ORDER BY a;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ROLLBACK;
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
+a b
+3 3
+START TRANSACTION;
+UPDATE t1 SET b=10 WHERE a > 1 ORDER BY a;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1 WHERE b = 10;
+a b
+DROP TABLE t1;
diff --git a/mysql-test/r/innodb_notembedded.result b/mysql-test/r/innodb_notembedded.result
index 36714eb62fb..af332aba38a 100644
--- a/mysql-test/r/innodb_notembedded.result
+++ b/mysql-test/r/innodb_notembedded.result
@@ -1,4 +1,5 @@
drop table if exists t1;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
insert t1 values (1,100);
@@ -19,4 +20,4 @@ rollback;
rollback;
drop table t1;
drop function f1;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index 704cf444681..a285810b78b 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -393,6 +393,7 @@ id c1 cnt
1 0 3
2 2 1
DROP TABLE t1;
+DROP TABLE t2;
create table t1(f1 int primary key,
f2 timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP);
insert into t1(f1) values(1);
diff --git a/mysql-test/r/key_buffer_size_func.result b/mysql-test/r/key_buffer_size_func.result
deleted file mode 100644
index e2eff04f030..00000000000
--- a/mysql-test/r/key_buffer_size_func.result
+++ /dev/null
@@ -1,36 +0,0 @@
-drop table if exists t1;
-## Creating new table t1 ##
-CREATE TABLE t1
-(
-id INT NOT NULL auto_increment,
-PRIMARY KEY (id),
-rollno int NOT NULL,
-name VARCHAR(30)
-);
-FLUSH STATUS;
-'#--------------------FN_DYNVARS_055_01-------------------------#'
-## Setting initial value of variable to 131072 ##
-SET @@global.key_buffer_size = 131072;
-## Creating two new connections ##
-'#--------------------FN_DYNVARS_055_02-------------------------#'
-## Connecting with connection test_con1 ##
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-131072
-## Inserting some rows in table ##
-INSERT into t1(rollno, name) values(1, 'Record_1');
-INSERT into t1(rollno, name) values(2, 'Record_2');
-INSERT into t1(rollno, name) values(1, 'Record_3');
-INSERT into t1(rollno, name) values(3, 'Record_4');
-INSERT into t1(rollno, name) values(1, 'Record_5');
-INSERT into t1(rollno, name) values(3, 'Record_6');
-INSERT into t1(rollno, name) values(4, 'Record_7');
-INSERT into t1(rollno, name) values(4, 'Record_8');
-INSERT into t1(rollno, name) values(4, 'Record_9');
-INSERT into t1(rollno, name) values(4, 'Record_10');
-## Verifying status of reading & writing variables ##
-## Switching to connection test_con2 ##
-## Verifying status of reading & writing variables ##
-## Dropping table ##
-DROP table if exists t1;
-## Disconnecting both the connections ##
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 4e458e831cf..1e488b320d7 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -1,6 +1,6 @@
drop table if exists t1, t2;
create table t1 (a date, b date, c date not null, d date);
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'c' at row 1
@@ -8,7 +8,7 @@ Warning 1265 Data truncated for column 'd' at row 1
Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 2
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
SELECT * from t1;
a b c d
0000-00-00 NULL 0000-00-00 0000-00-00
@@ -16,7 +16,7 @@ a b c d
2003-03-03 2003-03-03 2003-03-03 NULL
2003-03-03 2003-03-03 2003-03-03 NULL
truncate table t1;
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'd' at row 1
@@ -29,7 +29,7 @@ NULL 0000-00-00 0000-00-00 0000-00-00
NULL 2003-03-03 2003-03-03 NULL
drop table t1;
create table t1 (a text, b text);
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
Warnings:
Warning 1261 Row 3 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from t1;
@@ -41,7 +41,7 @@ Field 3,'Field 4|
|Field 6| | 'Field 7'|
drop table t1;
create table t1 (a int, b char(10));
-load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
@@ -55,7 +55,7 @@ a b
3 row 3
0 1234567890
truncate table t1;
-load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: '
' for column 'a' at row 4
@@ -79,7 +79,7 @@ id
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1;
create table t1 (a varchar(20), b varchar(20));
-load data infile '../std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
+load data infile '../../std_data/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
select * from t1;
a b
field1 field2
@@ -141,25 +141,25 @@ SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
id c1 c2
DROP TABLE t1,t2;
create table t1 (a int default 100, b int, c varchar(60));
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1;
a b c
NULL 20 b=10
NULL 25 b=15
truncate table t1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
select * from t1;
a b c
NULL NULL oops
NULL NULL oops
truncate table t1;
set @c:=123;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
select * from t1;
a b c
100 10 123
100 15 123
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, @b);
select * from t1;
a b c
100 10 123
@@ -170,7 +170,7 @@ select @a, @b;
@a @b
NULL 15
truncate table t1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 set c=b;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 set c=b;
Warnings:
Warning 1261 Row 1 doesn't contain data for all columns
Warning 1261 Row 2 doesn't contain data for all columns
@@ -179,25 +179,25 @@ a b c
NULL 10 10
NULL 15 15
truncate table t1;
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
select * from t1;
a b c
1 2 Wow
3 4 Wow
5 6 Wow
truncate table t1;
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
select * from t1;
a b c
1 2 1+2+123+2+NIL
3 4 3+4+123+4+NIL
5 6 5+6+123+6+NIL
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
ERROR HY000: Can't load value from file with fixed size rows to variable
create table t2 (num int primary key, str varchar(10));
insert into t2 values (10,'Ten'), (15,'Fifteen');
truncate table t1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
select * from t1;
a b c
10 NULL Ten
@@ -212,7 +212,7 @@ set @@secure_file_priv= 0;
ERROR HY000: Variable 'secure_file_priv' is a read only variable
truncate table t1;
load data infile 'MYSQL_TEST_DIR/t/loaddata.test' into table t1;
-ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+Got one of the listed errors
select * from t1;
a b c
select load_file("MYSQL_TEST_DIR/t/loaddata.test");
@@ -277,7 +277,7 @@ CREATE VIEW v1 AS SELECT * FROM t1;
CREATE VIEW v2 AS SELECT 1 + 2 AS c0, c1, c2 FROM t1;
CREATE VIEW v3 AS SELECT 1 AS d1, 2 AS d2;
-LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v1
+LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v1
FIELDS ESCAPED BY '\\'
TERMINATED BY ','
ENCLOSED BY '"'
@@ -297,7 +297,7 @@ c1 c2
DELETE FROM t1;
-LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2
+LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v2
FIELDS ESCAPED BY '\\'
TERMINATED BY ','
ENCLOSED BY '"'
@@ -317,14 +317,14 @@ c0 c1 c2
DELETE FROM t1;
-LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2
+LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v2
FIELDS ESCAPED BY '\\'
TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n' (c0, c2);
ERROR HY000: Invalid column reference (v2.c0) in LOAD DATA
-LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v3
+LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v3
FIELDS ESCAPED BY '\\'
TERMINATED BY ','
ENCLOSED BY '"'
diff --git a/mysql-test/r/loaddata_autocom_innodb.result b/mysql-test/r/loaddata_autocom_innodb.result
index 11a07cdb783..c1e6b7f2fba 100644
--- a/mysql-test/r/loaddata_autocom_innodb.result
+++ b/mysql-test/r/loaddata_autocom_innodb.result
@@ -2,7 +2,7 @@ SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1;
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
start transaction;
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
+load data infile 'LOAD_FILE' into table t1 fields terminated by ',' enclosed by '''' (a, b);
Warnings:
Warning 1261 Row 3 doesn't contain data for all columns
commit;
@@ -11,7 +11,7 @@ count(*)
4
truncate table t1;
start transaction;
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
+load data infile 'LOAD_FILE' into table t1 fields terminated by ',' enclosed by '''' (a, b);
Warnings:
Warning 1261 Row 3 doesn't contain data for all columns
rollback;
diff --git a/mysql-test/r/lock_tables_lost_commit.result b/mysql-test/r/lock_tables_lost_commit.result
index 22885d93d40..df4b6eff5cf 100644
--- a/mysql-test/r/lock_tables_lost_commit.result
+++ b/mysql-test/r/lock_tables_lost_commit.result
@@ -1,8 +1,8 @@
-drop table if exists t1;
-create table t1(a int) engine=innodb;
-lock tables t1 write;
-insert into t1 values(10);
-select * from t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT) ENGINE=innodb;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 VALUES(10);
+SELECT * FROM t1;
a
10
-drop table t1;
+DROP TABLE t1;
diff --git a/mysql-test/r/log_queries_not_using_indexes_basic.result b/mysql-test/r/log_queries_not_using_indexes_basic.result
deleted file mode 100644
index d05437e3f66..00000000000
--- a/mysql-test/r/log_queries_not_using_indexes_basic.result
+++ /dev/null
@@ -1,53 +0,0 @@
-'#---------------------BS_STVARS_041_01----------------------#'
-SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
-COUNT(@@GLOBAL.log_queries_not_using_indexes)
-1
-1 Expected
-'#---------------------BS_STVARS_041_02----------------------#'
-SET @@GLOBAL.log_queries_not_using_indexes=1;
-Expected error 'Read only variable'
-"BUG:It should give error on setting this variable as it is readonly variable"
-SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
-COUNT(@@GLOBAL.log_queries_not_using_indexes)
-1
-1 Expected
-'#---------------------BS_STVARS_041_03----------------------#'
-SELECT @@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='log_queries_not_using_indexes';
-@@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE
-0
-1 Expected
-SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
-COUNT(@@GLOBAL.log_queries_not_using_indexes)
-1
-1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='log_queries_not_using_indexes';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-'#---------------------BS_STVARS_041_04----------------------#'
-SELECT @@log_queries_not_using_indexes = @@GLOBAL.log_queries_not_using_indexes;
-@@log_queries_not_using_indexes = @@GLOBAL.log_queries_not_using_indexes
-1
-1 Expected
-'#---------------------BS_STVARS_041_05----------------------#'
-SELECT COUNT(@@log_queries_not_using_indexes);
-COUNT(@@log_queries_not_using_indexes)
-1
-1 Expected
-SELECT COUNT(@@local.log_queries_not_using_indexes);
-ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@SESSION.log_queries_not_using_indexes);
-ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
-COUNT(@@GLOBAL.log_queries_not_using_indexes)
-1
-1 Expected
-SELECT log_queries_not_using_indexes = @@SESSION.log_queries_not_using_indexes;
-ERROR 42S22: Unknown column 'log_queries_not_using_indexes' in 'field list'
-Expected error 'Readonly variable'
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index 63903a034d2..5c3e3d789a1 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -1,3 +1,7 @@
+SET @old_general_log= @@global.general_log;
+SET @old_general_log_file= @@global.general_log_file;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_slow_query_log_file= @@global.slow_query_log_file;
set global general_log= OFF;
truncate table mysql.general_log;
truncate table mysql.slow_log;
@@ -33,20 +37,26 @@ general_log ON
log ON
log_slow_queries OFF
slow_query_log OFF
-set session long_query_time=1;
-select sleep(2);
-sleep(2)
+# Establish connection con1 (user=root)
+# Switch to connection con1
+set @long_query_time = <long_query_time>;
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
+sleep(@long_query_time + 1)
0
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
+# Switch to connection default
set global slow_query_log= ON;
-set session long_query_time=1;
-select sleep(2);
-sleep(2)
+# Switch to connection con1
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
+sleep(@long_query_time + 1)
0
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
-TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(2)
+TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(@long_query_time + 1)
+# Switch to connection default
show global variables
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
@@ -92,8 +102,8 @@ slow_query_log_file #
show variables like 'log_output';
Variable_name Value
log_output FILE,TABLE
-set global general_log_file='/not exiting path/log.master';
-ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
+set global general_log_file='/not existing path/log.master';
+ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not existing path/log.master'
set global general_log_file='MYSQLTEST_VARDIR';
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR'
set global general_log_file='';
@@ -153,8 +163,10 @@ select * from mysql.general_log;
event_time user_host thread_id server_id command_type argument
TIMESTAMP USER_HOST # 1 Query drop table t1
TIMESTAMP USER_HOST # 1 Query select * from mysql.general_log
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
+SET @@global.general_log = @old_general_log;
+SET @@global.general_log_file = @old_general_log_file;
+SET @@global.slow_query_log = @old_slow_query_log;
+SET @@global.slow_query_log_file = @old_slow_query_log_file;
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
FLUSH TABLES WITH READ LOCK;
@@ -173,10 +185,9 @@ SET GLOBAL READ_ONLY = ON;
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
SET GLOBAL READ_ONLY = OFF;
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+SET GLOBAL general_log = ON;
SHOW VARIABLES LIKE 'general_log';
Variable_name Value
general_log ON
@@ -239,29 +250,24 @@ log_slow_queries ON
SELECT @@slow_query_log, @@log_slow_queries;
@@slow_query_log @@log_slow_queries
1 1
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
-set @old_general_log_file= @@global.general_log_file;
-set @old_slow_query_log_file= @@global.slow_query_log_file;
-set global general_log_file= concat('/not exiting path/log.maste', 'r');
-ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
-set global general_log_file= NULL;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+SET GLOBAL general_log_file= CONCAT('/not existing path/log.maste', 'r');
+ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not existing path/log.master'
+SET GLOBAL general_log_file= NULL;
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'NULL'
-set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
-ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not exiting path/log.master'
-set global slow_query_log_file= NULL;
+SET GLOBAL slow_query_log_file= CONCAT('/not existing path/log.maste', 'r');
+ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not existing path/log.master'
+SET GLOBAL slow_query_log_file= NULL;
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'NULL'
-set global general_log_file= @old_general_log_file;
-set global slow_query_log_file= @old_slow_query_log_file;
+SET GLOBAL general_log_file= @old_general_log_file;
+SET GLOBAL slow_query_log_file= @old_slow_query_log_file;
# --
# -- Bug#32748: Inconsistent handling of assignments to
-# -- general_log_file/slow_query_log_file.
+# -- general_log_file/slow_query_log_file.
# --
-SET @general_log_file_saved = @@global.general_log_file;
-SET @slow_query_log_file_saved = @@global.slow_query_log_file;
-
SET GLOBAL general_log_file = 'bug32748.query.log';
SET GLOBAL slow_query_log_file = 'bug32748.slow.log';
@@ -270,8 +276,8 @@ Variable_name Value
general_log_file bug32748.query.log
slow_query_log_file bug32748.slow.log
-SET GLOBAL general_log_file = @general_log_file_saved;
-SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
+SET GLOBAL general_log_file = @old_general_log_file;
+SET GLOBAL slow_query_log_file = @old_slow_query_log_file;
# -- End of Bug#32748.
deprecated:
@@ -298,4 +304,13 @@ SET GLOBAL general_log_file = @my_glf;
SET GLOBAL slow_query_log_file = @my_sqlf;
SET GLOBAL general_log = DEFAULT;
SET GLOBAL slow_query_log = DEFAULT;
+SET @@global.general_log = @old_general_log;
+SET @@global.general_log_file = @old_general_log_file;
+SET @@global.slow_query_log = @old_slow_query_log;
+SET @@global.slow_query_log_file = @old_slow_query_log_file;
End of 5.1 tests
+# Close connection con1
+SET global general_log = @old_general_log;
+SET global general_log_file = @old_general_log_file;
+SET global slow_query_log = @old_slow_query_log;
+SET global slow_query_log_file = @old_slow_query_log_file;
diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result
index 2f294314b04..376120abcda 100644
--- a/mysql-test/r/log_tables.result
+++ b/mysql-test/r/log_tables.result
@@ -1,3 +1,8 @@
+SET @old_general_log_state = @@global.general_log;
+SET @old_log_output= @@global.log_output;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_general_log= @@global.general_log;
+SET @old_long_query_time= @@session.long_query_time;
use mysql;
SET @saved_long_query_time = @@long_query_time;
SET @saved_log_output = @@log_output;
@@ -432,7 +437,8 @@ SET SESSION long_query_time =@saved_long_query_time;
FLUSH LOGS;
ALTER TABLE mysql.slow_log DROP COLUMN seq;
ALTER TABLE mysql.slow_log ENGINE = CSV;
-SET GLOBAL slow_query_log = @saved_slow_query_log;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
drop procedure if exists proc25422_truncate_slow;
drop procedure if exists proc25422_truncate_general;
drop procedure if exists proc25422_alter_slow;
@@ -623,8 +629,8 @@ DROP TABLE `db_17876.general_log_data`;
DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
DROP DATABASE IF EXISTS `db_17876`;
-SET GLOBAL general_log = @saved_general_log;
-SET GLOBAL slow_query_log = @saved_slow_query_log;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
select CONNECTION_ID() into @thread_id;
truncate table mysql.general_log;
set global general_log = on;
@@ -840,7 +846,7 @@ Query execute long_query using @lparam
Execute select '000 001 002 003 004 005 006 007 008 009010 011 012 013 014 015 016 017 018 019020 021 022 023 024 025 026 027 028 029030 031 032 033 034 035 036 037 038 039040 041 042 043 044 045 046 047 048 049050 051 052 053 054 055 056 057 058 059060 061 062 063 064 065 066 067 068 069070 071 072 073 074 075 076 077 078 079080 081 082 083 084 085 086 087 088 089090 091 092 093 094 095 096 097 098 099100 101 102 103 104 105 106 107 108 109110 111 112 113 114 115 116 117 118 119120 121 122 123 124 125 126 127 128 129130 131 132 133 134 135 136 137 138 139140 141 142 143 144 145 146 147 148 149150 151 152 153 154 155 156 157 158 159160 161 162 163 164 165 166 167 168 169170 171 172 173 174 175 176 177 178 179180 181 182 183 184 185 186 187 188 189190 191 192 193 194 195 196 197 198 199200 201 202 203 204 205 206 207 208 209210 211 212 213 214 215 216 217 218 219220 221 222 223 224 225 226 227 228 229230 231 232 233 234 235 236 237 238 239240 241 242 243 244 245 246 247 248 249250 251 252 253 254 255 256 257 258 259260 261 262 263 264 265 266 267 268 269270 271 272 273 274 275 276 277 278 279280 281 282 283 284 285 286 287 288 289290 291 292 293 294 295 296 297 298 299300 301 302 303 304 305 306 307 308 309310 311 312 313 314 315 316 317 318 319320 321 322 323 324 325 326 327 328 329330 331 332 333 334 335 336 337 338 339340 341 342 343 344 345 346 347 348 349350 351 352 353 354 355 356 357 358 359360 361 362 363 364 365 366 367 368 369370 371 372 373 374 375 376 377 378 379380 381 382 383 384 385 386 387 388 389390 391 392 393 394 395 396 397 398 399400 401 402 403 404 405 406 407 408 409410 411 412 413 414 415 416 417 418 419420 421 422 423 424 425 426 427 428 429430 431 432 433 434 435 436 437 438 439440 441 442 443 444 445 446 447 448 449450 451 452 453 454 455 456 457 458 459460 461 462 463 464 465 466 467 468 469470 471 472 473 474 475 476 477 478 479480 481 482 483 484 485 486 487 488 489490 491 492 493 494 495 496 497 498 499500 501 502 503 504 505 506 507 508 509510 511 512 513 514 515 516 517 518 519520 521 522 523 524 525 526 527 528 529530 531 532 533 534 535 536 537 538 539540 541 542 543 544 545 546 547 548 549550 551 552 553 554 555 556 557 558 559560 561 562 563 564 565 566 567 568 569570 571 572 573 574 575 576 577 578 579580 581 582 583 584 585 586 587 588 589590 591 592 593 594 595 596 597 598 599600 601 602 603 604 605 606 607 608 609610 611 612 613 614 615 616 617 618 619620 621 622 623 624 625 626 627 628 629630 631 632 633 634 635 636 637 638 639640 641 642 643 644 645 646 647 648 649650 651 652 653 654 655 656 657 658 659660 661 662 663 664 665 666 667 668 669670 671 672 673 674 675 676 677 678 679680 681 682 683 684 685 686 687 688 689690 691 692 693 694 695 696 697 698 699700 701 702 703 704 705 706 707 708 709710 711 712 713 714 715 716 717 718 719720 721 722 723 724 725 726 727 728 729730 731 732 733 734 735 736 737 738 739740 741 742 743 744 745 746 747 748 749750 751 752 753 754 755 756 757 758 759760 761 762 763 764 765 766 767 768 769770 771 772 773 774 775 776 777 778 779780 781 782 783 784 785 786 787 788 789790 791 792 793 794 795 796 797 798 799800 801 802 803 804 805 806 807 808 809810 811 812 813 814 815 816 817 818 819820 821 822 823 824 825 826 827 828 829830 831 832 833 834 835 836 837 838 839840 841 842 843 844 845 846 847 848 849850 851 852 853 854 855 856 857 858 859860 861 862 863 864 865 866 867 868 869870 871 872 873 874 875 876 877 878 879880 881 882 883 884 885 886 887 888 889890 891 892 893 894 895 896 897 898 899900 901 902 903 904 905 906 907 908 909910 911 912 913 914 915 916 917 918 919920 921 922 923 924 925 926 927 928 929930 931 932 933 934 935 936 937 938 939940 941 942 943 944 945 946 947 948 949950 951 952 953 954 955 956 957 958 959960 961 962 963 964 965 966 967 968 969970 971 972 973 974 975 976 977 978 979980 981 982 983 984 985 986 987 988 989990 991 992 993 994 995 996 997 998 999' as long_query
Query set global general_log = off
deallocate prepare long_query;
-set global general_log = @saved_general_log;
+set global general_log = @old_general_log;
DROP TABLE IF EXISTS log_count;
DROP TABLE IF EXISTS slow_log_copy;
DROP TABLE IF EXISTS general_log_copy;
@@ -893,7 +899,7 @@ TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1
TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2
DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
-SET GLOBAL slow_query_log = @saved_slow_query_log;
-SET GLOBAL general_log=@saved_general_log;
-SET SESSION long_query_time =@saved_long_query_time;
-SET GLOBAL LOG_OUTPUT = @saved_log_output;
+SET @@session.long_query_time= @old_long_query_time;
+SET @@global.log_output= @old_log_output;
+SET @@global.slow_query_log= @old_slow_query_log;
+SET @@global.general_log= @old_general_log;
diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result
index 14cff4f98c9..880a203a15f 100644
--- a/mysql-test/r/lowercase_table3.result
+++ b/mysql-test/r/lowercase_table3.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Cannot find or open table test/BUG29839 from");
DROP TABLE IF EXISTS t1,T1;
CREATE TABLE t1 (a int);
SELECT * from T1;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index cc05efded02..9ab982a6688 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -988,6 +988,17 @@ m1 CREATE TABLE `m1` (
`a` int(11) DEFAULT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, m1;
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a VARCHAR(10));
+CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
+CREATE TABLE m2(a INT) ENGINE=MERGE UNION=(t1);
+SELECT * FROM t1;
+a
+SELECT * FROM m1;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+SELECT * FROM m2;
+a
+DROP TABLE t1, t2, m1, m2;
End of 5.0 tests
create table t1 (c1 int, index(c1));
create table t2 (c1 int, index(c1)) engine=merge union=(t1);
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 553a9f36690..6f26135ce45 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -2215,7 +2215,7 @@ KEY (c1),
KEY (c2)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0;
-MyISAM file: MYSQLTEST_VARDIR/master-data/test/t1
+MyISAM file: MYSQLD_DATADIR/test/t1
Record format: Packed
Character set: utf8_general_ci (33)
Data records: 0 Deleted blocks: 0
diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result
index 5f39d318234..50d700ab7a2 100644
--- a/mysql-test/r/myisampack.result
+++ b/mysql-test/r/myisampack.result
@@ -27,3 +27,30 @@ CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+drop table if exists t1;
+create table t1(f1 int, f2 char(255));
+insert into t1 values(1, 'foo'), (2, 'bar');
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+flush tables;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize error Table 'test.t1' is read only
+Warnings:
+Error 1036 Table 't1' is read only
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair error Table 'test.t1' is read only
+Warnings:
+Error 1036 Table 't1' is read only
+drop table t1;
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index a4d96c1c243..25b66fe7fc6 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -180,6 +180,14 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
1
This is a file starting with UTF8 BOM 0xEFBBBF
This is a file starting with UTF8 BOM 0xEFBBBF
+delimiter
+1
+2
+2
+2
+2
+@z:='1' @z=database()
+1 NULL
End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
Warning (Code 1286): Unknown table engine 'nonexistent'
diff --git a/mysql-test/r/mysql_client_test.result b/mysql-test/r/mysql_client_test.result
index 9766475a418..08d982c85e3 100644
--- a/mysql-test/r/mysql_client_test.result
+++ b/mysql-test/r/mysql_client_test.result
@@ -1 +1,3 @@
+SET @old_general_log= @@global.general_log;
ok
+SET @@global.general_log= @old_general_log;
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 31846f68b7b..384442f8c31 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -1,4 +1,6 @@
Run mysql_upgrade once
+mtr.global_suppressions OK
+mtr.test_suppressions OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -29,6 +31,8 @@ mysql.user OK
Run it again - should say already completed
This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade
Force should run it regardless of wether it's been run before
+mtr.global_suppressions OK
+mtr.test_suppressions OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -59,6 +63,8 @@ mysql.user OK
CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila';
GRANT ALL ON *.* TO mysqltest1@'%';
Run mysql_upgrade with password protected account
+mtr.global_suppressions OK
+mtr.test_suppressions OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -91,6 +97,8 @@ Run mysql_upgrade with a non existing server socket
mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
+mtr.global_suppressions OK
+mtr.test_suppressions OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index 9c2ccc78429..974b4952799 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -1,14 +1,15 @@
+reset master;
set timestamp=1000000000;
drop table if exists t1,t2,t3,t4,t5,t03,t04;
create table t1 (word varchar(20));
create table t2 (id int auto_increment not null primary key);
insert into t1 values ("abirvalg");
insert into t2 values ();
-load data infile '../std_data_ln/words.dat' into table t1;
-load data infile '../std_data_ln/words.dat' into table t1;
-load data infile '../std_data_ln/words.dat' into table t1;
-load data infile '../std_data_ln/words.dat' into table t1;
-load data infile '../std_data_ln/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
insert into t1 values ("Alas");
flush logs;
@@ -20,7 +21,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -66,7 +67,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -98,7 +99,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -120,7 +121,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -166,7 +167,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -198,7 +199,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -298,7 +299,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -320,17 +321,17 @@ call p1();
drop procedure p1;
flush logs;
create table t1 (a varchar(64) character set utf8);
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=latin1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=latin1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8r;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r;
select hex(a) from t1;
hex(a)
C3BF
@@ -348,7 +349,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result
index 89fc4b87d29..dba9bdc9d70 100644
--- a/mysql-test/r/mysqlbinlog2.result
+++ b/mysql-test/r/mysqlbinlog2.result
@@ -22,7 +22,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -65,7 +65,7 @@ SET INSERT_ID=1/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -104,7 +104,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -130,7 +130,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -165,7 +165,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -188,7 +188,7 @@ SET INSERT_ID=3/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -218,7 +218,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -249,7 +249,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -284,7 +284,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -307,7 +307,7 @@ SET INSERT_ID=1/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -338,7 +338,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -361,7 +361,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -380,7 +380,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -402,7 +402,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -448,7 +448,7 @@ SET INSERT_ID=3/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -471,7 +471,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -493,7 +493,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -523,7 +523,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -566,7 +566,7 @@ SET INSERT_ID=1/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -604,7 +604,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -630,7 +630,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -664,7 +664,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -687,7 +687,7 @@ SET INSERT_ID=3/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -717,7 +717,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -747,7 +747,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -782,7 +782,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -805,7 +805,7 @@ SET INSERT_ID=1/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -836,7 +836,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -858,7 +858,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -877,7 +877,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -899,7 +899,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -945,7 +945,7 @@ SET INSERT_ID=3/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -968,7 +968,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -990,7 +990,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1020,7 +1020,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/r/mysqlbinlog_base64.result b/mysql-test/r/mysqlbinlog_base64.result
index b62023e0ccf..c5e1e2f8ca1 100644
--- a/mysql-test/r/mysqlbinlog_base64.result
+++ b/mysql-test/r/mysqlbinlog_base64.result
@@ -1,3 +1,4 @@
+reset master;
create table t1 (a int);
insert into t1 values (1);
insert into t1 values (2);
@@ -5,7 +6,7 @@ insert into t1 values (3);
update t1 set a=a+2 where a=2;
update t1 set a=a+2 where a=3;
create table t2 (word varchar(20));
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
flush logs;
drop table t1;
drop table t2;
@@ -89,7 +90,7 @@ aberration
flush logs;
drop table t2;
create table t2 (word varchar(20));
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
insert into t2 select * from t2;
insert into t2 select * from t2;
insert into t2 select * from t2;
diff --git a/mysql-test/r/mysqlbinlog_row.result b/mysql-test/r/mysqlbinlog_row.result
index 39ca296e343..9b562ac0fff 100644
--- a/mysql-test/r/mysqlbinlog_row.result
+++ b/mysql-test/r/mysqlbinlog_row.result
@@ -339,7 +339,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/r/mysqlbinlog_row_big.result b/mysql-test/r/mysqlbinlog_row_big.result
index 0daf50e1ac3..f2ca72f9936 100644
--- a/mysql-test/r/mysqlbinlog_row_big.result
+++ b/mysql-test/r/mysqlbinlog_row_big.result
@@ -9,7 +9,7 @@ SET timestamp=1000000000;
#
# We need big packets.
#
-SET @@session.max_allowed_packet= 1024*1024*1024;
+SET @@global.max_allowed_packet= 1024*1024*1024;
#
# Delete all existing binary logs.
#
diff --git a/mysql-test/r/mysqlbinlog_row_innodb.result b/mysql-test/r/mysqlbinlog_row_innodb.result
index 56efba0362f..86f0b67ebb3 100644
--- a/mysql-test/r/mysqlbinlog_row_innodb.result
+++ b/mysql-test/r/mysqlbinlog_row_innodb.result
@@ -2256,7 +2256,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -3879,7 +3879,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -4246,7 +4246,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -4772,7 +4772,7 @@ c3 VARCHAR(60)
#
# Load data.
#
-LOAD DATA INFILE '../std_data_ln/loaddata5.dat'
+LOAD DATA INFILE '../../std_data/loaddata5.dat'
INTO TABLE t1 FIELDS TERMINATED BY '' ENCLOSED BY '' (c1,c2)
SET c3 = 'Wow';
affected rows: 3
@@ -4807,7 +4807,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
diff --git a/mysql-test/r/mysqlbinlog_row_myisam.result b/mysql-test/r/mysqlbinlog_row_myisam.result
index d3f2a2a1f2f..b9366d941f8 100644
--- a/mysql-test/r/mysqlbinlog_row_myisam.result
+++ b/mysql-test/r/mysqlbinlog_row_myisam.result
@@ -2256,7 +2256,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -3901,7 +3901,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -4274,7 +4274,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -4810,7 +4810,7 @@ c3 VARCHAR(60)
#
# Load data.
#
-LOAD DATA INFILE '../std_data_ln/loaddata5.dat'
+LOAD DATA INFILE '../../std_data/loaddata5.dat'
INTO TABLE t1 FIELDS TERMINATED BY '' ENCLOSED BY '' (c1,c2)
SET c3 = 'Wow';
affected rows: 3
@@ -4845,7 +4845,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
diff --git a/mysql-test/r/mysqlbinlog_row_trans.result b/mysql-test/r/mysqlbinlog_row_trans.result
index b7dd6a68096..d0180e4a7a3 100644
--- a/mysql-test/r/mysqlbinlog_row_trans.result
+++ b/mysql-test/r/mysqlbinlog_row_trans.result
@@ -135,7 +135,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -215,30 +215,14 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-BEGIN
-/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # Xid = #
-COMMIT/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
-BEGIN
-/*!*/;
-# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # Xid = #
-COMMIT/*!*/;
-# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
BEGIN
@@ -347,17 +331,9 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-BEGIN
-/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # Xid = #
-COMMIT/*!*/;
-# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t2
@@ -473,17 +449,9 @@ ROLLBACK
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-BEGIN
-/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # Xid = #
-COMMIT/*!*/;
-# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t2
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index e222d66c5b6..6f7fcb7efde 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -1,6 +1,8 @@
DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
drop view if exists v1;
drop database if exists client_test_db;
+mtr.global_suppressions OK
+mtr.test_suppressions OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -130,3 +132,58 @@ v1
v-1
drop view v1, `v-1`;
drop table t1;
+SET NAMES utf8;
+CREATE TABLE `#mysql50#@` (a INT);
+SHOW TABLES;
+Tables_in_test
+#mysql50#@
+SET NAMES DEFAULT;
+mysqlcheck --fix-table-names --databases test
+SET NAMES utf8;
+SHOW TABLES;
+Tables_in_test
+@
+DROP TABLE `@`;
+CREATE TABLE `Ñ` (a INT);
+SET NAMES DEFAULT;
+mysqlcheck --default-character-set="latin1" --databases test
+test.?
+Error : Table doesn't exist
+error : Corrupt
+mysqlcheck --default-character-set="utf8" --databases test
+test.Ñ OK
+SET NAMES utf8;
+DROP TABLE `Ñ`;
+SET NAMES DEFAULT;
+CREATE DATABASE `#mysql50#a@b`;
+USE `#mysql50#a@b`;
+CREATE TABLE `#mysql50#c@d` (a INT);
+CREATE TABLE t1 (a INT);
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
+TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+NULL #mysql50#a@b tr1 INSERT NULL #mysql50#a@b #mysql50#c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+NULL #mysql50#a@b tr2 INSERT NULL #mysql50#a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+Warnings:
+Warning 1603 Triggers for table `#mysql50#a@b`.`#mysql50#c@d` have no creation context
+Warning 1603 Triggers for table `#mysql50#a@b`.`t1` have no creation context
+mysqlcheck --fix-db-names --fix-table-names --all-databases
+USE `a@b`;
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name;
+TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+NULL a@b tr1 INSERT NULL a@b c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+NULL a@b tr2 INSERT NULL a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+INSERT INTO `c@d` VALUES (2), (1);
+SELECT * FROM `c@d`;
+a
+20
+10
+INSERT INTO t1 VALUES (3), (5);
+SELECT * FROM t1;
+a
+300
+500
+DROP DATABASE `a@b`;
+USE test;
+End of 5.1 tests
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index ec397d8fb89..4e97f5bc509 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1,6 +1,6 @@
-Bug#37938 - Test "mysqldump" lacks various insert statements
-Turn off concurrent inserts to avoid random errors
-NOTE: We reset the variable back to saved value at the end of test
+# Bug#37938 Test "mysqldump" lacks various insert statements
+# Turn off concurrent inserts to avoid random errors
+# NOTE: We reset the variable back to saved value at the end of test
SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT = 0;
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
@@ -8,7 +8,7 @@ drop database if exists mysqldump_test_db;
drop database if exists db1;
drop database if exists db2;
drop view if exists v1, v2, v3;
-CREATE TABLE t1(a int, key (a)) key_block_size=1024;
+CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
INSERT INTO t1 VALUES (1), (2);
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
@@ -29,7 +29,7 @@ INSERT INTO t1 VALUES (1), (2);
</mysqldump>
DROP TABLE t1;
#
-# Bug #2005
+# Bug#2005 Long decimal comparison bug.
#
CREATE TABLE t1 (a decimal(64, 20));
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
@@ -43,7 +43,7 @@ SET character_set_client = @saved_cs_client;
INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('987654321098765432109876543210987654321.00000000000000000000');
DROP TABLE t1;
#
-# Bug #2055
+# Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL"
#
CREATE TABLE t1 (a double);
INSERT INTO t1 VALUES ('-9e999999');
@@ -58,7 +58,7 @@ SET character_set_client = @saved_cs_client;
INSERT INTO `t1` VALUES (RES);
DROP TABLE t1;
#
-# Bug #3361 mysqldump quotes DECIMAL values inconsistently
+# Bug#3361 mysqldump quotes DECIMAL values inconsistently
#
CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
INSERT INTO t1 VALUES (1.2345, 2.3456);
@@ -170,7 +170,7 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
</mysqldump>
DROP TABLE t1;
#
-# Bug #1707
+# Bug#1707 mysqldump -X does't quote field and table names
#
CREATE TABLE t1 (`a"b"` char(2));
INSERT INTO t1 VALUES ("1\""), ("\"2");
@@ -192,8 +192,8 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
</mysqldump>
DROP TABLE t1;
#
-# Bug #1994
-# Bug #4261
+# Bug#1994 mysqldump does not correctly dump UCS2 data
+# Bug#4261 mysqldump 10.7 (mysql 4.1.2) --skip-extended-insert drops NULL from inserts
#
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
@@ -234,7 +234,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
-# Bug #2634
+# Bug#2634 mysqldump in --compatible=mysql4
#
CREATE TABLE t1 (a int) ENGINE=MYISAM;
INSERT INTO t1 VALUES (1), (2);
@@ -292,7 +292,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
-# Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
+# Bug#2592 mysqldump doesn't quote "tricky" names correctly
#
create table ```a` (i int);
SET @saved_cs_client = @@character_set_client;
@@ -303,7 +303,7 @@ CREATE TABLE ```a` (
SET character_set_client = @saved_cs_client;
drop table ```a`;
#
-# Bug #2591 "mysqldump quotes names inconsistently"
+# Bug#2591 mysqldump quotes names inconsistently
#
create table t1(a int);
@@ -426,7 +426,7 @@ UNLOCK TABLES;
set global sql_mode='';
drop table t1;
#
-# Bug #2705 'mysqldump --tab extra output'
+# Bug#2705 mysqldump --tab extra output
#
create table t1(a int);
insert into t1 values (1),(2),(3);
@@ -460,7 +460,7 @@ SET character_set_client = @saved_cs_client;
3
drop table t1;
#
-# Bug #6101: create database problem
+# Bug#6101 create database problem
#
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
@@ -515,7 +515,7 @@ USE `mysqldump_test_db`;
drop database mysqldump_test_db;
#
-# Bug #7020
+# Bug#7020 mysqldump --compatible=mysql40 should set --skip-set-charset --default-char...
# Check that we don't dump in UTF8 in compatible mode by default,
# but use the default compiled values, or the values given in
# --default-character-set=xxx. However, we should dump in UTF8
@@ -557,8 +557,8 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
#
-# Bug#8063: make test mysqldump [ fail ]
-# We cannot tes this command because its output depends
+# Bug#8063 make test mysqldump [ fail ]
+# We cannot test this command because its output depends
# on --default-character-set incompiled into "mysqldump" program.
# If the future we can move this command into a separate test with
# checking that "mysqldump" is compiled with "latin1"
@@ -643,7 +643,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
-# WL #2319: Exclude Tables from dump
+# WL#2319 Exclude Tables from dump
#
CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
@@ -686,7 +686,7 @@ UNLOCK TABLES;
DROP TABLE t1;
DROP TABLE t2;
#
-# Bug #8830
+# Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values
#
CREATE TABLE t1 (`b` blob);
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
@@ -728,7 +728,7 @@ DROP TABLE t1;
#
# Test for --insert-ignore
#
-CREATE TABLE t1 (a int);
+CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t1 VALUES (4),(5),(6);
@@ -799,9 +799,9 @@ INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
DROP TABLE t1;
#
-# Bug #10286: mysqldump -c crashes on table that has many fields with long
-# names
-#
+# Bug#10286 mysqldump -c crashes on table that has many fields with long
+# names
+#
create table t1 (
F_c4ca4238a0b923820dcc509a6f75849b int,
F_c81e728d9d4c2f636f067f89cc14862c int,
@@ -1545,7 +1545,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
-# Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
+# Bug#9558 mysqldump --no-data db t1 t2 format still dumps data
#
CREATE DATABASE mysqldump_test_db;
USE mysqldump_test_db;
@@ -1650,7 +1650,7 @@ DROP DATABASE mysqldump_test_db;
#
# Testing with tables and databases that don't exists
# or contains illegal characters
-# (Bug #9358 mysqldump crashes if tablename starts with \)
+# (Bug#9358 mysqldump crashes if tablename starts with \)
#
create database mysqldump_test_db;
use mysqldump_test_db;
@@ -1679,7 +1679,7 @@ drop table t1, t2, t3;
drop database mysqldump_test_db;
use test;
#
-# Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
+# Bug#9657 mysqldump xml ( -x ) does not format NULL fields correctly
#
create table t1 (a int(10));
create table t2 (pk int primary key auto_increment,
@@ -1738,7 +1738,7 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
</mysqldump>
drop table t1, t2;
#
-# BUG #12123
+# Bug#12123 mysqldump --tab results in text file which can't be imported
#
create table t1 (a text character set utf8, b text character set latin1);
insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
@@ -1751,11 +1751,11 @@ a b
Osnabrück Köln
drop table t1;
#
-# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
+# Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
#
--fields-optionally-enclosed-by="
#
-# BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
+# Bug#19025 mysqldump doesn't correctly dump "auto_increment = [int]"
#
create table `t1` (
t1_name varchar(255) default null,
@@ -1795,7 +1795,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM AUTO_INCREMENT=1003 DEFAULT CHARSET=latin1
drop table `t1`;
#
-# Bug #18536: wrong table order
+# Bug#18536 wrong table order
#
create table t1(a int);
create table t2(a int);
@@ -1844,7 +1844,7 @@ SET character_set_client = @saved_cs_client;
drop table t1, t2, t3;
#
-# Bug #21288: mysqldump segmentation fault when using --where
+# Bug#21288 mysqldump segmentation fault when using --where
#
create table t1 (a int);
mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1` WHERE xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 (1064)
@@ -1880,7 +1880,7 @@ SET character_set_client = @saved_cs_client;
drop table t1;
#
-# BUG#13926: --order-by-primary fails if PKEY contains quote character
+# Bug#13926 --order-by-primary fails if PKEY contains quote character
#
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
@@ -1959,7 +1959,7 @@ UNLOCK TABLES;
DROP TABLE `t1`;
End of 4.1 tests
#
-# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
+# Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
#
create database db1;
use db1;
@@ -2036,7 +2036,7 @@ drop view v2;
drop database db1;
use test;
#
-# Bug 10713 mysqldump includes database in create view and referenced tables
+# Bug#10713 mysqldump includes database in create view and referenced tables
#
create database db2;
use db2;
@@ -2067,9 +2067,6 @@ a b
drop table t1, t2;
drop database db1;
use test;
-#
-# dump of view
-#
create table t1(a int);
create view v1 as select * from t1;
@@ -2130,7 +2127,7 @@ SET character_set_client = @saved_cs_client;
drop view v1;
drop table t1;
#
-# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
+# Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
#
create database mysqldump_test_db;
use mysqldump_test_db;
@@ -2207,7 +2204,7 @@ drop view v2;
drop database mysqldump_test_db;
use test;
#
-# Bug #9756
+# Bug#9756 mysql client failing on dumps containing certain \ sequences
#
CREATE TABLE t1 (a char(10));
INSERT INTO t1 VALUES ('\'');
@@ -2247,7 +2244,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
-# Bug #10927 mysqldump: Can't reload dump with view that consist of other view
+# Bug#10927 mysqldump: Can't reload dump with view that consist of other view
#
create table t1(a int, b int, c varchar(30));
insert into t1 values(1, 2, "one"), (2, 4, "two"), (3, 6, "three");
@@ -2620,12 +2617,14 @@ end if;
end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP TABLE t1, t2;
#
-# Bugs #9136, #12917: problems with --defaults-extra-file option
+# Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a
+# Bug#12917 The --defaults-extra-file option is ignored by the 5.0 client binaries
+# (Problems with --defaults-extra-file option)
#
--port=1234
--port=1234
#
-# Test of fix to BUG 12597
+# Test of fix to Bug#12597 mysqldump dumps triggers wrongly
#
DROP TABLE IF EXISTS `test1`;
Warnings:
@@ -2659,7 +2658,7 @@ DROP TRIGGER testref;
DROP TABLE test1;
DROP TABLE test2;
#
-# BUG#9056 - mysqldump does not dump routines
+# Bug#9056 mysqldump does not dump routines
#
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS bug9056_func1;
@@ -2677,9 +2676,9 @@ begin
set f1= concat( 'hello', f1 );
return f1;
end //
-CREATE PROCEDURE bug9056_proc2(OUT a INT)
-BEGIN
-select sum(id) from t1 into a;
+CREATE PROCEDURE bug9056_proc2(OUT a INT)
+BEGIN
+select sum(id) from t1 into a;
END //
set sql_mode='ansi';
create procedure `a'b` () select 1;
@@ -2794,8 +2793,8 @@ DELIMITER ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `bug9056_proc2`(OUT a INT)
-BEGIN
-select sum(id) from t1 into a;
+BEGIN
+select sum(id) from t1 into a;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@@ -2819,7 +2818,7 @@ DROP PROCEDURE bug9056_proc2;
DROP PROCEDURE `a'b`;
drop table t1;
#
-# BUG# 13052 - mysqldump timestamp reloads broken
+# Bug#13052 mysqldump timestamp reloads broken
#
drop table if exists t1;
create table t1 (`d` timestamp, unique (`d`));
@@ -2914,7 +2913,7 @@ drop table t1;
set global time_zone=default;
set time_zone=default;
#
-# Test of fix to BUG 13146 - ansi quotes break loading of triggers
+# Test of fix to Bug#13146 ansi quotes break loading of triggers
#
DROP TABLE IF EXISTS `t1 test`;
DROP TABLE IF EXISTS `t2 test`;
@@ -2993,7 +2992,7 @@ DROP TRIGGER `test trig`;
DROP TABLE `t1 test`;
DROP TABLE `t2 test`;
#
-# BUG# 12838 mysqldump -x with views exits with error
+# Bug#12838 mysqldump -x with views exits with error
#
drop table if exists t1;
create table t1 (a int, b varchar(32), c varchar(32));
@@ -3127,7 +3126,7 @@ drop view v0;
drop view v1;
drop table t1;
#
-# BUG#14554 - mysqldump does not separate words "ROW" and "BEGIN"
+# Bug#14554 mysqldump does not separate words "ROW" and "BEGIN"
# for tables with trigger created in the IGNORE_SPACE sql mode.
#
SET @old_sql_mode = @@SQL_MODE;
@@ -3198,8 +3197,8 @@ DELIMITER ;
DROP TRIGGER tr1;
DROP TABLE t1;
#
-# Bug #13318: Bad result with empty field and --hex-blob
-#
+# Bug#13318 Bad result with empty field and --hex-blob
+#
create table t1 (a binary(1), b blob);
insert into t1 values ('','');
@@ -3274,7 +3273,7 @@ UNLOCK TABLES;
drop table t1;
#
-# Bug 14871 Invalid view dump output
+# Bug#14871 Invalid view dump output
#
create table t1 (a int);
insert into t1 values (289), (298), (234), (456), (789);
@@ -3303,7 +3302,7 @@ a
drop table t1;
drop view v1, v2, v3, v4, v5;
#
-# Bug #16878 dump of trigger
+# Bug#16878 dump of trigger
#
create table t1 (a int, created datetime);
create table t2 (b int, created datetime);
@@ -3371,7 +3370,7 @@ drop view v2;
drop table t;
#
# Bug#14857 Reading dump files with single statement stored routines fails.
-# fixed by patch for bug#16878
+# fixed by patch for Bug#16878
#
/*!50003 CREATE FUNCTION `f`() RETURNS bigint(20)
return 42 */|
@@ -3388,7 +3387,7 @@ select 42 latin1 latin1_swedish_ci latin1_swedish_ci
drop function f;
drop procedure p;
#
-# Bug #17371 Unable to dump a schema with invalid views
+# Bug#17371 Unable to dump a schema with invalid views
#
create table t1 ( id serial );
create view v1 as select * from t1;
@@ -3399,7 +3398,7 @@ mysqldump {
} mysqldump
drop view v1;
-# BUG#17201 Spurious 'DROP DATABASE' in output,
+# Bug#17201 Spurious 'DROP DATABASE' in output,
# also confusion between tables and views.
# Example code from Markus Popp
create database mysqldump_test_db;
@@ -3478,7 +3477,7 @@ drop view v1;
drop table t1;
drop database mysqldump_test_db;
#
-# Bug21014 Segmentation fault of mysqldump on view
+# Bug#21014 Segmentation fault of mysqldump on view
#
create database mysqldump_tables;
use mysqldump_tables;
@@ -3530,7 +3529,7 @@ drop database mysqldump_views;
drop table mysqldump_tables.basetable;
drop database mysqldump_tables;
#
-# Bug20221 Dumping of multiple databases containing view(s) yields maleformed dumps
+# Bug#20221 Dumping of multiple databases containing view(s) yields maleformed dumps
#
create database mysqldump_dba;
use mysqldump_dba;
@@ -3579,10 +3578,10 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
#
-# Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
-# information_schema database.
+# Bug#21527 mysqldump incorrectly tries to LOCK TABLES on the
+# information_schema database.
#
-# Bug #21424 mysqldump failing to export/import views
+# Bug#21424 mysqldump failing to export/import views
#
create database mysqldump_myDB;
use mysqldump_myDB;
@@ -3602,8 +3601,8 @@ revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
drop user myDB_User@localhost;
drop database mysqldump_myDB;
flush privileges;
-# Bug #21424 continues from here.
-# Restore. Flush Privileges test ends.
+# Bug#21424 continues from here.
+# Restore. Flush Privileges test ends.
#
use mysqldump_myDB;
select * from mysqldump_myDB.v1;
@@ -3621,7 +3620,7 @@ drop user myDB_User@localhost;
drop database mysqldump_myDB;
use test;
#
-# Bug #19745: mysqldump --xml produces invalid xml
+# Bug#19745 mysqldump --xml produces invalid xml
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (f1 int(10), data MEDIUMBLOB);
@@ -3643,15 +3642,15 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
</mysqldump>
DROP TABLE t1;
#
-# Bug#26346: stack + buffer overrun in mysqldump
+# Bug#26346 stack + buffer overrun in mysqldump
#
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
-CREATE TABLE t2 (a int);
-CREATE TABLE t3 (a int);
-CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3);
+CREATE TABLE t2 (a INT);
+CREATE TABLE t3 (a INT);
+CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -3706,7 +3705,7 @@ UNLOCK TABLES;
DROP TABLE t1, t2, t3;
#
-# Bug #23491: MySQLDump prefix function call in a view by database name
+# Bug#23491 MySQLDump prefix function call in a view by database name
#
create database bug23491_original;
create database bug23491_restore;
@@ -3728,12 +3727,12 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
drop database bug23491_original;
drop database bug23491_restore;
use test;
-#
-# Bug 27293: mysqldump crashes when dumping routines
-# defined by a different user
#
-# Bug #22761: mysqldump reports no errors when using
-# --routines without mysql.proc privileges
+# Bug#27293 mysqldump crashes when dumping routines
+# defined by a different user
+#
+# Bug#22761 mysqldump reports no errors when using
+# --routines without mysql.proc privileges
#
create database mysqldump_test_db;
grant all privileges on mysqldump_test_db.* to user1;
@@ -3764,7 +3763,7 @@ drop user user1;
drop user user2;
drop database mysqldump_test_db;
#
-# Bug #28522: buffer overrun by '\0' byte using --hex-blob.
+# Bug#28522 buffer overrun by '\0' byte using --hex-blob.
#
CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
@@ -3778,8 +3777,8 @@ SET character_set_client = @saved_cs_client;
INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171);
DROP TABLE t1;
#
-# Bug #28524: mysqldump --skip-add-drop-table is not
-# compatible with views
+# Bug#28524 mysqldump --skip-add-drop-table is not
+# compatible with views
#
CREATE VIEW v1 AS SELECT 1;
DROP VIEW v1;
@@ -3788,8 +3787,8 @@ SELECT * FROM v1;
1
DROP VIEW v1;
#
-# Bug #29788: mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
-# the SQL_MODE variable after the dumping of triggers.
+# Bug#29788 mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
+# the SQL_MODE variable after the dumping of triggers.
#
CREATE TABLE t1 (c1 INT);
CREATE TRIGGER t1bd BEFORE DELETE ON t1 FOR EACH ROW BEGIN END;
@@ -3810,8 +3809,8 @@ c1
2
DROP TABLE t1,t2;
#
-# Bug#29815: new option for suppressing last line of mysqldump:
-# "Dump completed on"
+# Bug#29815 new option for suppressing last line of mysqldump:
+# "Dump completed on"
#
# --skip-dump-date:
--
@@ -3876,7 +3875,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
-# BUG# 16853: mysqldump doesn't show events
+# Bug#16853 mysqldump doesn't show events
#
create database first;
use first;
@@ -3916,7 +3915,7 @@ drop database third;
set time_zone = 'SYSTEM';
use test;
#
-# BUG#17201 Spurious 'DROP DATABASE' in output,
+# Bug#17201 Spurious 'DROP DATABASE' in output,
# also confusion between tables and views.
# Example code from Markus Popp
#
@@ -3996,8 +3995,8 @@ drop view v1;
drop table t1;
drop database mysqldump_test_db;
#
-# Bug #30027: mysqldump does not dump views properly.
-#
+# Bug#30027 mysqldump does not dump views properly.
+#
# Cleanup.
DROP DATABASE IF EXISTS mysqldump_test_db;
@@ -4029,8 +4028,8 @@ set names latin1;
# Cleanup.
DROP DATABASE mysqldump_test_db;
#
-# BUG#29938: wrong behavior of mysqldump --skip-events
-# with --all-databases
+# Bug#29938 wrong behavior of mysqldump --skip-events
+# with --all-databases
#
TRUNCATE mysql.event;
USE test;
@@ -4062,7 +4061,7 @@ drop database `test-database`;
use test;
# -----------------------------------------------------------------
-# -- Bug#30217: Views: changes in metadata behaviour between 5.0 and 5.1.
+# -- Bug#30217 Views: changes in metadata behaviour between 5.0 and 5.1.
# -----------------------------------------------------------------
DROP DATABASE IF EXISTS mysqldump_test_db;
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 51a0b6c45ef..1a65f90bd65 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -153,8 +153,12 @@ mysqltest: At line 1: Missing delimiter
mysqltest: At line 1: End of line junk detected: "sleep 7
# Another comment
"
-mysqltest: At line 1: Missing delimiter
-mysqltest: At line 1: Missing delimiter
+mysqltest: At line 1: Extra argument 'comment
+# comment 3
+disable_query_log' passed to 'disconnect'
+mysqltest: At line 1: Extra argument 'comment
+# comment 3
+disable_query_log' passed to 'disconnect'
mysqltest: At line 1: End of line junk detected: "disconnect default
#
@@ -294,7 +298,7 @@ var5 from query that returns no row
failing query in let
mysqltest: At line 1: Error running query 'failing query': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
-mysqltest: At line 1: Could not open './non_existingFile' for reading
+mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
@@ -444,7 +448,7 @@ ERROR 3D000: No database selected
Output from mysqltest-x.inc
Output from mysqltest-x.inc
Output from mysqltest-x.inc
-mysqltest: Could not open './non_existing_file.inc' for reading: errno = 2
+mysqltest: Could not open './non_existing_file.inc' for reading, errno: 2
failing_statement;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1
failing_statement;
@@ -487,8 +491,6 @@ mysqltest: At line 3: query 'create table t1 (a int primary key);
insert into t1 values (1);
select 'select-me';
insertz 'error query'' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insertz 'error query'' at line 1
-
-More results from queries before failure can be found in MYSQLTEST_VARDIR/log/bug11731.log
drop table t1;
Multi statement using expected error
create table t1 (a int primary key);
@@ -732,4 +734,21 @@ file2.txt
SELECT 'c:\\a.txt' AS col;
col
z
+hej
+mysqltest: At line 1: Found junk ' != 143' after $variable in expression
+select 1;
+1
+1
+select 1;
+1
+1
+-- a comment for the server;
+mysqltest: At line 1: Found line beginning with -- that didn't contain a valid mysqltest command, check your syntax or use # if you intended to write a comment
+con1
+default
+con1
+default
+con1
+con1
+-closed_connection-
End of tests
diff --git a/mysql-test/r/not_as_root.require b/mysql-test/r/not_as_root.require
deleted file mode 100644
index d9ea5244efc..00000000000
--- a/mysql-test/r/not_as_root.require
+++ /dev/null
@@ -1,2 +0,0 @@
-running_as_root
-NO
diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result
index 1b734136e6c..8f7c125196a 100644
--- a/mysql-test/r/not_embedded_server.result
+++ b/mysql-test/r/not_embedded_server.result
@@ -1,12 +1,3 @@
-prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!=\'Daemon\' ';
-execute stmt1;
-ID USER HOST DB COMMAND TIME STATE INFO
-number root localhost test Query time executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!='Daemon'
-deallocate prepare stmt1;
-FLUSH STATUS;
-SHOW GLOBAL STATUS LIKE 'com_select';
-Variable_name Value
-Com_select 102
-SHOW GLOBAL STATUS LIKE 'com_select';
-Variable_name Value
-Com_select 102
+select 1;
+1
+1
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index 64b8aa74af3..1cdc48e6552 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -93,9 +93,11 @@ INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
Warnings:
Warning 1265 Data truncated for column 'd' at row 1
UPDATE t1 SET d=1/NULL;
-ERROR 23000: Column 'd' cannot be null
+Warnings:
+Warning 1265 Data truncated for column 'd' at row 1
UPDATE t1 SET d=NULL;
-ERROR 23000: Column 'd' cannot be null
+Warnings:
+Warning 1048 Column 'd' cannot be null
INSERT INTO t1 (a) values (null);
ERROR 23000: Column 'a' cannot be null
INSERT INTO t1 (a) values (1/null);
@@ -130,7 +132,7 @@ Warning 1048 Column 'd' cannot be null
Warning 1048 Column 'd' cannot be null
select * from t1;
a b c d
- 0 0000-00-00 00:00:00 2003
+ 0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 70151acda22..cab1f7a0755 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -3,8 +3,8 @@ create table t1(f1 int);
insert into t1 values (5);
grant select on test.* to ssl_user1@localhost require SSL;
grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA";
-grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com";
-grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
+grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com";
+grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges;
connect(localhost,ssl_user5,,test,MASTER_PORT,MASTER_SOCKET);
diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result
index 8503df545d2..e5f5a53c1f3 100644
--- a/mysql-test/r/outfile.result
+++ b/mysql-test/r/outfile.result
Binary files differ
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 93684ba05e5..cec4e60d139 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,3 +1,4 @@
+SET @old_general_log= @@global.general_log;
drop table if exists t1, t2;
CREATE TABLE t1 (
pk INT NOT NULL AUTO_INCREMENT,
@@ -1907,3 +1908,4 @@ count(*)
288
drop table t1;
End of 5.1 tests
+SET @@global.general_log= @old_general_log;
diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result
index 3e4acfdee12..607afb71da5 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -324,7 +324,7 @@ partition by hash (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(27) NOT NULL DEFAULT '\0\0\0\0',
+ `a` bit(27) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 585447ff333..547ce1ca316 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -87,8 +87,8 @@ partitions 3
partition x2 tablespace ts2,
partition x3 tablespace ts3);
ERROR HY000: Field in list of fields for partition function not found in table
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -164,8 +164,8 @@ partitions 2
(partition x1 values less than (4),
partition x2 values less than (5));
ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -177,8 +177,8 @@ partitions 2
(partition x1 values in (4),
partition x2 values in (5));
ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -190,8 +190,8 @@ partitions 2
(partition x1 values in (4,6),
partition x2 values in (5,7));
ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -201,8 +201,8 @@ primary key (a,b))
partition by key (a)
subpartition by key (b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -212,8 +212,8 @@ primary key (a,b))
partition by key (a)
subpartition by key (a, b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -223,8 +223,8 @@ primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -234,8 +234,8 @@ primary key (a,b))
partition by key (a)
subpartition by key (b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -245,8 +245,8 @@ primary key (a,b))
partition by key (a)
subpartition by key (a, b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -256,8 +256,8 @@ primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -277,8 +277,8 @@ subpartition by hash (sin(a+b))
(partition x1 (subpartition x11, subpartition x12),
partition x2 (subpartition x21, subpartition x22));
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -302,8 +302,8 @@ subpartition by key (a,d)
(partition x1 values less than (1) (subpartition x11, subpartition x12),
partition x2 values less than (2) (subpartition x21, subpartition x22));
ERROR HY000: Field in list of fields for partition function not found in table
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
@@ -330,8 +330,8 @@ c int not null,
primary key(a,b))
partition by range (a);
ERROR HY000: For RANGE partitions each partition must be defined
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
-load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
+select load_file('$MYSQLD_DATADIR/test/t1.par');
+load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
diff --git a/mysql-test/r/partition_innodb_semi_consistent.result b/mysql-test/r/partition_innodb_semi_consistent.result
new file mode 100644
index 00000000000..471da4c1c2e
--- /dev/null
+++ b/mysql-test/r/partition_innodb_semi_consistent.result
@@ -0,0 +1,129 @@
+drop table if exists t1;
+set binlog_format=mixed;
+set session transaction isolation level repeatable read;
+create table t1(a int not null)
+engine=innodb
+DEFAULT CHARSET=latin1
+PARTITION BY RANGE(a)
+(PARTITION p0 VALUES LESS THAN (20),
+PARTITION p1 VALUES LESS THAN MAXVALUE);
+insert into t1 values (1),(2),(3),(4),(5),(6),(7);
+set autocommit=0;
+select * from t1 where a=3 lock in share mode;
+a
+3
+set binlog_format=mixed;
+set session transaction isolation level repeatable read;
+set autocommit=0;
+update t1 set a=10 where a=5;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+commit;
+set session transaction isolation level read committed;
+update t1 set a=10 where a=5;
+select * from t1 where a=2 for update;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from t1 where a=2 limit 1 for update;
+a
+2
+update t1 set a=11 where a=6;
+update t1 set a=12 where a=2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+update t1 set a=13 where a=1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+commit;
+update t1 set a=14 where a=1;
+commit;
+select * from t1;
+a
+10
+11
+14
+2
+3
+4
+7
+drop table t1;
+SET SESSION AUTOCOMMIT = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+set binlog_format=mixed;
+# Switch to connection con1
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (300),
+PARTITION p1 VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1,2);
+# 1. test for locking:
+BEGIN;
+UPDATE t1 SET b = 12 WHERE a = 1;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+SELECT * FROM t1;
+a b
+1 12
+# Switch to connection con2
+UPDATE t1 SET b = 21 WHERE a = 1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# Switch to connection con1
+SELECT * FROM t1;
+a b
+1 12
+ROLLBACK;
+# 2. test for serialized update:
+CREATE TABLE t2 (a INT);
+TRUNCATE t1;
+INSERT INTO t1 VALUES (1,'init');
+CREATE PROCEDURE p1()
+BEGIN
+UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+INSERT INTO t2 VALUES ();
+END|
+BEGIN;
+UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+SELECT * FROM t1;
+a b
+1 init+con1
+# Switch to connection con2
+CALL p1;;
+# Switch to connection con1
+SELECT * FROM t1;
+a b
+1 init+con1
+COMMIT;
+SELECT * FROM t1;
+a b
+1 init+con1
+# Switch to connection con2
+SELECT * FROM t1;
+a b
+1 init+con1+con2
+# Switch to connection con1
+# 3. test for updated key column:
+TRUNCATE t1;
+TRUNCATE t2;
+INSERT INTO t1 VALUES (1,'init');
+BEGIN;
+UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+SELECT * FROM t1;
+a b
+2 init+con1
+# Switch to connection con2
+CALL p1;;
+# Switch to connection con1
+SELECT * FROM t1;
+a b
+2 init+con1
+COMMIT;
+SELECT * FROM t1;
+a b
+2 init+con1
+# Switch to connection con2
+SELECT * FROM t1;
+a b
+2 init+con1
+DROP PROCEDURE p1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result
index 465bddcb3fb..a1f35756e21 100644
--- a/mysql-test/r/partition_mgm.result
+++ b/mysql-test/r/partition_mgm.result
@@ -1,4 +1,11 @@
DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY)
+ENGINE MYISAM
+PARTITION BY HASH (a)
+PARTITIONS 1;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+ALTER TABLE t1 REORGANIZE PARTITION;
+DROP TABLE t1;
create table t1 (a int)
partition by range (a)
subpartition by key (a)
diff --git a/mysql-test/r/partition_not_windows.result b/mysql-test/r/partition_not_windows.result
index fa22b796a28..42dca557b3e 100644
--- a/mysql-test/r/partition_not_windows.result
+++ b/mysql-test/r/partition_not_windows.result
@@ -37,20 +37,20 @@ DROP TABLE t1, t2;
set @@sql_mode=@org_mode;
CREATE TABLE t1(a INT)
PARTITION BY KEY (a)
-(PARTITION p0 DATA DIRECTORY 'TEST_DIR/master-data/test');
+(PARTITION p0 DATA DIRECTORY 'MYSQLD_DATADIR/test');
ERROR HY000: Incorrect arguments to DATA DIRECTORY
CREATE TABLE t1(a INT)
PARTITION BY KEY (a)
-(PARTITION p0 INDEX DIRECTORY 'TEST_DIR/master-data/test');
+(PARTITION p0 INDEX DIRECTORY 'MYSQLD_DATADIR/test');
ERROR HY000: Incorrect arguments to INDEX DIRECTORY
CREATE TABLE ts (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) (
PARTITION p0 VALUES LESS THAN (1990) (
SUBPARTITION s0a
-DATA DIRECTORY = 'TEST_DIR/master-data/test',
+DATA DIRECTORY = 'MYSQLD_DATADIR/test',
SUBPARTITION s0b
-DATA DIRECTORY = 'TEST_DIR/master-data/test'
+DATA DIRECTORY = 'MYSQLD_DATADIR/test'
));
ERROR HY000: Incorrect arguments to DATA DIRECTORY
CREATE TABLE ts (id INT, purchased DATE)
@@ -58,9 +58,9 @@ PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) (
PARTITION p0 VALUES LESS THAN (1990) (
SUBPARTITION s0a
-INDEX DIRECTORY = 'TEST_DIR/master-data/test',
+INDEX DIRECTORY = 'MYSQLD_DATADIR/test',
SUBPARTITION s0b
-INDEX DIRECTORY = 'TEST_DIR/master-data/test'
+INDEX DIRECTORY = 'MYSQLD_DATADIR/test'
));
ERROR HY000: Incorrect arguments to INDEX DIRECTORY
DROP TABLE IF EXISTS `example`;
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index b153ad9ad47..26ddc92e97b 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -1,4 +1,16 @@
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+CREATE TABLE t1
+(a INT NOT NULL AUTO_INCREMENT,
+b DATETIME,
+PRIMARY KEY (a,b),
+KEY (b))
+PARTITION BY RANGE (to_days(b))
+(PARTITION p0 VALUES LESS THAN (733681) COMMENT = 'LESS THAN 2008-10-01',
+PARTITION p1 VALUES LESS THAN (733712) COMMENT = 'LESS THAN 2008-11-01',
+PARTITION pX VALUES LESS THAN MAXVALUE);
+SELECT a,b FROM t1 WHERE b >= '2008-12-01' AND b < '2009-12-00';
+a b
+DROP TABLE t1;
create table t1 ( a int not null) partition by hash(a) partitions 2;
insert into t1 values (1),(2),(3);
explain select * from t1 where a=5 and a=6;
diff --git a/mysql-test/r/profiling.result b/mysql-test/r/profiling.result
index a9ada576b4b..c96074eb830 100644
--- a/mysql-test/r/profiling.result
+++ b/mysql-test/r/profiling.result
@@ -11,6 +11,7 @@ select @@profiling;
0
set global profiling = ON;
ERROR HY000: Variable 'profiling' is a SESSION variable and can't be used with SET GLOBAL
+set @start_value= @@global.profiling_history_size;
set global profiling_history_size=100;
show global variables like 'profil%';
Variable_name Value
@@ -412,4 +413,5 @@ Warnings:
Note 1051 Unknown table 'test.v1'
drop function if exists f1;
set session profiling = OFF;
+set global profiling_history_size= @start_value;
End of 5.0 tests
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index c6799c6538e..e2905ea0904 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -260,6 +260,7 @@ prepare stmt4 from ' show databases ';
execute stmt4;
Database
information_schema
+mtr
mysql
test
prepare stmt4 from ' show tables from test like ''t2%'' ';
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 0888b78618f..a91d13d11a1 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -1303,11 +1303,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
+0 two
1 one
-2 two
3 three
4 four
set @arg00=0;
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index e5a57131b01..50c94d6cc4e 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -1286,11 +1286,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
+0 two
1 one
-2 two
3 three
4 four
set @arg00=0;
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 2c83916e952..a85809d3800 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1287,11 +1287,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
+0 two
1 one
-2 two
3 three
4 four
set @arg00=0;
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 0348d100393..fd1b69c0ffd 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -1329,11 +1329,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
+0 two
1 one
-2 two
3 three
4 four
set @arg00=0;
@@ -4350,11 +4351,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
+0 two
1 one
-2 two
3 three
4 four
set @arg00=0;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 34c86d6c8c6..6cabc24d0eb 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -669,7 +669,7 @@ word
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
-load data infile 'MYSQLTEST_VARDIR/std_data_ln/words.dat' into table t1;
+load data infile 'MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
@@ -1116,12 +1116,13 @@ create procedure `p1`()
begin
select a, f1() from t1;
end//
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
call p1()//
a f1()
1 2
2 2
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET GLOBAL log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
drop procedure p1//
drop function f1//
drop table t1//
@@ -1615,41 +1616,6 @@ id
DROP PROCEDURE proc29856;
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
-Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
-set GLOBAL query_cache_type=1;
-set GLOBAL query_cache_limit=10000;
-set GLOBAL query_cache_min_res_unit=0;
-set GLOBAL query_cache_size= 100000;
-flush tables;
-drop table if exists t1, t2;
-create table t1 (a int);
-create table t2 (a int);
-insert into t1 values (1),(2),(3);
-Locking table T2 with a write lock.
-lock table t2 write;
-Select blocked by write lock.
-select *, (select count(*) from t2) from t1;;
-Sleeing is ok, because selecting should be done very fast.
-Inserting into table T1.
-insert into t1 values (4);
-Unlocking the tables.
-unlock tables;
-Collecting result from previously blocked select.
-Next select should contain 4 rows, as the insert is long finished.
-select *, (select count(*) from t2) from t1;
-a (select count(*) from t2)
-1 0
-2 0
-3 0
-4 0
-reset query cache;
-select *, (select count(*) from t2) from t1;
-a (select count(*) from t2)
-1 0
-2 0
-3 0
-4 0
-drop table t1,t2;
#
# Bug#25132 disabled query cache: Qcache_free_blocks = 1
#
@@ -1690,6 +1656,57 @@ Qcache_hits 1
DROP TABLE t1;
SET GLOBAL concurrent_insert= @save_concurrent_insert;
SET GLOBAL query_cache_size= default;
+DROP TABLE IF EXISTS t1;
+FLUSH STATUS;
+SET GLOBAL query_cache_size=1048576;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+SHOW STATUS LIKE 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+5
+BEGIN;
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+5
+COMMIT;
+SHOW STATUS LIKE 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 2
+SHOW STATUS LIKE "Qcache_hits";
+Variable_name Value
+Qcache_hits 0
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+5
+BEGIN;
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+5
+COMMIT;
+SHOW STATUS LIKE "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+DROP TABLE t1;
+SET GLOBAL query_cache_size= default;
End of 5.0 tests
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
diff --git a/mysql-test/r/query_cache_28249.result b/mysql-test/r/query_cache_28249.result
new file mode 100644
index 00000000000..aed84911032
--- /dev/null
+++ b/mysql-test/r/query_cache_28249.result
@@ -0,0 +1,62 @@
+SET @query_cache_type= @@global.query_cache_type;
+SET @query_cache_limit= @@global.query_cache_limit;
+SET @query_cache_min_res_unit= @@global.query_cache_min_res_unit;
+SET @query_cache_size= @@global.query_cache_size;
+# Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
+# Establish connections user1,user2,user3 (user=root)
+# Switch to connection user1
+SET GLOBAL query_cache_type=1;
+SET GLOBAL query_cache_limit=10000;
+SET GLOBAL query_cache_min_res_unit=0;
+SET GLOBAL query_cache_size= 100000;
+FLUSH TABLES;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+# Switch to connection user2
+LOCK TABLE t2 WRITE;
+# Switch to connection user1
+# "send" the next select, "reap" the result later.
+# The select will be blocked by the write lock on the t1.
+SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
+# Switch to connection user3
+# Poll till the select of connection user1 is blocked by the write lock on t1.
+SELECT user,command,state,info FROM information_schema.processlist
+WHERE state = 'Locked'
+ AND info = 'SELECT *, (SELECT COUNT(*) FROM t2) FROM t1';
+user command state info
+root Query Locked SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
+INSERT INTO t1 VALUES (4);
+# Switch to connection user2
+UNLOCK TABLES;
+# Switch to connection user1
+# Collecting ("reap") the result from the previously blocked select.
+# The printing of the result (varies between 3 and 4 rows) set has to be suppressed.
+# Switch to connection user3
+# The next select enforces that effects of "concurrent_inserts" like the
+# record with a = 4 is missing in result sets can no more happen.
+SELECT 1 FROM t1 WHERE a = 4;
+1
+1
+# Switch to connection user1
+# The next result set must contain 4 rows.
+SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
+a (SELECT COUNT(*) FROM t2)
+1 0
+2 0
+3 0
+4 0
+RESET QUERY CACHE;
+SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
+a (SELECT COUNT(*) FROM t2)
+1 0
+2 0
+3 0
+4 0
+DROP TABLE t1,t2;
+# Switch to connection default + close connections user1,user2,user3
+SET GLOBAL query_cache_type= @query_cache_type;
+SET GLOBAL query_cache_limit= @query_cache_limit;
+SET GLOBAL query_cache_min_res_unit= @query_cache_min_res_unit;
+SET GLOBAL query_cache_size= @query_cache_size;
diff --git a/mysql-test/r/query_cache_notembedded.result b/mysql-test/r/query_cache_notembedded.result
index ec78c2267d2..64bb40f1d17 100644
--- a/mysql-test/r/query_cache_notembedded.result
+++ b/mysql-test/r/query_cache_notembedded.result
@@ -314,6 +314,7 @@ drop procedure f2;
drop procedure f3;
drop procedure f4;
drop table t1;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
reset query cache;
drop function if exists f1;
@@ -346,7 +347,7 @@ id
drop table t1;
drop function f1;
set GLOBAL query_cache_size=0;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
DROP DATABASE IF EXISTS bug30269;
FLUSH STATUS;
CREATE DATABASE bug30269;
diff --git a/mysql-test/r/rpl_init_slave_func.result b/mysql-test/r/rpl_init_slave_func.result
deleted file mode 100644
index 3861f40e7d9..00000000000
--- a/mysql-test/r/rpl_init_slave_func.result
+++ /dev/null
@@ -1,47 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-'#--------------------FN_DYNVARS_037_01-------------------------#'
-SET @@global.init_slave = "SET @a = 10";
-'connect (con1,localhost,root,,)'
-'connection con1'
-SELECT @@global.init_slave;
-@@global.init_slave
-SET @a = 10
-'connection master'
-'#--------------------FN_DYNVARS_037_02-------------------------#'
-'check if value in slave opt file is executed'
-'connection slave'
-show variables like 'init_slave';
-Variable_name Value
-init_slave set global max_connections=500
-show variables like 'max_connections';
-Variable_name Value
-max_connections 500
-reset master;
-'check if value in slave opt file doesnt apply to master'
-'connection master'
-show variables like 'init_slave';
-Variable_name Value
-init_slave SET @a = 10
-show variables like 'max_connections';
-Variable_name Value
-max_connections 151
-'connection slave'
-'try creating a temporary variable in init_slave'
-SET @@global.init_slave = "SET @a=5";
-stop slave;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-SHOW VARIABLES LIKE 'init_slave';
-Variable_name Value
-init_slave SET @a=5
-SELECT @a;
-@a
-NULL
-'Bug#35365 SET statement in init_slave not execute if slave is restarted'
-set global max_connections= default;
diff --git a/mysql-test/r/schema.result b/mysql-test/r/schema.result
index 538abd8d039..564fb3626df 100644
--- a/mysql-test/r/schema.result
+++ b/mysql-test/r/schema.result
@@ -7,6 +7,7 @@ show schemas;
Database
information_schema
foo
+mtr
mysql
test
drop schema foo;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 4b2464af688..0519489b715 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4340,6 +4340,39 @@ Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 6
DROP TABLE t1, t2;
+CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0',
+f2 int(11) NOT NULL default '0',
+f3 bigint(20) NOT NULL default '0',
+f4 varchar(255) NOT NULL default '',
+PRIMARY KEY (f1),
+KEY key1 (f4),
+KEY key2 (f2));
+CREATE TABLE t2 (f1 int(11) NOT NULL default '0',
+f2 enum('A1','A2','A3') NOT NULL default 'A1',
+f3 int(11) NOT NULL default '0',
+PRIMARY KEY (f1),
+KEY key1 (f3));
+CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0',
+f2 datetime NOT NULL default '1980-01-01 00:00:00',
+PRIMARY KEY (f1));
+insert into t1 values (1, 1, 1, 'abc');
+insert into t1 values (2, 1, 2, 'def');
+insert into t1 values (3, 1, 2, 'def');
+insert into t2 values (1, 'A1', 1);
+insert into t3 values (1, '1980-01-01');
+SELECT a.f3, cr.f4, count(*) count
+FROM t2 a
+STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1
+LEFT JOIN
+(t1 cr2
+JOIN t3 ae2 ON cr2.f3 = ae2.f1
+) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND
+cr.f4 = cr2.f4
+GROUP BY a.f3, cr.f4;
+f3 f4 count
+1 abc 1
+1 def 2
+drop table t1, t2, t3;
End of 5.0 tests
create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
@@ -4358,3 +4391,29 @@ a
4
5
DROP TABLE t1;
+CREATE TABLE A (date_key date);
+CREATE TABLE C (
+pk int,
+int_nokey int,
+int_key int,
+date_key date NOT NULL,
+date_nokey date,
+varchar_key varchar(1)
+);
+INSERT INTO C VALUES
+(1,1,1,'0000-00-00',NULL,NULL),
+(1,1,1,'0000-00-00',NULL,NULL);
+SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C);
+1
+SELECT COUNT(DISTINCT 1) FROM C
+WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk;
+COUNT(DISTINCT 1)
+SELECT date_nokey FROM C
+WHERE int_key IN (SELECT 1 FROM A)
+HAVING date_nokey = '10:41:7'
+ORDER BY date_key;
+date_nokey
+Warnings:
+Warning 1292 Incorrect date value: '10:41:7' for column 'date_nokey' at row 1
+DROP TABLE A,C;
+End of 5.1 tests
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index d054e5cdc05..2051939e4b6 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -140,6 +140,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8
Database
information_schema
+mtr
mysql
test
show databases like "test%";
diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result
index ae294f05b25..d7d44061b76 100644
--- a/mysql-test/r/sp-destruct.result
+++ b/mysql-test/r/sp-destruct.result
@@ -84,7 +84,7 @@ drop table t1;
drop function bug14233_1;
drop function bug14233_2;
drop procedure bug14233_3;
-show procedure status;
+show procedure status where db=DATABASE();
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-show function status;
+show function status where db=DATABASE();
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 2f8f71077a6..3def6536897 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1,4 +1,5 @@
drop table if exists t1, t2;
+SELECT * FROM mysql.proc INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/proc.txt';
delete from mysql.proc;
create procedure syntaxerror(t int)|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
@@ -1658,3 +1659,4 @@ begin
declare continue handler for sqlstate '00000' set @x=0;
end$$
ERROR 42000: Bad SQLSTATE: '00000'
+LOAD DATA INFILE '../../tmp/proc.txt' INTO TABLE mysql.proc;
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index cf26f0076d7..66177395ac9 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -142,13 +142,13 @@ use db2;
alter procedure q modifies sql data;
drop procedure q;
use test;
-select type,db,name from mysql.proc;
+select type,db,name from mysql.proc where db like 'db%';
type db name
FUNCTION db1_secret db
PROCEDURE db1_secret stamp
drop database db1_secret;
drop database db2;
-select type,db,name from mysql.proc;
+select type,db,name from mysql.proc where db like 'db%';
type db name
delete from mysql.user where user='user1' or user='user2';
delete from mysql.user where user='' and host='%';
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 6b58b939a07..01ddde56450 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -544,7 +544,7 @@ drop procedure if exists into_outfile|
create procedure into_outfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
-select * into outfile "../tmp/spout" from test.t1;
+select * into outfile "MYSQLTEST_VARDIR/tmp/spout" from test.t1;
insert into test.t1 values (concat(x, "2"), y+2);
end|
call into_outfile("ofile", 1)|
@@ -554,7 +554,7 @@ drop procedure if exists into_dumpfile|
create procedure into_dumpfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
-select * into dumpfile "../tmp/spdump" from test.t1 limit 1;
+select * into dumpfile "MYSQLTEST_VARDIR/tmp/spdump" from test.t1 limit 1;
insert into test.t1 values (concat(x, "2"), y+2);
end|
call into_dumpfile("dfile", 1)|
@@ -1322,7 +1322,7 @@ end;
end if;
end loop;
end latin1 latin1_swedish_ci latin1_swedish_ci
-show procedure status like '%p%'|
+show procedure status where name like '%p%' and db='test'|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test ip PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
test opp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
@@ -1335,7 +1335,7 @@ i p
drop table t3|
drop procedure opp|
drop procedure ip|
-show procedure status like '%p%'|
+show procedure status where name like '%p%' and db='test'|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
drop table if exists t3|
create table t3 ( f bigint unsigned not null )|
@@ -1945,12 +1945,12 @@ drop procedure bug2260|
drop procedure if exists bug2267_1|
create procedure bug2267_1()
begin
-show procedure status;
+show procedure status where db='test';
end|
drop procedure if exists bug2267_2|
create procedure bug2267_2()
begin
-show function status;
+show function status where db='test';
end|
drop procedure if exists bug2267_3|
create procedure bug2267_3()
@@ -1977,7 +1977,7 @@ call bug2267_3()|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug2267_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug2267_1`()
begin
-show procedure status;
+show procedure status where db='test';
end latin1 latin1_swedish_ci latin1_swedish_ci
call bug2267_4()|
Function sql_mode Create Function character_set_client collation_connection Database Collation
@@ -4342,9 +4342,9 @@ drop procedure if exists bug13012|
create procedure bug13012()
BEGIN
REPAIR TABLE t1;
-BACKUP TABLE t1 to '../tmp';
+BACKUP TABLE t1 to '../../tmp';
DROP TABLE t1;
-RESTORE TABLE t1 FROM '../tmp';
+RESTORE TABLE t1 FROM '../../tmp';
END|
call bug13012()|
Table Op Msg_type Msg_text
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result
index 1e758ce68c7..ca815540c29 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -196,7 +196,7 @@ create table db37908.t1(f1 int);
insert into db37908.t1 values(1);
grant usage,execute on test.* to mysqltest_1@localhost;
create procedure proc37908() begin select 1; end |
-create function func37908() returns int sql security invoker
+create function func37908() returns int sql security invoker
return (select * from db37908.t1 limit 1)|
select * from db37908.t1;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
@@ -209,4 +209,31 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table '
drop database db37908;
drop procedure proc37908;
drop function func37908;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+DROP USER mysqltest_1@localhost;
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+CREATE FUNCTION f1() RETURNS INTEGER
+BEGIN
+DECLARE foo INTEGER;
+DECLARE bar INTEGER;
+SET foo=1;
+SET bar=2;
+RETURN foo;
+END $$
+CREATE PROCEDURE p1()
+BEGIN
+SELECT 1;
+END $$
+SELECT f1();
+f1()
+1
+CALL p1();
+1
+1
+SELECT 9;
+9
+9
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/r/status2.result b/mysql-test/r/status2.result
new file mode 100644
index 00000000000..146fb2adbaf
--- /dev/null
+++ b/mysql-test/r/status2.result
@@ -0,0 +1,73 @@
+#
+# Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
+#
+FLUSH STATUS;
+CREATE FUNCTION testQuestion() RETURNS INTEGER
+BEGIN
+DECLARE foo INTEGER;
+DECLARE bar INTEGER;
+SET foo=1;
+SET bar=2;
+RETURN foo;
+END $$
+CREATE PROCEDURE testQuestion2()
+BEGIN
+SELECT 1;
+END $$
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
+DO INSERT INTO t1 VALUES(1);
+Assert Questions == 7
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 7
+SELECT testQuestion();
+testQuestion()
+1
+Assert Questions == 9
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 9
+CALL testQuestion2();
+1
+1
+Assert Questions == 11
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 11
+SELECT 1;
+1
+1
+Assert Questions == 13
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 13
+SELECT 1;
+1
+1
+Assert Questions == 14
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 14
+CREATE TRIGGER trigg1 AFTER INSERT ON t1
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES (1);
+END;
+$$
+Assert Questions == 16
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 16
+INSERT INTO t1 VALUES (1);
+Assert Questions == 18
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 18
+DROP PROCEDURE testQuestion2;
+DROP TRIGGER trigg1;
+DROP FUNCTION testQuestion;
+DROP EVENT ev1;
+DROP TABLE t1,t2;
+End of 6.0 tests
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index a257d0a8648..1255284f4fe 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -1347,6 +1347,13 @@ t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*'
drop table t1;
+CREATE TABLE t3 (f1 INT) COMMENT 'כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן';
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן'
+DROP TABLE t3;
set sql_mode= 'traditional';
create table t1(col1 tinyint, col2 tinyint unsigned,
col3 smallint, col4 smallint unsigned,
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index c1c81847b13..aff26454b2d 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -1658,9 +1658,9 @@ SELECT DISTINCT (SELECT a) FROM t1 LIMIT 100;
DROP TABLE t1;
create table t1 (a int, b decimal(13, 3));
insert into t1 values (1, 0.123);
-select a, (select max(b) from t1) into outfile "subselect.out.file.1" from t1;
+select a, (select max(b) from t1) into outfile "../../tmp/subselect.out.file.1" from t1;
delete from t1;
-load data infile "subselect.out.file.1" into table t1;
+load data infile "../../tmp/subselect.out.file.1" into table t1;
select * from t1;
a b
1 0.123
@@ -4478,4 +4478,40 @@ WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
DELETE FROM v3;
DROP VIEW v1,v2,v3;
DROP TABLE t1,t2;
+#
+# BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result
+#
+create table t1(id integer primary key, g integer, v integer, s char(1));
+create table t2(id integer primary key, g integer, v integer, s char(1));
+insert into t1 values
+(10, 10, 10, 'l'),
+(20, 20, 20, 'l'),
+(40, 40, 40, 'l'),
+(41, 40, null, 'l'),
+(50, 50, 50, 'l'),
+(51, 50, null, 'l'),
+(60, 60, 60, 'l'),
+(61, 60, null, 'l'),
+(70, 70, 70, 'l'),
+(90, 90, null, 'l');
+insert into t2 values
+(10, 10, 10, 'r'),
+(30, 30, 30, 'r'),
+(50, 50, 50, 'r'),
+(60, 60, 60, 'r'),
+(61, 60, null, 'r'),
+(70, 70, 70, 'r'),
+(71, 70, null, 'r'),
+(80, 80, 80, 'r'),
+(81, 80, null, 'r'),
+(100,100,null, 'r');
+select *
+from t1
+where v in(select v
+from t2
+where t1.g=t2.g) is unknown;
+id g v s
+51 50 NULL l
+61 60 NULL l
+drop table t1, t2;
End of 5.1 tests.
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index b15ec9dbe4e..e0f361a0f4f 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -795,6 +795,60 @@ WHERE INNR.varchar_key > 'n{'
);
varchar_nokey
DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2), (11);
+# 2nd and 3rd columns should be same
+SELECT a, ROW(11, 12) = (SELECT a, 22), ROW(11, 12) IN (SELECT a, 22) FROM t1 GROUP BY t1.a;
+a ROW(11, 12) = (SELECT a, 22) ROW(11, 12) IN (SELECT a, 22)
+1 0 0
+2 0 0
+11 0 0
+SELECT a, ROW(11, 12) = (SELECT a, 12), ROW(11, 12) IN (SELECT a, 12) FROM t1 GROUP BY t1.a;
+a ROW(11, 12) = (SELECT a, 12) ROW(11, 12) IN (SELECT a, 12)
+1 0 0
+2 0 0
+11 1 1
+SELECT a, ROW(11, 12) = (SELECT a, 22), ROW(11, 12) IN (SELECT a, 22) FROM t1;
+a ROW(11, 12) = (SELECT a, 22) ROW(11, 12) IN (SELECT a, 22)
+1 0 0
+2 0 0
+11 0 0
+SELECT a, ROW(11, 12) = (SELECT a, 12), ROW(11, 12) IN (SELECT a, 12) FROM t1;
+a ROW(11, 12) = (SELECT a, 12) ROW(11, 12) IN (SELECT a, 12)
+1 0 0
+2 0 0
+11 1 1
+SELECT a AS x, ROW(11, 12) = (SELECT MAX(x), 22), ROW(11, 12) IN (SELECT MAX(x), 22) FROM t1;
+x ROW(11, 12) = (SELECT MAX(x), 22) ROW(11, 12) IN (SELECT MAX(x), 22)
+1 0 0
+2 0 0
+11 0 0
+# 2nd and 3rd columns should be same for x == 11 only
+SELECT a AS x, ROW(11, 12) = (SELECT MAX(x), 12), ROW(11, 12) IN (SELECT MAX(x), 12) FROM t1;
+x ROW(11, 12) = (SELECT MAX(x), 12) ROW(11, 12) IN (SELECT MAX(x), 12)
+1 0 1
+2 0 1
+11 1 1
+DROP TABLE t1;
+# both columns should be same
+SELECT ROW(1,2) = (SELECT NULL, NULL), ROW(1,2) IN (SELECT NULL, NULL);
+ROW(1,2) = (SELECT NULL, NULL) ROW(1,2) IN (SELECT NULL, NULL)
+NULL NULL
+SELECT ROW(1,2) = (SELECT 1, NULL), ROW(1,2) IN (SELECT 1, NULL);
+ROW(1,2) = (SELECT 1, NULL) ROW(1,2) IN (SELECT 1, NULL)
+NULL NULL
+SELECT ROW(1,2) = (SELECT NULL, 2), ROW(1,2) IN (SELECT NULL, 2);
+ROW(1,2) = (SELECT NULL, 2) ROW(1,2) IN (SELECT NULL, 2)
+NULL NULL
+SELECT ROW(1,2) = (SELECT NULL, 1), ROW(1,2) IN (SELECT NULL, 1);
+ROW(1,2) = (SELECT NULL, 1) ROW(1,2) IN (SELECT NULL, 1)
+0 0
+SELECT ROW(1,2) = (SELECT 1, 1), ROW(1,2) IN (SELECT 1, 1);
+ROW(1,2) = (SELECT 1, 1) ROW(1,2) IN (SELECT 1, 1)
+0 0
+SELECT ROW(1,2) = (SELECT 1, 2), ROW(1,2) IN (SELECT 1, 2);
+ROW(1,2) = (SELECT 1, 2) ROW(1,2) IN (SELECT 1, 2)
+1 1
End of 5.0 tests
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 03bdeaceb58..245dcec04da 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -147,16 +147,16 @@ CREATE TABLE t1 (a INT) ENGINE MYISAM;
DROP TABLE t1;
End of 5.0 tests
CREATE TABLE t1(a INT)
-INDEX DIRECTORY='TEST_DIR/master-data/mysql';
+INDEX DIRECTORY='MYSQLD_DATADIR/mysql';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT)
-DATA DIRECTORY='TEST_DIR/master-data/test';
+DATA DIRECTORY='MYSQLD_DATADIR/test';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT)
-DATA DIRECTORY='TEST_DIR/master-data/';
+DATA DIRECTORY='MYSQLD_DATADIR/';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT)
-INDEX DIRECTORY='TEST_DIR/master-data';
+INDEX DIRECTORY='MYSQLD_DATADIR';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT)
INDEX DIRECTORY='TEST_DIR/master-data_var';
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 171b53ebf09..0106c9459e7 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -1,4 +1,3 @@
-drop table if exists t1,t1aa,t2aa;
show tables;
Tables_in_db
columns_priv
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index 6df09463d02..ba6b9f81a2d 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -194,4 +194,20 @@ DELETE FROM t1;
SELECT * FROM t1;
a b
DROP TABLE t1;
+DROP TABLE IF EXISTS t1,t2;
+DROP FUNCTION IF EXISTS f1;
+CREATE TEMPORARY TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 LIKE t1;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+return 1;
+END|
+INSERT INTO t2 SELECT * FROM t1;
+INSERT INTO t1 SELECT f1();
+CREATE TABLE t3 SELECT * FROM t1;
+INSERT INTO t1 SELECT f1();
+UPDATE t1,t2 SET t1.a = t2.a;
+INSERT INTO t2 SELECT f1();
+DROP TABLE t1,t2,t3;
+DROP FUNCTION f1;
End of 5.1 tests
diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result
index ed15172a0e9..2948bb8ecec 100644
--- a/mysql-test/r/timezone2.result
+++ b/mysql-test/r/timezone2.result
@@ -269,6 +269,7 @@ select * from t1;
convert_tz(NULL, NULL, NULL)
NULL
drop table t1;
+SET @old_log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (ldt datetime, udt datetime);
create function f1(i datetime) returns datetime
@@ -284,7 +285,7 @@ ldt ldt2
2006-04-19 16:30:00 2006-04-19 16:30:00
drop table t1;
drop function f1;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (t TIMESTAMP);
INSERT INTO t1 VALUES (NULL), (NULL);
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 35d5134fa6b..2290919f191 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -406,13 +406,13 @@ create table t1 (i int, j int, k int);
create trigger trg1 before insert on t1 for each row set new.k = new.i;
create trigger trg2 after insert on t1 for each row set @b:= "Fired";
set @b:="";
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, i);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, i);
select *, @b from t1;
i j k @b
10 NULL 10 Fired
15 NULL 15 Fired
set @b:="";
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
select *, @b from t1;
i j k @b
10 NULL 10 Fired
@@ -449,7 +449,7 @@ ERROR 42S22: Unknown column 'at' in 'OLD'
select * from t1;
i k
1 1
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
ERROR 42S22: Unknown column 'at' in 'NEW'
select * from t1;
i k
@@ -524,7 +524,7 @@ select * from t1;
i k
1 1
2 2
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
ERROR 42S22: Unknown column 'bt' in 'NEW'
select * from t1;
i k
@@ -997,7 +997,7 @@ insert into t1 (a) values
create trigger t2_ai after insert on t2 for each row
set @a:= (select max(a) from t2);
insert into t2 select * from t1;
-load data infile '../std_data_ln/words.dat' into table t1 (a);
+load data infile '../../std_data/words.dat' into table t1 (a);
drop trigger t1_ai;
drop trigger t2_ai;
create function f1() returns int return (select max(b) from t1);
@@ -1006,7 +1006,7 @@ insert into t1 values
("And",f1()),("the",f1()),("mome", f1()),("raths",f1()),("outgrabe",f1());
create function f2() returns int return (select max(b) from t2);
insert into t2 select a, f2() from t1;
-load data infile '../std_data_ln/words.dat' into table t1 (a) set b:= f1();
+load data infile '../../std_data/words.dat' into table t1 (a) set b:= f1();
drop function f1;
drop function f2;
drop table t1, t2;
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index 782cddaeff7..b831771d9c5 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -708,6 +708,47 @@ HEX(b1) HEX(b2) i2
1 0 100
1 0 200
DROP TABLE t1, t2;
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b'10',
+f2 bit(14) NOT NULL default b'11110000111100'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` bit(2) NOT NULL DEFAULT b'10',
+ `f2` bit(14) NOT NULL DEFAULT b'11110000111100'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
+DROP TABLE t1;
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+ERROR 42000: Invalid default value for 'f1'
+create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(7)) engine=MyISAM;
+insert into t1bit7 values (b'1100000');
+insert into t1bit7 values (b'1100001');
+insert into t1bit7 values (b'1100010');
+insert into t2bit7 values (b'1100001');
+insert into t2bit7 values (b'1100010');
+insert into t2bit7 values (b'1100110');
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+bin(a1)
+1100001
+1100010
+drop table t1bit7, t2bit7;
+create table t1bit7 (a1 bit(15) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(15)) engine=MyISAM;
+insert into t1bit7 values (b'110000011111111');
+insert into t1bit7 values (b'110000111111111');
+insert into t1bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110000111111111');
+insert into t2bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110011011111111');
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+bin(a1)
+110000111111111
+110001011111111
+drop table t1bit7, t2bit7;
End of 5.0 tests
create table t1(a bit(7));
insert into t1 values(0x40);
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index 90857269c5c..a80adab1f87 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -507,25 +507,25 @@ Warnings:
Warning 1101 BLOB/TEXT column 'imagem' can't have a default value
insert into t1 (id) values (1);
select
-charset(load_file('../std_data_ln/words.dat')),
-collation(load_file('../std_data_ln/words.dat')),
-coercibility(load_file('../std_data_ln/words.dat'));
-charset(load_file('../std_data_ln/words.dat')) collation(load_file('../std_data_ln/words.dat')) coercibility(load_file('../std_data_ln/words.dat'))
+charset(load_file('../../std_data/words.dat')),
+collation(load_file('../../std_data/words.dat')),
+coercibility(load_file('../../std_data/words.dat'));
+charset(load_file('../../std_data/words.dat')) collation(load_file('../../std_data/words.dat')) coercibility(load_file('../../std_data/words.dat'))
binary binary 4
explain extended select
-charset(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat')),
-collation(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat')),
-coercibility(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat'));
+charset(load_file('MYSQLTEST_VARDIR/std_data/words.dat')),
+collation(load_file('MYSQLTEST_VARDIR/std_data/words.dat')),
+coercibility(load_file('MYSQLTEST_VARDIR/std_data/words.dat'));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select charset(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat')) AS `charset(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat'))`,collation(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat')) AS `collation(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat'))`,coercibility(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat')) AS `coercibility(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat'))`
-update t1 set imagem=load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat') where id=1;
+Note 1003 select charset(load_file('MYSQLTEST_VARDIR/std_data/words.dat')) AS `charset(load_file('MYSQLTEST_VARDIR/std_data/words.dat'))`,collation(load_file('MYSQLTEST_VARDIR/std_data/words.dat')) AS `collation(load_file('MYSQLTEST_VARDIR/std_data/words.dat'))`,coercibility(load_file('MYSQLTEST_VARDIR/std_data/words.dat')) AS `coercibility(load_file('MYSQLTEST_VARDIR/std_data/words.dat'))`
+update t1 set imagem=load_file('MYSQLTEST_VARDIR/std_data/words.dat') where id=1;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
if(imagem is null, "ERROR", "OK") length(imagem)
OK 581
drop table t1;
-create table t1 select load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat') l;
+create table t1 select load_file('MYSQLTEST_VARDIR/std_data/words.dat') l;
show full fields from t1;
Field Type Collation Null Key Default Extra Privileges Comment
l longblob NULL YES NULL #
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 7cb71831bce..f96e07b0c5e 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -65,12 +65,15 @@ CREATE TABLE t1(AFIELD INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(GMT VARCHAR(32));
INSERT INTO t2 VALUES('GMT-0800');
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
-DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
+FROM t1, t2 GROUP BY t1.AFIELD;
+DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800
INSERT INTO t1 VALUES(1);
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
-DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)),
+DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
+FROM t1,t2 GROUP BY t1.AFIELD;
+DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800 Wed, 06 March 2002 10:11:12 GMT-0800
drop table t1,t2;
CREATE TABLE t1 (f1 time default NULL, f2 time default NULL);
@@ -155,7 +158,7 @@ str_to_date( '', a )
0000-00-00 00:00:00
NULL
DROP TABLE t1;
-CREATE TABLE t1 (a DATE, b int, PRIMARY KEY (a,b));
+CREATE TABLE t1 (a DATE, b INT, PRIMARY KEY (a,b));
INSERT INTO t1 VALUES (DATE(NOW()), 1);
SELECT COUNT(*) FROM t1 WHERE a = NOW();
COUNT(*)
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index 6fbc8268a64..d4cfd1c04ed 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -392,4 +392,13 @@ f1 + 0e0
1.0000000150475e+30
-1.0000000150475e+30
drop table t1;
+create table t1(d double, u bigint unsigned);
+insert into t1(d) values (9.22337203685479e18),
+(1.84e19);
+update t1 set u = d;
+select u from t1;
+u
+9223372036854790144
+18400000000000000000
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 596dcbf432c..91938771ee3 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -492,6 +492,7 @@ a b c
5 NULL 2001-09-09 04:46:59
6 NULL 2006-06-06 06:06:06
drop table t1;
+End of 4.1 tests
set time_zone= @@global.time_zone;
CREATE TABLE t1 (
`id` int(11) NOT NULL auto_increment,
@@ -508,3 +509,21 @@ select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and COL
is_nullable
NO
drop table t1;
+CREATE TABLE t1 ( f1 INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+f2 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+f3 TIMESTAMP);
+INSERT INTO t1 (f2,f3) VALUES (NOW(), "0000-00-00 00:00:00");
+INSERT INTO t1 (f2,f3) VALUES (NOW(), NULL);
+INSERT INTO t1 (f2,f3) VALUES (NOW(), ASCII(NULL));
+INSERT INTO t1 (f2,f3) VALUES (NOW(), FROM_UNIXTIME('9999999999'));
+INSERT INTO t1 (f2,f3) VALUES (NOW(), TIME(NULL));
+UPDATE t1 SET f2=NOW(), f3=FROM_UNIXTIME('9999999999') WHERE f1=1;
+SELECT f1,f2-f3 FROM t1;
+f1 f2-f3
+1 0
+2 0
+3 0
+4 0
+5 0
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result
index 3a7d59798ae..05efea79fe7 100644
--- a/mysql-test/r/user_var-binlog.result
+++ b/mysql-test/r/user_var-binlog.result
@@ -22,7 +22,7 @@ SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/;
use test/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 2d91835d723..8961a935006 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -399,4 +399,9 @@ select @lastid != id, @lastid, @lastid := id from t1;
0 3 3
1 3 4
drop table t1;
+CREATE TABLE t1 (i INT);
+CREATE TRIGGER t_after_insert AFTER INSERT ON t1 FOR EACH ROW SET @bug42188 = 10;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/variables-notembedded.result b/mysql-test/r/variables-notembedded.result
index 571b6605674..c9125bcee90 100644
--- a/mysql-test/r/variables-notembedded.result
+++ b/mysql-test/r/variables-notembedded.result
@@ -15,6 +15,7 @@ slave_skip_errors 3,100,137,643,1752
---- Clean Up ----
set global slave_net_timeout=default;
set global sql_slave_skip_counter= 0;
+set @@global.slave_net_timeout= @my_slave_net_timeout;
#
SHOW VARIABLES like 'log_slave_updates';
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index ac78d8e1871..d3b3a6f2663 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -15,6 +15,7 @@ set @my_max_heap_table_size =@@global.max_heap_table_size;
set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads;
set @my_max_join_size =@@global.max_join_size;
set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size;
+set @my_myisam_max_sort_file_size =@@global.myisam_max_sort_file_size;
set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout;
set @my_net_read_timeout =@@global.net_read_timeout;
@@ -25,6 +26,7 @@ set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time;
set @my_storage_engine =@@global.storage_engine;
set @my_thread_cache_size =@@global.thread_cache_size;
+set @my_max_allowed_packet =@@global.max_allowed_packet;
set @`test`=1;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
@test @`test` @TEST @`TEST` @"teSt"
@@ -975,7 +977,7 @@ set global delayed_queue_size =@my_delayed_queue_size;
set global flush =@my_flush;
set global flush_time =@my_flush_time;
set global key_buffer_size =@my_key_buffer_size;
-set global max_binlog_cache_size =default;
+set global max_binlog_cache_size =@my_max_binlog_cache_size;
set global max_binlog_size =@my_max_binlog_size;
set global max_connect_errors =@my_max_connect_errors;
set global max_connections =@my_max_connections;
@@ -986,6 +988,7 @@ set global max_join_size =@my_max_join_size;
set global max_user_connections =default;
set global max_write_lock_count =default;
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
+set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size;
set global net_buffer_length =@my_net_buffer_length;
set global net_write_timeout =@my_net_write_timeout;
set global net_read_timeout =@my_net_read_timeout;
@@ -996,6 +999,7 @@ set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
set global storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size;
+set global max_allowed_packet =@my_max_allowed_packet;
show global variables where Variable_name='table_definition_cache' or
Variable_name='table_lock_wait_timeout';
Variable_name Value
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 2fefa21eaca..38d05ae84fe 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1314,7 +1314,7 @@ drop view v2, v1;
drop table t1;
create table t1 (a int, b char(10));
create view v1 as select * from t1 where a != 0 with check option;
-load data infile '../std_data_ln/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
ERROR HY000: CHECK OPTION failed 'test.v1'
select * from t1;
a b
@@ -1325,7 +1325,7 @@ a b
1 row 1
2 row 2
delete from t1;
-load data infile '../std_data_ln/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
Error 1369 CHECK OPTION failed 'test.v1'
@@ -1345,14 +1345,14 @@ drop view v1;
drop table t1;
create table t1 (a text, b text);
create view v1 as select * from t1 where a <> 'Field A' with check option;
-load data infile '../std_data_ln/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
ERROR HY000: CHECK OPTION failed 'test.v1'
select concat('|',a,'|'), concat('|',b,'|') from t1;
concat('|',a,'|') concat('|',b,'|')
select concat('|',a,'|'), concat('|',b,'|') from v1;
concat('|',a,'|') concat('|',b,'|')
delete from t1;
-load data infile '../std_data_ln/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
Warnings:
Error 1369 CHECK OPTION failed 'test.v1'
Warning 1261 Row 2 doesn't contain data for all columns
diff --git a/mysql-test/r/wait_timeout.result b/mysql-test/r/wait_timeout.result
index 6fbff82f908..adb7d6bafd9 100644
--- a/mysql-test/r/wait_timeout.result
+++ b/mysql-test/r/wait_timeout.result
@@ -1,20 +1,33 @@
-select 0;
-0
-0
-flush status;
-select 1;
+SET @@global.wait_timeout= 2;
+disconnect default;
+connection wait_con;
+connection default;
+--disable_reconnect;
+SELECT 1;
1
1
-select 2;
+connection wait_con;
+connection default;
+SELECT 2;
Got one of the listed errors
-select 3;
+--enable_reconnect;
+SELECT 3;
3
3
-select 1;
+disconnection default;
+connection wait_con;
+connection con1;
+--disable_reconnect;
+SELECT 1;
1
1
-select 2;
+connection wait_con;
+connection con1;
+SELECT 2;
Got one of the listed errors
-select 3;
+--enable_reconnect;
+SELECT 3;
3
3
+SET @@global.wait_timeout= <start_value>;
+disconnection con1;
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 090ac1340ea..19d95acd5c1 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -70,7 +70,7 @@ select @@warning_count;
1
drop table t1;
create table t1(a tinyint, b int not null, c date, d char(5));
-load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
+load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
Warnings:
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 3
@@ -98,7 +98,8 @@ Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'c' at row 2
alter table t1 add d char(2);
update t1 set a=NULL where a=10;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning 1048 Column 'a' cannot be null
update t1 set c='mysql ab' where c='test';
Warnings:
Warning 1265 Data truncated for column 'c' at row 4
diff --git a/mysql-test/r/warnings_engine_disabled.result b/mysql-test/r/warnings_engine_disabled.result
index aa6170a60a7..e5d35fdaa5f 100644
--- a/mysql-test/r/warnings_engine_disabled.result
+++ b/mysql-test/r/warnings_engine_disabled.result
@@ -1,7 +1,15 @@
create table t1 (id int) engine=NDB;
Warnings:
+Warning 1286 Unknown table engine 'NDB'
Warning 1266 Using storage engine MyISAM for table 't1'
alter table t1 engine=NDB;
Warnings:
-Warning 1266 Using storage engine MyISAM for table 't1'
+Warning 1286 Unknown table engine 'NDB'
drop table t1;
+SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster';
+ENGINE SUPPORT
+ndbcluster NO
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE
+PLUGIN_NAME='ndbcluster';
+PLUGIN_NAME PLUGIN_STATUS
+ndbcluster DISABLED
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index 56c884343e3..404b0dc3789 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -1029,4 +1029,39 @@ SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
1
1
DROP TABLE t1;
+SET @xml=
+'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title> Title - document with document declaration</title>
+ </head>
+ <body> Hi, Im a webpage with document a declaration </body>
+</html>';
+SELECT ExtractValue(@xml, 'html/head/title');
+ExtractValue(@xml, 'html/head/title')
+ Title - document with document declaration
+SELECT ExtractValue(@xml, 'html/body');
+ExtractValue(@xml, 'html/body')
+ Hi, Im a webpage with document a declaration
+SELECT ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml');
+ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml')
+NULL
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 11: STRING unexpected ('>' wanted)'
+SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml');
+ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml')
+NULL
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 17: STRING unexpected ('>' wanted)'
+set @x=10;
+select extractvalue('<a></a>','$@x/a');
+ERROR HY000: XPATH syntax error: '/a'
+select extractvalue('<a></a>','round(123.4)/a');
+ERROR HY000: XPATH syntax error: '/a'
+select extractvalue('<a></a>','1/a');
+ERROR HY000: XPATH syntax error: '/a'
+select extractvalue('<a></a>','"b"/a');
+ERROR HY000: XPATH syntax error: '/a'
+select extractvalue('<a></a>','(1)/a');
+ERROR HY000: XPATH syntax error: '/a'
End of 5.1 tests
diff --git a/mysql-test/resolve-stack b/mysql-test/resolve-stack
deleted file mode 100755
index cdbe362c752..00000000000
--- a/mysql-test/resolve-stack
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /bin/sh
-# A shortcut for resolving stacks when debugging when
-# we cannot duplicate the crash in a debugger and have to
-# resort to using stack traces
-
-nm --numeric-sort ../sql/mysqld > var/tmp/mysqld.sym
-echo "Please type or paste the numeric stack trace,Ctrl-C to quit:"
-../extra/resolve_stack_dump -s var/tmp/mysqld.sym
diff --git a/mysql-test/std_data/bug40482-bin.000001 b/mysql-test/std_data/bug40482-bin.000001
new file mode 100644
index 00000000000..d001bf664c7
--- /dev/null
+++ b/mysql-test/std_data/bug40482-bin.000001
Binary files differ
diff --git a/mysql-test/std_data/cacert.pem b/mysql-test/std_data/cacert.pem
index b445e77d7c4..5473e4b153e 100644
--- a/mysql-test/std_data/cacert.pem
+++ b/mysql-test/std_data/cacert.pem
@@ -1,17 +1,17 @@
-----BEGIN CERTIFICATE-----
-MIICrTCCAhagAwIBAgIJAIAO/Ybiptv1MA0GCSqGSIb3DQEBBAUAMEQxCzAJBgNV
+MIICrTCCAhagAwIBAgIJAJXpePU0UOTVMA0GCSqGSIb3DQEBBQUAMEQxCzAJBgNV
BAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxhMREwDwYD
-VQQKEwhNeVNRTCBBQjAeFw0wNjA1MDMwODQ4NTRaFw0wOTAxMjcwODQ4NTRaMEQx
+VQQKEwhNeVNRTCBBQjAeFw0wOTAxMjgxMDQ5NDZaFw0xNDAxMjcxMDQ5NDZaMEQx
CzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxh
MREwDwYDVQQKEwhNeVNRTCBBQjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
-+C46EQl1u7tQ6gb9eqc8V079gr8YmDPCEqtjO8bCIbchpjOpDITx0WZz36Sn9E72
-GPJwNip4FxLaPRIA3xNQHM5cE5U53qznlRx1Fc4O3hcWCvyCqNDl/vzPAh3pI6Bl
-Ku9hfHXpp93W812smVPe9haShEXGgbEPYGzvOfVdu/MCAwEAAaOBpjCBozAdBgNV
-HQ4EFgQUjIy/6OCTmqtPHBFha6/qzVk3yTcwdAYDVR0jBG0wa4AUjIy/6OCTmqtP
-HBFha6/qzVk3yTehSKRGMEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxh
-MRAwDgYDVQQHEwdVcHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAIAO/Ybiptv1
-MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEA8lD9zyB820Oq1aj7ZafX
-De/hbdt9RIl2tzgw2K3r1KZGdXJVL0vSt5fZ51Nq9lg7OPJy3iXf+caBJEp0IJpB
-uf4Gfr6zfXw+UlY6ZthRtHQHoXKcbskECjH5/ps/Uaa+dpVQ9O+Ii1rPzmgo6ztM
-s+xZ46ESBt4WiHXm8kwbU9Y=
+4XQHAe5R1+TXC8noZtWf+d5E0v1C59FWpn9SWEUCBjE5UiIwuJvi4Y+7xWGOXLAI
+/JzJx5gNXLBiTsE/zh0uX9fKlajLhxB0GN+QU0ZlpQ1BeYipEcNXeI/7cT499f6v
+XWabnTflivdCgHSWUOQ20/Lzs6kP6/e6OoZd/DPSjPECAwEAAaOBpjCBozAdBgNV
+HQ4EFgQU8uLqVWWkmuKsnZf1RWz294wRrd8wdAYDVR0jBG0wa4AU8uLqVWWkmuKs
+nZf1RWz294wRrd+hSKRGMEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxh
+MRAwDgYDVQQHEwdVcHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAJXpePU0UOTV
+MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAMMTE5sDN+Z0ZlV7KvH3g
+6+aKvql8dTpRT3hYukeQlWua0nq74WPGVw0c4e/M/vbiMwmJcCYpB9pd4+dHqzSw
+aPyoenjY6UF8n7B4quWy3SIUk2LSHeJLW+kzJn2afN9gvipFhdVh/uU2TIyLGOur
+Z/vmJX2W7hF1uqPnbfa8Lrw=
-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/client-cert.pem b/mysql-test/std_data/client-cert.pem
index fdd5c86a23f..9300520793e 100644
--- a/mysql-test/std_data/client-cert.pem
+++ b/mysql-test/std_data/client-cert.pem
@@ -1,42 +1,55 @@
Certificate:
Data:
- Version: 1 (0x0)
- Serial Number: 1 (0x1)
- Signature Algorithm: md5WithRSAEncryption
+ Version: 3 (0x2)
+ Serial Number: 3 (0x3)
+ Signature Algorithm: sha1WithRSAEncryption
Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
Validity
- Not Before: May 3 08:55:39 2006 GMT
- Not After : Jan 27 08:55:39 2009 GMT
- Subject: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com
+ Not Before: Jan 28 11:04:39 2009 GMT
+ Not After : Jan 28 11:04:39 2010 GMT
+ Subject: C=SE, ST=Uppsala, O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (512 bit)
Modulus (512 bit):
- 00:d8:db:68:28:49:84:4d:d6:0f:5c:bc:3d:9a:ab:
- 70:d5:3e:f5:b5:17:ba:ef:e1:f8:87:54:30:22:1f:
- 81:07:bf:f9:24:7f:8a:54:10:e9:5f:e6:99:50:04:
- d4:3b:55:a9:f1:52:ad:12:2b:5a:da:5c:be:8c:3e:
- 5b:9e:b0:5a:19
+ 00:e1:52:30:2c:d9:be:64:28:91:5d:7a:fd:d9:e9:
+ 14:35:7a:d2:94:4e:91:46:e0:db:9f:6b:79:f4:4c:
+ ac:6e:07:61:34:86:74:62:a7:a8:44:af:fa:87:87:
+ a8:7d:42:61:ff:ab:50:d4:7b:bf:75:fa:d5:d5:b3:
+ 74:fb:56:1e:37
Exponent: 65537 (0x10001)
- Signature Algorithm: md5WithRSAEncryption
- 07:57:bf:07:92:c2:8e:86:24:6b:0a:bf:e5:31:21:44:c3:60:
- 02:a6:ac:9e:f7:db:7a:6e:fc:4f:d4:7b:54:18:80:47:d2:4a:
- 63:0e:e3:f8:af:6e:58:e3:97:5a:2b:82:5d:76:20:d1:33:a0:
- f5:43:a1:d1:51:f4:ca:c8:b3:1a:66:4e:0e:55:df:d2:e8:fa:
- 83:18:42:f5:ec:66:40:f0:39:e8:f9:d7:cf:f6:dd:e4:7b:69:
- dd:0c:92:d8:52:95:43:6f:29:3d:f0:8d:4c:dd:52:ea:6b:a0:
- 39:0f:dc:59:a7:5c:37:6b:8b:05:44:b7:69:ea:a3:58:e0:4e:
- ce:d6
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ X509v3 Subject Key Identifier:
+ 58:30:B5:9B:2C:05:94:06:BA:3D:3C:F0:B2:CD:1D:67:65:E3:7F:85
+ X509v3 Authority Key Identifier:
+ keyid:F2:E2:EA:55:65:A4:9A:E2:AC:9D:97:F5:45:6C:F6:F7:8C:11:AD:DF
+ DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
+ serial:95:E9:78:F5:34:50:E4:D5
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 05:19:e3:13:14:fc:c5:28:bf:69:f8:00:b3:25:cb:bd:ca:9f:
+ 2f:4c:b3:a8:04:11:f0:74:27:bd:82:2c:b4:49:9b:a7:59:f0:
+ f7:87:d1:e0:ba:99:a2:fe:4b:1d:10:6f:e4:a2:b3:cd:7f:8b:
+ 68:31:46:ee:cd:9e:e2:47:e1:4c:fa:74:d1:e2:8b:cc:a0:4b:
+ a8:24:d1:a4:c3:6b:2a:c6:28:cd:41:e0:06:48:e6:cf:f2:3c:
+ ca:37:95:d7:29:64:6b:91:91:83:e7:ac:c8:0b:87:bc:da:a6:
+ aa:f1:44:43:c8:74:7b:15:26:91:2e:03:c4:71:50:6c:f8:68:
+ dc:8c
-----BEGIN CERTIFICATE-----
-MIIB5jCCAU8CAQEwDQYJKoZIhvcNAQEEBQAwRDELMAkGA1UEBhMCU0UxEDAOBgNV
-BAgTB1VwcHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFC
-MB4XDTA2MDUwMzA4NTUzOVoXDTA5MDEyNzA4NTUzOVowdzELMAkGA1UEBhMCU0Ux
-EDAOBgNVBAgTB1VwcHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15
-U1FMIEFCMTEwLwYJKoZIhvcNAQkBFiJhYnN0cmFjdC5teXNxbC5kZXZlbG9wZXJA
-bXlzcWwuY29tMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANjbaChJhE3WD1y8PZqr
-cNU+9bUXuu/h+IdUMCIfgQe/+SR/ilQQ6V/mmVAE1DtVqfFSrRIrWtpcvow+W56w
-WhkCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAHV78HksKOhiRrCr/lMSFEw2ACpqye
-99t6bvxP1HtUGIBH0kpjDuP4r25Y45daK4JddiDRM6D1Q6HRUfTKyLMaZk4OVd/S
-6PqDGEL17GZA8Dno+dfP9t3ke2ndDJLYUpVDbyk98I1M3VLqa6A5D9xZp1w3a4sF
-RLdp6qNY4E7O1g==
+MIICfzCCAeigAwIBAgIBAzANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ
+MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
+UUwgQUIwHhcNMDkwMTI4MTEwNDM5WhcNMTAwMTI4MTEwNDM5WjBlMQswCQYDVQQG
+EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxMTAvBgkq
+hkiG9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wXDAN
+BgkqhkiG9w0BAQEFAANLADBIAkEA4VIwLNm+ZCiRXXr92ekUNXrSlE6RRuDbn2t5
+9EysbgdhNIZ0YqeoRK/6h4eofUJh/6tQ1Hu/dfrV1bN0+1YeNwIDAQABo4GjMIGg
+MAkGA1UdEwQCMAAwHQYDVR0OBBYEFFgwtZssBZQGuj088LLNHWdl43+FMHQGA1Ud
+IwRtMGuAFPLi6lVlpJrirJ2X9UVs9veMEa3foUikRjBEMQswCQYDVQQGEwJTRTEQ
+MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
+UUwgQUKCCQCV6Xj1NFDk1TANBgkqhkiG9w0BAQUFAAOBgQAFGeMTFPzFKL9p+ACz
+Jcu9yp8vTLOoBBHwdCe9giy0SZunWfD3h9Hgupmi/ksdEG/korPNf4toMUbuzZ7i
+R+FM+nTR4ovMoEuoJNGkw2sqxijNQeAGSObP8jzKN5XXKWRrkZGD56zIC4e82qaq
+8URDyHR7FSaRLgPEcVBs+GjcjA==
-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/client-key.pem b/mysql-test/std_data/client-key.pem
index 22f8e23ab2a..9ef464d0875 100644
--- a/mysql-test/std_data/client-key.pem
+++ b/mysql-test/std_data/client-key.pem
@@ -1,9 +1,9 @@
-----BEGIN RSA PRIVATE KEY-----
-MIIBOgIBAAJBANjbaChJhE3WD1y8PZqrcNU+9bUXuu/h+IdUMCIfgQe/+SR/ilQQ
-6V/mmVAE1DtVqfFSrRIrWtpcvow+W56wWhkCAwEAAQJAK27WT6tZylUjQomZNQ89
-TBiOEbUtBbqWklQ0R8FTkH9uKV+8KYQ+k+tMkoAEGFfChB0YfofNQ2KZYWWw4yOB
-WQIhAPXXDQt73aou10s+cmKM3C3WzLmIZtrvm9wNBXWDGxgTAiEA4dG4cXrZfa1M
-TTbjzNU1/Jf50/M8SvZDWMPQWxJ8oqMCIH6zBpYUkHlVCsBMvsbrsc4uFfTIx7mu
-I7WVQGr/1sbhAiBf4uFirjtztgZUMx5/d3k5DH80lG/hlLf8FQl/4lWx6QIhAPHw
-CXfPUbUFl4r/i9Br5+exGol50qX4F3aP5Sh5EnZT
+MIIBOQIBAAJBAOFSMCzZvmQokV16/dnpFDV60pROkUbg259refRMrG4HYTSGdGKn
+qESv+oeHqH1CYf+rUNR7v3X61dWzdPtWHjcCAwEAAQJAXYooM8ZlcuEgj+VKU1ee
+qyEFIMqJJxqcMk+E/nWCM96WxCP3zHNSrqNfSpI3ld7QzMwhdRz+gFLxT2gGNpIw
+MQIhAPxzM/lDihe67X3ADYtDl9ZjA8Pm430x9sXlcxI17tCZAiEA5H1SyFl4mUee
+9VnfSC2XGW7lwz72ZygfVX+b7tLWF08CIEh40gzW5MfXM+KLxdea+fXjyursV5ZT
+R6KcMiKiNQLRAiAcmHqlzFzFgisotai2Fc6VRkXHG7gmzOSvBJt1VjmpDQIge6jf
+2N7whTdvC4ferB+zUlgWQdyvx1c3T4gnt6PYdaY=
-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/ndb_config_config.ini b/mysql-test/std_data/ndb_config_config.ini
new file mode 100644
index 00000000000..c325952d322
--- /dev/null
+++ b/mysql-test/std_data/ndb_config_config.ini
@@ -0,0 +1,55 @@
+[ndbd default]
+NoOfReplicas= 2
+MaxNoOfConcurrentTransactions= 64
+MaxNoOfConcurrentOperations= 10000
+DataMemory= 20M
+IndexMemory= 1M
+Diskless= 0
+TimeBetweenWatchDogCheck= 30000
+DataDir= /data/msvensson/mysql/mysql-5.1-new-maint/mysql-test/var/ndbcluster-10095
+MaxNoOfOrderedIndexes= 32
+MaxNoOfAttributes= 2048
+TimeBetweenGlobalCheckpoints= 500
+NoOfFragmentLogFiles= 4
+FragmentLogFileSize=12M
+DiskPageBufferMemory= 4M
+# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
+#ODirect= 1
+# the following parametes just function as a small regression
+# test that the parameter exists
+InitialNoOfOpenFiles= 27
+
+#
+# Increase timeouts to cater for slow test-machines
+# (possibly running several tests in parallell)
+#
+HeartbeatIntervalDbDb= 30000
+HeartbeatIntervalDbApi= 30000
+#TransactionDeadlockDetectionTimeout= 7500
+
+[ndbd]
+HostName= localhost
+
+[ndbd]
+HostName= localhost
+
+[ndb_mgmd]
+HostName= localhost
+DataDir= /data/msvensson/mysql/mysql-5.1-new-maint/mysql-test/var/ndbcluster-10095 #
+PortNumber= 10095
+
+[mysqld]
+
+[mysqld]
+
+[mysqld]
+
+[mysqld]
+
+[mysqld]
+
+[mysqld]
+
+[mysqld]
+
+[mysqld]
diff --git a/mysql-test/suite/rpl/data/rpl_bug28618.dat b/mysql-test/std_data/rpl_bug28618.dat
index b800c4dd39d..b800c4dd39d 100644
--- a/mysql-test/suite/rpl/data/rpl_bug28618.dat
+++ b/mysql-test/std_data/rpl_bug28618.dat
diff --git a/mysql-test/suite/rpl/data/rpl_mixed.dat b/mysql-test/std_data/rpl_mixed.dat
index 131c57750cc..131c57750cc 100644
--- a/mysql-test/suite/rpl/data/rpl_mixed.dat
+++ b/mysql-test/std_data/rpl_mixed.dat
diff --git a/mysql-test/std_data/server-cert-des.pem b/mysql-test/std_data/server-cert-des.pem
deleted file mode 100644
index 3b93d865d5b..00000000000
--- a/mysql-test/std_data/server-cert-des.pem
+++ /dev/null
@@ -1,16 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICljCCAX4CAQEwDQYJKoZIhvcNAQEEBQAwUTELMAkGA1UEBhMCU0UxEDAOBgNV
-BAgTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMRAwDgYDVQQLEwdTdXBwb3J0
-MQswCQYDVQQDEwJDQTAeFw0wNjA4MjgxMTA4NTlaFw0wOTA1MjQxMTA4NTlaMFUx
-CzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMREwDwYDVQQKEwhNeVNRTCBB
-QjEQMA4GA1UECxMHU3VwcG9ydDEPMA0GA1UEAxMGc2VydmVyMIGfMA0GCSqGSIb3
-DQEBAQUAA4GNADCBiQKBgQDEiOVZcWYzZe7I8xhhUwCzvmkZifAXeMTH+8XKGLHX
-NWF3FLduAmeAad9oOZgBKb+oWTdRDWXqwu6nYYUBfrUpaY27/wLkgWRgewL3LZnw
-W2FjhNsjx3gI2NK+Pix47q9d+a+5T4AW5+lK499l0K0k2cvyFdIerhDW8R0t8Uru
-twIDAQABMA0GCSqGSIb3DQEBBAUAA4IBAQC2LQcqLg52RbelWrKutlJ5E6rzugnJ
-ZAlbN9sM98O2xFiIGDA3tb5j9LAEjE0E+RqdptEYnvy9b3szhLYXtIILZTkClf9r
-Uwu1nUYPTyp+9ZYCa4fovOU5h1Ogv+9UZPds/LPDwWEn8K+lvscB4X57wJyuoEck
-1Mu41OA6h77181MydSdgZo0oquJDWhdCsYHXVFVs0F6naMm2uPMCTDiQVlhHJuTO
-VQMNIwxRFtvsv2tpsXsaP/8sT32d5CFebfxxSVnqQvJ4ZdIrphl6L43XU01rsEcE
-K8KYujZQ6SKws+HVcGqsr7TPgJfJE6D+5RazvvIQISPvx4eduebqzqdC
------END CERTIFICATE-----
diff --git a/mysql-test/std_data/server-cert.pem b/mysql-test/std_data/server-cert.pem
index f420b4f3124..cab54db8b23 100644
--- a/mysql-test/std_data/server-cert.pem
+++ b/mysql-test/std_data/server-cert.pem
@@ -1,42 +1,55 @@
Certificate:
Data:
- Version: 1 (0x0)
+ Version: 3 (0x2)
Serial Number: 1 (0x1)
- Signature Algorithm: md5WithRSAEncryption
+ Signature Algorithm: sha1WithRSAEncryption
Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
Validity
- Not Before: May 3 08:54:13 2006 GMT
- Not After : Jan 27 08:54:13 2009 GMT
- Subject: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB, CN=localhost/emailAddress=abstract.mysql.developer@mysql.com
+ Not Before: Jan 28 10:55:13 2009 GMT
+ Not After : Jan 28 10:55:13 2010 GMT
+ Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=localhost/emailAddress=abstract.mysql.developer@mysql.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (512 bit)
Modulus (512 bit):
- 00:d9:fd:da:b3:fb:7c:e0:b0:03:be:97:c6:a4:36:
- ac:71:af:bb:2d:e5:84:ed:f3:8f:2b:eb:11:e5:aa:
- 66:ed:bf:62:6b:e3:ce:fa:80:ed:90:ff:b9:4a:39:
- 20:40:b6:f2:99:bf:2f:33:b5:f2:ec:3a:90:60:1d:
- 9e:94:7e:a4:1b
+ 00:b6:8f:e5:b7:b4:86:83:13:8a:f9:bf:63:cb:64:
+ 2d:b9:51:d1:de:ab:7b:45:1f:aa:b5:66:73:13:f9:
+ a6:07:d5:ba:7c:fa:92:bd:37:e2:ad:87:db:3e:b6:
+ 6a:12:64:f8:ee:17:e3:15:06:2f:a8:82:68:bf:57:
+ 8d:c3:04:98:27
Exponent: 65537 (0x10001)
- Signature Algorithm: md5WithRSAEncryption
- de:5e:35:cd:7b:11:e6:7c:c5:7c:d6:27:4e:72:12:49:42:eb:
- 6f:2c:96:f3:f4:00:78:a7:4f:9f:2d:7b:d7:30:39:af:49:4d:
- df:b1:55:0d:30:be:23:6f:06:67:fd:dd:ba:98:66:36:c6:32:
- b7:ed:63:fc:aa:49:cd:4f:72:98:3b:13:0e:f6:28:d7:d4:eb:
- 04:6b:dc:e8:c7:04:80:92:e4:04:86:0b:ed:32:25:76:1d:a9:
- 5c:a9:2c:18:2c:bd:bc:15:ed:e1:76:96:4d:bb:0d:41:44:06:
- 2c:ad:45:bb:db:61:ad:17:11:cb:49:70:67:eb:c6:27:d3:91:
- c8:f2
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ X509v3 Subject Key Identifier:
+ D9:9A:B8:5F:22:EA:04:10:C8:25:7D:82:57:E6:2E:FD:19:29:E7:DA
+ X509v3 Authority Key Identifier:
+ keyid:F2:E2:EA:55:65:A4:9A:E2:AC:9D:97:F5:45:6C:F6:F7:8C:11:AD:DF
+ DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
+ serial:95:E9:78:F5:34:50:E4:D5
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 54:07:2d:21:0b:a5:af:3b:58:23:32:5e:56:7f:ab:58:63:48:
+ 91:aa:38:90:89:16:f9:cc:bf:a4:0e:78:2b:9f:c5:1b:58:a6:
+ e6:08:8f:2e:ae:97:03:21:9b:f1:cd:c0:26:8f:1d:d7:28:27:
+ a0:8e:81:09:1b:1c:0f:c9:a5:41:3a:2d:44:3f:9c:fa:87:ff:
+ c8:4c:2b:44:f7:1b:c1:3e:4f:01:7f:e9:26:cc:9f:1c:06:b5:
+ 0b:27:d1:10:90:be:93:0c:9c:e7:b0:d1:ea:27:99:4e:06:14:
+ 0c:7a:e9:c1:52:c5:33:68:bc:61:0d:db:81:3b:57:48:57:bf:
+ 42:9a
-----BEGIN CERTIFICATE-----
-MIIB+zCCAWQCAQEwDQYJKoZIhvcNAQEEBQAwRDELMAkGA1UEBhMCU0UxEDAOBgNV
-BAgTB1VwcHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFC
-MB4XDTA2MDUwMzA4NTQxM1oXDTA5MDEyNzA4NTQxM1owgYsxCzAJBgNVBAYTAlNF
-MRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxhMREwDwYDVQQKEwhN
-eVNRTCBBQjESMBAGA1UEAxMJbG9jYWxob3N0MTEwLwYJKoZIhvcNAQkBFiJhYnN0
-cmFjdC5teXNxbC5kZXZlbG9wZXJAbXlzcWwuY29tMFwwDQYJKoZIhvcNAQEBBQAD
-SwAwSAJBANn92rP7fOCwA76XxqQ2rHGvuy3lhO3zjyvrEeWqZu2/YmvjzvqA7ZD/
-uUo5IEC28pm/LzO18uw6kGAdnpR+pBsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQDe
-XjXNexHmfMV81idOchJJQutvLJbz9AB4p0+fLXvXMDmvSU3fsVUNML4jbwZn/d26
-mGY2xjK37WP8qknNT3KYOxMO9ijX1OsEa9zoxwSAkuQEhgvtMiV2HalcqSwYLL28
-Fe3hdpZNuw1BRAYsrUW722GtFxHLSXBn68Yn05HI8g==
+MIICkzCCAfygAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ
+MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
+UUwgQUIwHhcNMDkwMTI4MTA1NTEzWhcNMTAwMTI4MTA1NTEzWjB5MQswCQYDVQQG
+EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxEjAQBgNV
+BAMTCWxvY2FsaG9zdDExMC8GCSqGSIb3DQEJARYiYWJzdHJhY3QubXlzcWwuZGV2
+ZWxvcGVyQG15c3FsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC2j+W3tIaD
+E4r5v2PLZC25UdHeq3tFH6q1ZnMT+aYH1bp8+pK9N+Kth9s+tmoSZPjuF+MVBi+o
+gmi/V43DBJgnAgMBAAGjgaMwgaAwCQYDVR0TBAIwADAdBgNVHQ4EFgQU2Zq4XyLq
+BBDIJX2CV+Yu/Rkp59owdAYDVR0jBG0wa4AU8uLqVWWkmuKsnZf1RWz294wRrd+h
+SKRGMEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdV
+cHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAJXpePU0UOTVMA0GCSqGSIb3DQEB
+BQUAA4GBAFQHLSELpa87WCMyXlZ/q1hjSJGqOJCJFvnMv6QOeCufxRtYpuYIjy6u
+lwMhm/HNwCaPHdcoJ6COgQkbHA/JpUE6LUQ/nPqH/8hMK0T3G8E+TwF/6SbMnxwG
+tQsn0RCQvpMMnOew0eonmU4GFAx66cFSxTNovGEN24E7V0hXv0Ka
-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server-key-des.pem b/mysql-test/std_data/server-key-des.pem
deleted file mode 100644
index b35d4ab223b..00000000000
--- a/mysql-test/std_data/server-key-des.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,D2BE7598C7E3BDA5
-
-1W3qPgw5ut80OhaAGVZZe/tfFiBAlwpX1SohdApWj+QYP+dK/mdEBhgI3BXTFNLW
-pJqDTzGlKtft7hHN6QDFEdZMKxej5+2iLu14V62o+5yQgUoqswoXcmmqJCJ7AvyJ
-yMBmGAzxRFlQsT8lf6o5TS1/efBvjvWhh3NG2Zq2LpyhWRRqA3kNhzktzt2WjDZe
-ZkKmZJJnArr/Aw7jEBC4sH+nmgxoR18GzDddRG12hv1AWyHc3+VisTBpyNzeBy17
-rxuQtqLzkAJmId723ddw83RVNSvBUUS3G0rx5O3HPobvZK89UqVxcXtIgc11WTVU
-N3DbcJq5it43Loo0W3gAngtESDm2E3rTadrmdUSDGv2wQ5dNFl6cQ1f397Sdd/WC
-A0grn1tKjJ6COp80Ymdyvn+stjv/+Rl1/KHSeG0lNeZxqjPPOJ7NHaKv7qjYsJ6W
-LT35/Xc3oCo5qk9FOlq/0tGjHxf6RcFr5U7k5ILKZs+RmvJ4Sv/VYShLfLTcfGbJ
-wBNfRKvcHZBQJQBb1+s/kRrjFFtvhrUwLz4+c9kskp+t4qRVYywUAnGGGsMs/GPm
-wYsLQZO6Bs5/taaVUyaJQW015J7FGGv+/7/A1dIhu73S/Xl/YcFbX/CMEVq2Lxxd
-hZdFIuaZ7LE+0MDQWsvYMYPDPLDH11diczb/jeKBdLPOzk/FUqVx3Fin1PpcaBxY
-b+7oZJhYdg/rAWDeQ/nji9qnEG8waK6x1hdkYPOrqqWQPfgM/LPsSrgWeuTSdx2B
-Ixi01UlBb5UP4K7UrjyddPobmcVjXaQLNe7zaq0+OS3UnIG85GtHrQ==
------END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/server-key.pem b/mysql-test/std_data/server-key.pem
index a4842624c0c..0d8274b77f6 100644
--- a/mysql-test/std_data/server-key.pem
+++ b/mysql-test/std_data/server-key.pem
@@ -1,9 +1,9 @@
-----BEGIN RSA PRIVATE KEY-----
-MIIBOgIBAAJBANn92rP7fOCwA76XxqQ2rHGvuy3lhO3zjyvrEeWqZu2/YmvjzvqA
-7ZD/uUo5IEC28pm/LzO18uw6kGAdnpR+pBsCAwEAAQJBAMieYdpmRoUaODf9wqh6
-ULXH/sG8i1vaXRcUHcJ50oRVfVK8/tGGvUuTDu6MeINTdahNDlYfjwOjKWVXys1w
-h6ECIQDs6s7DfczK2bKCLt0zqg24mZL3rOpGmDU+TatwN1yVgwIhAOuMzdVTX39p
-328+5WxJvBOFfxmSmqdDhIFpnRMvgguJAiByvKjT/km+970+1OllyvaIL0AA2OpA
-tBgdC0p6tyUMdwIgKuHAWzTJbu28UolVxQgLaFZmVCZ/ZzIAfnrWsLZ2a1kCIBq/
-ywJ2cpyFlgazu8AH6KCQa0ok9s70ElaB6FEC85Al
+MIIBOQIBAAJBALaP5be0hoMTivm/Y8tkLblR0d6re0UfqrVmcxP5pgfVunz6kr03
+4q2H2z62ahJk+O4X4xUGL6iCaL9XjcMEmCcCAwEAAQJASA5VwgNb0CKHiPm0ntOk
+hG+54SRX3DmafEy6gRjZIl/bZ/asSLhXUZ+CeohyrQh7BZgYWvykd8pRISL9eKsU
+GQIhAOXkUrOtP/EtjyqNluEqZdG+RZi/7p61JS3Ce13Myu+LAiEAy0uMlV34AJpM
+b40FPKqlHxw8DD/Dt1iKhNVAg8+LDVUCIFjv7fbJDbW2VG63/Cj8CAwOukoP5rbL
+iaicVrHBKrllAiB9+MiaXeopZXNrxDS0jQFYr8Q9yt1aJVFgUkxx4Q9HKQIgZPs0
+KlF3NNNWw78INaAEkyf0IEssnLMsuoCWw0DIOak=
-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/server8k-cert.pem b/mysql-test/std_data/server8k-cert.pem
index a0750f9e69e..3b86effd699 100644
--- a/mysql-test/std_data/server8k-cert.pem
+++ b/mysql-test/std_data/server8k-cert.pem
@@ -1,51 +1,138 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4 (0x4)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
+ Validity
+ Not Before: Jan 28 11:12:27 2009 GMT
+ Not After : Jan 28 11:12:27 2010 GMT
+ Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=server
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (8192 bit)
+ Modulus (8192 bit):
+ 00:c0:8f:22:03:24:59:67:46:14:d6:8f:60:09:58:
+ 06:07:45:f1:78:71:55:f1:ea:b9:30:8a:cd:c3:3c:
+ b9:bf:65:6e:18:ed:a0:b8:c9:19:56:6f:c4:90:19:
+ c8:65:09:db:ff:bf:82:a1:08:ad:01:4f:5a:a3:d4:
+ 3d:78:7e:4b:4a:01:a4:7d:e8:7b:05:3e:7d:d8:b9:
+ 55:58:60:d6:1c:ce:e8:32:62:2c:19:60:f3:ed:05:
+ 99:6d:c9:77:07:2e:11:6d:0b:9a:c7:68:38:46:e8:
+ fa:31:80:df:e8:79:f0:f1:fd:a9:94:c3:fa:0d:f5:
+ 78:ac:49:7e:d5:17:fd:e1:ee:44:f3:c7:0e:30:32:
+ 5d:a9:19:25:e4:bb:21:1d:fe:3c:84:48:40:f5:58:
+ f4:bf:13:8c:85:68:bb:ec:f5:dd:c6:38:d1:b0:77:
+ 1f:a6:8e:4f:8d:e2:6f:49:74:f5:3f:90:65:8e:99:
+ 1e:59:9c:1c:b5:26:24:c4:b1:de:1e:fb:96:65:c4:
+ 31:14:1a:53:b8:5e:62:8a:c7:04:f7:b4:36:a4:af:
+ 07:c8:27:06:ed:dd:e6:f4:8c:62:f1:65:40:d0:9f:
+ 9f:a9:14:c8:8e:8b:74:d6:67:5a:d0:c9:4d:35:a1:
+ d5:7b:39:3a:42:9f:e4:d0:f4:c6:0f:2e:42:30:4b:
+ 56:b2:3d:6d:8e:2d:58:c5:69:99:35:49:95:95:99:
+ b6:87:29:2b:32:d1:50:08:cd:25:14:48:6d:10:99:
+ 85:61:3c:41:26:21:55:cc:1f:cf:ad:b0:2f:b9:89:
+ d8:4e:a0:18:ff:75:1d:b6:97:7c:c5:fa:8b:dc:93:
+ 17:86:0a:64:d4:09:35:d5:83:34:6d:5c:6d:c6:8c:
+ cd:b9:ec:c2:93:c6:c1:b7:cc:04:6f:22:e0:07:bf:
+ e0:d9:9b:2f:d5:a0:50:cc:f9:f0:95:83:8f:f4:30:
+ 83:72:94:d7:b5:4b:da:cc:9f:54:3b:8d:78:77:0b:
+ 24:6c:0f:c2:96:61:96:2f:b8:5f:b5:7a:ab:7a:5b:
+ 97:7a:a9:ad:40:8b:f2:d6:c6:8d:81:d9:94:61:8f:
+ 9d:03:c5:b9:10:03:68:83:bf:04:81:cc:ac:bd:34:
+ 89:e8:d4:8d:43:20:e2:b6:a4:11:3d:15:2a:82:0c:
+ d6:3a:6a:8c:62:d4:93:bc:c3:80:bf:1b:b4:2b:0a:
+ 7a:34:f0:cd:1e:82:3f:25:0f:d1:04:a8:0a:05:19:
+ b0:d6:16:83:39:af:0b:45:7d:cb:14:7e:4d:aa:aa:
+ c2:39:a8:46:38:ab:bd:ab:2a:bd:34:43:7f:da:25:
+ de:2b:fb:69:3b:fe:3b:87:fd:98:94:76:4a:bf:04:
+ a3:31:e3:3a:ff:6f:04:fa:fa:24:e4:2a:89:e9:0e:
+ bf:44:4c:72:85:82:3c:89:4a:03:63:01:41:92:53:
+ d0:82:60:6e:d8:ff:8c:a2:b4:1a:3b:20:6d:ae:74:
+ 92:30:4e:48:e3:51:a6:cb:73:97:06:13:03:32:23:
+ 9b:7d:a2:c7:3a:a9:af:97:8c:51:ed:fe:fa:b4:b4:
+ 1a:a3:87:fc:cf:8c:8e:e6:80:15:03:fd:fe:7d:bd:
+ b1:76:f1:5f:b3:09:2b:4c:4d:a7:7c:b5:72:b1:d6:
+ db:38:c0:67:a4:54:bc:87:09:a5:39:ba:1a:7e:3f:
+ 74:60:ad:3d:4b:be:94:53:f3:64:16:c7:33:35:ec:
+ 41:00:95:b6:de:99:62:a2:7a:28:9a:45:4d:fa:cd:
+ a6:77:f6:de:58:72:50:c8:7d:69:38:db:07:04:84:
+ d8:4d:39:f7:50:13:43:ae:2d:af:45:a4:2a:39:56:
+ 3c:b8:b7:d8:26:a4:36:c9:23:aa:aa:b8:49:0b:21:
+ ba:9e:7a:2b:7f:4d:29:9f:0e:00:1e:b4:5e:a6:fa:
+ 49:fe:8d:e5:74:57:d8:ba:d9:92:2c:d2:ac:84:1d:
+ f2:a6:a4:44:1c:bf:88:41:32:7e:d1:c3:2f:6e:bc:
+ 0f:5d:19:a6:8f:74:2b:67:ba:dd:a9:db:68:b5:ce:
+ 9d:25:48:df:54:08:d0:1d:4f:2e:5b:24:bc:05:0f:
+ fb:58:46:fa:02:ca:53:93:29:cf:10:27:c2:a0:18:
+ d0:f5:d4:b9:3c:5e:df:8e:6c:f5:7c:b9:b4:54:cc:
+ 39:16:5d:3c:da:96:b3:c3:6c:d4:70:5d:d3:30:a7:
+ a6:bd:6f:dd:41:bc:a8:de:42:60:59:9a:85:25:0d:
+ 2a:45:c3:05:b4:6e:7a:4a:4d:ca:8c:0a:e5:6c:34:
+ bc:20:9b:6d:4a:ca:ca:b6:a6:3a:a0:db:c3:0e:20:
+ 1a:12:1b:77:dd:cb:1d:7f:c3:0d:0d:e7:c1:fd:96:
+ d2:c7:68:80:99:a0:d9:8a:33:21:a3:8b:a2:5a:a7:
+ 7e:27:06:02:7f:ed:60:11:37:34:54:17:7f:4d:90:
+ 14:1e:69:37:0d:ba:f0:2b:f0:a3:2d:62:79:c8:76:
+ a8:ea:c8:e7:3b:1f:c6:4f:c2:0c:d7:ac:f0:77:53:
+ 5d:f0:50:b4:df:9b:03:ca:4d:41:e1:18:b2:25:30:
+ 86:1d:63:e5:67:b1:53:cd:6b:4e:83:1a:b9:5e:2d:
+ 05:15:6b:d4:8e:b1:97:fc:31:03:57:cb:bf:27:7f:
+ cd:5f:27:7e:66:e7:3c:17:09:b6:11:2a:4f:33:cd:
+ eb:1a:d3:6f:d5:15:8b:8b:ce:68:6b:7e:9a:95:e5:
+ 74:7f:17:57:d9
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ X509v3 Subject Key Identifier:
+ 58:12:24:59:A7:3C:29:15:89:5A:C2:12:DB:E7:A5:42:10:21:B7:BA
+ X509v3 Authority Key Identifier:
+ keyid:F2:E2:EA:55:65:A4:9A:E2:AC:9D:97:F5:45:6C:F6:F7:8C:11:AD:DF
+ DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
+ serial:95:E9:78:F5:34:50:E4:D5
+
+ Signature Algorithm: sha1WithRSAEncryption
+ cd:cb:5c:83:35:ea:cb:cb:c3:a8:c3:95:e2:e6:6f:4d:d8:e4:
+ ee:41:dd:3f:35:82:ac:2f:fd:63:89:4f:3a:19:d7:81:75:b3:
+ a3:fc:36:b2:12:d5:c6:56:bc:13:60:37:33:6e:a0:d8:ae:7c:
+ 88:f9:4b:ee:7b:1f:c8:f0:56:19:07:4d:bb:45:52:1c:78:81:
+ 07:7c:13:86:b8:86:70:85:e4:71:25:58:78:d1:be:de:22:82:
+ 6d:1a:4b:06:ac:f0:e8:50:87:c7:69:64:c2:61:43:cd:96:06:
+ a6:7e:09:a9:02:01:2a:a2:40:f3:cd:10:80:48:d0:34:55:40:
+ b9:ce
-----BEGIN CERTIFICATE-----
-MIIJHDCCBQQCAQEwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCU0UxEDAOBgNV
-BAgTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMQ0wCwYDVQQLEwRUZXN0MQsw
-CQYDVQQDEwJDQTAeFw0wNzA3MTMwNzU2MjVaFw0xMDA0MDgwNzU2MjVaMFoxCzAJ
-BgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRkwFwYDVQQKFBBNeVNRTCAgIAog
-ICAgIEFCMQ0wCwYDVQQLEwRUZXN0MQ8wDQYDVQQDEwZzZXJ2ZXIwggQiMA0GCSqG
-SIb3DQEBAQUAA4IEDwAwggQKAoIEAQDUFlh/3mwov5YaICFXOdJXgHV/uDkTjXB6
-9oxlipshQaYPX8LDT5vhI3gPciS1Z1sRE2dTcC4Mk2K4LDUIjp3WkeTfFAHZPV3E
-Y+3OH/ftH4N6SEIBTKE4EY6ah0nJtU98M0JhxOh5zHje6zQp1SkBnhEOQYexYRqj
-OtGloZ9RyF0iFAXcyu2Ap14u37l5Yla0cyPzvZqP4mFYlcXwaRfAacJmqMM1vuQv
-Fx1JITUTBugMF3VGZ1F0tw63EIUH/FW/WWncPqvG18na40qlv9ZkBw0FhZeKS8cK
-JIY5y4J30jn/eV8p1lTO7K+ASTuGZWmdRDgjUG0Y9OGuKsPPoaE6ml0HTnMBsBSQ
-fXUq9XkwGt8DTgPioAKHBHjLbILEy4FMYWrlTZlPTzNqyhayec/2T15oDladNSt7
-JpDLpX70UECXFhdEGxsGxtXdKbIBvNm2yT4X2nxW9ItsECjSSgD+94TgGoa8QKDw
-rpmgq+Wqpm54CZ1vN1oqyMUw1sjNEX/iLByHAjSALby2Kffk5cl5mnsR6d/k4jsi
-c3Qsciwkd+rQt/8VMhS2ns3nkez/BK3FvQA2Ms8xJhFLfszVrBhnjcFRTNT2+/KM
-lr1oT5Q1XZKL7qVXTpabPL51JlVBL5CSHl1QRkffsqfqcgJkcHBq+kKjUiFs4lad
-hTrvNBCXYa5+NkA2QqIfdOpNwl62/gdE7/7zU1uh40vkVKyzL+APkLPywPEXBOpQ
-yIDNkgoXmS10+JMD44K7uZyUmxZL7W7Xbi30NuEFrVOzoUmVXhapPbpQnkQHxn8n
-tqKPYXdBcvXcCKyJ6i79H2Vk9fM6rBYiwNcE7QyWqfd2QMjzr76veF04sXkPR+tG
-5Y1lrF9Zp3vabFXQg2RJuGA3rV6MR2GFNXuChIYu410vhIhPNtmdKEVoIVZsFsug
-+dtn0PDCFrR8VEd/sshp0naNa9Ad1lY+marJkOJOVpPgCs2yJDPAUB/YdvSJ4avW
-6ZdvNTwhBL8fEJMS2DSqkaa6A3+i/SqITpU8ToJxsMGagBsLieXgvJALFysSRfR/
-2dmEu9/J0PPc28inHXwjiLb99VKlkuEz8wX9UkuoqFl0pLa8jrlM8hzdPQ9QHb3k
-9c5knfgPCYkOIWwGXH+NwANHdQRK7CmGAFV24k9+P3q0g5ikabVHr+4ZQ3WPd+1H
-K0+Msbb/vv53vFJWa+pYeNeFcwNCyW2kJBTMiI6qmlL4IWCcX+QDzpRLalbAWWHj
-l5Zk39QEaCL024DYK948IDXCqDg6utEs7YnMdaIF0meYMKjehZFp0fVQ8e8Od+rp
-bbjdj/w60wMgBpSOeYxVrs3QKNZd/if4Az3LggoVHB09SjXKiWpvAgMBAAEwDQYJ
-KoZIhvcNAQEEBQADggQBABncOBW0wQwJdEB6W3d9CrhFp40q1OM54GPfX0/0aUfP
-aOQPxS1uCKcFhxAmR4OT9RiJx+0bhDctekkuMkj5yy3u0a/4PxHIhnVxXTyB0/Hj
-N1gLz6cQricunl6Q4Ldi54gR5/KUehKLBWnqsfxhgzWBHosvhlJC0xh/uio7JTqz
-ns60djyL7R4wGbSqiGdhT9L2HfpJo3dmmWLDxe02jaHkbL1Z6NQMxrRgs3+gctp/
-Wd5UxNl4BHbNsSbzaK9V9gXUcj4TjZGGSqVki0+pEZ3dmksGZdoW9cSKtzKvgUQ6
-vhhqO4dcopxkY2zYeVOpspgTm0XLZSbNPXv5rSFwa4cpWSfD7u8o8KhHvkkSMahw
-cMuH17W4voHHFDtWP8Oq9rA7uE/4/LKCl0JmJl2RWM+G6PMH8w4X4auHPssgRvb/
-Ge1AvgqQJrvi7zWx3XYKKJ0ISBy7fi5Jo/wYgLagRYcG3mwdm1+gAdw+77C/ZGmG
-FbWFIPB1+Mc6azhhk9m/vqP7o/Wuncc99mp2zPMzdAEzuzp/IJ9UJNat0edA7jiC
-bQ7JSRJ1DSzdJZSWWHdardLNKipPfrEHVm7f5QvL5DQLnGpt+rCWL361KsGtvETC
-o+Ph7+kDJsJLokUYfs/BEZopzspNPy/NQ2ECwQp7T4Yq/PBE6Ce/dFaoZysMUOrG
-TcALtJW6It98dRmTJPiqjlrlHNTrfoV3Aiy+tK4rpyGuApSHc+1Y+t7YvWotRlQ4
-GEboBqR8evjDPJ1xAaUZqwLkebf3mlpl4MzHM9uNWBkQdJilkQs/IrAaApG3Ayt0
-nIymNHmDslBEdrRGmT4aNWAWYvVYzyKDy3H0fzYdWwuA9goJUL4tj3eMJa8pgEU/
-rG3HfflVi+xuwm1UnLXPSIE8hixgV8ebnwcCnEjlUBvwpl7f5Ub40jKcdycdGvVu
-gcTUzuRl1+Ikfk/MXKPbdi4A5Pjtz6AG4Ez9q5j7X77JqskTI5Z/f1RPiKwFBJHg
-cN4+BPnEuSWGcjiNDOfQxhk5exlWRf/gpEhnQpGHe3a7tZgfxHUb/pWU9BYpf8OH
-vtV3WSDXlUqsEEH6/bmvj8lmFWJLmeZv+qLy1wHxcXR9/GJ6TwCF8niQIl3MrBAL
-sKPLft1drmpqdIQpZQIJxtN/AQuD9mxEdW7XA6rkvFySKcswJpS1QjkSWpafCBWE
-wu+SPxZL8oFrnNMTU3JloUjcRp70FkNXLLm/Dy+MjW2qFBtIoBgNptVGp94L1uZS
-amd2XJMcOQ+X9fcH3wAdM3IHGn3NiLf6eTW92JNNA0IN6aNtyVaJKmFJ1JfXOl9r
-ujr4SorRSesaerjIcuzW1u1YE5RlgeI4kizV2/D5kYc=
+MIIGJTCCBY6gAwIBAgIBBDANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ
+MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
+UUwgQUIwHhcNMDkwMTI4MTExMjI3WhcNMTAwMTI4MTExMjI3WjBDMQswCQYDVQQG
+EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxDzANBgNV
+BAMTBnNlcnZlcjCCBCIwDQYJKoZIhvcNAQEBBQADggQPADCCBAoCggQBAMCPIgMk
+WWdGFNaPYAlYBgdF8XhxVfHquTCKzcM8ub9lbhjtoLjJGVZvxJAZyGUJ2/+/gqEI
+rQFPWqPUPXh+S0oBpH3oewU+fdi5VVhg1hzO6DJiLBlg8+0FmW3JdwcuEW0Lmsdo
+OEbo+jGA3+h58PH9qZTD+g31eKxJftUX/eHuRPPHDjAyXakZJeS7IR3+PIRIQPVY
+9L8TjIVou+z13cY40bB3H6aOT43ib0l09T+QZY6ZHlmcHLUmJMSx3h77lmXEMRQa
+U7heYorHBPe0NqSvB8gnBu3d5vSMYvFlQNCfn6kUyI6LdNZnWtDJTTWh1Xs5OkKf
+5ND0xg8uQjBLVrI9bY4tWMVpmTVJlZWZtocpKzLRUAjNJRRIbRCZhWE8QSYhVcwf
+z62wL7mJ2E6gGP91HbaXfMX6i9yTF4YKZNQJNdWDNG1cbcaMzbnswpPGwbfMBG8i
+4Ae/4NmbL9WgUMz58JWDj/Qwg3KU17VL2syfVDuNeHcLJGwPwpZhli+4X7V6q3pb
+l3qprUCL8tbGjYHZlGGPnQPFuRADaIO/BIHMrL00iejUjUMg4rakET0VKoIM1jpq
+jGLUk7zDgL8btCsKejTwzR6CPyUP0QSoCgUZsNYWgzmvC0V9yxR+TaqqwjmoRjir
+vasqvTRDf9ol3iv7aTv+O4f9mJR2Sr8EozHjOv9vBPr6JOQqiekOv0RMcoWCPIlK
+A2MBQZJT0IJgbtj/jKK0Gjsgba50kjBOSONRpstzlwYTAzIjm32ixzqpr5eMUe3+
++rS0GqOH/M+MjuaAFQP9/n29sXbxX7MJK0xNp3y1crHW2zjAZ6RUvIcJpTm6Gn4/
+dGCtPUu+lFPzZBbHMzXsQQCVtt6ZYqJ6KJpFTfrNpnf23lhyUMh9aTjbBwSE2E05
+91ATQ64tr0WkKjlWPLi32CakNskjqqq4SQshup56K39NKZ8OAB60Xqb6Sf6N5XRX
+2LrZkizSrIQd8qakRBy/iEEyftHDL268D10Zpo90K2e63anbaLXOnSVI31QI0B1P
+LlskvAUP+1hG+gLKU5MpzxAnwqAY0PXUuTxe345s9Xy5tFTMORZdPNqWs8Ns1HBd
+0zCnpr1v3UG8qN5CYFmahSUNKkXDBbRuekpNyowK5Ww0vCCbbUrKyramOqDbww4g
+GhIbd93LHX/DDQ3nwf2W0sdogJmg2YozIaOLolqnficGAn/tYBE3NFQXf02QFB5p
+Nw268Cvwoy1iech2qOrI5zsfxk/CDNes8HdTXfBQtN+bA8pNQeEYsiUwhh1j5Wex
+U81rToMauV4tBRVr1I6xl/wxA1fLvyd/zV8nfmbnPBcJthEqTzPN6xrTb9UVi4vO
+aGt+mpXldH8XV9kCAwEAAaOBozCBoDAJBgNVHRMEAjAAMB0GA1UdDgQWBBRYEiRZ
+pzwpFYlawhLb56VCECG3ujB0BgNVHSMEbTBrgBTy4upVZaSa4qydl/VFbPb3jBGt
+36FIpEYwRDELMAkGA1UEBhMCU0UxEDAOBgNVBAgTB1VwcHNhbGExEDAOBgNVBAcT
+B1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCggkAlel49TRQ5NUwDQYJKoZIhvcN
+AQEFBQADgYEAzctcgzXqy8vDqMOV4uZvTdjk7kHdPzWCrC/9Y4lPOhnXgXWzo/w2
+shLVxla8E2A3M26g2K58iPlL7nsfyPBWGQdNu0VSHHiBB3wThriGcIXkcSVYeNG+
+3iKCbRpLBqzw6FCHx2lkwmFDzZYGpn4JqQIBKqJA880QgEjQNFVAuc4=
-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server8k-key.pem b/mysql-test/std_data/server8k-key.pem
index 608593a5096..493ad2350c8 100644
--- a/mysql-test/std_data/server8k-key.pem
+++ b/mysql-test/std_data/server8k-key.pem
@@ -1,99 +1,99 @@
-----BEGIN RSA PRIVATE KEY-----
-MIISKQIBAAKCBAEA1BZYf95sKL+WGiAhVznSV4B1f7g5E41wevaMZYqbIUGmD1/C
-w0+b4SN4D3IktWdbERNnU3AuDJNiuCw1CI6d1pHk3xQB2T1dxGPtzh/37R+DekhC
-AUyhOBGOmodJybVPfDNCYcToecx43us0KdUpAZ4RDkGHsWEaozrRpaGfUchdIhQF
-3MrtgKdeLt+5eWJWtHMj872aj+JhWJXF8GkXwGnCZqjDNb7kLxcdSSE1EwboDBd1
-RmdRdLcOtxCFB/xVv1lp3D6rxtfJ2uNKpb/WZAcNBYWXikvHCiSGOcuCd9I5/3lf
-KdZUzuyvgEk7hmVpnUQ4I1BtGPThrirDz6GhOppdB05zAbAUkH11KvV5MBrfA04D
-4qAChwR4y2yCxMuBTGFq5U2ZT08zasoWsnnP9k9eaA5WnTUreyaQy6V+9FBAlxYX
-RBsbBsbV3SmyAbzZtsk+F9p8VvSLbBAo0koA/veE4BqGvECg8K6ZoKvlqqZueAmd
-bzdaKsjFMNbIzRF/4iwchwI0gC28tin35OXJeZp7Eenf5OI7InN0LHIsJHfq0Lf/
-FTIUtp7N55Hs/wStxb0ANjLPMSYRS37M1awYZ43BUUzU9vvyjJa9aE+UNV2Si+6l
-V06Wmzy+dSZVQS+Qkh5dUEZH37Kn6nICZHBwavpCo1IhbOJWnYU67zQQl2GufjZA
-NkKiH3TqTcJetv4HRO/+81NboeNL5FSssy/gD5Cz8sDxFwTqUMiAzZIKF5ktdPiT
-A+OCu7mclJsWS+1u124t9DbhBa1Ts6FJlV4WqT26UJ5EB8Z/J7aij2F3QXL13Ais
-ieou/R9lZPXzOqwWIsDXBO0Mlqn3dkDI86++r3hdOLF5D0frRuWNZaxfWad72mxV
-0INkSbhgN61ejEdhhTV7goSGLuNdL4SITzbZnShFaCFWbBbLoPnbZ9Dwwha0fFRH
-f7LIadJ2jWvQHdZWPpmqyZDiTlaT4ArNsiQzwFAf2Hb0ieGr1umXbzU8IQS/HxCT
-Etg0qpGmugN/ov0qiE6VPE6CcbDBmoAbC4nl4LyQCxcrEkX0f9nZhLvfydDz3NvI
-px18I4i2/fVSpZLhM/MF/VJLqKhZdKS2vI65TPIc3T0PUB295PXOZJ34DwmJDiFs
-Blx/jcADR3UESuwphgBVduJPfj96tIOYpGm1R6/uGUN1j3ftRytPjLG2/77+d7xS
-VmvqWHjXhXMDQsltpCQUzIiOqppS+CFgnF/kA86US2pWwFlh45eWZN/UBGgi9NuA
-2CvePCA1wqg4OrrRLO2JzHWiBdJnmDCo3oWRadH1UPHvDnfq6W243Y/8OtMDIAaU
-jnmMVa7N0CjWXf4n+AM9y4IKFRwdPUo1yolqbwIDAQABAoIEAQDI3u0tFoWMRoCs
-99d8HLiaxYED2YC9gw2QeKjal198LQhRsVnu0ByMLKLOxkX8RgrbbmxDe5Exufob
-A0urciAOFJoXqoRhs5x2oEqgGmkf/ePx0jQptOFREFfnBdGeKIpC0O3DWdLxYPbt
-8wixwkEXVhVDUk9pcdXf2ZqsbBpQRBvpZdtzlgNCAcLTVHP/gmMqf48CkIauVjPq
-ydfybibfx4sm3hodclH+Q78p/zicb8MhiKo7ZymgCKz4N743pQe1tsLrpbPeHY0C
-MpoFyF8O2Bq+KxwvELxQX+19GcHVKJhj3hmCr4wde9BxCWtGTBCusekVkVvy8iQ5
-aCmTIrtonMEVZXjJlXK0sw5hBKOmKx0jrSVC5FfgdxzNVlW4fCJXLEEpMsjMc+/3
-6bV7jqGn4N5CYaopNS2ccxdaucE3NjcmofahO6bqUTJHSPFecfYmCA42W2m+ldjj
-HZ78JLkyw03nT1hjPjbwHf5FTem1KfKg4EJrDprowMT7D8KZb0SW+z59pFoDOM5u
-Heu6sOSUtvpvKfozdw2ZAI58dhpW4/jTfCEtewRhPqE3/V7g3haTnQFxU8gm/a4N
-uefZTCjFE16QWNuvnUrJWw/DlvOBY8GjpQCWY0mDeBHPNOI0Xg9oRTgOCrKSLUya
-YSbg6BmhSKwKsYQU834jrQb3fXFlXZVIxlcNePOWMhHFFNAHucHF822Nr7u/3FOT
-twcbBIOXCGfDT6ed8d4dNum1L7k9Blju16CWkfuciL8PGXY4mGAmF4nZMXGZgK8B
-Cz9cxhtvFLe8gz5615DtBAsuVm7Q4AAHiULAMg6t6auyxCb8pXbAL0Ec5X4zS3+f
-I2riODYiyHCh/qTtjawOzUZZEtjZRMSDi+jk8wjjDdkFU8McOaYoPyqT3TDy2v6m
-NiPJs8GWQ2NCNo9CNoGbEIIFFP5iSz18XLFAOF+2dN/KHHl9nKyi7kOhYbbzoNku
-2wQV40yVsrS4E/hd/7+2IB2Muduxiu7NxCUSUXsw6p0hZTYMpIoduEfRSk1al0lS
-862GD8JgJ4RhJ0uIOTDJS52MQmO8zFIL86emdjjV1CzVvadYSQLTX7ZgR0i8g46A
-y0muCFAC8EJpnEtHzqtQ/z22zB8TCJShFuUK9KF6K8nOlbc6ShcUXU2J6r1sc8aT
-Dx0yzRXfCL15fpCJBP49EYaKhArTNmFRa2GaLiJP0OYkTrrwVOGuS6x2+kRVoP/8
-BcNMZ5x8mXP1LgotHCztgMKX30Hn5CLxbH8QfcWKemGva1jBmhCWxS17Gh3Ld9T3
-/WKkBa6JDq83rlO84x/iF3mB3tYkZPfcYtYURn5wwm/BmVV/9G1VwAatJdxmfCSy
-5JwC9WDBAoICAQD7xStPk3lq+qYHAtLZidujmzSNv7XG+E8UC9yvMRFuBwSM5ZE4
-YGD2LDev2nghB+7OSR8KJIkxeaNjP91Zf3s8wjCuxLg/cLGI6mf6uWy9+zypFg3i
-J+ylDKa6NBuqYyY75W7Pj63xvGQlw5kX5+mB3ulQbActT4cUiVdEkyDytzubqLzY
-s15QGFrL9gqLow+C+7LKQKdeXq8OavFV1PWkMDAJUki6cIir9m+f5Mqr2cQCLKgx
-38aX8c9UWJv6pI5zQQuBjpaBOwz07WnyTXiFpc71x/8i85uLGDM0e3VO5ZPGeRBj
-jZ0ucHatOHJ3i/nPRG16rsPR+q97QiDHoLF0quHEG+ND+rwTBzNGIwzYRE16p1o3
-UdzFk1RzlDCfOX7QgszCwK6mf8TbCK9f/FxJ5e6TCkt3iHXSrlLS4op6k9nEpKFH
-KHf4nPtCy9GriP+A8+dA6K1s+DgejoIojBMBTsnl4TEf+m8BaenTXGuU7KYyc8dR
-JqmpmDggDRT/ImHRhXirY7lIIYXnI7tRjN5gmnKpEiHScT1r848zpQ4gWH1Dx/ks
-mKT6NZ8nF45saQCYbKEYc0RH9Kw0O7vr1kVtNPc2dEZtVgt4bC5fnl7xX1/YTk3m
-+h1qfzbku/+MX5rRjHLR2l8a71UltlnnnpP5NKBBgtxll6aCIkk6CdH8YQKCAgEA
-16aBaVa0cOZmiOQwPQkpuXIbV7msz1ttWEAHElCy6waniOCON89PYFCb7F0NjV3Q
-i+pGaRgG1iZGbjjHwyqTrHhMloFm+IsSWZqOZzrHgSJgA4bgTJFgp+5b31sQXGfJ
-14QQSqMJLC61/M+CnrNtiuI3IVHx6BFRxI42uE7PfTyUMaFhL9F0/SLl0Mw0oMPj
-S5kmarduuKpRn1tN9WO+ywEvYwopvH3e9PBssZzPpttlLiE/Wulb0iEtlVXYB9DS
-Vzc94N2dzFMIvWUDF9BQ+IBMRzXRm15Psy6LfzoK+9S6w38Dx3BVV8ykSMKeW1UR
-ZwTajjdnIBLdE3onD5XMmrSOPw/WtV5zXEYY4DObhIPoN2iD8GJP0IubPb6fonH5
-VHmuVZoXrroFEe7rdt2wgmBdPPl6fqvBKVhjJOpYQctrFLgWh63bXZKaBWqbQM9W
-fECq8We1VN3fzqwfwJQit3z5R/DjQNk8eQx7SnnkOzAY6ZgpysHCwaoPOnPVuiYF
-ZU0+X3iwfsdeefWmGEDIzoZk6nYaljs61lOhhEoWHngZHDkMOp5kg0n9f8BUP02+
-WJ4QhwzZ73hr4FPBuPHHXECw9TCAgCBHBFrnrXg5QalDhRXz4F+3tCY7UUpD/ikZ
-L6Daxm5zGJ5u3rXs6WwKy2EHVVS9zfqs4Q259pQdWM8CggIAcIKpGzOVM+h033c0
-kIBZxeAq+Rlt+0+lzxiJ80RjPJ8oOmqwndf8HKaf8BcaTfCEmGz20QqIwLJSAJ1e
-posgoINLTB6fE8Kho8TU2KeaX7/xWMKBS8p5pzxjGZ0Fq/wI7wVVoq3blsaQnout
-U5CQujfKXeUYw/fhLp09gWiadbzKh4I9ej2V7QclNDZsegBRg0BForqH0NVRN4k0
-9h1n9IqQPOonlCGMAgTr1zFgHLIBNNOOClOtJOOruk6qzbRR8FFl+eyld3TTEnUy
-PlS+gkMZnJ5WduEUZnFXGKH/R1Wy1yPs3gA/+KvLbRdnl+LWrPgwUH3fBmwXlWZ0
-zaETDEb9Ay1PP2bCO2KhWDt7lv3W/fPhjg0oMqbnO4tCuzTvZfC93l5K7h708skL
-zkIxX9i/57fXB8DUnmTGoHUaWzLNQ2IqrGj6TACjDDOXLCfZvl/AvTH9pk+6jHU0
-1zfZmmECOpeK43Z/ussA8jI/5Vpn3u38aVh0w1RB6JjQBD/yJLaXuUekWgaZFzTR
-ldz014jNqp5uvONcBmzeVr7w9CV3PR4VTQed2i6yQ770J6A44uTQjOOd5OYDOohj
-Lz4e4nGj9BK8Eko8cAEwLAzS8tyjMT+08n5dPOVCu68DwVBMGE7CVONYUuoXS/YU
-cTxddiU9ZGk9Yq0FfOwjeys+SqECggIAdn3M2b6Egwx2Bn2ra74fKQBjub4SEBWi
-bT0xJYUl6jHL2E/alRvZ94gTRLqUebq0nkxpx9El4IFDbcjRKpG4dqnbG0+a7rIr
-sQRVfq8zc+cZbparpCa1P1CfNojo4n080KiF8xzGK3q3EGRM1zqr1AYcWLiX/PWX
-QjMKKhdTtvKUUvjjV8z1RSnpsOKjgDpiJ+XM0BJeSiV7l94pZc4axZyvFvI8oI9g
-9KEueCE7j+k5HTGziBZ1F26Xh1iVzSWWjcmSvH3I+L4fLUHVgz45X3HPd8lAlOgr
-Tr8icxPHeTwYKtcdknZMzmNpWXlmXbTOTRbDqCUVCvCSfOM/lzauJ8tR5aCkTx/I
-r0js3jQ9HYEFFXzeEjVSubob4L9fI3kQkLQTcIGsxZr8si/fPX7uP5UHZjuGbRee
-mUMxptUFDZHiEo5cAs0qna2x54v+JoxGbxtxUhez8R/Am+TDxaMfuEZ5Cmh31egH
-bFPJYtC68TKqXZ/4RqpUgukYWPvQ0emWSWU6AmdkQyT06nppeyYNsDz0MkgWr7l3
-yNBHDVNP+Anxcip+Z68kd2cuXQWmxOnIzxR67FnJXeWDEM20whRHgI8jLHYsBTq3
-CtOQPSaz/zosGXJIgF7Xp6riKPZvibW3Ww49Z47EuyBCtyirNk7hV4LG7sITUJyO
-ZVKPfcdAoM0CggIBANz3EBZGyt3af2UjFFKbazV01KcHF8OxqdQzsLqHCXWb98V6
-PggQnrF76U7DvqOWho9djDBPrbQU55HG5nXq+eZKPwhsOdwQ8bxOhaVxQcATZOI7
-FtJYnjM1/+zMzzS0iPR5DA2pbB3AKH2Z+wODmF23CK2XTwoJyPKxvlyGKrIqq3gN
-kOmocNu2Qm5bJf+D/hYPm5Ust2wzD52NnvJU536bZ0ZMo1/kaK2idqSAzqo4TkR1
-j9U0fdW2rIBDo/qFmBBdJhYVjYLj4qR8CEEoIjshD4Nztf1xRM5C8irE/gJcT5+r
-4bPJJ5TjAtHxPiQqZruSprSEUbMsPqBap64ow0SmbNNWSgyaz2ha1rG0p52NBzH4
-XM52LBqS9QHPHvB0ooYfBTfPpDM3CePuuNyzjPAw86ncUo38FKXuc2oViJJ6C5I7
-v2sKhLK5gu3uPBB2ludDEXSpWBqiraynolOT/o52r+taYp9YY2WU3GrhOiV/A1FV
-Nl118xiF6FOFpEeTbhHvy27A8kZEKXgeSs+f4aC0XG9kLVD1CiCbQiqHTDcDS4nV
-O1N1eQxhP81X+YKE4Lgufh07REqYVwtCj2lQcMp73WDyfBLKTEFlmHusoqmT5JCH
-X0BWNjk5Dn1g5h63/lQb+EjNRILBhDFYhrDRDQtw5p0/7IY3AcNKDUHv+XGn
+MIISKAIBAAKCBAEAwI8iAyRZZ0YU1o9gCVgGB0XxeHFV8eq5MIrNwzy5v2VuGO2g
+uMkZVm/EkBnIZQnb/7+CoQitAU9ao9Q9eH5LSgGkfeh7BT592LlVWGDWHM7oMmIs
+GWDz7QWZbcl3By4RbQuax2g4Ruj6MYDf6Hnw8f2plMP6DfV4rEl+1Rf94e5E88cO
+MDJdqRkl5LshHf48hEhA9Vj0vxOMhWi77PXdxjjRsHcfpo5PjeJvSXT1P5Bljpke
+WZwctSYkxLHeHvuWZcQxFBpTuF5iiscE97Q2pK8HyCcG7d3m9Ixi8WVA0J+fqRTI
+jot01mda0MlNNaHVezk6Qp/k0PTGDy5CMEtWsj1tji1YxWmZNUmVlZm2hykrMtFQ
+CM0lFEhtEJmFYTxBJiFVzB/PrbAvuYnYTqAY/3Udtpd8xfqL3JMXhgpk1Ak11YM0
+bVxtxozNuezCk8bBt8wEbyLgB7/g2Zsv1aBQzPnwlYOP9DCDcpTXtUvazJ9UO414
+dwskbA/ClmGWL7hftXqreluXeqmtQIvy1saNgdmUYY+dA8W5EANog78EgcysvTSJ
+6NSNQyDitqQRPRUqggzWOmqMYtSTvMOAvxu0Kwp6NPDNHoI/JQ/RBKgKBRmw1haD
+Oa8LRX3LFH5NqqrCOahGOKu9qyq9NEN/2iXeK/tpO/47h/2YlHZKvwSjMeM6/28E
++vok5CqJ6Q6/RExyhYI8iUoDYwFBklPQgmBu2P+MorQaOyBtrnSSME5I41Gmy3OX
+BhMDMiObfaLHOqmvl4xR7f76tLQao4f8z4yO5oAVA/3+fb2xdvFfswkrTE2nfLVy
+sdbbOMBnpFS8hwmlOboafj90YK09S76UU/NkFsczNexBAJW23plionoomkVN+s2m
+d/beWHJQyH1pONsHBITYTTn3UBNDri2vRaQqOVY8uLfYJqQ2ySOqqrhJCyG6nnor
+f00pnw4AHrRepvpJ/o3ldFfYutmSLNKshB3ypqREHL+IQTJ+0cMvbrwPXRmmj3Qr
+Z7rdqdtotc6dJUjfVAjQHU8uWyS8BQ/7WEb6AspTkynPECfCoBjQ9dS5PF7fjmz1
+fLm0VMw5Fl082pazw2zUcF3TMKemvW/dQbyo3kJgWZqFJQ0qRcMFtG56Sk3KjArl
+bDS8IJttSsrKtqY6oNvDDiAaEht33csdf8MNDefB/ZbSx2iAmaDZijMho4uiWqd+
+JwYCf+1gETc0VBd/TZAUHmk3DbrwK/CjLWJ5yHao6sjnOx/GT8IM16zwd1Nd8FC0
+35sDyk1B4RiyJTCGHWPlZ7FTzWtOgxq5Xi0FFWvUjrGX/DEDV8u/J3/NXyd+Zuc8
+Fwm2ESpPM83rGtNv1RWLi85oa36aleV0fxdX2QIDAQABAoIEAGv5ltvmLQ/A93xc
+x0BWEINRkBa2jrfpo9B5dOnuikWtza/Cx+X2NfQHFlSrcHhfr/JX5BsCb2iVo8DM
+CXAgeX1VMHS9wQXuxciaHCZDnqxmxUNDU3EjsYQOKLusRcdL6M+Zuz/ny+7PQ0Qw
+/N0yS46Wa9oUjon3RKRvTeSV4HIpFpcP3n/eLjDc/ielWuujnTGcBnjNWegvQROp
+5/7221YElGh8U84kbK2l9DtfjwoGoTv11lPvOxXE/scg6em7r9j+y3p3TMzMeDtT
+YBC6CA4Oa7GrWLJXROOKOQ0ddtvFNlUsZ02vG2QCbqU2y8mwJrJDI80qNbeKGel3
+SfwkssedtGoOOYHxNczwpyVNHVHrHuMPBe75gbo+5pFxVJ5ymCGWfbLJf73oVsqW
+ZimoknvkozW4+mlVlcmo3X73IxTW2U4RlXthYdj9KXsBLRaKVCQJDc934eHWkXHU
+GF2U2NonqOVd8YG/FmZQ2ig6EcW97hC6wnsWT2Uc7UNAE2RM4bY0xCUHaQiKTrEs
+CI6wpbbTV+XhDu2HmL9G+fsuSIu0RoSOCmr5jQDAVwCNPXFgBgcIxbPZ/UCJ7RHj
+GrWPBldAN8ip4osiA+B3XwBabcvwXP2fgBP/eLWN1St3q3tw5xpHpqCuhNuPSqsc
+0ntz0oIdJyRR6fXWmRFex4kXQ597z5ozm0uyg8arV3HJFxDC3DI6kKfs86/oqMSW
+l+9g+d4x6VrUOCTDk0bjN3T8HQ9ASfy9JVacqk6yuXX7a0WeeT+x9JsvFAjg2KmG
+CJUtm5w5siItMDSPpcRE4hlfgh+M7ZKS3PFgH3vvwfPMbC/IC93QoSaFzRJMyobX
+ei6PNwqJvL+HADlMfLmehE2w9ycp4Fe1Gw/NW0Ed1S6Ajo45hgXQJSIrzla6eglg
+JPsPpQ8b+weZNQ8zvc0KvfRJmZKKEb9dHvFdi68I1kV8aapQsjrMOjwHC2pnCFh/
+axkVc7a59fKUs7L6nAJhCs2sSixTorZz5PvJ6mXhWu72TCzu+kThNnEORrlWPHQl
+RFEAFpDDaGSzOMlhb92CWUMPyZU2qtzMzv4QGbP5YqTy121hXuT5OBKCF3eNLihV
+aje16k0RMFqqW3Olbm7Mp2P1C6DuwzsUJBnNwB5JzhC79Po88zNAl2d1h+qysKU1
+jxF316nhpWJ2dGJ/sbJ+XpUMd/tVrNFQMA254GFfXycsfBoQOSY5d6GfRwKUDOou
+xImbIzGUAaIYdsGKDuKtqs5S21JMJjJ/J5CwjLu9tbpP/jsp22KHCpraHAQCupSp
++SFwWI7tRUXzREuxJixfUOnJFQYOATnMFvvtk1d6v4xoPYCVEhHq8gHqJkTyTi3Y
+BPVwT1UCggIBAOEy5gThTrEqSVFUcFJm9bJxtWZt/YhOIJWNNxeaxExHzy5hPpsw
+fZXtN4MUCeMSWI4isgIujmltwgOHMjQqsJPISn/1gVrqLmrZ2PnFzko/WA8rMUfd
+EUnOOpj2bKpChlRGHi76ZV4XGgoTXyO6mrVUcUgf3reSImdcdQ5IHa7J+lWhCQGb
+neZIyDOk41LX1TxjcYkY7vuUgmbBYComXPm2UaY3HN4E/3ElXntj6PrlozL33A56
+z4UPfv2Vv9kl0ydkTJe/WcUN2htqLFCYygF2XLlwbv2SYDCT31PkJUORbScUM46A
+DOhlxvLBFcpF+l0RtCtvnrKyFy9yZJKrcLh9x6xVChZ/aQqSptSHjll5IEcVm54Y
+Z1TjWizCI4txnaBFV0UCLt1CZrllXnyIksZLS4/dVqUIKmkxPBQUpiD5dmgDcmPB
+/LdWzS6k4MH3J3Y3tu3MNPHDwgUtnifSZrsWSYPK0F8J0dMU/mLaS9eOplAH7Eo1
+t7OrrImvitM6tUdErRYilIaoS/6YPmsPST5gY1N4n8Lf4sAE/tY8fwaWRpTVSrIw
+CoFwLtHESUOhqfuAOdr1EkDfo/RQTUVdnmWZ+D0j3du8MmsMje4x3f2CjBDXqArl
+gNnBQELDmrdif8KELNjlEpTIz0T7wEfquhVQ2dzhFpL7RLAgggD+oEBLAoICAQDa
+5WOWrAtaI1cC5C7LFxM2qXTHGRttfAtVxuigJapLqNASJuu59GGRxsCVwhthbNFh
+aCMSj+fZK7QNFkaoPwuZCEtzy0ErkVZzxYp3cP6b99mzGoCcuqiHiW5qhEkbxwdC
+f3YEsSGqE6j8TPW8feiziqo8q+QPSudI9ngkH1gjgbIrTu9iaxKJcF2CwBxe5tfB
+uFBNPIgJAaLPejRKQu17MAV2jDnBDIsZUZnm53IxQ+giIYUBay3cfC1KMJu/AnZ/
+CxETjgqqnzqdFW0b0o49Q6YQa6QXAiSjs+lL/BhjbdA5quVdFmA3CoASFQbihYfM
+4vilUg7Y4wXfzS7DyBZdfppIn+HI8PPSMv/lfdsQXecl5TU1fBDPRWYPpTZqm1II
+HDCkmGRKet/j4/oobabNRrJ6PJcxNjqeMVv/a72pypDRPIXzNxLb1BkfWDGfgu2R
+YAdRNBSJSpdoHDZ+1VO2A+/8gz9Zuiv1WxoX7+u3pCAd+0vCfHiaXiFVc7fI8F+m
+rtDmN5p3DD9l1+/v7yd+7eUezwxYecElw5E5MyAJRTYGrim8g7XvF/u9rXvH09VP
+TeIE8oJ7XzrxCmtGIxlJs6FmgUbUblOyfPZDUqPnzlo8Ru1H2iKRo2FPiMfij8mh
+H3wgFTnZpGDQjw/xop51bxVueXrmOeguS0wmk/8Z6wKCAgEA0y+bPApadJRWS1nn
+N69sTBqMZfFR6Eh0ECts9criuTJCXZk+T+SqcTYTb+4T04k52Jk63Aby8HXIkuxv
+LTK3gu86xkLiOvMP8o43Bwz0BvbeSuNThLQQ6Wjn1NiLUSOvu0pCNgYFl7YMalR+
+TRBK0y/MSDny762wa8Pt1iXVCDxLcY/h1UstSW8JqDzCHcdgJhCPwWTLgMxleZ1w
+5DYzzM2oRjq67I49Sssjjo1ESD2fzUVZbY7IG11L1t1fG3F4UiGiHlCJC92Qo1Lv
+Geoezj5EeHay70Mcx5F0xsRWGcZAWXx9WO5GrI39g1uFZro3Lp5SmsVDSwrt6UXa
+gR0bSThTTw40tqJnTE34+6ff25JWrbLay+jQxm+q+fxZvwQeMNW2IHYKot4JXWVt
+tVWSZzjnNJP6FCvTMfDFCYPPw26OFr7cwCaEKx7QriRazitMK3XWK6zsHalZwudj
+wK50PpCJAnno7KdVySCP6v4ST6Rr3POBKJq1ml2tITWo96u/ooUJ2I83QAyFr8zw
+BBBCvKdBnl6pW+P/TdmhbiEvcmrs59gaA34/6+DbV0Y++piZwswd9XML2iCgLZY8
+0IcZ6uf4PsXq4Yzcrz0HwM+tAXcyiPzkjstpCUxMShALgFxzuWOgdwpjYXnrviJk
+0EyUkzbOCHBhbhcK9CyYHfyrJX8CggIAdWwgJC9eV5glkPN+9osGT4hPkI4zXGPy
+YK03FNGfrL59/37JbRNfU6fen3dk4LpTB4Gpbserg6AiEfMlLBPF0O3WK+OYrhpk
+2e3Z/YCr1Fb8fUt2Op0W0r4ycQlNfo0ho9ZkJNgwSuAJAm72U4rnTYjREYLT8DAq
+KcWtZRM7YLCuNvU9DPqLExcn0n/juDT1AIIy8XvLLamnAM15R2znn/F+vL00Lg7g
+f1B60pbNdwgKemSoyL4J+ADU+rtgkPJtRnFVU7walLSd6K4ZvZcRnmOvrZdQitcn
+eHmGaLBvFMdPr9+w8mKScnQ7h3eoHdOrqYkIAQcn18jQ2eFjeLrY5IaJlPPPVs+K
+u/OHuj/tR7ZXzMhL5skK62U6/qGNs1pmgts8bM8i3aFUgRdGlnFbzTpje5cNM+T3
+RO0NgNL3ByIW1Wc2I+YjQ7FfWKUi2YKOljGBO1pIue09kyevRBKDuVwbXMW7MhLg
+idm5AaY+OGDeqbaoSUgkGgrsrr5IlI39gZi9jwG85qe3Spavq3ILKdfL1N8UrFGD
+/xIN0TVPtilede7vjKTK79tZu8JYaDWGc+g/mo/M1wmawLrqGNGzOwoVRruKl2In
+m9PU9wBZ1HuphDQ4DRdC/AU8qkGhmDOx4bDWEQ/R3KKFHNvhnamyfyR7xqt79gyS
+NGNIElnJuskCggIARFaK6yAVmaL74Qu3iiELj8FU9Cw8kPP5HeWUfGxCjlegdH3R
+FBtoQlDcQjYzO2uZR94Itg3yk3Dt+xbf7KxUsODwlgLj1UhV4eOXUDTosBFTrbTG
+v9gnRVH0Eyu9tF+CMUcCXhq6tnIrQOVv1ozcdXfIpk9gvIbfh4rlo6X0iM8Xge2t
+Vo7awq05t4wJBkO1xUtOaw9HabaszK/CU1iNV7cIBmaFF3AEP/KVfOs+kjubc9AF
+mqC+LVVClvJPNzm1YA5JZlxmQ0u1xXFqZv0OMoibgY+gSzaiAQz3eKB6vEv4Xv4U
+kaF9nEUTEjowpTE6uX9X0mGkXXT2wXmlTjosZFnxRX5IIrRNug30plRra5CNYPGp
+3uTmD/D7Nzi1iYitJg3yhrTQmCWiJY3x4Z0xophLkio2nlJ9WoTKf1AwTIATY7fa
+pX9bxEKldYXrYZNFlbqBPFgA/36v+JDVfMf2E9yRMCt0LAJ0HUM6zP0ngMv+S1TP
+Pu6X0WXR9JeuoaF4uJSty/xwdpST/CkHflFLVsk5n3tNQfWGjqoTSOJMgL9NRY9e
+Pc/OshHZHeCVFUSXtcf1pfmmBtT6FHX0L4cgVqA5xO8RYapnLDAFLXq2/dRv3NwW
+W9CzZcZKh7jmJw4iSIY5IU1+ThgugWoxlkcmjs/egjBclL8BBfqRIwx/vOE=
-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/suite/binlog/combinations b/mysql-test/suite/binlog/combinations
index ea25611a5d4..07042c2cbec 100644
--- a/mysql-test/suite/binlog/combinations
+++ b/mysql-test/suite/binlog/combinations
@@ -1,8 +1,8 @@
[row]
---binlog-format=row
+binlog-format=row
[stmt]
---binlog-format=statement
+binlog-format=statement
[mix]
---binlog-format=mixed
+binlog-format=mixed
diff --git a/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result b/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
index 68f1f0b2566..8df0568a755 100644
--- a/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
+++ b/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
@@ -1,3 +1,4 @@
+SET @old_relay_log_purge= @@global.relay_log_purge;
change master to
MASTER_HOST='dummy.localdomain',
RELAY_LOG_FILE='slave-relay-bin.000001',
@@ -37,3 +38,4 @@ DROP PROCEDURE IF EXISTS p2;
DROP FUNCTION IF EXISTS f1;
DROP TRIGGER IF EXISTS tr1;
stop slave sql_thread;
+SET @@global.relay_log_purge= @old_relay_log_purge;
diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result
index fbc2b8344ee..58c444c9571 100644
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result
@@ -37,7 +37,7 @@ DELIMITER /*!*/;
# at 102
<#>use test/*!*/;
SET TIMESTAMP=1196959712/*!*/;
-<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result
index 3b470fe11af..8dbe0f21852 100644
--- a/mysql-test/suite/binlog/r/binlog_database.result
+++ b/mysql-test/suite/binlog/r/binlog_database.result
@@ -33,6 +33,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values (1)
master-bin.000001 # Query # # drop database if exists mysqltest1
master-bin.000001 # Query # # use `test`; insert into t1 values (1)
master-bin.000001 # Query # # use `test`; drop table tt1, t1
+FLUSH STATUS;
set binlog_format=mixed;
reset master;
create database testing_1;
@@ -68,6 +69,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values (1)
master-bin.000001 # Query # # drop database if exists mysqltest1
master-bin.000001 # Query # # use `test`; insert into t1 values (1)
master-bin.000001 # Query # # use `test`; drop table tt1, t1
+FLUSH STATUS;
set binlog_format=row;
reset master;
create database testing_1;
@@ -108,8 +110,10 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+FLUSH STATUS;
show databases;
Database
information_schema
+mtr
mysql
test
diff --git a/mysql-test/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result
index 9f3c3746bd4..d49ceb00501 100644
--- a/mysql-test/r/binlog_index.result
+++ b/mysql-test/suite/binlog/r/binlog_index.result
@@ -9,7 +9,7 @@ master-bin.000003 #
master-bin.000004 #
purge binary logs TO 'master-bin.000004';
Warnings:
-Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
+Warning 1612 Being purged log master-bin.000001 was not found
*** must show a list starting from the 'TO' argument of PURGE ***
show binary logs;
Log_name File_size
@@ -20,7 +20,8 @@ flush logs;
flush logs;
*** must be a warning master-bin.000001 was not found ***
Warnings:
-Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
+Warning 1612 Being purged log master-bin.000001 was not found
+Warning 1612 Being purged log master-bin.000001 was not found
*** must show one record, of the active binlog, left in the index file after PURGE ***
show binary logs;
Log_name File_size
@@ -33,7 +34,7 @@ purge binary logs TO 'master-bin.000002';
ERROR HY000: Fatal error during log purge
show warnings;
Level Code Message
-Error 1377 a problem with deleting MYSQLTEST_VARDIR/log/master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
+Error 1377 a problem with deleting master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
Error 1377 Fatal error during log purge
reset master;
End of tests
diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result
index adc90d007bd..919ac33ef35 100644
--- a/mysql-test/suite/binlog/r/binlog_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_innodb.result
@@ -113,16 +113,17 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
DROP TABLE t1;
+flush status;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 15
+Binlog_cache_use 0
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 0
create table t1 (a int) engine=innodb;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 16
+Binlog_cache_use 1
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
@@ -131,7 +132,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 17
+Binlog_cache_use 2
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result
new file mode 100644
index 00000000000..fab79c4bc2f
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result
@@ -0,0 +1,31 @@
+CREATE TABLE t1 (i int unique) ENGINE=innodb;
+reset master;
+begin;
+insert into t1 values (1),(2);
+*** the following UPDATE query wont generate any updates for the binlog ***
+update t1 set i = 3 where i < 3;
+ERROR 23000: Duplicate entry '3' for key 'i'
+commit;
+*** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+delete from t1;
+reset master;
+begin;
+insert into t1 values (1),(2);
+*** the following UPDATE query wont generate any updates for the binlog ***
+insert into t1 values (3),(4),(1),(2);
+ERROR 23000: Duplicate entry '1' for key 'i'
+commit;
+*** Results of the test: the binlog must have only one Write_rows event not two ***
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+drop table t1;
diff --git a/mysql-test/suite/binlog/r/binlog_killed_simulate.result b/mysql-test/suite/binlog/r/binlog_killed_simulate.result
index 66d3a86cd5a..634d3f62814 100644
--- a/mysql-test/suite/binlog/r/binlog_killed_simulate.result
+++ b/mysql-test/suite/binlog/r/binlog_killed_simulate.result
@@ -14,12 +14,12 @@ select 1 /* must return 1 as query completed before got killed*/;
1
create table t2 (a int, b int) ENGINE=MyISAM;
reset master;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */;
+load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */;
ERROR 70100: Query execution was interrupted
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
-master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=#
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=#
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
is not null;
diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result
index a295657b8f8..caae5f55d13 100644
--- a/mysql-test/suite/binlog/r/binlog_multi_engine.result
+++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result
@@ -17,24 +17,24 @@ TRUNCATE t1b;
TRUNCATE t1n;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
-master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2)
-master-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f
-master-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1n)
-master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # use `test`; TRUNCATE t1m
-master-bin.000001 # Query # # use `test`; TRUNCATE t1b
-master-bin.000001 # Query # # use `test`; TRUNCATE t1n
+mysqld-bin.000001 # Query # # use `test`; BEGIN
+mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
+mysqld-bin.000001 # Query # # use `test`; COMMIT
+mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
+mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
+mysqld-bin.000001 # Query # # use `test`; BEGIN
+mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2)
+mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f
+mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
+mysqld-bin.000001 # Query # # use `test`; COMMIT
+mysqld-bin.000001 # Query # # BEGIN
+mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
+mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query # # COMMIT
+mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m
+mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b
+mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n
RESET MASTER;
SET SESSION BINLOG_FORMAT=MIXED;
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
@@ -48,20 +48,20 @@ TRUNCATE t1b;
TRUNCATE t1n;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1n)
-master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
-master-bin.000001 # Query # # use `test`; TRUNCATE t1m
-master-bin.000001 # Query # # use `test`; TRUNCATE t1b
-master-bin.000001 # Query # # use `test`; TRUNCATE t1n
+mysqld-bin.000001 # Query # # use `test`; BEGIN
+mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
+mysqld-bin.000001 # Query # # use `test`; COMMIT
+mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
+mysqld-bin.000001 # Query # # BEGIN
+mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
+mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows # # table_id: #
+mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query # # COMMIT
+mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
+mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m
+mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b
+mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n
RESET MASTER;
SET SESSION BINLOG_FORMAT=ROW;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
@@ -73,19 +73,19 @@ UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1m)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1b)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1n)
-master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
+mysqld-bin.000001 # Query # # use `test`; BEGIN
+mysqld-bin.000001 # Table_map # # table_id: # (test.t1m)
+mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query # # use `test`; COMMIT
+mysqld-bin.000001 # Query # # use `test`; BEGIN
+mysqld-bin.000001 # Table_map # # table_id: # (test.t1b)
+mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query # # use `test`; COMMIT
+mysqld-bin.000001 # Query # # BEGIN
+mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
+mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows # # table_id: #
+mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query # # COMMIT
RESET MASTER;
DROP TABLE t1m, t1b, t1n;
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
index a066928fc13..49aa64adfb5 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
@@ -17,7 +17,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
index 7106480663f..4f3bc57e576 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
@@ -133,10 +133,6 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
insert into t1 values(11);
commit;
show binlog events from <binlog_start>;
@@ -148,8 +144,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -278,10 +272,6 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; drop table t1,t2
master-bin.000001 # Query # # use `test`; create table t0 (n int)
master-bin.000001 # Query # # use `test`; BEGIN
@@ -382,16 +372,14 @@ master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
-master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
@@ -400,11 +388,9 @@ master-bin.000001 # Query # # use `test`; DROP TABLE t2
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
@@ -412,10 +398,8 @@ master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
-master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
@@ -685,7 +669,7 @@ delete from t1;
create table t4 (a int default 0, b int primary key) engine=innodb;
insert into t4 values (0, 17);
reset master;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
select * from t4;
a b
@@ -913,7 +897,7 @@ delete from t1;
create table t4 (a int default 0, b int primary key) engine=innodb;
insert into t4 values (0, 17);
reset master;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
select * from t4;
a b
@@ -929,7 +913,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
-master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # use `test`; ROLLBACK
drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5;
diff --git a/mysql-test/suite/binlog/r/binlog_start_comment.result b/mysql-test/suite/binlog/r/binlog_start_comment.result
index 162968195f2..c5c906dfc4e 100644
--- a/mysql-test/suite/binlog/r/binlog_start_comment.result
+++ b/mysql-test/suite/binlog/r/binlog_start_comment.result
@@ -2,7 +2,7 @@ reset master;
drop table if exists t1,t2;
create table t1 (word varchar(20)) -- create table t1;
create table t2 (word varchar(20)) -- create table t2;
-load data infile '../std_data_ln/words.dat' into table t1 -- load data to t1;
+load data infile '../../std_data/words.dat' into table t1 -- load data to t1;
insert into t2 values ("Ada");
flush logs;
select * from t2;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
index 30f298488fc..1cd77cfbed4 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
@@ -92,7 +92,7 @@ insert into t1 values(1);
insert ignore into t1 values(1);
replace into t1 values(100);
create table t2 (a varchar(200)) engine=blackhole;
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
alter table t1 add b int;
alter table t1 drop b;
create table t3 like t1;
@@ -127,7 +127,7 @@ master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581
-master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=#
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/words.dat' into table t2 ;file_id=#
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; alter table t1 add b int
master-bin.000001 # Query # # use `test`; alter table t1 drop b
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
index 1b14686a97d..b7edf7fedb8 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
@@ -16,7 +16,7 @@ SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/;
use test/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
index 3d71f333852..38488c9331d 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
@@ -346,9 +346,7 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (3,3)
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4)
-master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
-master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5)
master-bin.000001 # Query # # use `test`; DROP TABLE t2
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (6,6)
@@ -356,9 +354,7 @@ master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2 (a int, b in
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (7,7)
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (8,8)
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (9,9)
-master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
-master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (10,10)
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t2 values (100,100)
@@ -611,7 +607,7 @@ delete from t1;
create table t4 (a int default 0, b int primary key) engine=innodb;
insert into t4 values (0, 17);
reset master;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
select * from t4;
a b
@@ -625,7 +621,7 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
-master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
drop trigger trg_del_t2;
@@ -845,7 +841,7 @@ delete from t1;
create table t4 (a int default 0, b int primary key) engine=innodb;
insert into t4 values (0, 17);
reset master;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
select * from t4;
a b
@@ -861,7 +857,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
-master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # use `test`; ROLLBACK
drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_row.result b/mysql-test/suite/binlog/r/binlog_stm_row.result
index 97ec38cfb3e..d1cc55f03b3 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_row.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_row.result
@@ -1,5 +1,7 @@
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
+set @saved_global_binlog_format = @@global.binlog_format;
+set @saved_local_binlog_format = @@session.binlog_format;
SET GLOBAL BINLOG_FORMAT = STATEMENT;
SET SESSION BINLOG_FORMAT = STATEMENT;
CREATE TABLE t1 (a INT);
@@ -69,3 +71,5 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
DROP TABLE t1;
DROP TABLE t2;
+SET GLOBAL BINLOG_FORMAT = @saved_global_binlog_format;
+SET SESSION BINLOG_FORMAT = @saved_local_binlog_format;
diff --git a/mysql-test/suite/binlog/r/binlog_tmp_table.result b/mysql-test/suite/binlog/r/binlog_tmp_table.result
new file mode 100644
index 00000000000..e4928432324
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_tmp_table.result
@@ -0,0 +1,30 @@
+create table foo (a int);
+flush logs;
+create temporary table tmp1_foo like foo;
+create temporary table tmp2_foo (a int);
+insert into tmp1_foo values (1), (2), (3), (4);
+replace into tmp2_foo values (1), (2), (3), (4);
+update tmp1_foo set a=2*a-1;
+update tmp2_foo set a=2*a;
+delete from tmp1_foo where a < 5;
+delete from tmp2_foo where a < 5;
+insert into foo select * from tmp1_foo;
+insert into foo select * from tmp2_foo;
+truncate table tmp1_foo;
+truncate table tmp2_foo;
+flush logs;
+select * from foo;
+a
+5
+7
+6
+8
+drop table foo;
+create table foo (a int);
+select * from foo;
+a
+5
+7
+6
+8
+drop table foo;
diff --git a/mysql-test/suite/binlog/r/binlog_truncate_innodb.result b/mysql-test/suite/binlog/r/binlog_truncate_innodb.result
new file mode 100644
index 00000000000..ab237898a74
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_truncate_innodb.result
@@ -0,0 +1,63 @@
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3);
+**** Truncate of empty table shall be logged
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3);
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+**** Truncate of empty table shall be logged
+TRUNCATE TABLE t1;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+TRUNCATE TABLE t2;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3);
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+**** Truncate of empty table shall be logged
+TRUNCATE TABLE t1;
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+TRUNCATE TABLE t2;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3);
+SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+**** Truncate of empty table shall be logged
+TRUNCATE TABLE t1;
+SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+TRUNCATE TABLE t2;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3);
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+**** Truncate of empty table shall be logged
+TRUNCATE TABLE t1;
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+TRUNCATE TABLE t2;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/binlog/r/binlog_truncate_myisam.result b/mysql-test/suite/binlog/r/binlog_truncate_myisam.result
new file mode 100644
index 00000000000..9f01c015178
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_truncate_myisam.result
@@ -0,0 +1,12 @@
+RESET MASTER;
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(2),(3);
+**** Truncate of empty table shall be logged
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
+master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
index 1f7b217dc31..7c0980ba77c 100644
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result
@@ -220,3 +220,10 @@ Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
DROP PROCEDURE p1;
DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100));
+INSERT INTO t1 VALUES ('a','b');
+UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
+Warnings:
+Warning 1592 Statement is not safe to log in statement format.
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
index e77c9398c59..f20cc33f820 100644
--- a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
+++ b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
@@ -17,9 +17,15 @@
source include/have_log_bin.inc;
-copy_file $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001 $MYSQLTEST_VARDIR/master-data/slave-relay-bin.000001;
+# Need to restore this at the end; CHANGE MASTER modifies it (see the
+# manual for CHANGE MASTER).
+SET @old_relay_log_purge= @@global.relay_log_purge;
-write_file $MYSQLTEST_VARDIR/master-data/slave-relay-bin.index;
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+copy_file $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001 $MYSQLD_DATADIR/slave-relay-bin.000001;
+
+write_file $MYSQLD_DATADIR/slave-relay-bin.index;
slave-relay-bin.000001
EOF
@@ -46,9 +52,9 @@ DROP FUNCTION IF EXISTS f1;
DROP TRIGGER IF EXISTS tr1;
enable_warnings;
-remove_file $MYSQLTEST_VARDIR/master-data/slave-relay-bin.000001;
-remove_file $MYSQLTEST_VARDIR/master-data/slave-relay-bin.index;
+remove_file $MYSQLD_DATADIR/slave-relay-bin.000001;
+remove_file $MYSQLD_DATADIR/slave-relay-bin.index;
stop slave sql_thread;
-let $keep_connection=1;
source include/wait_for_slave_sql_to_stop.inc;
+SET @@global.relay_log_purge= @old_relay_log_purge;
diff --git a/mysql-test/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test
index 1e44a9b02e2..13287465b88 100644
--- a/mysql-test/t/binlog_index.test
+++ b/mysql-test/suite/binlog/t/binlog_index.test
@@ -13,11 +13,11 @@ flush logs;
flush logs;
source include/show_binary_logs.inc;
-
-remove_file $MYSQLTEST_VARDIR/log/master-bin.000001;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/master-bin.000001;
# there must be a warning with file names
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+replace_regex /\.[\\\/]master/master/;
purge binary logs TO 'master-bin.000004';
--echo *** must show a list starting from the 'TO' argument of PURGE ***
@@ -32,12 +32,12 @@ reset master;
flush logs;
flush logs;
flush logs;
-remove_file $MYSQLTEST_VARDIR/log/master-bin.000001;
+remove_file $MYSQLD_DATADIR/master-bin.000001;
--echo *** must be a warning master-bin.000001 was not found ***
let $date=`select NOW() + INTERVAL 1 MINUTE`;
--disable_query_log
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+replace_regex /\.[\\\/]master/master/;
eval purge binary logs BEFORE '$date';
--enable_query_log
@@ -55,14 +55,14 @@ flush logs;
flush logs;
flush logs;
-remove_file $MYSQLTEST_VARDIR/log/master-bin.000001;
-mkdir $MYSQLTEST_VARDIR/log/master-bin.000001;
+remove_file $MYSQLD_DATADIR/master-bin.000001;
+mkdir $MYSQLD_DATADIR/master-bin.000001;
--error ER_BINLOG_PURGE_FATAL_ERR
purge binary logs TO 'master-bin.000002';
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+replace_regex /\.[\\\/]master/master/;
show warnings;
-rmdir $MYSQLTEST_VARDIR/log/master-bin.000001;
+rmdir $MYSQLD_DATADIR/master-bin.000001;
--disable_warnings
reset master;
--enable_warnings
diff --git a/mysql-test/suite/binlog/t/binlog_innodb.test b/mysql-test/suite/binlog/t/binlog_innodb.test
index df99e3786ee..f84fd65226a 100644
--- a/mysql-test/suite/binlog/t/binlog_innodb.test
+++ b/mysql-test/suite/binlog/t/binlog_innodb.test
@@ -101,6 +101,7 @@ DROP TABLE t1;
# Actually this test has nothing to do with innodb per se, it just requires
# transactional table.
#
+flush status;
show status like "binlog_cache_use";
show status like "binlog_cache_disk_use";
diff --git a/mysql-test/suite/binlog/t/binlog_innodb_row.test b/mysql-test/suite/binlog/t/binlog_innodb_row.test
new file mode 100644
index 00000000000..aaba98e3284
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_innodb_row.test
@@ -0,0 +1,42 @@
+#
+# Tests of innodb/binlog with the row binlog format
+#
+source include/have_innodb.inc;
+source include/have_log_bin.inc;
+source include/have_binlog_format_row.inc;
+
+#
+# Bug #40221 Replication failure on RBR + UPDATE the primary key
+#
+
+CREATE TABLE t1 (i int unique) ENGINE=innodb;
+reset master;
+
+# part 1: update can cause the dup key
+
+begin;
+insert into t1 values (1),(2);
+--echo *** the following UPDATE query wont generate any updates for the binlog ***
+--error ER_DUP_ENTRY
+update t1 set i = 3 where i < 3;
+commit;
+
+--echo *** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
+source include/show_binlog_events.inc;
+
+# part 2: insert can cause the dup key
+
+delete from t1;
+reset master;
+
+begin;
+insert into t1 values (1),(2);
+--echo *** the following UPDATE query wont generate any updates for the binlog ***
+--error ER_DUP_ENTRY
+insert into t1 values (3),(4),(1),(2);
+commit;
+
+--echo *** Results of the test: the binlog must have only one Write_rows event not two ***
+source include/show_binlog_events.inc;
+
+drop table t1;
diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
index e63186b64c8..9b30ec4a0db 100644
--- a/mysql-test/suite/binlog/t/binlog_killed.test
+++ b/mysql-test/suite/binlog/t/binlog_killed.test
@@ -50,7 +50,8 @@ connection con2;
reap;
let $rows= `select count(*) from t2 /* must be 2 or 0 */`;
---exec $MYSQL_BINLOG --force-if-open --start-position=134 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYSQL_BINLOG --force-if-open --start-position=134 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
@@ -261,7 +262,7 @@ source include/show_binlog_events.inc;
# a proof the query is binlogged with an error
---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
+--exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
@@ -307,7 +308,7 @@ source include/show_binlog_events.inc;
# a proof the query is binlogged with an error
---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
+--exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test
index 8af51fc5fe5..ec61271ae88 100644
--- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test
+++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test
@@ -23,7 +23,8 @@ update t1 set a=2 /* will be "killed" after work has been done */;
#todo: introduce a suite private macro that provides numeric values
# for some constants like the offset of the first real event
# that is different between severs versions.
---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
@@ -44,14 +45,14 @@ remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
create table t2 (a int, b int) ENGINE=MyISAM;
reset master;
--error ER_QUERY_INTERRUPTED
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */;
+load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */;
# a proof the query is binlogged with an error
source include/show_binlog_events.inc;
---exec $MYSQL_BINLOG --force-if-open --start-position=98 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
+--exec $MYSQL_BINLOG --force-if-open --start-position=98 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
diff --git a/mysql-test/suite/binlog/t/binlog_start_comment.test b/mysql-test/suite/binlog/t/binlog_start_comment.test
index 6f8540efd07..98f2ca05505 100644
--- a/mysql-test/suite/binlog/t/binlog_start_comment.test
+++ b/mysql-test/suite/binlog/t/binlog_start_comment.test
@@ -10,15 +10,16 @@ drop table if exists t1,t2;
--enable_warnings
create table t1 (word varchar(20)) -- create table t1;
create table t2 (word varchar(20)) -- create table t2;
-load data infile '../std_data_ln/words.dat' into table t1 -- load data to t1;
+load data infile '../../std_data/words.dat' into table t1 -- load data to t1;
insert into t2 values ("Ada");
flush logs;
select * from t2;
---exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
--exec $MYSQL --local-infile=1 < $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
flush logs;
select * from t2;
# clean up
drop table t1,t2;
-#--remove_file $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
+remove_file $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog;
diff --git a/mysql-test/suite/binlog/t/binlog_stm_row.test b/mysql-test/suite/binlog/t/binlog_stm_row.test
index 4944e65c9f3..e923faae940 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_row.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_row.test
@@ -19,6 +19,8 @@ DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings
+set @saved_global_binlog_format = @@global.binlog_format;
+set @saved_local_binlog_format = @@session.binlog_format;
SET GLOBAL BINLOG_FORMAT = STATEMENT;
SET SESSION BINLOG_FORMAT = STATEMENT;
@@ -105,3 +107,5 @@ source include/show_binlog_events.inc;
DROP TABLE t1;
DROP TABLE t2;
+SET GLOBAL BINLOG_FORMAT = @saved_global_binlog_format;
+SET SESSION BINLOG_FORMAT = @saved_local_binlog_format;
diff --git a/mysql-test/suite/binlog/t/binlog_tmp_table.test b/mysql-test/suite/binlog/t/binlog_tmp_table.test
new file mode 100644
index 00000000000..6947959a5e0
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_tmp_table.test
@@ -0,0 +1,83 @@
+# ==== Purpose ====
+#
+# Test if statements used temporary tables are binlogged correctly
+#
+# ==== Method ====
+#
+# Use two connections, use temporary tables on both of them, and by
+# switching connections between statements, the test can check if the
+# statements are logged with the correct thread id.
+#
+# The statements current tested include:
+# CREATE TEMPORARY TABLE
+# CREATE TEMPORARY TABLE LIKE
+# INSERT
+# REPLACE
+# UPDATE
+# INSERT SELECT
+# TRUNCATE
+#
+# Note: When adding new query statements, please add them between the
+# two 'flush logs'. And aslo please make sure the connection is
+# switched between each statement.
+#
+# ==== Related bugs ====
+#
+# BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used
+#
+source include/have_log_bin.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
+
+create table foo (a int);
+
+flush logs;
+
+connection master;
+create temporary table tmp1_foo like foo;
+connection master1;
+create temporary table tmp2_foo (a int);
+
+connection master;
+insert into tmp1_foo values (1), (2), (3), (4);
+connection master1;
+replace into tmp2_foo values (1), (2), (3), (4);
+
+connection master;
+update tmp1_foo set a=2*a-1;
+connection master1;
+update tmp2_foo set a=2*a;
+
+connection master;
+delete from tmp1_foo where a < 5;
+connection master1;
+delete from tmp2_foo where a < 5;
+
+connection master;
+insert into foo select * from tmp1_foo;
+connection master1;
+insert into foo select * from tmp2_foo;
+
+connection master;
+truncate table tmp1_foo;
+connection master1;
+truncate table tmp2_foo;
+
+flush logs;
+
+connection default;
+select * from foo;
+
+# prepare for the replay
+drop table foo;
+create table foo (a int);
+
+# replay from binary log
+let $MYSQLD_DATADIR= `select @@datadir`;
+exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000002 | $MYSQL;
+select * from foo;
+
+# clean up
+drop table foo;
diff --git a/mysql-test/suite/binlog/t/binlog_truncate_innodb-master.opt b/mysql-test/suite/binlog/t/binlog_truncate_innodb-master.opt
new file mode 100644
index 00000000000..69cc489a969
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_truncate_innodb-master.opt
@@ -0,0 +1 @@
+--loose-innodb \ No newline at end of file
diff --git a/mysql-test/suite/binlog/t/binlog_truncate_innodb.test b/mysql-test/suite/binlog/t/binlog_truncate_innodb.test
new file mode 100644
index 00000000000..be0918a43f0
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_truncate_innodb.test
@@ -0,0 +1,29 @@
+source include/have_log_bin.inc;
+source include/have_innodb.inc;
+
+# It is necessary to reset the master since otherwise the binlog test
+# might show the wrong binary log. The default for SHOW BINLOG EVENTS
+# is to show the first binary log, not the current one (which is
+# actually a better idea).
+
+RESET MASTER;
+
+let $engine = InnoDB;
+source extra/binlog_tests/binlog_truncate.test;
+
+# Under transaction isolation level READ UNCOMMITTED and READ
+# COMMITTED, InnoDB does not permit statement-based replication of
+# row-deleting statement. In these cases, TRUNCATE TABLE should still
+# be replicated as a statement.
+
+let $before_truncate = SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+source extra/binlog_tests/binlog_truncate.test;
+
+let $before_truncate = SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+source extra/binlog_tests/binlog_truncate.test;
+
+let $before_truncate = SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+source extra/binlog_tests/binlog_truncate.test;
+
+let $before_truncate = SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+source extra/binlog_tests/binlog_truncate.test;
diff --git a/mysql-test/suite/binlog/t/binlog_truncate_myisam.test b/mysql-test/suite/binlog/t/binlog_truncate_myisam.test
new file mode 100644
index 00000000000..e0e4673e876
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_truncate_myisam.test
@@ -0,0 +1,11 @@
+source include/have_log_bin.inc;
+
+# It is necessary to reset the master since otherwise the binlog test
+# might show the wrong binary log. The default for SHOW BINLOG EVENTS
+# is to show the first binary log, not the current one (which is
+# actually a better idea).
+
+RESET MASTER;
+
+let $engine = MyISAM;
+source extra/binlog_tests/binlog_truncate.test;
diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test
index 0d7059bc31f..f58233d4fef 100644
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test
@@ -257,3 +257,17 @@ delimiter ;|
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
+
+#
+# Bug#42634: % character in query can cause mysqld signal 11 segfault
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100));
+INSERT INTO t1 VALUES ('a','b');
+UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def
index 888298bbb09..0018387de94 100644
--- a/mysql-test/suite/binlog/t/disabled.def
+++ b/mysql-test/suite/binlog/t/disabled.def
@@ -9,3 +9,5 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
+binlog_truncate_innodb : BUG#42643 2009-02-06 mats Changes to InnoDB requires to complete fix for BUG#36763
+
diff --git a/mysql-test/suite/bugs/combinations b/mysql-test/suite/bugs/combinations
index ea25611a5d4..07042c2cbec 100644
--- a/mysql-test/suite/bugs/combinations
+++ b/mysql-test/suite/bugs/combinations
@@ -1,8 +1,8 @@
[row]
---binlog-format=row
+binlog-format=row
[stmt]
---binlog-format=statement
+binlog-format=statement
[mix]
---binlog-format=mixed
+binlog-format=mixed
diff --git a/mysql-test/suite/bugs/r/rpl_bug36391.result b/mysql-test/suite/bugs/r/rpl_bug36391.result
new file mode 100644
index 00000000000..2d62837a87a
--- /dev/null
+++ b/mysql-test/suite/bugs/r/rpl_bug36391.result
@@ -0,0 +1,17 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+create table t1(id int);
+show tables;
+Tables_in_test
+t1
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 278
+flush logs;
diff --git a/mysql-test/suite/bugs/t/rpl_bug36391-master.opt b/mysql-test/suite/bugs/t/rpl_bug36391-master.opt
new file mode 100644
index 00000000000..56273241f14
--- /dev/null
+++ b/mysql-test/suite/bugs/t/rpl_bug36391-master.opt
@@ -0,0 +1 @@
+--sql_mode=NO_BACKSLASH_ESCAPES
diff --git a/mysql-test/suite/bugs/t/rpl_bug36391.test b/mysql-test/suite/bugs/t/rpl_bug36391.test
new file mode 100644
index 00000000000..9f384304837
--- /dev/null
+++ b/mysql-test/suite/bugs/t/rpl_bug36391.test
@@ -0,0 +1,28 @@
+#
+# BUG#36391 and BUG#38731
+#
+# The fix for BUG#20103 "Escaping with backslash does not work as expected"
+# was implemented too greedy though in that it not only changes the behavior
+# of backslashes within strings but in general, so disabling command shortcuts
+# like \G or \C (which in turn leads to BUG#36391: "mysqlbinlog creates invalid charset statements".
+#
+# The test executes simple commands that are stored in the binary log and
+# re-execute them through the mysql client which should have to process
+# some command shortcuts. The backslashes within strings is disabled in the file
+# rpl_bug36391-master.opt by the option --sql_mode=NO_BACKSLASH_ESCAPES.
+#
+#
+
+--source include/master-slave.inc
+
+drop table if exists t1;
+
+create table t1(id int);
+
+show tables;
+
+show master status;
+
+flush logs;
+
+--exec $MYSQL_BINLOG $MYSQL_TEST_DIR/var/log/master-bin.000001 | $MYSQL test
diff --git a/mysql-test/suite/federated/disabled.def b/mysql-test/suite/federated/disabled.def
new file mode 100644
index 00000000000..9a9149ec80a
--- /dev/null
+++ b/mysql-test/suite/federated/disabled.def
@@ -0,0 +1,12 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+federated_transactions : Bug#29523 Transactions do not work
diff --git a/mysql-test/suite/federated/federated.inc b/mysql-test/suite/federated/federated.inc
new file mode 100644
index 00000000000..ad640dcbb61
--- /dev/null
+++ b/mysql-test/suite/federated/federated.inc
@@ -0,0 +1,11 @@
+--source include/not_embedded.inc
+--source have_federated_db.inc
+
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
+
+connection master;
+CREATE DATABASE federated;
+
+connection slave;
+CREATE DATABASE federated;
diff --git a/mysql-test/r/federated.result b/mysql-test/suite/federated/federated.result
index efd288613a0..e54aa63b2ac 100644
--- a/mysql-test/r/federated.result
+++ b/mysql-test/suite/federated/federated.result
@@ -1,13 +1,4 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-stop slave;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
@@ -1695,7 +1686,7 @@ a b c
13 17 221
19 23 437
delete from federated.t1;
-load data infile '../std_data_ln/loaddata5.dat' into table federated.t1 fields terminated by '' enclosed by '' ignore 1 lines (a, b);
+load data infile '../../std_data/loaddata5.dat' into table federated.t1 fields terminated by '' enclosed by '' ignore 1 lines (a, b);
select * from federated.t1 order by a;
a b c
3 4 12
@@ -2146,6 +2137,6 @@ End of 5.1 tests
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
diff --git a/mysql-test/t/federated.test b/mysql-test/suite/federated/federated.test
index f45bff2597f..fa448e74a18 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/suite/federated/federated.test
@@ -6,7 +6,7 @@
# should work with embedded server after mysqltest is fixed
--source include/not_embedded.inc
---source include/federated.inc
+--source federated.inc
connection default;
@@ -1537,7 +1537,7 @@ insert into federated.t1 (a, b) select * from federated.t2;
select * from federated.t1 order by a;
delete from federated.t1;
# load
-load data infile '../std_data_ln/loaddata5.dat' into table federated.t1 fields terminated by '' enclosed by '' ignore 1 lines (a, b);
+load data infile '../../std_data/loaddata5.dat' into table federated.t1 fields terminated by '' enclosed by '' ignore 1 lines (a, b);
select * from federated.t1 order by a;
drop tables federated.t1, federated.t2;
@@ -1955,4 +1955,4 @@ connection slave;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
connection default;
-source include/federated_cleanup.inc;
+source federated_cleanup.inc;
diff --git a/mysql-test/r/federated_archive.result b/mysql-test/suite/federated/federated_archive.result
index 3fd7cb2acd4..b7960e2a561 100644
--- a/mysql-test/r/federated_archive.result
+++ b/mysql-test/suite/federated/federated_archive.result
@@ -1,13 +1,4 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-stop slave;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
DROP TABLE IF EXISTS federated.archive_table;
CREATE TABLE federated.archive_table (
@@ -43,6 +34,6 @@ id name
DROP TABLE federated.t1;
DROP TABLE federated.archive_table;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
diff --git a/mysql-test/t/federated_archive.test b/mysql-test/suite/federated/federated_archive.test
index f8df5f1c51a..1bde23889be 100644
--- a/mysql-test/t/federated_archive.test
+++ b/mysql-test/suite/federated/federated_archive.test
@@ -1,7 +1,5 @@
-# should work with embedded server after mysqltest is fixed
--- source include/not_embedded.inc
source include/have_archive.inc;
-source include/federated.inc;
+source federated.inc;
connection slave;
@@ -56,5 +54,5 @@ connection slave;
DROP TABLE federated.archive_table;
-source include/federated_cleanup.inc;
+source federated_cleanup.inc;
diff --git a/mysql-test/r/federated_bug_13118.result b/mysql-test/suite/federated/federated_bug_13118.result
index cc14dae87d9..57175dc8def 100644
--- a/mysql-test/r/federated_bug_13118.result
+++ b/mysql-test/suite/federated/federated_bug_13118.result
@@ -1,13 +1,4 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-stop slave;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
DROP TABLE IF EXISTS federated.bug_13118_table;
CREATE TABLE federated.bug_13118_table (
@@ -34,6 +25,6 @@ foo bar
DROP TABLE federated.t1;
DROP TABLE federated.bug_13118_table;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
diff --git a/mysql-test/t/federated_bug_13118.test b/mysql-test/suite/federated/federated_bug_13118.test
index e429a660489..fad6be75dac 100644
--- a/mysql-test/t/federated_bug_13118.test
+++ b/mysql-test/suite/federated/federated_bug_13118.test
@@ -1,7 +1,4 @@
-# should work with embedded server after mysqltest is fixed
--- source include/not_embedded.inc
-source include/federated.inc;
-
+source federated.inc;
connection slave;
--disable_warnings
@@ -40,5 +37,5 @@ connection slave;
DROP TABLE federated.bug_13118_table;
-source include/federated_cleanup.inc;
+source federated_cleanup.inc;
diff --git a/mysql-test/r/federated_bug_25714.result b/mysql-test/suite/federated/federated_bug_25714.result
index 5730eedc246..55d9a0ceb52 100644
--- a/mysql-test/r/federated_bug_25714.result
+++ b/mysql-test/suite/federated/federated_bug_25714.result
@@ -1,13 +1,4 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-stop slave;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
@@ -57,6 +48,6 @@ SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
DROP TABLE federated.t1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
diff --git a/mysql-test/t/federated_bug_25714.test b/mysql-test/suite/federated/federated_bug_25714.test
index 6d112cae5b8..82745b2a094 100644
--- a/mysql-test/t/federated_bug_25714.test
+++ b/mysql-test/suite/federated/federated_bug_25714.test
@@ -1,5 +1,10 @@
---source include/have_bug25714.inc
-source include/federated.inc;
+ # Check that path to the specific test program has been setup
+if (`select LENGTH("$MYSQL_BUG25714") = 0`)
+{
+ skip Need bug25714 test program;
+}
+
+source federated.inc;
connection master;
# Disable concurrent inserts to avoid test failures when reading
@@ -53,6 +58,5 @@ DROP TABLE federated.t1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
-source include/federated_cleanup.inc;
-
+source federated_cleanup.inc;
diff --git a/mysql-test/include/federated_cleanup.inc b/mysql-test/suite/federated/federated_cleanup.inc
index 06fd7f6737a..e96a7cd2cee 100644
--- a/mysql-test/include/federated_cleanup.inc
+++ b/mysql-test/suite/federated/federated_cleanup.inc
@@ -1,9 +1,9 @@
connection master;
--disable_warnings
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
connection slave;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
--enable_warnings
diff --git a/mysql-test/t/federated_innodb-slave.opt b/mysql-test/suite/federated/federated_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/federated_innodb-slave.opt
+++ b/mysql-test/suite/federated/federated_innodb-slave.opt
diff --git a/mysql-test/r/federated_innodb.result b/mysql-test/suite/federated/federated_innodb.result
index 70ba3acb279..e6cf81bb1a6 100644
--- a/mysql-test/r/federated_innodb.result
+++ b/mysql-test/suite/federated/federated_innodb.result
@@ -1,13 +1,4 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-stop slave;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
create table federated.t1 (a int primary key, b varchar(64))
engine=myisam;
@@ -29,6 +20,6 @@ a b
drop table federated.t1;
drop table federated.t1;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
diff --git a/mysql-test/t/federated_innodb.test b/mysql-test/suite/federated/federated_innodb.test
index 0617cb15d97..278c5b18661 100644
--- a/mysql-test/t/federated_innodb.test
+++ b/mysql-test/suite/federated/federated_innodb.test
@@ -4,7 +4,7 @@
# See Bug #40645 Test main.federated_innodb does not always clean up after itself
source include/have_innodb.inc;
-source include/federated.inc;
+source federated.inc;
#
# Bug#25513 Federated transaction failures
@@ -36,4 +36,4 @@ connection slave;
drop table federated.t1;
-source include/federated_cleanup.inc;
+source federated_cleanup.inc;
diff --git a/mysql-test/r/federated_server.result b/mysql-test/suite/federated/federated_server.result
index 32717b4f0e3..2c20d1c1d57 100644
--- a/mysql-test/r/federated_server.result
+++ b/mysql-test/suite/federated/federated_server.result
@@ -1,13 +1,4 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-stop slave;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
-DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
create database first_db;
create database second_db;
@@ -266,9 +257,8 @@ use test;
create procedure p1 ()
begin
DECLARE v INT DEFAULT 0;
-DECLARE e INT DEFAULT 0;
DECLARE i INT;
-DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET i = sleep(5);
WHILE v < 10000 do
CREATE SERVER s
@@ -278,18 +268,13 @@ ALTER SERVER s OPTIONS (USER 'Remote');
DROP SERVER s;
SET v = v + 1;
END WHILE;
-SELECT e > 0;
END//
use test;
call p1();
call p1();
-e > 0
-1
-e > 0
-1
drop procedure p1;
drop server if exists s;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
DROP TABLE IF EXISTS federated.t1;
-DROP DATABASE IF EXISTS federated;
+DROP DATABASE federated;
diff --git a/mysql-test/t/federated_server.test b/mysql-test/suite/federated/federated_server.test
index 444285ac045..ec952d071f2 100644
--- a/mysql-test/t/federated_server.test
+++ b/mysql-test/suite/federated/federated_server.test
@@ -1,9 +1,6 @@
# WL #3031 This test tests the new servers table as well as
# if federated can utilise the servers table
-# should work with embedded server after mysqltest is fixed
--- source include/not_embedded.inc
--- source include/federated.inc
--- source include/big_test.inc
+-- source federated.inc
connection slave;
create database first_db;
@@ -308,9 +305,8 @@ delimiter //;
create procedure p1 ()
begin
DECLARE v INT DEFAULT 0;
- DECLARE e INT DEFAULT 0;
DECLARE i INT;
- DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET i = sleep(5);
WHILE v < 10000 do
CREATE SERVER s
@@ -320,7 +316,6 @@ begin
DROP SERVER s;
SET v = v + 1;
END WHILE;
- SELECT e > 0;
END//
delimiter ;//
connection other;
@@ -334,4 +329,4 @@ drop procedure p1;
drop server if exists s;
-source include/federated_cleanup.inc;
+source federated_cleanup.inc;
diff --git a/mysql-test/t/federated_transactions-slave.opt b/mysql-test/suite/federated/federated_transactions-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/federated_transactions-slave.opt
+++ b/mysql-test/suite/federated/federated_transactions-slave.opt
diff --git a/mysql-test/r/federated_transactions.result b/mysql-test/suite/federated/federated_transactions.result
index 40644e3535e..40644e3535e 100644
--- a/mysql-test/r/federated_transactions.result
+++ b/mysql-test/suite/federated/federated_transactions.result
diff --git a/mysql-test/t/federated_transactions.test b/mysql-test/suite/federated/federated_transactions.test
index 2fc737730bf..cd08d310273 100644
--- a/mysql-test/t/federated_transactions.test
+++ b/mysql-test/suite/federated/federated_transactions.test
@@ -1,7 +1,5 @@
-# should work with embedded server after mysqltest is fixed
--- source include/not_embedded.inc
source include/have_innodb.inc;
-source include/federated.inc;
+source federated.inc;
connection slave;
DROP TABLE IF EXISTS federated.t1;
@@ -37,4 +35,4 @@ INSERT INTO federated.t1 (id, name) VALUES (6, 'fig');
SELECT * FROM federated.t1;
DELETE FROM federated.t1;
-source include/federated_cleanup.inc;
+source federated_cleanup.inc;
diff --git a/mysql-test/suite/federated/have_federated_db.inc b/mysql-test/suite/federated/have_federated_db.inc
new file mode 100644
index 00000000000..81f49aaa48e
--- /dev/null
+++ b/mysql-test/suite/federated/have_federated_db.inc
@@ -0,0 +1,6 @@
+if (!`SELECT count(*) FROM information_schema.engines WHERE
+ (support = 'YES' OR support = 'DEFAULT') AND
+ engine = 'federated'`)
+{
+ skip Need federated engine;
+}
diff --git a/mysql-test/suite/federated/my.cnf b/mysql-test/suite/federated/my.cnf
new file mode 100644
index 00000000000..3e84845b945
--- /dev/null
+++ b/mysql-test/suite/federated/my.cnf
@@ -0,0 +1,12 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld.1]
+log-bin= master-bin
+
+[mysqld.2]
+
+
+[ENV]
+MASTER_MYPORT= @mysqld.1.port
+SLAVE_MYPORT= @mysqld.2.port
diff --git a/mysql-test/suite/funcs_1/datadict/charset_collation.inc b/mysql-test/suite/funcs_1/datadict/charset_collation.inc
index ae03996b073..a1991346cfc 100644
--- a/mysql-test/suite/funcs_1/datadict/charset_collation.inc
+++ b/mysql-test/suite/funcs_1/datadict/charset_collation.inc
@@ -61,6 +61,7 @@ DROP USER dbdict_test@localhost;
CREATE USER dbdict_test@localhost;
--echo # Establish connection con (user=dbdict_test)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (con,localhost,dbdict_test,,);
################################################################################
diff --git a/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc b/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
index 098b8c6eca2..c8e8a186673 100644
--- a/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
@@ -126,6 +126,7 @@ ORDER BY constraint_catalog, constraint_schema, constraint_name,
eval $select;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $select;
diff --git a/mysql-test/suite/funcs_1/datadict/is_routines.inc b/mysql-test/suite/funcs_1/datadict/is_routines.inc
index 28a849e9df5..573967cbc1b 100644
--- a/mysql-test/suite/funcs_1/datadict/is_routines.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_routines.inc
@@ -178,6 +178,7 @@ GRANT EXECUTE ON db_datadict_2.* TO 'testuser2'@'localhost';
FLUSH PRIVILEGES;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
diff --git a/mysql-test/suite/funcs_1/datadict/is_schemata.inc b/mysql-test/suite/funcs_1/datadict/is_schemata.inc
index 29e1f6af4ef..96061d541b7 100644
--- a/mysql-test/suite/funcs_1/datadict/is_schemata.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_schemata.inc
@@ -104,6 +104,7 @@ eval $my_select;
eval $my_show;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict_1);
# Shows db_datadict_1
diff --git a/mysql-test/suite/funcs_1/datadict/is_tables.inc b/mysql-test/suite/funcs_1/datadict/is_tables.inc
index d1e4608a572..4f608eb02ea 100644
--- a/mysql-test/suite/funcs_1/datadict/is_tables.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_tables.inc
@@ -130,6 +130,7 @@ WHERE table_schema = 'db_datadict' ORDER BY table_name;
let $my_show = SHOW TABLES FROM db_datadict;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
# tb2 is not granted to anyone
diff --git a/mysql-test/suite/funcs_1/datadict/is_triggers.inc b/mysql-test/suite/funcs_1/datadict/is_triggers.inc
index 3b83a75295b..70d5540e163 100644
--- a/mysql-test/suite/funcs_1/datadict/is_triggers.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_triggers.inc
@@ -122,6 +122,7 @@ let $my_select = SELECT * FROM information_schema.triggers
WHERE trigger_name = 'trg1';
let $my_show = SHOW TRIGGERS FROM db_datadict;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
--replace_result $engine_type <engine_type>
diff --git a/mysql-test/suite/funcs_1/datadict/is_views.inc b/mysql-test/suite/funcs_1/datadict/is_views.inc
index 32e66e4f684..542dab05a8e 100644
--- a/mysql-test/suite/funcs_1/datadict/is_views.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_views.inc
@@ -108,6 +108,7 @@ WHERE table_schema = 'db_datadict' ORDER BY table_name;
eval $select;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
eval $select;
diff --git a/mysql-test/suite/funcs_1/datadict/statistics.inc b/mysql-test/suite/funcs_1/datadict/statistics.inc
index 00fd7a1b06b..6f24f422b5e 100644
--- a/mysql-test/suite/funcs_1/datadict/statistics.inc
+++ b/mysql-test/suite/funcs_1/datadict/statistics.inc
@@ -42,6 +42,7 @@ ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
eval $my_select;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,db_datadict);
--replace_column 10 #CARD#
diff --git a/mysql-test/suite/funcs_1/datadict/table_constraints.inc b/mysql-test/suite/funcs_1/datadict/table_constraints.inc
index 9e57976862b..513057c84a0 100644
--- a/mysql-test/suite/funcs_1/datadict/table_constraints.inc
+++ b/mysql-test/suite/funcs_1/datadict/table_constraints.inc
@@ -33,6 +33,7 @@ ORDER BY table_schema,table_name,constraint_name;
eval $my_select;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,db_datadict);
eval $my_select;
diff --git a/mysql-test/suite/funcs_1/datadict/tables.inc b/mysql-test/suite/funcs_1/datadict/tables.inc
index 5aa072d184c..8dae7ba0ebc 100644
--- a/mysql-test/suite/funcs_1/datadict/tables.inc
+++ b/mysql-test/suite/funcs_1/datadict/tables.inc
@@ -37,6 +37,7 @@ CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,test1);
--source suite/funcs_1/datadict/tables2.inc
diff --git a/mysql-test/suite/funcs_1/datadict/tables1.inc b/mysql-test/suite/funcs_1/datadict/tables1.inc
index 2e054a9dcfb..2dff32d81a9 100644
--- a/mysql-test/suite/funcs_1/datadict/tables1.inc
+++ b/mysql-test/suite/funcs_1/datadict/tables1.inc
@@ -27,6 +27,7 @@ CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,test1);
--source suite/funcs_1/datadict/tables2.inc
diff --git a/mysql-test/suite/funcs_1/include/innodb_tb1.inc b/mysql-test/suite/funcs_1/include/innodb_tb1.inc
index c6b6395d91f..02d17eceddc 100644
--- a/mysql-test/suite/funcs_1/include/innodb_tb1.inc
+++ b/mysql-test/suite/funcs_1/include/innodb_tb1.inc
@@ -66,5 +66,5 @@ f58 numeric (64) not null DEFAULT 99
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/innodb_tb1.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/innodb_tb1.txt'
into table tb1;
diff --git a/mysql-test/suite/funcs_1/include/innodb_tb2.inc b/mysql-test/suite/funcs_1/include/innodb_tb2.inc
index b9a0910a0af..4e5ee091c74 100644
--- a/mysql-test/suite/funcs_1/include/innodb_tb2.inc
+++ b/mysql-test/suite/funcs_1/include/innodb_tb2.inc
@@ -59,5 +59,5 @@ f109 set("1set","2set") not null default "1set"
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/innodb_tb2.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/innodb_tb2.txt'
into table tb2;
diff --git a/mysql-test/suite/funcs_1/include/innodb_tb3.inc b/mysql-test/suite/funcs_1/include/innodb_tb3.inc
index ffdb20b7eef..a9968632c5c 100644
--- a/mysql-test/suite/funcs_1/include/innodb_tb3.inc
+++ b/mysql-test/suite/funcs_1/include/innodb_tb3.inc
@@ -66,5 +66,5 @@ f175 numeric (64)
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/innodb_tb3.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/innodb_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/include/innodb_tb4.inc b/mysql-test/suite/funcs_1/include/innodb_tb4.inc
index c7c919c829d..104b0e763be 100644
--- a/mysql-test/suite/funcs_1/include/innodb_tb4.inc
+++ b/mysql-test/suite/funcs_1/include/innodb_tb4.inc
@@ -66,5 +66,5 @@ f241 char(100)
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/innodb_tb4.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/innodb_tb4.txt'
into table tb4;
diff --git a/mysql-test/suite/funcs_1/include/memory_tb1.inc b/mysql-test/suite/funcs_1/include/memory_tb1.inc
index 3a4ebb0c484..e15f14bffdc 100644
--- a/mysql-test/suite/funcs_1/include/memory_tb1.inc
+++ b/mysql-test/suite/funcs_1/include/memory_tb1.inc
@@ -58,5 +58,5 @@ f58 numeric (64) not null DEFAULT 99
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb1.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/memory_tb1.txt'
into table tb1;
diff --git a/mysql-test/suite/funcs_1/include/memory_tb2.inc b/mysql-test/suite/funcs_1/include/memory_tb2.inc
index c059e565c64..272b86b9f03 100644
--- a/mysql-test/suite/funcs_1/include/memory_tb2.inc
+++ b/mysql-test/suite/funcs_1/include/memory_tb2.inc
@@ -59,5 +59,5 @@ f109 set("1set","2set") not null default "1set"
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb2.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/memory_tb2.txt'
into table tb2 ;
diff --git a/mysql-test/suite/funcs_1/include/memory_tb3.inc b/mysql-test/suite/funcs_1/include/memory_tb3.inc
index b5d4bb93f12..f384c1b59a8 100644
--- a/mysql-test/suite/funcs_1/include/memory_tb3.inc
+++ b/mysql-test/suite/funcs_1/include/memory_tb3.inc
@@ -60,5 +60,5 @@ f175 numeric (64)
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/include/memory_tb4.inc b/mysql-test/suite/funcs_1/include/memory_tb4.inc
index 0cf17127d32..d3bab92af3d 100644
--- a/mysql-test/suite/funcs_1/include/memory_tb4.inc
+++ b/mysql-test/suite/funcs_1/include/memory_tb4.inc
@@ -65,5 +65,5 @@ f240 varchar(1200)
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb4.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/memory_tb4.txt'
into table tb4;
diff --git a/mysql-test/suite/funcs_1/include/myisam_tb1.inc b/mysql-test/suite/funcs_1/include/myisam_tb1.inc
index 1c95c6c53c0..261e6e926c8 100644
--- a/mysql-test/suite/funcs_1/include/myisam_tb1.inc
+++ b/mysql-test/suite/funcs_1/include/myisam_tb1.inc
@@ -66,5 +66,5 @@ f58 numeric (64) not null DEFAULT 99
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/myisam_tb1.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/myisam_tb1.txt'
into table tb1;
diff --git a/mysql-test/suite/funcs_1/include/myisam_tb2.inc b/mysql-test/suite/funcs_1/include/myisam_tb2.inc
index c878b1853f0..2a5584084c1 100644
--- a/mysql-test/suite/funcs_1/include/myisam_tb2.inc
+++ b/mysql-test/suite/funcs_1/include/myisam_tb2.inc
@@ -78,5 +78,5 @@ f117 VARBINARY(192) null
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/myisam_tb2.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
diff --git a/mysql-test/suite/funcs_1/include/myisam_tb3.inc b/mysql-test/suite/funcs_1/include/myisam_tb3.inc
index 209c2e13fbf..aa0bb5bbcac 100644
--- a/mysql-test/suite/funcs_1/include/myisam_tb3.inc
+++ b/mysql-test/suite/funcs_1/include/myisam_tb3.inc
@@ -66,5 +66,5 @@ f175 numeric (64)
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/myisam_tb3.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/myisam_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/include/myisam_tb4.inc b/mysql-test/suite/funcs_1/include/myisam_tb4.inc
index d7e3a966579..23fa9af45bb 100644
--- a/mysql-test/suite/funcs_1/include/myisam_tb4.inc
+++ b/mysql-test/suite/funcs_1/include/myisam_tb4.inc
@@ -86,5 +86,5 @@ f242 bit(30)
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/myisam_tb4.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/myisam_tb4.txt'
into table tb4;
diff --git a/mysql-test/suite/funcs_1/include/ndb_tb1.inc b/mysql-test/suite/funcs_1/include/ndb_tb1.inc
index 223a323b006..fd2db538b4c 100644
--- a/mysql-test/suite/funcs_1/include/ndb_tb1.inc
+++ b/mysql-test/suite/funcs_1/include/ndb_tb1.inc
@@ -66,5 +66,5 @@ f58 numeric (64) not null DEFAULT 99
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/ndb_tb1.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/ndb_tb1.txt'
into table tb1 ;
diff --git a/mysql-test/suite/funcs_1/include/ndb_tb2.inc b/mysql-test/suite/funcs_1/include/ndb_tb2.inc
index c1f56b9ece6..3a8d647b65f 100644
--- a/mysql-test/suite/funcs_1/include/ndb_tb2.inc
+++ b/mysql-test/suite/funcs_1/include/ndb_tb2.inc
@@ -59,5 +59,5 @@ f109 set("1set","2set") not null default "1set"
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/ndb_tb2.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/ndb_tb2.txt'
into table tb2 ;
diff --git a/mysql-test/suite/funcs_1/include/ndb_tb3.inc b/mysql-test/suite/funcs_1/include/ndb_tb3.inc
index 77856a7f0be..6ade99bd1a2 100644
--- a/mysql-test/suite/funcs_1/include/ndb_tb3.inc
+++ b/mysql-test/suite/funcs_1/include/ndb_tb3.inc
@@ -66,5 +66,5 @@ f175 numeric (64)
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/ndb_tb3.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/ndb_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/include/ndb_tb4.inc b/mysql-test/suite/funcs_1/include/ndb_tb4.inc
index 2a9349e6755..3eaae90179a 100644
--- a/mysql-test/suite/funcs_1/include/ndb_tb4.inc
+++ b/mysql-test/suite/funcs_1/include/ndb_tb4.inc
@@ -66,5 +66,5 @@ f241 char(100) unicode
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/ndb_tb4.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/ndb_tb4.txt'
into table tb4 ;
diff --git a/mysql-test/suite/funcs_1/include/sp_tb.inc b/mysql-test/suite/funcs_1/include/sp_tb.inc
index ae1114fb5f1..53ee9deddcf 100644
--- a/mysql-test/suite/funcs_1/include/sp_tb.inc
+++ b/mysql-test/suite/funcs_1/include/sp_tb.inc
@@ -22,19 +22,19 @@ CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' INTO TABLE t1;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' INTO TABLE t2;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' INTO TABLE t4;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' INTO TABLE t10;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' INTO TABLE t11;
--disable_warnings
@@ -44,7 +44,7 @@ eval
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t3.txt' INTO TABLE t3;
#---------------------------
@@ -59,7 +59,7 @@ CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' INTO TABLE t6;
#---------------------------
use test;
@@ -73,10 +73,10 @@ eval
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t7.txt' INTO TABLE t7;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t7.txt' INTO TABLE t8;
--disable_warnings
@@ -85,5 +85,5 @@ drop TABLE if exists t9;
eval CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
+LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/funcs_1/t9.txt' INTO TABLE t9;
diff --git a/mysql-test/suite/funcs_1/include/tb3.inc b/mysql-test/suite/funcs_1/include/tb3.inc
index 5e7dc369ddb..0f73c39cb47 100644
--- a/mysql-test/suite/funcs_1/include/tb3.inc
+++ b/mysql-test/suite/funcs_1/include/tb3.inc
@@ -2,7 +2,7 @@
#
# This auxiliary script is used in several Trigger tests.
#
-# If the table need data than the file std_data_ln/funcs_1/memory_tb3.txt
+# If the table need data than the file std_data/funcs_1/memory_tb3.txt
# could be used.
#
diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result
index 96e4f23976b..1547c5461be 100644
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result
@@ -203,7 +203,7 @@ my_binary_30, id FROM t1_values';
SET @my_select = 'SELECT LENGTH(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values';
SET @my_select =
-'SELECT LOAD_FILE(''<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt'')
+'SELECT LOAD_FILE(''<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt'')
AS my_col,
id FROM t1_values';
SET @my_select = 'SELECT LOCATE(''char'', my_char_30),
@@ -811,10 +811,10 @@ WHERE select_id = 157 OR select_id IS NULL) order by id;
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt')
+CREATE VIEW v1 AS SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
AS my_col,
id FROM t1_values;
-SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt')
+SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
AS my_col,
id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL order by id;
@@ -831,7 +831,7 @@ Here is content from load_file
5
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt') AS `my_col`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt') AS `my_col`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL) order by id;
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
index 04fb7d29385..65fc5b5afc9 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.2 - Syntax checks for the stored procedure-specific
programming statements BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_03.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_03.result
index 53e25441e2e..fdbe03e17fc 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_03.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.3 - Syntax checks for the stored procedure-specific flow
control statements IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
index 9695432ad99..67d9c76ccac 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
index c4e8082fd7d..5a2c0bb6bdf 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.7 - SQL mode checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
index 0bed3989f13..7bffd77d9c6 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.8 - SHOW statement checks:
--------------------------------------------------------------------------------
@@ -208,6 +208,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -426,6 +495,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -637,6 +775,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
index 163bae36bed..24ebd38e403 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
index 2cd4b447367..86c2d2521ac 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
@@ -204,8 +204,10 @@ f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
+gs_insert
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
+ts_insert
drop trigger trg5_1;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
@@ -348,9 +350,11 @@ for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
+mtr gs_insert global_suppressions
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
+mtr ts_insert test_suppressions
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
insert into trig_db2.t1 (f1,f2) values ('insert to db2 t1 from db1',352);
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
index a4871065c04..62c8e0d06db 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
@@ -92,6 +92,8 @@ drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
+mtr gs_insert global_suppressions
+mtr ts_insert test_suppressions
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
f1
@@ -152,6 +154,7 @@ Drop database db_drop4;
Show databases;
Database
information_schema
+mtr
mysql
test
select trigger_schema, trigger_name, event_object_table
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_09.result b/mysql-test/suite/funcs_1/r/innodb_trig_09.result
index 0af360c5bfb..986506b4e71 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_09.result
@@ -58,7 +58,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
@@ -187,7 +187,8 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
0 0 0 0 0 0
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
-ERROR 23000: Column 'f136' cannot be null
+Warnings:
+Warning 1048 Column 'f136' cannot be null
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result b/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result
index 78265fac296..2709989ab86 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result
@@ -58,7 +58,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
@@ -136,7 +136,7 @@ set @counter= 0;
select @counter as 'Rows Loaded Before';
Rows Loaded Before
0
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table tb_load;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result
index 5abbc3b3481..bc0b101f90a 100644
--- a/mysql-test/suite/funcs_1/r/innodb_views.result
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result
@@ -53,7 +53,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2;
DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
@@ -112,7 +112,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2;
USE test;
diff --git a/mysql-test/suite/funcs_1/r/is_coll_charset_applic.result b/mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result
index 7eba964bdf6..7eba964bdf6 100644
--- a/mysql-test/suite/funcs_1/r/is_coll_charset_applic.result
+++ b/mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result
diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
index 811e360e62d..27a00ebf10d 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
@@ -76,7 +76,7 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb1.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
@@ -132,7 +132,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2;
drop table if exists tb3 ;
create table tb3 (
@@ -199,7 +199,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb3.txt'
into table tb3;
drop table if exists tb4;
create table tb4 (
@@ -262,7 +262,7 @@ f239 varchar(20000) binary,
f240 varchar(2000),
f241 char(100)
) engine = innodb;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb4.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
@@ -319,7 +319,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2;
USE test;
USE test;
@@ -334,25 +334,25 @@ CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t1;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t2;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t4;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t10;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = InnoDB;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = InnoDB;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = InnoDB;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = InnoDB;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -364,7 +364,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -378,7 +378,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = InnoDB;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 15466887ecc..94aa75c6db2 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -43,10 +43,10 @@ NULL information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL N
NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
NULL information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ENGINES SAVEPOINTS 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
-NULL information_schema ENGINES TRANSACTIONS 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema ENGINES XA 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index 1e0646de08f..d5e1309e39f 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -3,22 +3,22 @@ WHERE table_schema = 'information_schema'
AND table_name <> 'profiling'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
NULL information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60)
NULL information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
-NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+NULL information_schema COLLATIONS COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11)
NULL information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
NULL information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
@@ -43,10 +43,10 @@ NULL information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL N
NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
NULL information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
NULL information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ENGINES SAVEPOINTS 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+NULL information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
NULL information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
-NULL information_schema ENGINES TRANSACTIONS 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema ENGINES XA 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+NULL information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+NULL information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
NULL information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
NULL information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
NULL information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
@@ -67,7 +67,7 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
NULL information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
NULL information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10)
-NULL information_schema EVENTS SQL_MODE 12 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+NULL information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
@@ -110,9 +110,9 @@ NULL information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NUL
NULL information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
NULL information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480)
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
NULL information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480)
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
NULL information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
@@ -200,11 +200,11 @@ NULL information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7)
NULL information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
NULL information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+NULL information_schema ROUTINES SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+NULL information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
NULL information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
NULL information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
@@ -213,9 +213,9 @@ NULL information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NU
NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
NULL information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480)
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
NULL information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480)
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
NULL information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21)
NULL information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1)
NULL information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
@@ -244,7 +244,7 @@ NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NU
NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
@@ -277,12 +277,12 @@ NULL information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL
NULL information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
NULL information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+NULL information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
NULL information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6)
NULL information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+NULL information_schema TRIGGERS SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
NULL information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
NULL information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
@@ -357,18 +357,18 @@ WHERE table_schema = 'information_schema'
AND table_name <> 'profiling'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
-3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60)
NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(3)
-3.0000 information_schema COLLATIONS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema COLLATIONS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema COLLATIONS COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema COLLATIONS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema COLLATIONS ID bigint NULL NULL NULL NULL bigint(11)
3.0000 information_schema COLLATIONS IS_DEFAULT varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema COLLATIONS IS_COMPILED varchar 3 9 utf8 utf8_general_ci varchar(3)
NULL information_schema COLLATIONS SORTLEN bigint NULL NULL NULL NULL bigint(3)
-3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema COLUMNS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema COLUMNS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema COLUMNS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -381,8 +381,8 @@ NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH bigint NULL NULL NULL N
NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema COLUMNS NUMERIC_PRECISION bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint(21) unsigned
-3.0000 information_schema COLUMNS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema COLUMNS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema COLUMNS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema COLUMNS COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
1.0000 information_schema COLUMNS COLUMN_TYPE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema COLUMNS COLUMN_KEY varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema COLUMNS EXTRA varchar 27 81 utf8 utf8_general_ci varchar(27)
@@ -412,7 +412,7 @@ NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint(
NULL information_schema EVENTS EXECUTE_AT datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS INTERVAL_VALUE varchar 256 768 utf8 utf8_general_ci varchar(256)
3.0000 information_schema EVENTS INTERVAL_FIELD varchar 18 54 utf8 utf8_general_ci varchar(18)
-1.0000 information_schema EVENTS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema EVENTS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
NULL information_schema EVENTS STARTS datetime NULL NULL NULL NULL datetime
NULL information_schema EVENTS ENDS datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS STATUS varchar 18 54 utf8 utf8_general_ci varchar(18)
@@ -464,9 +464,9 @@ NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) uns
3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255)
3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
+3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
+3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -550,7 +550,7 @@ NULL information_schema PROCESSLIST TIME bigint NULL NULL NULL NULL bigint(7)
3.0000 information_schema ROUTINES SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime
NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime
-1.0000 information_schema ROUTINES SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
@@ -558,8 +558,8 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema SCHEMATA CATALOG_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema SCHEMATA SCHEMA_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SCHEMATA DEFAULT_COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema SCHEMATA DEFAULT_COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema SCHEMATA SQL_PATH varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema SCHEMA_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
3.0000 information_schema SCHEMA_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
@@ -567,9 +567,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
+3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
+3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -602,7 +602,7 @@ NULL information_schema TABLES AUTO_INCREMENT bigint NULL NULL NULL NULL bigint(
NULL information_schema TABLES CREATE_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
-3.0000 information_schema TABLES TABLE_COLLATION varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
3.0000 information_schema TABLES TABLE_COMMENT varchar 80 240 utf8 utf8_general_ci varchar(80)
@@ -635,8 +635,8 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(
3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
-1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
-1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema TRIGGERS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
+3.0000 information_schema TRIGGERS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result
index 3262f1e3fc8..9bcf7887c16 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result
@@ -72,7 +72,7 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb1.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
@@ -128,7 +128,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ;
drop table if exists tb3;
create table tb3 (
@@ -189,7 +189,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
drop table if exists tb4 ;
create table tb4 (
@@ -251,7 +251,7 @@ f238 varchar(25000) binary,
f239 varbinary(0),
f240 varchar(1200)
) engine = memory;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb4.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
@@ -308,7 +308,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ;
USE test;
USE test;
@@ -323,25 +323,25 @@ CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t1;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t2;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t4;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t10;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MEMORY;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -353,7 +353,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -367,7 +367,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
index 1eed0774037..de047728826 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
@@ -80,7 +80,7 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb1.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
@@ -144,7 +144,7 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
drop table if exists tb3 ;
create table tb3 (
@@ -211,7 +211,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb3.txt'
into table tb3;
drop table if exists tb4 ;
create table tb4 (
@@ -283,7 +283,7 @@ f240 varchar(120),
f241 char(100),
f242 bit(30)
) engine = myisam;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb4.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
@@ -348,7 +348,7 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
USE test;
USE test;
@@ -363,25 +363,25 @@ CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t1;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t2;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t4;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t10;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -393,7 +393,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -407,7 +407,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
index e2204dd12ec..d22c5cc06f7 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
@@ -80,7 +80,7 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb1.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
@@ -144,7 +144,7 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
drop table if exists tb3 ;
create table tb3 (
@@ -211,7 +211,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb3.txt'
into table tb3;
drop table if exists tb4 ;
create table tb4 (
@@ -283,7 +283,7 @@ f240 varchar(120),
f241 char(100),
f242 bit(30)
) engine = myisam;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb4.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
@@ -348,7 +348,7 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
USE test;
USE test;
@@ -363,25 +363,25 @@ CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t1;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t2;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t4;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t10;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -393,7 +393,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -407,7 +407,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MyISAM;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_ndb.result b/mysql-test/suite/funcs_1/r/is_columns_ndb.result
index 444c62eb010..dcaceec337e 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_ndb.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_ndb.result
@@ -14,25 +14,25 @@ CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = ndb;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t1;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t2;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t4;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t10;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = ndb;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -44,7 +44,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -58,7 +58,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
diff --git a/mysql-test/suite/funcs_1/r/is_engines.result b/mysql-test/suite/funcs_1/r/is_engines.result
index ba98ddd8f1e..9965fc5ad73 100644
--- a/mysql-test/suite/funcs_1/r/is_engines.result
+++ b/mysql-test/suite/funcs_1/r/is_engines.result
@@ -31,27 +31,27 @@ Field Type Null Key Default Extra
ENGINE varchar(64) NO
SUPPORT varchar(8) NO
COMMENT varchar(80) NO
-TRANSACTIONS varchar(3) NO
-XA varchar(3) NO
-SAVEPOINTS varchar(3) NO
+TRANSACTIONS varchar(3) YES NULL
+XA varchar(3) YES NULL
+SAVEPOINTS varchar(3) YES NULL
SHOW CREATE TABLE information_schema.ENGINES;
Table Create Table
ENGINES CREATE TEMPORARY TABLE `ENGINES` (
`ENGINE` varchar(64) NOT NULL DEFAULT '',
`SUPPORT` varchar(8) NOT NULL DEFAULT '',
`COMMENT` varchar(80) NOT NULL DEFAULT '',
- `TRANSACTIONS` varchar(3) NOT NULL DEFAULT '',
- `XA` varchar(3) NOT NULL DEFAULT '',
- `SAVEPOINTS` varchar(3) NOT NULL DEFAULT ''
+ `TRANSACTIONS` varchar(3) DEFAULT NULL,
+ `XA` varchar(3) DEFAULT NULL,
+ `SAVEPOINTS` varchar(3) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.ENGINES;
Field Type Null Key Default Extra
ENGINE varchar(64) NO
SUPPORT varchar(8) NO
COMMENT varchar(80) NO
-TRANSACTIONS varchar(3) NO
-XA varchar(3) NO
-SAVEPOINTS varchar(3) NO
+TRANSACTIONS varchar(3) YES NULL
+XA varchar(3) YES NULL
+SAVEPOINTS varchar(3) YES NULL
########################################################################
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
# DDL on INFORMATION_SCHEMA tables are not supported
diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result
index 0c72136aa8d..9a2b0a6a293 100644
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result
@@ -204,7 +204,7 @@ my_binary_30, id FROM t1_values';
SET @my_select = 'SELECT LENGTH(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values';
SET @my_select =
-'SELECT LOAD_FILE(''<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt'')
+'SELECT LOAD_FILE(''<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt'')
AS my_col,
id FROM t1_values';
SET @my_select = 'SELECT LOCATE(''char'', my_char_30),
@@ -812,10 +812,10 @@ WHERE select_id = 157 OR select_id IS NULL) order by id;
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt')
+CREATE VIEW v1 AS SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
AS my_col,
id FROM t1_values;
-SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt')
+SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
AS my_col,
id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL order by id;
@@ -832,7 +832,7 @@ Here is content from load_file
5
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt') AS `my_col`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt') AS `my_col`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL) order by id;
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result
index 50f3536951e..6b474621685 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.2 - Syntax checks for the stored procedure-specific
programming statements BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_03.result b/mysql-test/suite/funcs_1/r/memory_storedproc_03.result
index 81c82ea1c8d..f5e40d190a6 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_03.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_03.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.3 - Syntax checks for the stored procedure-specific flow
control statements IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
index 91c0c315287..eb617c68ae9 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_07.result b/mysql-test/suite/funcs_1/r/memory_storedproc_07.result
index fe582c7f0f1..596b63316ce 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_07.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.7 - SQL mode checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_08.result b/mysql-test/suite/funcs_1/r/memory_storedproc_08.result
index 53ba16ed196..2740a2cafa8 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_08.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.8 - SHOW statement checks:
--------------------------------------------------------------------------------
@@ -209,6 +209,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode NO_ENGINE_SUBSTITUTION
@@ -427,6 +496,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode NO_ENGINE_SUBSTITUTION
@@ -638,6 +776,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode NO_ENGINE_SUBSTITUTION
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
index e7f7643c25a..f5e34b0063c 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0102.result b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
index 1e71085b2e1..a95702debcd 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
@@ -205,8 +205,10 @@ f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
+gs_insert
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
+ts_insert
drop trigger trg5_1;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
@@ -349,9 +351,11 @@ for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
+mtr gs_insert global_suppressions
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
+mtr ts_insert test_suppressions
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
insert into trig_db2.t1 (f1,f2) values ('insert to db2 t1 from db1',352);
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0407.result b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
index 3a790e70583..feb0017b86b 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
@@ -93,6 +93,8 @@ drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
+mtr gs_insert global_suppressions
+mtr ts_insert test_suppressions
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
f1
@@ -153,6 +155,7 @@ Drop database db_drop4;
Show databases;
Database
information_schema
+mtr
mysql
test
select trigger_schema, trigger_name, event_object_table
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_09.result b/mysql-test/suite/funcs_1/r/memory_trig_09.result
index 7ffbba05e81..0795c3be36f 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_09.result
@@ -59,7 +59,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
@@ -188,7 +188,8 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
0 0 0 0 0 0
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
-ERROR 23000: Column 'f136' cannot be null
+Warnings:
+Warning 1048 Column 'f136' cannot be null
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result b/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result
index 2f8552ece21..bfd5b36069a 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result
@@ -59,7 +59,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
@@ -137,7 +137,7 @@ set @counter= 0;
select @counter as 'Rows Loaded Before';
Rows Loaded Before
0
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table tb_load;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result
index 743d3a213ec..2eba325db23 100644
--- a/mysql-test/suite/funcs_1/r/memory_views.result
+++ b/mysql-test/suite/funcs_1/r/memory_views.result
@@ -54,7 +54,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ;
DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
@@ -113,7 +113,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ;
USE test;
diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result
index 0c72136aa8d..9a2b0a6a293 100644
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result
@@ -204,7 +204,7 @@ my_binary_30, id FROM t1_values';
SET @my_select = 'SELECT LENGTH(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values';
SET @my_select =
-'SELECT LOAD_FILE(''<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt'')
+'SELECT LOAD_FILE(''<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt'')
AS my_col,
id FROM t1_values';
SET @my_select = 'SELECT LOCATE(''char'', my_char_30),
@@ -812,10 +812,10 @@ WHERE select_id = 157 OR select_id IS NULL) order by id;
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt')
+CREATE VIEW v1 AS SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
AS my_col,
id FROM t1_values;
-SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt')
+SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
AS my_col,
id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL order by id;
@@ -832,7 +832,7 @@ Here is content from load_file
5
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt') AS `my_col`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt') AS `my_col`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL) order by id;
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
index 50f3536951e..6b474621685 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.2 - Syntax checks for the stored procedure-specific
programming statements BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_03.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_03.result
index 81c82ea1c8d..f5e40d190a6 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_03.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_03.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.3 - Syntax checks for the stored procedure-specific flow
control statements IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
index 91c0c315287..eb617c68ae9 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
index fe582c7f0f1..596b63316ce 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.7 - SQL mode checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
index 53ba16ed196..2740a2cafa8 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.8 - SHOW statement checks:
--------------------------------------------------------------------------------
@@ -209,6 +209,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode NO_ENGINE_SUBSTITUTION
@@ -427,6 +496,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode NO_ENGINE_SUBSTITUTION
@@ -638,6 +776,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode NO_ENGINE_SUBSTITUTION
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
index e7f7643c25a..f5e34b0063c 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
@@ -12,23 +12,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -42,7 +42,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -55,13 +55,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
index 1e71085b2e1..a95702debcd 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
@@ -205,8 +205,10 @@ f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
+gs_insert
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
+ts_insert
drop trigger trg5_1;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
@@ -349,9 +351,11 @@ for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
+mtr gs_insert global_suppressions
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
+mtr ts_insert test_suppressions
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
insert into trig_db2.t1 (f1,f2) values ('insert to db2 t1 from db1',352);
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
index 3a790e70583..feb0017b86b 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
@@ -93,6 +93,8 @@ drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
+mtr gs_insert global_suppressions
+mtr ts_insert test_suppressions
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
f1
@@ -153,6 +155,7 @@ Drop database db_drop4;
Show databases;
Database
information_schema
+mtr
mysql
test
select trigger_schema, trigger_name, event_object_table
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_09.result b/mysql-test/suite/funcs_1/r/myisam_trig_09.result
index 7ffbba05e81..0795c3be36f 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_09.result
@@ -59,7 +59,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
@@ -188,7 +188,8 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
0 0 0 0 0 0
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
-ERROR 23000: Column 'f136' cannot be null
+Warnings:
+Warning 1048 Column 'f136' cannot be null
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result b/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result
index 9add82e24be..74e741319fd 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result
@@ -59,7 +59,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
@@ -137,7 +137,7 @@ set @counter= 0;
select @counter as 'Rows Loaded Before';
Rows Loaded Before
0
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table tb_load;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
diff --git a/mysql-test/suite/funcs_1/r/myisam_views.result b/mysql-test/suite/funcs_1/r/myisam_views.result
index 8c58d8eed7b..3fcd8113df5 100644
--- a/mysql-test/suite/funcs_1/r/myisam_views.result
+++ b/mysql-test/suite/funcs_1/r/myisam_views.result
@@ -62,7 +62,7 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
@@ -129,7 +129,7 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
USE test;
diff --git a/mysql-test/suite/funcs_1/r/ndb_func_view.result b/mysql-test/suite/funcs_1/r/ndb_func_view.result
index 96e4f23976b..1547c5461be 100644
--- a/mysql-test/suite/funcs_1/r/ndb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/ndb_func_view.result
@@ -203,7 +203,7 @@ my_binary_30, id FROM t1_values';
SET @my_select = 'SELECT LENGTH(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values';
SET @my_select =
-'SELECT LOAD_FILE(''<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt'')
+'SELECT LOAD_FILE(''<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt'')
AS my_col,
id FROM t1_values';
SET @my_select = 'SELECT LOCATE(''char'', my_char_30),
@@ -811,10 +811,10 @@ WHERE select_id = 157 OR select_id IS NULL) order by id;
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt')
+CREATE VIEW v1 AS SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
AS my_col,
id FROM t1_values;
-SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt')
+SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
AS my_col,
id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL order by id;
@@ -831,7 +831,7 @@ Here is content from load_file
5
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file('<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/load_file.txt') AS `my_col`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt') AS `my_col`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL) order by id;
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result
index 04fb7d29385..65fc5b5afc9 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.2 - Syntax checks for the stored procedure-specific
programming statements BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_03.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_03.result
index 53e25441e2e..fdbe03e17fc 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_03.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_03.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.3 - Syntax checks for the stored procedure-specific flow
control statements IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result
index 9695432ad99..67d9c76ccac 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
index c4e8082fd7d..5a2c0bb6bdf 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.7 - SQL mode checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
index 0bed3989f13..7bffd77d9c6 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.8 - SHOW statement checks:
--------------------------------------------------------------------------------
@@ -208,6 +208,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -426,6 +495,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -637,6 +775,75 @@ DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME add_suppression
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME add_suppression
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_testcase
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_testcase
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY columns_in_mysql; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.proc, mysql.procs_priv, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME check_warnings
+ROUTINE_CATALOG NULL
+ROUTINE_SCHEMA mtr
+ROUTINE_NAME check_warnings
+ROUTINE_TYPE PROCEDURE
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT file_name, line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED <modified>
+LAST_ALTERED <created>
+SQL_MODE
+ROUTINE_COMMENT
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
index 163bae36bed..24ebd38e403 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result b/mysql-test/suite/funcs_1/r/ndb_trig_0102.result
index 2cd4b447367..86c2d2521ac 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_0102.result
@@ -204,8 +204,10 @@ f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
+gs_insert
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
+ts_insert
drop trigger trg5_1;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
@@ -348,9 +350,11 @@ for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
+mtr gs_insert global_suppressions
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
+mtr ts_insert test_suppressions
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
insert into trig_db2.t1 (f1,f2) values ('insert to db2 t1 from db1',352);
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result b/mysql-test/suite/funcs_1/r/ndb_trig_0407.result
index a4871065c04..62c8e0d06db 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_0407.result
@@ -92,6 +92,8 @@ drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
+mtr gs_insert global_suppressions
+mtr ts_insert test_suppressions
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
f1
@@ -152,6 +154,7 @@ Drop database db_drop4;
Show databases;
Database
information_schema
+mtr
mysql
test
select trigger_schema, trigger_name, event_object_table
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_09.result b/mysql-test/suite/funcs_1/r/ndb_trig_09.result
index 0af360c5bfb..986506b4e71 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_09.result
@@ -58,7 +58,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
@@ -187,7 +187,8 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
0 0 0 0 0 0
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
-ERROR 23000: Column 'f136' cannot be null
+Warnings:
+Warning 1048 Column 'f136' cannot be null
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result b/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result
index 60b70d1c981..198382b409d 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result
@@ -58,7 +58,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
@@ -136,7 +136,7 @@ set @counter= 0;
select @counter as 'Rows Loaded Before';
Rows Loaded Before
0
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table tb_load;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
diff --git a/mysql-test/suite/funcs_1/r/ndb_views.result b/mysql-test/suite/funcs_1/r/ndb_views.result
index d0e3b192c6e..671ef590f4d 100644
--- a/mysql-test/suite/funcs_1/r/ndb_views.result
+++ b/mysql-test/suite/funcs_1/r/ndb_views.result
@@ -53,7 +53,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = ndb;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/ndb_tb2.txt'
into table tb2 ;
DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
@@ -112,7 +112,7 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = ndb;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb2.txt'
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/ndb_tb2.txt'
into table tb2 ;
USE test;
@@ -21567,7 +21567,8 @@ View Create View character_set_client collation_connection
v28 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v28` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v27` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v28;
-ERROR HY000: Got temporary error 4006 'Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)' from NDBCLUSTER
+f1 f2
+5 five
The output of following EXPLAIN is deactivated, because the result
differs on some platforms
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 38fa933e13f..fd5b090e6fb 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -11,23 +11,23 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -41,7 +41,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@@ -54,13 +54,13 @@ Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.1 - Syntax checks for the CREATE PROCEDURE, CREATE
FUNCTION, ALTER PROCEDURE, ALTER FUNCTION, DROP PROCEDURE, DROP FUNCTION, SHOW
@@ -94,6 +94,9 @@ CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( 'abc' );
ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mtr add_suppression PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_testcase PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_warnings PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 BINARY )
LANGUAGE SQL DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
@@ -109,6 +112,9 @@ Warning 1265 Data truncated for column 'f1' at row 1
SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+mtr add_suppression PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_testcase PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_warnings PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 BLOB )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
@@ -122,6 +128,9 @@ CALL sp1( 34 );
SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+mtr add_suppression PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_testcase PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_warnings PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 INT )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
@@ -135,6 +144,9 @@ CALL sp1( 34 );
SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+mtr add_suppression PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_testcase PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_warnings PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 DECIMAL(256, 30) )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
@@ -176,6 +188,9 @@ END//
SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc sproc_1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+mtr add_suppression PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_testcase PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_warnings PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW FUNCTION STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc func_1 FUNCTION root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
@@ -191,2427 +206,1215 @@ ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during p
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+100;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+100, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+100);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+99;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+99, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+99);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+98;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+98, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+98);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+97;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+97, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+97);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+96;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+96, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+96);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+95;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+95, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+95);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+94;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+94, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+94);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+93;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+93, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+93);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+92;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+92, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+92);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+91;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+91, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+91);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+90;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+90, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+90);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+89;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+89, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+89);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+88;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+88, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+88);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+87;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+87, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+87);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+86;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+86, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+86);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+85;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+85, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+85);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+84;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+84, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+84);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+83;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+83, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+83);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+82;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+82, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+82);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+81;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+81, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+81);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+80;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+80, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+80);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+79;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+79, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+79);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+78;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+78, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+78);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+77;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+77, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+77);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+76;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+76, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+76);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+75;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+75, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+75);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+74;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+74, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+74);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+73;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+73, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+73);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+72;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+72, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+72);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+71;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+71, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+71);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+70;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+70, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+70);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+69;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+69, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+69);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+68;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+68, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+68);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+67;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+67, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+67);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+66;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+66, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+66);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+65;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+65, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+65);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+64;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+64, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+64);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+63;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+63, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+63);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+62;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+62, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+62);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+61;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+61, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+61);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+60;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+60, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+60);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+59;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+59, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+59);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+58;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+58, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+58);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+57;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+57, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+57);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+56;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+56, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+56);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+55;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+55, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+55);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+54;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+54, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+54);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+53;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+53, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+53);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+52;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+52, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+52);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+51;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+51, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+51);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+50;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+50, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+50);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+49;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+49, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+49);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+48;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+48, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+48);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+47;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+47, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+47);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+46;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+46, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+46);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+45;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+45, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+45);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+44;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+44, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+44);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+43;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+43, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+43);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+42;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+42, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+42);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+41;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+41, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+41);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+40;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+40, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+40);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+39;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+39, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+39);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+38;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+38, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+38);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+37;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+37, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+37);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+36;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+36, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+36);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+35;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+35, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+35);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+34;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+34, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+34);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+33;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+33, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+33);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+32;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+32, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+32);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+31;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+31, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+31);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+30;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+30, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+30);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+29;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+29, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+29);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+28;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+28, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+28);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+27;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+27, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+27);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+26;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+26, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+26);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+25;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+25, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+25);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+24;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+24, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+24);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+23;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+23, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+23);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+22;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+22, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+22);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+21;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+21, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+21);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+20;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+20, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+20);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+19;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+19, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+19);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+18;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+18, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+18);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+17;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+17, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+17);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+16;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+16, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+16);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+15;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+15, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+15);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+14;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+14, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+14);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+13;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+13, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+13);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+12;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+12, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+12);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+11;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+11, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+11);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+10;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+10, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+10);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+9;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+9, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+9);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+8;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+8, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+8);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+7;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+7, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+7);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+6;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+6, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+6);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+5;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+5, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+5);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+4;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+4, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+4);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+3;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+3, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+3);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+2;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+2, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+2);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+1;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+1, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+1);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+0;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+0, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+0);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-100;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-100, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-100);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-99;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-99, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-99);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-98;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-98, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-98);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-97;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-97, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-97);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-96;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-96, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-96);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-95;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-95, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-95);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-94;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-94, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-94);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-93;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-93, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-93);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-92;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-92, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-92);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-91;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-91, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-91);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-90;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-90, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-90);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-89;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-89, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-89);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-88;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-88, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-88);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-87;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-87, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-87);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-86;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-86, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-86);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-85;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-85, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-85);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-84;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-84, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-84);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-83;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-83, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-83);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-82;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-82, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-82);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-81;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-81, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-81);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-80;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-80, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-80);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-79;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-79, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-79);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-78;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-78, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-78);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-77;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-77, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-77);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-76;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-76, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-76);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-75;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-75, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-75);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-74;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-74, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-74);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-73;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-73, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-73);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-72;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-72, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-72);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-71;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-71, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-71);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-70;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-70, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-70);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-69;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-69, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-69);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-68;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-68, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-68);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-67;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-67, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-67);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-66;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-66, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-66);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-65;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-65, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-65);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-64;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-64, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-64);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-63;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-63, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-63);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-62;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-62, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-62);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-61;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-61, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-61);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-60;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-60, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-60);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-59;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-59, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-59);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-58;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-58, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-58);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-57;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-57, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-57);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-56;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-56, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-56);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-55;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-55, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-55);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-54;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-54, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-54);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-53;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-53, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-53);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-52;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-52, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-52);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-51;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-51, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-51);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-50;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-50, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-50);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-49;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-49, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-49);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-48;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-48, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-48);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-47;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-47, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-47);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-46;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-46, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-46);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-45;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-45, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-45);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-44;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-44, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-44);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-43;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-43, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-43);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-42;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-42, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-42);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-41;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-41, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-41);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-40;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-40, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-40);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-39;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-39, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-39);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-38;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-38, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-38);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-37;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-37, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-37);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-36;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-36, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-36);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-35;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-35, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-35);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-34;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-34, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-34);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-33;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-33, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-33);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-32;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-32, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-32);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-31;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-31, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-31);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-30;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-30, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-30);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-29;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-29, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-29);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-28;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-28, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-28);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-27;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-27, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-27);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-26;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-26, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-26);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-25;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-25, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-25);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-24;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-24, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-24);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-23;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-23, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-23);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-22;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-22, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-22);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-21;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-21, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-21);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-20;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-20, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-20);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-19;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-19, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-19);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-18;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-18, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-18);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-17;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-17, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-17);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-16;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-16, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-16);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-15;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-15, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-15);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-14;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-14, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-14);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-13;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-13, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-13);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-12;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-12, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-12);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-11;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-11, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-11);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-10;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-10, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-10);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-9;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-9, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-9);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-8;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-8, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-8);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-7;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-7, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-7);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-6;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-6, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-6);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-5;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-5, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-5);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-4;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-4, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-4);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-3;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-3, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-3);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-2;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-2, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-2);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-1;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-1, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-1);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-0;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-0, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-0);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
DROP PROCEDURE sproc_1;
DROP FUNCTION func_1;
DROP TABLE t1_aux;
@@ -2631,6 +1434,9 @@ Note 1291 Column '' has duplicated value 'value1' in ENUM
SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+mtr add_suppression PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_testcase PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_warnings PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 SET("value1", "value1") )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
@@ -2648,6 +1454,9 @@ Warning 1265 Data truncated for column 'f1' at row 1
SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+mtr add_suppression PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_testcase PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_warnings PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 ENUM("value1", "value1") )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
@@ -2664,6 +1473,9 @@ Note 1291 Column '' has duplicated value 'value1' in ENUM
SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+mtr add_suppression PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_testcase PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+mtr check_warnings PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 TEXT ) LANGUAGE SQL SELECT f1;
CALL sp1( 'abc' );
diff --git a/mysql-test/suite/funcs_1/storedproc/load_sp_tb.inc b/mysql-test/suite/funcs_1/storedproc/load_sp_tb.inc
index 5224860925c..c4ae93aca6b 100644
--- a/mysql-test/suite/funcs_1/storedproc/load_sp_tb.inc
+++ b/mysql-test/suite/funcs_1/storedproc/load_sp_tb.inc
@@ -27,7 +27,7 @@ create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t1;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' into table t1;
--replace_result $engine_type <engine_to_be_tested>
eval
@@ -35,14 +35,14 @@ create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t2;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' into table t2;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t3(f1 char(20),f2 char(20),f3 integer) engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t3.txt' into table t3;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t3.txt' into table t3;
--replace_result $engine_type <engine_to_be_tested>
eval
@@ -50,7 +50,7 @@ create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t4;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
@@ -60,7 +60,7 @@ create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t6;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' into table t6;
USE db_storedproc;
@@ -70,7 +70,7 @@ create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t7.txt' into table t7;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t7.txt' into table t7;
--replace_result $engine_type <engine_to_be_tested>
eval
@@ -78,14 +78,14 @@ create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t7.txt' into table t8;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t7.txt' into table t8;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t9(f1 int, f2 char(25), f3 int) engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t9.txt' into table t9;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t9.txt' into table t9;
--replace_result $engine_type <engine_to_be_tested>
eval
@@ -93,7 +93,7 @@ create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t10;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' into table t10;
--replace_result $engine_type <engine_to_be_tested>
eval
@@ -101,4 +101,4 @@ create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t11;
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t4.txt' into table t11;
diff --git a/mysql-test/suite/funcs_1/storedproc/param_check.inc b/mysql-test/suite/funcs_1/storedproc/param_check.inc
index f6c0b30ab8b..203187f92b1 100644
--- a/mysql-test/suite/funcs_1/storedproc/param_check.inc
+++ b/mysql-test/suite/funcs_1/storedproc/param_check.inc
@@ -16,15 +16,32 @@
# Created:
# 2008-08-27 mleich
#
-
+# Modified:
+# 2008-11-17 pcrews
+# added --disable / --enable_warning statements to minimize differences
+# between platforms (Bug#40177 Test funcs_1.storedproc failing on Pushbuild)
+#
+# TODO: (After 5.1 GA)
+# 1) Examine reordering statements in this file to minimize the number of
+# --disable / --enable_warning statements. Unsure if performance gains
+# warrant the working time
+# 2) We could probably add a comparison of the # of warnings before the
+# assignment of @v1_proc and @v1_func to the # of warnings after assignment
+# The difference of these values should be zero
+# Refer to Bug#40177 - http://bugs.mysql.com/bug.php?id=40177 for notes as well
+
eval UPDATE t1_aux SET f1 = NULL;
# Enforce that all user variables have the same data type and initial value.
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+--disable_warnings
eval UPDATE t1_aux SET f1 = $test_value;
+--enable_warnings
SELECT f1 INTO @v1_tab FROM t1_aux;
+--disable_warnings
eval CALL sproc_1($test_value, @v1_proc);
eval SET @v1_func = func_1($test_value);
+--enable_warnings
if (`SELECT @v1_tab <> @v1_proc OR @v1_tab <> @v2_proc OR @v1_tab <> @v1_func`)
{
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
index f2df99fb5a3..d0fc6092959 100644
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
@@ -53,6 +53,7 @@ flush privileges;
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (user1a, localhost, user_1, , db_storedproc_1);
--source suite/funcs_1/include/show_connection.inc
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
index 83f5f2105c5..69378541b51 100644
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
@@ -58,6 +58,7 @@ GRANT CREATE ROUTINE ON db_storedproc.* TO 'user_1'@'localhost';
GRANT SELECT ON db_storedproc.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (user2_1, localhost, user_1, , db_storedproc);
--source suite/funcs_1/include/show_connection.inc
diff --git a/mysql-test/suite/funcs_1/t/is_basics_mixed.test b/mysql-test/suite/funcs_1/t/is_basics_mixed.test
index 235b91c67d0..7d03dc5f8b0 100644
--- a/mysql-test/suite/funcs_1/t/is_basics_mixed.test
+++ b/mysql-test/suite/funcs_1/t/is_basics_mixed.test
@@ -55,6 +55,7 @@ DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
# Low privileged user
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
SELECT DATABASE();
diff --git a/mysql-test/suite/funcs_1/t/is_coll_charset_applic.test b/mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test
index cda7b578aae..84690b0647c 100644
--- a/mysql-test/suite/funcs_1/t/is_coll_charset_applic.test
+++ b/mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test
@@ -1,7 +1,7 @@
-# suite/funcs_1/t/is_collation_character_set_applicability.test
+# suite/funcs_1/t/is_coll_char_set_appl.test
#
# Check the layout of information_schema.collation_character_set_applicability
-# and some functionality realted tests.
+# and some functionality related tests.
#
# Author:
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
diff --git a/mysql-test/suite/funcs_1/t/is_column_privileges.test b/mysql-test/suite/funcs_1/t/is_column_privileges.test
index cb8c50c01b7..925d07b9657 100644
--- a/mysql-test/suite/funcs_1/t/is_column_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_column_privileges.test
@@ -132,6 +132,7 @@ WITH GRANT OPTION;
eval $select;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $select;
diff --git a/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test b/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test
index 33269fe929c..98d01c60838 100644
--- a/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test
+++ b/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test
@@ -46,6 +46,7 @@ eval $my_show2;
eval $my_show3;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $my_select;
diff --git a/mysql-test/suite/funcs_1/t/is_columns.test b/mysql-test/suite/funcs_1/t/is_columns.test
index efb52acd48c..20b832ca5c3 100644
--- a/mysql-test/suite/funcs_1/t/is_columns.test
+++ b/mysql-test/suite/funcs_1/t/is_columns.test
@@ -148,6 +148,7 @@ eval $my_show2;
eval $my_show3;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
--source suite/funcs_1/datadict/datadict_bug_12777.inc
diff --git a/mysql-test/suite/funcs_1/t/is_engines_federated.test b/mysql-test/suite/funcs_1/t/is_engines_federated.test
index a15a1bafdbc..81eac89c0d2 100644
--- a/mysql-test/suite/funcs_1/t/is_engines_federated.test
+++ b/mysql-test/suite/funcs_1/t/is_engines_federated.test
@@ -9,7 +9,7 @@
#
let $engine_type= FEDERATED;
---source include/have_federated_db.inc
+--source suite/federated/have_federated_db.inc
--vertical_results
eval SELECT * FROM information_schema.engines
WHERE ENGINE = '$engine_type';
diff --git a/mysql-test/suite/funcs_1/t/is_schema_privileges.test b/mysql-test/suite/funcs_1/t/is_schema_privileges.test
index 1f408d71b39..c1fc70b03f7 100644
--- a/mysql-test/suite/funcs_1/t/is_schema_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_schema_privileges.test
@@ -116,6 +116,7 @@ let $show_testuser1 = SHOW GRANTS FOR 'testuser1'@'localhost';
let $show_testuser2 = SHOW GRANTS FOR 'testuser2'@'localhost';
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
GRANT SELECT ON db_datadict_4.* TO 'testuser2'@'localhost';
diff --git a/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test b/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test
index 3f60f71fe9a..d7b703ed04a 100644
--- a/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test
+++ b/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test
@@ -46,6 +46,7 @@ eval $my_show2;
eval $my_show3;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $my_select;
diff --git a/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test b/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test
index 9bfbf0cf335..b5f13ab323c 100644
--- a/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test
+++ b/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test
@@ -46,6 +46,7 @@ eval $my_show2;
eval $my_show3;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $my_select;
diff --git a/mysql-test/suite/funcs_1/t/is_statistics.test b/mysql-test/suite/funcs_1/t/is_statistics.test
index 458892a6d91..e202e7392ea 100644
--- a/mysql-test/suite/funcs_1/t/is_statistics.test
+++ b/mysql-test/suite/funcs_1/t/is_statistics.test
@@ -140,6 +140,7 @@ eval $my_show1;
eval $my_show2;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
# nothing visible for testuser1
diff --git a/mysql-test/suite/funcs_1/t/is_table_constraints.test b/mysql-test/suite/funcs_1/t/is_table_constraints.test
index a64b3bfaa6e..730e805c91e 100644
--- a/mysql-test/suite/funcs_1/t/is_table_constraints.test
+++ b/mysql-test/suite/funcs_1/t/is_table_constraints.test
@@ -132,6 +132,7 @@ eval $my_show1;
eval $my_show2;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
SHOW GRANTS FOR 'testuser1'@'localhost';
diff --git a/mysql-test/suite/funcs_1/t/is_table_privileges.test b/mysql-test/suite/funcs_1/t/is_table_privileges.test
index 5ea0dd7c6a7..27ce22816a2 100644
--- a/mysql-test/suite/funcs_1/t/is_table_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_table_privileges.test
@@ -116,6 +116,7 @@ WHERE table_name LIKE 'tb%'
ORDER BY grantee,table_schema,table_name,privilege_type;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
--replace_result $other_engine_type <other_engine_type>
diff --git a/mysql-test/suite/funcs_1/t/is_user_privileges.test b/mysql-test/suite/funcs_1/t/is_user_privileges.test
index 1d0d3e51aae..5f8c29ca39d 100644
--- a/mysql-test/suite/funcs_1/t/is_user_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_user_privileges.test
@@ -114,6 +114,7 @@ eval $my_select1;
eval $my_select2;
--echo # Establish connection testuser1 (user=testuser1)
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $my_select1;
diff --git a/mysql-test/suite/funcs_1/t/storedproc.test b/mysql-test/suite/funcs_1/t/storedproc.test
index d7ef1f2712b..cc45101fbed 100644
--- a/mysql-test/suite/funcs_1/t/storedproc.test
+++ b/mysql-test/suite/funcs_1/t/storedproc.test
@@ -817,6 +817,7 @@ CREATE PROCEDURE sp11() insert into mysql.t1 values('a');
--replace_column 13 created 14 modified
SELECT security_type from mysql.proc where specific_name='sp11';
+let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (u_1, localhost, user_1, , db_storedproc);
--source suite/funcs_1/include/show_connection.inc
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03.inc b/mysql-test/suite/funcs_1/triggers/triggers_03.inc
index 9ef6a9ac9af..e5bea5b2005 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03.inc
@@ -62,6 +62,7 @@ let $message= Testcase 3.5.3.2/6:;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03e_columns.inc b/mysql-test/suite/funcs_1/triggers/triggers_03e_columns.inc
index 475063587d4..60928ba8f35 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03e_columns.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03e_columns.inc
@@ -36,6 +36,7 @@ let $message= ####### Testcase for column privileges of triggers: #######;
grant SELECT,UPDATE on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03e_db_level.inc b/mysql-test/suite/funcs_1/triggers/triggers_03e_db_level.inc
index e5933eb84a8..cb9d8ddc78b 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03e_db_level.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03e_db_level.inc
@@ -37,6 +37,7 @@ let $message= Testcase for db level:;
show grants for test_noprivs@localhost;
# no trigger privilege->create trigger must fail:
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
let $message= no trigger privilege on db level for create:;
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03e_db_table_mix.inc b/mysql-test/suite/funcs_1/triggers/triggers_03e_db_table_mix.inc
index 82f4a28f664..de9cf61f641 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03e_db_table_mix.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03e_db_table_mix.inc
@@ -41,6 +41,7 @@ let $message= ####### Testcase for mix of db and table level: #######;
grant SELECT,INSERT on priv2_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
use priv1_db;
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03e_definer.inc b/mysql-test/suite/funcs_1/triggers/triggers_03e_definer.inc
index f1efff990f1..18c8a3ebcd5 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03e_definer.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03e_definer.inc
@@ -27,6 +27,7 @@ let $message= ######### Testcase for definer: ########;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03e_global_db_mix.inc b/mysql-test/suite/funcs_1/triggers/triggers_03e_global_db_mix.inc
index b6f4af7e0a7..cd90d25aefd 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03e_global_db_mix.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03e_global_db_mix.inc
@@ -38,6 +38,7 @@ let $message= #### Testcase for mix of user(global) and db level: ####;
grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03e_prepare.inc b/mysql-test/suite/funcs_1/triggers/triggers_03e_prepare.inc
index ea7c385768c..f1b3bbe2cb4 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03e_prepare.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03e_prepare.inc
@@ -32,6 +32,7 @@ let $message= #### Testcase for trigger privilege on execution time ########;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_useprivs@localhost;
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03e_table_level.inc b/mysql-test/suite/funcs_1/triggers/triggers_03e_table_level.inc
index 1019579a3fb..9cc272c09bc 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03e_table_level.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03e_table_level.inc
@@ -30,7 +30,7 @@ let $message= ######### Testcase for table level: ########;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03e_transaction.inc b/mysql-test/suite/funcs_1/triggers/triggers_03e_transaction.inc
index e43f4ce97a3..53ce49c728c 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03e_transaction.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03e_transaction.inc
@@ -27,6 +27,7 @@ let $message= ######### Testcase for transactions: ########;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_0407.inc b/mysql-test/suite/funcs_1/triggers/triggers_0407.inc
index 8bacc3944de..a5e3c180a71 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_0407.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_0407.inc
@@ -22,6 +22,7 @@ let $message= Testcase: 3.5:;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (con1_general,localhost,test_general,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_08.inc b/mysql-test/suite/funcs_1/triggers/triggers_08.inc
index 087f18e8e6b..4b4050b996d 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_08.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_08.inc
@@ -23,6 +23,7 @@ let $message= Testcase: 3.5:;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
+ let $MASTER_MYSOCK= query_get_value(SHOW VARIABLES LIKE 'socket', Value, 1);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (con2_general,localhost,test_general,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_09.inc b/mysql-test/suite/funcs_1/triggers/triggers_09.inc
index 6f3aca5be16..47277afb63c 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_09.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_09.inc
@@ -9,7 +9,7 @@ USE test;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/memory_tb3.txt'
into table tb3;
#################################
@@ -183,7 +183,6 @@ let $message= Testcase 3.5.9.4:;
@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
--enable_query_log
---error ER_BAD_NULL_ERROR
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
index 7230f240e2d..a5388dc80c3 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
@@ -10,7 +10,7 @@ USE test;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
+load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/memory_tb3.txt'
into table tb3;
@@ -109,7 +109,7 @@ let $message= Testcase 3.5.10.4:;
set @counter= 0;
select @counter as 'Rows Loaded Before';
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
- eval load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t9.txt' into table tb_load;
+ eval load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Select * from tb_load order by f1 limit 10;
diff --git a/mysql-test/suite/funcs_1/views/func_view.inc b/mysql-test/suite/funcs_1/views/func_view.inc
index 6679a0f898f..4aed5845a84 100644
--- a/mysql-test/suite/funcs_1/views/func_view.inc
+++ b/mysql-test/suite/funcs_1/views/func_view.inc
@@ -1048,7 +1048,7 @@ $col_type, id FROM t1_values';
# SELECT LOADFILE
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SET @my_select =
-'SELECT LOAD_FILE(''$MYSQLTEST_VARDIR/std_data_ln/funcs_1/load_file.txt'')
+'SELECT LOAD_FILE(''$MYSQLTEST_VARDIR/std_data/funcs_1/load_file.txt'')
AS my_col,
id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
diff --git a/mysql-test/suite/funcs_2/t/disabled.def b/mysql-test/suite/funcs_2/t/disabled.def
index c903662e052..da6230bd7ed 100644
--- a/mysql-test/suite/funcs_2/t/disabled.def
+++ b/mysql-test/suite/funcs_2/t/disabled.def
@@ -1,6 +1,6 @@
# Disabled by hhunger (2008-03-03) due to WL4204
-innodb_charset : Due to bug#20447
-myisam_charset : Due to bug#20477
-memory_charset : Due to bug#20447
-ndb_charset : Due to bug#20447
+innodb_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+myisam_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+memory_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+ndb_charset : Bug#20447 Problem with prefix keys with contractions and expansions
diff --git a/mysql-test/suite/jp/r/jp_create_db_sjis.result b/mysql-test/suite/jp/r/jp_create_db_sjis.result
index 2534e958931..fd66609b7bc 100644
--- a/mysql-test/suite/jp/r/jp_create_db_sjis.result
+++ b/mysql-test/suite/jp/r/jp_create_db_sjis.result
@@ -6,8 +6,8 @@ drop database if exists `ƒ\\•\`;
CREATE DATABASE `ÆÎݺÞ`;
CREATE DATABASE `“ú–{Œê`;
CREATE DATABASE `ƒ\\•\`;
-SHOW DATABASES;
-Database
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+schema_name
information_schema
ƒ\\•\
“ú–{Œê
diff --git a/mysql-test/suite/jp/r/jp_create_db_ucs2.result b/mysql-test/suite/jp/r/jp_create_db_ucs2.result
index 4ba1b7b47b9..3a3316ecbaf 100644
--- a/mysql-test/suite/jp/r/jp_create_db_ucs2.result
+++ b/mysql-test/suite/jp/r/jp_create_db_ucs2.result
@@ -7,8 +7,8 @@ SET character_set_server = ucs2;
CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`;
CREATE DATABASE `ÆüËܸì`;
CREATE DATABASE `íÜíÝíÞ`;
-SHOW DATABASES;
-Database
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+schema_name
information_schema
ÆüËܸì
íÜíÝíÞ
diff --git a/mysql-test/suite/jp/r/jp_create_db_ujis.result b/mysql-test/suite/jp/r/jp_create_db_ujis.result
index b3beebbd917..4d6561b88ce 100644
--- a/mysql-test/suite/jp/r/jp_create_db_ujis.result
+++ b/mysql-test/suite/jp/r/jp_create_db_ujis.result
@@ -6,8 +6,8 @@ SET character_set_database = ujis;
CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`;
CREATE DATABASE `ÆüËܸì`;
CREATE DATABASE `íÜíÝíÞ`;
-SHOW DATABASES;
-Database
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+schema_name
information_schema
ÆüËܸì
íÜíÝíÞ
diff --git a/mysql-test/suite/jp/r/jp_create_db_utf8.result b/mysql-test/suite/jp/r/jp_create_db_utf8.result
index 0e1725a9c86..2f70903ac71 100644
--- a/mysql-test/suite/jp/r/jp_create_db_utf8.result
+++ b/mysql-test/suite/jp/r/jp_create_db_utf8.result
@@ -6,8 +6,8 @@ SET character_set_database = utf8;
CREATE DATABASE `ニホï¾ï½ºï¾ž`;
CREATE DATABASE `日本語`;
CREATE DATABASE `龔龖龗`;
-SHOW DATABASES;
-Database
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+schema_name
information_schema
日本語
龔龖龗
diff --git a/mysql-test/suite/jp/t/jp_create_db_sjis.test b/mysql-test/suite/jp/t/jp_create_db_sjis.test
index 7d231eaf22c..49647bf1753 100644
--- a/mysql-test/suite/jp/t/jp_create_db_sjis.test
+++ b/mysql-test/suite/jp/t/jp_create_db_sjis.test
@@ -16,7 +16,7 @@ CREATE DATABASE `ÆÎݺÞ`;
CREATE DATABASE `“ú–{Œê`;
CREATE DATABASE `ƒ\\•\`;
-SHOW DATABASES;
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
USE `ÆÎݺÞ`;
USE `“ú–{Œê`;
diff --git a/mysql-test/suite/jp/t/jp_create_db_ucs2.test b/mysql-test/suite/jp/t/jp_create_db_ucs2.test
index 9e8ca7d2a0f..8be8cf62f15 100644
--- a/mysql-test/suite/jp/t/jp_create_db_ucs2.test
+++ b/mysql-test/suite/jp/t/jp_create_db_ucs2.test
@@ -18,7 +18,7 @@ CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`;
CREATE DATABASE `ÆüËܸì`;
CREATE DATABASE `íÜíÝíÞ`;
-SHOW DATABASES;
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
USE `ŽÆŽÎŽÝŽºŽÞ`;
USE `ÆüËܸì`;
diff --git a/mysql-test/suite/jp/t/jp_create_db_ujis.test b/mysql-test/suite/jp/t/jp_create_db_ujis.test
index 0095f864836..382c7937552 100644
--- a/mysql-test/suite/jp/t/jp_create_db_ujis.test
+++ b/mysql-test/suite/jp/t/jp_create_db_ujis.test
@@ -17,7 +17,7 @@ CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`;
CREATE DATABASE `ÆüËܸì`;
CREATE DATABASE `íÜíÝíÞ`;
-SHOW DATABASES;
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
USE `ŽÆŽÎŽÝŽºŽÞ`;
USE `ÆüËܸì`;
diff --git a/mysql-test/suite/jp/t/jp_create_db_utf8.test b/mysql-test/suite/jp/t/jp_create_db_utf8.test
index f8faf411ed0..2df5b9e1f6f 100644
--- a/mysql-test/suite/jp/t/jp_create_db_utf8.test
+++ b/mysql-test/suite/jp/t/jp_create_db_utf8.test
@@ -16,7 +16,7 @@ CREATE DATABASE `ニホï¾ï½ºï¾ž`;
CREATE DATABASE `日本語`;
CREATE DATABASE `龔龖龗`;
-SHOW DATABASES;
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
USE `ニホï¾ï½ºï¾ž`;
USE `日本語`;
diff --git a/mysql-test/suite/ndb/my.cnf b/mysql-test/suite/ndb/my.cnf
new file mode 100644
index 00000000000..60769272ada
--- /dev/null
+++ b/mysql-test/suite/ndb/my.cnf
@@ -0,0 +1,20 @@
+!include include/default_mysqld.cnf
+!include include/default_ndbd.cnf
+
+[cluster_config.1]
+NoOfReplicas= 2
+ndbd=,
+ndb_mgmd=
+mysqld=,
+
+[mysqld]
+# Make all mysqlds use cluster
+ndbcluster
+
+[ENV]
+NDB_CONNECTSTRING= @mysql_cluster.1.ndb_connectstring
+MASTER_MYPORT= @mysqld.1.1.port
+MASTER_MYPORT1= @mysqld.2.1.port
+
+NDB_BACKUP_DIR= @cluster_config.ndbd.1.1.BackupDataDir
+
diff --git a/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result b/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result
index f98e6a76981..b4d0b0b81a7 100644
--- a/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result
+++ b/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result
@@ -2,7 +2,7 @@ SET SESSION STORAGE_ENGINE = ndbcluster;
drop table if exists t1;
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
start transaction;
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
+load data infile 'LOAD_FILE' into table t1 fields terminated by ',' enclosed by '''' (a, b);
Warnings:
Warning 1261 Row 3 doesn't contain data for all columns
commit;
@@ -11,7 +11,7 @@ count(*)
4
truncate table t1;
start transaction;
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
+load data infile 'LOAD_FILE' into table t1 fields terminated by ',' enclosed by '''' (a, b);
Warnings:
Warning 1261 Row 3 doesn't contain data for all columns
rollback;
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
index 6631feeaa17..0699f8c4a59 100644
--- a/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
@@ -10,32 +10,32 @@ create table t1 (a int primary key) engine=ndb;
create table t2 (a int primary key) engine=ndb;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 1 # create database mysqltest
-master-bin1.000001 # Query 1 # use `mysqltest`; create table t1 (a int primary key) engine=ndb
-master-bin1.000001 # Query 102 # use `test`; create table t2 (a int primary key) engine=ndb
+mysqld-bin.000001 # Query 1 # create database mysqltest
+mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t1 (a int primary key) engine=ndb
+mysqld-bin.000001 # Query 2 # use `test`; create table t2 (a int primary key) engine=ndb
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # create database mysqltest
-master-bin.000001 # Query 1 # use `mysqltest`; create table t1 (a int primary key) engine=ndb
-master-bin.000001 # Query 102 # use `test`; create table t2 (a int primary key) engine=ndb
+mysqld-bin.000001 # Query 1 # create database mysqltest
+mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t1 (a int primary key) engine=ndb
+mysqld-bin.000001 # Query 2 # use `test`; create table t2 (a int primary key) engine=ndb
reset master;
reset master;
alter table t2 add column (b int);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 102 # use `test`; alter table t2 add column (b int)
+mysqld-bin.000001 # Query 2 # use `test`; alter table t2 add column (b int)
reset master;
reset master;
ALTER DATABASE mysqltest CHARACTER SET latin1;
drop table mysqltest.t1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 102 # ALTER DATABASE mysqltest CHARACTER SET latin1
-master-bin.000001 # Query 102 # use `mysqltest`; drop table `t1`
+mysqld-bin.000001 # Query 2 # ALTER DATABASE mysqltest CHARACTER SET latin1
+mysqld-bin.000001 # Query 2 # use `mysqltest`; drop table `t1`
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 102 # ALTER DATABASE mysqltest CHARACTER SET latin1
-master-bin.000001 # Query 102 # use `mysqltest`; drop table `t1`
+mysqld-bin.000001 # Query 2 # ALTER DATABASE mysqltest CHARACTER SET latin1
+mysqld-bin.000001 # Query 2 # use `mysqltest`; drop table `t1`
reset master;
reset master;
use test;
@@ -44,14 +44,14 @@ drop database mysqltest;
create table t1 (a int primary key) engine=ndb;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (test.t2)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
-master-bin1.000001 # Query 1 # drop database mysqltest
-master-bin1.000001 # Query 1 # use `test`; create table t1 (a int primary key) engine=ndb
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t2)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: #
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
+mysqld-bin.000001 # Query 1 # drop database mysqltest
+mysqld-bin.000001 # Query 1 # use `test`; create table t1 (a int primary key) engine=ndb
drop table t2;
reset master;
reset master;
@@ -85,63 +85,63 @@ DROP LOGFILE GROUP lg1
ENGINE =NDB;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 1 # CREATE LOGFILE GROUP lg1
+mysqld-bin.000001 # Query 1 # CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB
-master-bin1.000001 # Query 1 # ALTER LOGFILE GROUP lg1
+mysqld-bin.000001 # Query 1 # ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB
-master-bin1.000001 # Query 1 # CREATE TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB
-master-bin1.000001 # Query 1 # ALTER TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
ADD DATAFILE 'datafile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB
-master-bin1.000001 # Query 1 # ALTER TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE = NDB
-master-bin1.000001 # Query 1 # ALTER TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
DROP DATAFILE 'datafile02.dat'
ENGINE = NDB
-master-bin1.000001 # Query 1 # DROP TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # DROP TABLESPACE ts1
ENGINE = NDB
-master-bin1.000001 # Query 1 # DROP LOGFILE GROUP lg1
+mysqld-bin.000001 # Query 1 # DROP LOGFILE GROUP lg1
ENGINE =NDB
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 1 # CREATE LOGFILE GROUP lg1
+mysqld-bin.000001 # Query 1 # CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB
-master-bin1.000001 # Query 1 # ALTER LOGFILE GROUP lg1
+mysqld-bin.000001 # Query 1 # ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB
-master-bin1.000001 # Query 1 # CREATE TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB
-master-bin1.000001 # Query 1 # ALTER TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
ADD DATAFILE 'datafile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB
-master-bin1.000001 # Query 1 # ALTER TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE = NDB
-master-bin1.000001 # Query 1 # ALTER TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
DROP DATAFILE 'datafile02.dat'
ENGINE = NDB
-master-bin1.000001 # Query 1 # DROP TABLESPACE ts1
+mysqld-bin.000001 # Query 1 # DROP TABLESPACE ts1
ENGINE = NDB
-master-bin1.000001 # Query 1 # DROP LOGFILE GROUP lg1
+mysqld-bin.000001 # Query 1 # DROP LOGFILE GROUP lg1
ENGINE =NDB
drop table t1;
reset master;
@@ -156,13 +156,13 @@ create table t3 (a int key) engine=ndb;
rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 1 # use `test`; create table t1 (a int key) engine=ndb
-master-bin1.000001 # Query 1 # use `test`; create table t2 (a int key) engine=ndb
-master-bin1.000001 # Query 1 # use `test`; create table t3 (a int key) engine=ndb
-master-bin1.000001 # Query 1 # use `test`; rename table `test.t3` to `test.t4`
-master-bin1.000001 # Query 1 # use `test`; rename table `test.t2` to `test.t3`
-master-bin1.000001 # Query 1 # use `test`; rename table `test.t1` to `test.t2`
-master-bin1.000001 # Query 1 # use `test`; rename table `test.t4` to `test.t1`
+mysqld-bin.000001 # Query 1 # use `test`; create table t1 (a int key) engine=ndb
+mysqld-bin.000001 # Query 1 # use `test`; create table t2 (a int key) engine=ndb
+mysqld-bin.000001 # Query 1 # use `test`; create table t3 (a int key) engine=ndb
+mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t3` to `test.t4`
+mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t2` to `test.t3`
+mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t1` to `test.t2`
+mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t4` to `test.t1`
drop table t1;
drop table t2;
drop table t3;
@@ -179,18 +179,18 @@ insert into t2 values(2);
drop table t2;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 1 # use `test`; create table t1 (a int key) engine=ndb
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (test.t1)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
-master-bin1.000001 # Query 1 # use `test`; rename table `test.t1` to `test.t2`
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (test.t2)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
-master-bin1.000001 # Query 102 # use `test`; drop table t2
+mysqld-bin.000001 # Query 1 # use `test`; create table t1 (a int key) engine=ndb
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: #
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
+mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t1` to `test.t2`
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t2)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: #
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
+mysqld-bin.000001 # Query 2 # use `test`; drop table t2
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_discover.result b/mysql-test/suite/ndb/r/ndb_binlog_discover.result
index 7c3a976c4d5..f8704971878 100644
--- a/mysql-test/suite/ndb/r/ndb_binlog_discover.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_discover.result
@@ -3,15 +3,15 @@ create table t1 (a int key) engine=ndb;
reset master;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Incident 1 # #1 (LOST_EVENTS)
-master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
-PURGE MASTER LOGS TO 'master-bin.000002';
+mysqld-bin.000001 # Incident 1 # #1 (LOST_EVENTS)
+mysqld-bin.000001 # Rotate 1 # mysqld-bin.000002;pos=4
+PURGE MASTER LOGS TO 'mysqld-bin.000002';
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Query 1 # BEGIN
-master-bin.000002 # Table_map 1 # table_id: # (test.t1)
-master-bin.000002 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-master-bin.000002 # Write_rows 1 # table_id: #
-master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000002 # Query 1 # COMMIT
+mysqld-bin.000002 # Query 1 # BEGIN
+mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1)
+mysqld-bin.000002 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000002 # Write_rows 1 # table_id: #
+mysqld-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
+mysqld-bin.000002 # Query 1 # COMMIT
drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result
index 30c2ca872ed..bb02002ed58 100644
--- a/mysql-test/suite/ndb/r/ndb_binlog_format.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_format.result
@@ -14,19 +14,19 @@ UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c;
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2)
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2)
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2)
-master-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f
-master-bin.000001 # Query # # use `test`; UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t3)
-master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
+mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2)
+mysqld-bin.000001 # Query # # use `test`; BEGIN
+mysqld-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2)
+mysqld-bin.000001 # Query # # use `test`; COMMIT
+mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c
+mysqld-bin.000001 # Query # # use `test`; BEGIN
+mysqld-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2)
+mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f
+mysqld-bin.000001 # Query # # use `test`; UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c
+mysqld-bin.000001 # Query # # use `test`; COMMIT
+mysqld-bin.000001 # Query # # BEGIN
+mysqld-bin.000001 # Table_map # # table_id: # (test.t3)
+mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query # # COMMIT
DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result b/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
index e4c9faa802c..d018f67dd71 100644
--- a/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
@@ -7,5 +7,5 @@ create table t1 (a int primary key, b int) engine=ndb;
insert into t1 values (1, 1);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # use `test`; drop table if exists t1
+mysqld-bin.000001 # Query 1 # use `test`; drop table if exists t1
drop database mysqltest;
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result b/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
index f80a46324e0..0260d49f75f 100644
--- a/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
@@ -11,27 +11,27 @@ insert into t1 values (1,1);
alter table t1 add c int;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # BEGIN
-master-bin.000001 # Table_map 1 # table_id: # (mysqltest.t1)
-master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Query 1 # COMMIT
+mysqld-bin.000001 # Query 1 # BEGIN
+mysqld-bin.000001 # Table_map 1 # table_id: # (mysqltest.t1)
+mysqld-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 1 # COMMIT
reset master;
use mysqltest;
insert into t2 values (1,1);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (mysqltest.t1)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (mysqltest.t2)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysqltest.t1)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysqltest.t2)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: #
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
reset master;
use mysqltest;
drop table t1;
@@ -41,40 +41,40 @@ create table t2 (d int key, e int) engine=ndb;
insert into t1 values (1,1);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # BEGIN
-master-bin.000001 # Table_map 1 # table_id: # (mysqltest.t2)
-master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows 1 # table_id: #
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Query 1 # COMMIT
-master-bin.000001 # Query 1 # use `mysqltest`; drop table t1
-master-bin.000001 # Query 1 # use `mysqltest`; drop table t2
-master-bin.000001 # Query 1 # use `mysqltest`; create table t1 (d int key, e int) engine=ndb
-master-bin.000001 # Query 1 # use `mysqltest`; create table t2 (d int key, e int) engine=ndb
-master-bin.000001 # Query 1 # BEGIN
-master-bin.000001 # Table_map 1 # table_id: # (mysqltest.t1)
-master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows 1 # table_id: #
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Query 1 # COMMIT
+mysqld-bin.000001 # Query 1 # BEGIN
+mysqld-bin.000001 # Table_map 1 # table_id: # (mysqltest.t2)
+mysqld-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 1 # table_id: #
+mysqld-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 1 # COMMIT
+mysqld-bin.000001 # Query 1 # use `mysqltest`; drop table t1
+mysqld-bin.000001 # Query 1 # use `mysqltest`; drop table t2
+mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t1 (d int key, e int) engine=ndb
+mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t2 (d int key, e int) engine=ndb
+mysqld-bin.000001 # Query 1 # BEGIN
+mysqld-bin.000001 # Table_map 1 # table_id: # (mysqltest.t1)
+mysqld-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 1 # table_id: #
+mysqld-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 1 # COMMIT
use mysqltest;
insert into t2 values (1,1);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 1 # use `mysqltest`; drop table `t1`
-master-bin1.000001 # Query 1 # use `mysqltest`; drop table `t2`
-master-bin1.000001 # Query 1 # use `mysqltest`; create table t1 (d int key, e int) engine=ndb
-master-bin1.000001 # Query 1 # use `mysqltest`; create table t2 (d int key, e int) engine=ndb
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (mysqltest.t1)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (mysqltest.t2)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
+mysqld-bin.000001 # Query 1 # use `mysqltest`; drop table `t1`
+mysqld-bin.000001 # Query 1 # use `mysqltest`; drop table `t2`
+mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t1 (d int key, e int) engine=ndb
+mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t2 (d int key, e int) engine=ndb
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysqltest.t1)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: #
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysqltest.t2)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: #
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
drop database mysqltest;
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_multi.result
index b2a9da39be0..e1af4aea092 100644
--- a/mysql-test/suite/ndb/r/ndb_binlog_multi.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_multi.result
@@ -8,13 +8,13 @@ CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB;
INSERT INTO t2 VALUES (1,1),(2,2);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 102 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (test.t2)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
+mysqld-bin.000001 # Query 2 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t2)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: #
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
select * from t2 order by a;
a b
1 1
@@ -30,14 +30,14 @@ a b
DROP TABLE t2;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 102 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
-master-bin.000001 # Query 1 # BEGIN
-master-bin.000001 # Table_map 1 # table_id: # (test.t2)
-master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows 1 # table_id: #
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Query 1 # COMMIT
-master-bin.000001 # Query 1 # use `test`; DROP TABLE t2
+mysqld-bin.000001 # Query 2 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
+mysqld-bin.000001 # Query 1 # BEGIN
+mysqld-bin.000001 # Table_map 1 # table_id: # (test.t2)
+mysqld-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 1 # table_id: #
+mysqld-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 1 # COMMIT
+mysqld-bin.000001 # Query 1 # use `test`; DROP TABLE t2
SELECT inserts,updates,deletes,schemaops FROM
mysql.ndb_binlog_index WHERE epoch=<the_epoch>;
inserts updates deletes schemaops
@@ -48,13 +48,13 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB;
INSERT INTO t1 VALUES (1),(2);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 102 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (test.t1)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
+mysqld-bin.000001 # Query 2 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: #
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
mysql.ndb_binlog_index ORDER BY epoch DESC LIMIT 1;
@the_epoch2:=epoch inserts updates deletes schemaops
@@ -66,14 +66,14 @@ inserts updates deletes schemaops
drop table t1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 102 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (test.t1)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
-master-bin1.000001 # Query 102 # use `test`; drop table t1
+mysqld-bin.000001 # Query 2 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
+mysqld-bin.000001 # Query 2 # BEGIN
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
+mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+mysqld-bin.000001 # Write_rows 2 # table_id: #
+mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Query 2 # COMMIT
+mysqld-bin.000001 # Query 2 # use `test`; drop table t1
SELECT inserts,updates,deletes,schemaops FROM
mysql.ndb_binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>;
inserts updates deletes schemaops
diff --git a/mysql-test/suite/ndb/r/ndb_config.result b/mysql-test/suite/ndb/r/ndb_config.result
index 9495af29df6..e12741212d6 100644
--- a/mysql-test/suite/ndb/r/ndb_config.result
+++ b/mysql-test/suite/ndb/r/ndb_config.result
@@ -1,4 +1,4 @@
-ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10, mysqld,11,
+ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4,localhost mysqld,5,localhost mysqld,6,localhost
1,localhost,20971520,1048576 2,localhost,20971520,1048576
1 localhost 20971520 1048576
2 localhost 20971520 1048576
diff --git a/mysql-test/suite/ndb/r/ndb_load.result b/mysql-test/suite/ndb/r/ndb_load.result
index 416a350066b..f990b12e735 100644
--- a/mysql-test/suite/ndb/r/ndb_load.result
+++ b/mysql-test/suite/ndb/r/ndb_load.result
@@ -1,10 +1,10 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=NDB;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1 ;
+LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
ERROR 23000: Can't write; duplicate key in table 't1'
DROP TABLE t1;
CREATE TABLE t1 (word CHAR(20) NOT NULL) ENGINE=NDB;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1 ;
+LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
SELECT * FROM t1 ORDER BY word;
word
Aarhus
diff --git a/mysql-test/suite/ndb/r/ndb_loaddatalocal.result b/mysql-test/suite/ndb/r/ndb_loaddatalocal.result
index 1d15c608f03..71d1b143089 100644
--- a/mysql-test/suite/ndb/r/ndb_loaddatalocal.result
+++ b/mysql-test/suite/ndb/r/ndb_loaddatalocal.result
@@ -1,19 +1,19 @@
DROP TABLE IF EXISTS t1;
create table t1(a int) engine=myisam;
-select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int) engine=ndb;
-load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
select count(*) from t1;
count(*)
10000
drop table t1;
create table t1(a int) engine=myisam;
insert into t1 values (1), (2), (2), (3);
-select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key) engine=ndb;
-load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
select * from t1 order by a;
a
1
@@ -22,10 +22,10 @@ a
drop table t1;
create table t1(a int) engine=myisam;
insert into t1 values (1), (1), (2), (3);
-select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key) engine=ndb;
-load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
select * from t1 order by a;
a
1
@@ -34,10 +34,10 @@ a
drop table t1;
create table t1(a int) engine=myisam;
insert into t1 values (1), (2), (3), (3);
-select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key) engine=ndb;
-load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
select * from t1 order by a;
a
1
diff --git a/mysql-test/suite/ndb/r/ndb_read_multi_range.result b/mysql-test/suite/ndb/r/ndb_read_multi_range.result
index 4c3496f3f47..113fb28bb78 100644
--- a/mysql-test/suite/ndb/r/ndb_read_multi_range.result
+++ b/mysql-test/suite/ndb/r/ndb_read_multi_range.result
@@ -491,4 +491,4 @@ select * from t2 order by id;
id
3
drop trigger kaboom;
-drop table t1;
+drop table t1, t2;
diff --git a/mysql-test/suite/ndb/r/ndb_replace.result b/mysql-test/suite/ndb/r/ndb_replace.result
index 23844ce3bff..ba78017ef7b 100644
--- a/mysql-test/suite/ndb/r/ndb_replace.result
+++ b/mysql-test/suite/ndb/r/ndb_replace.result
@@ -72,7 +72,7 @@ pk apk data
3 3 3
delete from t1;
insert into t1 values (1, 1, 1), (4, 4, 4), (6, 6, 6);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+load data infile '../../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
select * from t1 order by pk;
pk apk data
1 1 1
@@ -80,7 +80,7 @@ pk apk data
5 6 NULL
delete from t1;
insert into t1 values (1, 1, 1), (3, 3, 3), (5, 5, 5);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+load data infile '../../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
select * from t1 order by pk;
pk apk data
1 1 1
diff --git a/mysql-test/suite/ndb/r/ndb_restore.result b/mysql-test/suite/ndb/r/ndb_restore.result
index a33c5c5f31c..48c32bc14b6 100644
--- a/mysql-test/suite/ndb/r/ndb_restore.result
+++ b/mysql-test/suite/ndb/r/ndb_restore.result
@@ -131,12 +131,8 @@ create table t9 engine=myisam as select * from t9_c;
create table t10 engine=myisam as select * from t10_c;
ForceVarPart: 0
ForceVarPart: 1
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
ForceVarPart: 0
@@ -290,12 +286,8 @@ auto_increment
10001
ALTER TABLE t7_c
PARTITION BY LINEAR KEY (`dardtestard`);
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
select count(*) from t1;
@@ -498,12 +490,8 @@ select * from t9_c) a;
count(*)
3
drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
drop table if exists t2_c;
diff --git a/mysql-test/suite/ndb/r/ndb_restore_partition.result b/mysql-test/suite/ndb/r/ndb_restore_partition.result
index 7dc4057e615..58a35437a2e 100644
--- a/mysql-test/suite/ndb/r/ndb_restore_partition.result
+++ b/mysql-test/suite/ndb/r/ndb_restore_partition.result
@@ -125,12 +125,8 @@ create table t6 engine=myisam as select * from t6_c;
create table t7 engine=myisam as select * from t7_c;
create table t8 engine=myisam as select * from t8_c;
create table t9 engine=myisam as select * from t9_c;
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
select count(*) from t1;
@@ -248,12 +244,8 @@ PARTITION BY LINEAR HASH (`relatta`)
PARTITIONS 4;
ALTER TABLE t7_c
PARTITION BY LINEAR KEY (`dardtestard`);
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
select count(*) from t1;
@@ -456,12 +448,8 @@ select * from t9_c) a;
count(*)
3
drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
Create table test/def/t2_c failed: Translate frm error
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/suite/ndb/r/ndb_restore_print.result b/mysql-test/suite/ndb/r/ndb_restore_print.result
index e05f8e43d1a..7ff15652b3f 100644
--- a/mysql-test/suite/ndb/r/ndb_restore_print.result
+++ b/mysql-test/suite/ndb/r/ndb_restore_print.result
@@ -227,12 +227,8 @@ hex(h3) NULL
hex(i1) NULL
hex(i2) NULL
hex(i3) NULL
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
1;0x1;0x17;0x789A;0x789ABCDE;0xFEDC0001;127;255;32767;65535;2147483647;4294967295;9223372036854775807;18446744073709551615;1;12345678901234567890123456789012;123456789;1;12345678901234567890123456789012;123456789;0x12;0x123456789ABCDEF0;0x012345;0x12;0x123456789ABCDEF0;0x00123450
2;0x0;0x0;0x0;0x0;0x0;-128;0;-32768;0;-2147483648;0;-9223372036854775808;0;;;;;;;0x0;0x0;0x0;0x0;0x0;0x0
@@ -261,12 +257,8 @@ create table t4 (pk int key, a int) engine ndb;
insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15);
insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25);
insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
'1' '1' '12345678901234567890123456789012' '123456789' '1' '12345678901234567890123456789012' '123456789' '0x20' '0x123456789ABCDEF020' '0x012345000020' '0x1200000020' '0x123456789ABCDEF000000020' '0x00123450000020'
@@ -305,12 +297,8 @@ create table t1
insert into t1 values(1, 8388607, 16777215);
insert into t1 values(2, -8388608, 0);
insert into t1 values(3, -1, 1);
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
1;8388607;16777215
2;-8388608;0
diff --git a/mysql-test/suite/ndb/r/ndb_single_user.result b/mysql-test/suite/ndb/r/ndb_single_user.result
index 0a4f7cd0b5f..8133e540d71 100644
--- a/mysql-test/suite/ndb/r/ndb_single_user.result
+++ b/mysql-test/suite/ndb/r/ndb_single_user.result
@@ -1,5 +1,4 @@
-use test;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+drop table if exists t1,t2;
create table t1 (a int key, b int unique, c int) engine ndb;
ERROR HY000: Can't create table 'test.t1' (errno: 299)
CREATE LOGFILE GROUP lg1
@@ -85,6 +84,7 @@ update t1 set b=b+100 where a > 7;
delete from t1;
insert into t1 select * from t2;
create unique index new_index on t1 (b,c);
+drop table t2;
drop table t1;
ERROR 42S02: Unknown table 't1'
create index new_index_fail on t1 (c);
diff --git a/mysql-test/suite/ndb/r/ndb_trigger.result b/mysql-test/suite/ndb/r/ndb_trigger.result
index d074ad01c22..cc3e27df852 100644
--- a/mysql-test/suite/ndb/r/ndb_trigger.result
+++ b/mysql-test/suite/ndb/r/ndb_trigger.result
@@ -120,7 +120,7 @@ d 1 2.050000000000000000000000000000
delete from t1;
delete from t2;
insert into t1 values (3, 1, 1.05), (5, 2, 2.05);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
+load data infile '../../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
select * from t1 order by id;
id a b
3 4 0.000000000000000000000000000000
diff --git a/mysql-test/suite/ndb/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result
index 7ebadfa3685..73a2e0c1dda 100644
--- a/mysql-test/suite/ndb/r/ps_7ndb.result
+++ b/mysql-test/suite/ndb/r/ps_7ndb.result
@@ -1286,11 +1286,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
+0 two
1 one
-2 two
3 three
4 four
set @arg00=0;
diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def
index c638c7b4774..0fc9a5d3ad6 100644
--- a/mysql-test/suite/ndb/t/disabled.def
+++ b/mysql-test/suite/ndb/t/disabled.def
@@ -9,8 +9,7 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
-ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
+ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
diff --git a/mysql-test/suite/ndb/t/ndb_alter_table.test b/mysql-test/suite/ndb/t/ndb_alter_table.test
index cbd941b8a9c..bf0f8a540bb 100644
--- a/mysql-test/suite/ndb/t/ndb_alter_table.test
+++ b/mysql-test/suite/ndb/t/ndb_alter_table.test
@@ -362,7 +362,8 @@ CREATE TABLE t1 (
CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255));
--disable_warnings
---exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLD_DATADIR/test/tmp.dat
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
--enable_warnings
@@ -372,7 +373,7 @@ truncate ndb_show_tables;
alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
--disable_warnings
---exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLD_DATADIR/test/tmp.dat
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
--enable_warnings
@@ -386,9 +387,9 @@ alter table t1 add index i2(new_tiny);
drop index i1 on t1;
--disable_warnings
---exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLD_DATADIR/test/tmp.dat
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
---exec rm $MYSQLTEST_VARDIR/master-data/test/tmp.dat || true
+--exec rm $MYSQLD_DATADIR/test/tmp.dat || true
--enable_warnings
select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
diff --git a/mysql-test/suite/ndb/t/ndb_binlog_discover.test b/mysql-test/suite/ndb/t/ndb_binlog_discover.test
index e842b57093a..dc8275a8a39 100644
--- a/mysql-test/suite/ndb/t/ndb_binlog_discover.test
+++ b/mysql-test/suite/ndb/t/ndb_binlog_discover.test
@@ -30,7 +30,7 @@ while ($mysql_errno)
--enable_query_log
--source include/show_binlog_events2.inc
-PURGE MASTER LOGS TO 'master-bin.000002';
+PURGE MASTER LOGS TO 'mysqld-bin.000002';
--source include/show_binlog_events2.inc
drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_config.test b/mysql-test/suite/ndb/t/ndb_config.test
index f63c0087c1e..08d1226953c 100644
--- a/mysql-test/suite/ndb/t/ndb_config.test
+++ b/mysql-test/suite/ndb/t/ndb_config.test
@@ -6,7 +6,7 @@
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --type=ndbd --host=localhost 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host --config-file=$NDB_BACKUP_DIR/config.ini 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host --config-file=$MYSQL_TEST_DIR/std_data/ndb_config_config.ini 2> /dev/null
# End of 4.1 tests
@@ -18,6 +18,6 @@
--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --ndb-shm --connections --query=type,nodeid1,nodeid2,group,nodeidserver --mycnf 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --host=localhost --config-file=$NDB_BACKUP_DIR/config.ini 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --host=1.2.3.4 --config-file=$NDB_BACKUP_DIR/config.ini 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --host=127.0.0.1 --config-file=$NDB_BACKUP_DIR/config.ini 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --host=localhost --config-file=$MYSQL_TEST_DIR/std_data/ndb_config_config.ini 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --host=1.2.3.4 --config-file=$MYSQL_TEST_DIR/std_data/ndb_config_config.ini 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --host=127.0.0.1 --config-file=$MYSQL_TEST_DIR/std_data/ndb_config_config.ini 2> /dev/null
diff --git a/mysql-test/suite/ndb/t/ndb_load.test b/mysql-test/suite/ndb/t/ndb_load.test
index af2df70b74e..aa48b3dfdcf 100644
--- a/mysql-test/suite/ndb/t/ndb_load.test
+++ b/mysql-test/suite/ndb/t/ndb_load.test
@@ -12,12 +12,12 @@ DROP TABLE IF EXISTS t1;
# should give duplicate key
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=NDB;
--error 1022
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1 ;
+LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
DROP TABLE t1;
# now without a primary key we should be ok
CREATE TABLE t1 (word CHAR(20) NOT NULL) ENGINE=NDB;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1 ;
+LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
SELECT * FROM t1 ORDER BY word;
DROP TABLE t1;
diff --git a/mysql-test/suite/ndb/t/ndb_loaddatalocal.test b/mysql-test/suite/ndb/t/ndb_loaddatalocal.test
index 3eae3891f43..257a26087b7 100644
--- a/mysql-test/suite/ndb/t/ndb_loaddatalocal.test
+++ b/mysql-test/suite/ndb/t/ndb_loaddatalocal.test
@@ -15,55 +15,56 @@ while ($1)
dec $1;
}
set SQL_LOG_BIN=1;
+let $MYSQLD_DATADIR= `select @@datadir`;
enable_query_log;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
#This will generate a 20KB file, now test LOAD DATA LOCAL
drop table t1;
create table t1(a int) engine=ndb;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
select count(*) from t1;
---remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile
+--remove_file $MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile
drop table t1;
create table t1(a int) engine=myisam;
insert into t1 values (1), (2), (2), (3);
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key) engine=ndb;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile
select * from t1 order by a;
drop table t1;
create table t1(a int) engine=myisam;
insert into t1 values (1), (1), (2), (3);
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key) engine=ndb;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile
select * from t1 order by a;
drop table t1;
create table t1(a int) engine=myisam;
insert into t1 values (1), (2), (3), (3);
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key) engine=ndb;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile
select * from t1 order by a;
drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_read_multi_range.test b/mysql-test/suite/ndb/t/ndb_read_multi_range.test
index 1965874940b..1c439e65099 100644
--- a/mysql-test/suite/ndb/t/ndb_read_multi_range.test
+++ b/mysql-test/suite/ndb/t/ndb_read_multi_range.test
@@ -337,4 +337,4 @@ delete from t1 where id in (1,2);
select * from t2 order by id;
drop trigger kaboom;
-drop table t1;
+drop table t1, t2;
diff --git a/mysql-test/suite/ndb/t/ndb_replace.test b/mysql-test/suite/ndb/t/ndb_replace.test
index aa2072b98dd..432cf7f2dcd 100644
--- a/mysql-test/suite/ndb/t/ndb_replace.test
+++ b/mysql-test/suite/ndb/t/ndb_replace.test
@@ -85,12 +85,12 @@ select * from t1 order by pk;
delete from t1;
# Test for load data replace which updates pk
insert into t1 values (1, 1, 1), (4, 4, 4), (6, 6, 6);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+load data infile '../../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
select * from t1 order by pk;
delete from t1;
# Now test for load data replace which doesn't touch pk
insert into t1 values (1, 1, 1), (3, 3, 3), (5, 5, 5);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+load data infile '../../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
select * from t1 order by pk;
delete from t1;
# Finally test for both types of replace ... select
diff --git a/mysql-test/suite/ndb/t/ndb_single_user.test b/mysql-test/suite/ndb/t/ndb_single_user.test
index 07925b25917..a64ac066a49 100644
--- a/mysql-test/suite/ndb/t/ndb_single_user.test
+++ b/mysql-test/suite/ndb/t/ndb_single_user.test
@@ -3,8 +3,7 @@
-- source include/not_embedded.inc
--disable_warnings
-use test;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+drop table if exists t1,t2;
--enable_warnings
# operations allowed while cluster is in single user mode
@@ -15,8 +14,8 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
--eval set @node_id= SUBSTRING('$node_id', 20)+0
--enable_query_log
--let $node_id= `SELECT @node_id`
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT
+--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" --single-user >> $NDB_TOOLS_OUTPUT
# verify that we are indeed in single user mode
# and test that some operations give correct errors
@@ -103,6 +102,8 @@ insert into t1 select * from t2;
# - prior to bugfix this would fail
create unique index new_index on t1 (b,c);
+drop table t2;
+
# test some sql on other mysqld
--connection server2
--error 1051
@@ -124,7 +125,7 @@ update t1 set b=b+100;
--error 1296
update t1 set b=b+100 where a > 7;
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
#
@@ -139,8 +140,8 @@ BEGIN;
update t1 set b=b+100 where a=2;
# enter single user mode
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT
+--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" --single-user >> $NDB_TOOLS_OUTPUT
--connection server1
update t1 set b=b+100 where a=3;
@@ -160,7 +161,7 @@ create table t2 (a int) engine myisam;
alter table t2 add column (b int);
# exit single user mode
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
# cleanup
diff --git a/mysql-test/suite/ndb/t/ndb_trigger.test b/mysql-test/suite/ndb/t/ndb_trigger.test
index 2e944174fd0..9f01157fc93 100644
--- a/mysql-test/suite/ndb/t/ndb_trigger.test
+++ b/mysql-test/suite/ndb/t/ndb_trigger.test
@@ -98,7 +98,7 @@ delete from t1;
delete from t2;
# Check for load data replace
insert into t1 values (3, 1, 1.05), (5, 2, 2.05);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
+load data infile '../../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
select * from t1 order by id;
select * from t2 order by op, a, b;
update t4 set b = 10 where a = 1;
diff --git a/mysql-test/suite/ndb/t/ndbapi.test b/mysql-test/suite/ndb/t/ndbapi.test
index 3424513f8af..398a2cbfbfa 100644
--- a/mysql-test/suite/ndb/t/ndbapi.test
+++ b/mysql-test/suite/ndb/t/ndbapi.test
@@ -7,28 +7,28 @@ drop database if exists mysqltest;
--enable_warnings
--exec echo Running ndbapi_simple
---exec $NDB_EXAMPLES_DIR/ndbapi_simple/ndbapi_simple $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" >> $NDB_EXAMPLES_OUTPUT
+--exec $NDB_EXAMPLES_DIR/ndbapi_simple/ndbapi_simple $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
--exec echo Running ndbapi_simple_index
---exec $NDB_EXAMPLES_DIR/ndbapi_simple_index/ndbapi_simple_index $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" >> $NDB_EXAMPLES_OUTPUT
+--exec $NDB_EXAMPLES_DIR/ndbapi_simple_index/ndbapi_simple_index $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
--exec echo Running ndbapi_scan
---exec $NDB_EXAMPLES_DIR/ndbapi_scan/ndbapi_scan $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" >> $NDB_EXAMPLES_OUTPUT
+--exec $NDB_EXAMPLES_DIR/ndbapi_scan/ndbapi_scan $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
--exec echo Running ndbapi_retries
---exec $NDB_EXAMPLES_DIR/ndbapi_retries/ndbapi_retries $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" >> $NDB_EXAMPLES_OUTPUT
+--exec $NDB_EXAMPLES_DIR/ndbapi_retries/ndbapi_retries $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
--exec echo Running ndbapi_async
---exec $NDB_EXAMPLES_DIR/ndbapi_async/ndbapi_async $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" >> $NDB_EXAMPLES_OUTPUT
+--exec $NDB_EXAMPLES_DIR/ndbapi_async/ndbapi_async $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
--exec echo Running ndbapi_async1
---exec $NDB_EXAMPLES_DIR/ndbapi_async1/ndbapi_async1 $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" >> $NDB_EXAMPLES_OUTPUT
+--exec $NDB_EXAMPLES_DIR/ndbapi_async1/ndbapi_async1 $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
use TEST_DB;
create table t0(c0 int, c1 int, c2 char(4), c3 char(4), c4 text,
primary key(c0, c2)) engine ndb charset latin1;
#--exec echo Running ndbapi_event
-#--exec $NDB_EXAMPLES_DIR/ndbapi_event/ndbapi_event "localhost:$NDBCLUSTER_PORT" 1 >> $NDB_EXAMPLES_OUTPUT
+#--exec $NDB_EXAMPLES_DIR/ndbapi_event/ndbapi_event "$NDB_CONNECTSTRING" 1 >> $NDB_EXAMPLES_OUTPUT
insert into t0 values (1, 2, 'a', 'b', null);
insert into t0 values (3, 4, 'c', 'd', null);
update t0 set c3 = 'e' where c0 = 1 and c2 = 'a'; -- use pk
@@ -41,4 +41,4 @@ delete from t0;
drop table t0;
--exec echo Running mgmapi_logevent
---exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "localhost:$NDBCLUSTER_PORT" 1 >> $NDB_EXAMPLES_OUTPUT
+--exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "$NDB_CONNECTSTRING" 1 >> $NDB_EXAMPLES_OUTPUT
diff --git a/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result b/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
index 768aa86c832..102a96a15f4 100644
--- a/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
+++ b/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
@@ -27,12 +27,8 @@ pk1 c2 c3 hex(c4)
3 Sweden 498 1
4 Sweden 497 1
5 Sweden 496 1
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
DROP TABLE test.t1;
ALTER TABLESPACE table_space1
@@ -95,12 +91,8 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
LENGTH(data)
16384
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
DROP TABLE test.t1;
DROP TABLE test.t2;
@@ -325,12 +317,8 @@ pk1 c2 c3 hex(c4)
248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
DROP TABLE test.t1;
DROP TABLE test.t2;
diff --git a/mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result b/mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result
index 7f26313894c..37188aeb1ca 100644
--- a/mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result
+++ b/mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result
@@ -265,13 +265,9 @@ COUNT(*)
SELECT COUNT(*) FROM history;
COUNT(*)
200
-CREATE TEMPORARY TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM mysql.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-DROP TABLE IF EXISTS mysql.backup_info;
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+DROP TABLE test.backup_info;
************ Restore the slave ************************
CREATE DATABASE tpcb;
***** Check a few slave restore values ***************
diff --git a/mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test b/mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test
index a7e00262f5c..e08b1b6f701 100644
--- a/mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test
+++ b/mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test
@@ -9,8 +9,6 @@
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_default_cluster.inc
--source include/not_embedded.inc
-#--source include/big_test.inc
-#--source include/have_ndb_extra.inc
--source include/ndb_master-slave.inc
#### Test start cleanup section #####
@@ -289,25 +287,7 @@ while ($j)
SELECT COUNT(*) FROM history;
-#RESET MASTER;
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
-
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
-
-CREATE TEMPORARY TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-
-DELETE FROM mysql.backup_info;
-
-LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
---exec rm $MYSQLTEST_VARDIR/tmp.dat || true
---replace_column 1 <the_backup_id>
-
-SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
-
-let the_backup_id=`select @the_backup_id`;
-
-DROP TABLE IF EXISTS mysql.backup_info;
-#RESET MASTER;
+--source include/ndb_backup.inc
--echo ************ Restore the slave ************************
connection slave;
@@ -424,7 +404,7 @@ diff_files $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql $MYSQLTEST_VARDIR/tmp/RPL_DD_A
## Note: Ths files should only get removed, if the above diff succeeds.
---exec rm $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql
---exec rm $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql
+remove_file $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql;
+remove_file $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql;
# End 5.1 test case
diff --git a/mysql-test/suite/parts/inc/partition.pre b/mysql-test/suite/parts/inc/partition.pre
index 0c906ce4581..7c3b0d9d1ef 100644
--- a/mysql-test/suite/parts/inc/partition.pre
+++ b/mysql-test/suite/parts/inc/partition.pre
@@ -246,7 +246,7 @@ if (0)
# Option, for displaying files:
# $ls= 1 (default)
# --> Display the table related directory content via
-# "ls $MYSQLTEST_VARDIR/master-data/test/t1*"
+# "ls $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*"
# if these informations were collected.
# This is probably not portable to some OS.
# $ls= 0
@@ -410,7 +410,7 @@ if (0)
# 3. How to analyze a partitioning bug revealed with these tests/ How to build
# a small replay script from the monstrous protocols ?
#------------------------------------------------------------------------------#
-# a) crash -- use the file var/master-data/mysql/general_log.CSV
+# a) crash -- use the file var/mysqld.1/data/mysql/general_log.CSV
# b) no crash, but unexpected server response (there is no "reject file)
# -- use the file r/<testcase>.log
# Please be aware that the option $debug= 0 suppresses the
diff --git a/mysql-test/suite/parts/inc/partition_auto_increment.inc b/mysql-test/suite/parts/inc/partition_auto_increment.inc
index 5e9ad47aa2e..26375c72c0c 100644
--- a/mysql-test/suite/parts/inc/partition_auto_increment.inc
+++ b/mysql-test/suite/parts/inc/partition_auto_increment.inc
@@ -50,12 +50,7 @@ if (!$skip_update)
UPDATE t1 SET c1 = 40 WHERE c1 = 50;
SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AND TABLE_NAME='t1';
- -- error 0, ER_BAD_NULL_ERROR
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
-if (!$mysql_errno)
-{
- echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
-}
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
}
@@ -203,12 +198,7 @@ if (!$skip_update)
UPDATE t1 SET c1 = 140 WHERE c1 = 150;
SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AND TABLE_NAME='t1';
- -- error 0, ER_BAD_NULL_ERROR
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
-if (!$mysql_errno)
-{
- echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
-}
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
}
diff --git a/mysql-test/suite/parts/inc/partition_check_drop.inc b/mysql-test/suite/parts/inc/partition_check_drop.inc
index 1ab12e738ab..daaa5e541c7 100644
--- a/mysql-test/suite/parts/inc/partition_check_drop.inc
+++ b/mysql-test/suite/parts/inc/partition_check_drop.inc
@@ -18,21 +18,28 @@ if ($no_debug)
--disable_query_log
}
+# Get the MySQL Servers datadir without ending slash
+let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
+#echo MYSQLD_DATADIR: $MYSQLD_DATADIR;
+
if ($do_file_tests)
{
-let $ls_file= $MYSQLTEST_VARDIR/master-data/test/tmp2;
-# List the files belonging to the table t1
---list_files_write_file $ls_file $MYSQLTEST_VARDIR/master-data/test t1*
---chmod 0644 $ls_file
-if ($with_directories)
-{
---list_files_append_file $ls_file $MYSQLTEST_VARDIR/tmp t1*
-}
-eval SET @aux = load_file('$ls_file');
+ let $ls_file= $MYSQLD_DATADIR/test/tmp2;
+ # List the files belonging to the table t1
+ --list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
+ --chmod 0644 $ls_file
+ if ($with_directories)
+ {
+ --list_files_append_file $ls_file $MYSQLTEST_VARDIR/tmp t1*
+ }
+ eval SET @aux = load_file('$ls_file');
+
+ # clean up
+ remove_file $ls_file;
}
if (!$do_file_tests)
{
-SET @aux = '--- not determined ---';
+ SET @aux = '--- not determined ---';
}
# UPDATE the current filelist of the table t1 within t0_definition
@@ -59,7 +66,7 @@ if ($found_garbage)
}
# Do a manual cleanup, because the following tests should not suffer from
# remaining files
- --exec rm -f $MYSQLTEST_VARDIR/master-data/test/t1* || true
+ --exec rm -f $MYSQLD_DATADIR/test/t1* || true
if ($with_directories)
{
--exec rm -f $MYSQLTEST_VARDIR/tmp/t1* || true
diff --git a/mysql-test/suite/parts/inc/partition_key_32col.inc b/mysql-test/suite/parts/inc/partition_key_32col.inc
index 614693902dc..74016d9b556 100644
--- a/mysql-test/suite/parts/inc/partition_key_32col.inc
+++ b/mysql-test/suite/parts/inc/partition_key_32col.inc
@@ -13,7 +13,7 @@ partition pa2 max_rows=30 min_rows=3,
partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
---disable_abort_on error
+#--disable_abort_on error
show create table t1;
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'),
diff --git a/mysql-test/suite/parts/inc/partition_layout.inc b/mysql-test/suite/parts/inc/partition_layout.inc
index 23872b7ff1f..67d0fd4c0e9 100644
--- a/mysql-test/suite/parts/inc/partition_layout.inc
+++ b/mysql-test/suite/parts/inc/partition_layout.inc
@@ -9,6 +9,7 @@ eval SHOW CREATE TABLE t1;
# listing of files belonging to the table t1
if ($ls)
{
- --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
- --list_files $MYSQLTEST_VARDIR/master-data/test t1*
+ let $MYSQLD_DATADIR= `select @@datadir`;
+ --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+ --list_files $MYSQLD_DATADIR/test t1*
}
diff --git a/mysql-test/suite/parts/inc/partition_layout_check1.inc b/mysql-test/suite/parts/inc/partition_layout_check1.inc
index fb5887f9124..bca41b6f9c7 100644
--- a/mysql-test/suite/parts/inc/partition_layout_check1.inc
+++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc
@@ -1,12 +1,12 @@
################################################################################
-# inc/partition_layout_check1.inc #
+# inc/partition_layout_check1.inc #
# #
# Purpose: #
# Store the SHOW CREATE TABLE output and the list of files belonging to #
# this table + print this into the protocol #
# This script is only usefule when sourced within the partitioning tests. #
# #
-# Attention: The routine inc/partition_layout_check2.inc is very similar #
+# Attention: The routine inc/partition_layout_check2.inc is very similar #
# to this one. So if something has to be changed here it #
# might be necessary to do it also there #
# #
@@ -25,31 +25,34 @@ if ($no_debug)
# Clean the table holding the definition of t1
DELETE FROM t0_definition;
+# Get the MySQL Servers datadir without ending slash
+let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
+#echo MYSQLD_DATADIR: $MYSQLD_DATADIR;
+
# Dump the current definition of the table t1 to tmp1
# This complicated method - let another mysqltest collect the output - is used
# because of two reasons
# - SHOW CREATE TABLE t1 is at least currently most probably more reliable than
# the corresponding SELECT on the INFORMATION_SCHEMA
# - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT
-let $show_file= $MYSQLTEST_VARDIR/master-data/test/tmp1;
---exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $show_file 2>&1 || true
-
+let $show_file= $MYSQLD_DATADIR/test/tmp1;
+--exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1
if ($do_file_tests)
{
-# List the files belonging to the table t1
-let $ls_file= $MYSQLTEST_VARDIR/master-data/test/tmp2;
---list_files_write_file $ls_file $MYSQLTEST_VARDIR/master-data/test t1*
---chmod 0644 $ls_file
-if ($with_directories)
-{
---list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-data-dir t1*
---list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
-}
-eval SET @aux = load_file('$ls_file');
+ # List the files belonging to the table t1
+ let $ls_file= $MYSQLD_DATADIR/test/tmp2;
+ --list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
+ --chmod 0644 $ls_file
+ if ($with_directories)
+ {
+ --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-data-dir t1*
+ --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
+ }
+ eval SET @aux = load_file('$ls_file');
}
if (!$do_file_tests)
{
-SET @aux = '--- not determined ---';
+ SET @aux = '--- not determined ---';
}
# Insert the current definition of the table t1 into t0_definition
@@ -66,9 +69,9 @@ if ($do_file_tests)
if ($ls)
{
# Print the list of files into the protocol
- eval SELECT REPLACE(@aux,'$MYSQLTEST_VARDIR','\$MYSQLTEST_VARDIR')
- AS "unified filelist"
- FROM t0_definition WHERE state = 'old';
+ replace_result $MYSQLD_DATADIR MYSQLD_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+ SELECT file_list AS "unified filelist"
+ FROM t0_definition WHERE state = 'old';
}
}
--enable_query_log
diff --git a/mysql-test/suite/parts/inc/partition_layout_check2.inc b/mysql-test/suite/parts/inc/partition_layout_check2.inc
index 17dc0016b1d..7ff871a4c45 100644
--- a/mysql-test/suite/parts/inc/partition_layout_check2.inc
+++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc
@@ -7,7 +7,7 @@
# since the call of inc/partition_layout_check1.inc #
# This script is only usefule when sourced within the partitioning tests. #
# #
-# Attention: The routine inc/partition_layout_check1.inc is very similar #
+# Attention: The routine inc/partition_layout_check1.inc is very similar #
# to this one. So if something has to be changed here it #
# might be necessary to do it also there #
# #
@@ -23,26 +23,31 @@ if ($no_debug)
# Clean the table holding the definition of t1
DELETE FROM t0_definition WHERE state = 'new';
+
+# Get the MySQL Servers datadir without ending slash
+let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
+#echo MYSQLD_DATADIR: $MYSQLD_DATADIR;
+
# Dump the current definition of the table t1 to tmp1
-let $show_file= $MYSQLTEST_VARDIR/master-data/test/tmp1;
---exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $show_file 2>&1 || true
+let $show_file= $MYSQLD_DATADIR/test/tmp1;
+--exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1
if ($do_file_tests)
{
-# List the files belonging to the table t1
-let $ls_file= $MYSQLTEST_VARDIR/master-data/test/tmp2;
---list_files_write_file $ls_file $MYSQLTEST_VARDIR/master-data/test t1*
---chmod 0644 $ls_file
-if ($with_directories)
-{
---list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-data-dir t1*
---list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
-}
-eval SET @aux = load_file('$ls_file');
+ # List the files belonging to the table t1
+ let $ls_file= $MYSQLD_DATADIR/test/tmp2;
+ --list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
+ --chmod 0644 $ls_file
+ if ($with_directories)
+ {
+ --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-data-dir t1*
+ --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
+ }
+ eval SET @aux = load_file('$ls_file');
}
if (!$do_file_tests)
{
-SET @aux = '--- not determined ---';
+ SET @aux = '--- not determined ---';
}
# Insert the current definition of the table t1 into t0_definition
diff --git a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc
index 6e7b15c606b..83d0fa37375 100644
--- a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc
+++ b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc
@@ -124,9 +124,12 @@ eval insert into t3 values ($val1);
eval insert into t3 values ($val2);
eval insert into t3 values ($val3);
-eval load data infile '../std_data_ln/parts/$infile' into table t4;
-eval load data infile '../std_data_ln/parts/$infile' into table t5;
-eval load data infile '../std_data_ln/parts/$infile' into table t6;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data infile '$MYSQLTEST_VARDIR/std_data/parts/$infile' into table t4;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data infile '$MYSQLTEST_VARDIR/std_data/parts/$infile' into table t5;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data infile '$MYSQLTEST_VARDIR/std_data/parts/$infile' into table t6;
eval select $sqlfunc from t1 order by col1;
diff --git a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result
index 768aa86c832..102a96a15f4 100644
--- a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result
+++ b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result
@@ -27,12 +27,8 @@ pk1 c2 c3 hex(c4)
3 Sweden 498 1
4 Sweden 497 1
5 Sweden 496 1
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
DROP TABLE test.t1;
ALTER TABLESPACE table_space1
@@ -95,12 +91,8 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
LENGTH(data)
16384
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
DROP TABLE test.t1;
DROP TABLE test.t2;
@@ -325,12 +317,8 @@ pk1 c2 c3 hex(c4)
248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
DROP TABLE test.t1;
DROP TABLE test.t2;
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
index abdcab76d26..79462c25050 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
@@ -55,9 +55,9 @@ insert into t2 values (17 );
insert into t3 values (5 );
insert into t3 values (13 );
insert into t3 values (17 );
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6;
select abs(col1) from t1 order by col1;
abs(col1)
5
@@ -1740,9 +1740,9 @@ insert into t2 values (17);
insert into t3 values (5);
insert into t3 values (19);
insert into t3 values (17);
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6;
select mod(col1,10) from t1 order by col1;
mod(col1,10)
5
@@ -3447,9 +3447,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select day(col1) from t1 order by col1;
day(col1)
17
@@ -3952,9 +3952,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofmonth(col1) from t1 order by col1;
dayofmonth(col1)
17
@@ -4457,9 +4457,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofweek(col1) from t1 order by col1;
dayofweek(col1)
3
@@ -4974,9 +4974,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -5481,9 +5481,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -5988,9 +5988,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select extract(month from col1) from t1 order by col1;
extract(month from col1)
1
@@ -6495,9 +6495,9 @@ insert into t2 values ('21:59');
insert into t3 values ('09:09');
insert into t3 values ('14:30');
insert into t3 values ('21:59');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select hour(col1) from t1 order by col1;
hour(col1)
9
@@ -7008,9 +7008,9 @@ insert into t2 values ('00:59:22.000024');
insert into t3 values ('09:09:15.000002');
insert into t3 values ('04:30:01.000018');
insert into t3 values ('00:59:22.000024');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select microsecond(col1) from t1 order by col1;
microsecond(col1)
0
@@ -7507,9 +7507,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select minute(col1) from t1 order by col1;
minute(col1)
9
@@ -8026,9 +8026,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -8545,9 +8545,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -9064,9 +9064,9 @@ insert into t2 values ('2006-05-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-05-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select month(col1) from t1 order by col1;
month(col1)
1
@@ -9577,9 +9577,9 @@ insert into t2 values ('2006-09-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-09-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select quarter(col1) from t1 order by col1;
quarter(col1)
1
@@ -10088,9 +10088,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1;
time_to_sec(col1)-(time_to_sec(col1)-20)
20
@@ -10605,9 +10605,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select to_days(col1)-to_days('2006-01-01') from t1 order by col1;
to_days(col1)-to_days('2006-01-01')
16
@@ -11114,9 +11114,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select datediff(col1, '2006-01-01') from t1 order by col1;
datediff(col1, '2006-01-01')
16
@@ -11623,9 +11623,9 @@ insert into t2 values ('2006-05-25');
insert into t3 values ('2006-12-03');
insert into t3 values ('2006-11-17');
insert into t3 values ('2006-05-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select weekday(col1) from t1 order by col1;
weekday(col1)
4
@@ -12132,9 +12132,9 @@ insert into t2 values ('2004-05-25');
insert into t3 values ('1996-01-03');
insert into t3 values ('2000-02-17');
insert into t3 values ('2004-05-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select year(col1)-1990 from t1 order by col1;
year(col1)-1990
6
@@ -12645,9 +12645,9 @@ insert into t2 values ('2006-03-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-08-17');
insert into t3 values ('2006-03-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select yearweek(col1)-200600 from t1 order by col1;
yearweek(col1)-200600
1
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
index 3a54be8fec2..375a6e130be 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
@@ -55,9 +55,9 @@ insert into t2 values (17 );
insert into t3 values (5 );
insert into t3 values (13 );
insert into t3 values (17 );
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6;
select abs(col1) from t1 order by col1;
abs(col1)
5
@@ -1740,9 +1740,9 @@ insert into t2 values (17);
insert into t3 values (5);
insert into t3 values (19);
insert into t3 values (17);
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6;
select mod(col1,10) from t1 order by col1;
mod(col1,10)
5
@@ -3447,9 +3447,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select day(col1) from t1 order by col1;
day(col1)
17
@@ -3952,9 +3952,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofmonth(col1) from t1 order by col1;
dayofmonth(col1)
17
@@ -4457,9 +4457,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofweek(col1) from t1 order by col1;
dayofweek(col1)
3
@@ -4974,9 +4974,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -5481,9 +5481,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -5988,9 +5988,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select extract(month from col1) from t1 order by col1;
extract(month from col1)
1
@@ -6495,9 +6495,9 @@ insert into t2 values ('21:59');
insert into t3 values ('09:09');
insert into t3 values ('14:30');
insert into t3 values ('21:59');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select hour(col1) from t1 order by col1;
hour(col1)
9
@@ -7008,9 +7008,9 @@ insert into t2 values ('00:59:22.000024');
insert into t3 values ('09:09:15.000002');
insert into t3 values ('04:30:01.000018');
insert into t3 values ('00:59:22.000024');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select microsecond(col1) from t1 order by col1;
microsecond(col1)
0
@@ -7507,9 +7507,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select minute(col1) from t1 order by col1;
minute(col1)
9
@@ -8026,9 +8026,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -8545,9 +8545,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -9064,9 +9064,9 @@ insert into t2 values ('2006-05-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-05-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select month(col1) from t1 order by col1;
month(col1)
1
@@ -9577,9 +9577,9 @@ insert into t2 values ('2006-09-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-09-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select quarter(col1) from t1 order by col1;
quarter(col1)
1
@@ -10088,9 +10088,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1;
time_to_sec(col1)-(time_to_sec(col1)-20)
20
@@ -10605,9 +10605,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select to_days(col1)-to_days('2006-01-01') from t1 order by col1;
to_days(col1)-to_days('2006-01-01')
16
@@ -11114,9 +11114,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select datediff(col1, '2006-01-01') from t1 order by col1;
datediff(col1, '2006-01-01')
16
@@ -11623,9 +11623,9 @@ insert into t2 values ('2006-05-25');
insert into t3 values ('2006-12-03');
insert into t3 values ('2006-11-17');
insert into t3 values ('2006-05-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select weekday(col1) from t1 order by col1;
weekday(col1)
4
@@ -12132,9 +12132,9 @@ insert into t2 values ('2004-05-25');
insert into t3 values ('1996-01-03');
insert into t3 values ('2000-02-17');
insert into t3 values ('2004-05-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select year(col1)-1990 from t1 order by col1;
year(col1)-1990
6
@@ -12645,9 +12645,9 @@ insert into t2 values ('2006-03-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-08-17');
insert into t3 values ('2006-03-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select yearweek(col1)-200600 from t1 order by col1;
yearweek(col1)-200600
1
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result b/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result
index 1bacbc1b325..a1e10ee4a9c 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result
@@ -53,9 +53,9 @@ insert into t2 values (17 );
insert into t3 values (5 );
insert into t3 values (13 );
insert into t3 values (17 );
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6;
select abs(col1) from t1 order by col1;
abs(col1)
5
@@ -1261,9 +1261,9 @@ insert into t2 values (17);
insert into t3 values (5);
insert into t3 values (19);
insert into t3 values (17);
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6;
select mod(col1,10) from t1 order by col1;
mod(col1,10)
5
@@ -2479,9 +2479,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select day(col1) from t1 order by col1;
day(col1)
17
@@ -2867,9 +2867,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofmonth(col1) from t1 order by col1;
dayofmonth(col1)
17
@@ -3255,9 +3255,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofweek(col1) from t1 order by col1;
dayofweek(col1)
3
@@ -3653,9 +3653,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -4041,9 +4041,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -4429,9 +4429,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select extract(month from col1) from t1 order by col1;
extract(month from col1)
1
@@ -4827,9 +4827,9 @@ insert into t2 values ('21:59');
insert into t3 values ('09:09');
insert into t3 values ('14:30');
insert into t3 values ('21:59');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select hour(col1) from t1 order by col1;
hour(col1)
9
@@ -5225,9 +5225,9 @@ insert into t2 values ('00:59:22.000024');
insert into t3 values ('09:09:15.000002');
insert into t3 values ('04:30:01.000018');
insert into t3 values ('00:59:22.000024');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select microsecond(col1) from t1 order by col1;
microsecond(col1)
0
@@ -5613,9 +5613,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select minute(col1) from t1 order by col1;
minute(col1)
9
@@ -6011,9 +6011,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -6409,9 +6409,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -6807,9 +6807,9 @@ insert into t2 values ('2006-05-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-05-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select month(col1) from t1 order by col1;
month(col1)
1
@@ -7205,9 +7205,9 @@ insert into t2 values ('2006-09-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-09-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select quarter(col1) from t1 order by col1;
quarter(col1)
1
@@ -7603,9 +7603,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1;
time_to_sec(col1)-(time_to_sec(col1)-20)
20
@@ -8001,9 +8001,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select to_days(col1)-to_days('2006-01-01') from t1 order by col1;
to_days(col1)-to_days('2006-01-01')
16
@@ -8389,9 +8389,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select datediff(col1, '2006-01-01') from t1 order by col1;
datediff(col1, '2006-01-01')
16
@@ -8777,9 +8777,9 @@ insert into t2 values ('2006-05-25');
insert into t3 values ('2006-12-03');
insert into t3 values ('2006-11-17');
insert into t3 values ('2006-05-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select weekday(col1) from t1 order by col1;
weekday(col1)
4
@@ -9175,9 +9175,9 @@ insert into t2 values ('2004-05-25');
insert into t3 values ('1996-01-03');
insert into t3 values ('2000-02-17');
insert into t3 values ('2004-05-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select year(col1)-1990 from t1 order by col1;
year(col1)-1990
6
@@ -9573,9 +9573,9 @@ insert into t2 values ('2006-03-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-08-17');
insert into t3 values ('2006-03-25');
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select yearweek(col1)-200600 from t1 order by col1;
yearweek(col1)-200600
1
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
index 1946ebbf978..ac39d038c56 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
@@ -43,7 +43,6 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
1
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
-# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
@@ -192,7 +191,6 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
1
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
-# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
index a30dfbcbe72..9a23cd4364e 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
@@ -42,12 +42,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
31
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
+0
2
-4
5
6
10
@@ -215,12 +217,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
141
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
+0
2
-4
5
6
9
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_memory.result b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
index 96925d206f6..77bab79f020 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_memory.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
@@ -42,12 +42,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
52
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
+0
2
-4
5
6
10
@@ -214,12 +216,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
152
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
+0
2
-4
5
6
9
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
index 204c241cfa8..b5b001ec17a 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
@@ -42,12 +42,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
52
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
+0
2
-4
5
6
10
@@ -214,12 +216,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
152
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
+0
2
-4
5
6
9
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_ndb.result b/mysql-test/suite/parts/r/partition_auto_increment_ndb.result
index 85e226b749b..408f32cce78 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_ndb.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_ndb.result
@@ -43,12 +43,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
52
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
+0
2
-4
5
6
10
@@ -215,12 +217,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
152
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
+0
2
-4
5
6
9
diff --git a/mysql-test/suite/parts/r/partition_bit_innodb.result b/mysql-test/suite/parts/r/partition_bit_innodb.result
index 2ea66592679..a9ae917f13d 100644
--- a/mysql-test/suite/parts/r/partition_bit_innodb.result
+++ b/mysql-test/suite/parts/r/partition_bit_innodb.result
@@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='INNODB' partition by key (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
@@ -18,7 +18,7 @@ partition pa2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -30,7 +30,7 @@ partition by key (a) partitions 2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+ `a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+ `a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -88,7 +88,7 @@ partition by key (a) partitions 4;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -102,7 +102,7 @@ alter table t2 drop primary key;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0'
+ `a` bit(1) NOT NULL DEFAULT b'0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 4 */
@@ -114,7 +114,7 @@ alter table t2 add primary key (a);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -133,7 +133,7 @@ partition pa4 values less than (256));
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `a` bit(8) NOT NULL DEFAULT '\0',
+ `a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
@@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
- `a` bit(8) NOT NULL DEFAULT '\0',
+ `a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
diff --git a/mysql-test/suite/parts/r/partition_bit_myisam.result b/mysql-test/suite/parts/r/partition_bit_myisam.result
index c1f067d80d1..680845c9971 100644
--- a/mysql-test/suite/parts/r/partition_bit_myisam.result
+++ b/mysql-test/suite/parts/r/partition_bit_myisam.result
@@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='MyISAM' partition by key (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
@@ -18,7 +18,7 @@ partition pa2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -30,7 +30,7 @@ partition by key (a) partitions 2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+ `a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+ `a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -88,7 +88,7 @@ partition by key (a) partitions 4;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -102,7 +102,7 @@ alter table t2 drop primary key;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0'
+ `a` bit(1) NOT NULL DEFAULT b'0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 4 */
@@ -114,7 +114,7 @@ alter table t2 add primary key (a);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -133,7 +133,7 @@ partition pa4 values less than (256));
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `a` bit(8) NOT NULL DEFAULT '\0',
+ `a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
@@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
- `a` bit(8) NOT NULL DEFAULT '\0',
+ `a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
diff --git a/mysql-test/suite/parts/r/partition_bit_ndb.result b/mysql-test/suite/parts/r/partition_bit_ndb.result
deleted file mode 100644
index add3ed394ad..00000000000
--- a/mysql-test/suite/parts/r/partition_bit_ndb.result
+++ /dev/null
@@ -1,126 +0,0 @@
-SET @max_row = 20;
-create table t1 (a bit(65), primary key (a)) partition by key (a);
-ERROR 42000: Display width out of range for column 'a' (max = 64)
-create table t1 (a bit(0), primary key (a)) partition by key (a);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-drop table t1;
-create table t1 (a bit(0), primary key (a)) partition by key (a) (
-partition pa1 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp',
-partition pa2 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp');
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
-drop table t1;
-create table t1 (a bit(64), primary key (a)) partition by key (a);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-insert into t1 values
-(b'1111111111111111111111111111111111111111111111111111111111111111'),
-(b'1000000000000000000000000000000000000000000000000000000000000000'),
-(b'0000000000000000000000000000000000000000000000000000000000000001'),
-(b'1010101010101010101010101010101010101010101010101010101010101010'),
-(b'0101010101010101010101010101010101010101010101010101010101010101');
-select hex(a) from t1;
-hex(a)
-1
-5555555555555555
-8000000000000000
-AAAAAAAAAAAAAAAA
-FFFFFFFFFFFFFFFF
-drop table t1;
-create table t1 (a bit(64), primary key (a)) partition by key (a)(
-partition pa1 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=20 min_rows=2,
-partition pa2 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=30 min_rows=3,
-partition pa3 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=30 min_rows=4,
-partition pa4 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=40 min_rows=2);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
-insert into t1 values
-(b'1111111111111111111111111111111111111111111111111111111111111111'),
-(b'1000000000000000000000000000000000000000000000000000000000000000'),
-(b'0000000000000000000000000000000000000000000000000000000000000001'),
-(b'1010101010101010101010101010101010101010101010101010101010101010'),
-(b'0101010101010101010101010101010101010101010101010101010101010101');
-select hex(a) from t1;
-hex(a)
-1
-5555555555555555
-8000000000000000
-AAAAAAAAAAAAAAAA
-FFFFFFFFFFFFFFFF
-drop table t1;
-create table t1 (a bit, primary key (a)) partition by key (a);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-insert into t1 values (b'0'), (b'1');
-select hex(a) from t1;
-hex(a)
-0
-1
-alter table t1 drop primary key;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-select hex(a) from t1;
-hex(a)
-0
-1
-alter table t1 add primary key (a);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-select hex(a) from t1;
-hex(a)
-0
-1
-drop table t1;
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index 5eab78de8c2..8869f6d450c 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -213,5 +213,10 @@ START TRANSACTION;
INSERT INTO t1 VALUES (NULL, 'first row t2');
SET autocommit=OFF;
ALTER TABLE t1 AUTO_INCREMENT = 10;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t1 VALUES (NULL, 'second row t2');
+SELECT a,b FROM t1 ORDER BY a;
+a b
+1 first row t2
+2 second row t2
DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_t55.out b/mysql-test/suite/parts/r/partition_t55.out
index d86ceda8c38..e309785a30c 100644
--- a/mysql-test/suite/parts/r/partition_t55.out
+++ b/mysql-test/suite/parts/r/partition_t55.out
@@ -4,65 +4,65 @@ t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
-27 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp0.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp0.MYI
-18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp1.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp1.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp2.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp2.MYI
-18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp3.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp3.MYI
-18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp4.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp4.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp0.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp0.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp1.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp1.MYI
-18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp2.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp2.MYI
-18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp3.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp3.MYI
-36 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp4.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp4.MYI
-36 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp0.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp0.MYI
-0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp1.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp1.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp2.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp2.MYI
-18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp3.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp3.MYI
-27 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp4.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp4.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp0.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp0.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp1.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp1.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp2.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp2.MYI
-18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp3.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp3.MYI
-45 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp4.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp4.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp0.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp0.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp1.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp1.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp2.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp2.MYI
-0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp3.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp3.MYI
-0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp4.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp4.MYI
-0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp0.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp0.MYI
-0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp1.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp1.MYI
-0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp2.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp2.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp3.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp3.MYI
-9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp4.MYD
-1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp4.MYI
-8594 MYSQL_TEST_DIR/var/master-data/test/t55.frm
-408 MYSQL_TEST_DIR/var/master-data/test/t55.par
+27 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp0.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp0.MYI
+18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp1.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp1.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp2.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp2.MYI
+18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp3.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp3.MYI
+18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp4.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp4.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp0.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp0.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp1.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp1.MYI
+18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp2.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp2.MYI
+18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp3.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp3.MYI
+36 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp4.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp4.MYI
+36 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp0.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp0.MYI
+0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp1.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp1.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp2.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp2.MYI
+18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp3.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp3.MYI
+27 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp4.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp4.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp0.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp0.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp1.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp1.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp2.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp2.MYI
+18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp3.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp3.MYI
+45 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp4.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp4.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp0.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp0.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp1.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp1.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp2.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp2.MYI
+0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp3.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp3.MYI
+0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp4.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp4.MYI
+0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp0.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp0.MYI
+0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp1.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp1.MYI
+0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp2.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp2.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp3.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp3.MYI
+9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp4.MYD
+1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp4.MYI
+8594 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55.frm
+408 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55.par
diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result
index e330175bc0c..c2537815631 100644
--- a/mysql-test/suite/parts/r/rpl_partition.result
+++ b/mysql-test/suite/parts/r/rpl_partition.result
@@ -4,6 +4,8 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+set @old_global_binlog_format= @@global.binlog_format;
+set @old_session_binlog_format= @@session.binlog_format;
SET GLOBAL binlog_format = 'ROW';
SET SESSION binlog_format = 'ROW';
select @@global.binlog_format, @@session.binlog_format;
@@ -121,21 +123,21 @@ Create Table CREATE TABLE `t3` (
`fkid` mediumint(9) DEFAULT NULL,
`filler` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (id)
SUBPARTITION BY HASH (id)
SUBPARTITIONS 2
-(PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM,
- PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM,
- PARTITION pa3 VALUES LESS THAN (30) ENGINE = MyISAM,
- PARTITION pa4 VALUES LESS THAN (40) ENGINE = MyISAM,
- PARTITION pa5 VALUES LESS THAN (50) ENGINE = MyISAM,
- PARTITION pa6 VALUES LESS THAN (60) ENGINE = MyISAM,
- PARTITION pa7 VALUES LESS THAN (70) ENGINE = MyISAM,
- PARTITION pa8 VALUES LESS THAN (80) ENGINE = MyISAM,
- PARTITION pa9 VALUES LESS THAN (90) ENGINE = MyISAM,
- PARTITION pa10 VALUES LESS THAN (100) ENGINE = MyISAM,
- PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+(PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION pa2 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION pa3 VALUES LESS THAN (30) ENGINE = InnoDB,
+ PARTITION pa4 VALUES LESS THAN (40) ENGINE = InnoDB,
+ PARTITION pa5 VALUES LESS THAN (50) ENGINE = InnoDB,
+ PARTITION pa6 VALUES LESS THAN (60) ENGINE = InnoDB,
+ PARTITION pa7 VALUES LESS THAN (70) ENGINE = InnoDB,
+ PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB,
+ PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB,
+ PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB,
+ PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -181,6 +183,8 @@ SELECT count(*) "Slave bykey" FROM t2;
Slave bykey 500
SELECT count(*) "Slave byrange" FROM t3;
Slave byrange 500
+set @@global.binlog_format= @old_global_binlog_format;
+set @@session.binlog_format= @old_session_binlog_format;
DROP TABLE t1, t2, t3;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def
index b9cd3462635..518a3c90422 100644
--- a/mysql-test/suite/parts/t/disabled.def
+++ b/mysql-test/suite/parts/t/disabled.def
@@ -1,8 +1,3 @@
partition_basic_ndb : Bug#19899 Crashing the server
# http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html
-partition_bit_ndb : NDB does not support bit column in index
-partition_sessions : needs system_3_init.inc
partition_syntax_ndb : Bug#36735 Not supported
-partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function
-partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function
-partition_value_ndb : Bug#30581 partition_value tests use disallowed CAST() function
diff --git a/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test b/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test
index 51e6397c018..17c6a845b25 100644
--- a/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test
+++ b/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test
@@ -35,6 +35,9 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
--mkdir $MYSQLTEST_VARDIR/mysql-test-data-dir
--mkdir $MYSQLTEST_VARDIR/mysql-test-idx-dir
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@@ -49,17 +52,17 @@ PARTITION BY HASH (c1)
INDEX DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-idx-dir'
);
--echo # Verifying .frm and .par files
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
+--file_exists $MYSQLD_DATADIR/test/t1.frm
+--file_exists $MYSQLD_DATADIR/test/t1.par
--echo # Verifying that there are no MyISAM files
--error 1
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
--error 1
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+--file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
--error 1
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYD
--error 1
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI
+--file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYI
--error 1
--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p0.MYD
--error 1
@@ -73,12 +76,12 @@ FLUSH TABLES;
SHOW CREATE TABLE t1;
ALTER TABLE t1 ENGINE = MyISAM;
--echo # Verifying .frm, .par and MyISAM files (.MYD, MYI)
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI
+--file_exists $MYSQLD_DATADIR/test/t1.frm
+--file_exists $MYSQLD_DATADIR/test/t1.par
+--file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
+--file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYI
--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p0.MYD
--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p0.MYI
--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD
diff --git a/mysql-test/suite/parts/t/partition_bit_ndb.test b/mysql-test/suite/parts/t/partition_bit_ndb.test
deleted file mode 100644
index 227d3d53401..00000000000
--- a/mysql-test/suite/parts/t/partition_bit_ndb.test
+++ /dev/null
@@ -1,60 +0,0 @@
-################################################################################
-# t/partition_bit_ndb.test #
-# #
-# Purpose: #
-# Tests around bit type #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: HH #
-# Original Date: 2006-08-01 #
-# Change Author: #
-# Change Date: #
-# Change: #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
-
-##### Options, for debugging support #####
-let $debug= 0;
-let $with_partitioning= 1;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-# on partioned tables
-SET @max_row = 20;
-
-# The server must support partitioning.
---source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'NDB';
-connection default;
-
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-##### Assign a big number smaller than the maximum value for partitions #####
-# and smaller than the maximum value of SIGNED INTEGER
-let $MAX_VALUE= (2147483646);
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_bit.inc
diff --git a/mysql-test/suite/parts/t/partition_recover_myisam.test b/mysql-test/suite/parts/t/partition_recover_myisam.test
index 69e45b3ef3c..14604bfeb15 100644
--- a/mysql-test/suite/parts/t/partition_recover_myisam.test
+++ b/mysql-test/suite/parts/t/partition_recover_myisam.test
@@ -10,10 +10,12 @@ drop table if exists t1_will_crash;
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM;
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
FLUSH TABLES;
+
--echo # replacing t1.MYI with a corrupt + unclosed one created by doing:
--echo # 'create table t1 (a int key(a))' head -c1024 t1.MYI > corrupt_t1.MYI
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash.MYI
---copy_file std_data/corrupt_t1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash.MYI
+let $MYSQLD_DATADIR= `select @@datadir`;
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash.MYI
+--copy_file std_data/corrupt_t1.MYI $MYSQLD_DATADIR/test/t1_will_crash.MYI
SELECT * FROM t1_will_crash;
DROP TABLE t1_will_crash;
CREATE TABLE t1_will_crash (a INT, KEY (a))
@@ -25,7 +27,7 @@ FLUSH TABLES;
--echo # replacing t1#P#p1.MYI with a corrupt + unclosed one created by doing:
--echo # 'create table t1 (a int key(a)) partition by hash (a) partitions 3'
--echo # head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI
---copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
+--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
SELECT * FROM t1_will_crash;
DROP TABLE t1_will_crash;
diff --git a/mysql-test/suite/parts/t/partition_repair_myisam.test b/mysql-test/suite/parts/t/partition_repair_myisam.test
index 4c4cb21b848..a7ceb5b7faf 100644
--- a/mysql-test/suite/parts/t/partition_repair_myisam.test
+++ b/mysql-test/suite/parts/t/partition_repair_myisam.test
@@ -8,14 +8,16 @@ drop table if exists t1_will_crash;
--echo # REPAIR USE_FRM is not implemented for partitioned tables.
+let $MYSQLD_DATADIR= `select @@datadir`;
+
--echo # test of non partitioned myisam for reference
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM;
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
FLUSH TABLES;
--echo # replacing t1.MYI with a corrupt + unclosed one created by doing:
--echo # 'create table t1 (a int key(a))' head -c1024 t1.MYI > corrupt_t1.MYI
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash.MYI
---copy_file std_data/corrupt_t1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash.MYI
+--copy_file std_data/corrupt_t1.MYI $MYSQLD_DATADIR/test/t1_will_crash.MYI
CHECK TABLE t1_will_crash;
REPAIR TABLE t1_will_crash;
SELECT * FROM t1_will_crash;
@@ -32,16 +34,16 @@ FLUSH TABLES;
--echo # replacing t1#P#p1.MYI with a corrupt + unclosed one created by doing:
--echo # 'create table t1 (a int key(a)) partition by hash (a) partitions 3'
--echo # head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI
---copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
+--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
CHECK TABLE t1_will_crash;
REPAIR TABLE t1_will_crash;
SELECT * FROM t1_will_crash;
FLUSH TABLES;
--echo # test with ALTER TABLE ... CHECK/REPAIR PARTITION
--echo # replacing t1_will_crash#P#p1.MYI with a corrupt + unclosed one
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI
---copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
+--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
ALTER TABLE t1_will_crash CHECK PARTITION p0, p2;
ALTER TABLE t1_will_crash CHECK PARTITION p0, p1;
ALTER TABLE t1_will_crash CHECK PARTITION p1, p2;
@@ -63,16 +65,16 @@ SELECT * FROM t1_will_crash;
FLUSH TABLES;
--echo # test with CHECK/REPAIR TABLE
--echo # replacing t1_will_crash#P#p1#SP#p1sp0.MYI with a corrupt + unclosed one
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1#SP#p1sp0.MYI
---copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1#SP#p1sp0.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1#SP#p1sp0.MYI
+--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1#SP#p1sp0.MYI
CHECK TABLE t1_will_crash;
REPAIR TABLE t1_will_crash;
SELECT * FROM t1_will_crash;
FLUSH TABLES;
--echo # test with ALTER TABLE ... CHECK/REPAIR PARTITION
--echo # replacing t1_will_crash#P#p1#SP#p1sp0.MYI with a corrupt + unclosed one
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1#SP#p1sp0.MYI
---copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1#SP#p1sp0.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1#SP#p1sp0.MYI
+--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1#SP#p1sp0.MYI
ALTER TABLE t1_will_crash CHECK PARTITION p0;
ALTER TABLE t1_will_crash CHECK PARTITION all;
ALTER TABLE t1_will_crash CHECK PARTITION p1;
@@ -94,7 +96,7 @@ PARTITIONS 7;
# creating a longer string for for filling the records
let $i= 3;
let $lt= longtext;
-while ($i>0)
+while ($i)
{
let $lt= $lt$lt;
dec $i;
@@ -152,22 +154,22 @@ SELECT (b % 7) AS partition, b, a, length(c) FROM t1_will_crash ORDER BY partiti
FLUSH TABLES;
# testing p0, p1, p3, p6(1)
--echo # truncating p0 to simulate an empty datafile (not recovered!)
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p0.MYD
---write_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p0.MYD
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p0.MYD
+--write_file $MYSQLD_DATADIR/test/t1_will_crash#P#p0.MYD
EOF
--echo # replacing p1 with only the first 1024 bytes (not recovered!)
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYD
---copy_file std_data/parts/t1_will_crash#P#p1_first_1024.MYD $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYD
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYD
+--copy_file std_data/parts/t1_will_crash#P#p1_first_1024.MYD $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYD
--echo # replacing p3 with a crashed one at the last row in first insert
--echo # (crashed right after *share->write_record())
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p3.MYI
---copy_file std_data/parts/t1_will_crash#P#p3.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p3.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p3.MYI
+--copy_file std_data/parts/t1_will_crash#P#p3.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p3.MYI
--echo # replacing p6 with a crashed MYD file (1) (splitted dynamic record)
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p6.MYD
---copy_file std_data/parts/t1_will_crash#P#p6.MYD $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p6.MYD
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p6.MYD
+--copy_file std_data/parts/t1_will_crash#P#p6.MYD $MYSQLD_DATADIR/test/t1_will_crash#P#p6.MYD
ANALYZE TABLE t1_will_crash;
OPTIMIZE TABLE t1_will_crash;
CHECK TABLE t1_will_crash;
@@ -180,10 +182,10 @@ FLUSH TABLES;
# testing p2, p4, p6(2, 3)
--echo #
--echo # replacing p2 with crashed files (after _mi_mark_changed)
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p2.MYI
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p2.MYD
---copy_file std_data/parts/t1_will_crash#P#p2.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p2.MYI
---copy_file std_data/parts/t1_will_crash#P#p2.MYD $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p2.MYD
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p2.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p2.MYD
+--copy_file std_data/parts/t1_will_crash#P#p2.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p2.MYI
+--copy_file std_data/parts/t1_will_crash#P#p2.MYD $MYSQLD_DATADIR/test/t1_will_crash#P#p2.MYD
ALTER TABLE t1_will_crash CHECK PARTITION p2;
--echo # crash was when index only marked as opened, no real corruption
ALTER TABLE t1_will_crash CHECK PARTITION p2;
@@ -191,8 +193,8 @@ FLUSH TABLES;
--echo #
--echo # replacing p4 with updated but not closed index file
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p4.MYI
---copy_file std_data/parts/t1_will_crash#P#p4.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p4.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p4.MYI
+--copy_file std_data/parts/t1_will_crash#P#p4.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p4.MYI
#SHOW TABLE STATUS like 't1_will_crash';
#ALTER TABLE t1_will_crash ANALYZE PARTITION p4;
#SHOW TABLE STATUS like 't1_will_crash';
@@ -206,8 +208,8 @@ FLUSH TABLES;
--echo #
--echo # replacing p6 with a crashed MYD file (2) (splitted dynamic record)
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p6.MYD
---copy_file std_data/parts/t1_will_crash#P#p6_2.MYD $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p6.MYD
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p6.MYD
+--copy_file std_data/parts/t1_will_crash#P#p6_2.MYD $MYSQLD_DATADIR/test/t1_will_crash#P#p6.MYD
#ALTER TABLE t1_will_crash OPTIMIZE PARTITION p6;
ALTER TABLE t1_will_crash CHECK PARTITION p6;
ALTER TABLE t1_will_crash REPAIR PARTITION p6;
@@ -218,8 +220,8 @@ FLUSH TABLES;
--echo #
--echo # replacing p6 with a crashed MYD file (3) (splitted dynamic record)
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p6.MYD
---copy_file std_data/parts/t1_will_crash#P#p6_3.MYD $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p6.MYD
+--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p6.MYD
+--copy_file std_data/parts/t1_will_crash#P#p6_3.MYD $MYSQLD_DATADIR/test/t1_will_crash#P#p6.MYD
--echo # Different results from the corrupt table, which can lead to dropping
--echo # of the not completely written rows when using REBUILD on a corrupt
--echo # table, depending if one reads via index or direct on datafile.
diff --git a/mysql-test/suite/parts/t/partition_sessions.test b/mysql-test/suite/parts/t/partition_sessions.test
deleted file mode 100644
index 3d59292bee5..00000000000
--- a/mysql-test/suite/parts/t/partition_sessions.test
+++ /dev/null
@@ -1,391 +0,0 @@
-
-#--------------------------------------------------
-# Initialize system_3 test variables
-#--------------------------------------------------
-
---source suite/system_3/include/system_3_init.inc
-
-let $NUM_VAL=`SELECT @NUM_VAL`;
-let $LOAD_LINES=`SELECT @LOAD_LINES`;
-let $LOG_UPPER=`SELECT @LOG_UPPER`;
-let $LOG_LOWER=`SELECT @LOG_LOWER`;
-#let $ENG1=`SELECT @ENG1`;
-let $ENG2=`SELECT @ENG2`;
-let $ENG_LOG=`SELECT @ENG_LOG`;
-let $CLIENT_HOST=`SELECT @CLIENT_HOST`;
-let $ENG=innodb;
-let $ENG1=innodb;
-#---------------------------------------------------------
-# Column list with definition for all tables to be checked
-#---------------------------------------------------------
-
-let $column_list= f1 int,
-f2 char (15),
-f3 decimal (5,3),
-f4 datetime;
-
-let $col_access_list = f1,f2,f3,f4 ;
-let $col_new_list = new.f1,new.f2,new.f3 new.f4 ;
-
-#---------------------------------------------------
-# Setting the parameters to use during testing
-#---------------------------------------------------
-# Set number of variations of the f1 variable (used to segment the rows
-# being updated/deleted by a user at a time. The higher the number, the
-# more smaller segments used with each query.
---replace_result $NUM_VAL NUM_VAL
-eval set @f1_nums=$NUM_VAL;
-
-# The following sets the number controls the size of the log table.
-# Once a size of '@threshold' is reached, the first rows are removed
-# sunch that the table is down to '@shrink_to' lines
---replace_result $LOG_LOWER LOG_LOWER
-eval set @shrink_to=$LOG_LOWER;
---replace_result $LOG_UPPER LOG_UPPER
-eval set @threshold=$LOG_UPPER;
-
-#---------------------------------------------------
-# Creating the database tables and loading the data
-#---------------------------------------------------
-
---disable_warnings
-drop database if exists systest1;
---enable_warnings
-
-create database systest1;
-
---disable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval create user systuser@'$CLIENT_HOST';
---enable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval set password for systuser@'$CLIENT_HOST' = password('systpass');
---replace_result $CLIENT_HOST CLIENT_HOST
-eval grant ALL on systest1.* to systuser@'$CLIENT_HOST';
-use systest1;
---replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
-connect (systuser,localhost,systuser,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK);
-
-create table tb1_master (
- f1 int,
- f2 char(15),
- f3 decimal (5,3),
- f4 datetime
-);
-
-#--replace_result $ENG_LOG ENG_LOG
-eval create table tb1_logs (
- i1 int NOT NULL auto_increment, primary key (i1),
- dt1 datetime NOT NULL,
- entry_dsc char(100),
- f4 int
-) engine=$ENG_LOG
-;
-#PARTITION BY HASH (i1) PARTITIONS 8;
-
-if ($debug)
-{
-SHOW CREATE TABLE tb1_logs;
-}
-
-#--replace_result $ENG_LOG ENG_LOG
-eval create table ddl_logs (
- i1 int NOT NULL auto_increment, primary key (i1),
- dt1 datetime NOT NULL,
- entry_dsc char(100),
- errno int
-) engine=$ENG_LOG;
-#PARTITION BY HASH (i1) PARTITIONS 8;
-
-if ($debug)
-{
-SHOW CREATE TABLE tb1_logs;
-}
-create table test_stat (
- dt1 datetime,
- table_name char(20),
- row_count int,
- start_row int,
- end_row int
-);
-
-#----------------------------------------------------------------------
-# tb3_eng1: key partitioning
-#----------------------------------------------------------------------
-
-#--replace_result $ENG1 ENG1
-eval create table tb3_eng1 (
- i1 int NOT NULL auto_increment, primary key (i1),
- $column_list
-) engine=$ENG1
-PARTITION BY KEY (i1) PARTITIONS 4
-(PARTITION part1,
-PARTITION part2,
-PARTITION part3,
-PARTITION part4);
-
-#--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval load data local infile '$MYSQL_TEST_DIR/suite/system_3/data/tb1.txt'
- into table tb3_eng1 ($col_access_list);
-
-if ($WITH_TRIGGERS)
-{
-delimiter //;
-
-Create trigger tb3_eng1_ins after insert on tb3_eng1 for each row
-BEGIN
- insert into tb1_logs (dt1, entry_dsc, f4)
- values (now(), concat('Insert row ', new.f1,' ',
- new.f2, ' ', new.f3, ' (tb3_eng1)'), new.f1);
-END//
-
-Create trigger tb3_eng1_upd after update on tb3_eng1 for each row
-BEGIN
- insert into tb1_logs (dt1, entry_dsc, f4)
- values (now(), concat('Update row ', old.f1,' ', old.f2, '->',
- new.f2, ' ', old.f3, '->', new.f3, ' (tb3_eng1)'), new.f1);
-END//
-
-Create trigger tb3_eng1_del after delete on tb3_eng1 for each row
-BEGIN
- insert into tb1_logs (dt1, entry_dsc, f4)
- values (now(), concat('Delete row ', old.f1,' ', old.f2, ' ',
- old.f3, ' (tb3_eng1)'), old.f1);
-END//
-
-delimiter ;//
-}
-delimiter //;
-
-# This functions returns a random integer number
-# between zero and 'num'
-#-----------------------------------------------
-create function int_rand(num int) returns int
-BEGIN
- return round(num*rand()+0.5);
-END//
-
-# This function returns a string in the length 'len' of
-# random letters (ascii range of 65-122)
-#------------------------------------------------------
-create function str_rand (len int) returns char(12)
-BEGIN
- declare tmp_letter char(1);
- declare tmp_word char(12);
- declare word_str char(12) default '';
- wl_loop: WHILE len DO
- set tmp_letter=char(round(57*rand()+65));
- set tmp_word=concat(word_str,tmp_letter);
- set word_str=tmp_word;
- set len=len-1;
- END WHILE wl_loop;
- return word_str;
-END//
-
-
-# This procedure scans 'tb1_master' table for rows where f1='num_pr'
-# and for each row inserts a row in 'tb3_eng1'
-#------------------------------------------------------------------
-eval create procedure ins_tb3_eng1 (num_pr int, str_pr char(15))
-BEGIN
- declare done int default 0;
- declare v3 decimal(5,3);
- declare cur1 cursor for
- select f3 from tb1_master where f1=num_pr;
- declare continue handler for sqlstate '01000' set done = 1;
- declare continue handler for sqlstate '02000' set done = 1;
- open cur1;
- fetch cur1 into v3;
- wl_loop: WHILE NOT done DO
- insert into tb3_eng1 ($col_access_list) values
- (int_rand(@f1_nums), concat('I:',str_pr,'-',num_pr), v3, now());
- fetch cur1 into v3;
- END WHILE wl_loop;
- close cur1;
-END//
-
-
-# This procedure does selects from the 'tb1_logs' and inserts the
-# count into the table
-#------------------------------------------------------------------
-create procedure slct_tb1_logs ()
-BEGIN
- declare done int default 0;
- declare v4 int;
- declare v_count int default 0;
- declare str_val char(15) default ELT(int_rand(3),
- 'Insert', 'Update', 'Delete');
- declare cur1 cursor for
- select f4 from tb1_logs where entry_dsc like concat('%',str_val,'%');
- declare continue handler for sqlstate '01000' set done = 1;
- declare continue handler for sqlstate '02000' set done = 1;
- open cur1;
- fetch cur1 into v4;
- wl_loop: WHILE NOT done DO
- set v_count=v_count+1;
- fetch cur1 into v4;
- END WHILE wl_loop;
- close cur1;
- insert into tb1_logs (dt1, entry_dsc, f4)
- values (now(), concat('Number of \'', str_val, '\' rows is: ',
- v_count, ' (tb1_log)'),0);
-END//
-
-delimiter ;//
-
---disable_abort_on_error
-insert into systest1.tb3_eng1 values (NULL,50,'init_val',12.345,'2005-01-01 00:00:00');
-insert into systest1.tb3_eng1 values (NULL,70,'init_val',12.345,'2005-01-01 00:00:00');
---enable_abort_on_error
-
-connection default;0.
---disable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval create user syst1user@'$CLIENT_HOST';
---enable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval set password for syst1user@'$CLIENT_HOST' = password('systpass');
---replace_result $CLIENT_HOST CLIENT_HOST
-eval grant ALL on systest1.* to syst1user@'$CLIENT_HOST';
-use systest1;
---replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
-connect (syst1user,localhost,syst1user,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK);
-
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval SET @f1_nums=$NUM_VAL;
-SET @tmp_num=int_rand(@f1_nums);
-SET @tmp_word=str_rand(4);
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Insert rows replacing the deleted rows using a strored procedure
-# that reads the rows from a master table
-CALL ins_tb3_eng1 (@tmp_num, @tmp_word);
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval SET @f1_nums=$NUM_VAL;
-SET @tmp_num=int_rand(@f1_nums);
-SET @tmp_word=str_rand(4);
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Insert rows replacing the deleted rows using a strored procedure
-# that reads the rows from a master table
-CALL ins_tb3_eng1 (@tmp_num, @tmp_word);
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-call slct_tb1_logs();
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-set @tmp_word=str_rand(4);
-
-select @tmp_num, @tmp_word;
-
-# Update all rows in the table where f1 is one less the random number
-update tb3_eng1
- set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1
- where f1=@tmp_num-1;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-set @tmp_word=str_rand(4);
-
-select @tmp_num, @tmp_word;
-
-# Update all rows in the table where f1 is one less the random number
-update tb3_eng1
- set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1
- where f1=@tmp_num-1;
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-call slct_tb1_logs();
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-set @tmp_word=str_rand(4);
-
-select @tmp_num, @tmp_word;
-
-# Update all rows in the table where f1 is one less the random number
-update tb3_eng1
- set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1
- where f1=@tmp_num-1;
-
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-#--replace_result $NUM_VAL <NUM_VAL>
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-select @tmp_num;
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Delete all rows from the table where f1 is equal to the above number
-delete from tb3_eng1 where f1=@tmp_num;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-select * from tb3_eng1 where f1>40;
-
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-select @tmp_num;
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Delete all rows from the table where f1 is equal to the above number
-delete from tb3_eng1 where f1=@tmp_num;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-select * from tb3_eng1 where f1>40;
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-select @tmp_num;
-
-select @tmp_num, @tmp_word;
-
-# Delete all rows from the table where f1 is equal to the above number
-delete from tb3_eng1 where f1=@tmp_num;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-select * from tb3_eng1 where f1>40;
diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test
index b9fc8bdcd56..eac19f6d588 100644
--- a/mysql-test/suite/parts/t/partition_special_innodb.test
+++ b/mysql-test/suite/parts/t/partition_special_innodb.test
@@ -68,10 +68,12 @@ INSERT INTO t1 VALUES (NULL, 'first row t2');
--connection con2
SET autocommit=OFF;
+--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 AUTO_INCREMENT = 10;
--connection con1
INSERT INTO t1 VALUES (NULL, 'second row t2');
+SELECT a,b FROM t1 ORDER BY a;
--disconnect con2
--disconnect con1
--connection default
diff --git a/mysql-test/suite/parts/t/partition_value_innodb.test b/mysql-test/suite/parts/t/partition_value_innodb.test
index 9d59533a54e..fe47f533107 100644
--- a/mysql-test/suite/parts/t/partition_value_innodb.test
+++ b/mysql-test/suite/parts/t/partition_value_innodb.test
@@ -8,9 +8,9 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-04-11 #
-# Change Author: #
-# Change Date: #
-# Change: #
+# Change Author: mleich #
+# Change Date: 2008-12-08 #
+# Change: Remove test from disabled.def + change test that it gets skipped #
################################################################################
#
@@ -22,6 +22,12 @@
# any of the variables.
#
+#
+# CAST() within the partitioning function si no more supported, but we get
+# this functionality probably soon again. Therefor we do not delete this test.
+--skip # CAST() in partitioning function is currently not supported.
+
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_value_myisam.test b/mysql-test/suite/parts/t/partition_value_myisam.test
index d6020669509..026ad57f0b2 100644
--- a/mysql-test/suite/parts/t/partition_value_myisam.test
+++ b/mysql-test/suite/parts/t/partition_value_myisam.test
@@ -8,9 +8,9 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-04-11 #
-# Change Author: #
-# Change Date: #
-# Change: #
+# Change Author: mleich #
+# Change Date: 2008-12-08 #
+# Change: Remove test from disabled.def + change test that it gets skipped #
################################################################################
#
@@ -22,6 +22,12 @@
# any of the variables.
#
+#
+# CAST() within the partitioning function si no more supported, but we get
+# this functionality probably soon again. Therefor we do not delete this test.
+--skip # CAST() in partitioning function is currently not supported.
+
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_value_ndb.test b/mysql-test/suite/parts/t/partition_value_ndb.test
index 2f948b95727..80b4ba6fb64 100644
--- a/mysql-test/suite/parts/t/partition_value_ndb.test
+++ b/mysql-test/suite/parts/t/partition_value_ndb.test
@@ -8,9 +8,9 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-04-11 #
-# Change Author: #
-# Change Date: #
-# Change: #
+# Change Author: mleich #
+# Change Date: 2008-12-08 #
+# Change: Remove test from disabled.def + change test that it gets skipped #
################################################################################
#
@@ -22,6 +22,12 @@
# any of the variables.
#
+#
+# CAST() within the partitioning function si no more supported, but we get
+# this functionality probably soon again. Therefor we do not delete this test.
+--skip # CAST() in partitioning function is currently not supported.
+
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test
index f1002ded81f..c5ee20971b3 100644
--- a/mysql-test/suite/parts/t/rpl_partition.test
+++ b/mysql-test/suite/parts/t/rpl_partition.test
@@ -6,6 +6,8 @@
let $engine_type= 'innodb';
+set @old_global_binlog_format= @@global.binlog_format;
+set @old_session_binlog_format= @@session.binlog_format;
SET GLOBAL binlog_format = 'ROW';
SET SESSION binlog_format = 'ROW';
select @@global.binlog_format, @@session.binlog_format;
@@ -150,6 +152,8 @@ SELECT count(*) "Slave bykey" FROM t2;
SELECT count(*) "Slave byrange" FROM t3;
connection master;
+set @@global.binlog_format= @old_global_binlog_format;
+set @@session.binlog_format= @old_session_binlog_format;
DROP TABLE t1, t2, t3;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
diff --git a/mysql-test/suite/rpl/combinations b/mysql-test/suite/rpl/combinations
index ea25611a5d4..07042c2cbec 100644
--- a/mysql-test/suite/rpl/combinations
+++ b/mysql-test/suite/rpl/combinations
@@ -1,8 +1,8 @@
[row]
---binlog-format=row
+binlog-format=row
[stmt]
---binlog-format=statement
+binlog-format=statement
[mix]
---binlog-format=mixed
+binlog-format=mixed
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
index d7041d82a2a..e9adb805c99 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
@@ -51,9 +51,8 @@ DELETE FROM t2 WHERE a = 2;
--echo
--echo ******************** LOAD DATA INFILE ********************
---copy_file ./suite/rpl/data/rpl_mixed.dat $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat
-LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
SELECT * FROM t1 ORDER BY a;
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
@@ -329,6 +328,7 @@ DROP VIEW v2;
--echo ******************** SHOW BINLOG EVENTS ********************
--replace_column 2 # 5 #
--replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show binlog events from 1;
sync_slave_with_master;
# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
@@ -344,4 +344,4 @@ sync_slave_with_master;
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
+--diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
diff --git a/mysql-test/suite/rpl/my.cnf b/mysql-test/suite/rpl/my.cnf
new file mode 100644
index 00000000000..ea4caeb2ddd
--- /dev/null
+++ b/mysql-test/suite/rpl/my.cnf
@@ -0,0 +1,14 @@
+# Use settings from rpl_1slave_base.cnf
+# add setting to connect the slave to the master by default
+!include rpl_1slave_base.cnf
+
+[mysqld.2]
+# Hardcode the host to 127.0.0.1 until running on more
+# than one host and it need to be masked
+# master-host= @mysqld.1.#host
+master-host= 127.0.0.1
+master-port= @mysqld.1.port
+master-password= @mysqld.1.#password
+master-user= @mysqld.1.#user
+master-connect-retry= 1
+
diff --git a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
index 70013f95d85..b092dd9e088 100644
--- a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
+++ b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
@@ -6,10 +6,10 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
-LOAD DATA INFILE '../std_data_ln/words2.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE a = 'abashed';
DELETE FROM test.t1;
-LOAD DATA INFILE '../std_data_ln/words2.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
SELECT * FROM test.t1 ORDER BY a DESC;
a
aberration
diff --git a/mysql-test/suite/rpl/r/rpl_alter_db.result b/mysql-test/suite/rpl/r/rpl_alter_db.result
index 6edbe5d427f..60c07d0dede 100644
--- a/mysql-test/suite/rpl/r/rpl_alter_db.result
+++ b/mysql-test/suite/rpl/r/rpl_alter_db.result
@@ -4,5 +4,9 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-use mysql;
+==== Verify that alter database does not stop replication ====
+create database temp_db;
+use temp_db;
alter database collate latin1_bin;
+==== Clean up ====
+drop database temp_db;
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 083f3a4e901..2a4c3a09361 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
@@ -227,3 +227,20 @@ select * from t3 order by a;
a
127
drop table t1,t2,t3;
+set auto_increment_increment=1;
+set auto_increment_offset=1;
+CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
new file mode 100644
index 00000000000..f94d2833603
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
@@ -0,0 +1,8 @@
+call mtr.add_suppression('Found invalid event in binary log');
+==== Initialize ====
+Setting up fake replication from MYSQL_TEST_DIR/std_data/bug40482-bin.000001
+==== Test ====
+START SLAVE SQL_THREAD;
+Last_SQL_Error = Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
+==== Clean up ====
+Cleaning up after setup_fake_relay_log.inc
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole.result b/mysql-test/suite/rpl/r/rpl_blackhole.result
index 27094e761b0..954589267c5 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole.result
@@ -98,3 +98,4 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/rpl/r/rpl_bug26395.result b/mysql-test/suite/rpl/r/rpl_bug26395.result
new file mode 100644
index 00000000000..c6dd2d01ed3
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_bug26395.result
@@ -0,0 +1,41 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+==== Initialize ====
+[on master]
+CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
+SHOW CREATE TABLE tinnodb;
+Table Create Table
+tinnodb CREATE TABLE `tinnodb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+set @old_debug= @@debug;
+set @@debug= 'd,do_not_write_xid';
+==== Test ====
+INSERT INTO tinnodb VALUES (1);
+SELECT * FROM tinnodb ORDER BY a;
+a
+1
+[on slave]
+==== Verify results on slave ====
+include/stop_slave.inc
+SELECT "" AS Slave_IO_State;
+Slave_IO_State
+
+SELECT "" AS Last_SQL_Error;
+Last_SQL_Error
+
+SELECT "" AS Last_IO_Error;
+Last_IO_Error
+
+SELECT * FROM tinnodb ORDER BY a;
+a
+==== Clean up ====
+[on master]
+DROP TABLE tinnodb;
+set @@debug= @old_debug;
+[on slave]
+DROP TABLE tinnodb;
diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result
index 4043f04215b..1b3f2cfc7dc 100644
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result
@@ -1,6 +1,8 @@
reset master;
+call mtr.add_suppression("Failed during slave.*thread initialization");
stop slave;
reset slave;
+SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
show slave status;
Slave_IO_State #
@@ -41,3 +43,4 @@ Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
+SET GLOBAL debug="";
diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
new file mode 100644
index 00000000000..c3ccc76d1bc
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
@@ -0,0 +1,298 @@
+*** Set up circular ring by schema A->B->C->D->A ***
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 1;
+RESET MASTER;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_A_PORT,master_user='root',MASTER_LOG_FILE='MASTER_A_LOG_FILE';
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 2;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',MASTER_LOG_FILE='MASTER_B_LOG_FILE';
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 3;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_C_PORT,master_user='root',MASTER_LOG_FILE='MASTER_C_LOG_FILE';
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 4;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_D_PORT,master_user='root',MASTER_LOG_FILE='MASTER_D_LOG_FILE';
+SHOW VARIABLES LIKE 'auto_increment_%';
+Variable_name Value
+auto_increment_increment 4
+auto_increment_offset 1
+SHOW VARIABLES LIKE 'auto_increment_%';
+Variable_name Value
+auto_increment_increment 4
+auto_increment_offset 2
+SHOW VARIABLES LIKE 'auto_increment_%';
+Variable_name Value
+auto_increment_increment 4
+auto_increment_offset 3
+SHOW VARIABLES LIKE 'auto_increment_%';
+Variable_name Value
+auto_increment_increment 4
+auto_increment_offset 4
+1
+START SLAVE;
+START SLAVE;
+START SLAVE;
+START SLAVE;
+
+*** Preparing data ***
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB;
+
+*** Testing schema A->B->C->D->A ***
+
+INSERT INTO t1(b,c) VALUES('A',1);
+INSERT INTO t1(b,c) VALUES('B',1);
+INSERT INTO t1(b,c) VALUES('C',1);
+INSERT INTO t1(b,c) VALUES('D',1);
+SELECT 'Master A',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+Master A a b
+Master A 1 A
+Master A 2 B
+Master A 3 C
+Master A 4 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+Master B a b
+Master B 1 A
+Master B 2 B
+Master B 3 C
+Master B 4 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+Master C a b
+Master C 1 A
+Master C 2 B
+Master C 3 C
+Master C 4 D
+SELECT 'Master D',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+Master D a b
+Master D 1 A
+Master D 2 B
+Master D 3 C
+Master D 4 D
+
+*** Testing schema A->B->D->A if C has failure ***
+
+* Do failure for C and then make new connection B->D *
+STOP SLAVE;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
+include/start_slave.inc
+INSERT INTO t1 VALUES(6,'C',2);
+INSERT INTO t1(b,c) VALUES('B',2);
+INSERT INTO t1(b,c) VALUES('A',2);
+INSERT INTO t1(b,c) VALUES('D',2);
+
+* Data on servers (C failed) *
+SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master A a b
+Master A 5 A
+Master A 8 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master B a b
+Master B 5 A
+Master B 6 B
+Master B 8 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master C a b
+Master C 6 C
+SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master D a b
+Master D 8 D
+
+* Reconfigure replication to schema A->B->D->A *
+STOP SLAVE;
+STOP SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS;
+include/start_slave.inc
+
+* Check data inserted before failure *
+SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master A a b
+Master A 5 A
+Master A 6 B
+Master A 8 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master B a b
+Master B 5 A
+Master B 6 B
+Master B 8 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master C a b
+Master C 6 C
+SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master D a b
+Master D 5 A
+Master D 6 B
+Master D 8 D
+
+* Check data inserted after failure *
+INSERT INTO t1(b,c) VALUES('A',3);
+INSERT INTO t1(b,c) VALUES('B',3);
+INSERT INTO t1(b,c) VALUES('D',3);
+SELECT 'Master A',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+Master A a b
+Master A 9 A
+Master A 10 B
+Master A 12 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+Master B a b
+Master B 9 A
+Master B 10 B
+Master B 12 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+Master C a b
+SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+Master D a b
+Master D 9 A
+Master D 10 B
+Master D 12 D
+
+*** Testing restoring scheme A->B->C->D->A after failure ***
+
+* Remove wrong event from C and restore B->C->D *
+include/stop_slave.inc
+DELETE FROM t1 WHERE a = 6;
+START SLAVE;
+RESET MASTER;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_C_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS;
+START SLAVE;
+
+* Check data inserted before restoring schema A->B->C->D->A *
+SELECT 'Master A',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+Master A a b
+Master A 5 A
+Master A 6 B
+Master A 8 D
+Master A 9 A
+Master A 10 B
+Master A 12 D
+SELECT 'Master B',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+Master B a b
+Master B 5 A
+Master B 6 B
+Master B 8 D
+Master B 9 A
+Master B 10 B
+Master B 12 D
+SELECT 'Master C',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+Master C a b
+Master C 5 A
+Master C 6 B
+Master C 8 D
+Master C 9 A
+Master C 10 B
+Master C 12 D
+SELECT 'Master D',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+Master D a b
+Master D 5 A
+Master D 6 B
+Master D 8 D
+Master D 9 A
+Master D 10 B
+Master D 12 D
+
+* Check data inserted after restoring schema A->B->C->D->A *
+INSERT INTO t1(b,c) VALUES('A',4);
+INSERT INTO t1(b,c) VALUES('B',4);
+INSERT INTO t1(b,c) VALUES('C',4);
+INSERT INTO t1(b,c) VALUES('D',4);
+SELECT 'Master A',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+Master A a b
+Master A 13 A
+Master A 14 B
+Master A 15 C
+Master A 16 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+Master B a b
+Master B 13 A
+Master B 14 B
+Master B 15 C
+Master B 16 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+Master C a b
+Master C 13 A
+Master C 14 B
+Master C 15 C
+Master C 16 D
+SELECT 'Master D',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+Master D a b
+Master D 13 A
+Master D 14 B
+Master D 15 C
+Master D 16 D
+
+* Transactions with commits *
+BEGIN;
+BEGIN;
+SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+Master A b COUNT(*)
+Master A A 100
+Master A B 100
+Master A C 100
+Master A D 100
+SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+Master B b COUNT(*)
+Master B A 100
+Master B B 100
+Master B C 100
+Master B D 100
+SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+Master C b COUNT(*)
+Master C A 100
+Master C B 100
+Master C C 100
+Master C D 100
+SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+Master D b COUNT(*)
+Master D A 100
+Master D B 100
+Master D C 100
+Master D D 100
+
+* Transactions with rollbacks *
+BEGIN;
+BEGIN;
+SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+Master A b COUNT(*)
+Master A B 100
+Master A D 100
+SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+Master B b COUNT(*)
+Master B B 100
+Master B D 100
+SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+Master C b COUNT(*)
+Master C B 100
+Master C D 100
+SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+Master D b COUNT(*)
+Master D B 100
+Master D D 100
+
+*** Clean up ***
+DROP TABLE t1,t2;
+STOP SLAVE;
+RESET SLAVE;
+STOP SLAVE;
+RESET SLAVE;
+STOP SLAVE;
+RESET SLAVE;
+STOP SLAVE;
+RESET SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result
new file mode 100644
index 00000000000..de5dd134516
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_cross_version.result
@@ -0,0 +1,12 @@
+==== Initialize ====
+Setting up fake replication from MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001
+==== Test ====
+start slave sql_thread;
+==== a prove that the fake has been processed successfully ====
+SELECT COUNT(*) - 17920 as zero FROM t3;
+zero
+0
+==== Clean up ====
+stop slave sql_thread;
+Cleaning up after setup_fake_relay_log.inc
+drop table t1, t3;
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result
index c0efdf5290d..8825797f80d 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db.result
@@ -31,8 +31,7 @@ use test;
select * from t1;
n
1234
-stop slave;
-drop database mysqltest1;
-drop database mysqltest1;
use test;
drop table t1;
+drop database mysqltest1;
+include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_view.result b/mysql-test/suite/rpl/r/rpl_drop_view.result
index ef625464881..c359011612a 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_view.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_view.result
@@ -25,3 +25,5 @@ select * from v2;
ERROR 42S02: Table 'test.v2' doesn't exist
select * from v3;
ERROR 42S02: Table 'test.v3' doesn't exist
+==== clean up ====
+drop table t1, t2, t3;
diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result
index e4a412cb1d5..b797183f9d2 100644
--- a/mysql-test/suite/rpl/r/rpl_events.result
+++ b/mysql-test/suite/rpl/r/rpl_events.result
@@ -1,10 +1,11 @@
-set global event_scheduler=1;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+SET @old_event_scheduler = @@global.event_scheduler;
+set global event_scheduler=1;
set binlog_format=row;
DROP EVENT IF EXISTS test.justonce;
drop table if exists t1,t2;
@@ -34,7 +35,7 @@ db name status originator
test justonce SLAVESIDE_DISABLED 1
"Dropping event test.slave_once on the slave"
DROP EVENT IF EXISTS test.slave_once;
-CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
+CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
"Checking event status on the slave for originator value = slave's server_id"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
@@ -45,7 +46,7 @@ DROP EVENT IF EXISTS test.slave_once;
"Dropping event test.justonce on the master"
DROP EVENT IF EXISTS test.justonce;
"Creating event test.er on the master"
-CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -56,7 +57,7 @@ SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND
db name status originator body
test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
"Altering event test.er on the master"
-ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -75,7 +76,7 @@ db name status originator
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator
"Creating event test.slave_terminate on the slave"
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
"Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
@@ -123,7 +124,7 @@ db name status originator
test justonce SLAVESIDE_DISABLED 1
"Dropping event test.slave_once on the slave"
DROP EVENT IF EXISTS test.slave_once;
-CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
+CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
"Checking event status on the slave for originator value = slave's server_id"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
@@ -134,7 +135,7 @@ DROP EVENT IF EXISTS test.slave_once;
"Dropping event test.justonce on the master"
DROP EVENT IF EXISTS test.justonce;
"Creating event test.er on the master"
-CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -145,7 +146,7 @@ SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND
db name status originator body
test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
"Altering event test.er on the master"
-ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -164,7 +165,7 @@ db name status originator
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator
"Creating event test.slave_terminate on the slave"
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
"Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
@@ -190,4 +191,5 @@ select * from t28953;
END;|
ALTER EVENT event1 RENAME TO event2;
DROP EVENT event2;
+SET @@global.event_scheduler= @old_event_scheduler;
DROP TABLE t28953;
diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
index 86648ba12c3..ad67f96db71 100644
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
@@ -454,7 +454,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning 1048 Column 'f3' cannot be null
** Delete from Master **
@@ -1593,7 +1595,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning 1048 Column 'f3' cannot be null
** Delete from Master **
@@ -2732,7 +2736,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning 1048 Column 'f3' cannot be null
** Delete from Master **
diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
index 96d4ca237d1..8859a8e24e3 100644
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
@@ -454,7 +454,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning 1048 Column 'f3' cannot be null
** Delete from Master **
@@ -1593,7 +1595,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning 1048 Column 'f3' cannot be null
** Delete from Master **
@@ -2732,7 +2736,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning 1048 Column 'f3' cannot be null
** Delete from Master **
diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
index fb7f29da656..7eddaabc636 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
@@ -50,82 +50,82 @@ UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
[on slave]
show tables like 't%';
Tables_in_test (t%)
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index baa740bf250..600ac44fc86 100644
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show variables like 'relay_log%';
Variable_name Value
-relay_log MYSQLTEST_VARDIR/master-data/relay-log
+relay_log MYSQLD_DATADIR/relay-log
relay_log_index
relay_log_info_file relay-log.info
relay_log_purge ON
@@ -18,11 +18,7 @@ start slave;
stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT;
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
+include/start_slave.inc
FLUSH LOGS;
SHOW SLAVE STATUS;
Slave_IO_State #
diff --git a/mysql-test/suite/rpl/r/rpl_found_rows.result b/mysql-test/suite/rpl/r/rpl_found_rows.result
index 25be9eb63b3..45a931872cf 100644
--- a/mysql-test/suite/rpl/r/rpl_found_rows.result
+++ b/mysql-test/suite/rpl/r/rpl_found_rows.result
@@ -103,10 +103,10 @@ DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log;
DROP FUNCTION log_rows;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
#### 2. Using mixed mode ####
==== 2.1. Checking a procedure ====
**** On Master ****
diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result
index 5a4052864ad..f39d0f1f37f 100644
--- a/mysql-test/suite/rpl/r/rpl_idempotency.result
+++ b/mysql-test/suite/rpl/r/rpl_idempotency.result
@@ -4,6 +4,9 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
+call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+SET @old_slave_exec_mode= @@global.slave_exec_mode;
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
@@ -220,7 +223,7 @@ Last_SQL_Error
0
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
-set global slave_exec_mode='STRICT';
+SET @@global.slave_exec_mode= @old_slave_exec_mode;
set @@session.binlog_format= @save_binlog_format;
drop table t1,t2,ti2,ti1;
*** end of tests
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index cdc3f5e9579..e77be425270 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
@@ -116,7 +116,8 @@ show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
set global slave_exec_mode='IDEMPOTENT';
-drop table t1, t4, mysqltest2.t2;
+drop table t1, mysqltest2.t2;
+drop table t4;
drop database mysqltest2;
delete from mysql.user where user like "mysqltest%";
delete from mysql.db where user like "mysqltest%";
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave.result b/mysql-test/suite/rpl/r/rpl_init_slave.result
index 5ff72e57f0e..908abf56c1f 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave.result
@@ -5,8 +5,8 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set global max_connections=151;
-stop slave;
-start slave;
+include/stop_slave.inc
+include/start_slave.inc
show variables like 'init_slave';
Variable_name Value
init_slave set global max_connections=500
@@ -25,6 +25,6 @@ set global init_connect="set @c=1";
show variables like 'init_connect';
Variable_name Value
init_connect set @c=1
-stop slave;
+include/stop_slave.inc
set global init_connect= @my_global_init_connect;
set global max_connections= default;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb.result b/mysql-test/suite/rpl/r/rpl_innodb.result
index 658f92f4d75..bf6c3cb8c86 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb.result
@@ -12,7 +12,7 @@ PRIMARY KEY (id),
UNIQUE KEY unique_rec (name,number)
) ENGINE=InnoDB;
LOAD DATA
-INFILE '../std_data_ln/loaddata_pair.dat'
+INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
(name,number);
SELECT * FROM t4;
@@ -24,7 +24,7 @@ id name number
1 XXX 12345
2 XXY 12345
LOAD DATA
-INFILE '../std_data_ln/loaddata_pair.dat'
+INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
(name,number);
SELECT * FROM t4;
@@ -43,6 +43,7 @@ CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB";
SET AUTOCOMMIT = 0;
-------- switch to slave --------
+ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
SHOW CREATE TABLE mysqltest1.t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
index 85308442fd8..fbb1e2355c3 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
@@ -77,7 +77,7 @@ t1 CREATE TABLE `t1` (
`b` char(254) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `index1` (`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -85,7 +85,7 @@ t2 CREATE TABLE `t2` (
`b` char(254) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `index1` (`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
******************** DDL for indexes ********************
ALTER TABLE t2 ADD COLUMN d datetime;
@@ -120,7 +120,7 @@ t1 CREATE TABLE `t1` (
`b` char(254) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `index1` (`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -131,7 +131,7 @@ t2 CREATE TABLE `t2` (
KEY `index1` (`b`),
KEY `index2` (`d`),
KEY `index3` (`a`,`d`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
ALTER TABLE t2 DROP COLUMN d;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
index d70d8dadf54..1e795a85ce1 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -103,7 +103,7 @@ DELETE FROM t1;
DELETE FROM t2;
******************** LOAD DATA INFILE ********************
-LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
SELECT * FROM t1 ORDER BY a;
a b
10 line A
@@ -885,7 +885,7 @@ master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=#
-master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=#
+master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=#
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
@@ -963,9 +963,7 @@ master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
master-bin.000001 # Xid 1 # #
-master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
master-bin.000001 # Query 1 # use `test_rpl`; TRUNCATE t1
-master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
master-bin.000001 # Xid 1 # #
diff --git a/mysql-test/suite/rpl/r/rpl_load_table_from_master.result b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
index c24f857d829..9d9a1d7d6cb 100644
--- a/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
+++ b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
@@ -29,9 +29,9 @@ drop table t1;
drop table t1;
set SQL_LOG_BIN=0;
create table t1 (word char(20) not null, index(word))ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
create table t2 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
create table t3 (word char(20) not null primary key)ENGINE=MyISAM;
load table t1 from master;
load table t2 from master;
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result
index 070c50db3d5..d7a02bc84a5 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata.result
@@ -9,12 +9,12 @@ select last_insert_id();
last_insert_id()
0
create table t1(a int not null auto_increment, b int, primary key(a) );
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
select last_insert_id();
last_insert_id()
1
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2;
select * from t1;
@@ -31,7 +31,7 @@ drop table t2;
drop table t3;
create table t1(a int, b int, unique(b));
insert into t1 values(1,10);
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
set global sql_slave_skip_counter=1;
start slave;
show slave status;
@@ -40,7 +40,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
stop slave;
change master to master_user='test';
change master to master_user='root';
@@ -52,7 +52,7 @@ start slave;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
stop slave;
reset slave;
show slave status;
@@ -61,7 +61,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
@@ -76,14 +76,13 @@ day id category name
2003-03-22 2161 c asdf
alter table t2 drop key day;
delete from t2;
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
-drop table t2;
-drop table t2;
-drop table t1;
+drop table t1, t2;
+drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
-LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
index 929d06e74cf..7ba67150cb9 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
@@ -5,17 +5,17 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (a varchar(10) character set utf8);
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=DEFAULT;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=DEFAULT;
-load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8r;
+load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r;
select hex(a) from t1;
hex(a)
C3BF
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
index a4d67754bd6..27fb8623e85 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
@@ -45,7 +45,7 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
index 9dbae6d38c4..a1294d515fa 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
@@ -7,20 +7,21 @@ start slave;
drop database if exists mysqltest;
USE test;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE test.t1;
SELECT COUNT(*) FROM test.t1;
COUNT(*)
2
CREATE DATABASE mysqltest;
USE mysqltest;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
SELECT COUNT(*) FROM mysqltest.t1;
COUNT(*)
2
SHOW DATABASES;
Database
information_schema
+mtr
mysql
mysqltest
test
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_s.result b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
index 4fc33eee20d..779a3af9631 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_s.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master;
create table test.t1(a int, b int, unique(b));
-load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
select count(*) from test.t1;
count(*)
2
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
index 196093211b6..5e3923616ed 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (word CHAR(20) NOT NULL);
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word;
word
Aarhus
diff --git a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
index bb1b0610aa8..96de55e9dcf 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
@@ -5,19 +5,19 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(a int);
-select * into outfile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
truncate table t1;
-load data local infile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
select a,count(*) from t1 group by a;
a count(*)
1 10000
drop table t1;
create table t1(a int);
insert into t1 values (1), (2), (2), (3);
-select * into outfile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key);
-load data local infile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
SELECT * FROM t1 ORDER BY a;
a
1
diff --git a/mysql-test/suite/rpl/r/rpl_loadfile.result b/mysql-test/suite/rpl/r/rpl_loadfile.result
index 7487693a9f7..7a5a7bc50c9 100644
--- a/mysql-test/suite/rpl/r/rpl_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_loadfile.result
@@ -8,11 +8,11 @@ DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
INSERT INTO test.t1 VALUES(1,'test');
-UPDATE test.t1 SET blob_column=LOAD_FILE('../std_data_ln/words2.dat') WHERE a=1;
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
create procedure test.p1()
begin
INSERT INTO test.t1 VALUES(2,'test');
-UPDATE test.t1 SET blob_column=LOAD_FILE('../std_data_ln/words2.dat') WHERE a=2;
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
end|
CALL test.p1();
SELECT * FROM test.t1 ORDER BY blob_column;
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index e0c4dedde10..7b3ebf62959 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -7,7 +7,7 @@ start slave;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
-stop slave;
+include/stop_slave.inc
change master to master_log_pos=75;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -49,7 +49,7 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
-stop slave;
+include/stop_slave.inc
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result
index a8e5520ca8f..28b777822e4 100644
--- a/mysql-test/suite/rpl/r/rpl_misc_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result
@@ -14,8 +14,8 @@ set sql_log_bin=1;
insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
select * into outfile 'rpl_misc_functions.outfile' from t1;
-create table t2 like t1;
-load data local infile 'MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
+create temporary table t2 like t1;
+load data local infile 'MYSQLD_DATADIR/test/rpl_misc_functions.outfile' into table t2;
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
id i r1 r2 p id i r1 r2 p
drop table t1;
@@ -41,9 +41,9 @@ CALL test_replication_sp2();
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
-select * from t1 into outfile "../tmp/t1_slave.txt";
+select * from t1 into outfile "../../tmp/t1_slave.txt";
create temporary table t1_slave select * from t1 where 1=0;
-load data infile '../tmp/t1_slave.txt' into table t1_slave;
+load data infile '../../tmp/t1_slave.txt' into table t1_slave;
select count(*) into @aux from t1 join t1_slave using (id)
where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
SELECT @aux;
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
index 38972a4f571..08d3241c48f 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
@@ -14,7 +14,7 @@ n
2002
show slave hosts;
Server_id Host Port Rpl_recovery_rank Master_id
-2 127.0.0.1 9999 2 1
+2 127.0.0.1 9999 0 1
drop table t1;
stop slave;
create table t2(id int auto_increment primary key, created datetime);
diff --git a/mysql-test/suite/rpl/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result
index 7cb7d873415..e26777c15ce 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result
@@ -4,13 +4,10 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-create database if not exists mysqltest1;
-use mysqltest1;
drop table if exists t1;
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc
VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT
0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
-use mysqltest1;
alter table t1 engine=myisam;
show create table t1;
Table Create Table
@@ -55,7 +52,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -89,7 +86,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -123,7 +120,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -172,7 +169,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -206,7 +203,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -240,7 +237,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -289,7 +286,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -323,7 +320,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -357,10 +354,9 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
DROP TABLE t1;
-DROP DATABASE mysqltest1;
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index f89d6b3459a..4c64054e348 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -8,8 +8,8 @@ drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
-STOP SLAVE;
-START SLAVE;
+include/stop_slave.inc
+include/start_slave.inc
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
@@ -27,46 +27,13 @@ SLAVE_RUNNING ON
drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
-STOP SLAVE;
-START SLAVE;
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+include/stop_slave.inc
+include/start_slave.inc
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running No
-Slave_SQL_Running #
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
-Last_IO_Error
-Last_SQL_Errno 0
-Last_SQL_Error
+Slave_IO_Running = No (expect No)
+==== clean up ====
+DROP TABLE t1;
+SET @@global.max_allowed_packet= 1024;
+SET @@global.net_buffer_length= 1024;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_ps.result b/mysql-test/suite/rpl/r/rpl_ps.result
index faba43ae934..89e822b3eb6 100644
--- a/mysql-test/suite/rpl/r/rpl_ps.result
+++ b/mysql-test/suite/rpl/r/rpl_ps.result
@@ -68,6 +68,7 @@ test latin1_swedish_ci
DROP DATABASE mysqltest1;
use test;
+DROP TABLE t1;
# Connection: slave
diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
index 8f145b94046..0551240eb8a 100644
--- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+SET @old_binlog_format= @@global.binlog_format;
SET BINLOG_FORMAT=MIXED;
SET GLOBAL BINLOG_FORMAT=MIXED;
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
@@ -65,7 +66,6 @@ Last_SQL_Error
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Query 2 # use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9
slave-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG)
slave-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
slave-bin.000001 # Query 1 # use `test`; BEGIN
@@ -73,3 +73,4 @@ slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # use `test`; COMMIT
DROP TABLE IF EXISTS t1;
+SET @@global.binlog_format= @old_binlog_format;
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result
index d854a2d0f8d..33088ee2ec8 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result
@@ -9,7 +9,7 @@ drop table if exists t11;
create table t2 (n int);
insert into t2 values(4);
create table t2 (s char(20));
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
insert into t2 values('five');
create table t1 (m int);
insert into t1 values(15),(16),(17);
diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index 1b843bffdca..76dd574191f 100644
--- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
@@ -24,7 +24,7 @@ drop database if exists rewrite;
create database rewrite;
use test;
create table t1 (a date, b date, c date not null, d date);
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'c' at row 1
@@ -32,7 +32,7 @@ Warning 1265 Data truncated for column 'd' at row 1
Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 2
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
select * from rewrite.t1;
a b c d
0000-00-00 NULL 0000-00-00 0000-00-00
@@ -40,7 +40,7 @@ a b c d
2003-03-03 2003-03-03 2003-03-03 NULL
2003-03-03 2003-03-03 2003-03-03 NULL
truncate table t1;
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'd' at row 1
@@ -53,7 +53,7 @@ NULL 0000-00-00 0000-00-00 0000-00-00
NULL 2003-03-03 2003-03-03 NULL
drop table t1;
create table t1 (a text, b text);
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
Warnings:
Warning 1261 Row 3 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
@@ -65,7 +65,7 @@ Field 3,'Field 4|
|Field 6| | 'Field 7'|
drop table t1;
create table t1 (a int, b char(10));
-load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
@@ -79,7 +79,7 @@ a b
3 row 3
0 1234567890
truncate table t1;
-load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: '
' for column 'a' at row 4
diff --git a/mysql-test/suite/rpl/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result
index fad60af664f..0d682eb82e1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_001.result
@@ -5,8 +5,8 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (word CHAR(20) NOT NULL);
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
+LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word LIMIT 10;
word
Aarhus
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
index 670456ba6fd..1504c16bd7e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
@@ -9,6 +9,7 @@ CREATE DATABASE test_ignore;
SHOW DATABASES;
Database
information_schema
+mtr
mysql
test
test_ignore
@@ -35,6 +36,7 @@ master-bin.000001 # Query # # use `test`; COMMIT
SHOW DATABASES;
Database
information_schema
+mtr
mysql
test
USE test;
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
index 77148fc688c..a980092ac37 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
@@ -423,10 +423,10 @@ a b c
**** On Master ****
DELETE FROM t1;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
index 8d071d503bc..ea0c322fe6d 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
@@ -423,10 +423,10 @@ a b c
**** On Master ****
DELETE FROM t1;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
new file mode 100644
index 00000000000..0f15bfc7156
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
@@ -0,0 +1,109 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*");
+[on slave]
+SET @old_slave_exec_mode= @@global.slave_exec_mode;
+######## Run with slave_exec_mode=STRICT ########
+SET @@global.slave_exec_mode = 'STRICT';
+==== Initialize ====
+[on master]
+CREATE TABLE t1(a INT PRIMARY KEY);
+[on slave]
+==== Test: SQL thread sees 'INSERT' of existing key ====
+---- Prepare slave so that it will get duplicate key error ----
+INSERT INTO t1 VALUES (1);
+---- Insert rows on master ----
+[on master]
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+a
+1
+[on slave]
+---- Wait until slave stops with an error ----
+Last_SQL_Error = Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 346 (expected "duplicate key" error)
+SELECT * FROM t1;
+a
+1
+---- Resolve the conflict on the slave and restart SQL thread ----
+DELETE FROM t1 WHERE a = 1;
+START SLAVE SQL_THREAD;
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = '' (expected no error)
+SELECT * FROM t1;
+a
+1
+==== Test: SQL thread sees 'DELETE' of non-existing row ====
+---- On master, insert two rows, the second with binlogging off ----
+[on master]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+[on slave]
+DELETE FROM t1 WHERE a = 1;
+---- On master, remove the row that does not exist on slave ----
+[on master]
+DELETE FROM t1 WHERE a = 1;
+SELECT * FROM t1;
+a
+[on slave]
+---- Wait until slave stops with an error ----
+Last_SQL_Error = Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 982 (expected "can't find record" error)
+SELECT * FROM t1;
+a
+---- Resolve the conflict on the slave and restart SQL thread ----
+INSERT INTO t1 VALUES (1);
+START SLAVE SQL_THREAD;
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = (expected no error)
+SELECT * FROM t1;
+a
+==== Clean up ====
+[on master]
+DROP TABLE t1;
+[on slave]
+######## Run with slave_exec_mode=IDEMPOTENT ########
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+==== Initialize ====
+[on master]
+CREATE TABLE t1(a INT PRIMARY KEY);
+[on slave]
+==== Test: SQL thread sees 'INSERT' of existing key ====
+---- Prepare slave so that it will get duplicate key error ----
+INSERT INTO t1 VALUES (1);
+---- Insert rows on master ----
+[on master]
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+a
+1
+[on slave]
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = '' (expected no error)
+SELECT * FROM t1;
+a
+1
+==== Test: SQL thread sees 'DELETE' of non-existing row ====
+---- On master, insert two rows, the second with binlogging off ----
+[on master]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+[on slave]
+DELETE FROM t1 WHERE a = 1;
+---- On master, remove the row that does not exist on slave ----
+[on master]
+DELETE FROM t1 WHERE a = 1;
+SELECT * FROM t1;
+a
+[on slave]
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = (expected no error)
+SELECT * FROM t1;
+a
+==== Clean up ====
+[on master]
+DROP TABLE t1;
+[on slave]
+SET @@global.slave_exec_mode= @old_slave_exec_mode;
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index ad659c37b7f..29f58632fde 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -4,34 +4,39 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
-SHOW BINLOG EVENTS FROM 216;
+SHOW BINLOG EVENTS FROM 106;
Log_name #
-Pos 216
+Pos 106
Event_type Query
Server_id #
-End_log_pos 309
+End_log_pos 199
Info use `test`; CREATE TABLE t1 (a INT, b INT)
Log_name #
-Pos 309
+Pos 199
Event_type Query
Server_id #
-End_log_pos 415
+End_log_pos 305
Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge
Log_name #
-Pos 415
+Pos 305
Event_type Query
Server_id #
-End_log_pos 521
+End_log_pos 411
Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
Log_name #
-Pos 521
+Pos 411
Event_type Query
Server_id #
-End_log_pos 640
+End_log_pos 530
Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8
**** On Master ****
SHOW CREATE TABLE t1;
@@ -125,9 +130,14 @@ NULL 3 6
NULL 4 2
NULL 5 10
NULL 6 12
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
ERROR 23000: Duplicate entry '2' for key 'b'
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
CREATE TABLE t7 (a INT, b INT UNIQUE);
INSERT INTO t7 SELECT a,b FROM tt3;
@@ -137,18 +147,23 @@ a b
1 2
2 4
3 6
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1374 Query # 1474 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
-# 1474 Query # 1542 use `test`; BEGIN
-# 1542 Table_map # 1584 table_id: # (test.t7)
-# 1584 Write_rows # 1640 table_id: # flags: STMT_END_F
-# 1640 Query # 1711 use `test`; ROLLBACK
+# 106 Query # 206 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
+# 206 Query # 274 use `test`; BEGIN
+# 274 Table_map # 316 table_id: # (test.t7)
+# 316 Write_rows # 372 table_id: # flags: STMT_END_F
+# 372 Query # 443 use `test`; ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
2 4
3 6
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
BEGIN;
@@ -156,12 +171,12 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SHOW BINLOG EVENTS FROM 1711;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1711 Query # 1779 use `test`; BEGIN
-# 1779 Table_map # 1821 table_id: # (test.t7)
-# 1821 Write_rows # 1877 table_id: # flags: STMT_END_F
-# 1877 Query # 1946 use `test`; COMMIT
+# 106 Query # 174 use `test`; BEGIN
+# 174 Table_map # 216 table_id: # (test.t7)
+# 216 Write_rows # 272 table_id: # flags: STMT_END_F
+# 272 Query # 343 use `test`; ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
@@ -178,6 +193,11 @@ a b
4 8
5 10
6 12
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
CREATE TABLE t8 LIKE t4;
CREATE TABLE t9 LIKE tt4;
CREATE TEMPORARY TABLE tt5 LIKE t4;
@@ -196,10 +216,10 @@ Create Table CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW BINLOG EVENTS FROM 1946;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1946 Query # 2032 use `test`; CREATE TABLE t8 LIKE t4
-# 2032 Query # 2171 use `test`; CREATE TABLE `t9` (
+# 106 Query # 192 use `test`; CREATE TABLE t8 LIKE t4
+# 192 Query # 331 use `test`; CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
)
@@ -276,9 +296,8 @@ a
1
2
3
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
# 192 Query # 260 use `test`; BEGIN
# 260 Table_map # 301 table_id: # (test.t1)
@@ -308,7 +327,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
# 1329 Query # 1397 use `test`; BEGIN
# 1397 Table_map # 1438 table_id: # (test.t1)
# 1438 Write_rows # 1482 table_id: # flags: STMT_END_F
-# 1482 Query # 1551 use `test`; COMMIT
+# 1482 Query # 1553 use `test`; ROLLBACK
SHOW TABLES;
Tables_in_test
t1
@@ -371,9 +390,8 @@ a
4
6
9
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
# 192 Query # 260 use `test`; BEGIN
# 260 Table_map # 301 table_id: # (test.t1)
@@ -394,6 +412,11 @@ a
6
9
TRUNCATE TABLE t2;
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
BEGIN;
INSERT INTO t2 SELECT a*a FROM t1;
CREATE TEMPORARY TABLE tt2
@@ -406,14 +429,14 @@ Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT * FROM t2 ORDER BY a;
a
-SHOW BINLOG EVENTS FROM 949;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 949 Query # 1017 use `test`; BEGIN
-# 1017 Table_map # 1058 table_id: # (test.t2)
-# 1058 Write_rows # 1102 table_id: # flags: STMT_END_F
-# 1102 Table_map # 1143 table_id: # (test.t2)
-# 1143 Write_rows # 1182 table_id: # flags: STMT_END_F
-# 1182 Query # 1253 use `test`; ROLLBACK
+# 106 Query # 174 use `test`; BEGIN
+# 174 Table_map # 215 table_id: # (test.t2)
+# 215 Write_rows # 259 table_id: # flags: STMT_END_F
+# 259 Table_map # 300 table_id: # (test.t2)
+# 300 Write_rows # 339 table_id: # flags: STMT_END_F
+# 339 Query # 410 use `test`; ROLLBACK
SELECT * FROM t2 ORDER BY a;
a
DROP TABLE t1,t2;
@@ -436,11 +459,13 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
CREATE TABLE mysqltest1.without_select (f1 BIGINT);
CREATE TABLE mysqltest1.with_select AS SELECT 1 AS f1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # DROP DATABASE IF EXISTS mysqltest1
master-bin.000001 # Query # # CREATE DATABASE mysqltest1
master-bin.000001 # Query # # use `test`; CREATE TABLE mysqltest1.without_select (f1 BIGINT)
master-bin.000001 # Query # # use `test`; BEGIN
diff --git a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
index 09626754428..129bad0fbcc 100644
--- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
@@ -30,4 +30,5 @@ flush tables with read lock;
start slave;
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+unlock tables;
drop table t3, t4, t5;
diff --git a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
index 1dd97878666..562e3dc2862 100644
--- a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
+++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
@@ -4,56 +4,18 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-create table t1 (a int not null primary key);
-insert into t1 values (1);
-create table t2 (a int);
-insert into t2 values (1);
-update t1, t2 set t1.a = 0 where t1.a = t2.a;
-show tables;
-Tables_in_test
-t1
-select * from t1;
-a
-0
-drop table t1;
-insert into t1 values (1);
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_PORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos 1153
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table #
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1146
-Last_Error Error 'Table 'test.t1' doesn't exist' on opening tables
-Skip_Counter 0
-Exec_Master_Log_Pos 941
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1146
-Last_SQL_Error Error 'Table 'test.t1' doesn't exist' on opening tables
-drop table t1, t2;
+==== Setup table on master but not on slave ====
+[on master]
+CREATE TABLE t1 (a INT);
+[on slave]
+DROP TABLE t1;
+==== Modify table on master ====
+[on master]
+INSERT INTO t1 VALUES (1);
+==== Verify error on slave ====
+[on slave]
+Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables
+==== Clean up ====
+include/stop_slave.inc
+[on master]
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
index 149efddaf8d..198e55c71d0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
@@ -9,7 +9,7 @@ stop slave;
create database mysqltest;
use mysqltest;
create table t1(a int, b int, unique(b));
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # #
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index c0d70bb0cdd..b76cc6aa15e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
start slave;
@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
create table t1 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+load data infile 'LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
count(*)
69
@@ -113,10 +113,6 @@ Aberdeen
Abernathy
aberrant
aberration
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -189,7 +185,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -217,13 +214,12 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Query 1 # use `test`; COMMIT
show binary logs;
Log_name File_size
-master-bin.000001 1540
-master-bin.000002 516
-start slave;
+master-bin.000001 #
+master-bin.000002 #
show binary logs;
Log_name File_size
-slave-bin.000001 1638
-slave-bin.000002 417
+slave-bin.000001 #
+slave-bin.000002 #
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
@@ -292,13 +288,23 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
-reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int)
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
index 790038799c0..809c50e1465 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
start slave;
@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key)ENGINE=InnoDB;
insert into t1 values (NULL);
drop table t1;
create table t1 (word char(20) not null)ENGINE=InnoDB;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+load data infile 'LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
count(*)
69
@@ -113,10 +113,6 @@ Aberdeen
Abernathy
aberrant
aberration
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -189,7 +185,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=InnoDB;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -217,13 +214,12 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Xid 1 # COMMIT /* XID */
show binary logs;
Log_name File_size
-master-bin.000001 1456
-master-bin.000002 474
-start slave;
+master-bin.000001 #
+master-bin.000002 #
show binary logs;
Log_name File_size
-slave-bin.000001 1536
-slave-bin.000002 366
+slave-bin.000001 #
+slave-bin.000002 #
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
@@ -292,13 +288,23 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
-reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int)
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
index 392f5904233..2215b34814e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
@@ -1,5 +1,3 @@
-SET SESSION BINLOG_FORMAT=ROW;
-SET GLOBAL BINLOG_FORMAT=ROW;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index 2d9d801047b..2cb316c6a1f 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -159,7 +159,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -181,7 +181,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -290,7 +290,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -321,7 +321,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_row_mystery22.result b/mysql-test/suite/rpl/r/rpl_row_mystery22.result
deleted file mode 100644
index 5e42a89d741..00000000000
--- a/mysql-test/suite/rpl/r/rpl_row_mystery22.result
+++ /dev/null
@@ -1,32 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-create table t1(n int auto_increment primary key, s char(10));
-set @@global.slave_exec_mode= 'IDEMPOTENT';
-insert into t1 values (2,'old');
-insert into t1 values(NULL,'new');
-insert into t1 values(NULL,'new');
-select * from t1 order by n;
-n s
-1 new
-2 new
-delete from t1 where n = 2;
-start slave;
-stop slave;
-create table t2(n int);
-drop table t2;
-insert into t1 values(NULL,'new');
-set sql_log_bin=0;
-insert into t1 values(NULL,'new');
-set sql_log_bin=1;
-delete from t1 where n=4;
-start slave;
-select * from t1 order by n;
-n s
-1 new
-3 new
-drop table t1;
-set @@global.slave_exec_mode= default;
diff --git a/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
index 0fd4ff86893..1934b01505c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
+++ b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (words varchar(20)) engine=myisam;
-load data infile '../std_data_ln/words.dat' into table t1 (words);
+load data infile '../../std_data/words.dat' into table t1 (words);
select count(*) from t1;
count(*)
70
@@ -13,4 +13,5 @@ select count(*) from t1;
count(*)
70
drop table t1;
+include/stop_slave.inc
drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
index e81d4f7454e..a6a2181cd2a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -140,7 +140,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1364
Last_SQL_Error <Last_SQL_Error>
@@ -191,7 +191,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
@@ -232,7 +232,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -275,7 +275,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -318,7 +318,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -360,7 +360,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
index a6834be5a86..02e8c074354 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -140,7 +140,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1364
Last_SQL_Error <Last_SQL_Error>
@@ -191,7 +191,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
@@ -232,7 +232,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -275,7 +275,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -318,7 +318,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -360,7 +360,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index f544ef95702..be1ec51f74a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -149,8 +149,8 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
-stop slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
+include/stop_slave.inc
+start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740;
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -162,7 +162,7 @@ Read_Master_Log_Pos 1161
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
+Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
@@ -200,7 +200,7 @@ start slave until relay_log_file='slave-relay-bin.000002';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave sql_thread;
+start slave;
start slave until master_log_file='master-bin.000001', master_log_pos=740;
Warnings:
Note 1254 Slave is already running
diff --git a/mysql-test/suite/rpl/r/rpl_server_id1.result b/mysql-test/suite/rpl/r/rpl_server_id1.result
index 724f0071e07..76f187e3b01 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id1.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id1.result
@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master;
-stop slave;
+include/stop_slave.inc
change master to master_port=SLAVE_PORT;
start slave;
*** must be having the replicate-same-server-id IO thread error ***
diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result
index f68f9ff829d..bb5a175fbfe 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id2.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id2.result
@@ -8,45 +8,6 @@ create table t1 (n int);
reset master;
stop slave;
change master to master_port=SLAVE_PORT;
-show slave status;
-Slave_IO_State
-Master_Host 127.0.0.1
-Master_User root
-Master_Port SLAVE_PORT
-Connect_Retry 1
-Master_Log_File
-Read_Master_Log_Pos 4
-Relay_Log_File slave-relay-bin.000001
-Relay_Log_Pos 4
-Relay_Master_Log_File
-Slave_IO_Running No
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table #
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos 0
-Relay_Log_Space 106
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master NULL
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
start slave;
insert into t1 values (1);
select * from t1;
@@ -55,3 +16,15 @@ n
1
stop slave;
drop table t1;
+reset master;
+create table t1(n int);
+create table t2(n int);
+change master to master_port=MASTER_PORT;
+start slave until master_log_file='master-bin.000001', master_log_pos=UNTIL_POS;
+*** checking until postion execution: must be only t1 in the list ***
+show tables;
+Tables_in_test
+t1
+start slave sql_thread;
+drop table t1;
+drop table t2;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
new file mode 100644
index 00000000000..eb3c4ef5978
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
@@ -0,0 +1,123 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+
+*** Preparing data ***
+CREATE TABLE t1 (a INT NOT NULL, b VARCHAR(10)) ENGINE=MyISAM;
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+CREATE TRIGGER tr1 BEFORE UPDATE ON t1
+FOR EACH ROW BEGIN
+UPDATE t2 SET b='YY' WHERE a=NEW.a;
+END|
+CREATE TRIGGER tr2 AFTER UPDATE ON t1
+FOR EACH ROW BEGIN
+UPDATE t3 SET b='ZZ' WHERE a=NEW.a;
+END|
+
+*** Test non-transactional group w/o PK ***
+INSERT INTO t3 VALUES(1, 'AA');
+INSERT INTO t2 VALUES(1, 'AA');
+INSERT INTO t1 VALUES(1, 'AA');
+RENAME TABLE t3 TO t3_bak;
+UPDATE t1 SET b = 'XX' WHERE a = 1;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 XX
+SELECT * FROM t2 ORDER BY a;
+a b
+1 YY
+SELECT * FROM t3 ORDER BY a;
+a b
+1 ZZ
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+t2
+t3_bak
+SELECT * FROM t1 ORDER BY a;
+a b
+1 AA_for_row_or_XX_for_stmt_mixed
+SELECT * FROM t2 ORDER BY a;
+a b
+1 AA_for_row_or_YY_for_stmt_mixed
+include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+include/start_slave.inc
+TRUNCATE t1;
+TRUNCATE t2;
+TRUNCATE t3;
+
+*** Test non-transactional group w/ PK ***
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+ALTER TABLE t2 ADD PRIMARY KEY (a);
+ALTER TABLE t3 ADD PRIMARY KEY (a);
+RENAME TABLE t3 TO t3_bak;
+INSERT INTO t3 VALUES(2, 'B');
+INSERT INTO t2 VALUES(2, 'B');
+INSERT INTO t1 VALUES(2, 'B');
+UPDATE t1 SET b = 'X' WHERE a = 2;
+SELECT * FROM t1 ORDER BY a;
+a b
+2 X
+SELECT * FROM t2 ORDER BY a;
+a b
+2 YY
+SELECT * FROM t3 ORDER BY a;
+a b
+2 ZZ
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+t2
+t3_bak
+SELECT * FROM t1 ORDER BY a;
+a b
+SELECT * FROM t2 ORDER BY a;
+a b
+include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+include/start_slave.inc
+TRUNCATE t1;
+TRUNCATE t2;
+TRUNCATE t3;
+
+*** Test transactional group w/ PK ***
+ALTER TABLE t1 ENGINE=InnoDB;
+ALTER TABLE t2 ENGINE=InnoDB;
+ALTER TABLE t3 ENGINE=InnoDB;
+RENAME TABLE t3 TO t3_bak;
+BEGIN;
+INSERT INTO t1 VALUES (3, 'C'), (4, 'D');
+INSERT INTO t2 VALUES (3, 'C'), (4, 'D');
+INSERT INTO t3 VALUES (3, 'C'), (4, 'D');
+COMMIT;
+SELECT * FROM t1 ORDER BY a;
+a b
+3 C
+4 D
+SELECT * FROM t2 ORDER BY a;
+a b
+3 C
+4 D
+SELECT * FROM t3 ORDER BY a;
+a b
+3 C
+4 D
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+t2
+t3_bak
+SELECT * FROM t1 ORDER BY a;
+a b
+SELECT * FROM t2 ORDER BY a;
+a b
+include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+include/start_slave.inc
+*** Clean up ***
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index bb03c3b6cca..747e8f235a8 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -166,7 +166,7 @@ BEGIN
UPDATE t3 SET a =2, b = 'master only';
END|
**** On Slave ****
-STOP SLAVE;
+include/stop_slave.inc
**** On Master ****
UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1;
DROP TRIGGER tr1;
@@ -174,6 +174,7 @@ DROP TRIGGER tr2;
INSERT INTO t1 VALUES (3,'master/slave');
INSERT INTO t2 VALUES (3,'master/slave');
INSERT INTO t3 VALUES (3,'master/slave');
+COMMIT;
SELECT * FROM t1 ORDER BY a;
a b
2 master only
@@ -188,7 +189,7 @@ a b
3 master/slave
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a b
1 master/slave
@@ -208,7 +209,7 @@ CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
**** On Slave ****
-STOP SLAVE;
+include/stop_slave.inc
*** On Master ***
BEGIN;
INSERT INTO t4 VALUES (2, 'master only');
@@ -234,7 +235,7 @@ a b
3 master/slave
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -245,7 +246,7 @@ SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
**** On Slave ****
-STOP SLAVE;
+include/stop_slave.inc
*** On Master ***
BEGIN;
INSERT INTO t4 VALUES (6, 'master only');
@@ -277,7 +278,7 @@ a b
7 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -287,7 +288,7 @@ a b
SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
-STOP SLAVE;
+include/stop_slave.inc
SET AUTOCOMMIT=0;
INSERT INTO t4 VALUES (4, 'master only');
INSERT INTO t5 VALUES (4, 'master only');
@@ -323,7 +324,7 @@ a b
7 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -341,10 +342,10 @@ DROP TABLE t4, t5, t6;
*** On Master ***
CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
*** On Slave ***
-STOP SLAVE;
+include/stop_slave.inc
*** On Master ***
SET SESSION BINLOG_FORMAT=STATEMENT;
-LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
SELECT * FROM t10 ORDER BY a;
a b
1 master only
@@ -352,7 +353,7 @@ a b
3 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t10 ORDER BY a;
a b
DROP TABLE t10;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_status.result b/mysql-test/suite/rpl/r/rpl_slave_status.result
index b435af499df..a98a81dc74f 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_status.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_status.result
@@ -6,31 +6,30 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
==== Create new replication user ====
[on master]
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
[on slave]
-stop slave;
-change master to master_user='rpl',master_password='rpl';
-start slave;
+include/stop_slave.inc
+CHANGE MASTER TO master_user='rpl', master_password='rpl';
+include/start_slave.inc
==== Do replication as new user ====
[on master]
-create table t1 (n int);
-insert into t1 values (1);
+CREATE TABLE t1 (n INT);
+INSERT INTO t1 VALUES (1);
[on slave]
-select * from t1;
+SELECT * FROM t1;
n
1
==== Delete new replication user ====
[on master]
-drop user rpl@127.0.0.1;
-flush privileges;
+DROP USER rpl@127.0.0.1;
+FLUSH PRIVILEGES;
[on slave]
==== Restart slave without privileges =====
-stop slave;
-start slave;
+include/stop_slave.inc
+START SLAVE;
==== Verify that Slave_IO_Running = No ====
Slave_IO_Running = No (should be No)
==== Cleanup (Note that slave IO thread is not running) ====
-drop table t1;
-delete from mysql.user where user='rpl';
+DROP TABLE t1;
[on master]
-drop table t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 3ca4f86cf64..4a8a4050c02 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -191,11 +191,15 @@ begin
return unix_timestamp();
end|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_routine_creators=1;
Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1;
create function fn2()
returns int
@@ -549,8 +553,14 @@ insert into t values (1);
return 0;
end
master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`()
-set global log_bin_trust_function_creators=0;
-set global log_bin_trust_function_creators=0;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+Warnings:
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+Warnings:
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database mysqltest;
drop database mysqltest2;
use test;
@@ -605,7 +615,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result
index a39d189aa3a..d9cdfd81167 100644
--- a/mysql-test/suite/rpl/r/rpl_sp_effects.result
+++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop procedure if exists p1;
drop procedure if exists p2;
drop function if exists f1;
@@ -275,5 +276,5 @@ E
drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
end of the tests
diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result
index 3b4cd05f640..24e454eb876 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_000001.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result
@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (word char(20) not null);
-load data infile '../std_data_ln/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1 limit 10;
word
diff --git a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
index 13aa45d8ced..e69952787fb 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
@@ -11,3 +11,6 @@ set sql_log_bin=1;
insert into t1 values(1),(2);
ERROR 23000: Duplicate entry '2' for key 'a'
drop table t1;
+Error: "Query caused different errors on master and slave. Error on master: 'Duplicate entry '%-.192s' for key %d' (1062), Error on slave: 'no error' (0). Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
+Errno: "0" (expected 0)
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
new file mode 100644
index 00000000000..b0df9516b7c
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
@@ -0,0 +1,54 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+==== Initialize ====
+[on master]
+CREATE TABLE t1(a INT PRIMARY KEY);
+[on slave]
+==== Test: SQL thread sees 'INSERT' of existing key ====
+---- Prepare slave so that it will get duplicate key error ----
+INSERT INTO t1 VALUES (1);
+---- Insert rows on master ----
+[on master]
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+a
+1
+[on slave]
+---- Wait until slave stops with an error ----
+Last_SQL_Error = Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (1)' (expected "duplicate key" error)
+SELECT * FROM t1;
+a
+1
+---- Resolve the conflict on the slave and restart SQL thread ----
+DELETE FROM t1 WHERE a = 1;
+START SLAVE SQL_THREAD;
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = '' (expected no error)
+SELECT * FROM t1;
+a
+1
+==== Test: SQL thread sees 'DELETE' of non-existing row ====
+---- On master, insert two rows, the second with binlogging off ----
+[on master]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+[on slave]
+DELETE FROM t1 WHERE a = 1;
+---- On master, remove the row that does not exist on slave ----
+[on master]
+DELETE FROM t1 WHERE a = 1;
+SELECT * FROM t1;
+a
+[on slave]
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = (expected no error)
+SELECT * FROM t1;
+a
+==== Clean up ====
+[on master]
+DROP TABLE t1;
+[on slave]
diff --git a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
index 1c6b5615b6e..74031af1dde 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
@@ -30,4 +30,5 @@ flush tables with read lock;
start slave;
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+unlock tables;
drop table t3, t4, t5;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index 20f8e04afe7..715d4976a95 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
start slave;
@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
create table t1 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+load data infile 'LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
count(*)
69
@@ -25,7 +25,7 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
-master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
+master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1
show binlog events from 106 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
@@ -109,10 +109,6 @@ Aberdeen
Abernathy
aberrant
aberration
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -185,7 +181,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -196,7 +193,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values (NULL)
master-bin.000001 # Query # # use `test`; drop table t1
master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
-master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=#
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=#
master-bin.000001 # Rotate # # master-bin.000002;pos=4
show binlog events in 'master-bin.000002';
Log_name Pos Event_type Server_id End_log_pos Info
@@ -206,13 +203,12 @@ master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
master-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
show binary logs;
Log_name File_size
-master-bin.000001 1347
-master-bin.000002 392
-start slave;
+master-bin.000001 #
+master-bin.000002 #
show binary logs;
Log_name File_size
-slave-bin.000001 1447
-slave-bin.000002 293
+slave-bin.000001 #
+slave-bin.000002 #
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
@@ -222,7 +218,7 @@ slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
slave-bin.000001 # Query 1 # use `test`; drop table t1
slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
-slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
+slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4;
@@ -274,13 +270,21 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
-reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int)
+master-bin.000001 # Intvar # # INSERT_ID=1
+master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, 1)
master-bin.000001 # Intvar # # LAST_INSERT_ID=1
master-bin.000001 # Intvar # # INSERT_ID=5
master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id())
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mystery22.result b/mysql-test/suite/rpl/r/rpl_stm_mystery22.result
deleted file mode 100644
index ea34b308ec2..00000000000
--- a/mysql-test/suite/rpl/r/rpl_stm_mystery22.result
+++ /dev/null
@@ -1,31 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-create table t1(n int auto_increment primary key, s char(10));
-insert into t1 values (2,'old');
-insert into t1 values(NULL,'new');
-insert into t1 values(NULL,'new');
-select * from t1 order by n;
-n s
-1 new
-2 old
-delete from t1 where n = 2;
-start slave;
-stop slave;
-create table t2(n int);
-drop table t2;
-insert into t1 values(NULL,'new');
-set sql_log_bin=0;
-insert into t1 values(NULL,'new');
-set sql_log_bin=1;
-delete from t1 where n=4;
-start slave;
-select * from t1 order by n;
-n s
-1 new
-2 new
-3 new
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index 619115aa534..55074f0be0d 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -4,7 +4,10 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+[on slave]
+include/stop_slave.inc
+==== Create some events on master ====
+[on master]
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -12,6 +15,8 @@ create table t2(n int not null auto_increment primary key);
insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
+==== Replicate one event at a time on slave ====
+[on slave]
start slave until master_log_file='master-bin.000001', master_log_pos=323;
select * from t1;
n
@@ -149,7 +154,9 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
-stop slave;
+[on master]
+[on slave]
+include/stop_slave.inc
start slave until master_log_file='master-bin.000001', master_log_pos=776;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -190,6 +197,7 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+==== Test various error conditions ====
start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index d8fea78ecb4..568d5368adb 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032");
reset master;
SET @save_select_limit=@@session.sql_select_limit;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
index 430e63c5859..d14380a6369 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+call mtr.add_suppression("Deadlock found");
**** On Master ****
SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
diff --git a/mysql-test/suite/rpl/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result
index cd71dbe628e..927756dd530 100644
--- a/mysql-test/suite/rpl/r/rpl_timezone.result
+++ b/mysql-test/suite/rpl/r/rpl_timezone.result
@@ -42,7 +42,7 @@ t n
2004-06-11 09:39:02 6
delete from t1;
set time_zone='UTC';
-load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
+load data infile '../../std_data/rpl_timezone2.dat' into table t1;
Warnings:
Warning 1265 Data truncated for column 't' at row 1
Warning 1261 Row 1 doesn't contain data for all columns
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index 68c82ed037f..3d7757613a7 100644
--- a/mysql-test/suite/rpl/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -862,6 +862,9 @@ drop table t21,t31;
drop table t11;
STOP SLAVE;
FLUSH LOGS;
+--> Stop master server
+--> Start master server
+--> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4
RESET SLAVE;
START SLAVE;
SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0;
@@ -975,3 +978,22 @@ a b
2 b
3 c
drop table t1;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1 ( f int ) engine = innodb;
+create table log ( r int ) engine = myisam;
+create trigger tr
+after insert on t1
+for each row insert into log values ( new.f );
+set autocommit = 0;
+insert into t1 values ( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.log and slave:test.log
+drop table t1, log;
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
index 1ae98706975..38fb9e27764 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
@@ -4,241 +4,43 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
+**** Resetting master and slave ****
+include/stop_slave.inc
RESET SLAVE;
-START SLAVE;
-**** On Master ****
-SET SESSION BINLOG_FORMAT=STATEMENT;
-SET GLOBAL BINLOG_FORMAT=STATEMENT;
-CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-TRUNCATE TABLE t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
-**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
-RESET SLAVE;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
-SET SESSION BINLOG_FORMAT=MIXED;
-SET GLOBAL BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
**** On Master ****
TRUNCATE TABLE t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
+Comparing tables master:test.t1 and slave:test.t1
+==== Test using a table with delete triggers ====
**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
-RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
-RESET SLAVE;
-START SLAVE;
-**** On Master ****
-SET SESSION BINLOG_FORMAT=ROW;
-SET GLOBAL BINLOG_FORMAT=ROW;
-CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
+SET @count := 1;
+CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM;
+CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
TRUNCATE TABLE t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
-**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
-RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
+Comparing tables master:test.t2 and slave:test.t2
+DROP TABLE t1,t2;
+**** Resetting master and slave ****
+include/stop_slave.inc
RESET SLAVE;
-START SLAVE;
-**** On Master ****
-SET SESSION BINLOG_FORMAT=STATEMENT;
-SET GLOBAL BINLOG_FORMAT=STATEMENT;
-CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-DELETE FROM t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
-**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-master-bin.000001 # Query # # use `test`; DELETE FROM t1
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
-RESET SLAVE;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
-SET SESSION BINLOG_FORMAT=MIXED;
-SET GLOBAL BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
**** On Master ****
DELETE FROM t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
+Comparing tables master:test.t1 and slave:test.t1
+==== Test using a table with delete triggers ====
**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-master-bin.000001 # Query # # use `test`; DELETE FROM t1
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
-RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
-RESET SLAVE;
-START SLAVE;
-**** On Master ****
-SET SESSION BINLOG_FORMAT=ROW;
-SET GLOBAL BINLOG_FORMAT=ROW;
-CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
+SET @count := 1;
+CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM;
+CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
DELETE FROM t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
-3 3
-**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
-RESET MASTER;
+Comparing tables master:test.t2 and slave:test.t2
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
index 728b8450314..b5e5936834d 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
@@ -4,259 +4,43 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
+**** Resetting master and slave ****
+include/stop_slave.inc
RESET SLAVE;
-START SLAVE;
-**** On Master ****
-SET SESSION BINLOG_FORMAT=STATEMENT;
-SET GLOBAL BINLOG_FORMAT=STATEMENT;
-CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-TRUNCATE TABLE t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
-**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
-RESET SLAVE;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
-SET SESSION BINLOG_FORMAT=MIXED;
-SET GLOBAL BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
**** On Master ****
TRUNCATE TABLE t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
+Comparing tables master:test.t1 and slave:test.t1
+==== Test using a table with delete triggers ====
**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
-RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
-RESET SLAVE;
-START SLAVE;
-**** On Master ****
-SET SESSION BINLOG_FORMAT=ROW;
-SET GLOBAL BINLOG_FORMAT=ROW;
-CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
+SET @count := 1;
+CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB;
+CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
TRUNCATE TABLE t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
-**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
-RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
+Comparing tables master:test.t2 and slave:test.t2
+DROP TABLE t1,t2;
+**** Resetting master and slave ****
+include/stop_slave.inc
RESET SLAVE;
-START SLAVE;
-**** On Master ****
-SET SESSION BINLOG_FORMAT=STATEMENT;
-SET GLOBAL BINLOG_FORMAT=STATEMENT;
-CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-DELETE FROM t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
-**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; DELETE FROM t1
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
-RESET SLAVE;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
-SET SESSION BINLOG_FORMAT=MIXED;
-SET GLOBAL BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
**** On Master ****
DELETE FROM t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
+Comparing tables master:test.t1 and slave:test.t1
+==== Test using a table with delete triggers ====
**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; DELETE FROM t1
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
-RESET MASTER;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t1;
-RESET SLAVE;
-START SLAVE;
-**** On Master ****
-SET SESSION BINLOG_FORMAT=ROW;
-SET GLOBAL BINLOG_FORMAT=ROW;
-CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1;
-a b
-1 1
-2 2
-3 3
+SET @count := 1;
+CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB;
+CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
DELETE FROM t1;
-SELECT * FROM t1;
-a b
-**** On Slave ****
-SELECT * FROM t1;
-a b
-3 3
-**** On Master ****
-DROP TABLE t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; DROP TABLE t1
-RESET MASTER;
+Comparing tables master:test.t2 and slave:test.t2
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index 902340f0219..b3108c75a6e 100644
--- a/mysql-test/suite/rpl/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
@@ -40,10 +40,10 @@ SET @user_num = 10;
SET @user_text = 'Alunda';
[on master]
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
[on slave]
SET @@global.init_slave = 'SELECT 1';
[on master]
diff --git a/mysql-test/suite/rpl/rpl_1slave_base.cnf b/mysql-test/suite/rpl/rpl_1slave_base.cnf
new file mode 100644
index 00000000000..23b7ded9a7d
--- /dev/null
+++ b/mysql-test/suite/rpl/rpl_1slave_base.cnf
@@ -0,0 +1,50 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld.1]
+
+# Run the master.sh script before starting this process
+#!run-master-sh
+
+log-bin= master-bin
+
+loose-innodb
+
+[mysqld.2]
+# Run the slave.sh script before starting this process
+#!run-slave-sh
+
+# Append <testname>-slave.opt file to the list of argument used when
+# starting the mysqld
+#!use-slave-opt
+
+log-bin= slave-bin
+relay-log= slave-relay-bin
+
+init-rpl-role= slave
+log-slave-updates
+master-retry-count= 10
+
+# Values reported by slave when it connect to master
+# and shows up in SHOW SLAVE STATUS;
+report-host= 127.0.0.1
+report-port= @mysqld.2.port
+report-user= root
+
+skip-slave-start
+
+# Directory where slaves find the dumps generated by "load data"
+# on the server. The path need to have constant length otherwise
+# test results will vary, thus a relative path is used.
+slave-load-tmpdir= ../../tmp
+
+loose-innodb
+
+
+[ENV]
+MASTER_MYPORT= @mysqld.1.port
+MASTER_MYSOCK= @mysqld.1.socket
+
+SLAVE_MYPORT= @mysqld.2.port
+SLAVE_MYSOCK= @mysqld.2.socket
+
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index 8cae44a3607..f3f329c4b5b 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -10,3 +10,4 @@
#
##############################################################################
+rpl_binlog_corruption : BUG#41793 2008-12-30 sven rpl_binlog_corruption disabled in main (needs new mtr)
diff --git a/mysql-test/suite/rpl/t/rpl000017-slave.sh b/mysql-test/suite/rpl/t/rpl000017-slave.sh
index 17188aba0db..1d95798260a 100755
--- a/mysql-test/suite/rpl/t/rpl000017-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl000017-slave.sh
@@ -1,6 +1,6 @@
rm -f $MYSQLTEST_VARDIR/log/*relay*
-rm -f $MYSQLTEST_VARDIR/slave-data/relay-log.info
-cat > $MYSQLTEST_VARDIR/slave-data/master.info <<EOF
+rm -f $MYSQLTEST_VARDIR/mysqld.2/data/relay-log.info
+cat > $MYSQLTEST_VARDIR/mysqld.2/data/master.info <<EOF
master-bin.000001
4
127.0.0.1
diff --git a/mysql-test/suite/rpl/t/rpl000018-master.opt b/mysql-test/suite/rpl/t/rpl000018-master.opt
deleted file mode 100644
index ad2c6a647b5..00000000000
--- a/mysql-test/suite/rpl/t/rpl000018-master.opt
+++ /dev/null
@@ -1 +0,0 @@
--O max_binlog_size=4096
diff --git a/mysql-test/suite/rpl/t/rpl000018-slave.opt b/mysql-test/suite/rpl/t/rpl000018-slave.opt
deleted file mode 100644
index e854f0d0bb2..00000000000
--- a/mysql-test/suite/rpl/t/rpl000018-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---skip-slave-start --abort-slave-event-count=1
diff --git a/mysql-test/suite/rpl/t/rpl_000015.slave-mi b/mysql-test/suite/rpl/t/rpl_000015-slave.opt
index 28bc753dd56..28bc753dd56 100644
--- a/mysql-test/suite/rpl/t/rpl_000015.slave-mi
+++ b/mysql-test/suite/rpl/t/rpl_000015-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_000015.cnf b/mysql-test/suite/rpl/t/rpl_000015.cnf
new file mode 100644
index 00000000000..46f8af242c2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_000015.cnf
@@ -0,0 +1,2 @@
+!include ../rpl_1slave_base.cnf
+
diff --git a/mysql-test/suite/rpl/t/rpl_LD_INFILE.test b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
index bace5d4c1f5..ae647ed6648 100644
--- a/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
+++ b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
@@ -16,10 +16,10 @@ DROP TABLE IF EXISTS test.t1;
# Section 1 test
CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
-LOAD DATA INFILE '../std_data_ln/words2.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE a = 'abashed';
DELETE FROM test.t1;
-LOAD DATA INFILE '../std_data_ln/words2.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
SELECT * FROM test.t1 ORDER BY a DESC;
diff --git a/mysql-test/suite/rpl/t/rpl_alter_db.test b/mysql-test/suite/rpl/t/rpl_alter_db.test
index 5ac8a2f4018..341496350d7 100644
--- a/mysql-test/suite/rpl/t/rpl_alter_db.test
+++ b/mysql-test/suite/rpl/t/rpl_alter_db.test
@@ -1,10 +1,14 @@
source include/master-slave.inc;
-connection master;
-use mysql; # to be different from initial `test' db of mysqltest client
-alter database collate latin1_bin;
-save_master_pos;
-connection slave;
-sync_with_master;
+--echo ==== Verify that alter database does not stop replication ====
+create database temp_db;
+use temp_db; # to be different from initial `test' db of mysqltest client
+alter database collate latin1_bin;
+sync_slave_with_master;
+
+--echo ==== Clean up ====
+connection master;
+drop database temp_db;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
new file mode 100644
index 00000000000..815a8f81d32
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
@@ -0,0 +1 @@
+--replicate-same-server-id --relay-log=slave-relay-bin
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
new file mode 100644
index 00000000000..39799180f8b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
@@ -0,0 +1,42 @@
+# ==== Purpose ====
+#
+# Verify that the slave stops gracefully when reading a relay log with
+# corrupted data.
+#
+# ==== Implementation ====
+#
+# Setup "fake replication" where the slave only starts the SQL thread,
+# not the IO thread, and reads from an existing relay log that has
+# been prepared so that it contains the error. This requires some
+# extra server options: see the -master.opt file.
+#
+# ==== Related bugs ====
+#
+# BUG#31793: log event corruption causes crash
+# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
+
+source include/have_log_bin.inc;
+# BUG#40482 only manifested itself in debug-compiled binaries.
+source include/have_debug.inc;
+
+call mtr.add_suppression('Found invalid event in binary log');
+
+
+#
+# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
+#
+# The relay log contains an Incident_log_event with a non-existing
+# incident number.
+
+--echo ==== Initialize ====
+let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug40482-bin.000001;
+source include/setup_fake_relay_log.inc;
+
+--echo ==== Test ====
+START SLAVE SQL_THREAD;
+source include/wait_for_slave_sql_error.inc;
+let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+--echo Last_SQL_Error = $error
+
+--echo ==== Clean up ====
+source include/cleanup_fake_relay_log.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
index e95f69a3f99..31163927ce2 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
@@ -42,3 +42,4 @@ show grants for x@y;
show binlog events;
drop user x@y;
drop database d1;
+--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test b/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test
index d8e25b244fa..d56a32ce2bd 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test
@@ -16,8 +16,9 @@ reset master;
create table t1 (a int);
insert into t1 values (1);
+let $MYSQLD_DATADIR= `select @@datadir`;
flush logs;
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug36099.sql
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug36099.sql
drop table t1;
--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/bug36099.sql"
diff --git a/mysql-test/suite/rpl/t/rpl_blackhole.test b/mysql-test/suite/rpl/t/rpl_blackhole.test
index e8dfbd51552..6bf66422d62 100644
--- a/mysql-test/suite/rpl/t/rpl_blackhole.test
+++ b/mysql-test/suite/rpl/t/rpl_blackhole.test
@@ -78,3 +78,7 @@ source extra/rpl_tests/rpl_blackhole.test;
# Test delete, key
let $statement = DELETE FROM t1 WHERE a % 2 = 0 AND b = 3;
source extra/rpl_tests/rpl_blackhole.test;
+
+
+connection master;
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/rpl/t/rpl_bug26395.test b/mysql-test/suite/rpl/t/rpl_bug26395.test
new file mode 100644
index 00000000000..97c152d52e9
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_bug26395.test
@@ -0,0 +1,97 @@
+# ==== Purpose ====
+#
+# Tests that an autocommitted XA transaction where the master crashes
+# just before writing the XID log event is executed correctly. The
+# master rolls back, so the slave should not execute statement.
+#
+# This test was previously part of rpl_ndb_transaction.test
+#
+#
+# ==== Method ====
+#
+# We want master to be alive so that it can replicate the statement to
+# the slave. So in the test case, we must not crash the
+# master. Instead, we fake the crash by just not writing the XID event
+# to the binlog. This is done by the @@debug='d,do_not_write_xid'
+# flag. This, in turn, requires us to do 'source
+# include/have_debug.inc'
+#
+# So, unlike if the master had crashed, the master *will* execute the
+# statement. But the slave should not execute it. Hence, after the
+# test is executed, the expected result on master is a table with one
+# row, and on slave a table with no rows.
+#
+# To simulate the slave correctly, we wait until everything up to but
+# not including the XID is replicated. This has to be done with
+# include/sync_slave_io_with_master.inc, not sync_slave_with_master,
+# since the latter waits until the slave *SQL* thread has caught up
+# with the master's position, which it will never do.
+#
+#
+# ==== Related bugs ====
+#
+# BUG#26395: if crash during autocommit update to transactional table on master, slave fails
+
+source include/have_innodb.inc;
+# have_debug is needed since we use the @@debug variable on master
+source include/have_debug.inc;
+source include/master-slave.inc;
+
+
+--echo ==== Initialize ====
+
+--echo [on master]
+--connection master
+
+CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
+SHOW CREATE TABLE tinnodb;
+
+# do_not_write_xid stops the master from writing an XID event.
+set @old_debug= @@debug;
+set @@debug= 'd,do_not_write_xid';
+
+
+--echo ==== Test ====
+
+# Save the position up to which the slave SQL thread should execute.
+save_master_pos;
+
+# Execute query and check that the row made it to the table.
+INSERT INTO tinnodb VALUES (1);
+SELECT * FROM tinnodb ORDER BY a;
+
+# Sync slave's IO thread.
+--echo [on slave]
+source include/sync_slave_io_with_master.inc;
+
+# Sync slave's SQL thread.
+sync_with_master 0;
+
+
+--echo ==== Verify results on slave ====
+
+source include/stop_slave.inc;
+let $tmp= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1);
+eval SELECT "$tmp" AS Slave_IO_State;
+let $tmp= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+eval SELECT "$tmp" AS Last_SQL_Error;
+let $tmp= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1);
+eval SELECT "$tmp" AS Last_IO_Error;
+SELECT * FROM tinnodb ORDER BY a;
+
+
+--echo ==== Clean up ====
+
+# Easiest to clean up master and slave separately, without
+# replication, since master and slave are out of sync.
+
+--echo [on master]
+connection master;
+DROP TABLE tinnodb;
+set @@debug= @old_debug;
+
+--echo [on slave]
+connection slave;
+DROP TABLE tinnodb;
+
+# Warning: do not add more tests here. The binlog is in a bad state.
diff --git a/mysql-test/suite/rpl/t/rpl_bug33931-slave.opt b/mysql-test/suite/rpl/t/rpl_bug33931-slave.opt
deleted file mode 100644
index 55fe328a41d..00000000000
--- a/mysql-test/suite/rpl/t/rpl_bug33931-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init
diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test
index 788f79d4c1c..a439b346538 100644
--- a/mysql-test/suite/rpl/t/rpl_bug33931.test
+++ b/mysql-test/suite/rpl/t/rpl_bug33931.test
@@ -13,10 +13,18 @@ connection master;
reset master;
connection slave;
+
+# Add suppression for expected warnings in slaves error log
+call mtr.add_suppression("Failed during slave.*thread initialization");
+
--disable_warnings
stop slave;
--enable_warnings
reset slave;
+
+# Set debug flags on slave to force errors to occur
+SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
+
start slave;
connection master;
@@ -33,5 +41,8 @@ source include/wait_for_slave_to_stop.inc;
--replace_column 1 # 8 # 9 # 23 # 33 #
query_vertical show slave status;
-# no clean-up is needed
+#
+# Cleanup
+#
+SET GLOBAL debug="";
diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
new file mode 100644
index 00000000000..141aaa7788d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
@@ -0,0 +1,27 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-slave-updates
+innodb
+
+[mysqld.2]
+log-slave-updates
+innodb
+
+[mysqld.3]
+log-slave-updates
+innodb
+
+[mysqld.4]
+log-slave-updates
+innodb
+
+[ENV]
+SLAVE_MYPORT1= @mysqld.3.port
+SLAVE_MYSOCK1= @mysqld.3.socket
+
+SLAVE_MYPORT2= @mysqld.4.port
+SLAVE_MYSOCK2= @mysqld.4.socket
+
+
+
diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
new file mode 100644
index 00000000000..a49253f90c1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
@@ -0,0 +1,324 @@
+#############################################################
+# Author: Serge Kozlov <skozlov@mysql.com>
+# Date: 03/12/2008
+# Purpose: Testing circular replication based on schema
+# A->B->C->D->A with using AUTO_INCREMENT_INCREMENT,
+# AUTO_INCREMENT_OFFSET variables and failover
+#############################################################
+--source include/have_innodb.inc
+
+# Set up circular ring and new names for servers
+--echo *** Set up circular ring by schema A->B->C->D->A ***
+--source include/circular_rpl_for_4_hosts_init.inc
+--echo
+
+# Preparing data.
+--echo *** Preparing data ***
+--connection master_a
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB;
+--source include/circular_rpl_for_4_hosts_sync.inc
+--connection master_d
+--echo
+
+#
+# Testing
+#
+
+--echo *** Testing schema A->B->C->D->A ***
+--echo
+# insert data via all hosts
+--connection master_a
+INSERT INTO t1(b,c) VALUES('A',1);
+--sync_slave_with_master master_b
+INSERT INTO t1(b,c) VALUES('B',1);
+--sync_slave_with_master master_c
+INSERT INTO t1(b,c) VALUES('C',1);
+--sync_slave_with_master master_d
+INSERT INTO t1(b,c) VALUES('D',1);
+
+--source include/circular_rpl_for_4_hosts_sync.inc
+
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+--echo
+
+--echo *** Testing schema A->B->D->A if C has failure ***
+--echo
+--echo * Do failure for C and then make new connection B->D *
+# Do not replicate next event from C
+--connection master_d
+connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
+STOP SLAVE;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
+source include/start_slave.inc;
+disconnect slave;
+--connection master_c
+INSERT INTO t1 VALUES(6,'C',2);
+--save_master_pos
+--connection master_b
+INSERT INTO t1(b,c) VALUES('B',2);
+# Wait while C will stop.
+--connection master_c
+source include/wait_for_slave_sql_to_stop.inc;
+--connection master_a
+INSERT INTO t1(b,c) VALUES('A',2);
+--connection master_d
+INSERT INTO t1(b,c) VALUES('D',2);
+
+
+# Sync all servers except C
+--connection master_b
+let $wait_condition= SELECT COUNT(*)=3 FROM t1 WHERE a > 4;
+--source include/wait_condition.inc
+
+--echo
+--echo * Data on servers (C failed) *
+# Masters C,D shouldn't have correct data
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--echo
+
+--echo * Reconfigure replication to schema A->B->D->A *
+# Exclude Master C
+--connection master_c
+STOP SLAVE;
+--let $pos_c= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
+--let $file_c= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1)
+--connection master_d
+STOP SLAVE;
+--replace_result $SLAVE_MYPORT MASTER_B_PORT $file_c LOG_FILE $pos_c LOG_POS
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT,master_user='root',master_log_file='$file_c',master_log_pos=$pos_c
+connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
+source include/start_slave.inc;
+disconnect slave;
+--connection master_b
+--sync_slave_with_master master_d
+--sync_slave_with_master master_a
+--echo
+
+--echo * Check data inserted before failure *
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--echo
+
+--echo * Check data inserted after failure *
+--connection master_a
+INSERT INTO t1(b,c) VALUES('A',3);
+--connection master_b
+INSERT INTO t1(b,c) VALUES('B',3);
+--connection master_d
+INSERT INTO t1(b,c) VALUES('D',3);
+connection master_a;
+
+--sync_slave_with_master master_b
+--sync_slave_with_master master_d
+--sync_slave_with_master master_a
+--sync_slave_with_master master_b
+
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+--connection master_a
+--echo
+
+--echo *** Testing restoring scheme A->B->C->D->A after failure ***
+--echo
+# Master D will ignore a next event from C so that event will not be
+# distributed to other servers
+--echo * Remove wrong event from C and restore B->C->D *
+--connection master_d
+source include/stop_slave.inc;
+--connection master_c
+DELETE FROM t1 WHERE a = 6;
+START SLAVE;
+--connection master_b
+--sync_slave_with_master master_c
+RESET MASTER;
+--let $file_d= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $pos_d= query_get_value(SHOW MASTER STATUS, Position, 1)
+--connection master_d
+RESET SLAVE;
+--replace_result $SLAVE_MYPORT1 MASTER_C_PORT $file_d LOG_FILE $pos_d LOG_POS
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT1,master_user='root',master_log_file='$file_d',master_log_pos=$pos_d
+START SLAVE;
+--connection master_c
+--sync_slave_with_master master_d
+--source include/circular_rpl_for_4_hosts_sync.inc
+
+--echo
+--echo * Check data inserted before restoring schema A->B->C->D->A *
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+--sync_slave_with_master master_b
+SELECT 'Master B',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+--sync_slave_with_master master_c
+SELECT 'Master C',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+--sync_slave_with_master master_d
+SELECT 'Master D',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+--sync_slave_with_master master_a
+--echo
+
+--echo * Check data inserted after restoring schema A->B->C->D->A *
+--connection master_a
+INSERT INTO t1(b,c) VALUES('A',4);
+--connection master_b
+INSERT INTO t1(b,c) VALUES('B',4);
+--connection master_c
+INSERT INTO t1(b,c) VALUES('C',4);
+--connection master_d
+INSERT INTO t1(b,c) VALUES('D',4);
+--connection master_a
+
+--source include/circular_rpl_for_4_hosts_sync.inc
+
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+--connection master_a
+--echo
+
+--echo * Transactions with commits *
+# Testing mixing of transactions and regular inserts
+--connection master_a
+BEGIN;
+--connection master_c
+BEGIN;
+let $counter= 100;
+--connection master_a
+--disable_query_log
+while ($counter) {
+ --connection master_a
+ INSERT INTO t2(b,c) VALUES('A',1);
+ --connection master_b
+ INSERT INTO t2(b,c) VALUES('B',1);
+ --connection master_c
+ INSERT INTO t2(b,c) VALUES('C',1);
+ --connection master_d
+ INSERT INTO t2(b,c) VALUES('D',1);
+ dec $counter;
+}
+--connection master_a
+COMMIT;
+--connection master_c
+COMMIT;
+--connection master_a
+--enable_query_log
+
+
+--let $wait_condition= SELECT COUNT(*)=400 FROM t2 WHERE c = 1
+--connection master_a
+--source include/wait_condition.inc
+--connection master_b
+--source include/wait_condition.inc
+--connection master_c
+--source include/wait_condition.inc
+--connection master_d
+--source include/wait_condition.inc
+
+--connection master_a
+SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+--connection master_b
+SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+--connection master_c
+SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+--connection master_d
+SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+--connection master_a
+--echo
+
+--echo * Transactions with rollbacks *
+# Testing mixing of transactions with rollback and regular inserts
+--connection master_a
+BEGIN;
+--connection master_c
+BEGIN;
+let $counter= 100;
+--connection master_a
+--disable_query_log
+while ($counter) {
+ --connection master_a
+ INSERT INTO t2(b,c) VALUES('A',2);
+ --connection master_b
+ INSERT INTO t2(b,c) VALUES('B',2);
+ --connection master_c
+ INSERT INTO t2(b,c) VALUES('C',2);
+ --connection master_d
+ INSERT INTO t2(b,c) VALUES('D',2);
+ dec $counter;
+}
+--connection master_a
+ROLLBACK;
+--connection master_c
+ROLLBACK;
+--connection master_a
+--enable_query_log
+
+--let $wait_condition= SELECT COUNT(*)=200 FROM t2 WHERE c = 2
+--connection master_a
+--source include/wait_condition.inc
+--connection master_b
+--source include/wait_condition.inc
+--connection master_c
+--source include/wait_condition.inc
+--connection master_d
+--source include/wait_condition.inc
+
+--connection master_a
+SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+--connection master_b
+SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+--connection master_c
+SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+--connection master_d
+SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+--connection master_a
+
+--echo
+
+# Clean up
+--echo *** Clean up ***
+--connection master_a
+DROP TABLE t1,t2;
+--source include/circular_rpl_for_4_hosts_sync.inc
+
+--connection master_a
+STOP SLAVE;
+RESET SLAVE;
+--connection master_b
+STOP SLAVE;
+RESET SLAVE;
+--connection master_c
+STOP SLAVE;
+RESET SLAVE;
+--connection master_d
+STOP SLAVE;
+RESET SLAVE;
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
new file mode 100644
index 00000000000..0ea05290c11
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
@@ -0,0 +1 @@
+--replicate-same-server-id --relay-log=slave-relay-bin --secure-file-priv=$MYSQL_TMP_DIR
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version.test b/mysql-test/suite/rpl/t/rpl_cross_version.test
new file mode 100644
index 00000000000..adeba7f2b15
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_cross_version.test
@@ -0,0 +1,36 @@
+# ==== Purpose ====
+#
+# Verify cross-version replication from an old master to the up-to-date slave
+#
+# ==== Implementation ====
+#
+# Feed to the slave server a binlog recorded on an old version master
+# via setting up slave-to-slave replication. The latter is done by means of
+# the opt file and include/setup_fake_relay_log.inc.
+# The master's binlog is treated as a relay log that the SQL thread executes.
+#
+
+--source include/have_log_bin.inc
+--source include/not_windows.inc
+#
+# Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails
+#
+
+--echo ==== Initialize ====
+# the relay log contains create t1, t3 tables and load data infile
+--let $fake_relay_log = $MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001
+--source include/setup_fake_relay_log.inc
+
+--echo ==== Test ====
+start slave sql_thread;
+--let $slave_param = Exec_Master_Log_Pos
+# end_log_pos of the last event of the relay log
+--let $slave_param_value = 149436
+--source include/wait_for_slave_param.inc
+--echo ==== a prove that the fake has been processed successfully ====
+SELECT COUNT(*) - 17920 as zero FROM t3;
+
+--echo ==== Clean up ====
+stop slave sql_thread;
+--source include/cleanup_fake_relay_log.inc
+drop table t1, t3;
diff --git a/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
index c52c239a1a1..3819e7c3f7b 100644
--- a/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
@@ -1 +1 @@
---innodb --innodb_lock_wait_timeout=4 --slave-transaction-retries=2 --max-relay-log-size=4096
+--innodb_lock_wait_timeout=4 --slave-transaction-retries=2 --max-relay-log-size=4096
diff --git a/mysql-test/suite/rpl/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test
index 7f4a7843c4a..11e93e7307a 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_db.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db.test
@@ -47,15 +47,15 @@ use test;
select * from t1;
#cleanup
-connection slave;
-stop slave;
-drop database mysqltest1;
-
connection master;
+
# Remove the "extra" file created above
---remove_file $MYSQLTEST_VARDIR/master-data/mysqltest1/f1.txt
-drop database mysqltest1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/mysqltest1/f1.txt;
use test;
drop table t1;
+drop database mysqltest1;
+sync_slave_with_master;
+source include/stop_slave.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_drop_view.test b/mysql-test/suite/rpl/t/rpl_drop_view.test
index 8d826b8214d..11633a0a7e8 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_view.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_view.test
@@ -29,3 +29,8 @@ select * from v1;
select * from v2;
--error 1146
select * from v3;
+
+--echo ==== clean up ====
+connection master;
+drop table t1, t2, t3;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
index 7ab9064b7f6..9efb3d16d2b 100644
--- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
@@ -12,7 +12,8 @@ source include/have_innodb.inc;
# set up "dual head"
-let $keep_connection= 1;
+# Needed for debug info in wait_for_slave_sql_to_stop.
+let $master_connection= slave;
connection slave;
reset master;
diff --git a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
index e26e240b5ab..b9ab66165cc 100644
--- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
+++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
@@ -50,7 +50,7 @@ kill @id;
drop table t2,t3;
insert into t4 values (3),(4);
connection master;
---error 0,1053,2013,1048
+--error 0,1053,2013
reap;
connection master1;
save_master_pos;
diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test
index 2a9cf86fe55..d06a3118389 100644
--- a/mysql-test/suite/rpl/t/rpl_events.test
+++ b/mysql-test/suite/rpl/t/rpl_events.test
@@ -5,11 +5,12 @@
# in both row based and statement based format #
##################################################################
-set global event_scheduler=1;
-
--source include/not_embedded.inc
--source include/master-slave.inc
+SET @old_event_scheduler = @@global.event_scheduler;
+set global event_scheduler=1;
+
let $engine_type= MyISAM;
set binlog_format=row;
@@ -51,5 +52,6 @@ sync_slave_with_master;
# that there is no bad timing cauing it to try to access the table.
connection master;
+SET @@global.event_scheduler= @old_event_scheduler;
DROP TABLE t28953;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt
deleted file mode 100644
index 1338b6eba04..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
- --innodb
diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
index 274599857be..bf71ffbfd1e 100644
--- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
+++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
@@ -124,9 +124,11 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id
sync_slave_with_master;
connection master;
-# Parameter for include/wait_for_slave_sql_error_and_skip.inc, ask it
-# to show SQL error message
-let show_sql_error=1;
+# Parameters for include/wait_for_slave_sql_error_and_skip.inc:
+# Ask it to show SQL error message.
+let $show_sql_error= 1;
+# The expected error will always be 1146 (ER_NO_SUCH_TABLE).
+let $slave_sql_errno= 1146;
#
# Only do tables are referenced for update, these statements should
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
index a4d1d403dc9..95bca94fd3a 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
@@ -1 +1 @@
--O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/master-data/relay-log
+-O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.1/data/relay-log
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
index 95839c831c9..e2aa63225a3 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
@@ -1 +1 @@
--O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/slave-data/relay-log
+-O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.2/data/relay-log
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
index caead008169..a8befe612c2 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
@@ -2,7 +2,8 @@
# in case of bi-directional replication
-- source include/master-slave.inc
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/
show variables like 'relay_log%';
connection slave;
@@ -24,13 +25,8 @@ stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT;
-start slave;
-#
-# Wait for start of slave IO and SQL threads
-#
-let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%';
---source include/wait_slave_status.inc
+source include/start_slave.inc;
#
# Flush logs of slave
@@ -73,3 +69,9 @@ source include/wait_for_slave_param.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION
--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 #
--query_vertical SHOW SLAVE STATUS
+
+--disable_query_log
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+--enable_query_log
diff --git a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency-master.opt b/mysql-test/suite/rpl/t/rpl_idempotency-master.opt
deleted file mode 100644
index 66f581b56d0..00000000000
--- a/mysql-test/suite/rpl/t/rpl_idempotency-master.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---innodb
-
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt b/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt
index 71ccf047474..03fc19ca6ae 100644
--- a/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt
@@ -1,2 +1 @@
---slave-exec-mode=IDEMPOTENT --innodb
-
+--slave-exec-mode=IDEMPOTENT
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test
index cec91a6f4b7..1946aa100ab 100644
--- a/mysql-test/suite/rpl/t/rpl_idempotency.test
+++ b/mysql-test/suite/rpl/t/rpl_idempotency.test
@@ -7,6 +7,12 @@ source include/have_innodb.inc;
connection slave;
source include/have_innodb.inc;
+# Add suppression for expected warning(s) in slaves error log
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
+call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+
+SET @old_slave_exec_mode= @@global.slave_exec_mode;
+
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
@@ -203,9 +209,8 @@ select * from ti1 order by b /* must be (2),(3) */;
# foreign key: row is referenced
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -236,11 +241,10 @@ delete from ti1 where b=3;
connection master;
insert into ti2 set a=3, b=3 /* offending write event */;
---echo *** slave must stop
-
-source include/wait_for_slave_sql_to_stop.inc;
+--echo *** slave must stop
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -278,9 +282,8 @@ connection master;
insert into ti1 set b=1 /* offending write event */;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -314,9 +317,8 @@ connection master;
DELETE FROM t1 WHERE a = -2;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -333,9 +335,8 @@ set global slave_exec_mode='STRICT';
connection master;
DELETE FROM t2 WHERE a = -2;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -356,9 +357,8 @@ connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -377,9 +377,8 @@ connection master;
UPDATE t2 SET a = 1 WHERE a = -1;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -391,8 +390,7 @@ start slave sql_thread;
connection master;
sync_slave_with_master;
#connection slave;
-set global slave_exec_mode='STRICT';
-
+SET @@global.slave_exec_mode= @old_slave_exec_mode;
# cleanup for bug#31609 tests
@@ -400,16 +398,6 @@ connection master;
set @@session.binlog_format= @save_binlog_format;
drop table t1,t2,ti2,ti1;
-sync_slave_with_master;
-
+--source include/master-slave-end.inc
--echo *** end of tests
-
-
-
-
-
-
-
-
-
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test
index 7f13b16b0de..66f96e8f4e8 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_table.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test
@@ -127,7 +127,8 @@ show grants for mysqltest4@localhost;
set global slave_exec_mode='IDEMPOTENT';
connection master;
-drop table t1, t4, mysqltest2.t2;
+drop table t1, mysqltest2.t2;
+drop table t4;
drop database mysqltest2;
delete from mysql.user where user like "mysqltest%";
delete from mysql.db where user like "mysqltest%";
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index e99b88899bf..38fcc116736 100644
--- a/mysql-test/suite/rpl/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -14,7 +14,7 @@ REPLACE INTO t1 VALUES (4);
SELECT * FROM t1;
connection slave;
---wait_for_slave_to_stop
+source include/wait_for_slave_sql_to_stop.inc;
# The 4 should not be inserted into the table, since the incident log
# event should have stop the slave.
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave.test b/mysql-test/suite/rpl/t/rpl_init_slave.test
index 1511bd541ed..58d1f6bdc01 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave.test
@@ -7,33 +7,25 @@ source include/master-slave.inc;
set global max_connections=151;
connection slave;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
-start slave;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+source include/start_slave.inc;
connection master;
-save_master_pos;
-connection slave;
+sync_slave_with_master;
show variables like 'init_slave';
show variables like 'max_connections';
-sync_with_master;
reset master;
connection master;
show variables like 'init_slave';
show variables like 'max_connections';
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
# Save variable value
set @my_global_init_connect= @@global.init_connect;
set global init_connect="set @c=1";
show variables like 'init_connect';
connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
+sync_slave_with_master;
+source include/stop_slave.inc;
# Restore changed global variable
set global init_connect= @my_global_init_connect;
diff --git a/mysql-test/suite/rpl/t/rpl_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_innodb-master.opt
index 8636d2d8734..0eed7aaadad 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_innodb-master.opt
@@ -1 +1 @@
---innodb --innodb_autoinc_lock_mode=0
+--innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb.test b/mysql-test/suite/rpl/t/rpl_innodb.test
index 30d40e19614..64a85d27c88 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb.test
@@ -18,7 +18,7 @@ CREATE TABLE t4 (
--disable_warnings
LOAD DATA
- INFILE '../std_data_ln/loaddata_pair.dat'
+ INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
(name,number);
--enable_warnings
@@ -30,7 +30,7 @@ SELECT * FROM t4;
connection master;
--disable_warnings
LOAD DATA
- INFILE '../std_data_ln/loaddata_pair.dat'
+ INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
(name,number);
--enable_warnings
@@ -74,6 +74,17 @@ SET AUTOCOMMIT = 0;
sync_slave_with_master;
--echo -------- switch to slave --------
connection slave;
+
+# We want to verify that the following transactions are written to the
+# binlog, despite the transaction is rolled back. (The should be
+# written to the binlog since they contain non-transactional DROP
+# TEMPORARY TABLE). To see that, we use the auxiliary table t1, which
+# is transactional (InnoDB) on master and MyISAM on slave. t1 should
+# be transactional on master so that the insert into t1 does not cause
+# the transaction to be logged. Since t1 is non-transactional on
+# slave, the change will not be rolled back, so the inserted rows will
+# stay in t1 and we can verify that the transaction was replicated.
+ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
SHOW CREATE TABLE mysqltest1.t1;
--echo -------- switch to master --------
@@ -100,8 +111,7 @@ connection slave;
SHOW CREATE TABLE mysqltest1.tmp;
--error ER_NO_SUCH_TABLE
SHOW CREATE TABLE mysqltest1.tmp2;
-# has two rows here : as the default is MyISAM and
-# it can't be rolled back by the master's ROLLBACK.
+# t1 has two rows here: the transaction not rolled back since t1 uses MyISAM
SELECT COUNT(*) FROM mysqltest1.t1;
FLUSH LOGS;
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt
index 8636d2d8734..0eed7aaadad 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt
@@ -1 +1 @@
---innodb --innodb_autoinc_lock_mode=0
+--innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt
index 8636d2d8734..0eed7aaadad 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt
@@ -1 +1 @@
---innodb --innodb_autoinc_lock_mode=0
+--innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test
index 00e814951d5..d304dfb6cc7 100644
--- a/mysql-test/suite/rpl/t/rpl_insert.test
+++ b/mysql-test/suite/rpl/t/rpl_insert.test
@@ -13,6 +13,9 @@ USE mysqlslap;
CREATE TABLE t1 (id INT, name VARCHAR(64));
+sync_slave_with_master;
+connection master;
+
let $query = "INSERT DELAYED INTO t1 VALUES (1, 'Dr. No'), (2, 'From Russia With Love'), (3, 'Goldfinger'), (4, 'Thunderball'), (5, 'You Only Live Twice')";
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=200 --query=$query --delimiter=";"
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_load_from_master.test b/mysql-test/suite/rpl/t/rpl_load_from_master.test
index b04d8a44226..0f085457817 100644
--- a/mysql-test/suite/rpl/t/rpl_load_from_master.test
+++ b/mysql-test/suite/rpl/t/rpl_load_from_master.test
@@ -144,10 +144,11 @@ select * from mysqltest.t1;
# DISABLED FOR NOW AS chmod IS NOT PORTABLE ON NON-UNIX
# insert into mysqltest.t1 values(10, 'should be there');
# flush tables;
-# system chmod 500 $MYSQLTEST_VARDIR/slave-data/mysqltest/;
+let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
+# system chmod 500 $MYSQLD_SLAVE_DATADIR/mysqltest/;
# --error 6
# load data from master; # should fail (errno 13)
-# system chmod 700 $MYSQLTEST_VARDIR/slave-data/mysqltest/;
+# system chmod 700 $MYSQLD_SLAVE_DATADIR/mysqltest/;
# select * from mysqltest.t1; # should contain the row (10, ...)
diff --git a/mysql-test/suite/rpl/t/rpl_load_table_from_master.test b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
index b9cec3858a9..aad113878d3 100644
--- a/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
+++ b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
@@ -71,9 +71,9 @@ sync_with_master;
connection master;
set SQL_LOG_BIN=0;
create table t1 (word char(20) not null, index(word))ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
create table t2 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
create table t3 (word char(20) not null primary key)ENGINE=MyISAM;
connection slave;
load table t1 from master;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
index 7f2389cb9f6..c191d29d5a3 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
@@ -9,17 +9,17 @@ source include/master-slave.inc;
#
connection master;
create table t1 (a varchar(10) character set utf8);
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=DEFAULT;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=DEFAULT;
-load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8r;
+load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r;
select hex(a) from t1;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
index dceee7a65af..b7d9995c834 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
@@ -13,7 +13,7 @@ source include/show_slave_status.inc;
# Now we feed it a load data infile, which should make it stop with a
# fatal error.
connection master;
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
connection slave;
wait_for_slave_to_stop;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
index 537d4c163ef..42c3ad99f33 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_m.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
@@ -17,14 +17,14 @@ connection master;
# 'test' database should be ignored by the slave
USE test;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE test.t1;
SELECT COUNT(*) FROM test.t1;
# 'mysqltest' database should NOT be ignored by the slave
CREATE DATABASE mysqltest;
USE mysqltest;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
SELECT COUNT(*) FROM mysqltest.t1;
# Now lets check the slave to see what we have :-)
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_s.test b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
index f397d741310..2dd2218eb5c 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_s.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
@@ -12,7 +12,7 @@ reset master;
connection master;
# 'test' is the current database
create table test.t1(a int, b int, unique(b));
-load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
# Test logging on slave;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_simple.test b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
index 9e908cac677..439c2b48ca5 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
@@ -1,7 +1,7 @@
--source include/master-slave.inc
CREATE TABLE t1 (word CHAR(20) NOT NULL);
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
index b10603e7195..0de402f301a 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
@@ -19,13 +19,14 @@ while ($1)
}
set SQL_LOG_BIN=1;
enable_query_log;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
#This will generate a 20KB file, now test LOAD DATA LOCAL
truncate table t1;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
save_master_pos;
connection slave;
sync_with_master;
@@ -46,13 +47,13 @@ sync_with_master;
connection master;
create table t1(a int);
insert into t1 values (1), (2), (2), (3);
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key);
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
SELECT * FROM t1 ORDER BY a;
save_master_pos;
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index 532db77c248..5aa4da41fe5 100644
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
@@ -24,12 +24,12 @@ DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
INSERT INTO test.t1 VALUES(1,'test');
-UPDATE test.t1 SET blob_column=LOAD_FILE('../std_data_ln/words2.dat') WHERE a=1;
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
delimiter |;
create procedure test.p1()
begin
INSERT INTO test.t1 VALUES(2,'test');
- UPDATE test.t1 SET blob_column=LOAD_FILE('../std_data_ln/words2.dat') WHERE a=2;
+ UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
end|
delimiter ;|
diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test
index 45a097b6f14..5e8390f97ed 100644
--- a/mysql-test/suite/rpl/t/rpl_log_pos.test
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test
@@ -13,20 +13,14 @@
source include/master-slave.inc;
source include/show_master_status.inc;
sync_slave_with_master;
-stop slave;
---source include/wait_for_slave_to_stop.inc
+source include/stop_slave.inc;
change master to master_log_pos=75;
source include/show_slave_status2.inc;
start slave;
-let $slave_param= Slave_SQL_Running;
-let $slave_param_value= Yes;
---source include/wait_for_slave_param.inc
-let $slave_param= Slave_IO_Running;
-let $slave_param_value= No;
---source include/wait_for_slave_param.inc
-stop slave;
---source include/wait_for_slave_to_stop.inc
+source include/wait_for_slave_sql_to_start.inc;
+source include/wait_for_slave_io_to_stop.inc;
+source include/stop_slave.inc;
source include/show_slave_status.inc;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test
index 4a47e9645f9..d2e61d579e3 100644
--- a/mysql-test/suite/rpl/t/rpl_misc_functions.test
+++ b/mysql-test/suite/rpl/t/rpl_misc_functions.test
@@ -21,11 +21,12 @@ insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
# "altogether now"
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
select * into outfile 'rpl_misc_functions.outfile' from t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
sync_slave_with_master;
-create table t2 like t1;
+create temporary table t2 like t1;
# read the values from the master table
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/test/rpl_misc_functions.outfile' into table t2;
# compare them with the replica; the SELECT below should return no row
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
@@ -81,12 +82,12 @@ INSERT INTO t1 (col_a) VALUES (test_replication_sf());
--sync_slave_with_master
# Dump table on slave
-select * from t1 into outfile "../tmp/t1_slave.txt";
+select * from t1 into outfile "../../tmp/t1_slave.txt";
# Load data from slave into temp table on master
connection master;
create temporary table t1_slave select * from t1 where 1=0;
-load data infile '../tmp/t1_slave.txt' into table t1_slave;
+load data infile '../../tmp/t1_slave.txt' into table t1_slave;
--remove_file $MYSQLTEST_VARDIR/tmp/t1_slave.txt
# Compare master and slave temp table, use subtraction
@@ -109,7 +110,7 @@ DROP TABLE t1, t1_slave;
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
---remove_file $MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile
+--remove_file $MYSQLD_DATADIR/test/rpl_misc_functions.outfile
--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_multi_engine.test b/mysql-test/suite/rpl/t/rpl_multi_engine.test
index 10780c765f7..31c4a2050d7 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_engine.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_engine.test
@@ -12,16 +12,14 @@ connection slave;
connection master;
-- source include/have_innodb.inc
--disable_warnings
-create database if not exists mysqltest1;
-use mysqltest1;
drop table if exists t1;
+--enable_warnings
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc
VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT
0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
sync_slave_with_master;
-use mysqltest1;
# MyISAM to MyISAM then InnoDB then MEMORY
@@ -101,8 +99,6 @@ show create table t1;
# cleanup
connection master;
DROP TABLE t1;
-# Need to drop mysqltest1 as well so other test will pass.
-DROP DATABASE mysqltest1;
sync_slave_with_master;
# End of 5.1 test case
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 1bde61aef78..79cb2d9d735 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -13,15 +13,15 @@ enable_warnings;
eval create database $db;
connection master;
+let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
+let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
# Restart slave for setting to take effect
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+source include/start_slave.inc;
# Reconnect to master for new setting to take effect
disconnect master;
@@ -65,26 +65,35 @@ SET @@global.net_buffer_length=4096;
# Restart slave for new setting to take effect
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+source include/start_slave.inc;
# Reconnect to master for new setting to take effect
disconnect master;
connect (master, localhost, root);
connection master;
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+sync_slave_with_master;
+
+connection master;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
# The slave I/O thread must stop after trying to read the above event
connection slave;
---source include/wait_for_slave_io_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_MYPORT
-# import is only the 11th column Slave_IO_Running
---replace_column 1 # 7 # 8 # 9 # 12 # 22 # 23 # 33 #
-query_vertical show slave status;
+--source include/wait_for_slave_io_to_stop.inc
+let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
+--echo Slave_IO_Running = $slave_io_running (expect No)
+
+--echo ==== clean up ====
+connection master;
+DROP TABLE t1;
+eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
+eval SET @@global.net_buffer_length= $old_net_buffer_length;
+# slave is stopped
+connection slave;
+DROP TABLE t1;
# End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test
index 27f1ac3348d..b00dec6b80c 100644
--- a/mysql-test/suite/rpl/t/rpl_ps.test
+++ b/mysql-test/suite/rpl/t/rpl_ps.test
@@ -123,7 +123,7 @@ DROP DATABASE mysqltest1;
--echo
use test;
-
+DROP TABLE t1;
--echo
--save_master_pos
diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
index 72ae6a99c44..8863c9d4ac7 100644
--- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
@@ -5,6 +5,8 @@
# Test that the slave temporarily switches to ROW when seeing binrow
# events when it is in STATEMENT or MIXED mode
+SET @old_binlog_format= @@global.binlog_format;
+
SET BINLOG_FORMAT=MIXED;
SET GLOBAL BINLOG_FORMAT=MIXED;
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
@@ -33,6 +35,7 @@ SHOW BINLOG EVENTS;
connection master;
DROP TABLE IF EXISTS t1;
+SET @@global.binlog_format= @old_binlog_format;
# Let's compare. Note: If they match test will pass, if they do not match
# the test will show that the diff statement failed and not reject file
diff --git a/mysql-test/suite/rpl/t/rpl_read_only-slave.opt b/mysql-test/suite/rpl/t/rpl_read_only-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_read_only-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
index cf4319f2b40..e5b24dd9413 100644
--- a/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
@@ -1,3 +1,2 @@
-O max_relay_log_size=16384
---loose-innodb
--log-warnings
diff --git a/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test
index 90f00764691..fea168ee9f1 100644
--- a/mysql-test/suite/rpl/t/rpl_replicate_do.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test
@@ -11,7 +11,7 @@ create table t2 (n int);
insert into t2 values(4);
connection master;
create table t2 (s char(20));
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
insert into t2 values('five');
create table t1 (m int);
insert into t1 values(15),(16),(17);
diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
index 52f04e073dd..4dfe2edaf35 100644
--- a/mysql-test/suite/rpl/t/rpl_rewrt_db.test
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
@@ -34,8 +34,8 @@ create database rewrite;
connection master;
use test;
create table t1 (a date, b date, c date not null, d date);
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
sync_slave_with_master;
connection slave;
@@ -43,7 +43,7 @@ select * from rewrite.t1;
connection master;
truncate table t1;
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
sync_slave_with_master;
connection slave;
@@ -52,7 +52,7 @@ select * from rewrite.t1;
connection master;
drop table t1;
create table t1 (a text, b text);
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
sync_slave_with_master;
connection slave;
@@ -61,7 +61,7 @@ select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
connection master;
drop table t1;
create table t1 (a int, b char(10));
-load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
sync_slave_with_master;
connection slave;
@@ -69,7 +69,7 @@ select * from rewrite.t1;
connection master;
truncate table t1;
-load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
sync_slave_with_master;
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt b/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt
deleted file mode 100644
index ad2c6a647b5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt
+++ /dev/null
@@ -1 +0,0 @@
--O max_binlog_size=4096
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt
index 80190bf6d29..80190bf6d29 100644
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.cnf b/mysql-test/suite/rpl/t/rpl_rotate_logs.cnf
new file mode 100644
index 00000000000..7e676dc2da8
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.cnf
@@ -0,0 +1,6 @@
+!include ../rpl_1slave_base.cnf
+
+[mysqld.1]
+max_binlog_size=4096
+
+
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
index 9133c429934..2bad7b27272 100644
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
@@ -23,9 +23,10 @@ drop table if exists t1, t2, t3, t4;
--enable_warnings
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
# Create empty file
-write_file $MYSQLTEST_VARDIR/slave-data/master.info;
+let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
+write_file $MYSQLD_SLAVE_DATADIR/master.info;
EOF
-chmod 0000 $MYSQLTEST_VARDIR/slave-data/master.info;
+chmod 0000 $MYSQLD_SLAVE_DATADIR/master.info;
connection slave;
--disable_warnings
drop table if exists t1, t2, t3, t4;
@@ -36,7 +37,7 @@ drop table if exists t1, t2, t3, t4;
--replace_result $MYSQL_TEST_DIR TESTDIR
--error 1105,1105,29
start slave;
-chmod 0600 $MYSQLTEST_VARDIR/slave-data/master.info;
+chmod 0600 $MYSQLD_SLAVE_DATADIR/master.info;
# It will fail again because the file is empty so the slave cannot get valuable
# info about how to connect to the master from it (failure in
# init_strvar_from_file() in init_master_info()).
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
index ed7656c1f99..de86b63f230 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
@@ -1,2 +1,2 @@
---binlog_ignore_db=test_ignore --loose-innodb
+--binlog_ignore_db=test_ignore
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_conflicts.test b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
new file mode 100644
index 00000000000..59757e2e802
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
@@ -0,0 +1,31 @@
+# See the top of mysql-test/extra/rpl_tests/rpl_conflicts.test for
+# explanation of what this test does.
+#
+# This test file is for row-logging mode. It runs the test twice, with
+# slave_exec_mode=STRICT and slave_exec_mode=IDEMPOTENT, respectively.
+
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+connection slave;
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*");
+
+--echo [on slave]
+connection slave;
+SET @old_slave_exec_mode= @@global.slave_exec_mode;
+
+
+--echo ######## Run with slave_exec_mode=STRICT ########
+
+SET @@global.slave_exec_mode = 'STRICT';
+source extra/rpl_tests/rpl_conflicts.test;
+
+
+--echo ######## Run with slave_exec_mode=IDEMPOTENT ########
+
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+source extra/rpl_tests/rpl_conflicts.test;
+
+
+SET @@global.slave_exec_mode= @old_slave_exec_mode;
+source include/master-slave-end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt b/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
index 3fb5aa8e1f2..319f9546a81 100644
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -29,6 +29,8 @@ SET GLOBAL storage_engine=memory;
START SLAVE;
--enable_query_log
+--source include/reset_master_and_slave.inc
+
connection master;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
@@ -36,7 +38,7 @@ CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---query_vertical SHOW BINLOG EVENTS FROM 216
+--query_vertical SHOW BINLOG EVENTS FROM 106
--echo **** On Master ****
--query_vertical SHOW CREATE TABLE t1
--query_vertical SHOW CREATE TABLE t2
@@ -65,6 +67,8 @@ SELECT * FROM t5 ORDER BY a,b,c;
--query_vertical SHOW CREATE TABLE t6
SELECT * FROM t6 ORDER BY a,b,c;
+--source include/reset_master_and_slave.inc
+
connection master;
# Test for erroneous constructions
--error ER_DUP_ENTRY
@@ -72,7 +76,7 @@ CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
# Shouldn't be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
# Test that INSERT-SELECT works the same way as for SBR.
CREATE TABLE t7 (a INT, b INT UNIQUE);
@@ -82,10 +86,12 @@ SELECT * FROM t7 ORDER BY a,b;
# Should be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
+--source include/reset_master_and_slave.inc
+
connection master;
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
@@ -94,11 +100,13 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1711;
+SHOW BINLOG EVENTS FROM 106;
SELECT * FROM t7 ORDER BY a,b;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
+--source include/reset_master_and_slave.inc
+
connection master;
CREATE TABLE t8 LIKE t4;
CREATE TABLE t9 LIKE tt4;
@@ -110,7 +118,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1;
--query_vertical SHOW CREATE TABLE t9
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1946;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
--echo **** On Slave ****
--query_vertical SHOW CREATE TABLE t8
@@ -162,7 +170,7 @@ SELECT * FROM t3 ORDER BY a;
SELECT * FROM t4 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SHOW TABLES;
SELECT TABLE_NAME,ENGINE
@@ -208,13 +216,17 @@ COMMIT;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;
connection master;
TRUNCATE TABLE t2;
+sync_slave_with_master;
+--source include/reset_master_and_slave.inc
+
+connection master;
BEGIN;
INSERT INTO t2 SELECT a*a FROM t1;
CREATE TEMPORARY TABLE tt2
@@ -227,7 +239,7 @@ ROLLBACK;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 949;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;
@@ -266,6 +278,9 @@ sync_slave_with_master;
source include/master-slave-reset.inc;
connection master;
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+--enable_warnings
CREATE DATABASE mysqltest1;
CREATE TABLE mysqltest1.without_select (f1 BIGINT);
diff --git a/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt
deleted file mode 100644
index abd717f8222..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-ignore-table=test.t2
diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
index 25a8c0e744e..0c038c41ebf 100644
--- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
@@ -1,33 +1,42 @@
-# Test to see what slave says when master is updating a table it does
-# not have
+# ==== Purpose ====
+#
+# Verify that slave gives an error message if master updates a table
+# that slave does not have.
+#
+# ==== Method ====
+#
+# Create a table on master, wait till it's on slave, remove it from
+# slave. Then update the table on master.
+
--source include/have_binlog_format_row.inc
source include/master-slave.inc;
-connection master;
-create table t1 (a int not null primary key);
-insert into t1 values (1);
-create table t2 (a int);
-insert into t2 values (1);
-update t1, t2 set t1.a = 0 where t1.a = t2.a;
+--echo ==== Setup table on master but not on slave ====
+--echo [on master]
+CREATE TABLE t1 (a INT);
+--echo [on slave]
sync_slave_with_master;
-# t2 should not have been replicated
-# t1 should have been properly updated
-show tables;
-select * from t1;
-drop table t1;
+DROP TABLE t1;
+--echo ==== Modify table on master ====
+--echo [on master]
connection master;
-insert into t1 values (1);
+INSERT INTO t1 VALUES (1);
+--echo ==== Verify error on slave ====
+--echo [on slave]
connection slave;
# slave should have stopped because can't find table t1
--source include/wait_for_slave_sql_to_stop.inc
# see if we have a good error message:
---replace_column 7 #
-source include/show_slave_status.inc;
+let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+--echo Last_SQL_Error = $err
+
+--echo ==== Clean up ====
+source include/stop_slave.inc;
-# cleanup
+--echo [on master]
connection master;
-drop table t1, t2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
index a0be59e44a7..ea4b958ae4c 100644
--- a/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
@@ -4,8 +4,7 @@
# Test of manual relay log rotation with FLUSH LOGS.
# Requires statement logging
--- source include/not_ndb_default.inc
-SET SESSION BINLOG_FORMAT=ROW;
-SET GLOBAL BINLOG_FORMAT=ROW;
--- source extra/rpl_tests/rpl_max_relay_size.test
+source include/not_ndb_default.inc;
+source include/have_binlog_format_row.inc;
+source extra/rpl_tests/rpl_max_relay_size.test;
diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
index 192c1e325bf..62b46eeb58e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
@@ -37,11 +37,11 @@ CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT,
--disable_query_log
INSERT INTO t1 VALUES ("abirvalg");
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
# d1 length 3000
set @d1 = 'dd1';
@@ -96,10 +96,10 @@ select "--- Test 1 Dump binlog to file --" as "";
#
# Prepare local temporary file to recreate what we have currently.
+let $MYSQLD_DATADIR= `select @@datadir;`;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master.sql
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master.sql
-
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/master.sql
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/master.sql
# Now that we have our file, lets get rid of the current database.
# Cleanup the master and the slave and try to recreate.
@@ -160,7 +160,7 @@ connection master;
# We should be gold by the time, so I will get rid of our file.
---exec rm $MYSQLTEST_VARDIR/tmp/master.sql
+remove_file $MYSQLTEST_VARDIR/tmp/master.sql;
# this test for position option
@@ -168,8 +168,9 @@ connection master;
--disable_query_log
select "--- Test 2 position test --" as "";
--enable_query_log
+let $MYSQLD_DATADIR= `select @@datadir;`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=416 --stop-position=569 $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=416 --stop-position=569 $MYSQLD_DATADIR/master-bin.000001
# These are tests for remote binlog.
# They should return the same as previous test.
@@ -263,14 +264,15 @@ select "--- Test 5 LOAD DATA --" as "";
--disable_query_log
select "--- Test 6 reading stdin --" as "";
--enable_query_log
+let $MYSQLD_DATADIR= `select @@datadir;`;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --stop-position=569 - < $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- Test 7 reading stdin w/position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --position=416 --stop-position=569 - < $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --position=416 --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001
# Bug#16217 (mysql client did not know how not switch its internal charset)
--disable_query_log
@@ -299,9 +301,10 @@ create table t4 (f text character set utf8);
create table t5 (f text character set cp932);
--exec $MYSQL --default-character-set=utf8 test -e "insert into t4 values(_utf8'ソ')"
--exec $MYSQL --default-character-set=cp932 test -e "insert into t5 values(_cp932'ƒ\');"
+let $MYSQLD_DATADIR= `select @@datadir;`;
flush logs;
rename table t4 to t04, t5 to t05;
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 | $MYSQL --default-character-set=utf8
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL --default-character-set=utf8
# original and recovered data must be equal
select HEX(f) from t04;
select HEX(f) from t4;
@@ -337,10 +340,12 @@ INSERT INTO t1 VALUES(1,1);
SELECT * FROM t1;
+let $MYSQLD_DATADIR= `select @@datadir;`;
+
FLUSH LOGS;
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/remote.sql
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/local.sql
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/local.sql
--diff_files $MYSQLTEST_VARDIR/tmp/local.sql $MYSQLTEST_VARDIR/tmp/remote.sql
diff --git a/mysql-test/suite/rpl/t/rpl_row_mystery22.test b/mysql-test/suite/rpl/t/rpl_row_mystery22.test
deleted file mode 100644
index a3ba8648b22..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_mystery22.test
+++ /dev/null
@@ -1,52 +0,0 @@
-# Originally taken from rpl_mystery22.test,
-# but this row-based-replication test has a totally different spirit:
-# slave will not stop because of dup key,
-# instead we test if it does overwrite the dup key
-# as expected.
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-
-# first, cause a duplicate key problem on the slave
-create table t1(n int auto_increment primary key, s char(10));
-sync_slave_with_master;
-
-# bug#31552/31609 idempotency is not default any longer
-# so that the declared in heading comments aim of the test
-# should be backed up with explicit setting of the slave mode
-set @@global.slave_exec_mode= 'IDEMPOTENT';
-
-insert into t1 values (2,'old');
-connection master;
-insert into t1 values(NULL,'new');
-insert into t1 values(NULL,'new');
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t1 order by n;
-delete from t1 where n = 2;
---disable_warnings
-start slave;
---enable_warnings
-sync_with_master;
-stop slave;
-connection master;
-create table t2(n int);
-drop table t2;
-insert into t1 values(NULL,'new');
-# what happens when we delete a row which does not exist on slave?
-set sql_log_bin=0;
-insert into t1 values(NULL,'new');
-set sql_log_bin=1;
-delete from t1 where n=4;
-save_master_pos;
-connection slave;
---disable_warnings
-start slave;
---enable_warnings
-sync_with_master;
-select * from t1 order by n;
-#clean up
-connection master;
-drop table t1;
-sync_slave_with_master;
-set @@global.slave_exec_mode= default;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test
index b118242dc3b..f5a74325b7c 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp005.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test
@@ -84,6 +84,7 @@ let $message=< ---- Master selects-- >;
--source include/show_msg.inc
connection master;
CALL test.p1();
+
let $wait_condition= SELECT COUNT(*) = 4 FROM t3;
--source include/wait_condition.inc
save_master_pos;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
index 29b3008e822..9b24c78e62d 100644
--- a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
@@ -9,18 +9,18 @@
connection master;
create table t1 (words varchar(20)) engine=myisam;
-load data infile '../std_data_ln/words.dat' into table t1 (words);
+load data infile '../../std_data/words.dat' into table t1 (words);
select count(*) from t1;
save_master_pos;
connection slave;
-# slave will automatically tell itself to stop thanks to the .opt
+# slave will automatically stop the sql thread thanks to the .opt
# file; it will initiate the stop request after the first
# Rows_log_event (out of 3) but should wait until the last one is
# executed before stopping.
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
# check that we inserted all rows (waited until the last Rows event)
select count(*) from t1;
@@ -28,4 +28,5 @@ select count(*) from t1;
connection master;
drop table t1;
connection slave; # slave SQL thread is stopped
+source include/stop_slave.inc;
drop table t1;
diff --git a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
index bdf7351d9a5..d89de7d9ebd 100644
--- a/mysql-test/suite/rpl/t/rpl_row_until.test
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
@@ -9,12 +9,8 @@ let $VERSION=`select version()`;
# stop slave before he will start replication also sync with master
# for avoiding undetermenistic behaviour
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+sync_slave_with_master;
+--source include/stop_slave.inc
connection master;
# create some events on master
@@ -53,12 +49,13 @@ connection master;
save_master_pos;
connection slave;
sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+--source include/stop_slave.inc
# this should stop immediately as we are already there
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
+start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740;
+--let $slave_param= Until_Log_Pos
+--let $slave_param_value= 740
+--source include/wait_for_slave_param.inc
--source include/wait_for_slave_sql_to_stop.inc
# here the sql slave thread should be stopped
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
@@ -76,5 +73,5 @@ start slave until relay_log_file='slave-relay-bin.000002';
--error 1277
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
# Warning should be given for second command
-start slave sql_thread;
+start slave;
start slave until master_log_file='master-bin.000001', master_log_pos=740;
diff --git a/mysql-test/suite/rpl/t/rpl_server_id1.test b/mysql-test/suite/rpl/t/rpl_server_id1.test
index a0467d93543..c97f7975278 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id1.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id1.test
@@ -9,7 +9,7 @@ connection slave;
reset master;
# replicate ourselves
-stop slave;
+source include/stop_slave.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT;
start slave;
diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test
index 7e67fb42b4f..488a3aa6ab6 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id2.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id2.test
@@ -9,9 +9,6 @@ reset master;
stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT;
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 18 # 35 # 36 #
-query_vertical show slave status;
start slave;
insert into t1 values (1);
save_master_pos;
@@ -23,4 +20,44 @@ select * from t1; # check that indeed 2 were inserted
stop slave;
drop table t1;
-# End of 4.1 tests
+
+#
+# Bug#38934 slave slave until does not work with --replicate-same-server-id
+#
+# Verifying that slave performs all events until the master_log_pos
+# in presense of --replicate-same-server-id the slave is started with.
+
+connection master;
+reset master;
+
+# setting the until position to correspond to the first following create table
+# which will make the event executed and the slave sql thread stopped
+# right after that.
+let $until_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+inc $until_pos;
+
+create table t1(n int);
+create table t2(n int);
+
+connection slave;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_port=$MASTER_MYPORT;
+--replace_result $until_pos UNTIL_POS
+eval start slave until master_log_file='master-bin.000001', master_log_pos=$until_pos;
+--source include/wait_for_slave_io_to_start.inc
+--source include/wait_for_slave_sql_to_stop.inc
+
+--echo *** checking until postion execution: must be only t1 in the list ***
+show tables;
+
+# cleanup
+
+connection slave;
+start slave sql_thread;
+
+connection master;
+drop table t1;
+drop table t2;
+sync_slave_with_master;
+
+# End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
new file mode 100644
index 00000000000..1a0ff8d52f0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
@@ -0,0 +1,176 @@
+#############################################################
+# Author: Serge Kozlov <skozlov@mysql.com>
+# Date: 03/21/2008
+# Purpose:
+# WL#3734 Test: slave group execution
+# Testing slave group execution: stop in middle of the group
+# (of events) should be immpossible on slave.
+# Group of events means set of statements between BEGIN/COMMIT
+# for transactional engines or a statement for
+# non-transactional engines that fires triggers and
+# affects to another tables.
+# Implementation of slave stop in middle of the group:
+# Delete the table on slave before start of the group
+# on master where this table is participant of the group.
+# So sql thread will failed inside of the group.
+# Expected results:
+# 1. For non-transactional engines w/o PK slave should trying
+# to complete executing of the group.
+# 2. For non-transactional engines slave should stop on
+# start position of the group.
+#############################################################
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--echo
+
+# Create tables and data
+--echo *** Preparing data ***
+--connection master
+CREATE TABLE t1 (a INT NOT NULL, b VARCHAR(10)) ENGINE=MyISAM;
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+
+DELIMITER |;
+CREATE TRIGGER tr1 BEFORE UPDATE ON t1
+ FOR EACH ROW BEGIN
+ UPDATE t2 SET b='YY' WHERE a=NEW.a;
+ END|
+CREATE TRIGGER tr2 AFTER UPDATE ON t1
+ FOR EACH ROW BEGIN
+ UPDATE t3 SET b='ZZ' WHERE a=NEW.a;
+ END|
+DELIMITER ;|
+--echo
+
+# Test non-transactional group with MyISAM tables w/o PK.
+# Data for t1,t2 should be replicated for SBR even t3
+# doesn't exist on slave
+--echo *** Test non-transactional group w/o PK ***
+
+--connection master
+INSERT INTO t3 VALUES(1, 'AA');
+INSERT INTO t2 VALUES(1, 'AA');
+INSERT INTO t1 VALUES(1, 'AA');
+--sync_slave_with_master
+
+RENAME TABLE t3 TO t3_bak;
+
+--connection master
+UPDATE t1 SET b = 'XX' WHERE a = 1;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+
+--connection slave
+--source include/wait_for_slave_sql_to_stop.inc
+SHOW TABLES LIKE 't%';
+if (`SELECT @@BINLOG_FORMAT = 'ROW'`) {
+--replace_regex /AA/AA_for_row_or_XX_for_stmt_mixed/
+ SELECT * FROM t1 ORDER BY a;
+--replace_regex /AA/AA_for_row_or_YY_for_stmt_mixed/
+ SELECT * FROM t2 ORDER BY a;
+}
+if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) {
+--replace_regex /XX/AA_for_row_or_XX_for_stmt_mixed/
+ SELECT * FROM t1 ORDER BY a;
+--replace_regex /YY/AA_for_row_or_YY_for_stmt_mixed/
+ SELECT * FROM t2 ORDER BY a;
+}
+
+--source include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+--source include/start_slave.inc
+
+--connection master
+TRUNCATE t1;
+TRUNCATE t2;
+TRUNCATE t3;
+--sync_slave_with_master
+--echo
+
+
+# Test non-transactional group with MyISAM tables and PK.
+# No data replicated because update based on PK
+--echo *** Test non-transactional group w/ PK ***
+
+--connection master
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+ALTER TABLE t2 ADD PRIMARY KEY (a);
+ALTER TABLE t3 ADD PRIMARY KEY (a);
+--sync_slave_with_master
+RENAME TABLE t3 TO t3_bak;
+
+--connection master
+INSERT INTO t3 VALUES(2, 'B');
+INSERT INTO t2 VALUES(2, 'B');
+INSERT INTO t1 VALUES(2, 'B');
+UPDATE t1 SET b = 'X' WHERE a = 2;
+
+--connection slave
+--source include/wait_for_slave_sql_to_stop.inc
+
+--connection master
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+
+--connection slave
+SHOW TABLES LIKE 't%';
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--source include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+--source include/start_slave.inc
+
+--connection master
+TRUNCATE t1;
+TRUNCATE t2;
+TRUNCATE t3;
+--sync_slave_with_master
+--echo
+
+
+# Test transactional group with InnoDB tables with PK
+# No data replicated if errors happens inside transaction
+--echo *** Test transactional group w/ PK ***
+
+--connection master
+ALTER TABLE t1 ENGINE=InnoDB;
+ALTER TABLE t2 ENGINE=InnoDB;
+ALTER TABLE t3 ENGINE=InnoDB;
+
+--connection slave
+RENAME TABLE t3 TO t3_bak;
+
+--connection master
+BEGIN;
+INSERT INTO t1 VALUES (3, 'C'), (4, 'D');
+INSERT INTO t2 VALUES (3, 'C'), (4, 'D');
+INSERT INTO t3 VALUES (3, 'C'), (4, 'D');
+COMMIT;
+
+--connection slave
+--source include/wait_for_slave_sql_to_stop.inc
+
+--connection master
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+
+--connection slave
+SHOW TABLES LIKE 't%';
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+source include/stop_slave.inc;
+RENAME TABLE t3_bak TO t3;
+source include/start_slave.inc;
+
+# Clean up
+--echo *** Clean up ***
+--connection master
+DROP TABLE t1,t2,t3;
+--sync_slave_with_master
+
+# End of 5.1 test
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt b/mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index 8a5b1ae0ae4..f4cb0f69e93 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -110,8 +110,7 @@ DELIMITER ;|
--echo **** On Slave ****
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo **** On Master ****
connection master;
@@ -121,6 +120,7 @@ DROP TRIGGER tr2;
INSERT INTO t1 VALUES (3,'master/slave');
INSERT INTO t2 VALUES (3,'master/slave');
INSERT INTO t3 VALUES (3,'master/slave');
+COMMIT;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
@@ -131,8 +131,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t1 ORDER BY a;
@@ -156,8 +155,7 @@ CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
--echo **** On Slave ****
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo *** On Master ***
connection master;
@@ -182,8 +180,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t4 ORDER BY a;
@@ -194,8 +191,7 @@ SELECT * FROM t6 ORDER BY a;
--echo **** On Slave ****
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo *** On Master ***
connection master;
@@ -220,8 +216,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t4 ORDER BY a;
@@ -232,8 +227,7 @@ SELECT * FROM t6 ORDER BY a;
# And the same, but with autocommit = 0
#
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
connection master;
SET AUTOCOMMIT=0;
@@ -257,8 +251,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t4 ORDER BY a;
@@ -280,16 +273,14 @@ CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
--echo *** On Slave ***
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo *** On Master ***
connection master;
SET SESSION BINLOG_FORMAT=STATEMENT;
-exec cp ./suite/rpl/data/rpl_bug28618.dat $MYSQLTEST_VARDIR/tmp/;
+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
-remove_file $MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat;
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
SELECT * FROM t10 ORDER BY a;
@@ -298,8 +289,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t10 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test
index 46836382ac4..4edf1802a5d 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_status.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test
@@ -23,39 +23,36 @@
--echo ==== Create new replication user ====
--echo [on master]
connection master;
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
--echo [on slave]
sync_slave_with_master;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
-change master to master_user='rpl',master_password='rpl';
-start slave;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+CHANGE MASTER TO master_user='rpl', master_password='rpl';
+source include/start_slave.inc;
--echo ==== Do replication as new user ====
--echo [on master]
connection master;
-create table t1 (n int);
-insert into t1 values (1);
+CREATE TABLE t1 (n INT);
+INSERT INTO t1 VALUES (1);
--echo [on slave]
sync_slave_with_master;
-select * from t1;
+SELECT * FROM t1;
--echo ==== Delete new replication user ====
--echo [on master]
connection master;
-drop user rpl@127.0.0.1;
-flush privileges;
+DROP USER rpl@127.0.0.1;
+FLUSH PRIVILEGES;
--echo [on slave]
sync_slave_with_master;
--echo ==== Restart slave without privileges =====
# (slave.err will contain access denied error for this START SLAVE command)
-stop slave;
-source include/wait_for_slave_to_stop.inc;
-start slave;
+source include/stop_slave.inc;
+START SLAVE;
source include/wait_for_slave_sql_to_start.inc;
--echo ==== Verify that Slave_IO_Running = No ====
@@ -63,11 +60,10 @@ let $result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
--echo Slave_IO_Running = $result (should be No)
--echo ==== Cleanup (Note that slave IO thread is not running) ====
-drop table t1;
-delete from mysql.user where user='rpl';
+DROP TABLE t1;
# cleanup: slave io thread has been stopped "irrecoverably"
# so we clean up mess manually
--echo [on master]
connection master;
-drop table t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
index acf50d59b85..ec6464fb095 100644
--- a/mysql-test/suite/rpl/t/rpl_sp.test
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
@@ -11,6 +11,7 @@
source include/have_binlog_format_mixed.inc;
source include/master-slave.inc;
+
# we need a db != test, where we don't have automatic grants
--disable_warnings
drop database if exists mysqltest1;
@@ -240,6 +241,8 @@ begin
end|
delimiter ;|
connection master;
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
# test old variable name:
set global log_bin_trust_routine_creators=1;
# now use new name:
@@ -247,6 +250,8 @@ set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
# slave needs it too otherwise will not execute what master allowed:
connection slave;
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1;
connection con1;
@@ -571,9 +576,12 @@ show binlog events in 'master-bin.000001' from 106;
# Restore log_bin_trust_function_creators to its original value.
# This is a cleanup for all parts above where we tested stored
# functions and triggers.
-set global log_bin_trust_function_creators=0;
+connection slave;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
connection master;
-set global log_bin_trust_function_creators=0;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
# Clean up
drop database mysqltest;
@@ -625,8 +633,9 @@ show function status like '%mysqltestbug36570%';
connection master;
flush logs;
+let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex s/$MYSQL_TEST_DIR/MYSQL_TEST_DIR/ s/TIMESTAMP=[0-9]*/TIMESTAMP=t/
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001
use test;
drop procedure mysqltestbug36570_p1;
drop procedure ` mysqltestbug36570_p2`;
diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test
index c1092e3260f..63ac3a8ad9c 100644
--- a/mysql-test/suite/rpl/t/rpl_sp_effects.test
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test
@@ -10,6 +10,8 @@
# ****************************************************************
connection master;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
+
# cleanup
--disable_warnings
drop procedure if exists p1;
@@ -254,8 +256,8 @@ drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
-sync_slave_with_master;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
-SET GLOBAL log_bin_trust_function_creators = 0;
+sync_slave_with_master;
--echo end of the tests
diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
index 93c613f4cf4..dbf0775c978 100644
--- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
@@ -25,6 +25,7 @@ let $wait_condition= SELECT COUNT(*) > 0 FROM t1;
source include/wait_condition.inc;
stop slave io_thread;
start slave io_thread;
+source include/wait_for_slave_to_start.inc;
sync_with_master;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_stm_conflicts.test b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
new file mode 100644
index 00000000000..07b7a0bf8f7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
@@ -0,0 +1,11 @@
+# See the top of mysql-test/extra/rpl_tests/rpl_conflicts.test for an
+# explanation of what this test does.
+#
+# This test file is for statement-logging mode.
+
+source include/have_binlog_format_mixed_or_statement.inc;
+source include/master-slave.inc;
+
+source extra/rpl_tests/rpl_conflicts.test;
+
+source include/master-slave-end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mystery22.test b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test
deleted file mode 100644
index b43a734fffc..00000000000
--- a/mysql-test/suite/rpl/t/rpl_stm_mystery22.test
+++ /dev/null
@@ -1,66 +0,0 @@
-################################
-# Change Author: JBM
-# Change Date: 2006-01-12
-# Change: Added back have stm binlog
-# and added requirments comments
-################################
-# test case to make slave thread get ahead by 22 bytes
-################################
-#REQUIREMENT: If there is a faked slave duplicate key insert
-#error and the slave is restarted, the replication should
-#proceed in a correct way.
-################################
-#REQUIREMENT: If there is a faked slave non-existing record
-#delete error and the slave is restarted, then the replication
-#should proceed in a correct way.
-#################################
-
--- source include/have_binlog_format_mixed_or_statement.inc
--- source include/master-slave.inc
-
-# first, cause a duplicate key problem on the slave
-create table t1(n int auto_increment primary key, s char(10));
-sync_slave_with_master;
-insert into t1 values (2,'old');
-connection master;
-insert into t1 values(NULL,'new');
-insert into t1 values(NULL,'new');
-save_master_pos;
-connection slave;
-# wait until the slave tries to run the query, fails and aborts slave thread
-source include/wait_for_slave_sql_error.inc;
-select * from t1 order by n;
-delete from t1 where n = 2;
---disable_warnings
-start slave;
---enable_warnings
-sync_with_master;
-#now the buggy slave would be confused on the offset but it can replicate
-#in order to make it break, we need to stop/start the slave one more time
-stop slave;
-connection master;
-# to be able to really confuse the slave, we need some non-auto-increment
-# events in the log
-create table t2(n int);
-drop table t2;
-insert into t1 values(NULL,'new');
-# what happens when we delete a row which does not exist on slave?
-set sql_log_bin=0;
-insert into t1 values(NULL,'new');
-set sql_log_bin=1;
-delete from t1 where n=4;
-save_master_pos;
-connection slave;
---disable_warnings
-start slave;
---enable_warnings
-#now the truth comes out - if the slave is buggy, it will never sync because
-#the slave thread is not able to read events
-sync_with_master;
-select * from t1 order by n;
-#clean up
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 2793e8833fd..07a3b27763d 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -1,22 +1,37 @@
+# ==== Purpose ====
+#
+# Verify that START SLAVE UNTIL replicates until the given binlog
+# position but not longer. Verify that START SLAVE UNTIL with various
+# incorrect arguments gives an error.
+#
+# ==== Method ====
+#
+# On master, create a table and insert some rows. On slave, START
+# SLAVE UNTIL so that it reads one event at a time, and check the
+# table and the slave status each time.
+#
+# Then, on slave, run START SLAVE UNTIL with incorrect arguments and
+# verify that it gives an error.
+#
+# ==== Related bugs ====
+#
+# Bug in this test: BUG#37717: rpl.rpl_stm_until 'stmt' fails sporadically on pushbuild
+
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
# Test is dependent on binlog positions
-# prepare version for substitutions
-let $VERSION=`select version()`;
+# Stop slave before it starts replication. Also sync with master
+# to avoid nondeterministic behaviour.
+--echo [on slave]
+sync_slave_with_master;
+--source include/stop_slave.inc
-# stop slave before he will start replication also sync with master
-# for avoiding undetermenistic behaviour
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+--echo ==== Create some events on master ====
+--echo [on master]
connection master;
-# create some events on master
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -25,9 +40,13 @@ insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
+--echo ==== Replicate one event at a time on slave ====
+
# try to replicate all queries until drop of t1
+--echo [on slave]
connection slave;
start slave until master_log_file='master-bin.000001', master_log_pos=323;
+--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
# here table should be still not deleted
select * from t1;
@@ -35,6 +54,7 @@ source include/show_slave_status2.inc;
# this should fail right after start
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
# again this table should be still not deleted
select * from t1;
@@ -42,28 +62,28 @@ source include/show_slave_status2.inc;
# try replicate all up to and not including the second insert to t2;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
+--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
select * from t2;
source include/show_slave_status2.inc;
# clean up
start slave;
+--echo [on master]
connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+--echo [on slave]
+sync_slave_with_master;
+--source include/stop_slave.inc
# this should stop immediately as we are already there
start slave until master_log_file='master-bin.000001', master_log_pos=776;
+--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
-# here the sql slave thread should be stopped
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
source include/show_slave_status2.inc;
-#testing various error conditions
+--echo ==== Test various error conditions ====
+
--error 1277
start slave until master_log_file='master-bin', master_log_pos=561;
--error 1277
@@ -78,4 +98,3 @@ start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
start slave sql_thread;
start slave until master_log_file='master-bin.000001', master_log_pos=776;
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test
index a40d1cbb5c5..0bf3ecf97a2 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test
@@ -16,6 +16,10 @@ source include/add_anonymous_users.inc;
# (otherwise RESET MASTER may come too early).
save_master_pos;
connection slave;
+
+# Add suppression for expected warning(s) in slaves error log
+call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032");
+
sync_with_master;
reset master;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
index f38ed29f7d4..3b373e00a62 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
@@ -1,5 +1,7 @@
source include/master-slave.inc;
+call mtr.add_suppression("Deadlock found");
+
--echo **** On Master ****
connection master;
SET SESSION BINLOG_FORMAT=ROW;
diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test
index dac21000a62..d65242f2a22 100644
--- a/mysql-test/suite/rpl/t/rpl_timezone.test
+++ b/mysql-test/suite/rpl/t/rpl_timezone.test
@@ -67,7 +67,7 @@ connection master;
connection master;
delete from t1;
set time_zone='UTC';
-load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
+load data infile '../../std_data/rpl_timezone2.dat' into table t1;
SELECT * FROM t1 ORDER BY n;
sync_slave_with_master;
set time_zone='UTC';
diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index 911110d17dc..a3929458026 100644
--- a/mysql-test/suite/rpl/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
@@ -46,9 +46,7 @@ insert into t2 values(NULL,0),(500,0);
select a,b, truncate(rand_value,4) from t1;
select * from t2;
select a,name, old_a, old_b, truncate(rand_value,4) from t3;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
--disable_query_log
select "--- On slave --" as "";
--enable_query_log
@@ -108,9 +106,7 @@ SELECT trigger_name, definer
FROM information_schema.triggers
WHERE trigger_name = 't1_first';
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
--disable_query_log
select "--- On slave --" as "";
--enable_query_log
@@ -165,9 +161,7 @@ create database other;
use other;
insert into test.t1 values (1);
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
connection master;
use test;
@@ -265,6 +259,8 @@ while ($rnd)
connection master;
eval drop table t1$rnd;
+ sync_slave_with_master;
+ connection master;
dec $rnd;
}
@@ -300,8 +296,30 @@ STOP SLAVE;
# Replace master's binlog.
connection master;
+let $MYSQLD_DATADIR= `select @@datadir`;
FLUSH LOGS;
-exec cp $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLTEST_VARDIR/log/master-bin.000001;
+
+# Stop master server
+--echo --> Stop master server
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait
+EOF
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+# Replace binlog
+remove_file $MYSQLD_DATADIR/master-bin.000001;
+copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLD_DATADIR/master-bin.000001;
+
+--echo --> Start master server
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+let $binlog_version= query_get_value(SHOW BINLOG EVENTS, Info, 1);
+
+# Make the slave to replay the new binlog.
+--echo --> Master binlog: $binlog_version
# Make the slave to replay the new binlog.
@@ -377,9 +395,7 @@ DROP TABLE IF EXISTS t2;
--echo
--echo ---> Synchronizing slave with master...
---save_master_pos
---connection slave
---sync_with_master
+--sync_slave_with_master
--echo
--echo ---> connection: master
@@ -411,9 +427,7 @@ SELECT * FROM t2;
--echo
--echo ---> Synchronizing slave with master...
---save_master_pos
---connection slave
---sync_with_master
+--sync_slave_with_master
--echo ---> connection: master
@@ -435,9 +449,7 @@ SELECT * FROM t2;
DROP TABLE t1;
DROP TABLE t2;
---save_master_pos
---connection slave
---sync_with_master
+--sync_slave_with_master
--connection master
#
@@ -467,20 +479,49 @@ drop trigger if exists t1_bi;
insert into t1 values (3, "c");
select * from t1;
-
-save_master_pos;
-connection slave;
-sync_with_master;
-
+sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
+sync_slave_with_master;
#
-# End of tests
+# Bug#40116: Uncommited changes are replicated and stay on slave after
+# rollback on master
#
-save_master_pos;
+
+connection master;
+source include/master-slave-reset.inc;
+source include/have_innodb.inc;
connection slave;
-sync_with_master;
+source include/have_innodb.inc;
+
+connection master;
+create table t1 ( f int ) engine = innodb;
+create table log ( r int ) engine = myisam;
+create trigger tr
+ after insert on t1
+ for each row insert into log values ( new.f );
+
+set autocommit = 0;
+insert into t1 values ( 1 );
+rollback;
+sync_slave_with_master;
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+--source include/diff_tables.inc
+
+let $diff_table_1=master:test.log;
+let $diff_table_2=slave:test.log;
+--source include/diff_tables.inc
+
+connection master;
+drop table t1, log;
+sync_slave_with_master;
+
+#
+# End of tests
+#
diff --git a/mysql-test/suite/rpl_ndb/my.cnf b/mysql-test/suite/rpl_ndb/my.cnf
new file mode 100644
index 00000000000..58fec36eedd
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/my.cnf
@@ -0,0 +1,75 @@
+!include include/default_mysqld.cnf
+!include include/default_ndbd.cnf
+
+[cluster_config.1]
+NoOfReplicas= 2
+ndbd=,
+ndb_mgmd=
+mysqld=,
+
+[cluster_config.slave]
+NoOfReplicas= 1
+ndbd=
+ndb_mgmd=
+mysqld=
+
+[mysqld]
+# Make all mysqlds use cluster
+ndbcluster
+# Turn on bin logging
+log-bin= master-bin
+
+[mysqld.1.1]
+
+[mysqld.1.1]
+
+[mysqld.1.slave]
+
+# Append <testname>-slave.opt file to the list of argument used when
+# starting the mysqld
+#!use-slave-opt
+
+# Connect mysqld in the second cluster as save to first mysqld
+# Hardcode the host to 127.0.0.1 until running on more
+# than one host and it probably need to be masked anyway
+# master-host= @mysqld.1.#host
+master-host= 127.0.0.1
+master-port= @mysqld.1.1.port
+master-password= @mysqld.1.1.#password
+master-user= @mysqld.1.1.#user
+master-connect-retry= 1
+
+log-bin= slave-bin
+relay-log= slave-relay-bin
+
+init-rpl-role= slave
+log-slave-updates
+master-retry-count= 10
+
+# Values reported by slave when it connect to master
+# and shows up in SHOW SLAVE STATUS;
+report-host= 127.0.0.1
+report-port= @mysqld.1.slave.port
+report-user= root
+
+loose-skip-innodb
+skip-slave-start
+
+# Directory where slaves find the dumps generated by "load data"
+# on the server. The path need to have constant length otherwise
+# test results will vary, thus a relative path is used.
+slave-load-tmpdir= ../../../tmp
+
+rpl-recovery-rank= @mysqld.1.slave.server-id
+
+
+[ENV]
+NDB_CONNECTSTRING= @mysql_cluster.1.ndb_connectstring
+MASTER_MYPORT= @mysqld.1.1.port
+MASTER_MYPORT1= @mysqld.2.1.port
+
+NDB_CONNECTSTRING_SLAVE= @mysql_cluster.slave.ndb_connectstring
+SLAVE_MYPORT= @mysqld.1.slave.port
+SLAVE_MYSOCK= @mysqld.1.slave.socket
+
+NDB_BACKUP_DIR= @cluster_config.ndbd.1.1.BackupDataDir
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
index 84b60b599d8..28ca1ac43b9 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
@@ -8,6 +8,7 @@ SET storage_engine=ndb;
=== NDB -> MYISAM ===
+set @old_slave_exec_mode= @@global.slave_exec_mode;
set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
@@ -803,3 +804,4 @@ TRUNCATE TABLE t1;
--- Do Cleanup --
DROP TABLE IF EXISTS t1;
drop table mysql.ndb_apply_status;
+set @@global.slave_exec_mode= @old_slave_exec_mode;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
index b5b3dc6b66c..b16a63ec5ad 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
@@ -180,7 +180,7 @@ Last_IO_Error <Last_IO_Error>
Last_SQL_Errno <Last_SQL_Errno>
Last_SQL_Error <Last_SQL_Error>
set GLOBAL slave_transaction_retries=10;
-START SLAVE;
+include/start_slave.inc
select * from t1 order by nid;
nid nom prenom
1 LOCK ABC1
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
index e4b5e9b9216..2daacb351a9 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
@@ -52,8 +52,8 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
-Last_IO_Error
+Last_IO_Errno #
+Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
SELECT * FROM t1 ORDER BY a;
@@ -95,8 +95,8 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
-Last_IO_Error
+Last_IO_Errno #
+Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
STOP SLAVE;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result
new file mode 100644
index 00000000000..b7d4a3d76db
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result
@@ -0,0 +1,64 @@
+STOP SLAVE;
+STOP SLAVE;
+STOP SLAVE;
+STOP SLAVE;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+RESET MASTER;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+RESET MASTER;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+RESET MASTER;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+RESET MASTER;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_MYPORT,master_user='root';
+START SLAVE;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=SLAVE_MYPORT1,master_user='root';
+START SLAVE;
+
+*** Check server_id of mysqld servers ***
+SHOW VARIABLES LIKE "server_id";
+Variable_name Value
+server_id 1
+SET auto_increment_offset = 1;
+SET auto_increment_increment = 2;
+SHOW VARIABLES LIKE "server_id";
+Variable_name Value
+server_id 1
+SET auto_increment_offset = 1;
+SET auto_increment_increment = 2;
+SHOW VARIABLES LIKE "server_id";
+Variable_name Value
+server_id 2
+SET auto_increment_offset = 2;
+SET auto_increment_increment = 2;
+SHOW VARIABLES LIKE "server_id";
+Variable_name Value
+server_id 2
+SET auto_increment_offset = 2;
+SET auto_increment_increment = 2;
+
+*** Preparing data ***
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=ndb;
+
+*** Basic testing ***
+Insert rows via all hosts
+Check data on both clusters
+Comparing tables master:test.t1 and slave:test.t1
+*** Transaction testing ***
+BEGIN;
+BEGIN;
+COMMIT;
+COMMIT;
+Check data on both clusters
+Comparing tables master:test.t1 and slave:test.t1
+BEGIN;
+BEGIN;
+ROLLBACK;
+ROLLBACK;
+Check data on both clusters
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
index 18c00583df1..01f8d94da48 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
@@ -49,8 +49,8 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
-Last_IO_Error
+Last_IO_Errno #
+Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
SELECT * FROM t1 ORDER BY a;
@@ -98,7 +98,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
-Last_IO_Error
+Last_IO_Errno #
+Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result
index 75151f45419..a6e2144f532 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result
@@ -11,8 +11,6 @@ show variables like "%character_set_ser%";
Variable_name Value
character_set_server ucs2
DROP TABLE IF EXISTS t1;
-create table t1 (a int) ENGINE=NDB;
-drop table t1;
CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
`nom` char(4) default NULL,
`prenom` char(4) default NULL,
@@ -25,3 +23,5 @@ nid nom prenom
select * from t1 order by nid;
nid nom prenom
1 XYZ1 ABC1
+==== clean up ====
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result
index 148e6247b03..7c3f331958f 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result
@@ -23,11 +23,11 @@ select count(*) from t2;
count(*)
0
begin;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
@@ -49,11 +49,11 @@ count(*)
delete from t1;
delete from t2;
begin;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
@@ -77,11 +77,11 @@ delete from t2;
begin;
insert into t2 values(3),(4);
insert into t1 values(3),(4);
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
index 18558c57140..5b6ca5f5097 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
start slave;
@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key)ENGINE=NDB;
insert into t1 values (NULL);
drop table t1;
create table t1 (word char(20) not null)ENGINE=NDB;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+load data infile 'LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
count(*)
69
@@ -117,10 +117,6 @@ Aberdeen
Abernathy
aberrant
aberration
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -193,7 +189,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=NDB;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -227,13 +224,12 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Query 1 # COMMIT
show binary logs;
Log_name File_size
-master-bin.000001 1760
-master-bin.000002 623
-start slave;
+master-bin.000001 #
+master-bin.000002 #
show binary logs;
Log_name File_size
-slave-bin.000001 1855
-slave-bin.000002 202
+slave-bin.000001 #
+slave-bin.000002 #
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
@@ -308,13 +304,23 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
-reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int)
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result
new file mode 100644
index 00000000000..da60b0bbbbf
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result
@@ -0,0 +1,457 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE tmyisam (a int) ENGINE = MYISAM;
+CREATE TABLE tinnodb (a int) ENGINE = INNODB;
+CREATE TABLE tndb (a int) ENGINE = NDB;
+SHOW CREATE TABLE tmyisam;
+Table Create Table
+tmyisam CREATE TABLE `tmyisam` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE tinnodb;
+Table Create Table
+tinnodb CREATE TABLE `tinnodb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE tndb;
+Table Create Table
+tndb CREATE TABLE `tndb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+[on master]
+==== Single-engine transactions ====
+---- autocommitted ----
+SET AUTOCOMMIT = 1;
+INSERT INTO tmyisam VALUES (0);
+INSERT INTO tinnodb VALUES (1);
+INSERT INTO tndb VALUES (2);
+---- committed with BEGIN ----
+BEGIN;
+INSERT INTO tmyisam VALUES (3);
+INSERT INTO tmyisam VALUES (4);
+COMMIT;
+BEGIN;
+INSERT INTO tinnodb VALUES (5);
+INSERT INTO tinnodb VALUES (6);
+COMMIT;
+BEGIN;
+INSERT INTO tndb VALUES (7);
+INSERT INTO tndb VALUES (8);
+COMMIT;
+---- rolled back with BEGIN ----
+BEGIN;
+INSERT INTO tmyisam VALUES (9);
+INSERT INTO tmyisam VALUES (10);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+BEGIN;
+INSERT INTO tinnodb VALUES (11);
+INSERT INTO tinnodb VALUES (12);
+ROLLBACK;
+BEGIN;
+INSERT INTO tndb VALUES (13);
+INSERT INTO tndb VALUES (14);
+ROLLBACK;
+---- committed with AUTOCOMMIT = 0 ----
+SET AUTOCOMMIT = 0;
+INSERT INTO tmyisam VALUES (15);
+INSERT INTO tmyisam VALUES (16);
+COMMIT;
+INSERT INTO tinnodb VALUES (17);
+INSERT INTO tinnodb VALUES (18);
+COMMIT;
+INSERT INTO tndb VALUES (19);
+INSERT INTO tndb VALUES (20);
+COMMIT;
+---- rolled back with AUTOCOMMIT = 0 ----
+INSERT INTO tmyisam VALUES (21);
+INSERT INTO tmyisam VALUES (22);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+INSERT INTO tinnodb VALUES (23);
+INSERT INTO tinnodb VALUES (24);
+ROLLBACK;
+INSERT INTO tndb VALUES (25);
+INSERT INTO tndb VALUES (26);
+ROLLBACK;
+SET AUTOCOMMIT = 1;
+==== MyISAM + InnoDB ====
+---- committed with BEGIN ----
+BEGIN;
+INSERT INTO tmyisam VALUES (27);
+INSERT INTO tinnodb VALUES (28);
+COMMIT;
+BEGIN;
+INSERT INTO tinnodb VALUES (29);
+INSERT INTO tmyisam VALUES (30);
+COMMIT;
+---- rolled back with BEGIN ----
+BEGIN;
+INSERT INTO tmyisam VALUES (31);
+INSERT INTO tinnodb VALUES (32);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+BEGIN;
+INSERT INTO tinnodb VALUES (33);
+INSERT INTO tmyisam VALUES (34);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+---- committed with AUTOCOMMIT = 0 ----
+SET AUTOCOMMIT = 0;
+INSERT INTO tmyisam VALUES (35);
+INSERT INTO tinnodb VALUES (36);
+COMMIT;
+INSERT INTO tinnodb VALUES (37);
+INSERT INTO tmyisam VALUES (38);
+COMMIT;
+---- rolled back with AUTOCOMMIT = 0 ----
+INSERT INTO tmyisam VALUES (39);
+INSERT INTO tinnodb VALUES (40);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+INSERT INTO tinnodb VALUES (41);
+INSERT INTO tmyisam VALUES (42);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SET AUTOCOMMIT = 1;
+==== MyISAM + NDB ====
+---- committed with BEGIN----
+BEGIN;
+INSERT INTO tmyisam VALUES (43);
+INSERT INTO tndb VALUES (44);
+COMMIT;
+BEGIN;
+INSERT INTO tndb VALUES (45);
+INSERT INTO tmyisam VALUES (46);
+COMMIT;
+---- rolled back with BEGIN ----
+BEGIN;
+INSERT INTO tmyisam VALUES (47);
+INSERT INTO tndb VALUES (48);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+BEGIN;
+INSERT INTO tndb VALUES (49);
+INSERT INTO tmyisam VALUES (50);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+---- committed with AUTOCOMMIT = 0 ----
+SET AUTOCOMMIT = 0;
+INSERT INTO tmyisam VALUES (51);
+INSERT INTO tndb VALUES (52);
+COMMIT;
+INSERT INTO tndb VALUES (53);
+INSERT INTO tmyisam VALUES (54);
+COMMIT;
+---- rolled back with AUTOCOMMIT = 0 ----
+INSERT INTO tmyisam VALUES (55);
+INSERT INTO tndb VALUES (56);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+INSERT INTO tndb VALUES (57);
+INSERT INTO tmyisam VALUES (58);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SET AUTOCOMMIT = 1;
+==== InnoDB + NDB ====
+---- committed with BEGIN ----
+BEGIN;
+INSERT INTO tinnodb VALUES (59);
+INSERT INTO tndb VALUES (60);
+COMMIT;
+BEGIN;
+INSERT INTO tndb VALUES (61);
+INSERT INTO tinnodb VALUES (62);
+COMMIT;
+---- rolled back with BEGIN ----
+BEGIN;
+INSERT INTO tinnodb VALUES (63);
+INSERT INTO tndb VALUES (64);
+ROLLBACK;
+BEGIN;
+INSERT INTO tndb VALUES (65);
+INSERT INTO tinnodb VALUES (66);
+ROLLBACK;
+---- committed with AUTOCOMMIT = 0 ----
+SET AUTOCOMMIT = 0;
+INSERT INTO tinnodb VALUES (67);
+INSERT INTO tndb VALUES (68);
+COMMIT;
+INSERT INTO tndb VALUES (69);
+INSERT INTO tinnodb VALUES (70);
+COMMIT;
+---- rolled back with AUTOCOMMIT = 0 ----
+INSERT INTO tinnodb VALUES (71);
+INSERT INTO tndb VALUES (72);
+ROLLBACK;
+INSERT INTO tndb VALUES (73);
+INSERT INTO tinnodb VALUES (74);
+ROLLBACK;
+SET AUTOCOMMIT = 1;
+==== MyISAM + InnoDB + NDB ====
+---- committed with BEGIN ----
+BEGIN;
+INSERT INTO tmyisam VALUES (75);
+INSERT INTO tinnodb VALUES (76);
+INSERT INTO tndb VALUES (77);
+COMMIT;
+BEGIN;
+INSERT INTO tmyisam VALUES (78);
+INSERT INTO tndb VALUES (79);
+INSERT INTO tinnodb VALUES (80);
+COMMIT;
+BEGIN;
+INSERT INTO tinnodb VALUES (81);
+INSERT INTO tmyisam VALUES (82);
+INSERT INTO tndb VALUES (83);
+COMMIT;
+BEGIN;
+INSERT INTO tinnodb VALUES (84);
+INSERT INTO tndb VALUES (85);
+INSERT INTO tmyisam VALUES (86);
+COMMIT;
+BEGIN;
+INSERT INTO tndb VALUES (87);
+INSERT INTO tmyisam VALUES (88);
+INSERT INTO tinnodb VALUES (89);
+COMMIT;
+BEGIN;
+INSERT INTO tndb VALUES (90);
+INSERT INTO tinnodb VALUES (91);
+INSERT INTO tmyisam VALUES (92);
+COMMIT;
+---- rolled back with BEGIN ----
+BEGIN;
+INSERT INTO tmyisam VALUES (93);
+INSERT INTO tinnodb VALUES (94);
+INSERT INTO tndb VALUES (95);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+BEGIN;
+INSERT INTO tmyisam VALUES (96);
+INSERT INTO tndb VALUES (97);
+INSERT INTO tinnodb VALUES (98);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+BEGIN;
+INSERT INTO tinnodb VALUES (99);
+INSERT INTO tmyisam VALUES (100);
+INSERT INTO tndb VALUES (101);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+BEGIN;
+INSERT INTO tinnodb VALUES (102);
+INSERT INTO tndb VALUES (103);
+INSERT INTO tmyisam VALUES (104);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+BEGIN;
+INSERT INTO tndb VALUES (105);
+INSERT INTO tmyisam VALUES (106);
+INSERT INTO tinnodb VALUES (107);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+BEGIN;
+INSERT INTO tndb VALUES (108);
+INSERT INTO tinnodb VALUES (109);
+INSERT INTO tmyisam VALUES (110);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+---- committed with AUTOCOMMIT = 0 ----
+SET AUTOCOMMIT = 0;
+INSERT INTO tmyisam VALUES (111);
+INSERT INTO tinnodb VALUES (112);
+INSERT INTO tndb VALUES (113);
+COMMIT;
+INSERT INTO tmyisam VALUES (114);
+INSERT INTO tndb VALUES (115);
+INSERT INTO tinnodb VALUES (116);
+COMMIT;
+INSERT INTO tinnodb VALUES (117);
+INSERT INTO tmyisam VALUES (118);
+INSERT INTO tndb VALUES (119);
+COMMIT;
+INSERT INTO tinnodb VALUES (120);
+INSERT INTO tndb VALUES (121);
+INSERT INTO tmyisam VALUES (122);
+COMMIT;
+INSERT INTO tndb VALUES (123);
+INSERT INTO tmyisam VALUES (124);
+INSERT INTO tinnodb VALUES (125);
+COMMIT;
+INSERT INTO tndb VALUES (126);
+INSERT INTO tinnodb VALUES (127);
+INSERT INTO tmyisam VALUES (128);
+COMMIT;
+---- rolled back with AUTOCOMMIT = 0 ----
+INSERT INTO tmyisam VALUES (129);
+INSERT INTO tinnodb VALUES (130);
+INSERT INTO tndb VALUES (131);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+INSERT INTO tmyisam VALUES (132);
+INSERT INTO tndb VALUES (133);
+INSERT INTO tinnodb VALUES (134);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+INSERT INTO tinnodb VALUES (135);
+INSERT INTO tmyisam VALUES (136);
+INSERT INTO tndb VALUES (137);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+INSERT INTO tinnodb VALUES (138);
+INSERT INTO tndb VALUES (139);
+INSERT INTO tmyisam VALUES (140);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+INSERT INTO tndb VALUES (141);
+INSERT INTO tmyisam VALUES (142);
+INSERT INTO tinnodb VALUES (143);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+INSERT INTO tndb VALUES (144);
+INSERT INTO tinnodb VALUES (145);
+INSERT INTO tmyisam VALUES (146);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SET AUTOCOMMIT = 1;
+==== Verify the result ====
+SELECT * FROM tmyisam ORDER BY a;
+a
+0
+3
+4
+9
+10
+15
+16
+21
+22
+27
+30
+31
+34
+35
+38
+39
+42
+43
+46
+47
+50
+51
+54
+55
+58
+75
+78
+82
+86
+88
+92
+93
+96
+100
+104
+106
+110
+111
+114
+118
+122
+124
+128
+129
+132
+136
+140
+142
+146
+SELECT * FROM tinnodb ORDER BY a;
+a
+1
+5
+6
+17
+18
+28
+29
+36
+37
+59
+62
+67
+70
+76
+80
+81
+84
+89
+91
+112
+116
+117
+120
+125
+127
+SELECT * FROM tndb ORDER BY a;
+a
+2
+7
+8
+19
+20
+44
+45
+52
+53
+60
+61
+68
+69
+77
+79
+83
+85
+87
+90
+113
+115
+119
+121
+123
+126
+[on slave]
+Comparing tables master:test.tmyisam and slave:test.tmyisam
+Comparing tables master:test.tinnodb and slave:test.tinnodb
+Comparing tables master:test.tndb and slave:test.tndb
+==== Clean up ====
+[on master]
+DROP TABLE tmyisam, tinnodb, tndb;
+[on slave]
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
index 760114f3639..f8eb5ebdd89 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
@@ -26,10 +26,10 @@ stop slave;
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
-106 master-bin1.000001
+106 master-bin.000001
CHANGE MASTER TO
master_port=<MASTER_PORT1>,
-master_log_file = 'master-bin1.000001',
+master_log_file = 'master-bin.000001',
master_log_pos = 106 ;
start slave;
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
@@ -52,4 +52,6 @@ c1 c2 c3
row3 C 3
row4 D 4
row5 E 5
+==== clean up ====
+DROP TABLE t1;
STOP SLAVE;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result
index 56bb31e329d..7f75bdedd65 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result
@@ -5,8 +5,8 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (word CHAR(20) NOT NULL);
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
+LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word LIMIT 10;
word
Aarhus
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
index f2a1ba410b9..c788893e055 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
@@ -25,12 +25,8 @@ hex(c2) hex(c3) c1
0 1 BCDEF
1 0 CD
0 0 DEFGHIJKL
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
UPDATE t1 SET c2=0 WHERE c3="row2";
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result
deleted file mode 100644
index bbd0a873dc8..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result
+++ /dev/null
@@ -1,110 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-CREATE TABLE tmyisam (a int) ENGINE = MYISAM;
-CREATE TABLE tinnodb (a int) ENGINE = INNODB;
-CREATE TABLE tndb (a int) ENGINE = NDB;
-SHOW CREATE TABLE tmyisam;
-Table Create Table
-tmyisam CREATE TABLE `tmyisam` (
- `a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW CREATE TABLE tinnodb;
-Table Create Table
-tinnodb CREATE TABLE `tinnodb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SHOW CREATE TABLE tndb;
-Table Create Table
-tndb CREATE TABLE `tndb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-==== Test 1: Non-XA Engines ====
---- on master ---
-SET AUTOCOMMIT = 1;
-INSERT INTO tndb VALUES (1);
-INSERT INTO tmyisam VALUES (1);
-BEGIN;
-INSERT INTO tndb VALUES (2);
-INSERT INTO tndb VALUES (3);
-COMMIT;
-BEGIN;
-INSERT INTO tmyisam VALUES (2);
-INSERT INTO tmyisam VALUES (3);
-COMMIT;
-BEGIN;
-INSERT INTO tndb VALUES (4);
-INSERT INTO tmyisam VALUES (4);
-COMMIT;
-BEGIN;
-INSERT INTO tndb VALUES (5);
-INSERT INTO tndb VALUES (6);
-ROLLBACK;
-BEGIN;
-INSERT INTO tmyisam VALUES (5);
-INSERT INTO tmyisam VALUES (6);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tndb VALUES (7);
-INSERT INTO tmyisam VALUES (7);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SELECT * FROM tndb ORDER BY a;
-a
-1
-2
-3
-4
-SELECT * FROM tmyisam ORDER BY a;
-a
-1
-2
-3
-4
-5
-6
-7
---- on slave ---
-SELECT * FROM tndb ORDER BY a;
-a
-1
-2
-3
-4
-SELECT * FROM tmyisam ORDER BY a;
-a
-1
-2
-3
-4
-5
-6
-7
-==== Test 2: Master crash before writing XID event on XA engine ====
---- on master ---
-INSERT INTO tinnodb VALUES (1);
-SELECT * FROM tinnodb ORDER BY a;
-a
-1
---- on slave ---
-STOP SLAVE;
-SELECT "" AS Slave_IO_State;
-Slave_IO_State
-
-SELECT "" AS Last_SQL_Error;
-Last_SQL_Error
-
-SELECT "" AS Last_IO_Error;
-Last_IO_Error
-
-SELECT * FROM tinnodb ORDER BY a;
-a
---- on master ---
-DROP TABLE tmyisam, tinnodb, tndb;
-DROP TABLE tmyisam, tinnodb, tndb;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
index aa9d3132cbb..409397cb3d1 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
@@ -423,10 +423,10 @@ a b c
**** On Master ****
DELETE FROM t1;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def
index ebc99feeac6..6908269d014 100644
--- a/mysql-test/suite/rpl_ndb/t/disabled.def
+++ b/mysql-test/suite/rpl_ndb/t/disabled.def
@@ -10,7 +10,4 @@
#
##############################################################################
-rpl_ndb_circular : Bug#33849 COMMIT event missing in cluster circular replication.
-rpl_ndb_circular_simplex : Bug#33849 COMMIT event missing in cluster circular replication.
-
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
index 43ad901d746..3b075808481 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
@@ -12,6 +12,14 @@
-- connection slave
-- source include/have_innodb.inc
+
+# Remove any old ndb_apply_status from slaves datadir
+let $datadir= `SELECT @@datadir`;
+--error 0,1
+remove_file $datadir/mysql/ndb_apply_status.frm;
+--error 0,1
+remove_file $datadir/mysql/ndb_apply_status.ndb;
+
set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
index b19116ffd78..560efec255b 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
@@ -11,6 +11,14 @@
-- source include/master-slave.inc
-- connection slave
+
+# Remove any old ndb_apply_status from slaves datadir
+let $datadir= `SELECT @@datadir`;
+--error 0,1
+remove_file $datadir/mysql/ndb_apply_status.frm;
+--error 0,1
+remove_file $datadir/mysql/ndb_apply_status.ndb;
+
set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test
index 1657a6902ba..e954c72fd1d 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test
@@ -5,6 +5,7 @@
# to other engines (innodb, myisam), see also rpl_ndb_2other.test
##############################################################
--source include/have_binlog_format_mixed_or_row.inc
+--source include/have_ndb.inc
--source include/ndb_master-slave.inc
# On master use NDB as storage engine.
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test
index 67e8f7cea42..41f91d62dec 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test
@@ -17,6 +17,15 @@ SET storage_engine=ndb;
--echo === NDB -> MYISAM ===
--echo
connection slave;
+
+# Remove any old ndb_apply_status from slaves datadir
+let $datadir= `SELECT @@datadir`;
+--error 0,1
+remove_file $datadir/mysql/ndb_apply_status.frm;
+--error 0,1
+remove_file $datadir/mysql/ndb_apply_status.ndb;
+
+set @old_slave_exec_mode= @@global.slave_exec_mode;
set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
@@ -38,3 +47,4 @@ SET storage_engine=innodb;
connection slave;
drop table mysql.ndb_apply_status;
+set @@global.slave_exec_mode= @old_slave_exec_mode;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test
index ce951f01212..b90e6fff8bc 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test
@@ -73,7 +73,7 @@ CREATE TABLE ACCOUNT_TYPE ( ACCOUNT_TYPE_ID INT UNSIGNED NOT NULL,
#
# create "BANK" application
#
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankCreator >> $NDB_TOOLS_OUTPUT
+--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankCreator >> $NDB_TOOLS_OUTPUT
#
# start main loop
@@ -88,9 +88,9 @@ while ($2)
#
# start "BANK" application
#
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankTimer -w 5 >> $NDB_TOOLS_OUTPUT &
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankMakeGL >> $NDB_TOOLS_OUTPUT &
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankTransactionMaker >> $NDB_TOOLS_OUTPUT &
+--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankTimer -w 5 >> $NDB_TOOLS_OUTPUT &
+--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankMakeGL >> $NDB_TOOLS_OUTPUT &
+--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankTransactionMaker >> $NDB_TOOLS_OUTPUT &
#
# let the "BANK" run for a while
@@ -114,10 +114,10 @@ CREATE DATABASE BANK;
# start by taking a backup on master
--connection master
RESET MASTER;
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
# there is no neat way to find the backupid, this is a hack to find it...
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
+--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
CREATE TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM mysql.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
@@ -128,8 +128,8 @@ let the_backup_id=`select @the_backup_id`;
# restore on slave, first check that nothing is there
--connection slave
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
#
# now setup replication to continue from last epoch
@@ -150,7 +150,7 @@ while ($1)
--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 34 <Last_IO_Errno> 35 <Last_IO_Error>
SHOW SLAVE STATUS;
STOP SLAVE;
- --exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT_SLAVE ../storage/ndb/test/ndbapi/bank/bankValidateAllGLs >> $NDB_TOOLS_OUTPUT
+ --exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING_SLAVE ../storage/ndb/test/ndbapi/bank/bankValidateAllGLs >> $NDB_TOOLS_OUTPUT
START SLAVE;
--dec $1
}
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
index c7d8db8ef8b..5903cd223ad 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
@@ -184,22 +184,21 @@ set GLOBAL slave_transaction_retries=1;
--echo **** On Master ****
UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1;
+--echo **** On Slave ****
# Wait for deadlock to be detected.
# When detected, the slave will stop, so we just wait for it to stop.
+connection slave;
source include/wait_for_slave_sql_to_stop.inc;
# Replication should have stopped, since max retries were not enough.
# verify with show slave status
---connection slave
---echo **** On Slave ****
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 19 <Last_Errno> 20 <Last_Error> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 37 <Last_SQL_Errno> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS;
# now set max retries high enough to succeed, and start slave again
set GLOBAL slave_transaction_retries=10;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
# Wait for deadlock to be detected and retried.
# We want to wait until at least one retry has been made, but before
# the slave stops. currently, there is no safe way to do that: we
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
index c1a48d08c53..2cc46e2420e 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
@@ -5,11 +5,13 @@
--connection slave
RESET MASTER;
+
--connection master
--replace_result $SLAVE_MYPORT SLAVE_PORT
--eval CHANGE MASTER TO master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root"
START SLAVE;
+
# create the table on the "slave"
--connection slave
CREATE TABLE t1 (a int key, b int) ENGINE=ndb;
@@ -37,13 +39,15 @@ INSERT INTO t1 VALUES (2,3);
--connection slave
SELECT * FROM t1 ORDER BY a;
#SELECT * FROM t2 ORDER BY a;
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+# BUG#34654 Last_IO_Errno is not reset - Mask columns 35 and 36
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical show slave status;
# connect to master and ensure data it there.
--connection master
SELECT * FROM t1 ORDER BY a;
#SELECT * FROM t2 ORDER BY a;
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+# BUG#34654 Last_IO_Errno is not reset - Mask columns 35 and 36
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical show slave status;
# stop replication on "master" as not to replicate
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf
new file mode 100644
index 00000000000..b1b010ef0f3
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf
@@ -0,0 +1,31 @@
+!include ../my.cnf
+
+[mysqld.1.1]
+server-id= 1
+log-bin
+
+[mysqld.2.1]
+server-id= 1
+log-bin
+
+[mysqld.1.slave]
+server-id= 2
+log-bin
+skip-slave-start
+
+[mysqld.2.slave]
+server-id= 2
+master-host= 127.0.0.1
+master-port= @mysqld.2.1.port
+master-password= @mysqld.2.1.#password
+master-user= @mysqld.2.1.#user
+master-connect-retry= 1
+init-rpl-role= slave
+log-bin
+skip-slave-start
+ndb_connectstring= @mysql_cluster.slave.ndb_connectstring
+
+[ENV]
+
+SLAVE_MYPORT1= @mysqld.2.slave.port
+SLAVE_MYSOCK1= @mysqld.2.slave.socket
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test
new file mode 100644
index 00000000000..8721e85780d
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test
@@ -0,0 +1,172 @@
+#############################################################
+# Author: Serge Kozlov <skozlov@mysql.com>
+# Date: 03/17/2008
+# Purpose: Testing cluster circular replication based on two
+# independent channels between two clusters
+#############################################################
+--source include/have_ndb.inc
+--source include/ndb_master-slave_2ch.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--echo
+
+# Check server_id and set auto_increment_* variables
+--echo *** Check server_id of mysqld servers ***
+--connection master
+SHOW VARIABLES LIKE "server_id";
+SET auto_increment_offset = 1;
+SET auto_increment_increment = 2;
+--connection master1
+SHOW VARIABLES LIKE "server_id";
+SET auto_increment_offset = 1;
+SET auto_increment_increment = 2;
+--connection slave
+SHOW VARIABLES LIKE "server_id";
+SET auto_increment_offset = 2;
+SET auto_increment_increment = 2;
+--connection slave1
+SHOW VARIABLES LIKE "server_id";
+SET auto_increment_offset = 2;
+SET auto_increment_increment = 2;
+--echo
+
+# Preparing data.
+--echo *** Preparing data ***
+--connection master
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=ndb;
+
+let $wait_binlog_event= CREATE TABLE t1;
+--source include/wait_for_binlog_event.inc
+--connection master1
+--source include/wait_for_binlog_event.inc
+--connection slave
+--source include/wait_for_binlog_event.inc
+--connection slave1
+--source include/wait_for_binlog_event.inc
+--echo
+
+#
+# Testing
+#
+
+--echo *** Basic testing ***
+# insert data via all hosts
+--echo Insert rows via all hosts
+--disable_query_log
+let $counter= 10;
+while ($counter) {
+ --connection master
+ INSERT INTO t1(b,c) VALUES('master',1);
+ --connection master1
+ INSERT INTO t1(b,c) VALUES('master1',1);
+ --connection slave
+ INSERT INTO t1(b,c) VALUES('slave',1);
+ --connection slave1
+ INSERT INTO t1(b,c) VALUES('slave1',1);
+ dec $counter;
+}
+--connection master
+--enable_query_log
+
+# Wait replication between clusters
+let $wait_condition= SELECT COUNT(*)=40 FROM t1 WHERE c = 1;
+--source include/wait_condition.inc
+--connection slave
+--source include/wait_condition.inc
+
+# Check data
+--echo Check data on both clusters
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+
+source include/diff_tables.inc;
+
+--echo *** Transaction testing ***
+# Start transaction for one mysqld and do mass of inserts for other.
+# Do it for for both clusters
+
+--connection master
+BEGIN;
+--connection slave1
+BEGIN;
+let $counter= 100;
+--connection master
+--disable_query_log
+while ($counter) {
+ --connection master
+ INSERT INTO t1(b,c) VALUES('master',2);
+ --connection master1
+ INSERT INTO t1(b,c) VALUES('master1',2);
+ --connection slave
+ INSERT INTO t1(b,c) VALUES('slave',2);
+ --connection slave1
+ INSERT INTO t1(b,c) VALUES('slave1',2);
+ dec $counter;
+}
+--connection master
+--enable_query_log
+COMMIT;
+--connection slave1
+COMMIT;
+
+# Wait replication between clusters
+--connection master
+let $wait_condition= SELECT COUNT(*)=400 FROM t1 WHERE c = 2;
+--source include/wait_condition.inc
+--connection slave
+--source include/wait_condition.inc
+
+--echo Check data on both clusters
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+
+source include/diff_tables.inc;
+
+# Start transaction and then roll back
+
+--connection master
+BEGIN;
+--connection slave1
+BEGIN;
+let $counter= 100;
+--connection master
+--disable_query_log
+while ($counter) {
+ --connection master
+ INSERT INTO t1(b,c) VALUES('master',3);
+ --connection master1
+ INSERT INTO t1(b,c) VALUES('master1',3);
+ --connection slave
+ INSERT INTO t1(b,c) VALUES('slave',3);
+ --connection slave1
+ INSERT INTO t1(b,c) VALUES('slave1',3);
+ dec $counter;
+}
+--connection master
+--enable_query_log
+ROLLBACK;
+--connection slave1
+ROLLBACK;
+
+# Wait replication between clusters
+--connection master
+let $wait_condition= SELECT COUNT(*)=200 FROM t1 WHERE c = 3;
+--source include/wait_condition.inc
+--connection slave
+--source include/wait_condition.inc
+
+--echo Check data on both clusters
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+
+source include/diff_tables.inc;
+
+# Clean up
+--connection master
+DROP TABLE t1;
+--connection slave
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+--echo
+
+# End of test 5.1
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
index fcbff1392f4..d5ddfc2b739 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
@@ -49,7 +49,7 @@ sync_with_master;
# Check that there is no error in replication
--replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
# Check that we have the data on the master
@@ -76,5 +76,5 @@ SELECT * FROM t1 ORDER BY a;
# Check that there is no error in replication
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test
index be7fd1acd2e..8d5ad334766 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test
@@ -22,10 +22,7 @@ show variables like "%character_set_ser%";
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
-create table t1 (a int) ENGINE=NDB;
-drop table t1;
---connection master
CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
`nom` char(4) default NULL,
`prenom` char(4) default NULL,
@@ -35,8 +32,12 @@ CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
select * from t1 order by nid;
---sync_slave_with_master
+sync_slave_with_master;
# connect to slave and ensure data it there.
---connection slave
+connection slave;
select * from t1 order by nid;
+--echo ==== clean up ====
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test
index 2f2414ba578..fcc2928c5e2 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test
@@ -21,8 +21,8 @@ select count(*) from t2;
connection master;
begin;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
rollback;
select count(*) from t1;
@@ -35,8 +35,8 @@ connection master;
delete from t1;
delete from t2;
begin;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
rollback;
select count(*) from t1;
@@ -51,8 +51,8 @@ delete from t2;
begin;
insert into t2 values(3),(4);
insert into t1 values(3),(4);
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
+load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
rollback;
select count(*) from t1;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test
index a695eee3221..75fe2688b4a 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test
@@ -62,5 +62,5 @@ CREATE TABLE SERVER
#
# start "load" application
#
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/DbCreate >> $NDB_TOOLS_OUTPUT
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/DbAsyncGenerator >> $NDB_TOOLS_OUTPUT
+--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbCreate >> $NDB_TOOLS_OUTPUT
+--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbAsyncGenerator >> $NDB_TOOLS_OUTPUT
diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test
new file mode 100644
index 00000000000..14b76722fa6
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test
@@ -0,0 +1,450 @@
+# ==== Purpose ====
+#
+# Tests that transactions containing multiple table types are
+# replicated correctly to the slave.
+#
+# This test was previously part of rpl_ndb_transactions.
+#
+#
+# ==== Method ====
+#
+# Try all combinations of the following:
+# - Committed/rollback transactions.
+# - Transactions started by AUTOCOMMIT = 0 or BEGIN.
+# - Transactions using myisam, innodb, or ndb tables, or combinations
+# of them. For combinations, we use the engines in all possible
+# orders.
+# For single-engine transactions, we also try with AUTOCOMMIT = 1.
+#
+#
+# ==== Related bugs ====
+#
+# BUG#26395: if crash during autocommit update to transactional table on master, slave fails
+
+
+source include/have_ndb.inc;
+source include/ndb_master-slave.inc;
+source include/have_innodb.inc;
+
+CREATE TABLE tmyisam (a int) ENGINE = MYISAM;
+CREATE TABLE tinnodb (a int) ENGINE = INNODB;
+CREATE TABLE tndb (a int) ENGINE = NDB;
+
+SHOW CREATE TABLE tmyisam;
+SHOW CREATE TABLE tinnodb;
+SHOW CREATE TABLE tndb;
+
+
+--echo [on master]
+
+
+--echo ==== Single-engine transactions ====
+
+--echo ---- autocommitted ----
+
+SET AUTOCOMMIT = 1;
+
+INSERT INTO tmyisam VALUES (0);
+INSERT INTO tinnodb VALUES (1);
+INSERT INTO tndb VALUES (2);
+
+--echo ---- committed with BEGIN ----
+
+BEGIN;
+INSERT INTO tmyisam VALUES (3);
+INSERT INTO tmyisam VALUES (4);
+COMMIT;
+
+BEGIN;
+INSERT INTO tinnodb VALUES (5);
+INSERT INTO tinnodb VALUES (6);
+COMMIT;
+
+BEGIN;
+INSERT INTO tndb VALUES (7);
+INSERT INTO tndb VALUES (8);
+COMMIT;
+
+--echo ---- rolled back with BEGIN ----
+
+BEGIN;
+INSERT INTO tmyisam VALUES (9);
+INSERT INTO tmyisam VALUES (10);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tinnodb VALUES (11);
+INSERT INTO tinnodb VALUES (12);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tndb VALUES (13);
+INSERT INTO tndb VALUES (14);
+ROLLBACK;
+
+
+--echo ---- committed with AUTOCOMMIT = 0 ----
+
+SET AUTOCOMMIT = 0;
+
+INSERT INTO tmyisam VALUES (15);
+INSERT INTO tmyisam VALUES (16);
+COMMIT;
+
+INSERT INTO tinnodb VALUES (17);
+INSERT INTO tinnodb VALUES (18);
+COMMIT;
+
+INSERT INTO tndb VALUES (19);
+INSERT INTO tndb VALUES (20);
+COMMIT;
+
+--echo ---- rolled back with AUTOCOMMIT = 0 ----
+
+INSERT INTO tmyisam VALUES (21);
+INSERT INTO tmyisam VALUES (22);
+ROLLBACK;
+
+INSERT INTO tinnodb VALUES (23);
+INSERT INTO tinnodb VALUES (24);
+ROLLBACK;
+
+INSERT INTO tndb VALUES (25);
+INSERT INTO tndb VALUES (26);
+ROLLBACK;
+
+SET AUTOCOMMIT = 1;
+
+
+--echo ==== MyISAM + InnoDB ====
+
+--echo ---- committed with BEGIN ----
+
+BEGIN;
+INSERT INTO tmyisam VALUES (27);
+INSERT INTO tinnodb VALUES (28);
+COMMIT;
+
+BEGIN;
+INSERT INTO tinnodb VALUES (29);
+INSERT INTO tmyisam VALUES (30);
+COMMIT;
+
+--echo ---- rolled back with BEGIN ----
+
+BEGIN;
+INSERT INTO tmyisam VALUES (31);
+INSERT INTO tinnodb VALUES (32);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tinnodb VALUES (33);
+INSERT INTO tmyisam VALUES (34);
+ROLLBACK;
+
+--echo ---- committed with AUTOCOMMIT = 0 ----
+
+SET AUTOCOMMIT = 0;
+
+INSERT INTO tmyisam VALUES (35);
+INSERT INTO tinnodb VALUES (36);
+COMMIT;
+
+INSERT INTO tinnodb VALUES (37);
+INSERT INTO tmyisam VALUES (38);
+COMMIT;
+
+--echo ---- rolled back with AUTOCOMMIT = 0 ----
+
+INSERT INTO tmyisam VALUES (39);
+INSERT INTO tinnodb VALUES (40);
+ROLLBACK;
+
+INSERT INTO tinnodb VALUES (41);
+INSERT INTO tmyisam VALUES (42);
+ROLLBACK;
+
+SET AUTOCOMMIT = 1;
+
+
+--echo ==== MyISAM + NDB ====
+
+--echo ---- committed with BEGIN----
+
+BEGIN;
+INSERT INTO tmyisam VALUES (43);
+INSERT INTO tndb VALUES (44);
+COMMIT;
+
+BEGIN;
+INSERT INTO tndb VALUES (45);
+INSERT INTO tmyisam VALUES (46);
+COMMIT;
+
+--echo ---- rolled back with BEGIN ----
+
+BEGIN;
+INSERT INTO tmyisam VALUES (47);
+INSERT INTO tndb VALUES (48);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tndb VALUES (49);
+INSERT INTO tmyisam VALUES (50);
+ROLLBACK;
+
+--echo ---- committed with AUTOCOMMIT = 0 ----
+
+SET AUTOCOMMIT = 0;
+
+INSERT INTO tmyisam VALUES (51);
+INSERT INTO tndb VALUES (52);
+COMMIT;
+
+INSERT INTO tndb VALUES (53);
+INSERT INTO tmyisam VALUES (54);
+COMMIT;
+
+--echo ---- rolled back with AUTOCOMMIT = 0 ----
+
+INSERT INTO tmyisam VALUES (55);
+INSERT INTO tndb VALUES (56);
+ROLLBACK;
+
+INSERT INTO tndb VALUES (57);
+INSERT INTO tmyisam VALUES (58);
+ROLLBACK;
+
+SET AUTOCOMMIT = 1;
+
+
+--echo ==== InnoDB + NDB ====
+
+--echo ---- committed with BEGIN ----
+
+BEGIN;
+INSERT INTO tinnodb VALUES (59);
+INSERT INTO tndb VALUES (60);
+COMMIT;
+
+BEGIN;
+INSERT INTO tndb VALUES (61);
+INSERT INTO tinnodb VALUES (62);
+COMMIT;
+
+--echo ---- rolled back with BEGIN ----
+
+BEGIN;
+INSERT INTO tinnodb VALUES (63);
+INSERT INTO tndb VALUES (64);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tndb VALUES (65);
+INSERT INTO tinnodb VALUES (66);
+ROLLBACK;
+
+--echo ---- committed with AUTOCOMMIT = 0 ----
+
+SET AUTOCOMMIT = 0;
+
+INSERT INTO tinnodb VALUES (67);
+INSERT INTO tndb VALUES (68);
+COMMIT;
+
+INSERT INTO tndb VALUES (69);
+INSERT INTO tinnodb VALUES (70);
+COMMIT;
+
+--echo ---- rolled back with AUTOCOMMIT = 0 ----
+
+INSERT INTO tinnodb VALUES (71);
+INSERT INTO tndb VALUES (72);
+ROLLBACK;
+
+INSERT INTO tndb VALUES (73);
+INSERT INTO tinnodb VALUES (74);
+ROLLBACK;
+
+SET AUTOCOMMIT = 1;
+
+
+--echo ==== MyISAM + InnoDB + NDB ====
+
+--echo ---- committed with BEGIN ----
+
+BEGIN;
+INSERT INTO tmyisam VALUES (75);
+INSERT INTO tinnodb VALUES (76);
+INSERT INTO tndb VALUES (77);
+COMMIT;
+
+BEGIN;
+INSERT INTO tmyisam VALUES (78);
+INSERT INTO tndb VALUES (79);
+INSERT INTO tinnodb VALUES (80);
+COMMIT;
+
+BEGIN;
+INSERT INTO tinnodb VALUES (81);
+INSERT INTO tmyisam VALUES (82);
+INSERT INTO tndb VALUES (83);
+COMMIT;
+
+BEGIN;
+INSERT INTO tinnodb VALUES (84);
+INSERT INTO tndb VALUES (85);
+INSERT INTO tmyisam VALUES (86);
+COMMIT;
+
+BEGIN;
+INSERT INTO tndb VALUES (87);
+INSERT INTO tmyisam VALUES (88);
+INSERT INTO tinnodb VALUES (89);
+COMMIT;
+
+BEGIN;
+INSERT INTO tndb VALUES (90);
+INSERT INTO tinnodb VALUES (91);
+INSERT INTO tmyisam VALUES (92);
+COMMIT;
+
+--echo ---- rolled back with BEGIN ----
+
+BEGIN;
+INSERT INTO tmyisam VALUES (93);
+INSERT INTO tinnodb VALUES (94);
+INSERT INTO tndb VALUES (95);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tmyisam VALUES (96);
+INSERT INTO tndb VALUES (97);
+INSERT INTO tinnodb VALUES (98);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tinnodb VALUES (99);
+INSERT INTO tmyisam VALUES (100);
+INSERT INTO tndb VALUES (101);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tinnodb VALUES (102);
+INSERT INTO tndb VALUES (103);
+INSERT INTO tmyisam VALUES (104);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tndb VALUES (105);
+INSERT INTO tmyisam VALUES (106);
+INSERT INTO tinnodb VALUES (107);
+ROLLBACK;
+
+BEGIN;
+INSERT INTO tndb VALUES (108);
+INSERT INTO tinnodb VALUES (109);
+INSERT INTO tmyisam VALUES (110);
+ROLLBACK;
+
+--echo ---- committed with AUTOCOMMIT = 0 ----
+
+SET AUTOCOMMIT = 0;
+
+INSERT INTO tmyisam VALUES (111);
+INSERT INTO tinnodb VALUES (112);
+INSERT INTO tndb VALUES (113);
+COMMIT;
+
+INSERT INTO tmyisam VALUES (114);
+INSERT INTO tndb VALUES (115);
+INSERT INTO tinnodb VALUES (116);
+COMMIT;
+
+INSERT INTO tinnodb VALUES (117);
+INSERT INTO tmyisam VALUES (118);
+INSERT INTO tndb VALUES (119);
+COMMIT;
+
+INSERT INTO tinnodb VALUES (120);
+INSERT INTO tndb VALUES (121);
+INSERT INTO tmyisam VALUES (122);
+COMMIT;
+
+INSERT INTO tndb VALUES (123);
+INSERT INTO tmyisam VALUES (124);
+INSERT INTO tinnodb VALUES (125);
+COMMIT;
+
+INSERT INTO tndb VALUES (126);
+INSERT INTO tinnodb VALUES (127);
+INSERT INTO tmyisam VALUES (128);
+COMMIT;
+
+--echo ---- rolled back with AUTOCOMMIT = 0 ----
+
+INSERT INTO tmyisam VALUES (129);
+INSERT INTO tinnodb VALUES (130);
+INSERT INTO tndb VALUES (131);
+ROLLBACK;
+
+INSERT INTO tmyisam VALUES (132);
+INSERT INTO tndb VALUES (133);
+INSERT INTO tinnodb VALUES (134);
+ROLLBACK;
+
+INSERT INTO tinnodb VALUES (135);
+INSERT INTO tmyisam VALUES (136);
+INSERT INTO tndb VALUES (137);
+ROLLBACK;
+
+INSERT INTO tinnodb VALUES (138);
+INSERT INTO tndb VALUES (139);
+INSERT INTO tmyisam VALUES (140);
+ROLLBACK;
+
+INSERT INTO tndb VALUES (141);
+INSERT INTO tmyisam VALUES (142);
+INSERT INTO tinnodb VALUES (143);
+ROLLBACK;
+
+INSERT INTO tndb VALUES (144);
+INSERT INTO tinnodb VALUES (145);
+INSERT INTO tmyisam VALUES (146);
+ROLLBACK;
+
+SET AUTOCOMMIT = 1;
+
+
+--echo ==== Verify the result ====
+
+SELECT * FROM tmyisam ORDER BY a;
+SELECT * FROM tinnodb ORDER BY a;
+SELECT * FROM tndb ORDER BY a;
+
+--echo [on slave]
+--sync_slave_with_master
+
+let $diff_table_1=master:test.tmyisam;
+let $diff_table_2=slave:test.tmyisam;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test.tinnodb;
+let $diff_table_2=slave:test.tinnodb;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test.tndb;
+let $diff_table_2=slave:test.tndb;
+source include/diff_tables.inc;
+
+
+--echo ==== Clean up ====
+
+--echo [on master]
+connection master;
+DROP TABLE tmyisam, tinnodb, tndb;
+
+--echo [on slave]
+sync_slave_with_master;
+
+source include/master-slave-end.inc;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
index 1ee9aaf5372..eb128cfa2ce 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
@@ -64,4 +64,9 @@ sync_slave_with_master;
connection slave;
SELECT * FROM t1 ORDER BY c3;
+--echo ==== clean up ====
+connection server2;
+DROP TABLE t1;
+sync_slave_with_master;
+
STOP SLAVE;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
index 116f0879ca0..88572c3e9a2 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
@@ -39,8 +39,8 @@ SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
# we should have no tables
SHOW TABLES;
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
#
# BUG#11960
@@ -50,8 +50,8 @@ SHOW TABLES;
DROP DATABASE ndbsynctest;
CREATE DATABASE ndbsynctest;
USE ndbsynctest;
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
# continue test
SHOW TABLES;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-master.opt
deleted file mode 100644
index 5411960b4aa..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb --debug=d,do_not_write_xid
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test
deleted file mode 100644
index 5700e0fa422..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test
+++ /dev/null
@@ -1,131 +0,0 @@
-# Tests that transactions are replicated correctly, with various
-# combinations of non-transactional and transactional non-XA tables.
-# Also tests that an XA transaction where the master crashes just
-# before writing the XID log event is executed correctly. See below
-# for implementation details.
-
-source include/ndb_master-slave.inc;
-source include/have_ndb.inc;
-source include/have_debug.inc;
-
-CREATE TABLE tmyisam (a int) ENGINE = MYISAM;
-CREATE TABLE tinnodb (a int) ENGINE = INNODB;
-CREATE TABLE tndb (a int) ENGINE = NDB;
-
-SHOW CREATE TABLE tmyisam;
-SHOW CREATE TABLE tinnodb;
-SHOW CREATE TABLE tndb;
-
-
---echo ==== Test 1: Non-XA Engines ====
-# Test that everything works fine with non-XA engines. We just try
-# all ways to do transactions involving ndb and/or myisam, with
-# rollback or commit.
-
---echo --- on master ---
-
-SET AUTOCOMMIT = 1;
-
-INSERT INTO tndb VALUES (1);
-INSERT INTO tmyisam VALUES (1);
-
-BEGIN;
-INSERT INTO tndb VALUES (2);
-INSERT INTO tndb VALUES (3);
-COMMIT;
-
-BEGIN;
-INSERT INTO tmyisam VALUES (2);
-INSERT INTO tmyisam VALUES (3);
-COMMIT;
-
-BEGIN;
-INSERT INTO tndb VALUES (4);
-INSERT INTO tmyisam VALUES (4);
-COMMIT;
-
-BEGIN;
-INSERT INTO tndb VALUES (5);
-INSERT INTO tndb VALUES (6);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tmyisam VALUES (5);
-INSERT INTO tmyisam VALUES (6);
-#--warning 1196
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tndb VALUES (7);
-INSERT INTO tmyisam VALUES (7);
-#--warning 1196
-ROLLBACK;
-
-SELECT * FROM tndb ORDER BY a;
-SELECT * FROM tmyisam ORDER BY a;
-
---echo --- on slave ---
---sync_slave_with_master
-SELECT * FROM tndb ORDER BY a;
-SELECT * FROM tmyisam ORDER BY a;
-
-
---echo ==== Test 2: Master crash before writing XID event on XA engine ====
-# We now want to test the following scenario, to verify that BUG#26395
-# has been fixed:
-
-# "master and slave have a transactional table that uses XA. Master
-# has AUTOCOMMIT on and executes a statement (in this case an
-# INSERT). Master crashes just before writing the XID event."
-
-# In this scenario, master will roll back, so slave should not execute
-# the statement, and slave should roll back later when master is
-# restarted.
-
-# However, we want the master to be alive so that we are sure it
-# replicates the statement to the slave. So in the test case, we must
-# therefore not crash the master. Instead, we fake the crash by just
-# not writing the XID event to the binlog. This is done by the
-# --debug=d,do_not_write_xid flag in the .opt file.
-
-# So, unlike if the master had crashed, the master *will* execute the
-# statement. But the slave should not execute it. Hence, after the
-# first test is executed, the expected result on master is a table
-# with one row, and on slave a table with no rows.
-
-# To simulate the slave correctly, we wait until everything up to the
-# XID is replicated. We cannot sync_slave_with_master, because that
-# would wait for the transaction to end. Instead, we wait for
-# "sufficiently long time". Then we stop the slave.
-
-# Note: since this puts the master binlog in an inconsistent state,
-# this should be the last test of the file.
-
---echo --- on master ---
---connection master
-
-INSERT INTO tinnodb VALUES (1);
-SELECT * FROM tinnodb ORDER BY a;
-
---echo --- on slave ---
---connection slave
---sleep 3
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
-let $tmp= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1);
-eval SELECT "$tmp" AS Slave_IO_State;
-let $tmp= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-eval SELECT "$tmp" AS Last_SQL_Error;
-let $tmp= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1);
-eval SELECT "$tmp" AS Last_IO_Error;
-SELECT * FROM tinnodb ORDER BY a;
-
-# Clean up. We cannot do it on master and replicate over, because
-# master binlog is in a bad state after last test. So we do it both on
-# master and on slave.
---echo --- on master ---
-connection master;
-DROP TABLE tmyisam, tinnodb, tndb;
-
-connection slave;
-DROP TABLE tmyisam, tinnodb, tndb;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test
index 5067722bb79..543393b980d 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test
@@ -4,8 +4,8 @@
-- source include/ndb_master-slave.inc
--exec echo Running ndbapi_simple_dual
---exec $NDB_EXAMPLES_DIR/ndbapi_simple_dual/ndbapi_simple_dual $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" $SLAVE_MYSOCK "localhost:$NDBCLUSTER_PORT_SLAVE" >> $NDB_EXAMPLES_OUTPUT
+--exec $NDB_EXAMPLES_DIR/ndbapi_simple_dual/ndbapi_simple_dual $MASTER_MYSOCK "$NDB_CONNECTSTRING" $SLAVE_MYSOCK "$NDB_CONNECTSTRING_SLAVE" >> $NDB_EXAMPLES_OUTPUT
--exec echo Running mgmapi_logevent
---exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "localhost:$NDBCLUSTER_PORT" "localhost:$NDBCLUSTER_PORT_SLAVE" 1 >> $NDB_EXAMPLES_OUTPUT
+--exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "$NDB_CONNECTSTRING" "$NDB_CONNECTSTRING_SLAVE" 1 >> $NDB_EXAMPLES_OUTPUT
diff --git a/mysql-test/include/charset_basic.inc b/mysql-test/suite/sys_vars/inc/charset_basic.inc
index e3331697f2c..e3331697f2c 100644
--- a/mysql-test/include/charset_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/charset_basic.inc
diff --git a/mysql-test/include/collation_basic.inc b/mysql-test/suite/sys_vars/inc/collation_basic.inc
index be8ae36eeb8..be8ae36eeb8 100644
--- a/mysql-test/include/collation_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/collation_basic.inc
diff --git a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
index 996a9e712f9..e55673fd045 100644
--- a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
@@ -17,75 +17,79 @@
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
+# Modified: Horst Hunger 2008-11-27 #
+# Due to OS depending values the check has been changed #
+# from concrete values to ranges. #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
-# Changes: #
-# 2008-03-06 hhunger Got "lost connections with 5.1.24 #
-########################################################################
--source include/load_sysvars.inc
-########################################################################
+let $minimum_range= BETWEEN 8 AND 36;
+########################################################################
# START OF key_buffer_size TESTS #
-########################################################################
+########################################################################
--disable_warnings
-########################################################################
+########################################################################
# Saving initial value of key_buffer_size in a temporary variable #
-########################################################################
+########################################################################
SET @start_value = @@global.key_buffer_size;
-SELECT @start_value;
-
--echo '#--------------------FN_DYNVARS_055_01------------------------#'
-########################################################################
+########################################################################
# Display the DEFAULT value of key_buffer_size #
-########################################################################
+########################################################################
SET @@global.key_buffer_size = 99;
--Error ER_NO_DEFAULT
SET @@global.key_buffer_size = DEFAULT;
---echo 'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-
+eval SELECT @@global.key_buffer_size $minimum_range;
--echo '#---------------------FN_DYNVARS_055_02-------------------------#'
-###############################################
+###############################################
# Verify default value of variable #
-###############################################
+###############################################
SET @@global.key_buffer_size = @start_value;
SELECT @@global.key_buffer_size = @start_value;
--echo '#--------------------FN_DYNVARS_055_03------------------------#'
-########################################################################
+########################################################################
# Change the value of key_buffer_size to a valid value #
-########################################################################
+########################################################################
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@global.key_buffer_size= @min_key_buffer_size;
+SET @@global.key_buffer_size = 8 ;
+eval SELECT @@global.key_buffer_size $minimum_range;
--disable_warnings
-#Due to "lost connection"
+# The next subtest is set to comment because it will
+# be tried to allocate the buffer instantly which
+# might lead to a message about missing resources,
+# excessive runtime etc. especially if the main memory is less than 4GB.
#SET @@global.key_buffer_size = 4294967295;
--enable_warnings
#SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 1800;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
+eval SELECT @@global.key_buffer_size $minimum_range;
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--echo '#--------------------FN_DYNVARS_055_04-------------------------#'
-###########################################################################
+###########################################################################
# Change the value of key_buffer_size to invalid value #
-###########################################################################
-
-# Due to "lost connection"
+###########################################################################
+
+# The next subtests are set to comment because they will
+# be tried to allocate the buffer instantly which
+# might lead to a message about missing resources,
+# excessive runtime etc. especially if the main memory is less than 4GB.
+# The negative values lead to very big numbers, e.g. -1 to
+# a size of 18446744073709551615 bytes with a 32bit binary.
+# See Bug #42103.
#SET @@global.key_buffer_size = -1;
#SELECT @@global.key_buffer_size;
#SET @@global.key_buffer_size = 100000000000;
@@ -96,51 +100,49 @@ SELECT @@global.key_buffer_size;
#SET @@global.key_buffer_size = -1024;
#SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+eval SELECT @@global.key_buffer_size $minimum_range;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = ON;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
+eval SELECT @@global.key_buffer_size $minimum_range;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = 'test';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-
+eval SELECT @@global.key_buffer_size $minimum_range;
--echo '#-------------------FN_DYNVARS_055_05----------------------------#'
-###########################################################################
+###########################################################################
# Test if accessing session key_buffer_size gives error #
-###########################################################################
+###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.key_buffer_size = 0;
-SELECT @@key_buffer_size = @min_key_buffer_size;
-
+eval SELECT @@global.key_buffer_size $minimum_range;
--echo '#----------------------FN_DYNVARS_055_06------------------------#'
-##############################################################################
+##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
-SELECT @@global.key_buffer_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT @@global.key_buffer_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='key_buffer_size';
-SELECT @@key_buffer_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT @@key_buffer_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='key_buffer_size';
-
--echo '#---------------------FN_DYNVARS_055_07----------------------#'
-###################################################################
+###################################################################
# Check if TRUE and FALSE values can be used on variable #
-###################################################################
+###################################################################
+# The following assignment are accepted, but should be rejected
+# like the value ON (see above).
+# See Bug #42104
SET @@global.key_buffer_size = TRUE;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
+eval SELECT @@global.key_buffer_size $minimum_range;
SET @@global.key_buffer_size = FALSE;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-
+eval SELECT @@global.key_buffer_size $minimum_range;
--echo '#---------------------FN_DYNVARS_055_08----------------------#'
#####################################################################
@@ -150,18 +152,18 @@ SELECT @@global.key_buffer_size = @min_key_buffer_size;
# due to differences in contents of the warnings
--disable_warnings
-SET @@global.key_buffer_size = @min_key_buffer_size;
+SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
--enable_warnings
--echo '#---------------------FN_DYNVARS_055_09----------------------#'
-##########################################################################
+##########################################################################
# Check if key_buffer_size can be accessed with and without @@ sign #
##########################################################################
--Error ER_GLOBAL_VARIABLE
-SET key_buffer_size = @min_key_buffer_size;
-SELECT @@key_buffer_size = @min_key_buffer_size;
+SET key_buffer_size = 8 ;
+eval SELECT @@global.key_buffer_size $minimum_range;
--Error ER_PARSE_ERROR
SET local.key_buffer_size = 10;
--Error ER_UNKNOWN_TABLE
@@ -173,15 +175,14 @@ SELECT global.key_buffer_size;
--Error ER_BAD_FIELD_ERROR
SELECT key_buffer_size = @@session.key_buffer_size;
-
-##############################
+##############################
# Restore initial value #
##############################
SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size;
--enable_warnings
#######################################################################
# END OF key_buffer_size TESTS #
#######################################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc
index 1a3f9e1efe2..1f8c63c55bb 100644
--- a/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc
@@ -36,7 +36,6 @@
###############################################################################
SET @start_value = @@global.query_cache_size;
-SELECT @start_value;
--echo '#--------------------FN_DYNVARS_133_01------------------------#'
###############################################################################
@@ -53,7 +52,7 @@ SELECT @@global.query_cache_size;
###############################################
SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size = 0;
+SELECT @@global.query_cache_size = @start_value;
--echo '#--------------------FN_DYNVARS_133_03------------------------#'
################################################################################
@@ -167,7 +166,6 @@ SELECT query_cache_size = @@session.query_cache_size;
##############################
SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size;
########################################################################
# END OF query_cache_size TESTS #
diff --git a/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc
index 3a8608736c5..64eb3c4b329 100644
--- a/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc
@@ -74,8 +74,8 @@ SELECT @@session.query_prealloc_size = 8192;
SET @@global.query_prealloc_size = 8192;
SELECT @@global.query_prealloc_size ;
-SET @@global.query_prealloc_size = 4294967295;
-SELECT @@global.query_prealloc_size ;
+#SET @@global.query_prealloc_size = 4294967295;
+#SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = 655354;
SELECT @@global.query_prealloc_size ;
@@ -89,8 +89,8 @@ SELECT @@global.query_prealloc_size ;
SET @@session.query_prealloc_size = 8192;
SELECT @@session.query_prealloc_size ;
-SET @@session.query_prealloc_size = 4294967295;
-SELECT @@session.query_prealloc_size ;
+#SET @@session.query_prealloc_size = 4294967295;
+#SELECT @@session.query_prealloc_size ;
SET @@session.query_prealloc_size = 655345;
SELECT @@session.query_prealloc_size ;
@@ -106,11 +106,11 @@ SELECT @@session.query_prealloc_size ;
SET @@global.query_prealloc_size = 0;
SELECT @@global.query_prealloc_size ;
-SET @@global.query_prealloc_size = -1024;
-SELECT @@global.query_prealloc_size ;
+#SET @@global.query_prealloc_size = -1024;
+#SELECT @@global.query_prealloc_size ;
-SET @@global.query_prealloc_size = 429496729533;
-SELECT @@global.query_prealloc_size ;
+#SET @@global.query_prealloc_size = 429496729533;
+#SELECT @@global.query_prealloc_size ;
--Error ER_PARSE_ERROR
@@ -137,8 +137,8 @@ SELECT @@global.query_prealloc_size ;
SET @@session.query_prealloc_size = 0;
SELECT @@session.query_prealloc_size ;
-SET @@session.query_prealloc_size = -2;
-SELECT @@session.query_prealloc_size ;
+#SET @@session.query_prealloc_size = -2;
+#SELECT @@session.query_prealloc_size ;
--Error ER_PARSE_ERROR
diff --git a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
index 4dbae7c8847..19d8b442c2c 100644
--- a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
@@ -17,9 +17,12 @@
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
+# Modified: Horst Hunger, 2008-11-28 #
+# disabled warnings as they contain the values of this variable, #
+# modified the check of the value only checking a range. #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -29,7 +32,7 @@
######################################################################
-# START OF sort_buffer_size TESTS #
+# START OF sort_buffer_size TESTS #
######################################################################
@@ -37,65 +40,74 @@
# Save initial value #
#############################################################
-# due to difference when running on Windows (bug filed)
+# due to differences when running on Windows (Bug#36695)
--source include/not_windows.inc
+let $kbrange32 = BETWEEN 32776 AND 32999;
+let $mbrange2 = BETWEEN 2097116 AND 2100000;
+
+--disable_warnings
+
SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
-
--echo '#--------------------FN_DYNVARS_151_01-------------------------#'
######################################################################
-# Display the DEFAULT value of sort_buffer_size #
+# Display the DEFAULT value of sort_buffer_size #
######################################################################
SET @@global.sort_buffer_size = 1000;
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
+eval
+SELECT @@global.sort_buffer_size $mbrange2;
SET @@session.sort_buffer_size = 2000;
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
+eval
+SELECT @@session.sort_buffer_size $mbrange2;
--echo '#--------------------FN_DYNVARS_151_02-------------------------#'
######################################################################
-# Check the DEFAULT value of sort_buffer_size #
+# Check the DEFAULT value of sort_buffer_size #
######################################################################
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
+eval
+SELECT @@global.sort_buffer_size $mbrange2;
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
+eval
+SELECT @@session.sort_buffer_size $mbrange2;
--echo '#--------------------FN_DYNVARS_151_03-------------------------#'
################################################################################
-# Change the value of sort_buffer_size to a valid value for GLOBAL Scope #
+# Change the value of sort_buffer_size to a valid value for GLOBAL Scope #
################################################################################
SET @@global.sort_buffer_size = 32776;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
SET @@global.sort_buffer_size = 32777;
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
---echo 'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
--echo '#--------------------FN_DYNVARS_151_04-------------------------#'
###################################################################################
-# Change the value of sort_buffer_size to a valid value for SESSION Scope #
+# Change the value of sort_buffer_size to a valid value for SESSION Scope #
###################################################################################
SET @@session.sort_buffer_size = 32776;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+eval
+SELECT @@session.sort_buffer_size $kbrange32;
SET @@session.sort_buffer_size = 32777;
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
+eval
+SELECT @@session.sort_buffer_size $kbrange32;
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
SET @@session.sort_buffer_size = 4294967294;
@@ -104,13 +116,15 @@ SELECT @@session.sort_buffer_size;
--echo '#------------------FN_DYNVARS_151_05-----------------------#'
##################################################################
-# Change the value of sort_buffer_size to an invalid value #
+# Change the value of sort_buffer_size to an invalid value #
##################################################################
SET @@global.sort_buffer_size = 32775;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
SET @@global.sort_buffer_size = -1024;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
--Error ER_PARSE_ERROR
@@ -121,19 +135,18 @@ SET @@global.sort_buffer_size = test;
SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = 32775;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+eval
+SELECT @@session.sort_buffer_size $kbrange32;
SET @@session.sort_buffer_size = -2;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+eval
+SELECT @@session.sort_buffer_size $kbrange32;
--Error ER_PARSE_ERROR
SET @@session.sort_buffer_size = 65530.34.;
SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.sort_buffer_size = test;
-SELECT @@session.sort_buffer_size;
-
--echo '#------------------FN_DYNVARS_151_06-----------------------#'
####################################################################
@@ -141,14 +154,16 @@ SELECT @@session.sort_buffer_size;
####################################################################
-SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM
+ INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
--echo '#------------------FN_DYNVARS_151_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
-SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
--echo '#------------------FN_DYNVARS_151_08-----------------------#'
@@ -157,25 +172,24 @@ SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSI
####################################################################
SET @@global.sort_buffer_size = TRUE;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
SET @@global.sort_buffer_size = FALSE;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-echo 'Bug: Errors should be displayed on assigning TRUE/FALSE to variable';
-
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
--echo '#---------------------FN_DYNVARS_151_09----------------------#'
####################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
+# Check if accessing variable with and without GLOBAL point to same variable #
####################################################################################
SET @@global.sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
-
--echo '#---------------------FN_DYNVARS_151_10----------------------#'
-########################################################################################################
-# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
-########################################################################################################
+###################################################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable#
+###################################################################################################
SET @@sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
@@ -184,12 +198,12 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
--echo '#---------------------FN_DYNVARS_151_11----------------------#'
###################################################################################
-# Check if sort_buffer_size can be accessed with and without @@ sign #
+# Check if sort_buffer_size can be accessed with and without @@ sign #
###################################################################################
SET sort_buffer_size = 9100;
-SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
-SELECT @@sort_buffer_size;
+eval
+SELECT @@sort_buffer_size $kbrange32;
--Error ER_UNKNOWN_TABLE
SELECT local.sort_buffer_size;
--Error ER_UNKNOWN_TABLE
@@ -203,11 +217,11 @@ SELECT sort_buffer_size = @@session.sort_buffer_size;
####################################
SET @@global.sort_buffer_size = @start_global_value;
-SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = @start_session_value;
-SELECT @@session.sort_buffer_size;
+--enable_warnings
#############################################################
-# END OF sort_buffer_size TESTS #
+# END OF sort_buffer_size TESTS #
#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/timestamp_basic.inc b/mysql-test/suite/sys_vars/inc/timestamp_basic.inc
index d7ad620ec26..9ef57c97043 100644
--- a/mysql-test/suite/sys_vars/inc/timestamp_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/timestamp_basic.inc
@@ -18,8 +18,8 @@
# * Scope & Access method #
# * Data Integrity #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -102,9 +102,10 @@ SET @@timestamp = 9999999999999999999999;
# Check if the value in SESSION Table matches value in variable #
#########################################################################
-SELECT @@timestamp = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='timestamp';
+# disabled due to bug#41584
+#SELECT @@timestamp = VARIABLE_VALUE
+#FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+#WHERE VARIABLE_NAME='timestamp';
--echo '#---------------------FN_DYNVARS_001_08-------------------------#'
#############################################################################
diff --git a/mysql-test/r/auto_commit_basic.result b/mysql-test/suite/sys_vars/r/auto_commit_basic.result
index c3643aaa1db..c3643aaa1db 100644
--- a/mysql-test/r/auto_commit_basic.result
+++ b/mysql-test/suite/sys_vars/r/auto_commit_basic.result
diff --git a/mysql-test/r/auto_increment_increment_basic.result b/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
index c453d2322cf..c453d2322cf 100644
--- a/mysql-test/r/auto_increment_increment_basic.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
diff --git a/mysql-test/r/auto_increment_increment_func.result b/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
index f0f1ada6d95..f0f1ada6d95 100644
--- a/mysql-test/r/auto_increment_increment_func.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
diff --git a/mysql-test/r/auto_increment_offset_basic.result b/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
index b5ccca8ce56..b5ccca8ce56 100644
--- a/mysql-test/r/auto_increment_offset_basic.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
diff --git a/mysql-test/r/auto_increment_offset_func.result b/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
index 5c953544e73..5c953544e73 100644
--- a/mysql-test/r/auto_increment_offset_func.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
diff --git a/mysql-test/r/autocommit_func.result b/mysql-test/suite/sys_vars/r/autocommit_func.result
index 47c2c921022..47c2c921022 100644
--- a/mysql-test/r/autocommit_func.result
+++ b/mysql-test/suite/sys_vars/r/autocommit_func.result
diff --git a/mysql-test/r/automatic_sp_privileges_basic.result b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
index b9cf9b5ee80..b9cf9b5ee80 100644
--- a/mysql-test/r/automatic_sp_privileges_basic.result
+++ b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
diff --git a/mysql-test/r/automatic_sp_privileges_func.result b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_func.result
index dac956fb091..dac956fb091 100644
--- a/mysql-test/r/automatic_sp_privileges_func.result
+++ b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_func.result
diff --git a/mysql-test/r/basedir_basic.result b/mysql-test/suite/sys_vars/r/basedir_basic.result
index 9b18f08305c..9b18f08305c 100644
--- a/mysql-test/r/basedir_basic.result
+++ b/mysql-test/suite/sys_vars/r/basedir_basic.result
diff --git a/mysql-test/r/big_tables_basic.result b/mysql-test/suite/sys_vars/r/big_tables_basic.result
index 937576a76d3..937576a76d3 100644
--- a/mysql-test/r/big_tables_basic.result
+++ b/mysql-test/suite/sys_vars/r/big_tables_basic.result
diff --git a/mysql-test/r/binlog_format_basic.result b/mysql-test/suite/sys_vars/r/binlog_format_basic.result
index 72ba35cd753..0d76d9686e3 100644
--- a/mysql-test/r/binlog_format_basic.result
+++ b/mysql-test/suite/sys_vars/r/binlog_format_basic.result
@@ -2,6 +2,7 @@ SELECT @@GLOBAL.binlog_format;
@@GLOBAL.binlog_format
STATEMENT
'#---------------------BS_STVARS_002_01----------------------#'
+SET @start_value= @@global.binlog_format;
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
@@ -12,19 +13,13 @@ COUNT(@@SESSION.binlog_format)
1 Expected
'#---------------------BS_STVARS_002_02----------------------#'
SET @@GLOBAL.binlog_format=1;
-Expected error 'Read only variable'
-Bug: Writeable static variable
-SELECT COUNT(@@GLOBAL.binlog_format);
-COUNT(@@GLOBAL.binlog_format)
-1
-1 Expected
+SELECT @@GLOBAL.binlog_format;
+@@GLOBAL.binlog_format
+STATEMENT
SET @@SESSION.binlog_format=1;
-Expected error 'Read only variable'
-Bug: Writeable static variable
-SELECT COUNT(@@SESSION.binlog_format);
-COUNT(@@SESSION.binlog_format)
-1
-1 Expected
+SELECT @@SESSION.binlog_format;
+@@SESSION.binlog_format
+STATEMENT
'#---------------------BS_STVARS_002_03----------------------#'
SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -37,14 +32,14 @@ COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_002_04----------------------#'
-SELECT @@SESSION.binlog_format = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT @@SESSION.binlog_format = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
@@SESSION.binlog_format = VARIABLE_VALUE
1
@@ -54,7 +49,7 @@ COUNT(@@SESSION.binlog_format)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
COUNT(VARIABLE_VALUE)
1
@@ -76,3 +71,4 @@ SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
+SET @@global.binlog_format= @start_value;
diff --git a/mysql-test/r/character_set_client_basic.result b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
index c946d5109a8..c946d5109a8 100644
--- a/mysql-test/r/character_set_client_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
diff --git a/mysql-test/r/character_set_client_func.result b/mysql-test/suite/sys_vars/r/character_set_client_func.result
index 087db21639b..087db21639b 100644
--- a/mysql-test/r/character_set_client_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_client_func.result
diff --git a/mysql-test/r/character_set_connection_basic.result b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
index 18697a20fb9..18697a20fb9 100644
--- a/mysql-test/r/character_set_connection_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
diff --git a/mysql-test/r/character_set_connection_func.result b/mysql-test/suite/sys_vars/r/character_set_connection_func.result
index 2f5d28ec8af..6fc33a4f369 100644
--- a/mysql-test/r/character_set_connection_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_connection_func.result
@@ -15,7 +15,7 @@ utf8
'#--------------------FN_DYNVARS_011_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1(b CHAR(40) character set utf8);
+CREATE TABLE t1(b CHAR(40) CHARACTER SET utf8);
'--verify that character_set_connection converts character_set_client--'
SET @@session.character_set_client = utf8;
SET @@session.character_set_results = utf8;
@@ -53,3 +53,4 @@ SET @@global.character_set_connection = @global_character_set_connection;
SET @@session.character_set_connection = @session_character_set_connection;
SET @@session.character_set_client = @session_character_set_client;
SET @@session.character_set_results = @session_character_set_results;
+DROP TABLE t1;
diff --git a/mysql-test/r/character_set_database_basic.result b/mysql-test/suite/sys_vars/r/character_set_database_basic.result
index 4380fea4c81..4380fea4c81 100644
--- a/mysql-test/r/character_set_database_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_database_basic.result
diff --git a/mysql-test/r/character_set_database_func.result b/mysql-test/suite/sys_vars/r/character_set_database_func.result
index 95b65eacfd2..746824c58ff 100644
--- a/mysql-test/r/character_set_database_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_database_func.result
@@ -2,6 +2,7 @@
SET @global_character_set_database = @@global.character_set_database;
SET @session_character_set_database = @@session.character_set_database;
SET @session_character_set_server = @@session.character_set_server;
+SET @global_character_set_server = @@global.character_set_server;
SET @@global.character_set_database = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
@@ -59,18 +60,27 @@ USE test;
CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
'Verify with latin';
SET @@session.character_set_database = latin1;
-LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data_ln/charset_utf8.txt' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/charset_utf8.txt' INTO TABLE t1;
SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
count(*)
2433
TRUNCATE TABLE t1;
'Verify with utf8';
SET @@session.character_set_database = utf8;
-LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data_ln/charset_utf8.txt' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/charset_utf8.txt' INTO TABLE t1;
SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
count(*)
1
DROP TABLE IF EXISTS t1;
+'Bug#27208: If no current database, character_set_database !=character_set_server'
+SET GLOBAL character_set_server=latin5;
+CREATE DATABASE csdb CHARACTER SET = utf8;
+USE csdb;
+DROP DATABASE csdb;
+SELECT @@character_set_database;
+@@character_set_database
+latin5
SET @@global.character_set_database = @global_character_set_database;
SET @@session.character_set_database = @session_character_set_database;
SET @@session.character_set_server = @session_character_set_server;
+SET @@global.character_set_server = @global_character_set_server;
diff --git a/mysql-test/r/character_set_filesystem_basic.result b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
index 11f85528593..11f85528593 100644
--- a/mysql-test/r/character_set_filesystem_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
diff --git a/mysql-test/r/character_set_results_basic.result b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
index 71c01a3dc0d..71c01a3dc0d 100644
--- a/mysql-test/r/character_set_results_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
Binary files differ
diff --git a/mysql-test/r/character_set_results_func.result b/mysql-test/suite/sys_vars/r/character_set_results_func.result
index d92821fdfa6..d92821fdfa6 100644
--- a/mysql-test/r/character_set_results_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_results_func.result
diff --git a/mysql-test/r/character_set_server_basic.result b/mysql-test/suite/sys_vars/r/character_set_server_basic.result
index 83545128a76..83545128a76 100644
--- a/mysql-test/r/character_set_server_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_server_basic.result
diff --git a/mysql-test/r/character_set_server_func.result b/mysql-test/suite/sys_vars/r/character_set_server_func.result
index 3731f27adae..3731f27adae 100644
--- a/mysql-test/r/character_set_server_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_server_func.result
diff --git a/mysql-test/r/character_set_system_basic.result b/mysql-test/suite/sys_vars/r/character_set_system_basic.result
index 9f4b68ae861..9f4b68ae861 100644
--- a/mysql-test/r/character_set_system_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_system_basic.result
diff --git a/mysql-test/r/collation_connection_basic.result b/mysql-test/suite/sys_vars/r/collation_connection_basic.result
index bc6074e2614..bc6074e2614 100644
--- a/mysql-test/r/collation_connection_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_connection_basic.result
diff --git a/mysql-test/r/collation_connection_func.result b/mysql-test/suite/sys_vars/r/collation_connection_func.result
index 18f82dc60e1..18f82dc60e1 100644
--- a/mysql-test/r/collation_connection_func.result
+++ b/mysql-test/suite/sys_vars/r/collation_connection_func.result
diff --git a/mysql-test/r/collation_database_basic.result b/mysql-test/suite/sys_vars/r/collation_database_basic.result
index d4375b7c8e4..d4375b7c8e4 100644
--- a/mysql-test/r/collation_database_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_database_basic.result
diff --git a/mysql-test/r/collation_database_func.result b/mysql-test/suite/sys_vars/r/collation_database_func.result
index dae8677eecf..dae8677eecf 100644
--- a/mysql-test/r/collation_database_func.result
+++ b/mysql-test/suite/sys_vars/r/collation_database_func.result
diff --git a/mysql-test/r/collation_server_basic.result b/mysql-test/suite/sys_vars/r/collation_server_basic.result
index 5e36643a3c9..5e36643a3c9 100644
--- a/mysql-test/r/collation_server_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_server_basic.result
diff --git a/mysql-test/r/collation_server_func.result b/mysql-test/suite/sys_vars/r/collation_server_func.result
index 98672bc452b..98672bc452b 100644
--- a/mysql-test/r/collation_server_func.result
+++ b/mysql-test/suite/sys_vars/r/collation_server_func.result
diff --git a/mysql-test/r/completion_type_basic.result b/mysql-test/suite/sys_vars/r/completion_type_basic.result
index 93bfe581182..93bfe581182 100644
--- a/mysql-test/r/completion_type_basic.result
+++ b/mysql-test/suite/sys_vars/r/completion_type_basic.result
diff --git a/mysql-test/r/completion_type_func.result b/mysql-test/suite/sys_vars/r/completion_type_func.result
index 282bd1006cd..daee738c10d 100644
--- a/mysql-test/r/completion_type_func.result
+++ b/mysql-test/suite/sys_vars/r/completion_type_func.result
@@ -1,67 +1,67 @@
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
## Creating new table ##
CREATE TABLE t1
(
-id INT NOT NULL auto_increment,
+id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
-name varchar(30)
+name VARCHAR(30)
) ENGINE = INNODB;
'#--------------------FN_DYNVARS_017_01-------------------------#'
## Creating new connection ##
-INSERT into t1(name) values('Record_1');
+INSERT INTO t1(name) VALUES('Record_1');
SET @@autocommit = 0;
-SELECT * from t1;
+SELECT * FROM t1;
id name
1 Record_1
## Setting value of variable to 0 ##
SET @@session.completion_type = 0;
## Here commit & rollback should work normally ##
START TRANSACTION;
-SELECT * from t1;
+SELECT * FROM t1;
id name
1 Record_1
-INSERT into t1(name) values('Record_2');
-INSERT into t1(name) values('Record_3');
-SELECT * from t1;
+INSERT INTO t1(name) VALUES('Record_2');
+INSERT INTO t1(name) VALUES('Record_3');
+SELECT * FROM t1;
id name
1 Record_1
2 Record_2
3 Record_3
-DELETE FROM t1 where id = 2;
-SELECT * from t1;
+DELETE FROM t1 WHERE id = 2;
+SELECT * FROM t1;
id name
1 Record_1
3 Record_3
START TRANSACTION;
-SELECT * from t1;
+SELECT * FROM t1;
id name
1 Record_1
3 Record_3
-INSERT into t1(name) values('Record_4');
-INSERT into t1(name) values('Record_5');
+INSERT INTO t1(name) VALUES('Record_4');
+INSERT INTO t1(name) VALUES('Record_5');
COMMIT;
'#--------------------FN_DYNVARS_017_02-------------------------#'
SET @@session.completion_type = 2;
## Here commit should work as COMMIT RELEASE ##
START TRANSACTION;
-SELECT * from t1;
+SELECT * FROM t1;
id name
1 Record_1
3 Record_3
4 Record_4
5 Record_5
-INSERT into t1(name) values('Record_6');
-INSERT into t1(name) values('Record_7');
+INSERT INTO t1(name) VALUES('Record_6');
+INSERT INTO t1(name) VALUES('Record_7');
COMMIT;
## Inserting rows should give error here because connection should ##
## disconnect after using COMMIT ##
-INSERT into t1(name) values('Record_4');
+INSERT INTO t1(name) VALUES('Record_4');
Got one of the listed errors
## Creating new connection test_con2 ##
SET @@session.completion_type = 2;
## Inserting rows and using Rollback which should Rollback & release ##
START TRANSACTION;
-SELECT * from t1;
+SELECT * FROM t1;
id name
1 Record_1
3 Record_3
@@ -69,8 +69,9 @@ id name
5 Record_5
6 Record_6
7 Record_7
-INSERT into t1(name) values('Record_8');
-INSERT into t1(name) values('Record_9');
+INSERT INTO t1(name) VALUES('Record_8');
+INSERT INTO t1(name) VALUES('Record_9');
ROLLBACK;
-INSERT into t1(name) values('Record_4');
+INSERT INTO t1(name) VALUES('Record_4');
Got one of the listed errors
+DROP TABLE t1;
diff --git a/mysql-test/r/concurrent_insert_basic.result b/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
index e6614ea6abb..e6614ea6abb 100644
--- a/mysql-test/r/concurrent_insert_basic.result
+++ b/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
diff --git a/mysql-test/suite/sys_vars/r/concurrent_insert_func.result b/mysql-test/suite/sys_vars/r/concurrent_insert_func.result
new file mode 100644
index 00000000000..774775a8287
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/concurrent_insert_func.result
@@ -0,0 +1,121 @@
+DROP TABLE IF EXISTS t1;
+## Creating new table ##
+CREATE TABLE t1
+(
+name VARCHAR(30)
+);
+'#--------------------FN_DYNVARS_018_01-------------------------#'
+SET @start_value= @@global.concurrent_insert;
+## Setting initial value of variable to 1 ##
+SET @@global.concurrent_insert = 1;
+INSERT INTO t1(name) VALUES('Record_1');
+INSERT INTO t1(name) VALUES('Record_2');
+INSERT INTO t1(name) VALUES('Record_3');
+## locking table ##
+LOCK TABLE t1 READ LOCAL;
+## Creating new connection to insert some rows in table ##
+connection test_con1;
+## New records should come at the end of all rows ##
+INSERT INTO t1(name) VALUES('Record_4');
+SELECT * FROM t1;
+name
+Record_1
+Record_2
+Record_3
+Record_4
+## unlocking tables ##
+connection default;
+UNLOCK TABLES;
+## deleting record to create hole in table ##
+DELETE FROM t1 WHERE name ='Record_2';
+'#--------------------FN_DYNVARS_018_02-------------------------#'
+LOCK TABLE t1 READ LOCAL;
+connection test_con1;
+SET @@global.concurrent_insert=1;
+## send INSERT which should be blocked until unlock of the table ##
+INSERT INTO t1(name) VALUES('Record_7');
+connection default;
+## show processlist info and state ##
+SELECT state,info FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE state= "Locked" AND info LIKE "INSERT INTO t1%";
+state info
+Locked INSERT INTO t1(name) VALUES('Record_7')
+## table contents befor UNLOCK ##
+SELECT * FROM t1;
+name
+Record_1
+Record_3
+Record_4
+UNLOCK TABLES;
+## table contens after UNLOCK ##
+SELECT * FROM t1;
+name
+Record_1
+Record_7
+Record_3
+Record_4
+INSERT INTO t1(name) VALUES('Record_6');
+connection test_con1;
+SELECT * FROM t1;
+name
+Record_1
+Record_7
+Record_3
+Record_4
+Record_6
+connection default;
+'#--------------------FN_DYNVARS_018_03-------------------------#'
+## lock table and connect with connection1 ##
+LOCK TABLE t1 READ LOCAL;
+connection test_con1;
+## setting value of concurrent_insert to 2 ##
+SET @@global.concurrent_insert=2;
+## Inserting record in table, record should go at the end of the table ##
+INSERT INTO t1(name) VALUES('Record_5');
+SELECT * FROM t1;
+name
+Record_1
+Record_7
+Record_3
+Record_4
+Record_6
+Record_5
+SELECT @@concurrent_insert;
+@@concurrent_insert
+2
+connection default;
+## Unlocking table ##
+UNLOCK TABLES;
+SELECT * FROM t1;
+name
+Record_1
+Record_7
+Record_3
+Record_4
+Record_6
+Record_5
+## Inserting new row, this should go in the hole ##
+INSERT INTO t1(name) VALUES('Record_6');
+SELECT * FROM t1;
+name
+Record_1
+Record_7
+Record_3
+Record_4
+Record_6
+Record_5
+Record_6
+## connection test_con1 ##
+DELETE FROM t1 WHERE name ='Record_3';
+SELECT * FROM t1;
+name
+Record_1
+Record_7
+Record_4
+Record_6
+Record_5
+Record_6
+## Dropping table ##
+DROP TABLE t1;
+## Disconnecting connection ##
+SET @@global.concurrent_insert= @start_value;
diff --git a/mysql-test/r/connect_timeout_basic.result b/mysql-test/suite/sys_vars/r/connect_timeout_basic.result
index 7cdd747fc15..7cdd747fc15 100644
--- a/mysql-test/r/connect_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/connect_timeout_basic.result
diff --git a/mysql-test/r/datadir_basic.result b/mysql-test/suite/sys_vars/r/datadir_basic.result
index ade6f2873e8..ade6f2873e8 100644
--- a/mysql-test/r/datadir_basic.result
+++ b/mysql-test/suite/sys_vars/r/datadir_basic.result
diff --git a/mysql-test/r/default_week_format_basic.result b/mysql-test/suite/sys_vars/r/default_week_format_basic.result
index d513ef1c41e..d513ef1c41e 100644
--- a/mysql-test/r/default_week_format_basic.result
+++ b/mysql-test/suite/sys_vars/r/default_week_format_basic.result
diff --git a/mysql-test/r/default_week_format_func.result b/mysql-test/suite/sys_vars/r/default_week_format_func.result
index 279a1785255..279a1785255 100644
--- a/mysql-test/r/default_week_format_func.result
+++ b/mysql-test/suite/sys_vars/r/default_week_format_func.result
diff --git a/mysql-test/r/delay_key_write_basic.result b/mysql-test/suite/sys_vars/r/delay_key_write_basic.result
index 100c62ac47e..100c62ac47e 100644
--- a/mysql-test/r/delay_key_write_basic.result
+++ b/mysql-test/suite/sys_vars/r/delay_key_write_basic.result
diff --git a/mysql-test/r/delay_key_write_func.result b/mysql-test/suite/sys_vars/r/delay_key_write_func.result
index ca4e25e08b1..d55cca7ab8e 100644
--- a/mysql-test/r/delay_key_write_func.result
+++ b/mysql-test/suite/sys_vars/r/delay_key_write_func.result
@@ -1,4 +1,5 @@
'#--------------------FN_DYNVARS_023_01-------------------------#'
+SET @start_value= @@global.delay_key_write;
SET @@global.delay_key_write = ON;
SELECT @@global.delay_key_write;
@@global.delay_key_write
@@ -28,8 +29,8 @@ Key_writes 9
SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value
Key_write_requests 9
-select count(*) from t1;
-count(*)
+SELECT COUNT(*) FROM t1;
+COUNT(*)
9
'----check when delay_key_write is ON---'
SET @@global.delay_key_write = ON;
@@ -44,8 +45,8 @@ Key_writes 0
SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value
Key_write_requests 9
-select count(*) from t1;
-count(*)
+SELECT COUNT(*) FROM t1;
+COUNT(*)
9
'----check when delay_key_write is ALL---'
SET @@global.delay_key_write = ALL;
@@ -60,8 +61,9 @@ Key_writes 0
SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value
Key_write_requests 9
-select count(*) from t1;
-count(*)
+SELECT COUNT(*) FROM t1;
+COUNT(*)
9
DROP PROCEDURE sp_addRecords;
DROP TABLE t1;
+SET @@global.delay_key_write= @start_value;
diff --git a/mysql-test/r/delayed_insert_limit_func.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
index d7129d24498..d7129d24498 100644
--- a/mysql-test/r/delayed_insert_limit_func.result
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
diff --git a/mysql-test/r/delayed_insert_timeout_basic.result b/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
index 4049907eb80..4049907eb80 100644
--- a/mysql-test/r/delayed_insert_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
diff --git a/mysql-test/r/div_precision_increment_basic.result b/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
index d0311afa681..d0311afa681 100644
--- a/mysql-test/r/div_precision_increment_basic.result
+++ b/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
diff --git a/mysql-test/r/div_precision_increment_func.result b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
index eb1fc7ae3a7..eb1fc7ae3a7 100644
--- a/mysql-test/r/div_precision_increment_func.result
+++ b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
diff --git a/mysql-test/r/engine_condition_pushdown_basic.result b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
index 7073066c2f1..7073066c2f1 100644
--- a/mysql-test/r/engine_condition_pushdown_basic.result
+++ b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
diff --git a/mysql-test/r/error_count_basic.result b/mysql-test/suite/sys_vars/r/error_count_basic.result
index ea48b7d5b73..ea48b7d5b73 100644
--- a/mysql-test/r/error_count_basic.result
+++ b/mysql-test/suite/sys_vars/r/error_count_basic.result
diff --git a/mysql-test/r/event_scheduler_basic.result b/mysql-test/suite/sys_vars/r/event_scheduler_basic.result
index 8042187d39d..8042187d39d 100644
--- a/mysql-test/r/event_scheduler_basic.result
+++ b/mysql-test/suite/sys_vars/r/event_scheduler_basic.result
diff --git a/mysql-test/r/event_scheduler_func.result b/mysql-test/suite/sys_vars/r/event_scheduler_func.result
index 8da942e919c..8da942e919c 100644
--- a/mysql-test/r/event_scheduler_func.result
+++ b/mysql-test/suite/sys_vars/r/event_scheduler_func.result
diff --git a/mysql-test/r/expire_logs_days_basic.result b/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
index 66aa5fa42a5..66aa5fa42a5 100644
--- a/mysql-test/r/expire_logs_days_basic.result
+++ b/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
diff --git a/mysql-test/r/flush_basic.result b/mysql-test/suite/sys_vars/r/flush_basic.result
index 259f8f929a1..259f8f929a1 100644
--- a/mysql-test/r/flush_basic.result
+++ b/mysql-test/suite/sys_vars/r/flush_basic.result
diff --git a/mysql-test/r/foreign_key_checks_basic.result b/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result
index e09e680fe99..e09e680fe99 100644
--- a/mysql-test/r/foreign_key_checks_basic.result
+++ b/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result
diff --git a/mysql-test/r/foreign_key_checks_func.result b/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
index c2898293f83..c2898293f83 100644
--- a/mysql-test/r/foreign_key_checks_func.result
+++ b/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
diff --git a/mysql-test/r/ft_boolean_syntax_basic.result b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_basic.result
index 94a052172bb..94a052172bb 100644
--- a/mysql-test/r/ft_boolean_syntax_basic.result
+++ b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_basic.result
diff --git a/mysql-test/r/ft_boolean_syntax_func.result b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
index 4a3159c77c3..4a3159c77c3 100644
--- a/mysql-test/r/ft_boolean_syntax_func.result
+++ b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
diff --git a/mysql-test/r/general_log_basic.result b/mysql-test/suite/sys_vars/r/general_log_basic.result
index 18a5fde45c0..18a5fde45c0 100644
--- a/mysql-test/r/general_log_basic.result
+++ b/mysql-test/suite/sys_vars/r/general_log_basic.result
diff --git a/mysql-test/r/general_log_file_basic.result b/mysql-test/suite/sys_vars/r/general_log_file_basic.result
index 6847d92688e..48a8d90b55e 100644
--- a/mysql-test/r/general_log_file_basic.result
+++ b/mysql-test/suite/sys_vars/r/general_log_file_basic.result
@@ -6,7 +6,7 @@ test.log
SET @@global.general_log_file = DEFAULT;
SELECT RIGHT(@@global.general_log_file,10) AS log_file;
log_file
-master.log
+mysqld.log
'#--------------------FN_DYNVARS_004_02------------------------#'
SET @@global.general_log_file = mytest.log;
SET @@global.general_log_file = 12;
@@ -17,3 +17,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='general_log_file';
@@global.general_log_file = VARIABLE_VALUE
1
+SET @@global.general_log_file= @start_value;
diff --git a/mysql-test/r/general_log_file_func.result b/mysql-test/suite/sys_vars/r/general_log_file_func.result
index 42ef723e644..482a03c1a97 100644
--- a/mysql-test/r/general_log_file_func.result
+++ b/mysql-test/suite/sys_vars/r/general_log_file_func.result
@@ -1,8 +1,8 @@
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
## Creating new table ##
CREATE TABLE t1
(
-id INT NOT NULL auto_increment,
+id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
name VARCHAR(30)
);
@@ -10,10 +10,10 @@ name VARCHAR(30)
SELECT @@general_log_file;
@@general_log_file
mysql-test.log
-INSERT into t1(name) values('Record_1');
-INSERT into t1(name) values('Record_2');
-INSERT into t1(name) values('Record_3');
-INSERT into t1(name) values('Record_4');
+INSERT INTO t1(name) VALUES('Record_1');
+INSERT INTO t1(name) VALUES('Record_2');
+INSERT INTO t1(name) VALUES('Record_3');
+INSERT INTO t1(name) VALUES('Record_4');
## Verifying general log file ##
## Dropping table ##
DROP TABLE t1;
diff --git a/mysql-test/r/general_log_func.result b/mysql-test/suite/sys_vars/r/general_log_func.result
index 3bbd93f7207..39ba90265d5 100644
--- a/mysql-test/r/general_log_func.result
+++ b/mysql-test/suite/sys_vars/r/general_log_func.result
@@ -25,8 +25,12 @@ SELECT @@general_log;
## Inserting some Records & Verifying output in log ##
INSERT into t1(name) values('Record_3');
INSERT into t1(name) values('Record_4');
-## There should be no difference, case should pass ##
-## This case is failing which shows that mysql is writing in general ##
-## log when we set general_log to ON ##
+## There should be a difference ##
+SET @@global.max_allowed_packet= 1024*1024*1024;
+SET @orig_file= load_file('MYSQLD_LOGFILE.orig');
+SET @copy_file= load_file('MYSQLD_LOGFILE.copy');
+SELECT STRCMP(@orig_file, @copy_file);
+STRCMP(@orig_file, @copy_file)
+1
## Dropping tables ##
DROP TABLE t1;
diff --git a/mysql-test/r/group_concat_max_len_basic.result b/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
index 5704f00c014..5704f00c014 100644
--- a/mysql-test/r/group_concat_max_len_basic.result
+++ b/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
diff --git a/mysql-test/r/group_concat_max_len_func.result b/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result
index 52d67b8d274..52d67b8d274 100644
--- a/mysql-test/r/group_concat_max_len_func.result
+++ b/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result
diff --git a/mysql-test/r/have_compress_basic.result b/mysql-test/suite/sys_vars/r/have_compress_basic.result
index 9b48d0c4dff..9b48d0c4dff 100644
--- a/mysql-test/r/have_compress_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_compress_basic.result
diff --git a/mysql-test/r/have_crypt_basic.result b/mysql-test/suite/sys_vars/r/have_crypt_basic.result
index 3a3c221290b..3a3c221290b 100644
--- a/mysql-test/r/have_crypt_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_crypt_basic.result
diff --git a/mysql-test/r/have_csv_basic.result b/mysql-test/suite/sys_vars/r/have_csv_basic.result
index 3427d633f98..3427d633f98 100644
--- a/mysql-test/r/have_csv_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_csv_basic.result
diff --git a/mysql-test/r/have_dynamic_loading_basic.result b/mysql-test/suite/sys_vars/r/have_dynamic_loading_basic.result
index fba43958a69..fba43958a69 100644
--- a/mysql-test/r/have_dynamic_loading_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_dynamic_loading_basic.result
diff --git a/mysql-test/r/have_geometry_basic.result b/mysql-test/suite/sys_vars/r/have_geometry_basic.result
index 1d5a379c7bc..1d5a379c7bc 100644
--- a/mysql-test/r/have_geometry_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_geometry_basic.result
diff --git a/mysql-test/r/have_innodb_basic.result b/mysql-test/suite/sys_vars/r/have_innodb_basic.result
index 017512f3ae0..017512f3ae0 100644
--- a/mysql-test/r/have_innodb_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_innodb_basic.result
diff --git a/mysql-test/r/have_ndbcluster_basic.result b/mysql-test/suite/sys_vars/r/have_ndbcluster_basic.result
index 1b662311072..1b662311072 100644
--- a/mysql-test/r/have_ndbcluster_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_ndbcluster_basic.result
diff --git a/mysql-test/r/have_openssl_basic.result b/mysql-test/suite/sys_vars/r/have_openssl_basic.result
index 1fce883a02f..1fce883a02f 100644
--- a/mysql-test/r/have_openssl_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_openssl_basic.result
diff --git a/mysql-test/r/have_partitioning_basic.result b/mysql-test/suite/sys_vars/r/have_partitioning_basic.result
index 8a18288a3ec..8a18288a3ec 100644
--- a/mysql-test/r/have_partitioning_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_partitioning_basic.result
diff --git a/mysql-test/r/have_query_cache_basic.result b/mysql-test/suite/sys_vars/r/have_query_cache_basic.result
index 4baca716698..4baca716698 100644
--- a/mysql-test/r/have_query_cache_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_query_cache_basic.result
diff --git a/mysql-test/r/have_rtree_keys_basic.result b/mysql-test/suite/sys_vars/r/have_rtree_keys_basic.result
index 7d34f1faaed..7d34f1faaed 100644
--- a/mysql-test/r/have_rtree_keys_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_rtree_keys_basic.result
diff --git a/mysql-test/r/have_ssl_basic.result b/mysql-test/suite/sys_vars/r/have_ssl_basic.result
index a425363c03c..a425363c03c 100644
--- a/mysql-test/r/have_ssl_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_ssl_basic.result
diff --git a/mysql-test/r/have_symlink_basic.result b/mysql-test/suite/sys_vars/r/have_symlink_basic.result
index 999cbb66519..999cbb66519 100644
--- a/mysql-test/r/have_symlink_basic.result
+++ b/mysql-test/suite/sys_vars/r/have_symlink_basic.result
diff --git a/mysql-test/r/hostname_basic.result b/mysql-test/suite/sys_vars/r/hostname_basic.result
index c4357a4fbb4..c4357a4fbb4 100644
--- a/mysql-test/r/hostname_basic.result
+++ b/mysql-test/suite/sys_vars/r/hostname_basic.result
diff --git a/mysql-test/r/identity_basic.result b/mysql-test/suite/sys_vars/r/identity_basic.result
index 60f3edcc030..60f3edcc030 100644
--- a/mysql-test/r/identity_basic.result
+++ b/mysql-test/suite/sys_vars/r/identity_basic.result
diff --git a/mysql-test/r/identity_func.result b/mysql-test/suite/sys_vars/r/identity_func.result
index ba430e72a1f..ba430e72a1f 100644
--- a/mysql-test/r/identity_func.result
+++ b/mysql-test/suite/sys_vars/r/identity_func.result
diff --git a/mysql-test/r/init_connect_basic.result b/mysql-test/suite/sys_vars/r/init_connect_basic.result
index 58f7a9d2ccd..58f7a9d2ccd 100644
--- a/mysql-test/r/init_connect_basic.result
+++ b/mysql-test/suite/sys_vars/r/init_connect_basic.result
diff --git a/mysql-test/r/init_slave_basic.result b/mysql-test/suite/sys_vars/r/init_slave_basic.result
index 87272f1489b..87272f1489b 100644
--- a/mysql-test/r/init_slave_basic.result
+++ b/mysql-test/suite/sys_vars/r/init_slave_basic.result
diff --git a/mysql-test/r/innodb_additional_mem_pool_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_additional_mem_pool_size_basic.result
index fb062d62bc6..fb062d62bc6 100644
--- a/mysql-test/r/innodb_additional_mem_pool_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_additional_mem_pool_size_basic.result
diff --git a/mysql-test/r/innodb_autoextend_increment_basic.result b/mysql-test/suite/sys_vars/r/innodb_autoextend_increment_basic.result
index 3d94fc6fd6d..ea87526c42a 100644
--- a/mysql-test/r/innodb_autoextend_increment_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_autoextend_increment_basic.result
@@ -1,7 +1,4 @@
SET @global_start_value = @@global.innodb_autoextend_increment ;
-SELECT @global_start_value;
-@global_start_value
-64
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_autoextend_increment = 0;
Warnings:
@@ -57,16 +54,16 @@ SELECT @@global.innodb_autoextend_increment;
@@global.innodb_autoextend_increment
1000
'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_autoextend_increment = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT @@global.innodb_autoextend_increment = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_autoextend_increment ';
@@global.innodb_autoextend_increment = VARIABLE_VALUE
1
SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment
1000
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_autoextend_increment ';
VARIABLE_VALUE
1000
@@ -92,3 +89,4 @@ Warning 1292 Truncated incorrect autoextend_increment value: '0'
SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment
1
+SET @@global.innodb_autoextend_increment = @global_start_value;
diff --git a/mysql-test/r/innodb_autoinc_lock_mode_basic.result b/mysql-test/suite/sys_vars/r/innodb_autoinc_lock_mode_basic.result
index 9188cf07417..9188cf07417 100644
--- a/mysql-test/r/innodb_autoinc_lock_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_autoinc_lock_mode_basic.result
diff --git a/mysql-test/r/innodb_autoinc_lock_mode_func.result b/mysql-test/suite/sys_vars/r/innodb_autoinc_lock_mode_func.result
index 4c594558a6f..f8082cfaedb 100644
--- a/mysql-test/r/innodb_autoinc_lock_mode_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_autoinc_lock_mode_func.result
@@ -9,14 +9,15 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR
-)ENGINE=INNODB, AUTO_INCREMENT=100;
+) ENGINE=INNODB, AUTO_INCREMENT=100;
INSERT INTO t1 (a,b) VALUES (5,'a'), (NULL,'b'), (1,'c'), (NULL,'d');
INSERT INTO t1 (a,b) VALUES (NULL,'e');
'the new auto incremented value should be 104'
-SELECT * from t1;
+SELECT * FROM t1;
a b
1 c
5 a
100 b
101 d
104 e
+DROP TABLE t1;
diff --git a/mysql-test/r/innodb_buffer_pool_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result
index 27e6cae41ef..27e6cae41ef 100644
--- a/mysql-test/r/innodb_buffer_pool_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result
diff --git a/mysql-test/r/innodb_checksums_basic.result b/mysql-test/suite/sys_vars/r/innodb_checksums_basic.result
index ac4bed60eb5..ac4bed60eb5 100644
--- a/mysql-test/r/innodb_checksums_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_checksums_basic.result
diff --git a/mysql-test/r/innodb_commit_concurrency_basic.result b/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
index 301016d4362..301016d4362 100644
--- a/mysql-test/r/innodb_commit_concurrency_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
diff --git a/mysql-test/r/innodb_data_file_path_basic.result b/mysql-test/suite/sys_vars/r/innodb_data_file_path_basic.result
index 8904c0dcac4..8904c0dcac4 100644
--- a/mysql-test/r/innodb_data_file_path_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_data_file_path_basic.result
diff --git a/mysql-test/r/innodb_data_home_dir_basic.result b/mysql-test/suite/sys_vars/r/innodb_data_home_dir_basic.result
index e4bdd79b7c3..e4bdd79b7c3 100644
--- a/mysql-test/r/innodb_data_home_dir_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_data_home_dir_basic.result
diff --git a/mysql-test/r/innodb_doublewrite_basic.result b/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result
index 6062399e8b8..6062399e8b8 100644
--- a/mysql-test/r/innodb_doublewrite_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result
diff --git a/mysql-test/r/innodb_fast_shutdown_basic.result b/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
index adbfb6ec867..4b923f4bdd2 100644
--- a/mysql-test/r/innodb_fast_shutdown_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
@@ -93,14 +93,14 @@ ERROR HY000: Variable 'innodb_fast_shutdown' is a GLOBAL variable and should be
SET @@local.innodb_fast_shutdown = 0;
ERROR HY000: Variable 'innodb_fast_shutdown' is a GLOBAL variable and should be set with SET GLOBAL
'#----------------------FN_DYNVARS_042_06------------------------#'
-SELECT count(VARIABLE_VALUE) AS res_is_0
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT count(VARIABLE_VALUE) AS res_is_0
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='innodb_fast_shutdown';
res_is_0
1
'#----------------------FN_DYNVARS_042_07------------------------#'
SELECT @@global.innodb_fast_shutdown =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_fast_shutdown';
@@global.innodb_fast_shutdown =
VARIABLE_VALUE
@@ -125,3 +125,7 @@ SET @@global.innodb_fast_shutdown = FALSE;
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
0
+SET @@global.innodb_fast_shutdown = @global_start_value;
+SELECT @@global.innodb_fast_shutdown;
+@@global.innodb_fast_shutdown
+1
diff --git a/mysql-test/r/innodb_file_io_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_io_threads_basic.result
index 5ef7e1099e0..5ef7e1099e0 100644
--- a/mysql-test/r/innodb_file_io_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_io_threads_basic.result
diff --git a/mysql-test/r/innodb_file_per_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
index 77595639400..77595639400 100644
--- a/mysql-test/r/innodb_file_per_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
diff --git a/mysql-test/r/innodb_flush_log_at_trx_commit_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result
index da9f5ad3994..da9f5ad3994 100644
--- a/mysql-test/r/innodb_flush_log_at_trx_commit_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result
diff --git a/mysql-test/r/innodb_flush_method_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result
index 8c8924cdd86..8c8924cdd86 100644
--- a/mysql-test/r/innodb_flush_method_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result
diff --git a/mysql-test/r/innodb_force_recovery_basic.result b/mysql-test/suite/sys_vars/r/innodb_force_recovery_basic.result
index d3dcb525c7f..d3dcb525c7f 100644
--- a/mysql-test/r/innodb_force_recovery_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_force_recovery_basic.result
diff --git a/mysql-test/r/innodb_lock_wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
index ce46861b760..ce46861b760 100644
--- a/mysql-test/r/innodb_lock_wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
diff --git a/mysql-test/r/innodb_locks_unsafe_for_binlog_basic.result b/mysql-test/suite/sys_vars/r/innodb_locks_unsafe_for_binlog_basic.result
index a5967d28913..a5967d28913 100644
--- a/mysql-test/r/innodb_locks_unsafe_for_binlog_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_locks_unsafe_for_binlog_basic.result
diff --git a/mysql-test/r/innodb_log_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_buffer_size_basic.result
index d926addd1bd..d926addd1bd 100644
--- a/mysql-test/r/innodb_log_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_log_buffer_size_basic.result
diff --git a/mysql-test/r/innodb_log_file_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_file_size_basic.result
index 119e95df1e1..119e95df1e1 100644
--- a/mysql-test/r/innodb_log_file_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_log_file_size_basic.result
diff --git a/mysql-test/r/innodb_log_files_in_group_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_files_in_group_basic.result
index 1191ef010f8..1191ef010f8 100644
--- a/mysql-test/r/innodb_log_files_in_group_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_log_files_in_group_basic.result
diff --git a/mysql-test/r/innodb_log_group_home_dir_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_group_home_dir_basic.result
index c7fbd2d958f..c7fbd2d958f 100644
--- a/mysql-test/r/innodb_log_group_home_dir_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_log_group_home_dir_basic.result
diff --git a/mysql-test/r/innodb_max_dirty_pages_pct_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_basic.result
index 8e48957258f..8e48957258f 100644
--- a/mysql-test/r/innodb_max_dirty_pages_pct_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_basic.result
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
new file mode 100644
index 00000000000..baf06092126
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
@@ -0,0 +1,94 @@
+SET @innodb_max_dirty_pages_pct = @@global.innodb_max_dirty_pages_pct;
+'#--------------------FN_DYNVARS_044_02-------------------------#'
+SET @@global.innodb_max_dirty_pages_pct = 80;
+'connect (con1,localhost,root,,,,)'
+'connection con1'
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+80
+SET @@global.innodb_max_dirty_pages_pct = 70;
+'connect (con2,localhost,root,,,,)'
+'connection con2'
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+70
+'connection default'
+'disconnect con2'
+'disconnect con1'
+SET @@global.innodb_max_dirty_pages_pct = @innodb_max_dirty_pages_pct;
+'#--------------------FN_DYNVARS_044_02-------------------------#'
+DROP PROCEDURE IF EXISTS add_records;
+DROP PROCEDURE IF EXISTS add_until;
+DROP PROCEDURE IF EXISTS check_pct;
+DROP FUNCTION IF EXISTS dirty_pct;
+DROP TABLE IF EXISTS t1;
+CREATE PROCEDURE add_records(IN num INT)
+BEGIN
+START TRANSACTION;
+WHILE (num > 0) DO
+INSERT INTO t1(b) VALUES('MYSQL');
+SET num = num - 1;
+END WHILE;
+COMMIT;
+END//
+CREATE FUNCTION dirty_pct() RETURNS DECIMAL(20,17)
+BEGIN
+DECLARE res DECIMAL(20,17);
+DECLARE a1, b1 VARCHAR(256);
+DECLARE a2, b2 VARCHAR(256);
+DECLARE dirty CURSOR FOR SELECT * FROM information_schema.global_status
+WHERE variable_name LIKE 'Innodb_buffer_pool_pages_dirty';
+DECLARE total CURSOR FOR SELECT * FROM information_schema.global_status
+WHERE variable_name LIKE 'Innodb_buffer_pool_pages_total';
+OPEN dirty;
+OPEN total;
+FETCH dirty INTO a1, b1;
+FETCH total INTO a2, b2;
+SET res = (CONVERT(b1,DECIMAL) * 100) / CONVERT(b2,DECIMAL);
+CLOSE dirty;
+CLOSE total;
+RETURN res;
+END//
+CREATE PROCEDURE add_until(IN num DECIMAL)
+BEGIN
+DECLARE pct,last DECIMAL(20,17);
+SET pct = dirty_pct();
+SET last = 0;
+WHILE (pct < num AND pct < 100) DO
+CALL add_records(500);
+SET pct = dirty_pct();
+IF (pct < last) THEN
+SET pct = num + 1;
+ELSE
+SET last = pct;
+END IF;
+END WHILE;
+END//
+CREATE PROCEDURE check_pct(IN num DECIMAL)
+BEGIN
+IF (dirty_pct() < num) THEN
+SELECT 'BELOW_MAX' AS PCT_VALUE;
+ELSE
+SELECT 'ABOVE_MAX' AS PCT_VALUE;
+END IF;
+END//
+CREATE TABLE t1(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(200)
+) ENGINE = INNODB;
+'---Check when innodb_max_dirty_pages_pct is 10---'
+SET @@global.innodb_max_dirty_pages_pct = 10;
+FLUSH STATUS;
+CALL add_until(10);
+FLUSH TABLES;
+CALL add_records(500);
+'We expect dirty pages pct to be BELOW_MAX after some time depending on performance'
+CALL check_pct(10);
+PCT_VALUE
+BELOW_MAX
+DROP PROCEDURE add_records;
+DROP PROCEDURE add_until;
+DROP PROCEDURE check_pct;
+DROP FUNCTION dirty_pct;
+DROP TABLE t1;
+SET @@global.innodb_max_dirty_pages_pct = @innodb_max_dirty_pages_pct;
diff --git a/mysql-test/r/innodb_mirrored_log_groups_basic.result b/mysql-test/suite/sys_vars/r/innodb_mirrored_log_groups_basic.result
index 1645d8163ae..1645d8163ae 100644
--- a/mysql-test/r/innodb_mirrored_log_groups_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_mirrored_log_groups_basic.result
diff --git a/mysql-test/r/innodb_open_files_basic.result b/mysql-test/suite/sys_vars/r/innodb_open_files_basic.result
index eac2234270a..eac2234270a 100644
--- a/mysql-test/r/innodb_open_files_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_open_files_basic.result
diff --git a/mysql-test/r/innodb_rollback_on_timeout_basic.result b/mysql-test/suite/sys_vars/r/innodb_rollback_on_timeout_basic.result
index 6887166fae6..6887166fae6 100644
--- a/mysql-test/r/innodb_rollback_on_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_rollback_on_timeout_basic.result
diff --git a/mysql-test/r/innodb_support_xa_basic.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
index dcd6f498d56..dcd6f498d56 100644
--- a/mysql-test/r/innodb_support_xa_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
diff --git a/mysql-test/r/innodb_support_xa_func.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
index 9036794d636..9036794d636 100644
--- a/mysql-test/r/innodb_support_xa_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
diff --git a/mysql-test/r/innodb_table_locks_basic.result b/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result
index 14aa995273b..14aa995273b 100644
--- a/mysql-test/r/innodb_table_locks_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result
diff --git a/mysql-test/r/innodb_table_locks_func.result b/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result
index 22a52ce17fd..824d196d295 100644
--- a/mysql-test/r/innodb_table_locks_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result
@@ -1,4 +1,8 @@
'#--------------------FN_DYNVARS_048_01-------------------------#'
+SET @start_value= @@global.innodb_table_locks;
+SELECT @start_value;
+@start_value
+1
SET @@global.innodb_table_locks = OFF;
'connect (con1,localhost,root,,,,)'
'connection con1'
@@ -30,3 +34,7 @@ COMMIT;
'CONNECTION con2'
UNLOCK tables;
DROP TABLE t1;
+SET @@global.innodb_table_locks= @start_value;
+SELECT @@global.innodb_table_locks;
+@@global.innodb_table_locks
+1
diff --git a/mysql-test/r/innodb_thread_concurrency_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
index b27bbce5b3c..b27bbce5b3c 100644
--- a/mysql-test/r/innodb_thread_concurrency_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
diff --git a/mysql-test/r/innodb_thread_sleep_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
index 979bfd930ca..979bfd930ca 100644
--- a/mysql-test/r/innodb_thread_sleep_delay_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
diff --git a/mysql-test/r/insert_id_basic.result b/mysql-test/suite/sys_vars/r/insert_id_basic.result
index 47dd759ff44..47dd759ff44 100644
--- a/mysql-test/r/insert_id_basic.result
+++ b/mysql-test/suite/sys_vars/r/insert_id_basic.result
diff --git a/mysql-test/r/insert_id_func.result b/mysql-test/suite/sys_vars/r/insert_id_func.result
index f03b3ea4851..f03b3ea4851 100644
--- a/mysql-test/r/insert_id_func.result
+++ b/mysql-test/suite/sys_vars/r/insert_id_func.result
diff --git a/mysql-test/r/interactive_timeout_basic.result b/mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
index 0777596db07..0777596db07 100644
--- a/mysql-test/r/interactive_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
diff --git a/mysql-test/r/interactive_timeout_func.result b/mysql-test/suite/sys_vars/r/interactive_timeout_func.result
index b97f7c90908..b97f7c90908 100644
--- a/mysql-test/r/interactive_timeout_func.result
+++ b/mysql-test/suite/sys_vars/r/interactive_timeout_func.result
diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
index fc3061d2f59..e3016a2b22c 100644
--- a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
@@ -42,6 +42,8 @@ SELECT @@global.join_buffer_size;
@@global.join_buffer_size
65536
SET @@global.join_buffer_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect join_buffer_size value: '4294967295'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
4294963200
@@ -58,6 +60,8 @@ SELECT @@session.join_buffer_size;
@@session.join_buffer_size
65536
SET @@session.join_buffer_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect join_buffer_size value: '4294967295'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
4294963200
diff --git a/mysql-test/r/keep_files_on_create_basic.result b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
index f782ee3b078..f782ee3b078 100644
--- a/mysql-test/r/keep_files_on_create_basic.result
+++ b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
index 981988a1d4d..7221da16ed8 100644
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
@@ -1,14 +1,10 @@
SET @start_value = @@global.key_buffer_size;
-SELECT @start_value;
-@start_value
-1048576
'#--------------------FN_DYNVARS_055_01------------------------#'
SET @@global.key_buffer_size = 99;
SET @@global.key_buffer_size = DEFAULT;
ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
'#---------------------FN_DYNVARS_055_02-------------------------#'
SET @@global.key_buffer_size = @start_value;
@@ -16,21 +12,20 @@ SELECT @@global.key_buffer_size = @start_value;
@@global.key_buffer_size = @start_value
1
'#--------------------FN_DYNVARS_055_03------------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@global.key_buffer_size= @min_key_buffer_size;
-@@global.key_buffer_size= @min_key_buffer_size
+SET @@global.key_buffer_size = 8 ;
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET @@global.key_buffer_size = 1800;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1800'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
61440
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
'#--------------------FN_DYNVARS_055_04-------------------------#'
SET @@global.key_buffer_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
@@ -40,25 +35,24 @@ SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '4'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.key_buffer_size = ON;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET @@global.key_buffer_size = 'test';
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
'#-------------------FN_DYNVARS_055_05----------------------------#'
SET @@session.key_buffer_size = 0;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
'#----------------------FN_DYNVARS_055_06------------------------#'
SELECT @@global.key_buffer_size = VARIABLE_VALUE
@@ -75,25 +69,25 @@ WHERE VARIABLE_NAME='key_buffer_size';
SET @@global.key_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET @@global.key_buffer_size = FALSE;
Warnings:
Warning 1438 Cannot drop default keycache
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
'#---------------------FN_DYNVARS_055_08----------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
+SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
@@key_buffer_size = @@global.key_buffer_size
1
'#---------------------FN_DYNVARS_055_09----------------------#'
-SET key_buffer_size = @min_key_buffer_size;
+SET key_buffer_size = 8 ;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET local.key_buffer_size = 10;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
@@ -106,6 +100,3 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT key_buffer_size = @@session.key_buffer_size;
ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-1048576
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
index 981988a1d4d..9ce1ab20993 100644
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
@@ -1,14 +1,10 @@
SET @start_value = @@global.key_buffer_size;
-SELECT @start_value;
-@start_value
-1048576
'#--------------------FN_DYNVARS_055_01------------------------#'
SET @@global.key_buffer_size = 99;
SET @@global.key_buffer_size = DEFAULT;
ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
'#---------------------FN_DYNVARS_055_02-------------------------#'
SET @@global.key_buffer_size = @start_value;
@@ -16,21 +12,20 @@ SELECT @@global.key_buffer_size = @start_value;
@@global.key_buffer_size = @start_value
1
'#--------------------FN_DYNVARS_055_03------------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@global.key_buffer_size= @min_key_buffer_size;
-@@global.key_buffer_size= @min_key_buffer_size
+SET @@global.key_buffer_size = 8 ;
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET @@global.key_buffer_size = 1800;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1800'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
61440
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
'#--------------------FN_DYNVARS_055_04-------------------------#'
SET @@global.key_buffer_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
@@ -40,34 +35,33 @@ SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '4'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.key_buffer_size = ON;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET @@global.key_buffer_size = 'test';
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
'#-------------------FN_DYNVARS_055_05----------------------------#'
SET @@session.key_buffer_size = 0;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
'#----------------------FN_DYNVARS_055_06------------------------#'
-SELECT @@global.key_buffer_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT @@global.key_buffer_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='key_buffer_size';
@@global.key_buffer_size = VARIABLE_VALUE
1
-SELECT @@key_buffer_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT @@key_buffer_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='key_buffer_size';
@@key_buffer_size = VARIABLE_VALUE
1
@@ -75,25 +69,25 @@ WHERE VARIABLE_NAME='key_buffer_size';
SET @@global.key_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET @@global.key_buffer_size = FALSE;
Warnings:
Warning 1438 Cannot drop default keycache
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
'#---------------------FN_DYNVARS_055_08----------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
+SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
@@key_buffer_size = @@global.key_buffer_size
1
'#---------------------FN_DYNVARS_055_09----------------------#'
-SET key_buffer_size = @min_key_buffer_size;
+SET key_buffer_size = 8 ;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
+@@global.key_buffer_size BETWEEN 8 AND 36
1
SET local.key_buffer_size = 10;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
@@ -106,6 +100,3 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT key_buffer_size = @@session.key_buffer_size;
ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-1048576
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_func.result b/mysql-test/suite/sys_vars/r/key_buffer_size_func.result
new file mode 100644
index 00000000000..d5b79c260a0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_func.result
@@ -0,0 +1,61 @@
+DROP TABLE IF EXISTS t1;
+## Creating new table t1 ##
+CREATE TABLE t1
+(
+id INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id),
+rollno INT NOT NULL,
+name VARCHAR(30)
+);
+SET @start_value= @@global.key_buffer_size;
+FLUSH STATUS;
+'#--------------------FN_DYNVARS_055_01-------------------------#'
+## Setting initial value of variable to 131072 ##
+SET @@global.key_buffer_size = 131072;
+## Creating two new connections ##
+'#--------------------FN_DYNVARS_055_02-------------------------#'
+## Connecting with connection test_con1 ##
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+131072
+## Inserting some rows in table ##
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_1');
+INSERT INTO t1(rollno, name) VALUES(2, 'Record_2');
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_3');
+INSERT INTO t1(rollno, name) VALUES(3, 'Record_4');
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_5');
+INSERT INTO t1(rollno, name) VALUES(3, 'Record_6');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_7');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_8');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_9');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_10');
+## Key_reads must be zero (no disk access) ##
+show status like 'Key_reads';
+Variable_name Value
+Key_reads 0
+## Switching to connection test_con2 ##
+## Key_reads must be zero (no disk access) ##
+show status like 'Key_reads';
+Variable_name Value
+Key_reads 0
+SET @@global.key_buffer_size = 36;
+## Connecting with connection test_con1 ##
+## Inserting some rows in table ##
+INSERT INTO t1(rollno, name) VALUES(5, 'Record_11');
+INSERT INTO t1(rollno, name) VALUES(6, 'Record_12');
+INSERT INTO t1(rollno, name) VALUES(5, 'Record_13');
+INSERT INTO t1(rollno, name) VALUES(7, 'Record_14');
+INSERT INTO t1(rollno, name) VALUES(5, 'Record_15');
+INSERT INTO t1(rollno, name) VALUES(7, 'Record_16');
+INSERT INTO t1(rollno, name) VALUES(8, 'Record_17');
+INSERT INTO t1(rollno, name) VALUES(8, 'Record_18');
+INSERT INTO t1(rollno, name) VALUES(8, 'Record_19');
+INSERT INTO t1(rollno, name) VALUES(8, 'Record_20');
+## Key_reads must be zero (no disk access) ##
+show status like 'Key_reads';
+Variable_name Value
+Key_reads 10
+## Dropping table ##
+DROP TABLE IF EXISTS t1;
+## Disconnecting both the connections ##
+SET @@global.key_buffer_size= @start_value;
diff --git a/mysql-test/r/last_insert_id_func.result b/mysql-test/suite/sys_vars/r/last_insert_id_func.result
index 2f07aeeec05..2f07aeeec05 100644
--- a/mysql-test/r/last_insert_id_func.result
+++ b/mysql-test/suite/sys_vars/r/last_insert_id_func.result
diff --git a/mysql-test/r/lc_time_names_basic.result b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
index 36f3c45f0da..36f3c45f0da 100644
--- a/mysql-test/r/lc_time_names_basic.result
+++ b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
diff --git a/mysql-test/r/lc_time_names_func.result b/mysql-test/suite/sys_vars/r/lc_time_names_func.result
index 703aa65a6be..703aa65a6be 100644
--- a/mysql-test/r/lc_time_names_func.result
+++ b/mysql-test/suite/sys_vars/r/lc_time_names_func.result
diff --git a/mysql-test/r/license_basic.result b/mysql-test/suite/sys_vars/r/license_basic.result
index 1f92e595020..1f92e595020 100644
--- a/mysql-test/r/license_basic.result
+++ b/mysql-test/suite/sys_vars/r/license_basic.result
diff --git a/mysql-test/r/local_infile_basic.result b/mysql-test/suite/sys_vars/r/local_infile_basic.result
index 5f4c215719a..5f4c215719a 100644
--- a/mysql-test/r/local_infile_basic.result
+++ b/mysql-test/suite/sys_vars/r/local_infile_basic.result
diff --git a/mysql-test/r/local_infile_func.result b/mysql-test/suite/sys_vars/r/local_infile_func.result
index 52b922bc6d9..66a1e5544fb 100644
--- a/mysql-test/r/local_infile_func.result
+++ b/mysql-test/suite/sys_vars/r/local_infile_func.result
@@ -18,7 +18,7 @@ SET @@global.local_infile = 1;
DROP TABLE IF EXISTS t1;
create table t1(a int);
LOAD DATA LOCAL INFILE
-'MYSQLTEST_VARDIR/std_data_ln/numbers.txt' INTO TABLE test.t1;
+'MYSQLTEST_VARDIR/std_data/numbers.txt' INTO TABLE test.t1;
SELECT count(*) from t1;
count(*)
9
@@ -27,7 +27,7 @@ SET @@global.local_infile = 0;
DROP TABLE IF EXISTS t1;
create table t1(a int);
LOAD DATA LOCAL INFILE
-'MYSQLTEST_VARDIR/std_data_ln/numbers.txt' INTO TABLE test.t1;
+'MYSQLTEST_VARDIR/std_data/numbers.txt' INTO TABLE test.t1;
ERROR 42000: The used command is not allowed with this MySQL version
SELECT count(*) from t1;
count(*)
diff --git a/mysql-test/r/log_basic.result b/mysql-test/suite/sys_vars/r/log_basic.result
index edda72fa91e..18a12b72437 100644
--- a/mysql-test/r/log_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_basic.result
@@ -1,4 +1,5 @@
'#--------------------FN_DYNVARS_062_01------------------#'
+SET @start_log= @@global.log;
SELECT @@global.log AS INIT_VALUE;
INIT_VALUE
1
@@ -10,8 +11,11 @@ SET global general_log = 0;
'Bug# 34832: log is a system but it is not accessible using SET @@global.log;'
'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.'
'#--------------------FN_DYNVARS_062_02-------------------------#'
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='log';
VARIABLE_VALUE
OFF
+SET @@global.log= @start_log;
+Warnings:
+Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
diff --git a/mysql-test/r/log_bin_trust_function_creators_basic.result b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
index 40dc0e217c4..40dc0e217c4 100644
--- a/mysql-test/r/log_bin_trust_function_creators_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
diff --git a/mysql-test/r/log_bin_trust_function_creators_func.result b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_func.result
index e109b53a8e7..33443df5ae4 100644
--- a/mysql-test/r/log_bin_trust_function_creators_func.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_func.result
@@ -1,28 +1,42 @@
drop table if exists t1;
'#--------------------FN_DYNVARS_063_01-------------------------#'
+SET @start_value= @@global.log_bin_trust_function_creators;
## Creating new user tt ##
-CREATE user tt@localhost;
+CREATE USER tt@localhost;
## Setting value of variable to 0 ##
SET @@global.log_bin_trust_function_creators = 0;
## Creating new table t2 ##
-create table t2 (a INT);
+CREATE TABLE t2 (a INT);
## Creating & connecting with new connection test_con1 ##
SELECT @@log_bin_trust_function_creators;
@@log_bin_trust_function_creators
0
-SELECT @@sql_log_bin;
-@@sql_log_bin
-1
-## Creating new function f1 ##
+## Creating new function f1 fails because no DETERMINISTIC ###
CREATE FUNCTION f1(a INT) RETURNS INT
BEGIN
-IF (a < 3) THEN
+IF (a < 3) THEN
+INSERT INTO t2 VALUES (a);
+END IF;
+RETURN 1;
+END|
+ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+## Creating new function f1 fails because non-super user ##
+CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
+BEGIN
+IF (a < 3) THEN
+INSERT INTO t2 VALUES (a);
+END IF;
+RETURN 1;
+END|
+ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+## Creating new function f1 succeeds ##
+CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
+BEGIN
+IF (a < 3) THEN
INSERT INTO t2 VALUES (a);
END IF;
RETURN 1;
END|
-'Bug: Create Function should give error here because non-super user';
-'is creating function here';
## Creating new table t1 ##
CREATE TABLE t1 (a INT);
## Inserting some records in t1 ##
@@ -33,8 +47,8 @@ f1(a)
1
1
## Dropping function f1 & table t1 ##
-drop function f1;
-drop table t1;
+DROP FUNCTION f1;
+DROP TABLE t1;
'#--------------------FN_DYNVARS_063_02-------------------------#'
## Switching to default connection ##
## Setting value of variable to 1 ##
@@ -50,7 +64,7 @@ SELECT @@sql_log_bin;
## Creating new function f1 ##
CREATE FUNCTION f1(a INT) RETURNS INT
BEGIN
-IF (a < 3) THEN
+IF (a < 3) THEN
INSERT INTO t2 VALUES (a);
END IF;
RETURN 1;
@@ -65,7 +79,9 @@ f1(a)
1
1
## Dropping function f1 ##
-drop function f1;
+DROP FUNCTION f1;
## Dropping table t1 & t2 ##
-drop table t1,t2;
-## Disconnecting both the connections ##
+DROP TABLE t1,t2;
+## Disconnecting test_con2##
+DROP USER tt@localhost;
+SET @@global.log_bin_trust_function_creators= @start_value;
diff --git a/mysql-test/r/log_bin_trust_routine_creators_basic.result b/mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
index cfcbcddfca3..cfcbcddfca3 100644
--- a/mysql-test/r/log_bin_trust_routine_creators_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
diff --git a/mysql-test/r/log_output_basic.result b/mysql-test/suite/sys_vars/r/log_output_basic.result
index 481d5862074..481d5862074 100644
--- a/mysql-test/r/log_output_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_output_basic.result
diff --git a/mysql-test/r/log_output_func.result b/mysql-test/suite/sys_vars/r/log_output_func.result
index 060f930a161..060f930a161 100644
--- a/mysql-test/r/log_output_func.result
+++ b/mysql-test/suite/sys_vars/r/log_output_func.result
diff --git a/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result b/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
new file mode 100644
index 00000000000..b19b11a4209
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
@@ -0,0 +1,104 @@
+SET @start_value= @@global.log_queries_not_using_indexes;
+SET @@global.log_queries_not_using_indexes= DEFAULT;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET @@global.log_queries_not_using_indexes= TRUE;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+1
+SET @@global.log_queries_not_using_indexes= true;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+1
+SET @@global.log_queries_not_using_indexes= 0;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET @@global.log_queries_not_using_indexes= 1;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+1
+SET @goodvar= TRUE;
+SET @@global.log_queries_not_using_indexes= @goodvar;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+1
+SET GLOBAL log_queries_not_using_indexes= DEFAULT;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET GLOBAL log_queries_not_using_indexes= ON;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+1
+SET GLOBAL log_queries_not_using_indexes= OFF;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET GLOBAL log_queries_not_using_indexes= -0;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET GLOBAL log_queries_not_using_indexes= 0.00;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET GLOBAL log_queries_not_using_indexes= -0.0;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET GLOBAL log_queries_not_using_indexes= 001.00;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+1
+SET GLOBAL log_queries_not_using_indexes= +1.0;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+1
+SET GLOBAL log_queries_not_using_indexes= +0;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET GLOBAL log_queries_not_using_indexes= +0.000000;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET GLOBAL log_queries_not_using_indexes= 0000.00000;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET GLOBAL log_queries_not_using_indexes= .0;
+SELECT @@global.log_queries_not_using_indexes;
+@@global.log_queries_not_using_indexes
+0
+SET @@global.log_queries_not_using_indexes= 'DEFAULT';
+ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'DEFAULT'
+SET @@global.log_queries_not_using_indexes= 'true';
+ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'true'
+SET @@global.log_queries_not_using_indexes= BLABLA;
+ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'BLABLA'
+SET @@global.log_queries_not_using_indexes= 25;
+ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of '25'
+SET @@global.log_queries_not_using_indexes= 12.34;
+ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of '12'
+SET GLOBAL log_queries_not_using_indexes= -1;
+ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of '-1'
+SET @badvar= 'true';
+SET @@global.log_queries_not_using_indexes= @badvar;
+ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'true'
+SET GLOBAL log_queries_not_using_indexes= 'DEFAULT';
+ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'DEFAULT'
+SET log_queries_not_using_indexes= TRUE;
+ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
+SET SESSION log_queries_not_using_indexes= TRUE;
+ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.log_queries_not_using_indexes= TRUE;
+ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
+SET LOCAL log_queries_not_using_indexes= TRUE;
+ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@global log_queries_not_using_indexes= TRUE;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_queries_not_using_indexes= TRUE' at line 1
+SET @@SESSION log_queries_not_using_indexes= TRUE;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_queries_not_using_indexes= TRUE' at line 1
+SET @@global.log_queries_not_using_indexes= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
index 702e95b1383..900bb487706 100644
--- a/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
@@ -71,7 +71,7 @@ SELECT @@session.log_warnings;
'#------------------FN_DYNVARS_067_05-----------------------#'
SET @@global.log_warnings = 100000000000;
Warnings:
-Warning 1292 Truncated incorrect log-warnings value: '100000000000'
+Warning 1292 Truncated incorrect log_warnings value: '100000000000'
SELECT @@global.log_warnings;
@@global.log_warnings
4294967295
@@ -91,7 +91,7 @@ SELECT @@global.log_warnings;
0
SET @@session.log_warnings = 100000000000;
Warnings:
-Warning 1292 Truncated incorrect log-warnings value: '100000000000'
+Warning 1292 Truncated incorrect log_warnings value: '100000000000'
SELECT @@session.log_warnings;
@@session.log_warnings
4294967295
diff --git a/mysql-test/r/long_query_time_basic.result b/mysql-test/suite/sys_vars/r/long_query_time_basic.result
index b44500dc1e2..b44500dc1e2 100644
--- a/mysql-test/r/long_query_time_basic.result
+++ b/mysql-test/suite/sys_vars/r/long_query_time_basic.result
diff --git a/mysql-test/r/low_priority_updates_basic.result b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
index 87b30814837..87b30814837 100644
--- a/mysql-test/r/low_priority_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
diff --git a/mysql-test/r/max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
index 0745d5a36e1..0745d5a36e1 100644
--- a/mysql-test/r/max_allowed_packet_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
diff --git a/mysql-test/r/max_allowed_packet_func.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
index 43da24fa280..0d682b65aea 100644
--- a/mysql-test/r/max_allowed_packet_func.result
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
@@ -1,4 +1,5 @@
-1048576
+SET @start_max_allowed_packet= @@global.max_allowed_packet;
+SET @start_value= @@global.net_buffer_length;
drop table if exists t1;
## Creating new table t1 ##
CREATE TABLE t1
@@ -20,7 +21,7 @@ SELECT @@session.net_buffer_length;
@@session.net_buffer_length
16384
'#--------------------FN_DYNVARS_070_02-------------------------#'
-## Setting value of max_allowed packet and net_buffer_length to 1024 ##
+## Setting value of max_allowed packet and net_buffer_length to 1024 ##
SET @@global.max_allowed_packet = 1024;
SET @@global.net_buffer_length = 1024;
SELECT @@global.max_allowed_packet;
@@ -30,9 +31,8 @@ SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1024
## Creating new connection test_con1 ##
-## Inserting and fetching data of length greater than 1024 ##
+## Inserting and fetching data of length greater than 1024 ##
INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
drop table t1;
-SET @@global.max_allowed_packet = 1048576;
-## Server disconnects after this case and error occurs that Server ##
-## has gone away ##
+SET @@global.max_allowed_packet= @start_max_allowed_packet;
+SET @@global.net_buffer_length= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
index 1dbeb50ff90..a594295c0f5 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
@@ -1,7 +1,7 @@
SET @start_value = @@global.max_binlog_cache_size;
SELECT @start_value;
@start_value
-4294967295
+4294963200
'#--------------------FN_DYNVARS_072_01------------------------#'
SET @@global.max_binlog_cache_size = 5000;
SET @@global.max_binlog_cache_size = DEFAULT;
diff --git a/mysql-test/r/max_binlog_cache_size_func.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_func.result
index 50c9e8e935d..50c9e8e935d 100644
--- a/mysql-test/r/max_binlog_cache_size_func.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_func.result
diff --git a/mysql-test/r/max_binlog_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
index 291b687f76c..291b687f76c 100644
--- a/mysql-test/r/max_binlog_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
diff --git a/mysql-test/r/max_connections_basic.result b/mysql-test/suite/sys_vars/r/max_connections_basic.result
index ccedff01c54..ccedff01c54 100644
--- a/mysql-test/r/max_connections_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_connections_basic.result
diff --git a/mysql-test/r/max_delayed_threads_basic.result b/mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
index e0b2a3ee1cd..e0b2a3ee1cd 100644
--- a/mysql-test/r/max_delayed_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
diff --git a/mysql-test/r/max_error_count_basic.result b/mysql-test/suite/sys_vars/r/max_error_count_basic.result
index 2046a5e9dfa..2046a5e9dfa 100644
--- a/mysql-test/r/max_error_count_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_error_count_basic.result
diff --git a/mysql-test/r/max_insert_delayed_threads_basic.result b/mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
index 31c1fcec396..31c1fcec396 100644
--- a/mysql-test/r/max_insert_delayed_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
diff --git a/mysql-test/r/max_join_size_func.result b/mysql-test/suite/sys_vars/r/max_join_size_func.result
index bf535579433..bf535579433 100644
--- a/mysql-test/r/max_join_size_func.result
+++ b/mysql-test/suite/sys_vars/r/max_join_size_func.result
diff --git a/mysql-test/r/max_length_for_sort_data_basic.result b/mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
index 3edd3e86262..3edd3e86262 100644
--- a/mysql-test/r/max_length_for_sort_data_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
diff --git a/mysql-test/r/max_prepared_stmt_count_basic.result b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
index ebc7da8c7f8..ebc7da8c7f8 100644
--- a/mysql-test/r/max_prepared_stmt_count_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
diff --git a/mysql-test/r/max_prepared_stmt_count_func.result b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_func.result
index 562ef63f811..562ef63f811 100644
--- a/mysql-test/r/max_prepared_stmt_count_func.result
+++ b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_func.result
diff --git a/mysql-test/r/max_relay_log_size_basic.result b/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
index c0042f497ad..c0042f497ad 100644
--- a/mysql-test/r/max_relay_log_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
diff --git a/mysql-test/r/max_seeks_for_key_func.result b/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result
index b4c863af17b..5a2441276ec 100644
--- a/mysql-test/r/max_seeks_for_key_func.result
+++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result
@@ -1,8 +1,9 @@
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
CREATE TABLE t1
-(a int auto_increment primary key,
-b char(20)
+(a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(20)
);
+SET @start_value= @@global.max_seeks_for_key;
'#--------------------FN_DYNVARS_084_01-------------------------#'
SELECT @@global.max_seeks_for_key = 10;
@@global.max_seeks_for_key = 10
@@ -14,8 +15,8 @@ SET @@global.max_seeks_for_key = 20;
SELECT @@global.max_seeks_for_key;
@@global.max_seeks_for_key
20
-INSERT into t1(b) values("AREc");
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+INSERT INTO t1(b) VALUES("AREc");
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
1 SIMPLE t2 system NULL NULL NULL NULL 1
@@ -23,9 +24,9 @@ SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key
2
-INSERT into t1(b) values("BREc");
-INSERT into t1(b) values("CRec");
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+INSERT INTO t1(b) VALUES("BREc");
+INSERT INTO t1(b) VALUES("CRec");
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer
@@ -40,8 +41,8 @@ SET @@global.max_seeks_for_key = 20;
SELECT @@global.max_seeks_for_key;
@@global.max_seeks_for_key
20
-INSERT into t1(b) values("AREc");
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+INSERT INTO t1(b) VALUES("AREc");
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer
@@ -49,27 +50,28 @@ SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key
2
-INSERT into t1(b) values("BREc");
-INSERT into t1(b) values("CRec");
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+INSERT INTO t1(b) VALUES("BREc");
+INSERT INTO t1(b) VALUES("CRec");
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
-INSERT INTO t1 values(null,"test");
+INSERT INTO t1 VALUES(null,"test");
INSERT INTO t1 VALUES (null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a");
-explain SELECT STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 17
1 SIMPLE t2 ALL NULL NULL NULL NULL 17 Using where; Using join buffer
-analyze table t1;
+ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
SET MAX_SEEKS_FOR_KEY=1;
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 17
1 SIMPLE t2 ALL NULL NULL NULL NULL 17 Using where; Using join buffer
SET MAX_SEEKS_FOR_KEY=DEFAULT;
-drop table t1;
+DROP TABLE t1;
+SET @@global.max_seeks_for_key= @start_value;
diff --git a/mysql-test/r/max_sort_length_basic.result b/mysql-test/suite/sys_vars/r/max_sort_length_basic.result
index 73dd31ea4e7..73dd31ea4e7 100644
--- a/mysql-test/r/max_sort_length_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_sort_length_basic.result
diff --git a/mysql-test/r/max_sort_length_func.result b/mysql-test/suite/sys_vars/r/max_sort_length_func.result
index 04f5aa7f4f1..9254f1fadd7 100644
--- a/mysql-test/r/max_sort_length_func.result
+++ b/mysql-test/suite/sys_vars/r/max_sort_length_func.result
@@ -1,3 +1,4 @@
+SET @start_value= @@global.max_sort_length;
SET @session_max_sort_length = @@Session.max_sort_length;
DROP TABLE IF EXISTS t;
** creating tables **
@@ -296,3 +297,4 @@ SET @@SESSION.max_sort_length = @session_max_sort_length;
DROP TABLE IF EXISTS t;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
+SET @@global.max_sort_length= @start_value;
diff --git a/mysql-test/r/max_sp_recursion_depth_basic.result b/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
index 8c79f3c5fc7..8c79f3c5fc7 100644
--- a/mysql-test/r/max_sp_recursion_depth_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
diff --git a/mysql-test/r/max_sp_recursion_depth_func.result b/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_func.result
index 59d88440f53..59d88440f53 100644
--- a/mysql-test/r/max_sp_recursion_depth_func.result
+++ b/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_func.result
diff --git a/mysql-test/r/max_user_connections_basic.result b/mysql-test/suite/sys_vars/r/max_user_connections_basic.result
index 3250b2f03ea..3250b2f03ea 100644
--- a/mysql-test/r/max_user_connections_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_user_connections_basic.result
diff --git a/mysql-test/r/max_user_connections_func.result b/mysql-test/suite/sys_vars/r/max_user_connections_func.result
index 2ff2ac82ce7..2ff2ac82ce7 100644
--- a/mysql-test/r/max_user_connections_func.result
+++ b/mysql-test/suite/sys_vars/r/max_user_connections_func.result
diff --git a/mysql-test/r/myisam_data_pointer_size_basic.result b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
index d2b0bebe029..d2b0bebe029 100644
--- a/mysql-test/r/myisam_data_pointer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
diff --git a/mysql-test/r/myisam_data_pointer_size_func.result b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result
index f32e25c7427..82d9a7dad66 100644
--- a/mysql-test/r/myisam_data_pointer_size_func.result
+++ b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result
@@ -1,4 +1,5 @@
'#--------------------FN_DYNVARS_093_01-------------------------#'
+SET @start_value= @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 2;
'connect (con1,localhost,root,,,,)'
'connection con1'
@@ -40,3 +41,4 @@ count(*)
65536
DROP PROCEDURE sp_addRec;
DROP TABLE t1;
+SET @@global.myisam_data_pointer_size= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
index 64d1168685c..7467537eaba 100644
--- a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
@@ -1,7 +1,7 @@
SET @start_global_value = @@global.myisam_max_sort_file_size;
SELECT @start_global_value;
@start_global_value
-2147483647
+2146435072
'#--------------------FN_DYNVARS_094_01-------------------------#'
SET @@global.myisam_max_sort_file_size = 500000;
SET @@global.myisam_max_sort_file_size = DEFAULT;
diff --git a/mysql-test/r/myisam_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result
index 74d2fb3ec86..74d2fb3ec86 100644
--- a/mysql-test/r/myisam_sort_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result
diff --git a/mysql-test/r/myisam_stats_method_basic.result b/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result
index 3272ef6e538..3272ef6e538 100644
--- a/mysql-test/r/myisam_stats_method_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result
diff --git a/mysql-test/r/myisam_stats_method_func.result b/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result
index ace6887cc90..55d91b7417d 100644
--- a/mysql-test/r/myisam_stats_method_func.result
+++ b/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result
@@ -1,4 +1,5 @@
'#--------------------FN_DYNVARS_097_01-------------------------#'
+SET @start_value = @@global.myisam_stats_method;
SET @@global.myisam_stats_method = nulls_equal;
'connect (con1,localhost,root,,,,)'
'connection con1'
@@ -11,11 +12,11 @@ nulls_equal
'#--------------------FN_DYNVARS_097_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (a int, key (a));
+CREATE TABLE t1 (a INT, KEY (a));
INSERT INTO t1 VALUES (0),(1),(2),(3),(4);
INSERT INTO t1 SELECT NULL FROM t1;
'default: NULLs considered unequal'
-SET myisam_stats_method=nulls_unequal;
+SET myisam_stats_method = nulls_unequal;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
@@ -23,7 +24,7 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 10 NULL NULL YES BTREE
INSERT INTO t1 VALUES (11);
-DELETE FROM t1 WHERE a=11;
+DELETE FROM t1 WHERE a = 11;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -31,9 +32,9 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 10 NULL NULL YES BTREE
'Set nulls to be equal'
-SET myisam_stats_method=nulls_equal;
+SET myisam_stats_method = nulls_equal;
INSERT INTO t1 VALUES (11);
-DELETE FROM t1 WHERE a=11;
+DELETE FROM t1 WHERE a = 11;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
@@ -41,7 +42,7 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 5 NULL NULL YES BTREE
INSERT INTO t1 VALUES (11);
-DELETE FROM t1 WHERE a=11;
+DELETE FROM t1 WHERE a = 11;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -49,14 +50,14 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 5 NULL NULL YES BTREE
'Set nulls to be ignored'
-SET myisam_stats_method=nulls_ignored;
-SHOW variables LIKE 'myisam_stats_method';
+SET myisam_stats_method = nulls_ignored;
+SHOW VARIABLES LIKE 'myisam_stats_method';
Variable_name Value
myisam_stats_method nulls_ignored
-drop TABLE t1;
+DROP TABLE t1;
CREATE TABLE t1 (
-a char(3), b char(4), c char(5), d char(6),
-key(a,b,c,d)
+a CHAR(3), b CHAR(4), c CHAR(5), d CHAR(6),
+KEY(a,b,c,d)
);
INSERT INTO t1 VALUES ('bcd','def1', NULL, 'zz');
INSERT INTO t1 VALUES ('bcd','def2', NULL, 'zz');
@@ -81,5 +82,6 @@ t1 1 a 1 a A 0 NULL NULL YES BTREE
t1 1 a 2 b A 0 NULL NULL YES BTREE
t1 1 a 3 c A 0 NULL NULL YES BTREE
t1 1 a 4 d A 0 NULL NULL YES BTREE
-SET myisam_stats_method=DEFAULT;
+SET myisam_stats_method = DEFAULT;
DROP TABLE t1;
+SET @@global.myisam_stats_method= @start_value;
diff --git a/mysql-test/r/myisam_use_mmap_basic.result b/mysql-test/suite/sys_vars/r/myisam_use_mmap_basic.result
index c0f92acb983..c0f92acb983 100644
--- a/mysql-test/r/myisam_use_mmap_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_use_mmap_basic.result
diff --git a/mysql-test/r/ndb_log_update_as_write_basic.result b/mysql-test/suite/sys_vars/r/ndb_log_update_as_write_basic.result
index 6353fba2b7c..6353fba2b7c 100644
--- a/mysql-test/r/ndb_log_update_as_write_basic.result
+++ b/mysql-test/suite/sys_vars/r/ndb_log_update_as_write_basic.result
diff --git a/mysql-test/r/ndb_log_updated_only_basic.result b/mysql-test/suite/sys_vars/r/ndb_log_updated_only_basic.result
index 38abb7cc263..38abb7cc263 100644
--- a/mysql-test/r/ndb_log_updated_only_basic.result
+++ b/mysql-test/suite/sys_vars/r/ndb_log_updated_only_basic.result
diff --git a/mysql-test/r/net_buffer_length_basic.result b/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
index be7e9082332..be7e9082332 100644
--- a/mysql-test/r/net_buffer_length_basic.result
+++ b/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
diff --git a/mysql-test/r/net_read_timeout_basic.result b/mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
index 90a6ef72718..90a6ef72718 100644
--- a/mysql-test/r/net_read_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
diff --git a/mysql-test/r/net_write_timeout_basic.result b/mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
index 35a2cf069e3..35a2cf069e3 100644
--- a/mysql-test/r/net_write_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
diff --git a/mysql-test/r/new_basic.result b/mysql-test/suite/sys_vars/r/new_basic.result
index b36e540ddd9..b36e540ddd9 100644
--- a/mysql-test/r/new_basic.result
+++ b/mysql-test/suite/sys_vars/r/new_basic.result
diff --git a/mysql-test/r/old_passwords_basic.result b/mysql-test/suite/sys_vars/r/old_passwords_basic.result
index ecf23ab302b..ecf23ab302b 100644
--- a/mysql-test/r/old_passwords_basic.result
+++ b/mysql-test/suite/sys_vars/r/old_passwords_basic.result
diff --git a/mysql-test/r/old_passwords_func.result b/mysql-test/suite/sys_vars/r/old_passwords_func.result
index eebee9f4852..eebee9f4852 100644
--- a/mysql-test/r/old_passwords_func.result
+++ b/mysql-test/suite/sys_vars/r/old_passwords_func.result
diff --git a/mysql-test/r/optimizer_prune_level_basic.result b/mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
index 46fe70c40d0..46fe70c40d0 100644
--- a/mysql-test/r/optimizer_prune_level_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
diff --git a/mysql-test/r/optimizer_search_depth_basic.result b/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
index 9c26339839e..9c26339839e 100644
--- a/mysql-test/r/optimizer_search_depth_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
diff --git a/mysql-test/r/preload_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
index 775b670d3bc..775b670d3bc 100644
--- a/mysql-test/r/preload_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
diff --git a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
index 3b7f06c8f81..32b9371977c 100644
--- a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
@@ -36,10 +36,14 @@ SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
1024
SET @@global.query_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967295'
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
4294966272
SET @@global.query_alloc_block_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967294'
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
4294966272
@@ -58,10 +62,14 @@ SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
1024
SET @@session.query_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967295'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
4294966272
SET @@session.query_alloc_block_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967294'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
4294966272
diff --git a/mysql-test/r/query_cache_limit_func.result b/mysql-test/suite/sys_vars/r/query_cache_limit_func.result
index e54884cd5c3..bbbb273428a 100644
--- a/mysql-test/r/query_cache_limit_func.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_limit_func.result
@@ -1,6 +1,8 @@
** Setup **
SET @global_query_cache_limit = @@global.query_cache_limit;
+SET @global_query_cache_size = @@global.query_cache_size;
+SET @global_query_cache_type = @@global.query_cache_type;
** warnings **
DROP TABLE IF EXISTS t;
** creating table **
@@ -48,7 +50,7 @@ Qcache_queries_in_cache 1
FLUSH STATUS;
RESET QUERY CACHE;
** set cache limit **
-SET @@GLOBAL.query_cache_limit=0;
+SET @@GLOBAL.query_cache_limit = 0;
** fetching results **
SELECT * FROM t;
id c
@@ -67,7 +69,7 @@ Qcache_queries_in_cache 0
0 Expected
'#---------------------FN_DYNVARS_132_03----------------------#'
** set cache limit **
-SET @@GLOBAL.query_cache_limit=DEFAULT;
+SET @@GLOBAL.query_cache_limit = DEFAULT;
** Reset cache values **
FLUSH STATUS;
RESET QUERY CACHE;
@@ -86,7 +88,7 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
1 Expected
-SET @@GLOBAL.query_cache_limit=0;
+SET @@GLOBAL.query_cache_limit = 0;
SHOW STATUS LIKE 'Qcache_not_cached';
Variable_name Value
Qcache_not_cached 0
@@ -112,4 +114,6 @@ Variable_name Value
Qcache_queries_in_cache 1
1 Expected
SET @@GLOBAL.query_cache_limit = @global_query_cache_limit;
+SET GLOBAL query_cache_size = @global_query_cache_size;
+SET GLOBAL query_cache_type = @global_query_cache_type;
DROP TABLE IF EXISTS t;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result
index 1af70b3af84..1793726b2f1 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result
@@ -1,7 +1,4 @@
SET @start_value = @@global.query_cache_size;
-SELECT @start_value;
-@start_value
-0
'#--------------------FN_DYNVARS_133_01------------------------#'
SET @@global.query_cache_size = 99;
SET @@global.query_cache_size = DEFAULT;
@@ -10,8 +7,8 @@ SELECT @@global.query_cache_size;
0
'#---------------------FN_DYNVARS_133_02-------------------------#'
SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size = 0;
-@@global.query_cache_size = 0
+SELECT @@global.query_cache_size = @start_value;
+@@global.query_cache_size = @start_value
1
'#--------------------FN_DYNVARS_133_03------------------------#'
SET @@global.query_cache_size = 0;
@@ -133,6 +130,3 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT query_cache_size = @@session.query_cache_size;
ERROR 42S22: Unknown column 'query_cache_size' in 'field list'
SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
diff --git a/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result
index 0d67eec1ccc..0cc508b169e 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result
@@ -1,7 +1,4 @@
SET @start_value = @@global.query_cache_size;
-SELECT @start_value;
-@start_value
-0
'#--------------------FN_DYNVARS_133_01------------------------#'
SET @@global.query_cache_size = 99;
SET @@global.query_cache_size = DEFAULT;
@@ -10,8 +7,8 @@ SELECT @@global.query_cache_size;
0
'#---------------------FN_DYNVARS_133_02-------------------------#'
SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size = 0;
-@@global.query_cache_size = 0
+SELECT @@global.query_cache_size = @start_value;
+@@global.query_cache_size = @start_value
1
'#--------------------FN_DYNVARS_133_03------------------------#'
SET @@global.query_cache_size = 0;
@@ -129,6 +126,3 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT query_cache_size = @@session.query_cache_size;
ERROR 42S22: Unknown column 'query_cache_size' in 'field list'
SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
diff --git a/mysql-test/r/query_cache_type_basic.result b/mysql-test/suite/sys_vars/r/query_cache_type_basic.result
index 101853daa80..101853daa80 100644
--- a/mysql-test/r/query_cache_type_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_type_basic.result
diff --git a/mysql-test/r/query_cache_type_func.result b/mysql-test/suite/sys_vars/r/query_cache_type_func.result
index 94c31804248..af121244572 100644
--- a/mysql-test/r/query_cache_type_func.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_type_func.result
@@ -4,6 +4,7 @@
** Connection con0 **
SET @start_global_value = @@GLOBAL.query_cache_type;
SET @start_session_value = @@SESSION.query_cache_type;
+SET @start_query_cache_size= @@global.query_cache_size;
CREATE TABLE t1(id int, value varchar(10));
INSERT INTO t1 VALUES(1, 'val1');
INSERT INTO t1 VALUES(2, 'val2');
@@ -216,6 +217,7 @@ Disconnecting con1,con2,con3
** Connection con0 **
SET @@GLOBAL.query_cache_type = @start_global_value;
SET @@SESSION.query_cache_type = @start_session_value;
+SET GLOBAL query_cache_size = @start_query_cache_size;
DROP TABLE t1;
DROP PROCEDURE testProcHit;
Disconnecting con0
diff --git a/mysql-test/r/query_cache_wlock_invalidate_basic.result b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result
index bff07741656..bff07741656 100644
--- a/mysql-test/r/query_cache_wlock_invalidate_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result
diff --git a/mysql-test/r/query_cache_wlock_invalidate_func.result b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
index 71ee11a5235..71ee11a5235 100644
--- a/mysql-test/r/query_cache_wlock_invalidate_func.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result
index cd5f1727d41..a16c56f95c5 100644
--- a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result
@@ -35,10 +35,6 @@ SET @@global.query_prealloc_size = 8192;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
8192
-SET @@global.query_prealloc_size = 4294967295;
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-4294966272
SET @@global.query_prealloc_size = 655354;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
@@ -48,10 +44,6 @@ SET @@session.query_prealloc_size = 8192;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
8192
-SET @@session.query_prealloc_size = 4294967295;
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
-4294966272
SET @@session.query_prealloc_size = 655345;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
@@ -63,50 +55,32 @@ Warning 1292 Truncated incorrect query_prealloc_size value: '0'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
8192
-SET @@global.query_prealloc_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '0'
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size = 429496729533;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '429496729533'
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-4294966272
SET @@global.query_prealloc_size = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-4294966272
+8192
SET @@global.query_prealloc_size = test;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-4294966272
+8192
SET @@global.query_prealloc_size = "test";
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-4294966272
+8192
SET @@global.query_prealloc_size = 'test';
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-4294966272
+8192
SET @@global.query_prealloc_size = ON;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-4294966272
-SET @@session.query_prealloc_size = 0;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '0'
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
8192
-SET @@session.query_prealloc_size = -2;
+SET @@session.query_prealloc_size = 0;
Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '0'
SELECT @@session.query_prealloc_size ;
diff --git a/mysql-test/r/query_prealloc_size_func.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_func.result
index c77586f2fc4..4f7a8d18f32 100644
--- a/mysql-test/r/query_prealloc_size_func.result
+++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_func.result
@@ -1,17 +1,18 @@
** Setup **
-CREATE TABLE t1 (id int auto_increment primary key, val text(200));
-INSERT INTO t1 values(NULL,'a');
-INSERT INTO t1 values(NULL,'b');
-INSERT INTO t1 values(NULL,'c');
-INSERT INTO t1 values(NULL,'d');
+SET @start_value = @@global.query_prealloc_size;
+CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY, val TEXT(200));
+INSERT INTO t1 VALUES(NULL,'a');
+INSERT INTO t1 VALUES(NULL,'b');
+INSERT INTO t1 VALUES(NULL,'c');
+INSERT INTO t1 VALUES(NULL,'d');
SELECT * FROM t1 ORDER BY val;
id val
1 a
2 b
3 c
4 d
-SET SESSION query_prealloc_size = 8192;
+SET SESSION query_prealloc_size = 8192;
'#----------------------------FN_DYNVARS_137_05-----------------#'
SET GLOBAL query_prealloc_size = 8192;
SELECT @@SESSION.query_prealloc_size;
@@ -36,3 +37,5 @@ SELECT @@GLOBAL.query_prealloc_size;
@@GLOBAL.query_prealloc_size
8192
Expected Value : 8192;
+DROP TABLE t1;
+SET @@global.query_prealloc_size = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
index 93441448d90..95e22dfcf14 100644
--- a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
@@ -39,10 +39,14 @@ SELECT @@global.range_alloc_block_size;
4096
'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.range_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967295'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4294966272
SET @@global.range_alloc_block_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967294'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4294966272
@@ -55,10 +59,14 @@ SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4096
SET @@session.range_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967295'
SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4294966272
SET @@session.range_alloc_block_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967294'
SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4294966272
diff --git a/mysql-test/r/read_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
index 799f7b56235..3c007dc1515 100644
--- a/mysql-test/r/read_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
@@ -86,6 +86,8 @@ SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
1
SET @@global.read_buffer_size = 2147479553;
+Warnings:
+Warning 1292 Truncated incorrect read_buffer_size value: '2147479553'
SELECT @@global.read_buffer_size;
@@global.read_buffer_size
2147479552
@@ -114,6 +116,8 @@ SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
SET @@session.read_buffer_size = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SET @@session.read_buffer_size = 2147479553;
+Warnings:
+Warning 1292 Truncated incorrect read_buffer_size value: '2147479553'
SELECT @@session.read_buffer_size;
@@session.read_buffer_size
2147479552
diff --git a/mysql-test/r/read_only_basic.result b/mysql-test/suite/sys_vars/r/read_only_basic.result
index ac153fa337c..ac153fa337c 100644
--- a/mysql-test/r/read_only_basic.result
+++ b/mysql-test/suite/sys_vars/r/read_only_basic.result
diff --git a/mysql-test/r/read_only_func.result b/mysql-test/suite/sys_vars/r/read_only_func.result
index 35b42d468d6..35b42d468d6 100644
--- a/mysql-test/r/read_only_func.result
+++ b/mysql-test/suite/sys_vars/r/read_only_func.result
diff --git a/mysql-test/r/read_rnd_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
index c51b0591054..c6440ac032e 100644
--- a/mysql-test/r/read_rnd_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
@@ -88,6 +88,8 @@ SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 822
@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
1
SET @@global.read_rnd_buffer_size = 2147479553;
+Warnings:
+Warning 1292 Truncated incorrect read_rnd_buffer_size value: '2147479553'
SELECT @@global.read_rnd_buffer_size;
@@global.read_rnd_buffer_size
2147479552
@@ -116,6 +118,8 @@ SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8
SET @@session.read_rnd_buffer_size = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SET @@session.read_rnd_buffer_size = 2147479553;
+Warnings:
+Warning 1292 Truncated incorrect read_rnd_buffer_size value: '2147479553'
SELECT @@session.read_rnd_buffer_size;
@@session.read_rnd_buffer_size
2147479552
diff --git a/mysql-test/r/relay_log_purge_basic.result b/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result
index 6f938c5265f..6f938c5265f 100644
--- a/mysql-test/r/relay_log_purge_basic.result
+++ b/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result
diff --git a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
new file mode 100644
index 00000000000..0d1f4d483d8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
@@ -0,0 +1,46 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+connection slave
+SET @start_max_connections= @@global.max_connections;
+SET @start_init_slave= @@global.init_slave;
+SET @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1';
+DROP TABLE IF EXISTS t1;
+CREATE TEMPORARY TABLE t1 AS SELECT @@global.init_slave AS my_column;
+DESCRIBE t1;
+Field Type Null Key Default Extra
+my_column longtext NO NULL
+DROP TABLE t1;
+SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1';
+@@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1'
+1
+Expect 1
+SELECT @@global.max_connections= @start_max_connections;
+@@global.max_connections= @start_max_connections
+1
+Expect 1
+STOP SLAVE;
+RESET MASTER;
+RESET SLAVE;
+START SLAVE;
+SELECT @@global.max_connections = @start_max_connections + 1;
+@@global.max_connections = @start_max_connections + 1
+1
+Expect 1
+SET @@global.init_slave = "SET @a=5";
+STOP SLAVE;
+RESET MASTER;
+RESET SLAVE;
+START SLAVE;
+SHOW VARIABLES LIKE 'init_slave';
+Variable_name Value
+init_slave SET @a=5
+SELECT @a;
+@a
+NULL
+Expect NULL
+SET @@global.max_connections= @start_max_connections;
+SET @@global.init_slave= @start_init_slave;
diff --git a/mysql-test/r/rpl_max_binlog_size_func.result b/mysql-test/suite/sys_vars/r/rpl_max_binlog_size_func.result
index 08c1ea407fd..0d0a1ae03c4 100644
--- a/mysql-test/r/rpl_max_binlog_size_func.result
+++ b/mysql-test/suite/sys_vars/r/rpl_max_binlog_size_func.result
@@ -1,5 +1,8 @@
DROP TABLE IF EXISTS t1;
'--- check if log file is rotated after 4096 bytes ----'
+SET @saved_max_binlog_size= @@global.max_binlog_size;
SET @@global.max_binlog_size = 4096;
CREATE TABLE t1(a CHAR(5));
'mylog.000002 exists'
+SET @@global.max_binlog_size= @saved_max_binlog_size;
+DROP TABLE t1;
diff --git a/mysql-test/r/secure_auth_basic.result b/mysql-test/suite/sys_vars/r/secure_auth_basic.result
index b8a903ba420..b8a903ba420 100644
--- a/mysql-test/r/secure_auth_basic.result
+++ b/mysql-test/suite/sys_vars/r/secure_auth_basic.result
diff --git a/mysql-test/r/secure_auth_func.result b/mysql-test/suite/sys_vars/r/secure_auth_func.result
index f7e24e3f043..f7e24e3f043 100644
--- a/mysql-test/r/secure_auth_func.result
+++ b/mysql-test/suite/sys_vars/r/secure_auth_func.result
diff --git a/mysql-test/r/slave_allow_batching_basic.result b/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result
index 186cfbc8f0f..186cfbc8f0f 100644
--- a/mysql-test/r/slave_allow_batching_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result
diff --git a/mysql-test/r/slave_compressed_protocol_basic.result b/mysql-test/suite/sys_vars/r/slave_compressed_protocol_basic.result
index 3f2d9d2fb3f..3f2d9d2fb3f 100644
--- a/mysql-test/r/slave_compressed_protocol_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_compressed_protocol_basic.result
diff --git a/mysql-test/r/slave_exec_mode_basic.result b/mysql-test/suite/sys_vars/r/slave_exec_mode_basic.result
index aeb73196733..aeb73196733 100644
--- a/mysql-test/r/slave_exec_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_exec_mode_basic.result
diff --git a/mysql-test/r/slave_net_timeout_basic.result b/mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
index d672d0152d7..7903d7f8215 100644
--- a/mysql-test/r/slave_net_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
@@ -1,7 +1,7 @@
SET @start_global_value = @@global.slave_net_timeout;
SELECT @start_global_value;
@start_global_value
-3600
+120
'#--------------------FN_DYNVARS_146_01-------------------------#'
SET @@global.slave_net_timeout = 500000;
SET @@global.slave_net_timeout = DEFAULT;
@@ -124,4 +124,4 @@ SET global slave_net_timeout = 99;
SET @@global.slave_net_timeout = @start_global_value;
SELECT @@global.slave_net_timeout;
@@global.slave_net_timeout
-3600
+120
diff --git a/mysql-test/r/slow_launch_time_basic.result b/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
index c42942fba1a..c42942fba1a 100644
--- a/mysql-test/r/slow_launch_time_basic.result
+++ b/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
diff --git a/mysql-test/r/slow_launch_time_func.result b/mysql-test/suite/sys_vars/r/slow_launch_time_func.result
index 7665166ff29..7665166ff29 100644
--- a/mysql-test/r/slow_launch_time_func.result
+++ b/mysql-test/suite/sys_vars/r/slow_launch_time_func.result
diff --git a/mysql-test/r/slow_query_log_basic.result b/mysql-test/suite/sys_vars/r/slow_query_log_basic.result
index 716309aeaff..716309aeaff 100644
--- a/mysql-test/r/slow_query_log_basic.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_basic.result
diff --git a/mysql-test/r/slow_query_log_file_basic.result b/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result
index a62f3e21ef2..925f940a5c4 100644
--- a/mysql-test/r/slow_query_log_file_basic.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result
@@ -1,12 +1,9 @@
SET @start_value = @@global.slow_query_log_file;
-SELECT @start_value;
-@start_value
-slowtest.log
'#---------------------FN_DYNVARS_004_01-------------------------#'
SET @@global.slow_query_log_file = DEFAULT;
SELECT RIGHT(@@global.slow_query_log_file,15);
RIGHT(@@global.slow_query_log_file,15)
-master-slow.log
+mysqld-slow.log
'#--------------------FN_DYNVARS_004_02------------------------#'
SET @@global.slow_query_log_file = mytest.log;
SET @@global.slow_query_log_file = 12;
@@ -17,3 +14,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slow_query_log_file';
@@global.slow_query_log_file = VARIABLE_VALUE
1
+SET @@global.slow_query_log_file= @start_value;
diff --git a/mysql-test/r/slow_query_log_file_func.result b/mysql-test/suite/sys_vars/r/slow_query_log_file_func.result
index 4b7a49c6f0b..201b33c8edb 100644
--- a/mysql-test/r/slow_query_log_file_func.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_file_func.result
@@ -1,3 +1,3 @@
'#--------------------FN_DYNVARS_018_01-------------------------#'
-## --file_exists var/master-data/my_slow_test.log ##
+## Checking if my_slow_test.log exists in servers datadir ##
## This case should pass because we have set this filename in opt file ##
diff --git a/mysql-test/r/slow_query_log_func.result b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
index 83edb4c187e..83edb4c187e 100644
--- a/mysql-test/r/slow_query_log_func.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
index 09a1fe59046..9d3eadcc26f 100644
--- a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
@@ -1,47 +1,33 @@
SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-262144
SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-262144
'#--------------------FN_DYNVARS_151_01-------------------------#'
SET @@global.sort_buffer_size = 1000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '1000'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
+SELECT @@global.sort_buffer_size BETWEEN 2097116 AND 2100000;
+@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
1
SET @@session.sort_buffer_size = 2000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '2000'
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
+SELECT @@session.sort_buffer_size BETWEEN 2097116 AND 2100000;
+@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
1
'#--------------------FN_DYNVARS_151_02-------------------------#'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
+SELECT @@global.sort_buffer_size BETWEEN 2097116 AND 2100000;
+@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
1
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
+SELECT @@session.sort_buffer_size BETWEEN 2097116 AND 2100000;
+@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
1
'#--------------------FN_DYNVARS_151_03-------------------------#'
SET @@global.sort_buffer_size = 32776;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = 32777;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
@@ -51,19 +37,14 @@ SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967294
-'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
'#--------------------FN_DYNVARS_151_04-------------------------#'
SET @@session.sort_buffer_size = 32776;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@session.sort_buffer_size = 32777;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
@@ -75,20 +56,14 @@ SELECT @@session.sort_buffer_size;
4294967294
'#------------------FN_DYNVARS_151_05-----------------------#'
SET @@global.sort_buffer_size = 32775;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = 4294967296;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296'
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967295
@@ -103,64 +78,47 @@ SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967295
SET @@session.sort_buffer_size = 32775;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@session.sort_buffer_size = -2;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@session.sort_buffer_size = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SET @@session.sort_buffer_size = 4294967296;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296'
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.sort_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967295
'#------------------FN_DYNVARS_151_06-----------------------#'
-SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@global.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_07-----------------------#'
-SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@session.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_08-----------------------#'
SET @@global.sort_buffer_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '1'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
-'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
'#---------------------FN_DYNVARS_151_09----------------------#'
SET @@global.sort_buffer_size = 9000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
@@sort_buffer_size = @@global.sort_buffer_size
0
'#---------------------FN_DYNVARS_151_10----------------------#'
SET @@sort_buffer_size = 9000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
@@sort_buffer_size = @@local.sort_buffer_size
1
@@ -169,14 +127,9 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
1
'#---------------------FN_DYNVARS_151_11----------------------#'
SET sort_buffer_size = 9100;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9100'
-SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
-@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
-1
-SELECT @@sort_buffer_size;
-@@sort_buffer_size
-32804
+SELECT @@sort_buffer_size BETWEEN 32776 AND 32999;
+@@sort_buffer_size BETWEEN 32776 AND 32999
+1
SELECT local.sort_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.sort_buffer_size;
@@ -184,10 +137,4 @@ ERROR 42S02: Unknown table 'session' in field list
SELECT sort_buffer_size = @@session.sort_buffer_size;
ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
SET @@global.sort_buffer_size = @start_global_value;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-262144
SET @@session.sort_buffer_size = @start_session_value;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-262144
diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
index e9bd14abc67..c993c8a0a88 100644
--- a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
@@ -1,47 +1,33 @@
SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-262144
SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-262144
'#--------------------FN_DYNVARS_151_01-------------------------#'
SET @@global.sort_buffer_size = 1000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '1000'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
+SELECT @@global.sort_buffer_size BETWEEN 2097116 AND 2100000;
+@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
1
SET @@session.sort_buffer_size = 2000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '2000'
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
+SELECT @@session.sort_buffer_size BETWEEN 2097116 AND 2100000;
+@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
1
'#--------------------FN_DYNVARS_151_02-------------------------#'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
+SELECT @@global.sort_buffer_size BETWEEN 2097116 AND 2100000;
+@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
1
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
+SELECT @@session.sort_buffer_size BETWEEN 2097116 AND 2100000;
+@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
1
'#--------------------FN_DYNVARS_151_03-------------------------#'
SET @@global.sort_buffer_size = 32776;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = 32777;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
@@ -51,19 +37,14 @@ SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967294
-'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
'#--------------------FN_DYNVARS_151_04-------------------------#'
SET @@session.sort_buffer_size = 32776;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@session.sort_buffer_size = 32777;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
@@ -75,16 +56,12 @@ SELECT @@session.sort_buffer_size;
4294967294
'#------------------FN_DYNVARS_151_05-----------------------#'
SET @@global.sort_buffer_size = 32775;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
@@ -101,16 +78,12 @@ SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967296
SET @@session.sort_buffer_size = 32775;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@session.sort_buffer_size = -2;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@session.sort_buffer_size = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
@@ -118,45 +91,34 @@ SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.sort_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967296
'#------------------FN_DYNVARS_151_06-----------------------#'
-SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@global.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_07-----------------------#'
-SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@session.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_08-----------------------#'
SET @@global.sort_buffer_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '1'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
SET @@global.sort_buffer_size = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
1
-'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
'#---------------------FN_DYNVARS_151_09----------------------#'
SET @@global.sort_buffer_size = 9000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
@@sort_buffer_size = @@global.sort_buffer_size
0
'#---------------------FN_DYNVARS_151_10----------------------#'
SET @@sort_buffer_size = 9000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
@@sort_buffer_size = @@local.sort_buffer_size
1
@@ -165,14 +127,9 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
1
'#---------------------FN_DYNVARS_151_11----------------------#'
SET sort_buffer_size = 9100;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9100'
-SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
-@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
-1
-SELECT @@sort_buffer_size;
-@@sort_buffer_size
-32804
+SELECT @@sort_buffer_size BETWEEN 32776 AND 32999;
+@@sort_buffer_size BETWEEN 32776 AND 32999
+1
SELECT local.sort_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.sort_buffer_size;
@@ -180,10 +137,4 @@ ERROR 42S02: Unknown table 'session' in field list
SELECT sort_buffer_size = @@session.sort_buffer_size;
ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
SET @@global.sort_buffer_size = @start_global_value;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-262144
SET @@session.sort_buffer_size = @start_session_value;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-262144
diff --git a/mysql-test/r/sql_auto_is_null_basic.result b/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result
index b3a3eecd93a..b3a3eecd93a 100644
--- a/mysql-test/r/sql_auto_is_null_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result
diff --git a/mysql-test/r/sql_big_selects_basic.result b/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result
index 1171382380d..1171382380d 100644
--- a/mysql-test/r/sql_big_selects_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result
diff --git a/mysql-test/r/sql_big_selects_func.result b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
index fc7e1f32e00..fc7e1f32e00 100644
--- a/mysql-test/r/sql_big_selects_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
diff --git a/mysql-test/r/sql_big_tables_basic.result b/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result
index bce14b2aba2..bce14b2aba2 100644
--- a/mysql-test/r/sql_big_tables_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result
diff --git a/mysql-test/r/sql_big_tables_func.result b/mysql-test/suite/sys_vars/r/sql_big_tables_func.result
index 9b707e439ef..9b707e439ef 100644
--- a/mysql-test/r/sql_big_tables_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_tables_func.result
diff --git a/mysql-test/r/sql_buffer_result_basic.result b/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result
index d03b688dbe6..d03b688dbe6 100644
--- a/mysql-test/r/sql_buffer_result_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result
diff --git a/mysql-test/r/sql_buffer_result_func.result b/mysql-test/suite/sys_vars/r/sql_buffer_result_func.result
index 38d7f7ecc0a..38d7f7ecc0a 100644
--- a/mysql-test/r/sql_buffer_result_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_buffer_result_func.result
diff --git a/mysql-test/r/sql_log_bin_basic.result b/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
index 4e37c2079d6..4e37c2079d6 100644
--- a/mysql-test/r/sql_log_bin_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
diff --git a/mysql-test/r/sql_log_off_basic.result b/mysql-test/suite/sys_vars/r/sql_log_off_basic.result
index 03846cb6ce8..03846cb6ce8 100644
--- a/mysql-test/r/sql_log_off_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_off_basic.result
diff --git a/mysql-test/r/sql_log_off_func.result b/mysql-test/suite/sys_vars/r/sql_log_off_func.result
index e51860534f1..e51860534f1 100644
--- a/mysql-test/r/sql_log_off_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_off_func.result
diff --git a/mysql-test/r/sql_low_priority_updates_basic.result b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result
index 6a09e6720b3..6a09e6720b3 100644
--- a/mysql-test/r/sql_low_priority_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result
diff --git a/mysql-test/r/sql_low_priority_updates_func.result b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
index f0874ae7414..f0874ae7414 100644
--- a/mysql-test/r/sql_low_priority_updates_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
diff --git a/mysql-test/r/sql_max_join_size_func.result b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
index 0e406f6611e..0e406f6611e 100644
--- a/mysql-test/r/sql_max_join_size_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
diff --git a/mysql-test/r/sql_mode_basic.result b/mysql-test/suite/sys_vars/r/sql_mode_basic.result
index 78a9f179824..78a9f179824 100644
--- a/mysql-test/r/sql_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_mode_basic.result
diff --git a/mysql-test/r/sql_mode_func.result b/mysql-test/suite/sys_vars/r/sql_mode_func.result
index dbf0db4e1ad..dbf0db4e1ad 100644
--- a/mysql-test/r/sql_mode_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_mode_func.result
diff --git a/mysql-test/r/sql_notes_basic.result b/mysql-test/suite/sys_vars/r/sql_notes_basic.result
index 5dd792d8ede..5dd792d8ede 100644
--- a/mysql-test/r/sql_notes_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_notes_basic.result
diff --git a/mysql-test/r/sql_notes_func.result b/mysql-test/suite/sys_vars/r/sql_notes_func.result
index 87c4ecb8431..87c4ecb8431 100644
--- a/mysql-test/r/sql_notes_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_notes_func.result
diff --git a/mysql-test/r/sql_quote_show_create_basic.result b/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result
index 2550f2d1057..2550f2d1057 100644
--- a/mysql-test/r/sql_quote_show_create_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result
diff --git a/mysql-test/r/sql_quote_show_create_func.result b/mysql-test/suite/sys_vars/r/sql_quote_show_create_func.result
index 9c1e751eef2..9c1e751eef2 100644
--- a/mysql-test/r/sql_quote_show_create_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_quote_show_create_func.result
diff --git a/mysql-test/r/sql_safe_updates_basic.result b/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result
index 539b38bb1fe..539b38bb1fe 100644
--- a/mysql-test/r/sql_safe_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result
diff --git a/mysql-test/r/sql_safe_updates_func.result b/mysql-test/suite/sys_vars/r/sql_safe_updates_func.result
index cf8d613b683..cf8d613b683 100644
--- a/mysql-test/r/sql_safe_updates_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_safe_updates_func.result
diff --git a/mysql-test/r/sql_select_limit_func.result b/mysql-test/suite/sys_vars/r/sql_select_limit_func.result
index 893816e6f0f..893816e6f0f 100644
--- a/mysql-test/r/sql_select_limit_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_select_limit_func.result
diff --git a/mysql-test/r/sql_slave_skip_counter_basic.result b/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result
index 9ceef325483..9ceef325483 100644
--- a/mysql-test/r/sql_slave_skip_counter_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result
diff --git a/mysql-test/r/sql_warnings_basic.result b/mysql-test/suite/sys_vars/r/sql_warnings_basic.result
index 46907c0ced8..46907c0ced8 100644
--- a/mysql-test/r/sql_warnings_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_warnings_basic.result
diff --git a/mysql-test/r/sql_warnings_func.result b/mysql-test/suite/sys_vars/r/sql_warnings_func.result
index 8b723cf8be3..8b723cf8be3 100644
--- a/mysql-test/r/sql_warnings_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_warnings_func.result
diff --git a/mysql-test/r/ssl_ca_basic.result b/mysql-test/suite/sys_vars/r/ssl_ca_basic.result
index 618c5558c3e..618c5558c3e 100644
--- a/mysql-test/r/ssl_ca_basic.result
+++ b/mysql-test/suite/sys_vars/r/ssl_ca_basic.result
diff --git a/mysql-test/r/ssl_capath_basic.result b/mysql-test/suite/sys_vars/r/ssl_capath_basic.result
index 3d161392917..3d161392917 100644
--- a/mysql-test/r/ssl_capath_basic.result
+++ b/mysql-test/suite/sys_vars/r/ssl_capath_basic.result
diff --git a/mysql-test/r/ssl_cert_basic.result b/mysql-test/suite/sys_vars/r/ssl_cert_basic.result
index 1571730a653..1571730a653 100644
--- a/mysql-test/r/ssl_cert_basic.result
+++ b/mysql-test/suite/sys_vars/r/ssl_cert_basic.result
diff --git a/mysql-test/r/ssl_cipher_basic.result b/mysql-test/suite/sys_vars/r/ssl_cipher_basic.result
index df0fc8b5aad..df0fc8b5aad 100644
--- a/mysql-test/r/ssl_cipher_basic.result
+++ b/mysql-test/suite/sys_vars/r/ssl_cipher_basic.result
diff --git a/mysql-test/r/ssl_key_basic.result b/mysql-test/suite/sys_vars/r/ssl_key_basic.result
index 0869a2915e3..0869a2915e3 100644
--- a/mysql-test/r/ssl_key_basic.result
+++ b/mysql-test/suite/sys_vars/r/ssl_key_basic.result
diff --git a/mysql-test/r/storage_engine_basic.result b/mysql-test/suite/sys_vars/r/storage_engine_basic.result
index 8d621ac5599..8d621ac5599 100644
--- a/mysql-test/r/storage_engine_basic.result
+++ b/mysql-test/suite/sys_vars/r/storage_engine_basic.result
diff --git a/mysql-test/r/sync_frm_basic.result b/mysql-test/suite/sys_vars/r/sync_frm_basic.result
index 9792307d17f..9792307d17f 100644
--- a/mysql-test/r/sync_frm_basic.result
+++ b/mysql-test/suite/sys_vars/r/sync_frm_basic.result
diff --git a/mysql-test/r/system_time_zone_basic.result b/mysql-test/suite/sys_vars/r/system_time_zone_basic.result
index c398e5bd93b..c398e5bd93b 100644
--- a/mysql-test/r/system_time_zone_basic.result
+++ b/mysql-test/suite/sys_vars/r/system_time_zone_basic.result
diff --git a/mysql-test/r/table_definition_cache_basic.result b/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
index 13055d00600..13055d00600 100644
--- a/mysql-test/r/table_definition_cache_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
diff --git a/mysql-test/r/table_lock_wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
index 13771980188..13771980188 100644
--- a/mysql-test/r/table_lock_wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
diff --git a/mysql-test/r/table_open_cache_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
index b6891956489..b6891956489 100644
--- a/mysql-test/r/table_open_cache_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
diff --git a/mysql-test/r/thread_cache_size_func.result b/mysql-test/suite/sys_vars/r/thread_cache_size_func.result
index f808e28a512..f808e28a512 100644
--- a/mysql-test/r/thread_cache_size_func.result
+++ b/mysql-test/suite/sys_vars/r/thread_cache_size_func.result
diff --git a/mysql-test/r/thread_handling_basic.result b/mysql-test/suite/sys_vars/r/thread_handling_basic.result
index f5a333ac033..f5a333ac033 100644
--- a/mysql-test/r/thread_handling_basic.result
+++ b/mysql-test/suite/sys_vars/r/thread_handling_basic.result
diff --git a/mysql-test/r/time_zone_basic.result b/mysql-test/suite/sys_vars/r/time_zone_basic.result
index e7d419f28b5..e7d419f28b5 100644
--- a/mysql-test/r/time_zone_basic.result
+++ b/mysql-test/suite/sys_vars/r/time_zone_basic.result
diff --git a/mysql-test/r/time_zone_func.result b/mysql-test/suite/sys_vars/r/time_zone_func.result
index 2153a3f58ff..2153a3f58ff 100644
--- a/mysql-test/r/time_zone_func.result
+++ b/mysql-test/suite/sys_vars/r/time_zone_func.result
diff --git a/mysql-test/r/timed_mutexes_basic.result b/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result
index d8bd2cd975f..d8bd2cd975f 100644
--- a/mysql-test/r/timed_mutexes_basic.result
+++ b/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result
diff --git a/mysql-test/suite/sys_vars/r/timestamp_basic_32.result b/mysql-test/suite/sys_vars/r/timestamp_basic_32.result
index cc4f0324c0f..a8be2201e68 100644
--- a/mysql-test/suite/sys_vars/r/timestamp_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/timestamp_basic_32.result
@@ -35,11 +35,6 @@ ERROR 42000: Incorrect argument type to variable 'timestamp'
SET @@timestamp = 9999999999999999999999;
ERROR 42000: Incorrect argument type to variable 'timestamp'
'#----------------------FN_DYNVARS_001_06------------------------#'
-SELECT @@timestamp = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='timestamp';
-@@timestamp = VARIABLE_VALUE
-1
'#---------------------FN_DYNVARS_001_08-------------------------#'
SET @@timestamp = OFF;
ERROR 42000: Incorrect argument type to variable 'timestamp'
diff --git a/mysql-test/suite/sys_vars/r/timestamp_basic_64.result b/mysql-test/suite/sys_vars/r/timestamp_basic_64.result
index df877cd455b..824a3ea5529 100644
--- a/mysql-test/suite/sys_vars/r/timestamp_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/timestamp_basic_64.result
@@ -35,11 +35,6 @@ ERROR 42000: Incorrect argument type to variable 'timestamp'
SET @@timestamp = 9999999999999999999999;
ERROR 42000: Incorrect argument type to variable 'timestamp'
'#----------------------FN_DYNVARS_001_06------------------------#'
-SELECT @@timestamp = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='timestamp';
-@@timestamp = VARIABLE_VALUE
-1
'#---------------------FN_DYNVARS_001_08-------------------------#'
SET @@timestamp = OFF;
ERROR 42000: Incorrect argument type to variable 'timestamp'
diff --git a/mysql-test/r/timestamp_func.result b/mysql-test/suite/sys_vars/r/timestamp_func.result
index 1b49331c069..1b49331c069 100644
--- a/mysql-test/r/timestamp_func.result
+++ b/mysql-test/suite/sys_vars/r/timestamp_func.result
diff --git a/mysql-test/r/timestamp_sysdate_is_now_func.result b/mysql-test/suite/sys_vars/r/timestamp_sysdate_is_now_func.result
index e24ff2e962a..e24ff2e962a 100644
--- a/mysql-test/r/timestamp_sysdate_is_now_func.result
+++ b/mysql-test/suite/sys_vars/r/timestamp_sysdate_is_now_func.result
diff --git a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result b/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
index aeafd95ed55..3b4099d30ae 100644
--- a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
@@ -1,39 +1,21 @@
SET @start_global_value = @@global.tmp_table_size;
-SELECT @start_global_value;
-@start_global_value
-16777216
SET @start_session_value = @@session.tmp_table_size;
-SELECT @start_session_value;
-@start_session_value
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_005_01-------------------------#'
SET @@global.tmp_table_size = 100;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '100'
SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
SET @@session.tmp_table_size = 200;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '200'
SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size = 33554432;
-@@global.tmp_table_size = 33554432
-0
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size = 33554432;
-@@session.tmp_table_size = 33554432
-0
-'Bug# 34876: This variable has invalid default value as compared to documentation';
+SELECT @@global.tmp_table_size >= 16777216;
+@@global.tmp_table_size >= 16777216
+1
+SELECT @@session.tmp_table_size >= 16777216;
+@@session.tmp_table_size >= 16777216
+1
'#--------------------FN_DYNVARS_005_03-------------------------#'
SET @@global.tmp_table_size = 1024;
SELECT @@global.tmp_table_size;
@@ -52,7 +34,7 @@ SET @@session.tmp_table_size = 1024;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
1024
-SET @@session.tmp_table_size =4294967295;
+SET @@session.tmp_table_size = 4294967295;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
4294967295
@@ -79,7 +61,6 @@ Warning 1292 Truncated incorrect tmp_table_size value: '1000'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.tmp_table_size = ON;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@global.tmp_table_size = OFF;
@@ -96,7 +77,6 @@ Warning 1292 Truncated incorrect tmp_table_size value: '0'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
-'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
SET @@global.tmp_table_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@global.tmp_table_size ="Test";
@@ -120,18 +100,18 @@ SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = "Test";
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@session.tmp_table_size = 12345678901;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-4294967295
+SELECT @@session.tmp_table_size IN (12345678901,4294967295);
+@@session.tmp_table_size IN (12345678901,4294967295)
+1
'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT @@global.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
@@global.tmp_table_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT @@session.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
@@session.tmp_table_size = VARIABLE_VALUE
1
@@ -163,10 +143,4 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT tmp_table_size = @@session.tmp_table_size;
ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
SET @@global.tmp_table_size = @start_global_value;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
diff --git a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result
deleted file mode 100644
index 837b90fc143..00000000000
--- a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result
+++ /dev/null
@@ -1,172 +0,0 @@
-SET @start_global_value = @@global.tmp_table_size;
-SELECT @start_global_value;
-@start_global_value
-16777216
-SET @start_session_value = @@session.tmp_table_size;
-SELECT @start_session_value;
-@start_session_value
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.tmp_table_size = 100;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '100'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-SET @@session.tmp_table_size = 200;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '200'
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size = 33554432;
-@@global.tmp_table_size = 33554432
-0
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size = 33554432;
-@@session.tmp_table_size = 33554432
-0
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.tmp_table_size = 1024;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = 60020;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-60020
-SET @@global.tmp_table_size = 4294967295;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-4294967295
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.tmp_table_size = 1024;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size =4294967295;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-4294967295
-SET @@session.tmp_table_size = 65535;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-65535
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.tmp_table_size = 0;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = 1000;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '1000'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.tmp_table_size = ON;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size = True;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '1'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = False;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
-SET @@global.tmp_table_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = ON;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = True;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '1'
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size = False;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '0'
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = 12345678901;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-12345678901
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='tmp_table_size';
-@@global.tmp_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='tmp_table_size';
-@@session.tmp_table_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.tmp_table_size = 1024;
-SET @@tmp_table_size = 4294967295;
-SELECT @@tmp_table_size = @@global.tmp_table_size;
-@@tmp_table_size = @@global.tmp_table_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@tmp_table_size = 100;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '100'
-SELECT @@tmp_table_size = @@local.tmp_table_size;
-@@tmp_table_size = @@local.tmp_table_size
-1
-SELECT @@local.tmp_table_size = @@session.tmp_table_size;
-@@local.tmp_table_size = @@session.tmp_table_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET tmp_table_size = 1027;
-SELECT @@tmp_table_size;
-@@tmp_table_size
-1027
-SELECT local.tmp_table_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT global.tmp_table_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT tmp_table_size = @@session.tmp_table_size;
-ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
-SET @@global.tmp_table_size = @start_global_value;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
diff --git a/mysql-test/r/tmpdir_basic.result b/mysql-test/suite/sys_vars/r/tmpdir_basic.result
index 613cc8ec3cd..613cc8ec3cd 100644
--- a/mysql-test/r/tmpdir_basic.result
+++ b/mysql-test/suite/sys_vars/r/tmpdir_basic.result
diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
index 706d7802ed3..4aaf67c4064 100644
--- a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
@@ -40,6 +40,8 @@ SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
59392
SET @@global.transaction_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295'
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
4294966272
@@ -50,6 +52,8 @@ SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
1024
SET @@session.transaction_alloc_block_size =4294967295;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295'
SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
4294966272
@@ -146,6 +150,8 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size';
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@transaction_alloc_block_size = 1024;
SET @@global.transaction_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295'
SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
@@transaction_alloc_block_size = @@global.transaction_alloc_block_size
0
diff --git a/mysql-test/r/tx_isolation_basic.result b/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
index d487a6d92a8..d487a6d92a8 100644
--- a/mysql-test/r/tx_isolation_basic.result
+++ b/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
diff --git a/mysql-test/r/tx_isolation_func.result b/mysql-test/suite/sys_vars/r/tx_isolation_func.result
index 2242525f14b..2242525f14b 100644
--- a/mysql-test/r/tx_isolation_func.result
+++ b/mysql-test/suite/sys_vars/r/tx_isolation_func.result
diff --git a/mysql-test/r/unique_checks_basic.result b/mysql-test/suite/sys_vars/r/unique_checks_basic.result
index cc22c1c7f98..cc22c1c7f98 100644
--- a/mysql-test/r/unique_checks_basic.result
+++ b/mysql-test/suite/sys_vars/r/unique_checks_basic.result
diff --git a/mysql-test/r/updatable_views_with_limit_basic.result b/mysql-test/suite/sys_vars/r/updatable_views_with_limit_basic.result
index e2eebbd7a2c..e2eebbd7a2c 100644
--- a/mysql-test/r/updatable_views_with_limit_basic.result
+++ b/mysql-test/suite/sys_vars/r/updatable_views_with_limit_basic.result
diff --git a/mysql-test/r/updatable_views_with_limit_func.result b/mysql-test/suite/sys_vars/r/updatable_views_with_limit_func.result
index 0fdd4cbbb1b..0fdd4cbbb1b 100644
--- a/mysql-test/r/updatable_views_with_limit_func.result
+++ b/mysql-test/suite/sys_vars/r/updatable_views_with_limit_func.result
diff --git a/mysql-test/r/version_basic.result b/mysql-test/suite/sys_vars/r/version_basic.result
index 01710426ac9..01710426ac9 100644
--- a/mysql-test/r/version_basic.result
+++ b/mysql-test/suite/sys_vars/r/version_basic.result
diff --git a/mysql-test/r/version_comment_basic.result b/mysql-test/suite/sys_vars/r/version_comment_basic.result
index 5ef4bdbdd87..5ef4bdbdd87 100644
--- a/mysql-test/r/version_comment_basic.result
+++ b/mysql-test/suite/sys_vars/r/version_comment_basic.result
diff --git a/mysql-test/r/version_compile_machine_basic.result b/mysql-test/suite/sys_vars/r/version_compile_machine_basic.result
index eb239041929..eb239041929 100644
--- a/mysql-test/r/version_compile_machine_basic.result
+++ b/mysql-test/suite/sys_vars/r/version_compile_machine_basic.result
diff --git a/mysql-test/r/version_compile_os_basic.result b/mysql-test/suite/sys_vars/r/version_compile_os_basic.result
index 64dcb761ae1..64dcb761ae1 100644
--- a/mysql-test/r/version_compile_os_basic.result
+++ b/mysql-test/suite/sys_vars/r/version_compile_os_basic.result
diff --git a/mysql-test/r/wait_timeout_func.result b/mysql-test/suite/sys_vars/r/wait_timeout_func.result
index 01b4a71df87..01b4a71df87 100644
--- a/mysql-test/r/wait_timeout_func.result
+++ b/mysql-test/suite/sys_vars/r/wait_timeout_func.result
diff --git a/mysql-test/r/warning_count_basic.result b/mysql-test/suite/sys_vars/r/warning_count_basic.result
index 0ce85c7bbf9..0ce85c7bbf9 100644
--- a/mysql-test/r/warning_count_basic.result
+++ b/mysql-test/suite/sys_vars/r/warning_count_basic.result
diff --git a/mysql-test/t/auto_commit_basic.test b/mysql-test/suite/sys_vars/t/auto_commit_basic.test
index 0ea070ded59..0ea070ded59 100644
--- a/mysql-test/t/auto_commit_basic.test
+++ b/mysql-test/suite/sys_vars/t/auto_commit_basic.test
diff --git a/mysql-test/t/auto_increment_increment_basic.test b/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test
index 4acfb8f503b..4acfb8f503b 100644
--- a/mysql-test/t/auto_increment_increment_basic.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test
diff --git a/mysql-test/t/auto_increment_increment_func.test b/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test
index 7822775fb35..7822775fb35 100644
--- a/mysql-test/t/auto_increment_increment_func.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test
diff --git a/mysql-test/t/auto_increment_offset_basic.test b/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test
index a98fd6467ad..a98fd6467ad 100644
--- a/mysql-test/t/auto_increment_offset_basic.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test
diff --git a/mysql-test/t/auto_increment_offset_func.test b/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test
index 7e1668452cc..7e1668452cc 100644
--- a/mysql-test/t/auto_increment_offset_func.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test
diff --git a/mysql-test/t/autocommit_func-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/autocommit_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/autocommit_func-master.opt
diff --git a/mysql-test/t/autocommit_func.test b/mysql-test/suite/sys_vars/t/autocommit_func.test
index 07e15ce40da..07e15ce40da 100644
--- a/mysql-test/t/autocommit_func.test
+++ b/mysql-test/suite/sys_vars/t/autocommit_func.test
diff --git a/mysql-test/t/automatic_sp_privileges_basic.test b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
index 74da0904454..74da0904454 100644
--- a/mysql-test/t/automatic_sp_privileges_basic.test
+++ b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
diff --git a/mysql-test/t/automatic_sp_privileges_func.test b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_func.test
index ae5edbb078e..ae5edbb078e 100644
--- a/mysql-test/t/automatic_sp_privileges_func.test
+++ b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_func.test
diff --git a/mysql-test/t/basedir_basic.test b/mysql-test/suite/sys_vars/t/basedir_basic.test
index 480e46ca8a0..480e46ca8a0 100644
--- a/mysql-test/t/basedir_basic.test
+++ b/mysql-test/suite/sys_vars/t/basedir_basic.test
diff --git a/mysql-test/t/big_tables_basic.test b/mysql-test/suite/sys_vars/t/big_tables_basic.test
index 8665895bb19..8665895bb19 100644
--- a/mysql-test/t/big_tables_basic.test
+++ b/mysql-test/suite/sys_vars/t/big_tables_basic.test
diff --git a/mysql-test/t/binlog_format_basic.test b/mysql-test/suite/sys_vars/t/binlog_format_basic.test
index 819ad047c1b..cd2b772fcb1 100644
--- a/mysql-test/t/binlog_format_basic.test
+++ b/mysql-test/suite/sys_vars/t/binlog_format_basic.test
@@ -1,5 +1,3 @@
-
-
################## mysql-test\t\binlog_format_basic.test ######################
# #
# Variable Name: binlog_format #
@@ -17,8 +15,8 @@
# * Value Check #
# * Scope Check #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -33,6 +31,8 @@ SELECT @@GLOBAL.binlog_format;
####################################################################
# Displaying default value #
####################################################################
+SET @start_value= @@global.binlog_format;
+
SELECT COUNT(@@GLOBAL.binlog_format);
--echo 1 Expected
@@ -43,24 +43,11 @@ SELECT COUNT(@@SESSION.binlog_format);
####################################################################
# Check if Value can set #
####################################################################
-
-#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.binlog_format=1;
---echo Expected error 'Read only variable'
---echo Bug: Writeable static variable
-SELECT COUNT(@@GLOBAL.binlog_format);
---echo 1 Expected
-
-
+SELECT @@GLOBAL.binlog_format;
-#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@SESSION.binlog_format=1;
---echo Expected error 'Read only variable'
---echo Bug: Writeable static variable
-SELECT COUNT(@@SESSION.binlog_format);
---echo 1 Expected
-
-
+SELECT @@SESSION.binlog_format;
--echo '#---------------------BS_STVARS_002_03----------------------#'
#################################################################
@@ -76,7 +63,7 @@ SELECT COUNT(@@GLOBAL.binlog_format);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
--echo 1 Expected
@@ -86,8 +73,8 @@ WHERE VARIABLE_NAME='binlog_format';
# Check if the value in SESSION Table matches value in variable #
#################################################################
-SELECT @@SESSION.binlog_format = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT @@SESSION.binlog_format = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
--echo 1 Expected
@@ -95,13 +82,11 @@ SELECT COUNT(@@SESSION.binlog_format);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
--echo 1 Expected
-
-
--echo '#---------------------BS_STVARS_002_05----------------------#'
################################################################################
# Check if binlog_format can be accessed with and without @@ sign #
@@ -116,5 +101,5 @@ SELECT COUNT(@@SESSION.binlog_format);
SELECT COUNT(@@GLOBAL.binlog_format);
--echo 1 Expected
-
+SET @@global.binlog_format= @start_value;
diff --git a/mysql-test/t/character_set_client_basic.test b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
index 69e4c07dcd8..177a663c112 100644
--- a/mysql-test/t/character_set_client_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
@@ -207,7 +207,7 @@ SELECT @@character_set_client;
let charset_variable = @@global.character_set_client;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_010_08-------------------------#'
################################################################################
diff --git a/mysql-test/t/character_set_client_func.test b/mysql-test/suite/sys_vars/t/character_set_client_func.test
index 19994672fa4..19994672fa4 100644
--- a/mysql-test/t/character_set_client_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_client_func.test
diff --git a/mysql-test/t/character_set_connection_basic.test b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
index 509f8d0d346..5e28d43ce3e 100644
--- a/mysql-test/t/character_set_connection_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
@@ -122,7 +122,7 @@ SET @@character_set_connection = utf8 + latin2;
##############################################################################
let charset_variable = @@session.character_set_connection;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_011_07-------------------------#'
@@ -131,7 +131,7 @@ let charset_variable = @@session.character_set_connection;
##############################################################################
let charset_variable = @@global.character_set_connection;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_011_08-------------------------#'
diff --git a/mysql-test/t/character_set_connection_func.test b/mysql-test/suite/sys_vars/t/character_set_connection_func.test
index 04883b66544..11a8e311fd1 100644
--- a/mysql-test/t/character_set_connection_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_connection_func.test
@@ -14,14 +14,14 @@
# Description: Test Cases of Dynamic System Variable character_set_connection #
# that checks the behavior of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
--echo '#--------------------FN_DYNVARS_011_01-------------------------#'
##########################################################################
-# Check if setting character_set_connection is changed in new connection #
+# Check if setting character_set_connection is changed in new connection #
##########################################################################
#save
@@ -35,7 +35,7 @@ SET @@global.character_set_connection = utf8;
--echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
--echo 'connection con1'
-connection con1;
+connection con1;
SELECT @@global.character_set_connection;
SELECT @@session.character_set_connection;
disconnect con1;
@@ -51,7 +51,7 @@ connection default;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
-CREATE TABLE t1(b CHAR(40) character set utf8);
+CREATE TABLE t1(b CHAR(40) CHARACTER SET utf8);
#==============================================================================
--echo '--verify that character_set_connection converts character_set_client--'
#==============================================================================
@@ -90,13 +90,16 @@ INSERT INTO t1 VALUES('ÐЂЃЄ');
SELECT * FROM t1;
TRUNCATE TABLE t1;
-#restore
-#save
+
+# Cleanup
SET @@global.character_set_connection = @global_character_set_connection;
SET @@session.character_set_connection = @session_character_set_connection;
SET @@session.character_set_client = @session_character_set_client;
SET @@session.character_set_results = @session_character_set_results;
+DROP TABLE t1;
+
#############################################################
# End of functionality Testing for character_set_connection #
#############################################################
+
diff --git a/mysql-test/t/character_set_database_basic.test b/mysql-test/suite/sys_vars/t/character_set_database_basic.test
index 9690fb84b5a..08069c00ae0 100644
--- a/mysql-test/t/character_set_database_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_database_basic.test
@@ -121,7 +121,7 @@ SET @@character_set_database = utf8 + latin2;
#############################################################################
let charset_variable = @@session.character_set_database;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_012_07-------------------------#'
@@ -130,7 +130,7 @@ let charset_variable = @@session.character_set_database;
##############################################################################
let charset_variable = @@global.character_set_database;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_012_08-------------------------#'
diff --git a/mysql-test/t/character_set_database_func.test b/mysql-test/suite/sys_vars/t/character_set_database_func.test
index b2d2d017d64..78b1f1ab49b 100644
--- a/mysql-test/t/character_set_database_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_database_func.test
@@ -29,6 +29,7 @@
SET @global_character_set_database = @@global.character_set_database;
SET @session_character_set_database = @@session.character_set_database;
SET @session_character_set_server = @@session.character_set_server;
+SET @global_character_set_server = @@global.character_set_server;
SET @@global.character_set_database = utf8;
--echo 'connect (con1,localhost,root,,,,)'
@@ -92,24 +93,44 @@ CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
--echo 'Verify with latin';
SET @@session.character_set_database = latin1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/charset_utf8.txt' INTO TABLE t1;
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/charset_utf8.txt' INTO TABLE t1;
SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
TRUNCATE TABLE t1;
--echo 'Verify with utf8';
SET @@session.character_set_database = utf8;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/charset_utf8.txt' INTO TABLE t1;
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/charset_utf8.txt' INTO TABLE t1;
SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
+
+#==============================================================================
+--echo 'Bug#27208: If no current database, character_set_database !=character_set_server'
+#==============================================================================
+
+SET GLOBAL character_set_server=latin5;
+
+connect (con2, localhost, root,,);
+connection con2;
+
+CREATE DATABASE csdb CHARACTER SET = utf8;
+USE csdb;
+DROP DATABASE csdb;
+SELECT @@character_set_database;
+
+connection default;
+disconnect con2;
+
+
#restore
SET @@global.character_set_database = @global_character_set_database;
SET @@session.character_set_database = @session_character_set_database;
SET @@session.character_set_server = @session_character_set_server;
+SET @@global.character_set_server = @global_character_set_server;
############################################################
# End of functionality Testing for character_set_database #
############################################################
diff --git a/mysql-test/t/character_set_filesystem_basic.test b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
index 0117145a06b..3ba9c269a84 100644
--- a/mysql-test/t/character_set_filesystem_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
@@ -121,7 +121,7 @@ SET @@character_set_filesystem = utf8 + latin2;
###############################################################################
let charset_variable = @@session.character_set_filesystem;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_008_07-------------------------#'
@@ -130,7 +130,7 @@ let charset_variable = @@session.character_set_filesystem;
##############################################################################
let charset_variable = @@global.character_set_filesystem;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_008_08-------------------------#'
diff --git a/mysql-test/t/character_set_filesystem_func-master.opt b/mysql-test/suite/sys_vars/t/character_set_filesystem_func-master.opt
index 52a49182a53..52a49182a53 100644
--- a/mysql-test/t/character_set_filesystem_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/character_set_filesystem_func-master.opt
diff --git a/mysql-test/t/character_set_results_basic.test b/mysql-test/suite/sys_vars/t/character_set_results_basic.test
index aae05c824d1..98635c00287 100644
--- a/mysql-test/t/character_set_results_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_results_basic.test
@@ -121,7 +121,7 @@ SET @@character_set_results = utf8 + latin2;
##############################################################################
let charset_variable = @@session.character_set_results;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_013_07-------------------------#'
@@ -130,7 +130,7 @@ let charset_variable = @@session.character_set_results;
###############################################################################
let charset_variable = @@global.character_set_results;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_013_08-------------------------#'
diff --git a/mysql-test/t/character_set_results_func.test b/mysql-test/suite/sys_vars/t/character_set_results_func.test
index df7437f225f..df7437f225f 100644
--- a/mysql-test/t/character_set_results_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_results_func.test
diff --git a/mysql-test/t/character_set_server_basic.test b/mysql-test/suite/sys_vars/t/character_set_server_basic.test
index 2b3c078363a..21eb3fb36dc 100644
--- a/mysql-test/t/character_set_server_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_server_basic.test
@@ -123,7 +123,7 @@ SET @@character_set_server = utf8 + latin2;
let charset_variable = @@session.character_set_server;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_009_07-------------------------#'
@@ -132,7 +132,7 @@ let charset_variable = @@session.character_set_server;
###############################################################################
let charset_variable = @@global.character_set_server;
---source include/charset_basic.inc
+--source suite/sys_vars/inc/charset_basic.inc
--echo '#--------------------FN_DYNVARS_009_08-------------------------#'
diff --git a/mysql-test/t/character_set_server_func.test b/mysql-test/suite/sys_vars/t/character_set_server_func.test
index c17568c35ea..c17568c35ea 100644
--- a/mysql-test/t/character_set_server_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_server_func.test
diff --git a/mysql-test/t/character_set_system_basic.test b/mysql-test/suite/sys_vars/t/character_set_system_basic.test
index 9d59b313efc..9d59b313efc 100644
--- a/mysql-test/t/character_set_system_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_system_basic.test
diff --git a/mysql-test/t/collation_connection_basic.test b/mysql-test/suite/sys_vars/t/collation_connection_basic.test
index f3544dd306e..bf82ea321b7 100644
--- a/mysql-test/t/collation_connection_basic.test
+++ b/mysql-test/suite/sys_vars/t/collation_connection_basic.test
@@ -122,7 +122,7 @@ SET @@collation_connection = latin7_general_ci + latin7_general_cs;
###############################################################################
let collation_variable = @@session.collation_connection;
---source include/collation_basic.inc
+--source suite/sys_vars/inc/collation_basic.inc
--echo '#--------------------FN_DYNVARS_015_07-------------------------#'
@@ -131,7 +131,7 @@ let collation_variable = @@session.collation_connection;
###############################################################################
let collation_variable = @@global.collation_connection;
---source include/collation_basic.inc
+--source suite/sys_vars/inc/collation_basic.inc
--echo '#--------------------FN_DYNVARS_015_08-------------------------#'
diff --git a/mysql-test/t/collation_connection_func.test b/mysql-test/suite/sys_vars/t/collation_connection_func.test
index bdb2efd9959..bdb2efd9959 100644
--- a/mysql-test/t/collation_connection_func.test
+++ b/mysql-test/suite/sys_vars/t/collation_connection_func.test
diff --git a/mysql-test/t/collation_database_basic.test b/mysql-test/suite/sys_vars/t/collation_database_basic.test
index c130e276084..557f32b86a0 100644
--- a/mysql-test/t/collation_database_basic.test
+++ b/mysql-test/suite/sys_vars/t/collation_database_basic.test
@@ -121,7 +121,7 @@ SET @@collation_database = latin7_general_ci + latin7_general_cs;
###########################################################################
let collation_variable = @@session.collation_database;
---source include/collation_basic.inc
+--source suite/sys_vars/inc/collation_basic.inc
--echo '#--------------------FN_DYNVARS_016_07-------------------------#'
@@ -130,7 +130,7 @@ let collation_variable = @@session.collation_database;
###############################################################################
let collation_variable = @@global.collation_database;
---source include/collation_basic.inc
+--source suite/sys_vars/inc/collation_basic.inc
--echo '#--------------------FN_DYNVARS_016_08-------------------------#'
diff --git a/mysql-test/t/collation_database_func.test b/mysql-test/suite/sys_vars/t/collation_database_func.test
index ba8fc5a3d5e..ba8fc5a3d5e 100644
--- a/mysql-test/t/collation_database_func.test
+++ b/mysql-test/suite/sys_vars/t/collation_database_func.test
diff --git a/mysql-test/t/collation_server_basic.test b/mysql-test/suite/sys_vars/t/collation_server_basic.test
index c4b469007e5..a8af13c13ae 100644
--- a/mysql-test/t/collation_server_basic.test
+++ b/mysql-test/suite/sys_vars/t/collation_server_basic.test
@@ -121,7 +121,7 @@ SET @@collation_server = latin7_general_ci + latin7_general_cs;
##############################################################################
let collation_variable = @@session.collation_server;
---source include/collation_basic.inc
+--source suite/sys_vars/inc/collation_basic.inc
--echo '#--------------------FN_DYNVARS_014_07-------------------------#'
@@ -130,7 +130,7 @@ let collation_variable = @@session.collation_server;
#############################################################################
let collation_variable = @@global.collation_server;
---source include/collation_basic.inc
+--source suite/sys_vars/inc/collation_basic.inc
--echo '#--------------------FN_DYNVARS_014_08-------------------------#'
diff --git a/mysql-test/t/collation_server_func.test b/mysql-test/suite/sys_vars/t/collation_server_func.test
index 045cb5cf720..045cb5cf720 100644
--- a/mysql-test/t/collation_server_func.test
+++ b/mysql-test/suite/sys_vars/t/collation_server_func.test
diff --git a/mysql-test/t/completion_type_basic.test b/mysql-test/suite/sys_vars/t/completion_type_basic.test
index 7ffc1aa593b..7ffc1aa593b 100644
--- a/mysql-test/t/completion_type_basic.test
+++ b/mysql-test/suite/sys_vars/t/completion_type_basic.test
diff --git a/mysql-test/t/completion_type_func-master.opt b/mysql-test/suite/sys_vars/t/completion_type_func-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/completion_type_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/completion_type_func-master.opt
diff --git a/mysql-test/t/completion_type_func.test b/mysql-test/suite/sys_vars/t/completion_type_func.test
index 4f1ebf6700b..ed0f04c37b4 100644
--- a/mysql-test/t/completion_type_func.test
+++ b/mysql-test/suite/sys_vars/t/completion_type_func.test
@@ -1,4 +1,4 @@
-############## mysql-test\t\completion_type_func.test #########################
+############## mysql-test\t\completion_type_func.test ##########################
# #
# Variable Name: completion_type #
# Scope: GLOBAL & SESSION #
@@ -12,7 +12,7 @@
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable "completion_type" #
-# that checks functinality of this variable #
+# that checks functionality of this variable #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_completion_type #
@@ -22,7 +22,7 @@
--source include/have_innodb.inc
--disable_warnings
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
--enable_warnings
#########################
@@ -32,62 +32,62 @@ drop table if exists t1;
--echo ## Creating new table ##
CREATE TABLE t1
(
-id INT NOT NULL auto_increment,
+id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
-name varchar(30)
+name VARCHAR(30)
) ENGINE = INNODB;
--echo '#--------------------FN_DYNVARS_017_01-------------------------#'
#########################################################
-# Setting initial value of completion_type to zero #
+# Setting initial value of completion_type to zero #
#########################################################
--echo ## Creating new connection ##
connect (test_con1,localhost,root,,);
connection test_con1;
-INSERT into t1(name) values('Record_1');
+INSERT INTO t1(name) VALUES('Record_1');
SET @@autocommit = 0;
-SELECT * from t1;
+SELECT * FROM t1;
--echo ## Setting value of variable to 0 ##
SET @@session.completion_type = 0;
--echo ## Here commit & rollback should work normally ##
START TRANSACTION;
-SELECT * from t1;
-INSERT into t1(name) values('Record_2');
-INSERT into t1(name) values('Record_3');
-SELECT * from t1;
-DELETE FROM t1 where id = 2;
-SELECT * from t1;
+SELECT * FROM t1;
+INSERT INTO t1(name) VALUES('Record_2');
+INSERT INTO t1(name) VALUES('Record_3');
+SELECT * FROM t1;
+DELETE FROM t1 WHERE id = 2;
+SELECT * FROM t1;
START TRANSACTION;
-SELECT * from t1;
-INSERT into t1(name) values('Record_4');
-INSERT into t1(name) values('Record_5');
+SELECT * FROM t1;
+INSERT INTO t1(name) VALUES('Record_4');
+INSERT INTO t1(name) VALUES('Record_5');
COMMIT;
--echo '#--------------------FN_DYNVARS_017_02-------------------------#'
#########################################################
-# Setting initial value of completion_type to 2 #
+# Setting initial value of completion_type to 2 #
#########################################################
SET @@session.completion_type = 2;
--echo ## Here commit should work as COMMIT RELEASE ##
START TRANSACTION;
-SELECT * from t1;
-INSERT into t1(name) values('Record_6');
-INSERT into t1(name) values('Record_7');
+SELECT * FROM t1;
+INSERT INTO t1(name) VALUES('Record_6');
+INSERT INTO t1(name) VALUES('Record_7');
COMMIT;
--echo ## Inserting rows should give error here because connection should ##
--echo ## disconnect after using COMMIT ##
--Error 2006,2013,1053
-INSERT into t1(name) values('Record_4');
+INSERT INTO t1(name) VALUES('Record_4');
--echo ## Creating new connection test_con2 ##
connect (test_con2,localhost,root,,);
@@ -96,11 +96,17 @@ SET @@session.completion_type = 2;
--echo ## Inserting rows and using Rollback which should Rollback & release ##
START TRANSACTION;
-SELECT * from t1;
-INSERT into t1(name) values('Record_8');
-INSERT into t1(name) values('Record_9');
+SELECT * FROM t1;
+INSERT INTO t1(name) VALUES('Record_8');
+INSERT INTO t1(name) VALUES('Record_9');
ROLLBACK;
--Error 2006,2013,1053
-INSERT into t1(name) values('Record_4');
+INSERT INTO t1(name) VALUES('Record_4');
+
+connection default;
+disconnect test_con1;
+disconnect test_con2;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/concurrent_insert_basic.test b/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test
index bc401ef22a3..bc401ef22a3 100644
--- a/mysql-test/t/concurrent_insert_basic.test
+++ b/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test
diff --git a/mysql-test/t/concurrent_insert_func.test b/mysql-test/suite/sys_vars/t/concurrent_insert_func.test
index e6ea7c4304b..cdeb76d9cac 100644
--- a/mysql-test/t/concurrent_insert_func.test
+++ b/mysql-test/suite/sys_vars/t/concurrent_insert_func.test
@@ -14,14 +14,15 @@
# Description: Test Cases of Dynamic System Variable "concurrent_insert" #
# that checks functionality of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html#option_mysqld_concurrent_insert #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
################################################################################
+--source include/not_embedded.inc
--disable_warnings
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
--enable_warnings
#########################
@@ -31,110 +32,131 @@ drop table if exists t1;
--echo ## Creating new table ##
CREATE TABLE t1
(
-name varchar(30)
+name VARCHAR(30)
);
--echo '#--------------------FN_DYNVARS_018_01-------------------------#'
####################################################################
-# Setting initial value of concurrent_insert to 1
-# concurrent_insert = 1 means Enables concurrent insert
+# Setting initial value of concurrent_insert to 1
+# concurrent_insert = 1 means Enables concurrent insert
# for MyISAM tables that don't have holes
####################################################################
+SET @start_value= @@global.concurrent_insert;
+
--echo ## Setting initial value of variable to 1 ##
SET @@global.concurrent_insert = 1;
-INSERT into t1(name) values('Record_1');
-INSERT into t1(name) values('Record_2');
-INSERT into t1(name) values('Record_3');
+INSERT INTO t1(name) VALUES('Record_1');
+INSERT INTO t1(name) VALUES('Record_2');
+INSERT INTO t1(name) VALUES('Record_3');
--echo ## locking table ##
-lock table t1 read local;
+LOCK TABLE t1 READ LOCAL;
---echo ## Creating new connection to insert some rows in table ##
+--echo ## Creating new connection to insert some rows in table ##
connect (test_con1,localhost,root,,);
+--echo connection test_con1;
connection test_con1;
--echo ## New records should come at the end of all rows ##
-INSERT into t1(name) values('Record_4');
-SELECT * from t1;
+INSERT INTO t1(name) VALUES('Record_4');
+SELECT * FROM t1;
--echo ## unlocking tables ##
+--echo connection default;
connection default;
-unlock tables;
+UNLOCK TABLES;
---echo ## deleting record to create hole in table ##
-DELETE from t1 where name ='Record_2';
+--echo ## deleting record to create hole in table ##
+DELETE FROM t1 WHERE name ='Record_2';
--echo '#--------------------FN_DYNVARS_018_02-------------------------#'
####################################################################
-# Setting initial value of concurrent_insert to 1
-# concurrent_insert = 1 and trying to insert some values
+# Setting initial value of concurrent_insert to 1
+# concurrent_insert = 1 and trying to insert some values
# in MyISAM tables that have holes
####################################################################
-
# lock table and connect with connection1
-#lock table t1 read local;
-#connection test_con1;
+LOCK TABLE t1 READ LOCAL;
+--echo connection test_con1;
+connection test_con1;
# setting value of concurrent_insert to 1
-#SET @@global.concurrent_insert=1;
-
-#INSERT into t1(name) values('Record_7');
-#SELECT * from t1;
-
-#connection default;
-#unlock tables;
-
-#SELECT * from t1;
-#INSERT into t1(name) values('Record_6');
-
-# On inserting rows in hole while the value of concurrent_insert is 1
-# MySQL server hangs.
+SET @@global.concurrent_insert=1;
+--echo ## send INSERT which should be blocked until unlock of the table ##
+send
+INSERT INTO t1(name) VALUES('Record_7');
+--echo connection default;
+connection default;
+# wait until INSERT will be locked (low performance)
+let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE state= "Locked" AND info LIKE "INSERT INTO t1%";
+--source include/wait_condition.inc
+
+--echo ## show processlist info and state ##
+SELECT state,info FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE state= "Locked" AND info LIKE "INSERT INTO t1%";
+--echo ## table contents befor UNLOCK ##
+SELECT * FROM t1;
+UNLOCK TABLES;
+--echo ## table contens after UNLOCK ##
+SELECT * FROM t1;
+INSERT INTO t1(name) VALUES('Record_6');
+
+--echo connection test_con1;
+connection test_con1;
+# to complete the send above^
+reap;
+SELECT * FROM t1;
+--echo connection default;
+connection default;
--echo '#--------------------FN_DYNVARS_018_03-------------------------#'
-###############################################################################
+################################################################################
# Setting value of concurrent_insert to 2 to verify values after inserting
# it into table with holes
-# concurrent_insert = 2 means Enables concurrent insert
+# concurrent_insert = 2 means Enables concurrent insert
# for MyISAM tables that have holes but inserts values at the end of all rows
-###############################################################################
+################################################################################
--echo ## lock table and connect with connection1 ##
-lock table t1 read local;
+LOCK TABLE t1 READ LOCAL;
+--echo connection test_con1;
connection test_con1;
-
--echo ## setting value of concurrent_insert to 2 ##
SET @@global.concurrent_insert=2;
--echo ## Inserting record in table, record should go at the end of the table ##
-INSERT into t1(name) values('Record_5');
-SELECT * from t1;
+INSERT INTO t1(name) VALUES('Record_5');
+SELECT * FROM t1;
SELECT @@concurrent_insert;
---echo ## Switching to default connection ##
+--echo connection default;
connection default;
--echo ## Unlocking table ##
-unlock tables;
+UNLOCK TABLES;
-SELECT * from t1;
+SELECT * FROM t1;
--echo ## Inserting new row, this should go in the hole ##
-INSERT into t1(name) values('Record_6');
-SELECT * from t1;
+INSERT INTO t1(name) VALUES('Record_6');
+SELECT * FROM t1;
--echo ## connection test_con1 ##
-DELETE from t1 where name ='Record_3';
-SELECT * from t1;
+DELETE FROM t1 WHERE name ='Record_3';
+SELECT * FROM t1;
--echo ## Dropping table ##
-DROP table t1;
+DROP TABLE t1;
--echo ## Disconnecting connection ##
disconnect test_con1;
+SET @@global.concurrent_insert= @start_value;
+
diff --git a/mysql-test/t/connect_timeout_basic.test b/mysql-test/suite/sys_vars/t/connect_timeout_basic.test
index 095c85f8295..095c85f8295 100644
--- a/mysql-test/t/connect_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/connect_timeout_basic.test
diff --git a/mysql-test/t/datadir_basic.test b/mysql-test/suite/sys_vars/t/datadir_basic.test
index 7fae68fa55e..7fae68fa55e 100644
--- a/mysql-test/t/datadir_basic.test
+++ b/mysql-test/suite/sys_vars/t/datadir_basic.test
diff --git a/mysql-test/t/default_week_format_basic.test b/mysql-test/suite/sys_vars/t/default_week_format_basic.test
index d8b4a09541f..d8b4a09541f 100644
--- a/mysql-test/t/default_week_format_basic.test
+++ b/mysql-test/suite/sys_vars/t/default_week_format_basic.test
diff --git a/mysql-test/t/default_week_format_func.test b/mysql-test/suite/sys_vars/t/default_week_format_func.test
index c80c49b39fb..c80c49b39fb 100644
--- a/mysql-test/t/default_week_format_func.test
+++ b/mysql-test/suite/sys_vars/t/default_week_format_func.test
diff --git a/mysql-test/t/delay_key_write_basic.test b/mysql-test/suite/sys_vars/t/delay_key_write_basic.test
index faa1cb3cc6e..faa1cb3cc6e 100644
--- a/mysql-test/t/delay_key_write_basic.test
+++ b/mysql-test/suite/sys_vars/t/delay_key_write_basic.test
diff --git a/mysql-test/t/delay_key_write_func-master.opt b/mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt
index a449c0fb964..a449c0fb964 100644
--- a/mysql-test/t/delay_key_write_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt
diff --git a/mysql-test/t/delay_key_write_func.test b/mysql-test/suite/sys_vars/t/delay_key_write_func.test
index 3c0319be427..a44b37653d2 100644
--- a/mysql-test/t/delay_key_write_func.test
+++ b/mysql-test/suite/sys_vars/t/delay_key_write_func.test
@@ -14,16 +14,17 @@
# Description: Test Cases of Dynamic System Variable delay_key_write #
# that checks the behavior of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
--echo '#--------------------FN_DYNVARS_023_01-------------------------#'
#######################################################################
-# Check if setting delay_key_write is changed in every new connection #
+# Check if setting delay_key_write is changed in every new connection #
#######################################################################
+SET @start_value= @@global.delay_key_write;
SET @@global.delay_key_write = ON;
SELECT @@global.delay_key_write;
@@ -51,11 +52,11 @@ SELECT @@global.delay_key_write AS res_is_ALL;
--disable_query_log
DELIMITER //;
CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT)
-BEGIN
- WHILE (var1 < var2) DO
- INSERT INTO t1 VALUES(var1,REPEAT('MYSQL',10),100000.0/var1);
- SET var1=var1+1;
- END WHILE;
+BEGIN
+ WHILE (var1 < var2) DO
+ INSERT INTO t1 VALUES(var1,REPEAT('MYSQL',10),100000.0/var1);
+ SET var1=var1+1;
+ END WHILE;
END//
DELIMITER ;//
--enable_query_log
@@ -77,7 +78,7 @@ CREATE TABLE t1(
a INT PRIMARY KEY,
b VARCHAR(512),
c DOUBLE
-)delay_key_write = 1;
+) DELAY_KEY_WRITE = 1;
--enable_query_log
@@ -88,7 +89,7 @@ CALL sp_addRecords(1,10);
SHOW STATUS LIKE 'Key_reads';
SHOW STATUS LIKE 'Key_writes';
SHOW STATUS LIKE 'Key_write_requests';
-select count(*) from t1;
+SELECT COUNT(*) FROM t1;
#==============================================================================
--echo '----check when delay_key_write is ON---'
@@ -105,7 +106,7 @@ CREATE TABLE t1(
a INT PRIMARY KEY,
b VARCHAR(512),
c DOUBLE
-)delay_key_write = 1;
+) DELAY_KEY_WRITE = 1;
--enable_query_log
FLUSH STATUS;
@@ -114,7 +115,7 @@ CALL sp_addRecords(1,10);
SHOW STATUS LIKE 'Key_reads';
SHOW STATUS LIKE 'Key_writes';
SHOW STATUS LIKE 'Key_write_requests';
-select count(*) from t1;
+SELECT COUNT(*) FROM t1;
#==============================================================================
--echo '----check when delay_key_write is ALL---'
@@ -130,7 +131,7 @@ CREATE TABLE t1(
a INT PRIMARY KEY,
b VARCHAR(512),
c DOUBLE
-)delay_key_write = 0;
+) DELAY_KEY_WRITE = 0;
--enable_query_log
FLUSH STATUS;
@@ -139,11 +140,16 @@ CALL sp_addRecords(1,10);
SHOW STATUS LIKE 'Key_reads';
SHOW STATUS LIKE 'Key_writes';
SHOW STATUS LIKE 'Key_write_requests';
-select count(*) from t1;
+SELECT COUNT(*) FROM t1;
DROP PROCEDURE sp_addRecords;
DROP TABLE t1;
+disconnect user1;
+
+connection default;
+SET @@global.delay_key_write= @start_value;
####################################################
# End of functionality testing for delay_key_write #
####################################################
+
diff --git a/mysql-test/t/delayed_insert_limit_func.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
index 97e1f2daed1..97e1f2daed1 100644
--- a/mysql-test/t/delayed_insert_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
diff --git a/mysql-test/t/delayed_insert_timeout_basic.test b/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test
index 8bad6b2dfe6..8bad6b2dfe6 100644
--- a/mysql-test/t/delayed_insert_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test
diff --git a/mysql-test/t/div_precision_increment_basic.test b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test
index 40497e829df..40497e829df 100644
--- a/mysql-test/t/div_precision_increment_basic.test
+++ b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test
diff --git a/mysql-test/t/div_precision_increment_func.test b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test
index aebca88abf9..aebca88abf9 100644
--- a/mysql-test/t/div_precision_increment_func.test
+++ b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test
diff --git a/mysql-test/t/engine_condition_pushdown_basic.test b/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test
index ee781159d6a..ee781159d6a 100644
--- a/mysql-test/t/engine_condition_pushdown_basic.test
+++ b/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test
diff --git a/mysql-test/t/error_count_basic.test b/mysql-test/suite/sys_vars/t/error_count_basic.test
index 14001874c22..14001874c22 100644
--- a/mysql-test/t/error_count_basic.test
+++ b/mysql-test/suite/sys_vars/t/error_count_basic.test
diff --git a/mysql-test/t/event_scheduler_basic.test b/mysql-test/suite/sys_vars/t/event_scheduler_basic.test
index f7045651613..f7045651613 100644
--- a/mysql-test/t/event_scheduler_basic.test
+++ b/mysql-test/suite/sys_vars/t/event_scheduler_basic.test
diff --git a/mysql-test/t/event_scheduler_func.test b/mysql-test/suite/sys_vars/t/event_scheduler_func.test
index f727b2b6833..f727b2b6833 100644
--- a/mysql-test/t/event_scheduler_func.test
+++ b/mysql-test/suite/sys_vars/t/event_scheduler_func.test
diff --git a/mysql-test/t/expire_logs_days_basic.test b/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test
index 02448d1fd11..02448d1fd11 100644
--- a/mysql-test/t/expire_logs_days_basic.test
+++ b/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test
diff --git a/mysql-test/t/flush_basic.test b/mysql-test/suite/sys_vars/t/flush_basic.test
index f5f6665562e..f5f6665562e 100644
--- a/mysql-test/t/flush_basic.test
+++ b/mysql-test/suite/sys_vars/t/flush_basic.test
diff --git a/mysql-test/t/foreign_key_checks_basic.test b/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test
index 54d94aca971..54d94aca971 100644
--- a/mysql-test/t/foreign_key_checks_basic.test
+++ b/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test
diff --git a/mysql-test/t/foreign_key_checks_func.test b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
index 4d2c63bbce6..4d2c63bbce6 100644
--- a/mysql-test/t/foreign_key_checks_func.test
+++ b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
diff --git a/mysql-test/t/ft_boolean_syntax_basic.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
index 4117605c452..4117605c452 100644
--- a/mysql-test/t/ft_boolean_syntax_basic.test
+++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
diff --git a/mysql-test/t/ft_boolean_syntax_func.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test
index 4ea28b015cb..4ea28b015cb 100644
--- a/mysql-test/t/ft_boolean_syntax_func.test
+++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test
diff --git a/mysql-test/t/general_log_basic.test b/mysql-test/suite/sys_vars/t/general_log_basic.test
index 82f3be45bc9..82f3be45bc9 100644
--- a/mysql-test/t/general_log_basic.test
+++ b/mysql-test/suite/sys_vars/t/general_log_basic.test
diff --git a/mysql-test/t/general_log_file_basic-master.opt b/mysql-test/suite/sys_vars/t/general_log_file_basic-master.opt
index 8482f8cbbc3..8482f8cbbc3 100644
--- a/mysql-test/t/general_log_file_basic-master.opt
+++ b/mysql-test/suite/sys_vars/t/general_log_file_basic-master.opt
diff --git a/mysql-test/t/general_log_file_basic.test b/mysql-test/suite/sys_vars/t/general_log_file_basic.test
index 639e6619ef9..014108f88d2 100644
--- a/mysql-test/t/general_log_file_basic.test
+++ b/mysql-test/suite/sys_vars/t/general_log_file_basic.test
@@ -10,6 +10,7 @@
# #
# Creation Date: 2008-03-16 #
# Author: Salman Rawala #
+# Modified: HHunger 2008-09-11 Set system variable back to the start value #
# #
# Description: Test Cases of Dynamic System Variable "general_log_file" #
# that checks behavior of this variable in the following ways #
@@ -18,8 +19,8 @@
# * Scope & Access method #
# * Data Integrity #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html#option_mysqld_general_log_file #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
################################################################################
@@ -67,7 +68,9 @@ SELECT @@global.general_log_file = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='general_log_file';
+SET @@global.general_log_file= @start_value;
#####################################################
# END OF general_log_file TESTS #
#####################################################
+
diff --git a/mysql-test/t/general_log_file_func-master.opt b/mysql-test/suite/sys_vars/t/general_log_file_func-master.opt
index 3652d715f5f..3652d715f5f 100644
--- a/mysql-test/t/general_log_file_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/general_log_file_func-master.opt
diff --git a/mysql-test/t/general_log_file_func.test b/mysql-test/suite/sys_vars/t/general_log_file_func.test
index eeea3f75d26..1a73a4a5eaa 100644
--- a/mysql-test/t/general_log_file_func.test
+++ b/mysql-test/suite/sys_vars/t/general_log_file_func.test
@@ -21,7 +21,7 @@
--disable_warnings
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
--enable_warnings
#########################
@@ -31,7 +31,7 @@ drop table if exists t1;
--echo ## Creating new table ##
CREATE TABLE t1
(
-id INT NOT NULL auto_increment,
+id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
name VARCHAR(30)
);
@@ -40,18 +40,17 @@ name VARCHAR(30)
####################################################################
# Verifying general log as we have initialized in opt file #
####################################################################
-
-
SELECT @@general_log_file;
-INSERT into t1(name) values('Record_1');
-INSERT into t1(name) values('Record_2');
-INSERT into t1(name) values('Record_3');
-INSERT into t1(name) values('Record_4');
+INSERT INTO t1(name) VALUES('Record_1');
+INSERT INTO t1(name) VALUES('Record_2');
+INSERT INTO t1(name) VALUES('Record_3');
+INSERT INTO t1(name) VALUES('Record_4');
--echo ## Verifying general log file ##
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---file_exists $MYSQLTEST_VARDIR/master-data/mysql-test.log
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--file_exists $MYSQLD_DATADIR/mysql-test.log
--echo ## Dropping table ##
DROP TABLE t1;
diff --git a/mysql-test/t/general_log_func.test b/mysql-test/suite/sys_vars/t/general_log_func.test
index 39ce964a105..24d535e88e5 100644
--- a/mysql-test/t/general_log_func.test
+++ b/mysql-test/suite/sys_vars/t/general_log_func.test
@@ -46,17 +46,17 @@ name VARCHAR(30)
SET @@global.general_log = OFF;
SELECT @@general_log;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---copy_file $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test.log
+
+let $MYSQLD_LOGFILE= `select @@global.general_log_file`;
+--copy_file $MYSQLD_LOGFILE $MYSQLD_LOGFILE.copy
--echo ## Inserting some Records & Verifying output in log ##
INSERT into t1(name) values('Record_1');
INSERT into t1(name) values('Record_2');
--echo ## There should be no difference, case should pass ##
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---diff_files $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test.log
-
+--diff_files $MYSQLD_LOGFILE $MYSQLD_LOGFILE.copy
+--remove_file $MYSQLD_LOGFILE.copy
--echo '#--------------------FN_DYNVARS_018_01-------------------------#'
####################################################################
@@ -68,19 +68,25 @@ INSERT into t1(name) values('Record_2');
SET @@global.general_log = ON;
SELECT @@general_log;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---copy_file $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test-1.log
+--copy_file $MYSQLD_LOGFILE $MYSQLD_LOGFILE.copy
+--chmod 0777 $MYSQLD_LOGFILE.copy
--echo ## Inserting some Records & Verifying output in log ##
INSERT into t1(name) values('Record_3');
INSERT into t1(name) values('Record_4');
-
---echo ## There should be no difference, case should pass ##
-#--diff_files var/log/master.log var/log/master-test-1.log
-
---echo ## This case is failing which shows that mysql is writing in general ##
---echo ## log when we set general_log to ON ##
+--copy_file $MYSQLD_LOGFILE $MYSQLD_LOGFILE.orig
+--chmod 0777 $MYSQLD_LOGFILE.orig
+
+--echo ## There should be a difference ##
+SET @@global.max_allowed_packet= 1024*1024*1024;
+--replace_result $MYSQLD_LOGFILE MYSQLD_LOGFILE
+eval SET @orig_file= load_file('$MYSQLD_LOGFILE.orig');
+--replace_result $MYSQLD_LOGFILE MYSQLD_LOGFILE
+eval SET @copy_file= load_file('$MYSQLD_LOGFILE.copy');
+eval SELECT STRCMP(@orig_file, @copy_file);
+--remove_file $MYSQLD_LOGFILE.copy
+--remove_file $MYSQLD_LOGFILE.orig
--echo ## Dropping tables ##
DROP TABLE t1;
diff --git a/mysql-test/t/group_concat_max_len_basic.test b/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test
index 1bc707f4b5d..1bc707f4b5d 100644
--- a/mysql-test/t/group_concat_max_len_basic.test
+++ b/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test
diff --git a/mysql-test/t/group_concat_max_len_func.test b/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test
index 29a4ff5becb..29a4ff5becb 100644
--- a/mysql-test/t/group_concat_max_len_func.test
+++ b/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test
diff --git a/mysql-test/t/have_compress_basic.test b/mysql-test/suite/sys_vars/t/have_compress_basic.test
index f704ae67a1c..f704ae67a1c 100644
--- a/mysql-test/t/have_compress_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_compress_basic.test
diff --git a/mysql-test/t/have_crypt_basic.test b/mysql-test/suite/sys_vars/t/have_crypt_basic.test
index 7ca193d83bd..7ca193d83bd 100644
--- a/mysql-test/t/have_crypt_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_crypt_basic.test
diff --git a/mysql-test/t/have_csv_basic.test b/mysql-test/suite/sys_vars/t/have_csv_basic.test
index 12081ff270e..12081ff270e 100644
--- a/mysql-test/t/have_csv_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_csv_basic.test
diff --git a/mysql-test/t/have_dynamic_loading_basic.test b/mysql-test/suite/sys_vars/t/have_dynamic_loading_basic.test
index 3e13664752a..3e13664752a 100644
--- a/mysql-test/t/have_dynamic_loading_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_dynamic_loading_basic.test
diff --git a/mysql-test/t/have_geometry_basic.test b/mysql-test/suite/sys_vars/t/have_geometry_basic.test
index 3ec0690bd16..3ec0690bd16 100644
--- a/mysql-test/t/have_geometry_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_geometry_basic.test
diff --git a/mysql-test/t/have_innodb_basic.test b/mysql-test/suite/sys_vars/t/have_innodb_basic.test
index 9ae1bb0d443..9ae1bb0d443 100644
--- a/mysql-test/t/have_innodb_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_innodb_basic.test
diff --git a/mysql-test/t/have_ndbcluster_basic.test b/mysql-test/suite/sys_vars/t/have_ndbcluster_basic.test
index 1ac341ff62e..1ac341ff62e 100644
--- a/mysql-test/t/have_ndbcluster_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_ndbcluster_basic.test
diff --git a/mysql-test/t/have_openssl_basic.test b/mysql-test/suite/sys_vars/t/have_openssl_basic.test
index 037c8f4cbe6..037c8f4cbe6 100644
--- a/mysql-test/t/have_openssl_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_openssl_basic.test
diff --git a/mysql-test/t/have_partitioning_basic.test b/mysql-test/suite/sys_vars/t/have_partitioning_basic.test
index b37abdb1498..b37abdb1498 100644
--- a/mysql-test/t/have_partitioning_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_partitioning_basic.test
diff --git a/mysql-test/t/have_query_cache_basic.test b/mysql-test/suite/sys_vars/t/have_query_cache_basic.test
index 1c32300dec9..1c32300dec9 100644
--- a/mysql-test/t/have_query_cache_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_query_cache_basic.test
diff --git a/mysql-test/t/have_rtree_keys_basic.test b/mysql-test/suite/sys_vars/t/have_rtree_keys_basic.test
index 493c45530a6..493c45530a6 100644
--- a/mysql-test/t/have_rtree_keys_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_rtree_keys_basic.test
diff --git a/mysql-test/t/have_ssl_basic.test b/mysql-test/suite/sys_vars/t/have_ssl_basic.test
index c92219d2252..c92219d2252 100644
--- a/mysql-test/t/have_ssl_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_ssl_basic.test
diff --git a/mysql-test/t/have_symlink_basic.test b/mysql-test/suite/sys_vars/t/have_symlink_basic.test
index 924da7c7a9f..924da7c7a9f 100644
--- a/mysql-test/t/have_symlink_basic.test
+++ b/mysql-test/suite/sys_vars/t/have_symlink_basic.test
diff --git a/mysql-test/t/hostname_basic.test b/mysql-test/suite/sys_vars/t/hostname_basic.test
index 9f1dff756e2..9f1dff756e2 100644
--- a/mysql-test/t/hostname_basic.test
+++ b/mysql-test/suite/sys_vars/t/hostname_basic.test
diff --git a/mysql-test/t/identity_basic.test b/mysql-test/suite/sys_vars/t/identity_basic.test
index fa5fc807414..fa5fc807414 100644
--- a/mysql-test/t/identity_basic.test
+++ b/mysql-test/suite/sys_vars/t/identity_basic.test
diff --git a/mysql-test/t/identity_func-master.opt b/mysql-test/suite/sys_vars/t/identity_func-master.opt
index 66f581b56d0..66f581b56d0 100644
--- a/mysql-test/t/identity_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/identity_func-master.opt
diff --git a/mysql-test/t/identity_func.test b/mysql-test/suite/sys_vars/t/identity_func.test
index ff93607a2cd..ff93607a2cd 100644
--- a/mysql-test/t/identity_func.test
+++ b/mysql-test/suite/sys_vars/t/identity_func.test
diff --git a/mysql-test/t/init_connect_basic.test b/mysql-test/suite/sys_vars/t/init_connect_basic.test
index 8557dfbf4fc..8557dfbf4fc 100644
--- a/mysql-test/t/init_connect_basic.test
+++ b/mysql-test/suite/sys_vars/t/init_connect_basic.test
diff --git a/mysql-test/t/init_slave_basic.test b/mysql-test/suite/sys_vars/t/init_slave_basic.test
index b137a525090..b137a525090 100644
--- a/mysql-test/t/init_slave_basic.test
+++ b/mysql-test/suite/sys_vars/t/init_slave_basic.test
diff --git a/mysql-test/t/innodb_additional_mem_pool_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_additional_mem_pool_size_basic.test
index ffb1046ed32..ffb1046ed32 100644
--- a/mysql-test/t/innodb_additional_mem_pool_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_additional_mem_pool_size_basic.test
diff --git a/mysql-test/t/innodb_autoextend_increment_basic.test b/mysql-test/suite/sys_vars/t/innodb_autoextend_increment_basic.test
index 86f8c7aa7a4..eb208e7197f 100644
--- a/mysql-test/t/innodb_autoextend_increment_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_autoextend_increment_basic.test
@@ -1,99 +1,87 @@
-################# mysql-test\t\innodb_autoextend_increment _basic.test ###################
-# #
-# Variable Name: innodb_autoextend_increment #
-# Scope: GLOBAL #
-# Access Type: Dynamic #
-# Data Type: Numeric #
-# Default Value: 8 #
-# Range: 0,1 #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author: Rizwan #
-# #
-#Description:Test Cases of Dynamic System Variable innodb_autoextend_increment#
-# that checks the behavior of this variable in the following ways #
-# * Default Value #
-# * Valid & Invalid values #
-# * Scope & Access method #
-# * Data Integrity #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
-###############################################################################
+################# mysql-test\t\innodb_autoextend_increment _basic.test ###########
+# #
+# Variable Name: innodb_autoextend_increment #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 8 #
+# Range: 0,1 #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author: Rizwan #
+# #
+# Description: #
+# Test Cases of Dynamic System Variable innodb_autoextend_increment that #
+# checks the behavior of this variable in the following ways #
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
+# #
+##################################################################################
--source include/have_innodb.inc
--source include/load_sysvars.inc
-########################################################################
+########################################################################
# START OF innodb_autoextend_increment TESTS #
-########################################################################
+########################################################################
-################################################################################
-# Saving initial value of innodb_autoextend_increment in a temporary variable#
-################################################################################
+###############################################################################
+# Saving initial value of innodb_autoextend_increment in a temporary variable #
+###############################################################################
SET @global_start_value = @@global.innodb_autoextend_increment ;
-SELECT @global_start_value;
-
-
--echo '#--------------------FN_DYNVARS_046_01------------------------#'
-########################################################################
+########################################################################
# Display the DEFAULT value of innodb_autoextend_increment #
-########################################################################
-
-
+########################################################################
SET @@global.innodb_autoextend_increment = 0;
SET @@global.innodb_autoextend_increment = DEFAULT;
SELECT @@global.innodb_autoextend_increment ;
--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
-####################################################################################
+####################################################################################
# Check if innodb_autoextend_increment can be accessed with and without @@ sign #
-####################################################################################
+####################################################################################
--Error ER_GLOBAL_VARIABLE
SET innodb_autoextend_increment = 1;
SELECT @@innodb_autoextend_increment ;
-
--Error ER_UNKNOWN_TABLE
SELECT local.innodb_autoextend_increment ;
-
SET global innodb_autoextend_increment = 0;
SELECT @@global.innodb_autoextend_increment ;
--echo '#--------------------FN_DYNVARS_046_03------------------------#'
-##########################################################################
-# change the value of innodb_autoextend_increment to a valid value #
-##########################################################################
-
-
+##########################################################################
+# change the value of innodb_autoextend_increment to a valid value #
+##########################################################################
SET @@global.innodb_autoextend_increment = 1;
SELECT @@global.innodb_autoextend_increment ;
SET @@global.innodb_autoextend_increment = 1000;
SELECT @@global.innodb_autoextend_increment ;
---echo '#--------------------FN_DYNVARS_046_04-------------------------#'
-###########################################################################
-# Change the value of innodb_autoextend_increment to invalid value #
-###########################################################################
-
-
+--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+###########################################################################
+# Change the value of innodb_autoextend_increment to invalid value #
+###########################################################################
SET @@global.innodb_autoextend_increment = -1;
SELECT @@global.innodb_autoextend_increment;
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_autoextend_increment = "T";
SELECT @@global.innodb_autoextend_increment;
@@ -102,31 +90,28 @@ SELECT @@global.innodb_autoextend_increment;
SET @@global.innodb_autoextend_increment = "Y";
SELECT @@global.innodb_autoextend_increment;
-
SET @@global.innodb_autoextend_increment = 1001;
SELECT @@global.innodb_autoextend_increment;
-
-
--echo '#----------------------FN_DYNVARS_046_05------------------------#'
-#########################################################################
+#########################################################################
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@global.innodb_autoextend_increment = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT @@global.innodb_autoextend_increment = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_autoextend_increment ';
SELECT @@global.innodb_autoextend_increment ;
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_autoextend_increment ';
--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
-###################################################################
+###################################################################
# Check if ON and OFF values can be used on variable #
-###################################################################
+###################################################################
--ERROR ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_autoextend_increment = OFF;
@@ -136,25 +121,25 @@ SELECT @@global.innodb_autoextend_increment ;
SET @@global.innodb_autoextend_increment = ON;
SELECT @@global.innodb_autoextend_increment ;
+
--echo '#---------------------FN_DYNVARS_046_07----------------------#'
-###################################################################
+###################################################################
# Check if TRUE and FALSE values can be used on variable #
-###################################################################
-
+###################################################################
SET @@global.innodb_autoextend_increment = TRUE;
SELECT @@global.innodb_autoextend_increment ;
SET @@global.innodb_autoextend_increment = FALSE;
SELECT @@global.innodb_autoextend_increment ;
-##############################
+
+##############################
# Restore initial value #
##############################
+SET @@global.innodb_autoextend_increment = @global_start_value;
-#SET @@global.innodb_autoextend_increment = @global_start_value;
-#SELECT @@global.innodb_autoextend_increment ;
-
###############################################################
-# END OF innodb_autoextend_increment TESTS #
-###############################################################
+# END OF innodb_autoextend_increment TESTS #
+###############################################################
+
diff --git a/mysql-test/t/innodb_autoinc_lock_mode_basic.test b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
index 5b6fa943bbe..5b6fa943bbe 100644
--- a/mysql-test/t/innodb_autoinc_lock_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
diff --git a/mysql-test/t/innodb_autoinc_lock_mode_func-master.opt b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt
index ab9fcb75678..ab9fcb75678 100644
--- a/mysql-test/t/innodb_autoinc_lock_mode_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt
diff --git a/mysql-test/t/innodb_autoinc_lock_mode_func.test b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test
index 1ff7868ce87..89c1c80a6dc 100644
--- a/mysql-test/t/innodb_autoinc_lock_mode_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test
@@ -11,11 +11,12 @@
# Creation Date: 2008-03-08 #
# Author: Rizwan Maredia #
# #
-#Description:Test Cases of Dynamic System Variable innodb_autoextend_increment#
-# that checks the behavior of this variable #
+# Description: #
+# Test Cases of Dynamic System Variable innodb_autoextend_increment that #
+# checks the behavior of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -43,12 +44,14 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR
-)ENGINE=INNODB, AUTO_INCREMENT=100;
+) ENGINE=INNODB, AUTO_INCREMENT=100;
INSERT INTO t1 (a,b) VALUES (5,'a'), (NULL,'b'), (1,'c'), (NULL,'d');
INSERT INTO t1 (a,b) VALUES (NULL,'e');
--echo 'the new auto incremented value should be 104'
-SELECT * from t1;
+SELECT * FROM t1;
+
+DROP TABLE t1;
###############################################################
# End of functionality Testing for innodb_autoinc_lock_mode #
diff --git a/mysql-test/t/innodb_buffer_pool_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
index 190b2d19bc4..190b2d19bc4 100644
--- a/mysql-test/t/innodb_buffer_pool_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
diff --git a/mysql-test/t/innodb_checksums_basic.test b/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test
index 89daad9ce0a..89daad9ce0a 100644
--- a/mysql-test/t/innodb_checksums_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test
diff --git a/mysql-test/t/innodb_commit_concurrency_basic.test b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
index 1ef69e34999..1ef69e34999 100644
--- a/mysql-test/t/innodb_commit_concurrency_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
diff --git a/mysql-test/t/innodb_data_file_path_basic.test b/mysql-test/suite/sys_vars/t/innodb_data_file_path_basic.test
index 1d88c47b1bb..1d88c47b1bb 100644
--- a/mysql-test/t/innodb_data_file_path_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_data_file_path_basic.test
diff --git a/mysql-test/t/innodb_data_home_dir_basic.test b/mysql-test/suite/sys_vars/t/innodb_data_home_dir_basic.test
index f3b02edf83b..f3b02edf83b 100644
--- a/mysql-test/t/innodb_data_home_dir_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_data_home_dir_basic.test
diff --git a/mysql-test/t/innodb_doublewrite_basic.test b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
index 4a0460bb4bc..4a0460bb4bc 100644
--- a/mysql-test/t/innodb_doublewrite_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
diff --git a/mysql-test/t/innodb_fast_shutdown_basic.test b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
index 5e108708716..7de63332844 100644
--- a/mysql-test/t/innodb_fast_shutdown_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
@@ -9,54 +9,51 @@
# #
# #
# Creation Date: 2008-02-20 #
-# Author: Sharique Abdullah #
+# Author: Sharique Abdullah #
# #
-# Description: Test Cases of Dynamic System Variable innodb_fast_shutdown #
-# that checks the behavior of this variable in the following ways#
+# Description: #
+# Test Cases of Dynamic System Variable innodb_fast_shutdown that checks #
+# the behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
--source include/have_innodb.inc
--source include/load_sysvars.inc
-########################################################################
+########################################################################
# START OF innodb_fast_shutdown TESTS #
-########################################################################
+########################################################################
-##############################################################################
+##############################################################################
# Saving initial value of innodb_fast_shutdown in a temporary variable #
-##############################################################################
-
-
+##############################################################################
SET @global_start_value = @@global.innodb_fast_shutdown;
SELECT @@global.innodb_fast_shutdown;
-
+
--echo '#--------------------FN_DYNVARS_042_01------------------------#'
-########################################################################
+########################################################################
# Display the DEFAULT value of innodb_fast_shutdown #
-########################################################################
+########################################################################
SET @@global.innodb_fast_shutdown = 0;
SET @@global.innodb_fast_shutdown = DEFAULT;
SELECT @@global.innodb_fast_shutdown;
-
--echo '#---------------------FN_DYNVARS_042_02-------------------------#'
-#############################################################################
+#############################################################################
# Check if innodb_fast_shutdown can be accessed with and without @@ sign #
-#############################################################################
-
+#############################################################################
--ERROR ER_GLOBAL_VARIABLE
SET innodb_fast_shutdown = 1;
@@ -70,25 +67,26 @@ SELECT @@global.innodb_fast_shutdown;
--echo '#--------------------FN_DYNVARS_042_03------------------------#'
-########################################################################
-# Change the value of innodb_fast_shutdown to a valid value #
-########################################################################
+##########################################################################
+# Change the value of innodb_fast_shutdown to a valid value #
+##########################################################################
SET @@global.innodb_fast_shutdown = 0;
SELECT @@global.innodb_fast_shutdown;
SET @@global.innodb_fast_shutdown = 1;
SELECT @@global.innodb_fast_shutdown;
-## a value of 2 is used to just flush logs and then shutdown cold. Not supported on Netware
+## A value of 2 is used to just flush logs and then shutdown cold.
+## Not supported on Netware
SET @@global.innodb_fast_shutdown = 2;
SELECT @@global.innodb_fast_shutdown;
+
--echo '#--------------------FN_DYNVARS_042_04-------------------------#'
-###########################################################################
+###########################################################################
# Change the value of innodb_fast_shutdown to invalid value #
-###########################################################################
-
+###########################################################################
SET @@global.innodb_fast_shutdown = -1;
SELECT @@global.innodb_fast_shutdown;
@@ -121,11 +119,10 @@ SET @@global.innodb_fast_shutdown = "0";
SELECT @@global.innodb_fast_shutdown;
-
--echo '#-------------------FN_DYNVARS_042_05----------------------------#'
-###########################################################################
+###########################################################################
# Test if accessing session innodb_fast_shutdown gives error #
-###########################################################################
+###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.innodb_fast_shutdown = 0;
@@ -136,32 +133,30 @@ SET @@innodb_fast_shutdown = 0;
SET @@local.innodb_fast_shutdown = 0;
-
--echo '#----------------------FN_DYNVARS_042_06------------------------#'
-#########################################################################
+#########################################################################
# Check if the value in SESSION Table contains variable value #
#########################################################################
-SELECT count(VARIABLE_VALUE) AS res_is_0
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT count(VARIABLE_VALUE) AS res_is_0
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='innodb_fast_shutdown';
--echo '#----------------------FN_DYNVARS_042_07------------------------#'
-#########################################################################
-# Check if the value in GLOBAL Table matches value in variable #
+#########################################################################
+# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
SELECT @@global.innodb_fast_shutdown =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_fast_shutdown';
--echo '#---------------------FN_DYNVARS_042_08-------------------------#'
-###################################################################
+###################################################################
# Check if ON and OFF values can be used on variable #
-###################################################################
-
+###################################################################
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_fast_shutdown = OFF;
@@ -171,23 +166,25 @@ SELECT @@global.innodb_fast_shutdown;
SET @@global.innodb_fast_shutdown = ON;
SELECT @@global.innodb_fast_shutdown;
+
--echo '#---------------------FN_DYNVARS_042_09----------------------#'
-###################################################################
+###################################################################
# Check if TRUE and FALSE values can be used on variable #
-###################################################################
+###################################################################
SET @@global.innodb_fast_shutdown = TRUE;
SELECT @@global.innodb_fast_shutdown;
SET @@global.innodb_fast_shutdown = FALSE;
SELECT @@global.innodb_fast_shutdown;
-##############################
+
+##############################
# Restore initial value #
##############################
-#SET @@innodb_fast_shutdown = @global_start_value;
-#SELECT @@innodb_fast_shutdown;
+SET @@global.innodb_fast_shutdown = @global_start_value;
+SELECT @@global.innodb_fast_shutdown;
-########################################################################
+########################################################################
# END OF innodb_fast_shutdown TESTS #
-########################################################################
+########################################################################
diff --git a/mysql-test/t/innodb_file_io_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_io_threads_basic.test
index 32cdd0beac4..32cdd0beac4 100644
--- a/mysql-test/t/innodb_file_io_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_io_threads_basic.test
diff --git a/mysql-test/t/innodb_file_per_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
index bc0e34c484e..bc0e34c484e 100644
--- a/mysql-test/t/innodb_file_per_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
diff --git a/mysql-test/t/innodb_flush_log_at_trx_commit_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_log_at_trx_commit_basic.test
index 90da929d199..90da929d199 100644
--- a/mysql-test/t/innodb_flush_log_at_trx_commit_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_log_at_trx_commit_basic.test
diff --git a/mysql-test/t/innodb_flush_method_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test
index 531df4a2464..531df4a2464 100644
--- a/mysql-test/t/innodb_flush_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test
diff --git a/mysql-test/t/innodb_force_recovery_basic.test b/mysql-test/suite/sys_vars/t/innodb_force_recovery_basic.test
index f5aa769f09f..f5aa769f09f 100644
--- a/mysql-test/t/innodb_force_recovery_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_force_recovery_basic.test
diff --git a/mysql-test/t/innodb_lock_wait_timeout_basic.test b/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
index ed31fc9eb6b..ed31fc9eb6b 100644
--- a/mysql-test/t/innodb_lock_wait_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
diff --git a/mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test b/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test
index 63835113770..63835113770 100644
--- a/mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test
diff --git a/mysql-test/t/innodb_log_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_buffer_size_basic.test
index 74c1aeab87a..74c1aeab87a 100644
--- a/mysql-test/t/innodb_log_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_log_buffer_size_basic.test
diff --git a/mysql-test/t/innodb_log_file_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_file_size_basic.test
index 08925b73957..08925b73957 100644
--- a/mysql-test/t/innodb_log_file_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_log_file_size_basic.test
diff --git a/mysql-test/t/innodb_log_files_in_group_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_files_in_group_basic.test
index 67978efe76a..67978efe76a 100644
--- a/mysql-test/t/innodb_log_files_in_group_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_log_files_in_group_basic.test
diff --git a/mysql-test/t/innodb_log_group_home_dir_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_group_home_dir_basic.test
index 7e3969c6bd7..7e3969c6bd7 100644
--- a/mysql-test/t/innodb_log_group_home_dir_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_log_group_home_dir_basic.test
diff --git a/mysql-test/t/innodb_max_dirty_pages_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
index 38c3acd92a2..38c3acd92a2 100644
--- a/mysql-test/t/innodb_max_dirty_pages_pct_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
diff --git a/mysql-test/t/innodb_max_dirty_pages_pct_func.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
index 5d7b9754843..d077a3acf50 100644
--- a/mysql-test/t/innodb_max_dirty_pages_pct_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
@@ -10,20 +10,27 @@
# #
# Creation Date: 2008-03-08 #
# Author: Rizwan #
+# Modified: HHunger 2009-01-29 Fix for bug#39382, replaced sleep by wait cond.#
+# added comments, beautifications. #
# #
-#Description: Test Cases of Dynamic System Variable innodb_max_dirty_pages_pct#
-# that checks the behavior of this variable #
+# Description: #
+# Test Cases of Dynamic System Variable innodb_max_dirty_pages_pct that #
+# checks the behavior of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
--source include/have_innodb.inc
+
+# safe initial value
+SET @innodb_max_dirty_pages_pct = @@global.innodb_max_dirty_pages_pct;
+
--echo '#--------------------FN_DYNVARS_044_02-------------------------#'
-###########################################################################
-# Check if setting innodb_max_dirty_pages_pct is changed in new connection#
-###########################################################################
+############################################################################
+# Check if setting innodb_max_dirty_pages_pct is changed in new connection #
+############################################################################
SET @@global.innodb_max_dirty_pages_pct = 80;
--echo 'connect (con1,localhost,root,,,,)'
@@ -37,18 +44,20 @@ connect (con2,localhost,root,,,,);
--echo 'connection con2'
connection con2;
SELECT @@global.innodb_max_dirty_pages_pct;
+--echo 'connection default'
+connection default;
+--echo 'disconnect con2'
disconnect con2;
+--echo 'disconnect con1'
disconnect con1;
+# restore initial value
+SET @@global.innodb_max_dirty_pages_pct = @innodb_max_dirty_pages_pct;
--echo '#--------------------FN_DYNVARS_044_02-------------------------#'
###################################################################
# Begin the functionality Testing of innodb_max_dirty_pages_pct #
###################################################################
---echo 'connection default'
-connection default;
-
---disable_query_log
--disable_warnings
DROP PROCEDURE IF EXISTS add_records;
@@ -59,12 +68,12 @@ DROP TABLE IF EXISTS t1;
--enable_warnings
DELIMITER //;
-CREATE PROCEDURE add_records(IN NUM INT)
+CREATE PROCEDURE add_records(IN num INT)
BEGIN
START TRANSACTION;
- WHILE (NUM>0) DO
+ WHILE (num > 0) DO
INSERT INTO t1(b) VALUES('MYSQL');
- SET NUM = NUM - 1;
+ SET num = num - 1;
END WHILE;
COMMIT;
END//
@@ -72,50 +81,45 @@ END//
CREATE FUNCTION dirty_pct() RETURNS DECIMAL(20,17)
BEGIN
DECLARE res DECIMAL(20,17);
- DECLARE a1,b1 VARCHAR(256);
- DECLARE a2,b2 VARCHAR(256);
- DECLARE dirty CURSOR FOR SELECT * FROM information_schema.global_status
- WHERE variable_name LIKE 'Innodb_buffer_pool_pages_dirty'
- UNION SELECT * FROM information_schema.session_status
+ DECLARE a1, b1 VARCHAR(256);
+ DECLARE a2, b2 VARCHAR(256);
+ DECLARE dirty CURSOR FOR SELECT * FROM information_schema.global_status
WHERE variable_name LIKE 'Innodb_buffer_pool_pages_dirty';
DECLARE total CURSOR FOR SELECT * FROM information_schema.global_status
- WHERE variable_name LIKE 'Innodb_buffer_pool_pages_total'
- UNION SELECT * FROM information_schema.session_status
WHERE variable_name LIKE 'Innodb_buffer_pool_pages_total';
-
+
OPEN dirty;
OPEN total;
FETCH dirty INTO a1, b1;
FETCH total INTO a2, b2;
-
- SET res = ( CONVERT(b1,DECIMAL)*100)/CONVERT(b2,DECIMAL);
+
+ SET res = (CONVERT(b1,DECIMAL) * 100) / CONVERT(b2,DECIMAL);
CLOSE dirty;
CLOSE total;
RETURN res;
END//
-CREATE PROCEDURE add_until(IN NUM DECIMAL)
+CREATE PROCEDURE add_until(IN num DECIMAL)
BEGIN
DECLARE pct,last DECIMAL(20,17);
-
SET pct = dirty_pct();
SET last = 0;
- WHILE (pct<NUM and pct<100) DO
+ WHILE (pct < num AND pct < 100) DO
CALL add_records(500);
SET pct = dirty_pct();
- IF (pct<last) THEN
- SET pct = NUM+1;
+ IF (pct < last) THEN
+ SET pct = num + 1;
ELSE
SET last = pct;
END IF;
END WHILE;
END//
-CREATE PROCEDURE check_pct(IN NUM DECIMAL)
+CREATE PROCEDURE check_pct(IN num DECIMAL)
BEGIN
- IF (dirty_pct() < NUM) THEN
+ IF (dirty_pct() < num) THEN
SELECT 'BELOW_MAX' AS PCT_VALUE;
ELSE
SELECT 'ABOVE_MAX' AS PCT_VALUE;
@@ -127,9 +131,7 @@ DELIMITER ;//
CREATE TABLE t1(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(200)
-)ENGINE=INNODB;
-
---enable_query_log
+) ENGINE = INNODB;
#==========================================================
--echo '---Check when innodb_max_dirty_pages_pct is 10---'
@@ -139,24 +141,29 @@ SET @@global.innodb_max_dirty_pages_pct = 10;
FLUSH STATUS;
-# add rows until dirty pages pct is less than this value
+# add rows until dirty pages pct is about @@global.innodb_max_dirty_pages_pc
CALL add_until(10);
-# give server some time to flush dirty pages
+# Give the server some time to flush dirty pages
FLUSH TABLES;
-CALL add_records(500);
---echo '--sleep 5'
---sleep 5
---echo 'We expect dirty pages pct to be BELOW_MAX'
-CALL check_pct(10);
+# Add more pages to be over @@global.innodb_max_dirty_pages_pc
+CALL add_records(500);
-#SHOW STATUS LIKE 'innodb%';
+# Give server time to write pages to disk (depends on performance of the system)
+let $wait_condition= SELECT (dirty_pct() <= @@global.innodb_max_dirty_pages_pct);
+--source include/wait_condition.inc
+--echo 'We expect dirty pages pct to be BELOW_MAX after some time depending on performance'
+CALL check_pct(10);
DROP PROCEDURE add_records;
DROP PROCEDURE add_until;
DROP PROCEDURE check_pct;
DROP FUNCTION dirty_pct;
+DROP TABLE t1;
+
+# restore initial value
+SET @@global.innodb_max_dirty_pages_pct = @innodb_max_dirty_pages_pct;
##################################################################
# End of functionality Testing for innodb_max_dirty_pages_pct #
diff --git a/mysql-test/t/innodb_mirrored_log_groups_basic.test b/mysql-test/suite/sys_vars/t/innodb_mirrored_log_groups_basic.test
index 6edb07ac39f..6edb07ac39f 100644
--- a/mysql-test/t/innodb_mirrored_log_groups_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_mirrored_log_groups_basic.test
diff --git a/mysql-test/t/innodb_open_files_basic.test b/mysql-test/suite/sys_vars/t/innodb_open_files_basic.test
index c55b7e55937..c55b7e55937 100644
--- a/mysql-test/t/innodb_open_files_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_open_files_basic.test
diff --git a/mysql-test/t/innodb_rollback_on_timeout_basic.test b/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test
index c33e0fa1b75..c33e0fa1b75 100644
--- a/mysql-test/t/innodb_rollback_on_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test
diff --git a/mysql-test/t/innodb_support_xa_basic.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
index 6da3e68ebdf..6da3e68ebdf 100644
--- a/mysql-test/t/innodb_support_xa_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
diff --git a/mysql-test/t/innodb_support_xa_func.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_func.test
index f1b6fe84fe1..f1b6fe84fe1 100644
--- a/mysql-test/t/innodb_support_xa_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_support_xa_func.test
diff --git a/mysql-test/t/innodb_table_locks_basic.test b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
index 35961c43a7f..35961c43a7f 100644
--- a/mysql-test/t/innodb_table_locks_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
diff --git a/mysql-test/t/innodb_table_locks_func.test b/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test
index d233a2a5240..6638a20c926 100644
--- a/mysql-test/t/innodb_table_locks_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test
@@ -14,8 +14,8 @@
# Description: Test Cases of Dynamic System Variable innodb_table_locks #
# that checks the behavior of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -24,9 +24,12 @@
--echo '#--------------------FN_DYNVARS_048_01-------------------------#'
####################################################################
-# Check if setting innodb_table_locks is changed in new connection #
+# Check if setting innodb_table_locks is changed in new connection #
####################################################################
+SET @start_value= @@global.innodb_table_locks;
+SELECT @start_value;
+
SET @@global.innodb_table_locks = OFF;
--echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
@@ -80,6 +83,9 @@ UNLOCK tables;
DROP TABLE t1;
disconnect con2;
+connection default;
+SET @@global.innodb_table_locks= @start_value;
+SELECT @@global.innodb_table_locks;
##########################################################
# End of functionality Testing for innodb_table_locks #
diff --git a/mysql-test/t/innodb_thread_concurrency_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_concurrency_basic.test
index d30ec214f4a..d30ec214f4a 100644
--- a/mysql-test/t/innodb_thread_concurrency_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_thread_concurrency_basic.test
diff --git a/mysql-test/t/insert_id_basic.test b/mysql-test/suite/sys_vars/t/insert_id_basic.test
index cfae87095bc..cfae87095bc 100644
--- a/mysql-test/t/insert_id_basic.test
+++ b/mysql-test/suite/sys_vars/t/insert_id_basic.test
diff --git a/mysql-test/t/insert_id_func.test b/mysql-test/suite/sys_vars/t/insert_id_func.test
index d7103f806bd..d7103f806bd 100644
--- a/mysql-test/t/insert_id_func.test
+++ b/mysql-test/suite/sys_vars/t/insert_id_func.test
diff --git a/mysql-test/t/interactive_timeout_basic.test b/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test
index 0c1a6716348..0c1a6716348 100644
--- a/mysql-test/t/interactive_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test
diff --git a/mysql-test/t/interactive_timeout_func.test b/mysql-test/suite/sys_vars/t/interactive_timeout_func.test
index e3a210bf508..e3a210bf508 100644
--- a/mysql-test/t/interactive_timeout_func.test
+++ b/mysql-test/suite/sys_vars/t/interactive_timeout_func.test
diff --git a/mysql-test/t/keep_files_on_create_basic.test b/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test
index a855f56c863..a855f56c863 100644
--- a/mysql-test/t/keep_files_on_create_basic.test
+++ b/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test
diff --git a/mysql-test/t/key_buffer_size_func.test b/mysql-test/suite/sys_vars/t/key_buffer_size_func.test
index 05c591678dc..8ee305a3ac1 100644
--- a/mysql-test/t/key_buffer_size_func.test
+++ b/mysql-test/suite/sys_vars/t/key_buffer_size_func.test
@@ -14,13 +14,13 @@
# Description: Test Cases of Dynamic System Variable key_buffer_size #
# that checks the functionality of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
--disable_warnings
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
--enable_warnings
#########################
@@ -30,12 +30,14 @@ drop table if exists t1;
--echo ## Creating new table t1 ##
CREATE TABLE t1
(
-id INT NOT NULL auto_increment,
+id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
-rollno int NOT NULL,
+rollno INT NOT NULL,
name VARCHAR(30)
);
+SET @start_value= @@global.key_buffer_size;
+
FLUSH STATUS;
--echo '#--------------------FN_DYNVARS_055_01-------------------------#'
@@ -64,37 +66,60 @@ SELECT @@global.key_buffer_size;
--echo ## Inserting some rows in table ##
-INSERT into t1(rollno, name) values(1, 'Record_1');
-INSERT into t1(rollno, name) values(2, 'Record_2');
-INSERT into t1(rollno, name) values(1, 'Record_3');
-INSERT into t1(rollno, name) values(3, 'Record_4');
-INSERT into t1(rollno, name) values(1, 'Record_5');
-INSERT into t1(rollno, name) values(3, 'Record_6');
-INSERT into t1(rollno, name) values(4, 'Record_7');
-INSERT into t1(rollno, name) values(4, 'Record_8');
-INSERT into t1(rollno, name) values(4, 'Record_9');
-INSERT into t1(rollno, name) values(4, 'Record_10');
-
---echo ## Verifying status of reading & writing variables ##
-# Disabled due to differences in results
-#show status like 'Key%';
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_1');
+INSERT INTO t1(rollno, name) VALUES(2, 'Record_2');
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_3');
+INSERT INTO t1(rollno, name) VALUES(3, 'Record_4');
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_5');
+INSERT INTO t1(rollno, name) VALUES(3, 'Record_6');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_7');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_8');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_9');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_10');
+
+--echo ## Key_reads must be zero (no disk access) ##
+show status like 'Key_reads';
--echo ## Switching to connection test_con2 ##
connection test_con2;
---echo ## Verifying status of reading & writing variables ##
-# Disabled due to differences in results
-#show status like 'Key%';
+--echo ## Key_reads must be zero (no disk access) ##
+show status like 'Key_reads';
+
+CONNECTION default;
+--disable_warnings
+SET @@global.key_buffer_size = 36;
+--enable_warnings
+
+--echo ## Connecting with connection test_con1 ##
+CONNECTION test_con1;
+
+--echo ## Inserting some rows in table ##
+INSERT INTO t1(rollno, name) VALUES(5, 'Record_11');
+INSERT INTO t1(rollno, name) VALUES(6, 'Record_12');
+INSERT INTO t1(rollno, name) VALUES(5, 'Record_13');
+INSERT INTO t1(rollno, name) VALUES(7, 'Record_14');
+INSERT INTO t1(rollno, name) VALUES(5, 'Record_15');
+INSERT INTO t1(rollno, name) VALUES(7, 'Record_16');
+INSERT INTO t1(rollno, name) VALUES(8, 'Record_17');
+INSERT INTO t1(rollno, name) VALUES(8, 'Record_18');
+INSERT INTO t1(rollno, name) VALUES(8, 'Record_19');
+INSERT INTO t1(rollno, name) VALUES(8, 'Record_20');
+
+--echo ## Key_reads must be zero (no disk access) ##
+show status like 'Key_reads';
############################################################
# Disconnecting all connection & dropping table #
############################################################
--echo ## Dropping table ##
-DROP table if exists t1;
+DROP TABLE IF EXISTS t1;
--echo ## Disconnecting both the connections ##
DISCONNECT test_con2;
DISCONNECT test_con1;
+connection default;
+SET @@global.key_buffer_size= @start_value;
diff --git a/mysql-test/t/last_insert_id_func-master.opt b/mysql-test/suite/sys_vars/t/last_insert_id_func-master.opt
index 66f581b56d0..66f581b56d0 100644
--- a/mysql-test/t/last_insert_id_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/last_insert_id_func-master.opt
diff --git a/mysql-test/t/last_insert_id_func.test b/mysql-test/suite/sys_vars/t/last_insert_id_func.test
index 2309c539bd9..2309c539bd9 100644
--- a/mysql-test/t/last_insert_id_func.test
+++ b/mysql-test/suite/sys_vars/t/last_insert_id_func.test
diff --git a/mysql-test/t/lc_time_names_basic.test b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
index d0aa0c56937..d0aa0c56937 100644
--- a/mysql-test/t/lc_time_names_basic.test
+++ b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
diff --git a/mysql-test/t/lc_time_names_func.test b/mysql-test/suite/sys_vars/t/lc_time_names_func.test
index 2c86a597773..2c86a597773 100644
--- a/mysql-test/t/lc_time_names_func.test
+++ b/mysql-test/suite/sys_vars/t/lc_time_names_func.test
diff --git a/mysql-test/t/license_basic.test b/mysql-test/suite/sys_vars/t/license_basic.test
index e0c761dc5a5..e0c761dc5a5 100644
--- a/mysql-test/t/license_basic.test
+++ b/mysql-test/suite/sys_vars/t/license_basic.test
diff --git a/mysql-test/t/local_infile_basic.test b/mysql-test/suite/sys_vars/t/local_infile_basic.test
index 63f6b0fdb91..63f6b0fdb91 100644
--- a/mysql-test/t/local_infile_basic.test
+++ b/mysql-test/suite/sys_vars/t/local_infile_basic.test
diff --git a/mysql-test/t/local_infile_func.test b/mysql-test/suite/sys_vars/t/local_infile_func.test
index 166149ad9aa..00013f779a7 100644
--- a/mysql-test/t/local_infile_func.test
+++ b/mysql-test/suite/sys_vars/t/local_infile_func.test
@@ -64,7 +64,7 @@ create table t1(a int);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval LOAD DATA LOCAL INFILE
-'$MYSQLTEST_VARDIR/std_data_ln/numbers.txt' INTO TABLE test.t1;
+'$MYSQLTEST_VARDIR/std_data/numbers.txt' INTO TABLE test.t1;
SELECT count(*) from t1;
@@ -81,7 +81,7 @@ create table t1(a int);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--Error ER_NOT_ALLOWED_COMMAND
eval LOAD DATA LOCAL INFILE
-'$MYSQLTEST_VARDIR/std_data_ln/numbers.txt' INTO TABLE test.t1;
+'$MYSQLTEST_VARDIR/std_data/numbers.txt' INTO TABLE test.t1;
SELECT count(*) from t1;
diff --git a/mysql-test/t/log_basic.test b/mysql-test/suite/sys_vars/t/log_basic.test
index b9a64f8981b..98e99fa4e4f 100644
--- a/mysql-test/t/log_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_basic.test
@@ -1,6 +1,6 @@
###################### mysql-test\t\log_basic.test ############################
# #
-# Variable Name: log_basic #
+# Variable Name: log_basic #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: string #
@@ -11,15 +11,16 @@
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
-# Description: Test Cases of Dynamic System Variable log #
-# that checks the behavior of this variable in the following ways#
+# Description: #
+# Test Cases of Dynamic System Variable log that checks the behavior of #
+# this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -34,6 +35,8 @@
# Accessing variable #
#############################################################
+SET @start_log= @@global.log;
+
SELECT @@global.log AS INIT_VALUE;
SELECT @@log AS INIT_VALUE;
@@ -47,14 +50,17 @@ SET global general_log = 0;
--echo '#--------------------FN_DYNVARS_062_02-------------------------#'
-###################################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-###################################################################################
+################################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+################################################################################
# We can only access log value from information schema global_variables table
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='log';
+SET @@global.log= @start_log;
+
############################################
# END OF log TESTS #
############################################
+
diff --git a/mysql-test/t/log_bin_trust_function_creators_basic.test b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test
index 3b8b43e1354..3b8b43e1354 100644
--- a/mysql-test/t/log_bin_trust_function_creators_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test
diff --git a/mysql-test/t/log_bin_trust_function_creators_func.test b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_func.test
index db91128b225..0168114b11b 100644
--- a/mysql-test/t/log_bin_trust_function_creators_func.test
+++ b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_func.test
@@ -20,6 +20,8 @@
# #
###############################################################################
+source include/have_log_bin.inc;
+
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -30,36 +32,59 @@ drop table if exists t1;
# Setting initial value of variable to 0 and verifying whether user
# is allowed to create function or not.
########################################################################
+SET @start_value= @@global.log_bin_trust_function_creators;
--echo ## Creating new user tt ##
-CREATE user tt@localhost;
+CREATE USER tt@localhost;
--echo ## Setting value of variable to 0 ##
SET @@global.log_bin_trust_function_creators = 0;
--echo ## Creating new table t2 ##
-create table t2 (a INT);
+CREATE TABLE t2 (a INT);
--echo ## Creating & connecting with new connection test_con1 ##
connect (test_con1,localhost,tt,,);
connection test_con1;
SELECT @@log_bin_trust_function_creators;
-SELECT @@sql_log_bin;
---echo ## Creating new function f1 ##
+--echo ## Creating new function f1 fails because no DETERMINISTIC ###
delimiter |;
+--error ER_BINLOG_UNSAFE_ROUTINE
CREATE FUNCTION f1(a INT) RETURNS INT
BEGIN
- IF (a < 3) THEN
+ IF (a < 3) THEN
+ INSERT INTO t2 VALUES (a);
+ END IF;
+ RETURN 1;
+END|
+delimiter ;|
+
+--echo ## Creating new function f1 fails because non-super user ##
+delimiter |;
+--error ER_BINLOG_CREATE_ROUTINE_NEED_SUPER
+CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
+BEGIN
+ IF (a < 3) THEN
INSERT INTO t2 VALUES (a);
END IF;
RETURN 1;
END|
delimiter ;|
---echo 'Bug: Create Function should give error here because non-super user';
---echo 'is creating function here';
+connection default;
+
+--echo ## Creating new function f1 succeeds ##
+delimiter |;
+CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
+BEGIN
+ IF (a < 3) THEN
+ INSERT INTO t2 VALUES (a);
+ END IF;
+ RETURN 1;
+END|
+delimiter ;|
--echo ## Creating new table t1 ##
CREATE TABLE t1 (a INT);
@@ -69,8 +94,8 @@ INSERT INTO t1 VALUES (1),(2),(3);
SELECT f1(a) FROM t1;
--echo ## Dropping function f1 & table t1 ##
-drop function f1;
-drop table t1;
+DROP FUNCTION f1;
+DROP TABLE t1;
--echo '#--------------------FN_DYNVARS_063_02-------------------------#'
########################################################################
@@ -96,7 +121,7 @@ SELECT @@sql_log_bin;
delimiter |;
CREATE FUNCTION f1(a INT) RETURNS INT
BEGIN
- IF (a < 3) THEN
+ IF (a < 3) THEN
INSERT INTO t2 VALUES (a);
END IF;
RETURN 1;
@@ -111,11 +136,16 @@ INSERT INTO t1 VALUES (1),(2),(3);
SELECT f1(a) FROM t1;
--echo ## Dropping function f1 ##
-drop function f1;
+DROP FUNCTION f1;
--echo ## Dropping table t1 & t2 ##
-drop table t1,t2;
+DROP TABLE t1,t2;
---echo ## Disconnecting both the connections ##
+--echo ## Disconnecting test_con2##
disconnect test_con2;
+connection default;
+
+DROP USER tt@localhost;
+SET @@global.log_bin_trust_function_creators= @start_value;
+
diff --git a/mysql-test/t/log_bin_trust_routine_creators_basic.test b/mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test
index 1d44c77b1a7..1d44c77b1a7 100644
--- a/mysql-test/t/log_bin_trust_routine_creators_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test
diff --git a/mysql-test/t/log_output_basic.test b/mysql-test/suite/sys_vars/t/log_output_basic.test
index 45998e85480..45998e85480 100644
--- a/mysql-test/t/log_output_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_output_basic.test
diff --git a/mysql-test/t/log_output_func.test b/mysql-test/suite/sys_vars/t/log_output_func.test
index 007c4f38659..007c4f38659 100644
--- a/mysql-test/t/log_output_func.test
+++ b/mysql-test/suite/sys_vars/t/log_output_func.test
diff --git a/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
new file mode 100644
index 00000000000..f1152c07176
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
@@ -0,0 +1,132 @@
+################## mysql-test\t\log_queries_not_using_indexes_basic.test ######
+# #
+# Variable Name: log_queries_not_using_indexes #
+# Scope: Global #
+# Access Type: Static #
+# Data Type: #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author : Sharique Abdullah #
+# #
+# Description:Test Cases of Dynamic System Variable #
+# log_queries_not_using_indexes #
+# that checks the behavior of this variable in the following ways #
+# * Value Check #
+# * Scope Check #
+# #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
+# #
+###############################################################################
+
+SET @start_value= @@global.log_queries_not_using_indexes;
+
+####################################################################
+# Valid values for boolean #
+####################################################################
+SET @@global.log_queries_not_using_indexes= DEFAULT;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET @@global.log_queries_not_using_indexes= TRUE;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET @@global.log_queries_not_using_indexes= true;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET @@global.log_queries_not_using_indexes= 0;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET @@global.log_queries_not_using_indexes= 1;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET @goodvar= TRUE;
+SET @@global.log_queries_not_using_indexes= @goodvar;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= DEFAULT;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= ON;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= OFF;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= -0;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= 0.00;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= -0.0;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= 001.00;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= +1.0;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= +0;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= +0.000000;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= 0000.00000;
+SELECT @@global.log_queries_not_using_indexes;
+
+SET GLOBAL log_queries_not_using_indexes= .0;
+SELECT @@global.log_queries_not_using_indexes;
+
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_queries_not_using_indexes= 'DEFAULT';
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_queries_not_using_indexes= 'true';
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_queries_not_using_indexes= BLABLA;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_queries_not_using_indexes= 25;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_queries_not_using_indexes= 12.34;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL log_queries_not_using_indexes= -1;
+
+SET @badvar= 'true';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_queries_not_using_indexes= @badvar;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL log_queries_not_using_indexes= 'DEFAULT';
+
+--error ER_GLOBAL_VARIABLE
+SET log_queries_not_using_indexes= TRUE;
+
+--error ER_GLOBAL_VARIABLE
+SET SESSION log_queries_not_using_indexes= TRUE;
+
+--error ER_GLOBAL_VARIABLE
+SET @@session.log_queries_not_using_indexes= TRUE;
+
+--error ER_GLOBAL_VARIABLE
+SET LOCAL log_queries_not_using_indexes= TRUE;
+
+--error ER_PARSE_ERROR
+SET @@global log_queries_not_using_indexes= TRUE;
+
+--error ER_PARSE_ERROR
+SET @@SESSION log_queries_not_using_indexes= TRUE;
+
+
+SET @@global.log_queries_not_using_indexes= @start_value;
+
diff --git a/mysql-test/t/long_query_time_basic.test b/mysql-test/suite/sys_vars/t/long_query_time_basic.test
index c21e0a751c1..c21e0a751c1 100644
--- a/mysql-test/t/long_query_time_basic.test
+++ b/mysql-test/suite/sys_vars/t/long_query_time_basic.test
diff --git a/mysql-test/t/low_priority_updates_basic.test b/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test
index 0ce4ee8f921..0ce4ee8f921 100644
--- a/mysql-test/t/low_priority_updates_basic.test
+++ b/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test
diff --git a/mysql-test/t/max_allowed_packet_basic.test b/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test
index 8be0e5f670e..8be0e5f670e 100644
--- a/mysql-test/t/max_allowed_packet_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test
diff --git a/mysql-test/t/max_allowed_packet_func.test b/mysql-test/suite/sys_vars/t/max_allowed_packet_func.test
index 8437d480a37..0cfbeb4de5f 100644
--- a/mysql-test/t/max_allowed_packet_func.test
+++ b/mysql-test/suite/sys_vars/t/max_allowed_packet_func.test
@@ -14,16 +14,16 @@
# Description: Test Cases of Dynamic System Variable max_allowed_packet #
# that checks the functionality of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
#due to lost connection on win64
--source include/not_windows.inc
-let $start_global_value = `SELECT @@global.max_allowed_packet`;
---echo $start_global_value
+SET @start_max_allowed_packet= @@global.max_allowed_packet;
+SET @start_value= @@global.net_buffer_length;
--disable_warnings
drop table if exists t1;
@@ -60,10 +60,10 @@ SELECT @@session.net_buffer_length;
--echo '#--------------------FN_DYNVARS_070_02-------------------------#'
###############################################################################
# Setting value of max_allowed_packet to 1024 at global level and
-# verifying its behavior after inserting data greater than 1024 bytes
+# verifying its behavior after inserting data greater than 1024 bytes
###############################################################################
---echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ##
+--echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ##
SET @@global.max_allowed_packet = 1024;
SET @@global.net_buffer_length = 1024;
SELECT @@global.max_allowed_packet;
@@ -73,16 +73,13 @@ SELECT @@global.net_buffer_length;
connect (test_con1,localhost,root,,);
connection test_con1;
---echo ## Inserting and fetching data of length greater than 1024 ##
+--echo ## Inserting and fetching data of length greater than 1024 ##
--Error 0,ER_NET_PACKET_TOO_LARGE
INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
disconnect test_con1;
connection default;
drop table t1;
-eval SET @@global.max_allowed_packet = $start_global_value;
-
---echo ## Server disconnects after this case and error occurs that Server ##
---echo ## has gone away ##
-
+SET @@global.max_allowed_packet= @start_max_allowed_packet;
+SET @@global.net_buffer_length= @start_value;
diff --git a/mysql-test/t/max_binlog_cache_size_func-master.opt b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt
index 6e00d7157d6..6e00d7157d6 100644
--- a/mysql-test/t/max_binlog_cache_size_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt
diff --git a/mysql-test/t/max_binlog_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test
index 11d01b5c10f..11d01b5c10f 100644
--- a/mysql-test/t/max_binlog_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test
diff --git a/mysql-test/t/max_connections_basic.test b/mysql-test/suite/sys_vars/t/max_connections_basic.test
index ffc964db28f..ffc964db28f 100644
--- a/mysql-test/t/max_connections_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_connections_basic.test
diff --git a/mysql-test/t/max_delayed_threads_basic.test b/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test
index dc908c8396b..dc908c8396b 100644
--- a/mysql-test/t/max_delayed_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test
diff --git a/mysql-test/t/max_error_count_basic.test b/mysql-test/suite/sys_vars/t/max_error_count_basic.test
index 2b1e12843cf..2b1e12843cf 100644
--- a/mysql-test/t/max_error_count_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_error_count_basic.test
diff --git a/mysql-test/t/max_insert_delayed_threads_basic.test b/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test
index d165ddc11fe..d165ddc11fe 100644
--- a/mysql-test/t/max_insert_delayed_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test
diff --git a/mysql-test/t/max_join_size_func.test b/mysql-test/suite/sys_vars/t/max_join_size_func.test
index 0ea0d77bcd6..0ea0d77bcd6 100644
--- a/mysql-test/t/max_join_size_func.test
+++ b/mysql-test/suite/sys_vars/t/max_join_size_func.test
diff --git a/mysql-test/t/max_length_for_sort_data_basic.test b/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test
index 682e14146d7..682e14146d7 100644
--- a/mysql-test/t/max_length_for_sort_data_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test
diff --git a/mysql-test/t/max_prepared_stmt_count_basic.test b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
index 2206a388abb..2206a388abb 100644
--- a/mysql-test/t/max_prepared_stmt_count_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
diff --git a/mysql-test/t/max_prepared_stmt_count_func.test b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test
index 6617c4ad2ea..6617c4ad2ea 100644
--- a/mysql-test/t/max_prepared_stmt_count_func.test
+++ b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test
diff --git a/mysql-test/t/max_relay_log_size_basic.test b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test
index b780aa2b444..b780aa2b444 100644
--- a/mysql-test/t/max_relay_log_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test
diff --git a/mysql-test/t/max_seeks_for_key_func.test b/mysql-test/suite/sys_vars/t/max_seeks_for_key_func.test
index cdabd43328f..d49382b9f4f 100644
--- a/mysql-test/t/max_seeks_for_key_func.test
+++ b/mysql-test/suite/sys_vars/t/max_seeks_for_key_func.test
@@ -1,11 +1,7 @@
-
-
-
-#Test for max_seeks_for_key#
-
+# Test for max_seeks_for_key #
--disable_warnings
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -14,11 +10,11 @@ drop table if exists t1;
#########################
CREATE TABLE t1
-(a int auto_increment primary key,
-b char(20)
+(a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(20)
);
-
+SET @start_value= @@global.max_seeks_for_key;
--echo '#--------------------FN_DYNVARS_084_01-------------------------#'
##########################################################
@@ -35,15 +31,15 @@ SELECT @@session.max_seeks_for_key = 10;
# Setting global value of variable and inserting data in table
SET @@global.max_seeks_for_key = 20;
SELECT @@global.max_seeks_for_key;
-INSERT into t1(b) values("AREc");
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+INSERT INTO t1(b) VALUES("AREc");
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
# Setting session value of variable and inserting data in table
SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key;
-INSERT into t1(b) values("BREc");
-INSERT into t1(b) values("CRec");
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+INSERT INTO t1(b) VALUES("BREc");
+INSERT INTO t1(b) VALUES("CRec");
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
--echo '#--------------------FN_DYNVARS_084_02-------------------------#'
@@ -63,31 +59,26 @@ SELECT @@session.max_seeks_for_key = 10;
# Setting global value of variable and inserting data in table
SET @@global.max_seeks_for_key = 20;
SELECT @@global.max_seeks_for_key;
-INSERT into t1(b) values("AREc");
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+INSERT INTO t1(b) VALUES("AREc");
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
# Setting session value of variable and inserting data in table
SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key;
-INSERT into t1(b) values("BREc");
-INSERT into t1(b) values("CRec");
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
-
+INSERT INTO t1(b) VALUES("BREc");
+INSERT INTO t1(b) VALUES("CRec");
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
-
-
-
-
-#####################################################
+######################################################
# Inserting values in table t and analyzing table #
-#####################################################
+######################################################
-INSERT INTO t1 values(null,"test");
+INSERT INTO t1 VALUES(null,"test");
INSERT INTO t1 VALUES (null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a");
-explain SELECT STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
-analyze table t1;
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
+ANALYZE TABLE t1;
###################################################################
# Setting new value for max_seeks_for_key and anaylyzing table #
@@ -96,9 +87,14 @@ analyze table t1;
SET MAX_SEEKS_FOR_KEY=1;
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
+EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
SET MAX_SEEKS_FOR_KEY=DEFAULT;
-drop table t1;
+connection default;
+disconnect test_con1;
+disconnect test_con2;
+
+DROP TABLE t1;
+SET @@global.max_seeks_for_key= @start_value;
diff --git a/mysql-test/t/max_sort_length_basic.test b/mysql-test/suite/sys_vars/t/max_sort_length_basic.test
index 1198d7b1851..1198d7b1851 100644
--- a/mysql-test/t/max_sort_length_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_sort_length_basic.test
diff --git a/mysql-test/t/max_sort_length_func.test b/mysql-test/suite/sys_vars/t/max_sort_length_func.test
index e3197653f0d..74642a10861 100644
--- a/mysql-test/t/max_sort_length_func.test
+++ b/mysql-test/suite/sys_vars/t/max_sort_length_func.test
@@ -9,14 +9,14 @@
# #
# #
# Creation Date: 2008-03-02 #
-# Author: Sharique Abdullah #
+# Author: Sharique Abdullah #
# #
-# Description: Test Cases of Dynamic System Variable max_prepared_stmt_count_fn#
+# Description: Test Cases of Dynamic System Variable max_sort_length #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# #
-#Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#
-# option_mysqld_max_sort_length #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
################################################################################
@@ -24,6 +24,8 @@
# Setup
#
+SET @start_value= @@global.max_sort_length;
+
SET @session_max_sort_length = @@Session.max_sort_length;
@@ -186,7 +188,7 @@ SELECT c from t ORDER BY c, id;
#Check if sorting is applied on BLOB type #
###########################################
--echo Testing type BLOB
-## Setting global value of variable and inserting data in table
+# Setting global value of variable and inserting data in table
SET @@global.max_sort_length = 30;
SELECT @@global.max_sort_length;
INSERT INTO t1 set c = repeat('x',29);
@@ -211,7 +213,7 @@ SELECT c from t1 ORDER BY c, id;
#Check if sorting is applied on CHAR type #
###########################################
--echo Testing type CHAR
-## Setting global value of variable and inserting data in table
+# Setting global value of variable and inserting data in table
SET @@global.max_sort_length = 30;
SELECT @@global.max_sort_length;
INSERT INTO t2 set c = repeat('x',29);
@@ -251,3 +253,5 @@ DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings
+SET @@global.max_sort_length= @start_value;
+
diff --git a/mysql-test/t/max_sp_recursion_depth_basic.test b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test
index 8089951c8a2..8089951c8a2 100644
--- a/mysql-test/t/max_sp_recursion_depth_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test
diff --git a/mysql-test/t/max_sp_recursion_depth_func.test b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func.test
index ab43536457b..ab43536457b 100644
--- a/mysql-test/t/max_sp_recursion_depth_func.test
+++ b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func.test
diff --git a/mysql-test/t/max_user_connections_basic.test b/mysql-test/suite/sys_vars/t/max_user_connections_basic.test
index eb231bd8076..eb231bd8076 100644
--- a/mysql-test/t/max_user_connections_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_user_connections_basic.test
diff --git a/mysql-test/t/max_user_connections_func.test b/mysql-test/suite/sys_vars/t/max_user_connections_func.test
index 841a630c5ce..841a630c5ce 100644
--- a/mysql-test/t/max_user_connections_func.test
+++ b/mysql-test/suite/sys_vars/t/max_user_connections_func.test
diff --git a/mysql-test/t/myisam_data_pointer_size_basic.test b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test
index d151c6000b8..d151c6000b8 100644
--- a/mysql-test/t/myisam_data_pointer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test
diff --git a/mysql-test/t/myisam_data_pointer_size_func.test b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test
index 36ad31acf6c..37dd3a5a297 100644
--- a/mysql-test/t/myisam_data_pointer_size_func.test
+++ b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test
@@ -14,16 +14,17 @@
# Description: Test Cases of Dynamic System Variable myisam_data_pointer_size #
# that checks the behavior of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
################################################################################
--echo '#--------------------FN_DYNVARS_093_01-------------------------#'
###############################################################################
-# Check if setting myisam_data_pointer_size is changed in every new connection#
+# Check if setting myisam_data_pointer_size is changed in every new connection#
###############################################################################
+SET @start_value= @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 2;
# con1 will be default connection from now on
--echo 'connect (con1,localhost,root,,,,)'
@@ -48,7 +49,6 @@ disconnect con2;
--echo 'connection con1'
connection con1;
-
#===========================================================
# Checking myisam_data_pointer_size is 2
#===========================================================
@@ -59,10 +59,7 @@ DROP PROCEDURE IF EXISTS sp_addRec;
DROP TABLE IF EXISTS t1;
--enable_warnings
-
-
DELIMITER //;
-
CREATE PROCEDURE sp_addRec(IN count INT)
BEGIN
WHILE (count>0) DO
@@ -70,7 +67,6 @@ BEGIN
SET count = count -1;
END WHILE;
END //
-
DELIMITER ;//
# setting 2 will allow data pointer to access files with size < 65536
@@ -105,6 +101,8 @@ SELECT count(*) from t1;
DROP PROCEDURE sp_addRec;
DROP TABLE t1;
+connection default;
+SET @@global.myisam_data_pointer_size= @start_value;
################################################################
# End of functionality Testing for myisam_data_pointer_size #
################################################################
diff --git a/mysql-test/t/myisam_stats_method_basic.test b/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test
index 0045842269b..0045842269b 100644
--- a/mysql-test/t/myisam_stats_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test
diff --git a/mysql-test/t/myisam_stats_method_func.test b/mysql-test/suite/sys_vars/t/myisam_stats_method_func.test
index 8b47015ba87..a317f8d93da 100644
--- a/mysql-test/t/myisam_stats_method_func.test
+++ b/mysql-test/suite/sys_vars/t/myisam_stats_method_func.test
@@ -14,16 +14,18 @@
# Description: Test Cases of Dynamic System Variable myisam_stats_method #
# that checks the behavior of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
--echo '#--------------------FN_DYNVARS_097_01-------------------------#'
#####################################################################
-# Check if Setting myisam_stats_method is changed in new connection #
+# Check if Setting myisam_stats_method is changed in new connection #
#####################################################################
+SET @start_value = @@global.myisam_stats_method;
+
SET @@global.myisam_stats_method = nulls_equal;
--echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
@@ -45,19 +47,19 @@ connection default;
DROP TABLE IF EXISTS t1;
--enable_warnings
-CREATE TABLE t1 (a int, key (a));
+CREATE TABLE t1 (a INT, KEY (a));
INSERT INTO t1 VALUES (0),(1),(2),(3),(4);
INSERT INTO t1 SELECT NULL FROM t1;
#=======================================
--echo 'default: NULLs considered unequal'
#=======================================
-SET myisam_stats_method=nulls_unequal;
+SET myisam_stats_method = nulls_unequal;
ANALYZE TABLE t1;
SHOW INDEX FROM t1;
INSERT INTO t1 VALUES (11);
-DELETE FROM t1 WHERE a=11;
+DELETE FROM t1 WHERE a = 11;
CHECK TABLE t1;
SHOW INDEX FROM t1;
@@ -65,14 +67,14 @@ SHOW INDEX FROM t1;
#=====================================
--echo 'Set nulls to be equal'
#=====================================
-SET myisam_stats_method=nulls_equal;
+SET myisam_stats_method = nulls_equal;
INSERT INTO t1 VALUES (11);
-DELETE FROM t1 WHERE a=11;
-ANALYZE TABLE t1;
+DELETE FROM t1 WHERE a = 11;
+ANALYZE TABLE t1;
SHOW INDEX FROM t1;
INSERT INTO t1 VALUES (11);
-DELETE FROM t1 WHERE a=11;
+DELETE FROM t1 WHERE a = 11;
CHECK TABLE t1;
SHOW INDEX FROM t1;
@@ -80,13 +82,13 @@ SHOW INDEX FROM t1;
--echo 'Set nulls to be ignored'
#=====================================
-SET myisam_stats_method=nulls_ignored;
-SHOW variables LIKE 'myisam_stats_method';
-drop TABLE t1;
+SET myisam_stats_method = nulls_ignored;
+SHOW VARIABLES LIKE 'myisam_stats_method';
+DROP TABLE t1;
CREATE TABLE t1 (
- a char(3), b char(4), c char(5), d char(6),
- key(a,b,c,d)
+ a CHAR(3), b CHAR(4), c CHAR(5), d CHAR(6),
+ KEY(a,b,c,d)
);
INSERT INTO t1 VALUES ('bcd','def1', NULL, 'zz');
INSERT INTO t1 VALUES ('bcd','def2', NULL, 'zz');
@@ -98,9 +100,12 @@ DELETE FROM t1;
ANALYZE TABLE t1;
SHOW INDEX FROM t1;
-SET myisam_stats_method=DEFAULT;
+SET myisam_stats_method = DEFAULT;
DROP TABLE t1;
+SET @@global.myisam_stats_method= @start_value;
+
########################################################
# End of functionality Testing for myisam_stats_method #
########################################################
+
diff --git a/mysql-test/t/myisam_use_mmap_basic.test b/mysql-test/suite/sys_vars/t/myisam_use_mmap_basic.test
index d2cc39cfea7..d2cc39cfea7 100644
--- a/mysql-test/t/myisam_use_mmap_basic.test
+++ b/mysql-test/suite/sys_vars/t/myisam_use_mmap_basic.test
diff --git a/mysql-test/t/ndb_log_update_as_write_basic.test b/mysql-test/suite/sys_vars/t/ndb_log_update_as_write_basic.test
index 0b9d3ada158..0b9d3ada158 100644
--- a/mysql-test/t/ndb_log_update_as_write_basic.test
+++ b/mysql-test/suite/sys_vars/t/ndb_log_update_as_write_basic.test
diff --git a/mysql-test/t/ndb_log_updated_only_basic.test b/mysql-test/suite/sys_vars/t/ndb_log_updated_only_basic.test
index 85b76cc88a4..85b76cc88a4 100644
--- a/mysql-test/t/ndb_log_updated_only_basic.test
+++ b/mysql-test/suite/sys_vars/t/ndb_log_updated_only_basic.test
diff --git a/mysql-test/t/net_buffer_length_basic.test b/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test
index 6e1e0559c61..6e1e0559c61 100644
--- a/mysql-test/t/net_buffer_length_basic.test
+++ b/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test
diff --git a/mysql-test/t/net_read_timeout_basic.test b/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test
index f0d32302e4f..f0d32302e4f 100644
--- a/mysql-test/t/net_read_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test
diff --git a/mysql-test/t/net_write_timeout_basic.test b/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test
index 84c682561e3..84c682561e3 100644
--- a/mysql-test/t/net_write_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test
diff --git a/mysql-test/t/new_basic.test b/mysql-test/suite/sys_vars/t/new_basic.test
index b1d12c9a4de..b1d12c9a4de 100644
--- a/mysql-test/t/new_basic.test
+++ b/mysql-test/suite/sys_vars/t/new_basic.test
diff --git a/mysql-test/t/old_passwords_basic.test b/mysql-test/suite/sys_vars/t/old_passwords_basic.test
index b78ac9ca9b8..b78ac9ca9b8 100644
--- a/mysql-test/t/old_passwords_basic.test
+++ b/mysql-test/suite/sys_vars/t/old_passwords_basic.test
diff --git a/mysql-test/t/old_passwords_func.test b/mysql-test/suite/sys_vars/t/old_passwords_func.test
index 2707fc3ab6d..2707fc3ab6d 100644
--- a/mysql-test/t/old_passwords_func.test
+++ b/mysql-test/suite/sys_vars/t/old_passwords_func.test
diff --git a/mysql-test/t/optimizer_prune_level_basic.test b/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test
index 58c074d7d5e..58c074d7d5e 100644
--- a/mysql-test/t/optimizer_prune_level_basic.test
+++ b/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test
diff --git a/mysql-test/t/optimizer_search_depth_basic.test b/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test
index 42548c59d40..42548c59d40 100644
--- a/mysql-test/t/optimizer_search_depth_basic.test
+++ b/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test
diff --git a/mysql-test/t/preload_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test
index 48b1e32676a..48b1e32676a 100644
--- a/mysql-test/t/preload_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test
diff --git a/mysql-test/t/query_cache_limit_func.test b/mysql-test/suite/sys_vars/t/query_cache_limit_func.test
index 8dd5cf42d3d..e90a0e6adda 100644
--- a/mysql-test/t/query_cache_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_limit_func.test
@@ -9,14 +9,14 @@
# #
# #
# Creation Date: 2008-03-02 #
-# Author: Sharique Abdullah #
+# Author: Sharique Abdullah #
# #
# Description: Test Cases of Dynamic System Variable "Query_cache_limit" #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en #
-# /server-system-variables.html#option_mysqld_Query_cache_limit #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -28,6 +28,8 @@
#
SET @global_query_cache_limit = @@global.query_cache_limit;
+SET @global_query_cache_size = @@global.query_cache_size;
+SET @global_query_cache_type = @@global.query_cache_type;
--echo ** warnings **
--disable_warnings
@@ -105,7 +107,7 @@ RESET QUERY CACHE;
#set cache limit
--echo ** set cache limit **
-SET @@GLOBAL.query_cache_limit=0;
+SET @@GLOBAL.query_cache_limit = 0;
#fetching results#
--echo ** fetching results **
@@ -113,7 +115,6 @@ SELECT * FROM t;
# Check status after setting value#
--echo ** Check status after setting value **
-#let $newcachevalue1= query_get_value(SHOW STATUS LIKE 'Qcache_queries_in_cache', Value, 1);
SHOW STATUS LIKE 'Qcache_not_cached';
--echo 1 Expected
SHOW STATUS LIKE 'Qcache_queries_in_cache';
@@ -127,7 +128,7 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
#set cache limit to default
--echo ** set cache limit **
-SET @@GLOBAL.query_cache_limit=DEFAULT;
+SET @@GLOBAL.query_cache_limit = DEFAULT;
# Reset cache & flush status
--echo ** Reset cache values **
@@ -143,7 +144,7 @@ SHOW STATUS LIKE 'Qcache_not_cached';
SHOW STATUS LIKE 'Qcache_queries_in_cache';
--echo 1 Expected
-SET @@GLOBAL.query_cache_limit=0;
+SET @@GLOBAL.query_cache_limit = 0;
SHOW STATUS LIKE 'Qcache_not_cached';
--echo 0 Expected
@@ -167,7 +168,10 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
#
SET @@GLOBAL.query_cache_limit = @global_query_cache_limit;
+SET GLOBAL query_cache_size = @global_query_cache_size;
+SET GLOBAL query_cache_type = @global_query_cache_type;
--disable_warnings
DROP TABLE IF EXISTS t;
--enable_warnings
+
diff --git a/mysql-test/t/query_cache_type_basic.test b/mysql-test/suite/sys_vars/t/query_cache_type_basic.test
index ba7e26a3065..ba7e26a3065 100644
--- a/mysql-test/t/query_cache_type_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_type_basic.test
diff --git a/mysql-test/t/query_cache_type_func.test b/mysql-test/suite/sys_vars/t/query_cache_type_func.test
index 64f332eb7c0..4679d1ec339 100644
--- a/mysql-test/t/query_cache_type_func.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_type_func.test
@@ -14,8 +14,8 @@
# Description: Test Cases of Dynamic System Variable "query_cache_type" #
# that checks behavior of this variable in the following ways #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html#option_mysqld_query_cache_type #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -36,6 +36,7 @@ connection con0;
SET @start_global_value = @@GLOBAL.query_cache_type;
SET @start_session_value = @@SESSION.query_cache_type;
+SET @start_query_cache_size= @@global.query_cache_size;
#
# Creating test table
@@ -305,6 +306,7 @@ connection con0;
SET @@GLOBAL.query_cache_type = @start_global_value;
SET @@SESSION.query_cache_type = @start_session_value;
+SET GLOBAL query_cache_size = @start_query_cache_size;
DROP TABLE t1;
@@ -312,3 +314,4 @@ DROP PROCEDURE testProcHit;
--echo Disconnecting con0
disconnect con0;
+
diff --git a/mysql-test/t/query_cache_wlock_invalidate_basic.test b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test
index f253c1b4f43..f253c1b4f43 100644
--- a/mysql-test/t/query_cache_wlock_invalidate_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test
diff --git a/mysql-test/t/query_cache_wlock_invalidate_func.test b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
index 83b0c446b28..83b0c446b28 100644
--- a/mysql-test/t/query_cache_wlock_invalidate_func.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
diff --git a/mysql-test/t/query_prealloc_size_func.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_func.test
index 4f1e3e63e16..7267b9e317e 100644
--- a/mysql-test/t/query_prealloc_size_func.test
+++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_func.test
@@ -1,32 +1,32 @@
############# mysql-test\t\query_prealloc_size_func.test ######################
-# #
-# Variable Name: query_prealloc_size #
-# Scope: GLOBAL & SESSION #
-# Access Type: Dynamic #
-# Data Type: integer #
-# Default Value: 8192 #
-# Values: 8192-4294967295 #
-# #
-# #
-# Creation Date: 2008-02-22 #
-# Author: Sharique Abdullah #
-# #
-# Description: Test Cases of Dynamic System Variable "query_prealloc_size" #
-# that checks behavior of this variable in the following ways #
-# * Default Value #
-# * Valid & Invalid values #
-# * Scope & Access method #
-# * Cache behaviors #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html#option_mysqld_query_prealloc_size #
-# #
+# #
+# Variable Name: query_prealloc_size #
+# Scope: GLOBAL & SESSION #
+# Access Type: Dynamic #
+# Data Type: integer #
+# Default Value: 8192 #
+# Values: 8192-4294967295 #
+# #
+# #
+# Creation Date: 2008-02-22 #
+# Author: Sharique Abdullah #
+# #
+# Description: Test Cases of Dynamic System Variable "query_prealloc_size" #
+# that checks behavior of this variable in the following ways #
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Cache behaviors #
+# #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
+# #
###############################################################################
--echo ** Setup **
---echo
+--echo
#
# Setup
#
@@ -35,16 +35,18 @@
# Save initial value
#
-CREATE TABLE t1 (id int auto_increment primary key, val text(200));
+SET @start_value = @@global.query_prealloc_size;
-INSERT INTO t1 values(NULL,'a');
-INSERT INTO t1 values(NULL,'b');
-INSERT INTO t1 values(NULL,'c');
-INSERT INTO t1 values(NULL,'d');
+CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY, val TEXT(200));
+
+INSERT INTO t1 VALUES(NULL,'a');
+INSERT INTO t1 VALUES(NULL,'b');
+INSERT INTO t1 VALUES(NULL,'c');
+INSERT INTO t1 VALUES(NULL,'d');
SELECT * FROM t1 ORDER BY val;
-SET SESSION query_prealloc_size = 8192;
+SET SESSION query_prealloc_size = 8192;
--echo '#----------------------------FN_DYNVARS_137_05-----------------#'
@@ -84,3 +86,7 @@ connection default;
disconnect con_int1;
disconnect con_int2;
+DROP TABLE t1;
+
+SET @@global.query_prealloc_size = @start_value;
+
diff --git a/mysql-test/t/read_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test
index 405bb9da6d8..405bb9da6d8 100644
--- a/mysql-test/t/read_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test
diff --git a/mysql-test/t/read_only_basic.test b/mysql-test/suite/sys_vars/t/read_only_basic.test
index 917842256b1..917842256b1 100644
--- a/mysql-test/t/read_only_basic.test
+++ b/mysql-test/suite/sys_vars/t/read_only_basic.test
diff --git a/mysql-test/t/read_only_func.test b/mysql-test/suite/sys_vars/t/read_only_func.test
index c8fb932544b..c8fb932544b 100644
--- a/mysql-test/t/read_only_func.test
+++ b/mysql-test/suite/sys_vars/t/read_only_func.test
diff --git a/mysql-test/t/read_rnd_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test
index e3d2a4b89f7..e3d2a4b89f7 100644
--- a/mysql-test/t/read_rnd_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test
diff --git a/mysql-test/t/relay_log_purge_basic.test b/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test
index 7e4d6a51440..7e4d6a51440 100644
--- a/mysql-test/t/relay_log_purge_basic.test
+++ b/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test
diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
new file mode 100644
index 00000000000..f17cc1289b1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
@@ -0,0 +1,102 @@
+###################### mysql-test\t\init_slave_func.test #####################
+# #
+# Variable Name: init_slave #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: string #
+# Default Value: #
+# Range: #
+# #
+# #
+# Creation Date: 2008-03-08 #
+# Author: Rizwan #
+# Modified: HHunger 2008-09-29 Fixed the bug by inserting the usual wait and #
+# SQL-Satements to control master and slave, #
+# deleted the sleep and made improvements like: #
+# - Replaced the opt file by dynamic variables, #
+# - Made the tests independant of the initial #
+# values of the global variables, #
+# - Reduced the test to the needed test case to #
+# save run time, #
+# - Beautification. #
+# #
+# Description: Test Cases of Dynamic System Variable init_slave #
+# that checks the behavior of this variable #
+# #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
+# #
+###############################################################################
+
+source include/master-slave.inc;
+--echo connection slave
+connection slave;
+#
+# save the current values
+
+SET @start_max_connections= @@global.max_connections;
+SET @start_init_slave= @@global.init_slave;
+
+# setting of a global value with an effect on the next start of the slave server
+# check that @@global.init_slave could be set
+let $my_init_slave=
+ 'SET @@global.max_connections = @@global.max_connections + 1';
+eval SET @@global.init_slave = $my_init_slave;
+
+# show the data type of the variable
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+CREATE TEMPORARY TABLE t1 AS SELECT @@global.init_slave AS my_column;
+--enable_warnings
+DESCRIBE t1;
+DROP TABLE t1;
+#
+# check that the new setting of @@global.init_slave becomes immediately visible
+eval SELECT @@global.init_slave = $my_init_slave;
+--echo Expect 1
+# wait for the slave threads have set the global variable.
+let $wait_timeout= 90;
+let $wait_condition= SELECT @@global.max_connections = @start_max_connections;
+--source include/wait_condition_sp.inc
+# check that the action in init_slave does not happen immediately
+SELECT @@global.max_connections= @start_max_connections;
+--echo Expect 1
+#
+# reset of the server
+STOP SLAVE;
+--wait_for_slave_to_stop
+RESET MASTER;
+RESET SLAVE;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+#
+# wait for the slave threads have set the global variable.
+let $wait_timeout= 90;
+let $wait_condition= SELECT @@global.max_connections = @start_max_connections + 1;
+--source include/wait_condition_sp.inc
+# check that the action in init_slave was executed and had the intended effect
+SELECT @@global.max_connections = @start_max_connections + 1;
+--echo Expect 1
+#
+# Setting a variable(which is local to a session) and must not be visible
+SET @@global.init_slave = "SET @a=5";
+#
+STOP SLAVE;
+--wait_for_slave_to_stop
+RESET MASTER;
+RESET SLAVE;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+#
+SHOW VARIABLES LIKE 'init_slave';
+# expect NULL
+SELECT @a;
+--echo Expect NULL
+#
+# Clean up
+SET @@global.max_connections= @start_max_connections;
+SET @@global.init_slave= @start_init_slave;
+##################################################
+# End of functionality Testing for init_slave #
+##################################################
+
diff --git a/mysql-test/t/rpl_max_binlog_size_func-master.opt b/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func-master.opt
index bff213dfb0b..bff213dfb0b 100644
--- a/mysql-test/t/rpl_max_binlog_size_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func-master.opt
diff --git a/mysql-test/t/rpl_max_binlog_size_func.test b/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func.test
index df22b253009..c00db582deb 100644
--- a/mysql-test/t/rpl_max_binlog_size_func.test
+++ b/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func.test
@@ -12,6 +12,7 @@ DROP TABLE IF EXISTS t1;
--echo '--- check if log file is rotated after 4096 bytes ----'
#==============================================================
+SET @saved_max_binlog_size= @@global.max_binlog_size;
SET @@global.max_binlog_size = 4096;
CREATE TABLE t1(a CHAR(5));
@@ -27,11 +28,16 @@ dec $a;
--sleep 2
# if log file is not created then this will fail
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---file_exists $MYSQLTEST_VARDIR/master-data/mylog.000002
+let $MYSQLD_DATADIR=`select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--file_exists $MYSQLD_DATADIR/mylog.000002
--echo 'mylog.000002 exists'
+SET @@global.max_binlog_size= @saved_max_binlog_size;
+
+DROP TABLE t1;
+
###############################################################################
# End of functionality testing for max_binlog_size #
###############################################################################
diff --git a/mysql-test/t/secure_auth_basic.test b/mysql-test/suite/sys_vars/t/secure_auth_basic.test
index b52f219097b..b52f219097b 100644
--- a/mysql-test/t/secure_auth_basic.test
+++ b/mysql-test/suite/sys_vars/t/secure_auth_basic.test
diff --git a/mysql-test/t/secure_auth_func-master.opt b/mysql-test/suite/sys_vars/t/secure_auth_func-master.opt
index 38ba956df15..38ba956df15 100644
--- a/mysql-test/t/secure_auth_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/secure_auth_func-master.opt
diff --git a/mysql-test/t/secure_auth_func.test b/mysql-test/suite/sys_vars/t/secure_auth_func.test
index 10dc383035d..10dc383035d 100644
--- a/mysql-test/t/secure_auth_func.test
+++ b/mysql-test/suite/sys_vars/t/secure_auth_func.test
diff --git a/mysql-test/t/slave_allow_batching_basic.test b/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test
index cf31917933a..cf31917933a 100644
--- a/mysql-test/t/slave_allow_batching_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test
diff --git a/mysql-test/t/slave_compressed_protocol_basic.test b/mysql-test/suite/sys_vars/t/slave_compressed_protocol_basic.test
index 29a3227a8f5..29a3227a8f5 100644
--- a/mysql-test/t/slave_compressed_protocol_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_compressed_protocol_basic.test
diff --git a/mysql-test/t/slave_exec_mode_basic.test b/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test
index 5c5b4e7da1b..5c5b4e7da1b 100644
--- a/mysql-test/t/slave_exec_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test
diff --git a/mysql-test/t/slave_net_timeout_basic.test b/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test
index 5662eec3957..5662eec3957 100644
--- a/mysql-test/t/slave_net_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test
diff --git a/mysql-test/t/slow_launch_time_basic.test b/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test
index 6289a91abb3..6289a91abb3 100644
--- a/mysql-test/t/slow_launch_time_basic.test
+++ b/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test
diff --git a/mysql-test/t/slow_launch_time_func.test b/mysql-test/suite/sys_vars/t/slow_launch_time_func.test
index c9a7d28bb8a..c9a7d28bb8a 100644
--- a/mysql-test/t/slow_launch_time_func.test
+++ b/mysql-test/suite/sys_vars/t/slow_launch_time_func.test
diff --git a/mysql-test/t/slow_query_log_basic.test b/mysql-test/suite/sys_vars/t/slow_query_log_basic.test
index 3a1b2fbd9e7..3a1b2fbd9e7 100644
--- a/mysql-test/t/slow_query_log_basic.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_basic.test
diff --git a/mysql-test/t/slow_query_log_file_basic-master.opt b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic-master.opt
index aca191f7fea..aca191f7fea 100644
--- a/mysql-test/t/slow_query_log_file_basic-master.opt
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic-master.opt
diff --git a/mysql-test/t/slow_query_log_file_basic.test b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test
index 2620cd5eabc..9125b686cad 100644
--- a/mysql-test/t/slow_query_log_file_basic.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test
@@ -10,6 +10,7 @@
# #
# Creation Date: 2008-03-16 #
# Author: Salman Rawala #
+# Modified: HHunger 2008-09-11 set system var back to start value #
# #
# Description: Test Cases of Dynamic System Variable "slow_query_log_file" #
# that checks behavior of this variable in the following ways #
@@ -18,8 +19,8 @@
# * Scope & Access method #
# * Data Integrity #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html#option_mysqld_slow_query_log_file #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html
# #
################################################################################
@@ -35,8 +36,6 @@
###########################################################################
SET @start_value = @@global.slow_query_log_file;
-SELECT @start_value;
-
--echo '#---------------------FN_DYNVARS_004_01-------------------------#'
###############################################
@@ -66,7 +65,8 @@ SELECT @@global.slow_query_log_file = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slow_query_log_file';
-
+SET @@global.slow_query_log_file= @start_value;
#####################################################
# END OF slow_query_log_file TESTS #
#####################################################
+
diff --git a/mysql-test/t/slow_query_log_file_func-master.opt b/mysql-test/suite/sys_vars/t/slow_query_log_file_func-master.opt
index e5b1c0948b0..e5b1c0948b0 100644
--- a/mysql-test/t/slow_query_log_file_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_file_func-master.opt
diff --git a/mysql-test/t/slow_query_log_file_func.test b/mysql-test/suite/sys_vars/t/slow_query_log_file_func.test
index 519932b34b0..32420fc294a 100644
--- a/mysql-test/t/slow_query_log_file_func.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_file_func.test
@@ -25,8 +25,9 @@
# Verifying log file after setting it in opt file #
####################################################################
---echo ## --file_exists var/master-data/my_slow_test.log ##
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---file_exists $MYSQLTEST_VARDIR/master-data/my_slow_test.log
+let $MYSQLD_DATADIR= `select @@datadir`;
+--echo ## Checking if my_slow_test.log exists in servers datadir ##
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--file_exists $MYSQLD_DATADIR/my_slow_test.log
--echo ## This case should pass because we have set this filename in opt file ##
diff --git a/mysql-test/t/slow_query_log_func.test b/mysql-test/suite/sys_vars/t/slow_query_log_func.test
index 9bcbeb14fd7..9bcbeb14fd7 100644
--- a/mysql-test/t/slow_query_log_func.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_func.test
diff --git a/mysql-test/t/sql_auto_is_null_basic.test b/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test
index a843b88bf85..a843b88bf85 100644
--- a/mysql-test/t/sql_auto_is_null_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test
diff --git a/mysql-test/t/sql_big_selects_basic.test b/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test
index dd83a19230a..dd83a19230a 100644
--- a/mysql-test/t/sql_big_selects_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test
diff --git a/mysql-test/t/sql_big_selects_func.test b/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
index 4aefda5e15e..4aefda5e15e 100644
--- a/mysql-test/t/sql_big_selects_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
diff --git a/mysql-test/t/sql_big_tables_basic.test b/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test
index 4e3dbdc9504..4e3dbdc9504 100644
--- a/mysql-test/t/sql_big_tables_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test
diff --git a/mysql-test/t/sql_big_tables_func.test b/mysql-test/suite/sys_vars/t/sql_big_tables_func.test
index 5f919fac2c7..5f919fac2c7 100644
--- a/mysql-test/t/sql_big_tables_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_tables_func.test
diff --git a/mysql-test/t/sql_buffer_result_basic.test b/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test
index f5a5e323fc4..f5a5e323fc4 100644
--- a/mysql-test/t/sql_buffer_result_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test
diff --git a/mysql-test/t/sql_buffer_result_func.test b/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test
index 4530545b8f0..4530545b8f0 100644
--- a/mysql-test/t/sql_buffer_result_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test
diff --git a/mysql-test/t/sql_log_bin_basic.test b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
index 0f6d9e1e126..0f6d9e1e126 100644
--- a/mysql-test/t/sql_log_bin_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
diff --git a/mysql-test/t/sql_log_off_basic.test b/mysql-test/suite/sys_vars/t/sql_log_off_basic.test
index bcf9e87c1dd..bcf9e87c1dd 100644
--- a/mysql-test/t/sql_log_off_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_log_off_basic.test
diff --git a/mysql-test/t/sql_log_off_func.test b/mysql-test/suite/sys_vars/t/sql_log_off_func.test
index fb06a12b264..fb06a12b264 100644
--- a/mysql-test/t/sql_log_off_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_log_off_func.test
diff --git a/mysql-test/t/sql_low_priority_updates_basic.test b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test
index 499723b636d..499723b636d 100644
--- a/mysql-test/t/sql_low_priority_updates_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test
diff --git a/mysql-test/t/sql_low_priority_updates_func.test b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
index 6ff684af6cd..6ff684af6cd 100644
--- a/mysql-test/t/sql_low_priority_updates_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
diff --git a/mysql-test/t/sql_max_join_size_func.test b/mysql-test/suite/sys_vars/t/sql_max_join_size_func.test
index 17b7d911b94..17b7d911b94 100644
--- a/mysql-test/t/sql_max_join_size_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_max_join_size_func.test
diff --git a/mysql-test/t/sql_mode_basic.test b/mysql-test/suite/sys_vars/t/sql_mode_basic.test
index 24f1e8aefcb..24f1e8aefcb 100644
--- a/mysql-test/t/sql_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_mode_basic.test
diff --git a/mysql-test/t/sql_mode_func.test b/mysql-test/suite/sys_vars/t/sql_mode_func.test
index 5bb804c26da..5bb804c26da 100644
--- a/mysql-test/t/sql_mode_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_mode_func.test
diff --git a/mysql-test/t/sql_notes_basic.test b/mysql-test/suite/sys_vars/t/sql_notes_basic.test
index 984dca34e46..984dca34e46 100644
--- a/mysql-test/t/sql_notes_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_notes_basic.test
diff --git a/mysql-test/t/sql_notes_func.test b/mysql-test/suite/sys_vars/t/sql_notes_func.test
index f7c521d3736..f7c521d3736 100644
--- a/mysql-test/t/sql_notes_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_notes_func.test
diff --git a/mysql-test/t/sql_quote_show_create_basic.test b/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test
index 1919b3ee642..1919b3ee642 100644
--- a/mysql-test/t/sql_quote_show_create_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test
diff --git a/mysql-test/t/sql_quote_show_create_func.test b/mysql-test/suite/sys_vars/t/sql_quote_show_create_func.test
index 6350771a0da..6350771a0da 100644
--- a/mysql-test/t/sql_quote_show_create_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_quote_show_create_func.test
diff --git a/mysql-test/t/sql_safe_updates_basic.test b/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test
index 489b42949a0..489b42949a0 100644
--- a/mysql-test/t/sql_safe_updates_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test
diff --git a/mysql-test/t/sql_safe_updates_func.test b/mysql-test/suite/sys_vars/t/sql_safe_updates_func.test
index a8ce3a8d0f7..a8ce3a8d0f7 100644
--- a/mysql-test/t/sql_safe_updates_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_safe_updates_func.test
diff --git a/mysql-test/t/sql_select_limit_func.test b/mysql-test/suite/sys_vars/t/sql_select_limit_func.test
index ed582949aa0..ed582949aa0 100644
--- a/mysql-test/t/sql_select_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_select_limit_func.test
diff --git a/mysql-test/t/sql_slave_skip_counter_basic.test b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test
index e7d9098aee9..e7d9098aee9 100644
--- a/mysql-test/t/sql_slave_skip_counter_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test
diff --git a/mysql-test/t/sql_warnings_basic.test b/mysql-test/suite/sys_vars/t/sql_warnings_basic.test
index f740403ceda..f740403ceda 100644
--- a/mysql-test/t/sql_warnings_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_warnings_basic.test
diff --git a/mysql-test/t/sql_warnings_func.test b/mysql-test/suite/sys_vars/t/sql_warnings_func.test
index e7705d1f146..e7705d1f146 100644
--- a/mysql-test/t/sql_warnings_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_warnings_func.test
diff --git a/mysql-test/t/ssl_ca_basic.test b/mysql-test/suite/sys_vars/t/ssl_ca_basic.test
index c369f1f0894..c369f1f0894 100644
--- a/mysql-test/t/ssl_ca_basic.test
+++ b/mysql-test/suite/sys_vars/t/ssl_ca_basic.test
diff --git a/mysql-test/t/ssl_capath_basic.test b/mysql-test/suite/sys_vars/t/ssl_capath_basic.test
index c32b572fb1b..c32b572fb1b 100644
--- a/mysql-test/t/ssl_capath_basic.test
+++ b/mysql-test/suite/sys_vars/t/ssl_capath_basic.test
diff --git a/mysql-test/t/ssl_cert_basic.test b/mysql-test/suite/sys_vars/t/ssl_cert_basic.test
index c3b69bd495f..c3b69bd495f 100644
--- a/mysql-test/t/ssl_cert_basic.test
+++ b/mysql-test/suite/sys_vars/t/ssl_cert_basic.test
diff --git a/mysql-test/t/ssl_cipher_basic.test b/mysql-test/suite/sys_vars/t/ssl_cipher_basic.test
index 425f7aae442..425f7aae442 100644
--- a/mysql-test/t/ssl_cipher_basic.test
+++ b/mysql-test/suite/sys_vars/t/ssl_cipher_basic.test
diff --git a/mysql-test/t/ssl_key_basic.test b/mysql-test/suite/sys_vars/t/ssl_key_basic.test
index 4616f281c27..4616f281c27 100644
--- a/mysql-test/t/ssl_key_basic.test
+++ b/mysql-test/suite/sys_vars/t/ssl_key_basic.test
diff --git a/mysql-test/t/storage_engine_basic-master.opt b/mysql-test/suite/sys_vars/t/storage_engine_basic-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/storage_engine_basic-master.opt
+++ b/mysql-test/suite/sys_vars/t/storage_engine_basic-master.opt
diff --git a/mysql-test/t/storage_engine_basic.test b/mysql-test/suite/sys_vars/t/storage_engine_basic.test
index 689afcd1010..689afcd1010 100644
--- a/mysql-test/t/storage_engine_basic.test
+++ b/mysql-test/suite/sys_vars/t/storage_engine_basic.test
diff --git a/mysql-test/t/sync_frm_basic.test b/mysql-test/suite/sys_vars/t/sync_frm_basic.test
index 6c00182a805..6c00182a805 100644
--- a/mysql-test/t/sync_frm_basic.test
+++ b/mysql-test/suite/sys_vars/t/sync_frm_basic.test
diff --git a/mysql-test/t/system_time_zone_basic.test b/mysql-test/suite/sys_vars/t/system_time_zone_basic.test
index 0dfc850d227..0dfc850d227 100644
--- a/mysql-test/t/system_time_zone_basic.test
+++ b/mysql-test/suite/sys_vars/t/system_time_zone_basic.test
diff --git a/mysql-test/t/table_definition_cache_basic.test b/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test
index 741079091bc..741079091bc 100644
--- a/mysql-test/t/table_definition_cache_basic.test
+++ b/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test
diff --git a/mysql-test/t/table_lock_wait_timeout_basic.test b/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test
index 43186c70874..43186c70874 100644
--- a/mysql-test/t/table_lock_wait_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test
diff --git a/mysql-test/t/table_open_cache_basic.test b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test
index c32463ca030..c32463ca030 100644
--- a/mysql-test/t/table_open_cache_basic.test
+++ b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test
diff --git a/mysql-test/t/thread_cache_size_func.test b/mysql-test/suite/sys_vars/t/thread_cache_size_func.test
index fe9f4242c0d..fe9f4242c0d 100644
--- a/mysql-test/t/thread_cache_size_func.test
+++ b/mysql-test/suite/sys_vars/t/thread_cache_size_func.test
diff --git a/mysql-test/t/thread_handling_basic.test b/mysql-test/suite/sys_vars/t/thread_handling_basic.test
index bcad003ce93..bcad003ce93 100644
--- a/mysql-test/t/thread_handling_basic.test
+++ b/mysql-test/suite/sys_vars/t/thread_handling_basic.test
diff --git a/mysql-test/t/time_zone_basic.test b/mysql-test/suite/sys_vars/t/time_zone_basic.test
index 32616e97534..32616e97534 100644
--- a/mysql-test/t/time_zone_basic.test
+++ b/mysql-test/suite/sys_vars/t/time_zone_basic.test
diff --git a/mysql-test/t/time_zone_func.test b/mysql-test/suite/sys_vars/t/time_zone_func.test
index 1d9bc954d8a..1d9bc954d8a 100644
--- a/mysql-test/t/time_zone_func.test
+++ b/mysql-test/suite/sys_vars/t/time_zone_func.test
diff --git a/mysql-test/t/timed_mutexes_basic.test b/mysql-test/suite/sys_vars/t/timed_mutexes_basic.test
index b0eb41afb49..b0eb41afb49 100644
--- a/mysql-test/t/timed_mutexes_basic.test
+++ b/mysql-test/suite/sys_vars/t/timed_mutexes_basic.test
diff --git a/mysql-test/t/timestamp_func.test b/mysql-test/suite/sys_vars/t/timestamp_func.test
index e119f1b6253..e119f1b6253 100644
--- a/mysql-test/t/timestamp_func.test
+++ b/mysql-test/suite/sys_vars/t/timestamp_func.test
diff --git a/mysql-test/t/timestamp_sysdate_is_now_func-master.opt b/mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func-master.opt
index 97a58d28032..97a58d28032 100644
--- a/mysql-test/t/timestamp_sysdate_is_now_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func-master.opt
diff --git a/mysql-test/t/timestamp_sysdate_is_now_func.test b/mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func.test
index 7ca3b4cddac..7ca3b4cddac 100644
--- a/mysql-test/t/timestamp_sysdate_is_now_func.test
+++ b/mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func.test
diff --git a/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc b/mysql-test/suite/sys_vars/t/tmp_table_size_basic.test
index 7f69bcd1f8c..c2ff51d50ca 100644
--- a/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc
+++ b/mysql-test/suite/sys_vars/t/tmp_table_size_basic.test
@@ -1,27 +1,29 @@
-############## mysql-test\t\tmp_table_size_basic.test #########################
-# #
-# Variable Name: tmp_table_size #
-# Scope: GLOBAL | SESSION #
-# Access Type: Dynamic #
-# Data Type: numeric #
-# Default Value: 33554432 #
-# Range: 1024-4294967295 #
-# #
-# #
-# Creation Date: 2008-02-13 #
-# Author: Salman #
-# #
-# Description: Test Cases of Dynamic System Variable tmp_table_size #
-# that checks the behavior of this variable in the following ways#
-# * Default Value #
-# * Valid & Invalid values #
-# * Scope & Access method #
-# * Data Integrity #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html#option_mysqld_tmp_table_size #
-# #
-###############################################################################
+########################### tmp_table_size_basic.test ##########################
+# #
+# Variable Name: tmp_table_size #
+# Scope: GLOBAL | SESSION #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# Default Value: system dependend #
+# Range: 1024-system dependend #
+# #
+# #
+# Creation Date: 2008-02-13 #
+# Author: Salman #
+# #
+# Description: Test Cases of Dynamic System Variable tmp_table_size #
+# that checks the behavior of this variable in the following ways #
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity #
+# Modified: 2008-12-04 HHunger #
+# removed the differences between 64 and 32 bit platforms #
+# #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
+# #
+################################################################################
--source include/load_sysvars.inc
@@ -29,17 +31,12 @@
# START OF tmp_table_size TESTS #
##############################################################
-
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.tmp_table_size;
-SELECT @start_global_value;
SET @start_session_value = @@session.tmp_table_size;
-SELECT @start_session_value;
-
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
##############################################################
@@ -48,27 +45,19 @@ SELECT @start_session_value;
SET @@global.tmp_table_size = 100;
SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
SET @@session.tmp_table_size = 200;
SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
########################################################################
-# Check the DEFAULT value of tmp_table_size #
+# Check the DEFAULT value of tmp_table_size #
########################################################################
+# The DEFAULT value is system dependend.
+# Therefore we have only a plausibility check here
+SELECT @@global.tmp_table_size >= 16777216;
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size = 33554432;
-
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size = 33554432;
-
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
+SELECT @@session.tmp_table_size >= 16777216;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
########################################################################
@@ -87,11 +76,11 @@ SELECT @@global.tmp_table_size;
#########################################################################
# Change the value of tmp_table_size to a valid value for SESSION Scope #
#########################################################################
-
+
SET @@session.tmp_table_size = 1024;
SELECT @@session.tmp_table_size;
-SET @@session.tmp_table_size =4294967295;
+SET @@session.tmp_table_size = 4294967295;
SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = 65535;
SELECT @@session.tmp_table_size;
@@ -111,37 +100,28 @@ SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = 1000;
SELECT @@global.tmp_table_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = ON;
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = OFF;
-
SET @@global.tmp_table_size = True;
SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = False;
SELECT @@global.tmp_table_size;
---echo 'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = 65530.34;
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size ="Test";
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = ON;
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = OFF;
SET @@session.tmp_table_size = True;
@@ -150,21 +130,21 @@ SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = False;
SELECT @@session.tmp_table_size;
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = "Test";
SET @@session.tmp_table_size = 12345678901;
-SELECT @@session.tmp_table_size;
+# With a 64 bit mysqld:12345678901,with a 32 bit mysqld: 4294967295
+SELECT @@session.tmp_table_size IN (12345678901,4294967295);
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
-
-SELECT @@global.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT @@global.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
@@ -172,13 +152,10 @@ WHERE VARIABLE_NAME='tmp_table_size';
# Check if the value in SESSION Table matches value in variable #
####################################################################
-SELECT @@session.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT @@session.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
-
-
-
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
########################################################################
# Check if global and session variables are independent of each other #
@@ -216,16 +193,12 @@ SELECT global.tmp_table_size;
--Error ER_BAD_FIELD_ERROR
SELECT tmp_table_size = @@session.tmp_table_size;
-
####################################
# Restore initial value #
####################################
SET @@global.tmp_table_size = @start_global_value;
-SELECT @@global.tmp_table_size;
SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.tmp_table_size;
-
###################################################
# END OF tmp_table_size TESTS #
diff --git a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test
deleted file mode 100644
index c772b5c896c..00000000000
--- a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/tmp_table_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test
deleted file mode 100644
index 46b3f65be9a..00000000000
--- a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/tmp_table_size_basic.inc
-
diff --git a/mysql-test/t/tmpdir_basic.test b/mysql-test/suite/sys_vars/t/tmpdir_basic.test
index 5e9d08c4876..5e9d08c4876 100644
--- a/mysql-test/t/tmpdir_basic.test
+++ b/mysql-test/suite/sys_vars/t/tmpdir_basic.test
diff --git a/mysql-test/t/tx_isolation_basic.test b/mysql-test/suite/sys_vars/t/tx_isolation_basic.test
index 136a9b4331e..136a9b4331e 100644
--- a/mysql-test/t/tx_isolation_basic.test
+++ b/mysql-test/suite/sys_vars/t/tx_isolation_basic.test
diff --git a/mysql-test/t/tx_isolation_func-master.opt b/mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt
index c15943a7544..c15943a7544 100644
--- a/mysql-test/t/tx_isolation_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt
diff --git a/mysql-test/t/tx_isolation_func.test b/mysql-test/suite/sys_vars/t/tx_isolation_func.test
index 1fd2e323db8..1fd2e323db8 100644
--- a/mysql-test/t/tx_isolation_func.test
+++ b/mysql-test/suite/sys_vars/t/tx_isolation_func.test
diff --git a/mysql-test/t/unique_checks_basic.test b/mysql-test/suite/sys_vars/t/unique_checks_basic.test
index 55308adcc82..55308adcc82 100644
--- a/mysql-test/t/unique_checks_basic.test
+++ b/mysql-test/suite/sys_vars/t/unique_checks_basic.test
diff --git a/mysql-test/t/updatable_views_with_limit_basic.test b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test
index 61a45793d39..61a45793d39 100644
--- a/mysql-test/t/updatable_views_with_limit_basic.test
+++ b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test
diff --git a/mysql-test/t/updatable_views_with_limit_func.test b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_func.test
index 2e1a3f97346..2e1a3f97346 100644
--- a/mysql-test/t/updatable_views_with_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_func.test
diff --git a/mysql-test/t/version_basic.test b/mysql-test/suite/sys_vars/t/version_basic.test
index 0a22713ca12..0a22713ca12 100644
--- a/mysql-test/t/version_basic.test
+++ b/mysql-test/suite/sys_vars/t/version_basic.test
diff --git a/mysql-test/t/version_comment_basic.test b/mysql-test/suite/sys_vars/t/version_comment_basic.test
index 3ae6daa192a..3ae6daa192a 100644
--- a/mysql-test/t/version_comment_basic.test
+++ b/mysql-test/suite/sys_vars/t/version_comment_basic.test
diff --git a/mysql-test/t/version_compile_machine_basic.test b/mysql-test/suite/sys_vars/t/version_compile_machine_basic.test
index 30742436068..30742436068 100644
--- a/mysql-test/t/version_compile_machine_basic.test
+++ b/mysql-test/suite/sys_vars/t/version_compile_machine_basic.test
diff --git a/mysql-test/t/version_compile_os_basic.test b/mysql-test/suite/sys_vars/t/version_compile_os_basic.test
index 8858f248249..8858f248249 100644
--- a/mysql-test/t/version_compile_os_basic.test
+++ b/mysql-test/suite/sys_vars/t/version_compile_os_basic.test
diff --git a/mysql-test/t/wait_timeout_func.test b/mysql-test/suite/sys_vars/t/wait_timeout_func.test
index 6b7c8d016d2..6b7c8d016d2 100644
--- a/mysql-test/t/wait_timeout_func.test
+++ b/mysql-test/suite/sys_vars/t/wait_timeout_func.test
diff --git a/mysql-test/t/warning_count_basic.test b/mysql-test/suite/sys_vars/t/warning_count_basic.test
index 64539e28d5b..64539e28d5b 100644
--- a/mysql-test/t/warning_count_basic.test
+++ b/mysql-test/suite/sys_vars/t/warning_count_basic.test
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 76d57e76491..ae48d5a8736 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -751,6 +751,19 @@ ALTER TABLE t1 MODIFY COLUMN v VARCHAR(4);
SELECT * FROM t1;
DROP TABLE t1;
+
+#
+# Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types
+#
+create table t1 (a tinytext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+drop table t1;
+create table t1 (a mediumtext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+drop table t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index b42c8446a32..7139d95ab49 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1598,3 +1598,4 @@ CREATE TABLE t1(a INT NOT NULL AUTO_INCREMENT, b BLOB, KEY(a)) ENGINE=archive;
INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL);
FLUSH TABLE t1;
SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index 47458c1f054..32f065171f2 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -149,7 +149,6 @@ delete from t1 where a=0;
update t1 set a=0 where b=5;
select * from t1 order by b;
delete from t1 where a=0;
---error 1048
update t1 set a=NULL where b=6;
update t1 set a=300 where b=7;
SET SQL_MODE='';
@@ -165,7 +164,6 @@ delete from t1 where a=0;
update t1 set a=0 where b=12;
select * from t1 order by b;
delete from t1 where a=0;
---error 1048
update t1 set a=NULL where b=13;
update t1 set a=500 where b=14;
select * from t1 order by b;
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test
index cdbf7b69615..61e80ec682e 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -1,6 +1,6 @@
# The server need to be started in $MYSQLTEST_VARDIR since it
-# uses ../std_data_ln/
+# uses ../../std_data/
-- source include/uses_vardir.inc
#
@@ -16,41 +16,41 @@ drop table if exists t1, t2, t3, t4;
--enable_warnings
create table t4(n int);
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-backup table t4 to '../bogus';
-backup table t4 to '../tmp';
+backup table t4 to '../../bogus';
+backup table t4 to '../../tmp';
--replace_result ": 7" ": X" ": 17" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-backup table t4 to '../tmp';
+backup table t4 to '../../tmp';
drop table t4;
-restore table t4 from '../tmp';
+restore table t4 from '../../tmp';
select count(*) from t4;
create table t1(n int);
insert into t1 values (23),(45),(67);
-backup table t1 to '../tmp';
+backup table t1 to '../../tmp';
drop table t1;
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-restore table t1 from '../bogus';
-restore table t1 from '../tmp';
+restore table t1 from '../../bogus';
+restore table t1 from '../../tmp';
select n from t1;
create table t2(m int not null primary key);
create table t3(k int not null primary key);
insert into t2 values (123),(145),(167);
insert into t3 values (223),(245),(267);
-backup table t2,t3 to '../tmp';
+backup table t2,t3 to '../../tmp';
drop table t1,t2,t3;
-restore table t1,t2,t3 from '../tmp';
+restore table t1,t2,t3 from '../../tmp';
select n from t1;
select m from t2;
select k from t3;
drop table t1,t2,t3,t4;
-restore table t1 from '../tmp';
+restore table t1 from '../../tmp';
connection con2;
rename table t1 to t5;
--send
lock tables t5 write;
connection con1;
--send
-backup table t5 to '../tmp';
+backup table t5 to '../../tmp';
connection con2;
reap;
unlock tables;
@@ -80,11 +80,11 @@ DROP TABLE IF EXISTS `t+1`;
--enable_warnings
CREATE TABLE `t+1` (c1 INT);
INSERT INTO `t+1` VALUES (1), (2), (3);
-BACKUP TABLE `t+1` TO '../tmp';
+BACKUP TABLE `t+1` TO '../../tmp';
DROP TABLE `t+1`;
#
# Same for restore.
-RESTORE TABLE `t+1` FROM '../tmp';
+RESTORE TABLE `t+1` FROM '../../tmp';
SELECT * FROM `t+1`;
DROP TABLE `t+1`;
diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test
index 203ba9b2914..db89269b35d 100644
--- a/mysql-test/t/bootstrap.test
+++ b/mysql-test/t/bootstrap.test
@@ -6,6 +6,10 @@ drop table if exists t1;
--enable_warnings
+# Add the datadir to the bootstrap command
+let $MYSQLD_DATADIR= `select @@datadir`;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR;
+
#
# Check that --bootstrap reads from stdin
#
diff --git a/mysql-test/t/change_user-master.opt b/mysql-test/t/change_user-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/t/change_user-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test
index f200c76196c..89f35116a2c 100644
--- a/mysql-test/t/change_user.test
+++ b/mysql-test/t/change_user.test
@@ -45,9 +45,32 @@ SELECT IS_USED_LOCK('bug31418');
# Bug#31222: com_% global status counters behave randomly with
# mysql_change_user.
#
-# Moved to not_embedded_server.test due to Bug#34517: SHOW GLOBAL STATUS does
-# not work properly in embedded server.
-#
-# TODO: move it back when Bug#34517 is fixed (don't forget to add
-# --force-restart into change_user-master.opt).
-#
+
+FLUSH STATUS;
+
+--disable_result_log
+--disable_query_log
+
+let $i = 100;
+
+while ($i)
+{
+ dec $i;
+
+ SELECT 1;
+}
+
+--enable_query_log
+--enable_result_log
+
+let $before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1);
+
+--change_user
+
+let $after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1);
+
+if (`select $after != $before`){
+ SHOW GLOBAL STATUS LIKE 'com_select';
+ die The value of com_select changed during change_user;
+}
+echo Value of com_select did not change;
diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test
index 4e212d81e66..e3dba58d4df 100644
--- a/mysql-test/t/crash_commit_before.test
+++ b/mysql-test/t/crash_commit_before.test
@@ -15,7 +15,7 @@ insert into t1 values(9);
SET SESSION debug="d,crash_commit_before";
# Write file to make mysql-test-run.pl expect crash and restart
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/master0.expect
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Run the crashing query
--error 2013
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 2eeca1eea90..f9708002ee6 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1418,6 +1418,7 @@ SHOW CREATE TABLE t2;
--echo
DROP TABLE t2;
+DROP TABLE t1;
--echo
--echo # -- End of test case for Bug#21380.
@@ -1532,5 +1533,11 @@ DROP TABLE t1;
###########################################################################
+#
+# Bug#40104 regression with table names?
+#
+create table `me:i`(id int);
+drop table `me:i`;
+
--echo
--echo End of 5.1 tests
diff --git a/mysql-test/t/create_not_windows.test b/mysql-test/t/create_not_windows.test
index 56b4002106d..b612e31e3aa 100644
--- a/mysql-test/t/create_not_windows.test
+++ b/mysql-test/t/create_not_windows.test
@@ -29,7 +29,8 @@ drop table if exists t1;
--enable_warnings
create table t1(a int) engine=myisam;
insert into t1 values(1);
---system rm -f $MYSQLTEST_VARDIR/master-data/test/t1.frm
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/t1.frm;
--echo "We get an error because the table is in the definition cache"
--error ER_TABLE_EXISTS_ERROR
create table t1(a int, b int);
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index ac628f96a0f..abc161d014c 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1409,7 +1409,8 @@ DROP TABLE test_repair_table;
#
CREATE TABLE test_repair_table2 ( val integer not null ) ENGINE = CSV;
---remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM
+let $MYSQLD_DATADIR= `select @@datadir`;
+--remove_file $MYSQLD_DATADIR/test/test_repair_table2.CSM
# Should give a warning and perform autorepair. We also disable ps-protocol
# here, as mysql-test eats up warnings in ps-protocol mode
@@ -1420,15 +1421,15 @@ SELECT * from test_repair_table2;
# this should work ok, as the table is already repaired
SELECT * from test_repair_table2;
# check that the metafile appeared again.
---file_exists $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM
+--file_exists $MYSQLD_DATADIR/test/test_repair_table2.CSM
CHECK TABLE test_repair_table2;
DROP TABLE test_repair_table2;
# Corrupt csv file and see if we can repair it
CREATE TABLE test_repair_table3 ( val integer not null ) ENGINE = CSV;
---remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
---write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
+--remove_file $MYSQLD_DATADIR/test/test_repair_table3.CSV
+--write_file $MYSQLD_DATADIR/test/test_repair_table3.CSV
"1"
"4"
"3
@@ -1447,7 +1448,7 @@ CREATE TABLE test_repair_table4 (
founded char(4) DEFAULT '' NOT NULL
) ENGINE = CSV;
---remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table4.CSM
+--remove_file $MYSQLD_DATADIR/test/test_repair_table4.CSM
--disable_ps_protocol
SELECT * FROM test_repair_table4;
--enable_ps_protocol
@@ -1480,8 +1481,8 @@ CREATE TABLE test_repair_table5 (
) ENGINE = CSV;
# Corrupt a table -- put a file with wrong # of columns
---remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
---write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+--remove_file $MYSQLD_DATADIR/test/test_repair_table5.CSV
+--write_file $MYSQLD_DATADIR/test/test_repair_table5.CSV
"1","101","IBM"
EOF
@@ -1492,7 +1493,7 @@ INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT", 1876);
SELECT * FROM test_repair_table5;
# Corrupt a table -- put a row with wrong # of columns at end of file
---append_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+--append_file $MYSQLD_DATADIR/test/test_repair_table5.CSV
"1","101","IBM"
EOF
@@ -1505,7 +1506,7 @@ INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT2", 1876);
SELECT * FROM test_repair_table5;
# Corrupt table again -- put a row with wrong # of columns at end of file
---append_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+--append_file $MYSQLD_DATADIR/test/test_repair_table5.CSV
"1","101","IBM"
EOF
@@ -1588,14 +1589,14 @@ drop table t1;
create table bug15205 (val int(11) not null) engine=csv;
create table bug15205_2 (val int(11) not null) engine=csv;
---remove_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
+--remove_file $MYSQLD_DATADIR/test/bug15205.CSV
# system error (can't open the datafile)
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error 13
select * from bug15205;
select * from bug15205_2;
# Create empty file
---write_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
+--write_file $MYSQLD_DATADIR/test/bug15205.CSV
EOF
select * from bug15205;
drop table bug15205;
@@ -1634,16 +1635,16 @@ insert into bug22080_1 values(2,'string');
insert into bug22080_1 values(3,'string');
# Create first corrupt file as described in bug report
---remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV
---write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV
+--remove_file $MYSQLD_DATADIR/test/bug22080_2.CSV
+--write_file $MYSQLD_DATADIR/test/bug22080_2.CSV
1,"string"
2","string"
3,"string"
EOF
# Create second corrupt file as described in bug report
---remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV
---write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV
+--remove_file $MYSQLD_DATADIR/test/bug22080_3.CSV
+--write_file $MYSQLD_DATADIR/test/bug22080_3.CSV
1,"string"
"2",string"
3,"string"
@@ -1703,8 +1704,8 @@ check table t1;
drop table t1;
create table t1(a int not null, b int not null) engine=csv;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
---write_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
+--remove_file $MYSQLD_DATADIR/test/t1.CSV
+--write_file $MYSQLD_DATADIR/test/t1.CSV
1, 1E-2
-2E2, .9
-10E-1, -.9
@@ -1794,8 +1795,8 @@ create table t1 (a int not null) engine=csv;
lock tables t1 read;
connect (con1,localhost,root,,);
--connection con1
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
---replace_result $MYSQLTEST_VARDIR . master-data/ '' 13 2
+--remove_file $MYSQLD_DATADIR/test/t1.CSV
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/ ./ MYSQLD_DATADIR/ 13 2
# EE_FILENOTFOUND 29
--error 29
select * from t1;
@@ -1804,4 +1805,17 @@ unlock tables;
drop table t1;
--disconnect con1
+#
+# Bug#41441 repair csv table crashes debug server
+#
+# Note: The test should be removed after Bug#33717 is fixed
+
+create table t1(a enum ('a') not null) engine=csv;
+insert into t1 values (2);
+--error ER_CRASHED_ON_USAGE
+select * from t1 limit 1;
+repair table t1;
+select * from t1 limit 1;
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/csv_not_null.test b/mysql-test/t/csv_not_null.test
index bb7b412aa49..03ed566fb22 100644
--- a/mysql-test/t/csv_not_null.test
+++ b/mysql-test/t/csv_not_null.test
@@ -93,7 +93,6 @@ SELECT * FROM t1;
UPDATE t1 set b = 'new_value' where a = 0;
--enable_warnings
SELECT * FROM t1;
---error ER_BAD_NULL_ERROR
UPDATE t1 set b = NULL where b = 'new_value';
SELECT * FROM t1;
diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test
index 5a8a13f2bad..a75fd917052 100644
--- a/mysql-test/t/ctype_big5.test
+++ b/mysql-test/t/ctype_big5.test
@@ -75,12 +75,12 @@ create table t1 (a blob);
insert into t1 values (0xEE00);
select * into outfile 'test/t1.txt' from t1;
delete from t1;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---eval select hex(load_file('$MYSQLTEST_VARDIR/master-data/test/t1.txt'));
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--eval select hex(load_file('$MYSQLD_DATADIR/test/t1.txt'));
load data infile 't1.txt' into table t1;
select hex(a) from t1;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.txt
-
+--remove_file $MYSQLD_DATADIR/test/t1.txt
drop table t1;
--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test
index fc6ed0f2579..73a23a751e8 100644
--- a/mysql-test/t/ctype_ldml.test
+++ b/mysql-test/t/ctype_ldml.test
@@ -21,6 +21,22 @@ insert into t1 values ('a');
select * from t1 where c1='b';
drop table t1;
+
+#
+# Bug#41084 full-text index added to custom UCA collation not working
+#
+CREATE TABLE t1 (
+ col1 varchar(100) character set utf8 collate utf8_test_ci
+);
+INSERT INTO t1 (col1) VALUES ('abcd'),('efgh'),('ijkl');
+ALTER TABLE t1 ADD FULLTEXT INDEX (col1);
+SELECT * FROM t1 where match (col1) against ('abcd');
+SELECT * FROM t1 where match (col1) against ('abcd' IN BOOLEAN MODE);
+ALTER TABLE t1 ADD (col2 varchar(100) character set latin1);
+UPDATE t1 SET col2=col1;
+SELECT * FROM t1 WHERE col1=col2 ORDER BY col1;
+DROP TABLE t1;
+
#
# Vietnamese experimental collation
#
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index cb371bc0ca6..e247110658b 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -697,4 +697,29 @@ set names latin1;
#
select hex(char(0x41 using ucs2));
+#
+# Bug#37575: UCASE fails on monthname
+#
+SET character_set_connection=ucs2;
+SELECT CHARSET(DAYNAME(19700101));
+SELECT CHARSET(MONTHNAME(19700101));
+SELECT LOWER(DAYNAME(19700101));
+SELECT LOWER(MONTHNAME(19700101));
+SELECT UPPER(DAYNAME(19700101));
+SELECT UPPER(MONTHNAME(19700101));
+SELECT HEX(MONTHNAME(19700101));
+SELECT HEX(DAYNAME(19700101));
+SET LC_TIME_NAMES=ru_RU;
+SET NAMES utf8;
+SET character_set_connection=ucs2;
+SELECT CHARSET(DAYNAME(19700101));
+SELECT CHARSET(MONTHNAME(19700101));
+SELECT LOWER(DAYNAME(19700101));
+SELECT LOWER(MONTHNAME(19700101));
+SELECT UPPER(DAYNAME(19700101));
+SELECT UPPER(MONTHNAME(19700101));
+SELECT HEX(MONTHNAME(19700101));
+SELECT HEX(DAYNAME(19700101));
+SET character_set_connection=latin1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index abf09942d1c..e5dc7ffa53e 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -6,10 +6,15 @@
drop table if exists t1;
--enable_warnings
---replace_result ROW <format> STATEMENT <format> MIXED <format>
-SHOW GLOBAL VARIABLES LIKE "%e_format";
---replace_result ROW <format> STATEMENT <format> MIXED <format>
-SHOW SESSION VARIABLES LIKE "%e_format";
+SELECT variable_name, variable_value
+FROM information_schema.global_variables
+WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+ORDER BY variable_name;
+
+SELECT variable_name, variable_value
+FROM information_schema.session_variables
+WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+ORDER BY variable_name;
#
# Test setting a lot of different formats to see which formats are accepted and
@@ -36,8 +41,10 @@ set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
set datetime_format= '%h:%i:%s %p %Y-%m-%d';
set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
---replace_result ROW <format> STATEMENT <format> MIXED <format>
-SHOW SESSION VARIABLES LIKE "%e_format";
+SELECT variable_name, variable_value
+FROM information_schema.session_variables
+WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+ORDER BY variable_name;
--error 1231
SET time_format='%h:%i:%s';
@@ -121,7 +128,7 @@ SET datetime_format=default;
# Test of str_to_date
#
-# PS doesn't support fraction of a seconds
+# PS doesn't support fractions of a second
--disable_ps_protocol
select str_to_date(concat('15-01-2001',' 2:59:58.999'),
concat('%d-%m-%Y',' ','%H:%i:%s.%f'));
@@ -340,3 +347,15 @@ select str_to_date('04/30 /2004', '%m /%d /%Y');
select str_to_date('04/30/2004 ', '%m/%d/%Y ');
--echo "End of 4.1 tests"
+
+#
+# Bug #41470: DATE_FORMAT() crashes the complete server with a valid date
+#
+
+# show that these two do not crash the server:
+SELECT DATE_FORMAT("0000-01-01",'%W %d %M %Y') as valid_date;
+SELECT DATE_FORMAT("0000-02-28",'%W %d %M %Y') as valid_date;
+# show that date within the Gregorian range render correct results: (THU)
+SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
+
+--echo "End of 5.0 tests"
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index ce57645bd4b..94ad22b80d0 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -285,4 +285,47 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00');
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
DROP TABLE t1,t2;
+#
+# Bug#40536: SELECT is blocked by INSERT DELAYED waiting on upgrading lock,
+# even with low_priority_updates
+#
+
+set @old_delayed_updates = @@global.low_priority_updates;
+set global low_priority_updates = 1;
+select @@global.low_priority_updates;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int, b int);
+insert into t1 values (1,1);
+lock table t1 read;
+connect (update,localhost,root,,);
+connection update;
+--echo connection: update
+--send insert delayed into t1 values (2,2);
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where command = "Delayed insert" and state = "upgrading lock";
+--source include/wait_condition.inc
+connect (select,localhost,root,,);
+--echo connection: select
+select * from t1;
+connection default;
+--echo connection: default
+select * from t1;
+connection default;
+disconnect update;
+disconnect select;
+unlock tables;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where command = "Delayed insert" and state = "Waiting for INSERT";
+--source include/wait_condition.inc
+select * from t1;
+drop table t1;
+
+set global low_priority_updates = @old_delayed_updates;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 5de0a435ba5..f61090102ff 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -9,7 +9,6 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-federated_transactions : Bug#29523 Transactions do not work
-log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows
-slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions
-wait_timeout_func : Bug #41225 joro wait_timeout_func fails
+kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
+query_cache_28249 : Bug#41098 Query Cache returns wrong result with concurrent insert
+innodb_bug39438 : BUG#42383 2009-01-28 lsoares "This fails in embedded and on windows. Note that this test is not run on windows and on embedded in PB for main trees currently"
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 5be8d911881..a77d1136840 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -440,7 +440,6 @@ SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
DROP TABLE t1;
#Bug #20836: Selecting into variables results in wrong results being returned
-
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -488,14 +487,14 @@ CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
default NULL);
SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
-'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
-LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
+'../../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../../tmp/data1.tmp' INTO TABLE t2;
--error 0,1
--remove_file $MYSQLTEST_VARDIR/tmp/data1.tmp
SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
-'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
-LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
+'../../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../../tmp/data2.tmp' INTO TABLE t2;
--remove_file $MYSQLTEST_VARDIR/tmp/data2.tmp
SELECT @v19, @v20;
diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test
index 2c490b51afc..4f0777922b8 100644
--- a/mysql-test/t/drop.test
+++ b/mysql-test/t/drop.test
@@ -131,7 +131,8 @@ create table mysql_test.t1(f1 int);
create table mysql_test.`#sql-347f_7` (f1 int);
create table mysql_test.`#sql-347f_8` (f1 int);
drop table mysql_test.`#sql-347f_8`;
-copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm;
+let $MYSQLD_DATADIR= `select @@datadir`;
+copy_file $MYSQLD_DATADIR/mysql_test/t1.frm $MYSQLD_DATADIR/mysql_test/#sql-347f_6.frm;
drop database mysql_test;
###########################################################################
@@ -148,17 +149,18 @@ DROP DATABASE IF EXISTS mysql_test;
CREATE DATABASE mysql_test;
---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm
---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD
---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI
+let $MYSQLD_DATADIR= `select @@datadir`;
+--copy_file $MYSQLD_DATADIR/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm
+--copy_file $MYSQLD_DATADIR/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD
+--copy_file $MYSQLD_DATADIR/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI
DROP TABLE mysql.proc;
DROP DATABASE mysql_test;
---copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
---copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD
---copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI
+--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm $MYSQLD_DATADIR/mysql/proc.frm
+--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD $MYSQLD_DATADIR/mysql/proc.MYD
+--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI $MYSQLD_DATADIR/mysql/proc.MYI
--echo
--echo # --
diff --git a/mysql-test/t/error_simulation-master.opt b/mysql-test/t/error_simulation-master.opt
deleted file mode 100644
index edb77cfa85e..00000000000
--- a/mysql-test/t/error_simulation-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=d,raise_error
diff --git a/mysql-test/t/error_simulation.test b/mysql-test/t/error_simulation.test
index 2f6ea5eac87..f730c95208e 100644
--- a/mysql-test/t/error_simulation.test
+++ b/mysql-test/t/error_simulation.test
@@ -21,10 +21,15 @@ INSERT INTO t1 VALUES
set tmp_table_size=1024;
+# Set debug flag so an error is returned when
+# tmp table in query is converted from heap to myisam
+set session debug="d,raise_error";
+
--replace_regex /in table '[^']+'/in table 'tmp_table'/
--error ER_DUP_KEY
SELECT MAX(a) FROM t1 GROUP BY a,b;
set tmp_table_size=default;
-
DROP TABLE t1;
+
+
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index e86734c167c..69e2f681aa2 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -1,40 +1,133 @@
#### t/events_bugs.test
#
# Last change:
-# 2008-10-16 mleich
+# 2009-01-08 mleich
# - Fix for
-# Bug#39848 events_bugs fails sporadically on pushbuild
-# (missing rows in table event_log)
-# Bug#39863 events_bugs fails sporadically on pushbuild (extra processes
-# in I_S.PROCESSLIST)
-# Bug#39978 main.events_bugs does not clean up
-# Bug#39569 events_bugs fails sporadically on pushbuild (should have
-# failed with errno 1539)
-# - Minor improvements of formatting
-#
-#
-# Outcome of some experiments (mleich):
-# 1. SET GLOBAL event_scheduler = 'ON';
-# Immediate observation of the processlist.
-# Effects:
-# 1. There is no guarantee to find immediate the user 'event_scheduler'
-# within information_schema.processlist.
-# 2. Some states of the user 'event_scheduler' found in PROCESSLIST:
-# USER HOST DB COMMAND TIME STATE INFO
-# event_scheduler localhost NULL Daemon 0 Waiting on empty queue NULL
-# event_scheduler localhost NULL Daemon 0 Initialized NULL
+# Bug#41111 events_bugs fails sporadically on pushbuild
+# - Avoid effects of
+# Bug#41925 Warning 1366 Incorrect string value: ... for column processlist.info
+#
+# Please set $
+let $fixed_bug41925= 0;
+#
+# Dear maintainer of this test. Please do NOT remove the next big comment.
+# The tests for events were quite unstable over a significant time because the
+# effects of events in general and their representation within the processlist
+# were partially not known. Therefore I had to make excessive experiments.
+# The comment with the outcome of these experiments will be moved into a README
+# file as soon as the tests for events get their own testsuite.
+#
+# Outcome of some experiments (mleich, mysql-5.1 2008-12):
+# --------------------------------------------------------
+# 0. Most time used setup:
+# High parallel I/O load
+# set global event_scheduler= off;
+# sleep 3;
+# use events_test;
+# create event e_16407 on schedule every 2 second do
+# begin
+# select 'FIRST COMMAND', sleep(0.5);
+# select 'SECOND COMMAND';
+# end|
+# set global event_scheduler= on;
+# Start observation of the processlist
+#
+#
+# 1. SET GLOBAL event_scheduler = 'ON' and immediate observation of the processlist.
+# 1.1 Effects around event scheduler:
+# 1.1.1 First phase (very short)
+# No user 'event_scheduler' within information_schema.processlist.
+# 1.1.2 Second phase observed (independend of probably existing events and very short) was
+# USER HOST DB COMMAND TIME STATE INFO
+# event_scheduler localhost NULL Daemon 0 Initialized NULL
+# 1.1.3 Third phase observed:
+# 1.1.3.1 Case we do not have existing events (rather long)
+# USER HOST DB COMMAND TIME STATE INFO
+# event_scheduler localhost NULL Daemon 0 Waiting on empty queue NULL
+# 1.1.3.2 Case there exists already an event
+# 1.1.3.2.1 Event executor is not visible in processlist but comes up soon
+# USER HOST DB COMMAND TIME STATE INFO
+# event_scheduler localhost NULL Daemon 0 NULL
+# or
+# event_scheduler localhost NULL Daemon 0 NULL NULL
+# 1.1.3.2.2 A bit later, at least one event executor is or was visible in processlist
+# The states mentioned in 3.2.1 or a bit later
+# USER HOST DB COMMAND TIME STATE INFO
+# event_scheduler localhost NULL Daemon 0 Waiting for next activation NULL
+# 1.2 Effects around event executor:
+# Typical processlist content:
+# USER evtest1 -- Definer of event
+# DB events_test -- DB during time of event creation (use DB is not allowed in events)
+# COMMAND Connect
+# STATE NULL
+# INFO SET @evname = 'ev_sched_1823' -- Part of the event code
+#
+# State before "User sleep select 'FIRST COMMAND', sleep(0.5);"
+# ID USER HOST DB COMMAND TIME STATE INFO
+# 7 event_scheduler localhost NULL Connect 0 NULL NULL
+# !! The user is not the event creator and the DB is different. !!
+# !! This means that we must get later a change of the identity. !!
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 checking permissions
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 checking permissions CREATE PROCEDURE ....
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 NULL select 'FIRST COMMAND', sleep(0.5)
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 checking permissions select 'FIRST COMMAND'...
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 Opening table select 'FIRST COMMAND', sleep(0.5)
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 Locked select 'FIRST COMMAND', sleep(0.5)
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 executing select 'FIRST COMMAND', sleep(0.5)
+#
+# State "User sleep select 'FIRST COMMAND', sleep(0.5);" reached
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 User sleep select 'FIRST COMMAND', sleep(0.5)
+#
+# State at end (! It looks like a slow CREATE PROC !) of event code execution was sometimes
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 logging slow query CREATE PROCEDURE `e_16407`...
+#
+# State after running some event code was sometimes
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 logging slow query select 'SECOND COMMAND'
+#
+# State somewhere (I guess just before the event executor disappears)
+# USER HOST DB COMMAND TIME STATE INFO
+# Event thread fin <empty> events_test Connect 0 Clearing NULL
+#
+#
# 2. SET GLOBAL event_scheduler = 'OFF';
# Immediate observation of the processlist.
# Effects:
# 1. I never found the user 'event_scheduler' within the processlist.
# 2. Events just during execution could be found within the processlist
# = It does not look like "SET GLOBAL event_scheduler = 'OFF'" stops them.
-# 3. An event gets executed
-# USER evtest1 (Definer of event)
-# DB events_test (DB during time of event creation)
-# COMMAND Connect
-# STATE NULL
-# INFO SET @evname = 'ev_sched_1823' (Part of the event code)
+# ==> Everything mentioned in 1.2 above could be observed.
+#
+# Several subtests were weak because they showed random result set differences after issuing
+# "SET GLOBAL EVENT_SCHEDULER= off;".
+# 1. Reason one: There were already event executors
+# Fix: Wait till there is no event executor active ==> no session WHERE
+# - command IN ('Connect')
+# There must be no parallel session being just in "Connect" phase!
+# or
+# - user = <who created the maybe current running events>
+# There must be no parallel session of this person.
+# or user = 'event_scheduler' with command = 'Connect'
+# The session which will soon change its identity to event creator.
+#
+# 2. Reason two: If an event modifies a MyISAM table than a delayed visibilty of changes
+# might occur (concurrent_inserts=on or delayed inserts ...).
#
# Can't test with embedded server that doesn't support grants
@@ -47,6 +140,10 @@ drop database if exists mysqltest_db2;
--enable_warnings
create database events_test;
use events_test;
+# We use MyISAM tables and must avoid effects (visibility of changes might be
+# delayed) caused by concurrent_insert on (default).
+set @concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert = 0;
#
# START: Bug #31332 --event-scheduler option misbehaving
@@ -56,8 +153,11 @@ use events_test;
# option with no argument in events_bugs-master.opt turns the scheduler on.
select * from information_schema.global_variables where variable_name like 'event_scheduler';
+# Check that the event_scheduler is really running
+--source include/running_event_scheduler.inc
SET GLOBAL event_scheduler = 'OFF';
+--source include/check_events_off.inc
#
# END: Bug #31332
@@ -132,8 +232,10 @@ create event e_55 on schedule every 10 hour starts 10000101000000 do drop table
# Start - 16407: Events: Changes in sql_mode won't be taken into account
#
set global event_scheduler=off;
+--source include/check_events_off.inc
delete from mysql.event;
set global event_scheduler= on;
+--source include/running_event_scheduler.inc
set @old_sql_mode:=@@sql_mode;
set sql_mode=ansi;
select get_lock('test_bug16407', 60);
@@ -148,13 +250,13 @@ delimiter ;|
# We wait till one event runs and hangs when trying to get the user lock.
let $wait_condition=
select count(*) > 0 from information_schema.processlist
- where info = 'select get_lock(\'test_bug16407\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)';
--source include/wait_condition.inc
--echo "Now if everything is fine the event has compiled and is locked"
# Expect to see one session in events_test waiting for the user lock.
select /*1*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'test_bug16407\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)';
select release_lock('test_bug16407');
# Try to avoid
# Bug#39863 events_bugs fails sporadically on pushbuild (extra processes in I_S.PROCESSLIST)
@@ -162,23 +264,27 @@ select release_lock('test_bug16407');
# Bug#32782 User lock hash fails to find lock
# "various issues related to missing or incorrect return results
# from release_lock()."
-# Therefore we check here if the event executing session disappeared or
+# Therefore we check here if the event executor is no more locked or
# we waited >= 5 seconds for this to happen.
let $wait_timeout= 5;
let $wait_condition=
select count(*) = 0 from information_schema.processlist
- where info = 'select get_lock(\'test_bug16407\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)';
--source include/wait_condition.inc
if (!`$wait_condition`)
{
- --echo ERROR: There must be no session with info = 'select get_lock('test_bug16407', 60) within the processlist.
+ --echo ERROR: There must be no session with
+ --echo state = 'User lock' and info = 'select get_lock('test_bug16407', 60)
+ --echo within the processlist.
--echo We probably hit Bug#32782 User lock hash fails to find lock
- eval select * from information_schema.processlist;
+ SELECT * FROM information_schema.processlist;
--echo Abort
exit;
}
set global event_scheduler= off;
+# Wait till the event scheduler and all event executors have finished their work.
+--source include/check_events_off.inc
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
--echo "Let's check whether we change the sql_mode on ALTER EVENT"
@@ -191,9 +297,10 @@ set sql_mode="ansi";
select get_lock('ee_16407_2', 60);
set global event_scheduler= 1;
+--source include/running_event_scheduler.inc
--echo "Another sql_mode test"
set sql_mode="traditional";
-create table events_smode_test(ev_name char(10), a date) engine=myisam;
+create table events_smode_test(ev_name char(10), a date);
--echo "This should never insert something"
delimiter |;
create event ee_16407_2 on schedule every 60 second do
@@ -203,7 +310,7 @@ begin
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
end|
--error ER_TRUNCATED_WRONG_VALUE
-insert into events_smode_test values ('test','1980-19-02')|
+insert into events_test.events_smode_test values ('test','1980-19-02')|
--echo "This is ok"
create event ee_16407_3 on schedule every 60 second do
begin
@@ -223,13 +330,20 @@ end|
delimiter ;|
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
+# We wait till we have three event executors waiting for the removal of the lock.
let $wait_condition=
select count(*) = 3 from information_schema.processlist
- where info = 'select get_lock(\'ee_16407_2\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
--source include/wait_condition.inc
+# There is an extreme low risk that an additional event execution is just coming
+# up because
+# - the events have to be started every 60 seconds.
+# - we are just after event creation + waiting for seeing 3 locked
+# We expect to see three event executors in state 'User lock'.
select /*2*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'ee_16407_2\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
+
select release_lock('ee_16407_2');
# Try to avoid
@@ -244,13 +358,37 @@ let $wait_timeout= 5;
let $wait_condition=
select count(*) = 0
from information_schema.processlist
- where info = 'select get_lock(\'ee_16407_2\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
--source include/wait_condition.inc
+if (!`$wait_condition`)
+{
+ --echo ERROR: There must be no session with
+ --echo state = 'User lock' and info = 'select get_lock('test_bug16407_2', 60)
+ --echo within the processlist.
+ --echo We probably hit Bug#32782 User lock hash fails to find lock
+ SELECT * FROM information_schema.processlist;
+ --echo Abort
+ exit;
+}
+# We expect to see no event executors in state 'User lock'.
+if(!$fixed_bug41925)
+{
+ --disable_warnings
+}
select /*3*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'ee_16407_2\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
+if(!$fixed_bug41925)
+{
+ --enable_warnings
+}
+
set global event_scheduler= off;
-select * from events_smode_test order by ev_name, a;
+# Wait till the event scheduler and all event executors have finished their work.
+# Without this the next queries will give unstable results.
+--source include/check_events_off.inc
+
+select * from events_test.events_smode_test order by ev_name, a;
--echo "OK, last check before we drop them"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
drop event ee_16407_2;
@@ -259,11 +397,12 @@ drop event ee_16407_4;
--echo "And now one last test regarding sql_mode and call of SP from an event"
-delete from events_smode_test;
+delete from events_test.events_smode_test;
set sql_mode='ansi';
select get_lock('ee_16407_5', 60);
set global event_scheduler= on;
+--source include/running_event_scheduler.inc
set sql_mode='traditional';
delimiter |;
@@ -286,34 +425,46 @@ delimiter ;|
let $wait_condition=
select count(*) = 2 from information_schema.processlist
- where info = 'select get_lock(\'ee_16407_5\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
--source include/wait_condition.inc
--echo "Should have 2 locked processes"
select /*4*/ user, host, db, info from information_schema.processlist
-where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
-order by info;
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
+
select release_lock('ee_16407_5');
let $wait_condition=
- select count(*) = 1 and user = 'event_scheduler' and info is null
- from information_schema.processlist
- where (command!='Daemon' || user='event_scheduler')
- and (info is null or info not like '%processlist%');
+ select count(*) = 0 from information_schema.processlist
+ where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
--source include/wait_condition.inc
--echo "Should have 0 processes locked"
+if(!$fixed_bug41925)
+{
+ --disable_warnings
+}
select /*5*/ user, host, db, info from information_schema.processlist
-where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
-order by info;
-select * from events_smode_test order by ev_name, a;
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
+if(!$fixed_bug41925)
+{
+ --enable_warnings
+}
+
+# Wait till all event executors have finished their work, so that we can be sure
+# that their changes to events_smode_test are done.
+--source include/no_running_events.inc
+
+select * from events_test.events_smode_test order by ev_name, a;
--echo "And here we check one more time before we drop the events"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
+
drop event ee_16407_5;
drop event ee_16407_6;
drop procedure ee_16407_5_pendant;
drop procedure ee_16407_6_pendant;
set global event_scheduler= off;
+--source include/check_events_off.inc
drop table events_smode_test;
set sql_mode=@old_sql_mode;
#
@@ -324,6 +475,7 @@ set sql_mode=@old_sql_mode;
# START - 18897: Events: unauthorized action possible with alter event rename
#
set global event_scheduler=off;
+--source include/check_events_off.inc
--disable_warnings
delete from mysql.user where User like 'mysqltest_%';
delete from mysql.db where User like 'mysqltest_%';
@@ -409,6 +561,7 @@ create function f22830 () returns int return 5;
select get_lock('ee_22830', 60);
set global event_scheduler=on;
+--source include/running_event_scheduler.inc
delimiter |;
create procedure p22830_wait()
@@ -456,6 +609,7 @@ let $wait_condition=
--source include/wait_condition.inc
set global event_scheduler=off;
+--source include/check_events_off.inc
select event_name, event_definition, interval_value, interval_field from information_schema.events order by event_name;
drop procedure p22830_wait;
drop function f22830;
@@ -537,6 +691,7 @@ DROP USER mysqltest_u1@localhost;
# For the actual tests of time zones please see events_time_zone.test
#
SET GLOBAL EVENT_SCHEDULER= OFF;
+--source include/check_events_off.inc
SET @save_time_zone= @@TIME_ZONE;
#----------------------------------------------------------------------
@@ -749,6 +904,7 @@ let $engine=MyISAM;
USE test;
SHOW GRANTS FOR CURRENT_USER;
SET GLOBAL event_scheduler = ON;
+--source include/running_event_scheduler.inc
eval
CREATE TABLE events_test.event_log
(id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp)
@@ -817,12 +973,14 @@ disconnect e1;
DROP EVENT events_test.ev_sched_1823;
DROP TABLE events_test.event_log;
SET GLOBAL event_scheduler = OFF;
+--source include/check_events_off.inc
#
# Bug#28641 CREATE EVENT with '2038.01.18 03:00:00' let server crash.
#
SET GLOBAL event_scheduler= ON;
+--source include/running_event_scheduler.inc
DELIMITER |;
CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00'
DO BEGIN
@@ -831,6 +989,7 @@ END;|
DELIMITER ;|
SET GLOBAL event_scheduler= OFF;
+--source include/check_events_off.inc
DROP EVENT bug28641;
###########################################################################
@@ -955,6 +1114,7 @@ SET GLOBAL READ_ONLY = 1;
--echo
SET GLOBAL EVENT_SCHEDULER = ON;
+--source include/running_event_scheduler.inc
--echo
@@ -980,6 +1140,7 @@ let $wait_condition =
--echo
SET GLOBAL EVENT_SCHEDULER = OFF;
+--source include/check_events_off.inc
--echo
@@ -1056,14 +1217,15 @@ drop event e1;
#
###########################################################################
-let $wait_condition=
- select count(*) = 0 from information_schema.processlist
- where db='events_test' and command = 'Connect' and user=current_user();
---source include/wait_condition.inc
+# Ensure that all event executors have finished their work and cannot harm
+# the next test.
+--source include/no_running_events.inc
DROP DATABASE events_test;
-# Restore the original state (option with no argument in events_bugs-master.opt
-# turns the scheduler on).
-SET GLOBAL event_scheduler = 'ON';
+# Restore the original state i.e to how it was when test started
+# (option with no argument in events_bugs-master.opt turns the scheduler on).
+SET GLOBAL event_scheduler= 'ON';
+--source include/running_event_scheduler.inc
+SET @@global.concurrent_insert= @concurrent_insert;
# THIS MUST BE THE LAST LINE in this file.
diff --git a/mysql-test/t/events_restart-master.opt b/mysql-test/t/events_restart-master.opt
new file mode 100644
index 00000000000..f93413a61e5
--- /dev/null
+++ b/mysql-test/t/events_restart-master.opt
@@ -0,0 +1 @@
+--event-scheduler
diff --git a/mysql-test/t/events_restart.test b/mysql-test/t/events_restart.test
new file mode 100644
index 00000000000..e155fe2ea16
--- /dev/null
+++ b/mysql-test/t/events_restart.test
@@ -0,0 +1,106 @@
+# Can't test with embedded server that doesn't support grants
+-- source include/not_embedded.inc
+
+#
+# Test that when the server is restarted, it checks mysql.event table,
+# and disables the scheduler if it's not up to date.
+#
+
+# Switch off the scheduler for now.
+set global event_scheduler=off;
+
+--disable_warnings
+drop database if exists events_test;
+--enable_warnings
+create database events_test;
+use events_test;
+create table execution_log(name char(10));
+
+create event abc1 on schedule every 1 second do
+ insert into execution_log value('abc1');
+create event abc2 on schedule every 1 second do
+ insert into execution_log value('abc2');
+create event abc3 on schedule every 1 second do
+ insert into execution_log value('abc3');
+#
+# There are various conditions when a server would regard mysql.event
+# table as damaged:
+# - the table has more column than specified in the compiled in value, but
+# the version of the server which created the table is the same
+# - the column count in the table is less than the compiled in value
+# - some column has an incompatible type specification (for what is an
+# incompatible type specification please refer to the comments in the source
+#
+# Unfortunately, in order to test a condition, we need to restart the
+# server. Therefore, here we test only one simple case: changing the data
+# type of the 'body' field to blob.
+#
+# First, let's do a backup to not depend on actual definition of mysql.event
+create table event_like like mysql.event;
+insert into event_like select * from mysql.event;
+# Now let's alter the table and restart the server
+alter table mysql.event
+ change column body body longtext character set utf8 collate utf8_bin;
+--echo "Now we restart the server"
+
+--source include/restart_mysqld.inc
+
+use events_test;
+# Event scheduler should be disabled: the system tables are damaged
+select @@event_scheduler;
+# Try various Event Scheduler operation and check the output.
+--error ER_EVENTS_DB_ERROR
+show events;
+--error ER_EVENTS_DB_ERROR
+select event_name from information_schema.events;
+--error ER_EVENTS_DB_ERROR
+show create event intact_check;
+--error ER_EVENTS_DB_ERROR
+drop event no_such_event;
+--error ER_EVENTS_DB_ERROR
+create event intact_check_1 on schedule every 5 hour do select 5;
+--error ER_EVENTS_DB_ERROR
+alter event intact_check_1 on schedule every 8 hour do select 8;
+--error ER_EVENTS_DB_ERROR
+alter event intact_check_1 rename to intact_check_2;
+--error ER_EVENTS_DB_ERROR
+drop event intact_check_1;
+--error ER_EVENTS_DB_ERROR
+drop event intact_check_2;
+--error ER_EVENTS_DB_ERROR
+drop event intact_check;
+--error ER_EVENTS_DB_ERROR
+set global event_scheduler=on;
+--error ER_EVENTS_DB_ERROR
+set global event_scheduler=off;
+show variables like 'event_scheduler';
+--echo Make sure that we still can create and drop databases,
+--echo and no warnings are produced.
+drop database if exists mysqltest_database_not_exists;
+create database mysqltest_db1;
+drop database mysqltest_db1;
+--echo Restore the original mysql.event table
+drop table mysql.event;
+rename table event_like to mysql.event;
+--echo Now let's restart the server again
+
+--source include/restart_mysqld.inc
+
+# We need this file primarily to make sure that the scheduler is restarted
+# and enabled after we have restored mysql.event table.
+# This is the final step of the "cleanup".
+#
+# Make sure also that events are executed OK after restart, just in case.
+use events_test;
+# Make sure the scheduler was started successfully
+select @@event_scheduler;
+let $wait_condition=select count(distinct name)=3 from execution_log;
+--source include/wait_condition.inc
+drop table execution_log;
+# Will drop all events
+drop database events_test;
+
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
diff --git a/mysql-test/t/events_restart_phase1.test b/mysql-test/t/events_restart_phase1.test
deleted file mode 100644
index 6a94ef12222..00000000000
--- a/mysql-test/t/events_restart_phase1.test
+++ /dev/null
@@ -1,43 +0,0 @@
-# Can't test with embedded server that doesn't support grants
--- source include/not_embedded.inc
-#
-# Test that when the server is restarted, it checks mysql.event table,
-# and disables the scheduler if it's not up to date.
-#
-
-# Switch off the scheduler for now.
-set global event_scheduler=off;
-
---disable_warnings
-drop database if exists events_test;
---enable_warnings
-create database events_test;
-use events_test;
-create table execution_log(name char(10));
-
-create event abc1 on schedule every 1 second do
- insert into execution_log value('abc1');
-create event abc2 on schedule every 1 second do
- insert into execution_log value('abc2');
-create event abc3 on schedule every 1 second do
- insert into execution_log value('abc3');
-#
-# There are various conditions when a server would regard mysql.event
-# table as damaged:
-# - the table has more column than specified in the compiled in value, but
-# the version of the server which created the table is the same
-# - the column count in the table is less than the compiled in value
-# - some column has an incompatible type specification (for what is an
-# incompatible type specification please refer to the comments in the source
-#
-# Unfortunately, in order to test a condition, we need to restart the
-# server. Therefore, here we test only one simple case: changing the data
-# type of the 'body' field to blob.
-#
-# First, let's do a backup to not depend on actual definition of mysql.event
-create table event_like like mysql.event;
-insert into event_like select * from mysql.event;
-# Now let's alter the table and restart the server
-alter table mysql.event
- change column body body longtext character set utf8 collate utf8_bin;
---echo "Now we restart the server"
diff --git a/mysql-test/t/events_restart_phase2-master.opt b/mysql-test/t/events_restart_phase2-master.opt
deleted file mode 100644
index 673e87f4357..00000000000
--- a/mysql-test/t/events_restart_phase2-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---event-scheduler=on
diff --git a/mysql-test/t/events_restart_phase2.test b/mysql-test/t/events_restart_phase2.test
deleted file mode 100644
index c3f799634b3..00000000000
--- a/mysql-test/t/events_restart_phase2.test
+++ /dev/null
@@ -1,41 +0,0 @@
-# Can't test with embedded server that doesn't support grants
--- source include/not_embedded.inc
-
-use events_test;
-# Event scheduler should be disabled: the system tables are damaged
-select @@event_scheduler;
-# Try various Event Scheduler operation and check the output.
---error ER_EVENTS_DB_ERROR
-show events;
---error ER_EVENTS_DB_ERROR
-select event_name from information_schema.events;
---error ER_EVENTS_DB_ERROR
-show create event intact_check;
---error ER_EVENTS_DB_ERROR
-drop event no_such_event;
---error ER_EVENTS_DB_ERROR
-create event intact_check_1 on schedule every 5 hour do select 5;
---error ER_EVENTS_DB_ERROR
-alter event intact_check_1 on schedule every 8 hour do select 8;
---error ER_EVENTS_DB_ERROR
-alter event intact_check_1 rename to intact_check_2;
---error ER_EVENTS_DB_ERROR
-drop event intact_check_1;
---error ER_EVENTS_DB_ERROR
-drop event intact_check_2;
---error ER_EVENTS_DB_ERROR
-drop event intact_check;
---error ER_EVENTS_DB_ERROR
-set global event_scheduler=on;
---error ER_EVENTS_DB_ERROR
-set global event_scheduler=off;
-show variables like 'event_scheduler';
---echo Make sure that we still can create and drop databases,
---echo and no warnings are produced.
-drop database if exists mysqltest_database_not_exists;
-create database mysqltest_db1;
-drop database mysqltest_db1;
---echo Restore the original mysql.event table
-drop table mysql.event;
-rename table event_like to mysql.event;
---echo Now let's restart the server again
diff --git a/mysql-test/t/events_restart_phase3-master.opt b/mysql-test/t/events_restart_phase3-master.opt
deleted file mode 100644
index 656b9e1b017..00000000000
--- a/mysql-test/t/events_restart_phase3-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---event-scheduler=1
diff --git a/mysql-test/t/events_restart_phase3.test b/mysql-test/t/events_restart_phase3.test
deleted file mode 100644
index 04d879e50ec..00000000000
--- a/mysql-test/t/events_restart_phase3.test
+++ /dev/null
@@ -1,21 +0,0 @@
-# Can't test with embedded server that doesn't support grants
--- source include/not_embedded.inc
-#
-# We need this file primarily to make sure that the scheduler is restarted
-# and enabled after we have restored mysql.event table.
-# This is the final step of the "cleanup".
-#
-# Make sure also that events are executed OK after restart, just in case.
-use events_test;
-# Make sure the scheduler was started successfully
-select @@event_scheduler;
-let $wait_condition=select count(distinct name)=3 from execution_log;
---source include/wait_condition.inc
-drop table execution_log;
-# Will drop all events
-drop database events_test;
-
-let $wait_condition=
- select count(*) = 0 from information_schema.processlist
- where db='events_test' and command = 'Connect' and user=current_user();
---source include/wait_condition.inc
diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test
index 87cfa42e283..041a2def490 100644
--- a/mysql-test/t/events_scheduling.test
+++ b/mysql-test/t/events_scheduling.test
@@ -58,8 +58,6 @@ ON COMPLETION PRESERVE
DO
INSERT INTO table_4 VALUES (1);
-# Wait for the events to fire and check the data afterwards
-
# Let event_1 insert at least 4 records into the table
let $wait_condition=select count(*) >= 4 from table_1;
--source include/wait_condition.inc
@@ -85,25 +83,13 @@ let $wait_condition=select count(*) = 0 from information_schema.events
where event_name='event_4' and status='enabled';
--source include/wait_condition.inc
-let $wait_condition=SELECT SUM(a) >= 4 FROM table_1;
-source include/wait_condition.inc;
-SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
-
-# In case of a testing box under heavy load it cannot be guaranteed that
-# it is really often enough checked if event_2 has to be executed.
-# -> Bug#39854 events_scheduling fails sporadically on pushbuild
-# Therefore we lowered here the original expectation of 5 to 4.
-let $wait_condition=SELECT SUM(a) >= 4 FROM table_2;
-source include/wait_condition.inc;
-SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2;
-
-let $wait_condition=SELECT SUM(a) >= 1 FROM table_3;
-source include/wait_condition.inc;
-SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
-
-let $wait_condition=SELECT SUM(a) >= 1 FROM table_4;
-source include/wait_condition.inc;
-SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4;
+#
+# On a busy system the scheduler may skip execution of events,
+# we can't reliably expect that the data in a table to be modified
+# by an event will be exact. Thus we do not SELECT from the tables
+# in this test. See also
+# Bug#39854 events_scheduling fails sporadically on pushbuild
+#
SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test
index 4930164d3fa..e61d79f5249 100644
--- a/mysql-test/t/execution_constants.test
+++ b/mysql-test/t/execution_constants.test
@@ -41,12 +41,19 @@ while ($i)
error 0,1436 //
eval $query_head 0 $query_tail//
- if ($mysql_errno != 1436)
+ if ($mysql_errno)
{
# We reached the place where we reported an error about the stack limit,
# and we successfully returned the error. That means that at the stack
# limit, we still have enough space reserved to report an error.
let $i = 1//
+
+ # Check that mysql_errno is 1436
+ if (`select $mysql_errno != 1436`)
+ {
+ die Wrong error triggered, expected 1436 but got $mysql_errno//
+ }
+
}
# Multiplying by three stack frames should be fine enough resolution.
diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test
index 3051fd88076..c7cd500f8d2 100644
--- a/mysql-test/t/fix_priv_tables.test
+++ b/mysql-test/t/fix_priv_tables.test
@@ -51,7 +51,8 @@ echo;
-- disable_query_log
# Run the mysql_fix_privilege_tables.sql using "mysql --force"
---exec $MYSQL --force mysql < $MYSQL_FIX_PRIVILEGE_TABLES > $MYSQLTEST_VARDIR/log/fix_priv_tables.log 2>&1
+--exec $MYSQL --force mysql < $MYSQL_FIX_PRIVILEGE_TABLES > $MYSQLTEST_VARDIR/tmp/fix_priv_tables.log 2>&1
+--remove_file $MYSQLTEST_VARDIR/tmp/fix_priv_tables.log
-- enable_query_log
-- enable_result_log
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 21b06ca0882..852369fd568 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -445,3 +445,12 @@ EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
DROP TABLE t1;
+
+#
+# BUG#37245 - Full text search problem
+#
+CREATE TABLE t1(a CHAR(10));
+INSERT INTO t1 VALUES('aaa15');
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1;
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/fulltext_plugin-master.opt b/mysql-test/t/fulltext_plugin-master.opt
new file mode 100644
index 00000000000..a2554caa20b
--- /dev/null
+++ b/mysql-test/t/fulltext_plugin-master.opt
@@ -0,0 +1 @@
+$SIMPLE_PARSER_OPT
diff --git a/mysql-test/t/fulltext_plugin.test b/mysql-test/t/fulltext_plugin.test
new file mode 100644
index 00000000000..31978dadc51
--- /dev/null
+++ b/mysql-test/t/fulltext_plugin.test
@@ -0,0 +1,10 @@
+--source include/have_simple_parser.inc
+
+#
+# BUG#39746 - Debug flag breaks struct definition (server crash)
+#
+INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
+CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
+ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
+DROP TABLE t1;
+UNINSTALL PLUGIN simple_parser;
diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test
index 7f17fd2180f..0a3a3823fee 100644
--- a/mysql-test/t/func_compress.test
+++ b/mysql-test/t/func_compress.test
@@ -49,6 +49,9 @@ set @@global.max_allowed_packet=1048576*100;
# reconnect to make the new max packet size take effect
--connect (newconn, localhost, root,,)
eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null;
+disconnect newconn;
+connection default;
+set @@global.max_allowed_packet=default;
#
# Bug #18643: problem with null values
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 8da10f36cbe..4efea8e195e 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -150,4 +150,18 @@ FROM t1;
DROP TABLE t1;
+#
+# Bug #40761: Assert on sum func on IF(..., CAST(longtext AS UNSIGNED), signed)
+# (was: LEFT JOIN on inline view crashes server)
+#
+
+CREATE TABLE t1 (c LONGTEXT);
+INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890');
+
+SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
+SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
+
+DROP TABLE t1;
+
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index d0d4dea0713..3fc1697f146 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -426,4 +426,17 @@ select * from t1 where NOT id in (select null union all select 1);
select * from t1 where NOT id in (null, 1);
drop table t1;
+#
+# Bug #41363: crash of mysqld on windows with aggregate in case
+#
+
+CREATE TABLE t1(c0 INTEGER, c1 INTEGER, c2 INTEGER);
+INSERT INTO t1 VALUES(1, 1, 1), (1, 1, 1);
+
+SELECT CASE AVG (c0) WHEN c1 * c2 THEN 1 END FROM t1;
+SELECT CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END FROM t1;
+SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 61bf285c364..eb243d38238 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -445,6 +445,15 @@ select @my_uuid_date - @my_uuid_synthetic;
set @@session.time_zone=@save_tz;
+
+#
+# Bug#42014: Crash, name_const with collate
+#
+CREATE TABLE t1 (a DATE);
+SELECT * FROM t1 WHERE a = NAME_CONST('reportDate',
+ _binary'2009-01-09' COLLATE 'binary');
+DROP TABLE t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index f37ee0c39f0..1292c475732 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -151,4 +151,22 @@ select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00');
SELECT CAST(time('-73:42:12') AS DECIMAL);
+
+#
+# Bug#42525 - TIMEDIFF function
+#
+
+SELECT TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1Eq,
+ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq1,
+ TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq2,
+ TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))= '00:00:00' AS 2Eq,
+ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq1,
+ TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq2,
+ TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME(0) AS 3Eq,
+ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME(0) AS 3NEq1,
+ TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME(0) AS 3NEq2,
+ TIME(0) AS Time0, TIME('00:00:00') AS Time00, '00:00:00' AS Literal0000,
+ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')),
+ TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'));
+
# End of 5.0 tests
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 5a5f4024bc4..5d77c678d52 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1263,4 +1263,14 @@ CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
SELECT HEX(c1) from v1;
DROP VIEW v1;
+#
+# Bug #35558 Wrong server metadata blows up the client
+#
+create table t1(a float);
+insert into t1 values (1.33);
+--enable_metadata
+select format(a, 2) from t1;
+--disable_metadata
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index c417e9a02bf..b9da946a55f 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -304,6 +304,15 @@ select unix_timestamp('1970-01-01 03:00:01');
# check bad date, close to the boundary (we cut them off in the very end)
select unix_timestamp('2038-01-19 07:14:07');
+#
+# Bug #28759: DAYNAME() and MONTHNAME() return binary string
+#
+
+SELECT CHARSET(DAYNAME(19700101));
+SELECT CHARSET(MONTHNAME(19700101));
+SELECT LOWER(DAYNAME(19700101));
+SELECT LOWER(MONTHNAME(19700101));
+SELECT COERCIBILITY(MONTHNAME('1970-01-01')),COERCIBILITY(DAYNAME('1970-01-01'));
#
# Test types from + INTERVAL
@@ -606,6 +615,7 @@ select time_format('100:00:00', '%H %k %h %I %l');
# Bug #12562: Make SYSDATE behave like it does in Oracle: always the current
# time, regardless of magic to make NOW() always the same for the
# entirety of a statement.
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (a timestamp default '2005-05-05 01:01:01',
@@ -656,6 +666,7 @@ end;
delimiter ;//
call t_sysdate();
drop procedure t_sysdate;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
#
# Bug #13534: timestampdiff() returned incorrect results across leap years
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index e6b8b91783c..f8b8b0e17a7 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -386,7 +386,7 @@ drop table t1;
create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
alter table t1 disable keys;
--error 1263
-load data infile '../std_data_ln/bad_gis_data.dat' into table t1;
+load data infile '../../std_data/bad_gis_data.dat' into table t1;
alter table t1 enable keys;
drop table t1;
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 3fac767468e..a9491dc2736 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -3,6 +3,7 @@
# Grant tests not performed with embedded server
-- source include/not_embedded.inc
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
# Cleanup
@@ -1294,6 +1295,13 @@ drop view v1;
drop table test;
drop function test_function;
+#
+# Bug#41456 SET PASSWORD hates CURRENT_USER()
+#
+SELECT CURRENT_USER();
+SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
+SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
+
--echo End of 5.0 tests
#
@@ -1468,4 +1476,4 @@ use test;
DROP DATABASE dbbug33464;
---echo End of 5.1 tests
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index d91592f6bb6..54cdf8d6cc1 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -1,6 +1,10 @@
# Grant tests not performed with embedded server
-- source include/not_embedded.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+
SET NAMES binary;
#
@@ -27,7 +31,7 @@ create user mysqltest_2@localhost;
connect (user_a,localhost,mysqltest_1,,);
connection user_a;
grant select on `my\_1`.* to mysqltest_2@localhost;
---error 1132
+--error ER_PASSWORD_NOT_ALLOWED
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
disconnect user_a;
connection default;
@@ -61,7 +65,7 @@ connect (user1,localhost,mysqltest_1,,);
connection user1;
select current_user();
grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option;
#
@@ -72,7 +76,7 @@ select @@sql_mode;
#
# GRANT without IDENTIFIED BY does not create new users
#
---error 1133
+--error ER_PASSWORD_NO_MATCH
grant select on `my\_1`.* to mysqltest_4@localhost with grant option;
grant select on `my\_1`.* to mysqltest_4@localhost identified by 'mypass'
with grant option;
@@ -80,7 +84,7 @@ disconnect user1;
connection default;
show grants for mysqltest_1@localhost;
show grants for mysqltest_2@localhost;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for mysqltest_3@localhost;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
@@ -95,7 +99,7 @@ connect (user2,localhost,mysqltest_1,,);
connection user2;
select current_user();
show databases;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant all privileges on `mysqltest_1`.* to mysqltest_1@localhost with grant option;
disconnect user2;
connection default;
@@ -106,8 +110,8 @@ drop database mysqltest_1;
flush privileges;
#
-# Bug #6173: One can circumvent missing UPDATE privilege if he has SELECT
-# and INSERT privilege for table with primary key
+# Bug#6173 One can circumvent missing UPDATE privilege if he has SELECT and
+# INSERT privilege for table with primary key
#
create database mysqltest;
grant INSERT, SELECT on mysqltest.* to mysqltest_1@localhost;
@@ -119,10 +123,10 @@ connect (mrbad, localhost, mysqltest_1,,mysqltest);
connection mrbad;
show grants for current_user();
insert into t1 values (1, 'I can''t change it!');
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
update t1 set data='I can change it!' where id = 1;
# This should not be allowed since it too require UPDATE privilege.
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!';
select * from t1;
disconnect mrbad;
@@ -138,9 +142,9 @@ create table t1 (a int, b int);
grant select (a) on t1 to mysqltest_1@localhost with grant option;
connect (mrugly, localhost, mysqltest_1,,mysqltest);
connection mrugly;
---error 1143
+--error ER_COLUMNACCESS_DENIED_ERROR
grant select (a,b) on t1 to mysqltest_2@localhost;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
grant select on t1 to mysqltest_3@localhost;
disconnect mrugly;
@@ -157,7 +161,7 @@ use test;
#
-# Bug #15775: "drop user" command does not refresh acl_check_hosts
+# Bug#15775 "drop user" command does not refresh acl_check_hosts
#
# Create some test users
@@ -188,15 +192,15 @@ disconnect con9;
connection default;
#
-# Bug# 16180 - Setting SQL_LOG_OFF without SUPER privilege is silently ignored
+# Bug#16180 Setting SQL_LOG_OFF without SUPER privilege is silently ignored
#
create database mysqltest_1;
grant select, insert, update on `mysqltest\_1`.* to mysqltest_1@localhost;
connect (con10,localhost,mysqltest_1,,);
connection con10;
---error 1227
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
set sql_log_off = 1;
---error 1227
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
set sql_log_bin = 0;
disconnect con10;
connection default;
@@ -217,7 +221,7 @@ create table t2(c1 int, c2 int);
#
# Three forms of CREATE USER
create user 'mysqltest_1';
---error 1396
+--error ER_CANNOT_USER
create user 'mysqltest_1';
create user 'mysqltest_2' identified by 'Mysqltest-2';
create user 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff';
@@ -238,7 +242,7 @@ select host,user,password from mysql.user where user like 'mysqltest_%' order by
select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user;
select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name;
select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
#
# Rename
@@ -249,7 +253,7 @@ select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest
select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name;
show grants for 'mysqltest_1';
drop user 'mysqltest_1', 'mysqltest_3';
---error 1396
+--error ER_CANNOT_USER
drop user 'mysqltest_1';
#
# Cleanup
@@ -258,9 +262,9 @@ drop table t1, t2;
# Add a stray record
insert into mysql.db set user='mysqltest_1', db='%', host='%';
flush privileges;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
---error 1269
+--error ER_REVOKE_GRANTS
revoke all privileges, grant option from 'mysqltest_1';
drop user 'mysqltest_1';
select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,user;
@@ -268,7 +272,7 @@ select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,us
# Add a stray record
insert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1';
flush privileges;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
drop user 'mysqltest_1';
select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' order by host,db,user,table_name;
@@ -276,7 +280,7 @@ select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1'
# Add a stray record
insert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1';
flush privileges;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
drop user 'mysqltest_1';
select host,db,user,table_name,column_name from mysql.columns_priv where user = 'mysqltest_1' order by host,db,user,table_name,column_name;
@@ -286,23 +290,23 @@ create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
create user 'mysqltest_1', 'mysqltest_2' identified by 'Mysqltest-2', 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff';
rename user 'mysqltest_1' to 'mysqltest_1a', 'mysqltest_2' TO 'mysqltest_2a', 'mysqltest_3' TO 'mysqltest_3a';
---error 1396
+--error ER_CANNOT_USER
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
drop user 'mysqltest_1a', 'mysqltest_2a', 'mysqltest_3a';
#
# Let one of multiple users fail
create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
---error 1396
+--error ER_CANNOT_USER
create user 'mysqltest_1a', 'mysqltest_2', 'mysqltest_3a';
---error 1396
+--error ER_CANNOT_USER
rename user 'mysqltest_1a' to 'mysqltest_1b', 'mysqltest_2a' TO 'mysqltest_2b', 'mysqltest_3a' TO 'mysqltest_3b';
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
---error 1396
+--error ER_CANNOT_USER
drop user 'mysqltest_1b', 'mysqltest_2b', 'mysqltest_3b';
#
# Obsolete syntax has been dropped
create user 'mysqltest_2' identified by 'Mysqltest-2';
---error 1064
+--error ER_PARSE_ERROR
drop user 'mysqltest_2' identified by 'Mysqltest-2';
drop user 'mysqltest_2';
#
@@ -312,7 +316,7 @@ show grants for '%@b'@'b';
grant select on mysql.* to '%@b'@'b';
show grants for '%@b'@'b';
rename user '%@b'@'b' to '%@a'@'a';
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for '%@b'@'b';
show grants for '%@a'@'a';
drop user '%@a'@'a';
@@ -323,7 +327,7 @@ create user mysqltest_2@localhost;
grant create user on *.* to mysqltest_2@localhost;
connect (user3,localhost,mysqltest_2,,);
connection user3;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
create user mysqltest_A@'%';
rename user mysqltest_A@'%' to mysqltest_B@'%';
@@ -338,7 +342,7 @@ grant INSERT,DELETE,UPDATE on mysql.* to mysqltest_3@localhost;
connect (user4,localhost,mysqltest_3,,);
connection user4;
show grants;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
insert into mysql.user set host='%', user='mysqltest_B';
create user mysqltest_A@'%';
@@ -349,7 +353,7 @@ disconnect user4;
connection default;
drop user mysqltest_3@localhost;
#
-# Bug #3309: Test IP addresses with netmask
+# Bug#3309 Test IP addresses with netmask
set @@sql_mode='';
create database mysqltest_1;
create table mysqltest_1.t1 (i int);
@@ -367,7 +371,8 @@ flush privileges;
drop table mysqltest_1.t1;
#
-# Bug #12302: 'SET PASSWORD = ...' didn't work if connecting hostname !=
+# Bug#12302 Hostname resolution preventing password changes
+# 'SET PASSWORD = ...' didn't work if connecting hostname !=
# hostname the current user is authenticated as. Note that a test for this
# was also added to the test above.
#
@@ -400,7 +405,7 @@ drop database mysqltest_1;
# But anonymous users can't change their password
connect (n5,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection n5;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
set password = password("changed");
disconnect n5;
connection default;
@@ -408,7 +413,7 @@ connection default;
--source include/delete_anonymous_users.inc
-# Bug #12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
+# Bug#12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
# multi-threaded environment". We should be able to execute FLUSH
# PRIVILEGES and SET PASSWORD simultaneously with other account
# management commands (such as GRANT and REVOKE) without causing
@@ -471,12 +476,13 @@ connect (con1,localhost,mysqltest_1,password,TESTDB);
# The user mysqltest_1 should only be allowed access to
# database TESTDB, not TEStdb
-# On system with "lowercase names" we get error "1007: Can't create db..."
---error 1044, 1007
+# On system with "lowercase names" we get error "ER_DB_CREATE_EXISTS: Can't create db..."
+--error ER_DBACCESS_DENIED_ERROR, ER_DB_CREATE_EXISTS
create database TEStdb;
# Clean-up
connection default;
+disconnect con1;
delete from mysql.user;
delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB';
insert into mysql.user select * from t1;
@@ -485,38 +491,39 @@ drop database TESTDB;
flush privileges;
#
-# BUG#13310 incorrect user parsing by SP
+# Bug#13310 incorrect user parsing by SP
#
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
-grant all privileges on test.* to `a@`@localhost;
-grant execute on * to `a@`@localhost;
+GRANT ALL PRIVILEGES ON test.* TO `a@`@localhost;
+GRANT EXECUTE ON * TO `a@`@localhost;
connect (bug13310,localhost,'a@',,test);
connection bug13310;
-create table t2 (s1 int);
-insert into t2 values (1);
+CREATE TABLE t2 (s1 INT);
+INSERT INTO t2 VALUES (1);
--disable_warnings
-drop function if exists f2;
+DROP FUNCTION IF EXISTS f2;
--enable_warnings
delimiter //;
-create function f2 () returns int
-begin declare v int; select s1 from t2 into v; return v; end//
+CREATE FUNCTION f2 () RETURNS INT
+BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END//
delimiter ;//
-select f2();
-drop function f2;
-drop table t2;
-disconnect bug13310;
+SELECT f2();
+DROP FUNCTION f2;
+DROP TABLE t2;
+disconnect bug13310;
connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
-drop user `a@`@localhost;
+DROP USER `a@`@localhost;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
#
-# Bug#25578 "CREATE TABLE LIKE does not require any privileges on source table"
+# Bug#25578 CREATE TABLE LIKE does not require any privileges on source table
#
--disable_warnings
drop database if exists mysqltest_1;
@@ -535,7 +542,7 @@ create table t1 (i int);
connect (user1,localhost,mysqltest_u1,,mysqltest_1);
connection user1;
# As expected error is emitted
---error ER_TABLEACCESS_DENIED_ERROR
+--error ER_TABLEACCESS_DENIED_ERROR
show create table mysqltest_2.t1;
# This should emit error as well
--error ER_TABLEACCESS_DENIED_ERROR
@@ -550,14 +557,16 @@ create table t1 like mysqltest_2.t1;
# Clean-up
connection default;
+disconnect user1;
use test;
drop database mysqltest_1;
drop database mysqltest_2;
drop user mysqltest_u1@localhost;
+
#
# Bug#18660 Can't grant any privileges on single table in database
-# with underscore char
+# with underscore char
#
grant all on `mysqltest\_%`.* to mysqltest_1@localhost with grant option;
grant usage on *.* to mysqltest_2@localhost;
@@ -571,7 +580,7 @@ grant create on `mysqltest\_1`.* to mysqltest_2@localhost;
grant select on mysqltest_1.t1 to mysqltest_2@localhost;
connect (con3,localhost,mysqltest_2,,);
connection con3;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create database mysqltest_3;
use mysqltest_1;
create table t2(f1 int);
@@ -579,6 +588,9 @@ select * from t1;
connection default;
drop database mysqltest_1;
+connection default;
+disconnect con3;
+disconnect con18600_1;
revoke all privileges, grant option from mysqltest_1@localhost;
revoke all privileges, grant option from mysqltest_2@localhost;
drop user mysqltest_1@localhost;
@@ -586,7 +598,7 @@ drop user mysqltest_2@localhost;
#
-# Bug #30468: column level privileges not respected when joining tables
+# Bug#30468 column level privileges not respected when joining tables
#
CREATE DATABASE db1;
@@ -597,7 +609,7 @@ INSERT INTO t1 VALUES (1,1),(2,2);
CREATE TABLE t2 (b INT, c INT);
INSERT INTO t2 VALUES (1,100),(2,200);
-GRANT SELECT ON t1 TO mysqltest1@localhost;
+GRANT SELECT ON t1 TO mysqltest1@localhost;
GRANT SELECT (b) ON t2 TO mysqltest1@localhost;
connect (conn1,localhost,mysqltest1,,);
@@ -612,6 +624,7 @@ SELECT * FROM t1 JOIN t2 USING (b);
connection default;
disconnect conn1;
+USE test;
DROP TABLE db1.t1, db1.t2;
DROP USER mysqltest1@localhost;
DROP DATABASE db1;
@@ -619,3 +632,5 @@ DROP DATABASE db1;
--echo End of 5.0 tests
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test
index 8eceb851c29..9a635048774 100644
--- a/mysql-test/t/grant3.test
+++ b/mysql-test/t/grant3.test
@@ -1,6 +1,10 @@
-# Can't run with embedded server
+# Can't run with embedded server because we use GRANT
-- source include/not_embedded.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+
# Test of GRANT commands
SET NAMES binary;
@@ -23,10 +27,11 @@ grant create user on *.* to mysqltest_1@localhost;
grant select on `my\_1`.* to mysqltest_1@localhost with grant option;
connect (user_a,localhost,mysqltest_1,,);
connection user_a;
---error 1410
+--error ER_CANT_CREATE_USER_WITH_GRANT
grant select on `my\_1`.* to mysqltest_2@localhost;
create user mysqltest_2@localhost;
disconnect user_a;
+disconnect master;
connection default;
delete from mysql.user where user like 'mysqltest\_%';
@@ -36,7 +41,7 @@ delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
#
-# Bug: #19828 Case sensitivity in Grant/Revoke
+# Bug#19828 Case sensitivity in Grant/Revoke
#
grant select on test.* to CUser@localhost;
@@ -137,7 +142,7 @@ DROP USER CUser2@LOCALHOST;
#
-# Bug#31194: Privilege ordering does not order properly for wildcard values
+# Bug#31194 Privilege ordering does not order properly for wildcard values
#
CREATE DATABASE mysqltest_1;
@@ -160,3 +165,6 @@ DROP DATABASE mysqltest_1;
--echo End of 5.0 tests
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/grant_cache_no_prot.test b/mysql-test/t/grant_cache_no_prot.test
index 1f6a9aeb9ed..31209f343b9 100644
--- a/mysql-test/t/grant_cache_no_prot.test
+++ b/mysql-test/t/grant_cache_no_prot.test
@@ -18,7 +18,7 @@
if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
+ $VIEW_PROTOCOL > 0`)
{
- --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+ --skip Need normal protocol
}
# The main testing script
diff --git a/mysql-test/t/grant_cache_ps_prot.test b/mysql-test/t/grant_cache_ps_prot.test
index 7b579f869e9..27b3f23de3f 100644
--- a/mysql-test/t/grant_cache_ps_prot.test
+++ b/mysql-test/t/grant_cache_ps_prot.test
@@ -17,7 +17,7 @@
if (`SELECT $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0
OR $PS_PROTOCOL = 0`)
{
- --skip Test requires: ps-protocol enabled, other protocols disabled
+ --skip Need ps-protocol
}
# The main testing script
diff --git a/mysql-test/t/greedy_optimizer.test b/mysql-test/t/greedy_optimizer.test
index b73f70c6a3e..5131c97f122 100644
--- a/mysql-test/t/greedy_optimizer.test
+++ b/mysql-test/t/greedy_optimizer.test
@@ -311,3 +311,76 @@ explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and
show status like 'Last_query_cost';
drop table t1,t2,t3,t4,t5,t6,t7;
+
+
+#
+# Bug # 38795: Automatic search depth and nested join's results in server
+# crash
+#
+
+CREATE TABLE t1 (a int, b int, d int, i int); INSERT INTO t1 VALUES (1,1,1,1);
+CREATE TABLE t2 (b int, c int, j int); INSERT INTO t2 VALUES (1,1,1);
+CREATE TABLE t2_1 (j int); INSERT INTO t2_1 VALUES (1);
+CREATE TABLE t3 (c int, f int); INSERT INTO t3 VALUES (1,1);
+CREATE TABLE t3_1 (f int); INSERT INTO t3_1 VALUES (1);
+CREATE TABLE t4 (d int, e int, k int); INSERT INTO t4 VALUES (1,1,1);
+CREATE TABLE t4_1 (k int); INSERT INTO t4_1 VALUES (1);
+CREATE TABLE t5 (g int, d int, h int, l int); INSERT INTO t5 VALUES (1,1,1,1);
+CREATE TABLE t5_1 (l int); INSERT INTO t5_1 VALUES (1);
+
+SET optimizer_search_depth = 3;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ t2 JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ t4 JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ t2 LEFT JOIN (t3 JOIN t3_1 ON t3.f = t3_1.f) ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ t4 JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ (t2 JOIN t2_1 ON t2.j = t2_1.j) JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ t4 JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ t2 JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ (t4 JOIN t4_1 ON t4.k = t4_1.k) LEFT JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ t2 JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ t4 LEFT JOIN (t5 JOIN t5_1 ON t5.l = t5_1.l) ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SET optimizer_search_depth = DEFAULT;
+DROP TABLE t1,t2,t2_1,t3,t3_1,t4,t4_1,t5,t5_1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 36aef981f21..e3cf3ca856d 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1091,6 +1091,7 @@ EXPLAIN SELECT b from t2 GROUP BY b;
SELECT b from t2 GROUP BY b;
DROP TABLE t1;
+DROP TABLE t2;
#
# Bug #31797: error while parsing subqueries -- WHERE is parsed as HAVING
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index 683abfd3783..af9af4fe1fc 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -432,3 +432,14 @@ select f1 from t1 having max(f1)=f1;
select f1 from t1 group by f1 having max(f1)=f1;
set session sql_mode='';
drop table t1;
+
+
+#
+# Bug #38637: COUNT DISTINCT prevents NULL testing in HAVING clause
+#
+CREATE TABLE t1 ( a INT, b INT);
+INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL);
+SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index bcb22c44076..7105d7e04f0 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -37,7 +37,11 @@ create table t3(a int, KEY a_data (a));
create table mysqltest.t4(a int);
create table t5 (id int auto_increment primary key);
insert into t5 values (10);
-create view v1 (c) as select table_name from information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status';
+create view v1 (c) as
+ SELECT table_name FROM information_schema.TABLES
+ WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND
+ table_name<>'ndb_binlog_index' AND
+ table_name<>'ndb_apply_status';
select * from v1;
select c,table_name from v1
@@ -133,25 +137,25 @@ delimiter ;|
# Bug#7222 information_schema: errors in "routines"
#
select parameter_style, sql_data_access, dtd_identifier
-from information_schema.routines;
+from information_schema.routines where routine_schema='test';
--replace_column 5 # 6 #
-show procedure status;
+show procedure status where db='test';
--replace_column 5 # 6 #
-show function status;
+show function status where db='test';
select a.ROUTINE_NAME from information_schema.ROUTINES a,
information_schema.SCHEMATA b where
-a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
+a.ROUTINE_SCHEMA = b.SCHEMA_NAME AND b.SCHEMA_NAME='test';
--replace_column 3 #
explain select a.ROUTINE_NAME from information_schema.ROUTINES a,
information_schema.SCHEMATA b where
a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
-mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) order by 1;
-select count(*) from information_schema.ROUTINES;
+mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) AND a.ROUTINE_SCHEMA='test' order by 1;
+select count(*) from information_schema.ROUTINES where routine_schema='test';
-create view v1 as select routine_schema, routine_name from information_schema.routines
+create view v1 as select routine_schema, routine_name from information_schema.routines where routine_schema='test'
order by routine_schema, routine_name;
select * from v1;
drop view v1;
@@ -528,7 +532,7 @@ flush privileges;
# Bug #9404 information_schema: Weird error messages
# with SELECT SUM() ... GROUP BY queries
#
-SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
+SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
#
@@ -557,7 +561,7 @@ begin
end|
delimiter ;|
show triggers;
-select * from information_schema.triggers;
+select * from information_schema.triggers where trigger_schema in ('mysql', 'information_schema', 'test', 'mysqltest');
drop trigger trg1;
drop trigger trg2;
@@ -727,7 +731,7 @@ BEGIN
SELECT 'foo' FROM DUAL;
END |
delimiter ;|
-select ROUTINE_NAME from routines;
+select ROUTINE_NAME from routines where ROUTINE_SCHEMA='information_schema';
#
# Bug #10734 Grant of privileges other than 'select' and 'create view' should fail on schema
#
@@ -827,7 +831,7 @@ use mysql;
INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL',
'NO','DEFINER','','','BEGIN\r\n \r\nEND','root@%','2006-03-02 18:40:03',
'2006-03-02 18:40:03','','','utf8','utf8_general_ci','utf8_general_ci','n/a');
-select routine_name from information_schema.routines;
+select routine_name from information_schema.routines where ROUTINE_SCHEMA='test';
delete from proc where name='';
use test;
@@ -874,13 +878,13 @@ CREATE USER mysql_bug20230@localhost;
GRANT EXECUTE ON PROCEDURE p1 TO mysql_bug20230@localhost;
GRANT EXECUTE ON FUNCTION f1 TO mysql_bug20230@localhost;
-SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES;
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test';
SHOW CREATE PROCEDURE p1;
SHOW CREATE FUNCTION f1;
connect (conn1, localhost, mysql_bug20230,,);
-SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES;
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test';
SHOW CREATE PROCEDURE p1;
SHOW CREATE FUNCTION f1;
CALL p1();
@@ -931,10 +935,10 @@ SELECT t.table_name, c1.column_name
# INFORMARTION_SCHEMA.TABLES
#
-SELECT MAX(table_name) FROM information_schema.tables;
+SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
SELECT table_name from information_schema.tables
WHERE table_name=(SELECT MAX(table_name)
- FROM information_schema.tables);
+ FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test'));
#
# Bug #23037: Bug in field "Default" of query "SHOW COLUMNS FROM table"
#
@@ -1383,4 +1387,11 @@ select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 b, information_schema.global_
where a.VARIABLE_NAME = b.VARIABLE_NAME;
drop table t0;
+#
+# Bug#35275 INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS omits KEY_BLOCK_SIZE
+#
+CREATE TABLE t1(a INT) KEY_BLOCK_SIZE=1;
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+DROP TABLE t1;
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/information_schema_chmod.test b/mysql-test/t/information_schema_chmod.test
index 51e67a0c956..39e2f680bb8 100644
--- a/mysql-test/t/information_schema_chmod.test
+++ b/mysql-test/t/information_schema_chmod.test
@@ -17,7 +17,8 @@
#
create database mysqltest;
create table mysqltest.t1(a int);
-chmod 0000 $MYSQLTEST_VARDIR/master-data/mysqltest;
+let $MYSQLD_DATADIR= `select @@datadir`;
+chmod 0000 $MYSQLD_DATADIR/mysqltest;
select table_schema from information_schema.tables where table_schema='mysqltest';
-chmod 0777 $MYSQLTEST_VARDIR/master-data/mysqltest;
+chmod 0777 $MYSQLD_DATADIR/mysqltest;
drop database mysqltest;
diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test
index 7c580afadda..ceb5cae9743 100644
--- a/mysql-test/t/init_file.test
+++ b/mysql-test/t/init_file.test
@@ -13,7 +13,8 @@ INSERT INTO init_file.startup VALUES ( NOW() );
SELECT * INTO @X FROM init_file.startup limit 0,1;
SELECT * INTO @Y FROM init_file.startup limit 1,1;
SELECT YEAR(@X)-YEAR(@Y);
-DROP DATABASE init_file;
+# Enable this DROP DATABASE only after resolving bug #42507
+# DROP DATABASE init_file;
--echo ok
--echo end of 4.1 tests
@@ -26,4 +27,5 @@ select * from t1;
# Expected:
# 30, 3, 11, 13
select * from t2;
-drop table t1, t2;
+# Enable this DROP TABLE only after resolving bug #42507
+#drop table t1, t2;
diff --git a/mysql-test/t/innodb-autoinc-optimize.test b/mysql-test/t/innodb-autoinc-optimize.test
index c7e22a8ff40..0f0cb57f92f 100644
--- a/mysql-test/t/innodb-autoinc-optimize.test
+++ b/mysql-test/t/innodb-autoinc-optimize.test
@@ -14,3 +14,6 @@ insert into t1 set a = -1;
# NOTE: The database needs to be shutdown and restarted (here) for
# the test to work. It's included for reference only.
optimize table t1;
+
+--echo ==== clean up ====
+DROP TABLE t1;
diff --git a/mysql-test/t/innodb-autoinc.test b/mysql-test/t/innodb-autoinc.test
index aa464e42627..e6b804c4fff 100644
--- a/mysql-test/t/innodb-autoinc.test
+++ b/mysql-test/t/innodb-autoinc.test
@@ -23,7 +23,6 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (127, null);
-- error ER_DUP_ENTRY,1062
--- warning ER_WARN_DATA_OUT_OF_RANGE,1264
INSERT INTO t1 (c2) VALUES ('innodb');
SELECT * FROM t1;
DROP TABLE t1;
@@ -31,7 +30,6 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (255, null);
-- error ER_DUP_ENTRY,1062
--- warning ER_WARN_DATA_OUT_OF_RANGE,1264
INSERT INTO t1 (c2) VALUES ('innodb');
SELECT * FROM t1;
DROP TABLE t1;
@@ -41,7 +39,6 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (32767, null);
-- error ER_DUP_ENTRY,1062
--- warning ER_WARN_DATA_OUT_OF_RANGE,1264
INSERT INTO t1 (c2) VALUES ('innodb');
SELECT * FROM t1;
DROP TABLE t1;
@@ -49,7 +46,6 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (65535, null);
-- error ER_DUP_ENTRY,1062
--- warning ER_WARN_DATA_OUT_OF_RANGE,1264
INSERT INTO t1 (c2) VALUES ('innodb');
SELECT * FROM t1;
DROP TABLE t1;
@@ -59,7 +55,6 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (8388607, null);
-- error ER_DUP_ENTRY,1062
--- warning ER_WARN_DATA_OUT_OF_RANGE,1264
INSERT INTO t1 (c2) VALUES ('innodb');
SELECT * FROM t1;
DROP TABLE t1;
@@ -67,7 +62,6 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (16777215, null);
-- error ER_DUP_ENTRY,1062
--- warning ER_WARN_DATA_OUT_OF_RANGE,1264
INSERT INTO t1 (c2) VALUES ('innodb');
SELECT * FROM t1;
DROP TABLE t1;
@@ -77,7 +71,6 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (2147483647, null);
-- error ER_DUP_ENTRY,1062
--- warning ER_WARN_DATA_OUT_OF_RANGE,1264
INSERT INTO t1 (c2) VALUES ('innodb');
SELECT * FROM t1;
DROP TABLE t1;
@@ -94,7 +87,6 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (9223372036854775807, null);
-- error ER_DUP_ENTRY,1062
--- warning ER_WARN_DATA_OUT_OF_RANGE,1264
INSERT INTO t1 (c2) VALUES ('innodb');
SELECT * FROM t1;
DROP TABLE t1;
@@ -139,3 +131,262 @@ SELECT c1 FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+#
+# Bug 38839
+# Reset the last value generated at end of statement
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL, 1);
+DELETE FROM t1 WHERE c1 = 1;
+INSERT INTO t1 VALUES (2,1);
+INSERT INTO t1 VALUES (NULL,8);
+SELECT * FROM t1;
+DROP TABLE t1;
+# Bug 38839 -- same as above but for multi value insert
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL, 1);
+DELETE FROM t1 WHERE c1 = 1;
+INSERT INTO t1 VALUES (2,1), (NULL, 8);
+INSERT INTO t1 VALUES (NULL,9);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Test changes to AUTOINC next value calculation
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(5),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Test with SIGNED INT column, by inserting a 0 for the first column value
+# 0 is treated in the same was NULL.
+# Reset the AUTOINC session variables
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(0);
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+SET @@INSERT_ID=400;
+# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL
+-- error ER_DUP_ENTRY,1062
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Test with SIGNED INT column
+# Reset the AUTOINC session variables
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Test with UNSIGNED INT column, single insert
+# The sign in the value is ignored and a new column value is generated
+# Reset the AUTOINC session variables
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+INSERT INTO t1 VALUES (-2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (250);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Test with UNSIGNED INT column, multi-value inserts
+# The sign in the value is ignored and a new column value is generated
+# Reset the AUTOINC session variables
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL
+-- error ER_DUP_ENTRY,1062
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Check for overflow handling when increment is > 1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (9223372036854775794); #-- 2^63 - 14
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+# This should just fit
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Check for overflow handling when increment and offser are > 1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+# This should fail because of overflow but it doesn't, it seems to be
+# a MySQL server bug. It wraps around to 0 for the last value.
+# See MySQL Bug# 39828
+#
+# Instead of wrapping around, it asserts when MySQL is compiled --with-debug
+# (see sql/handler.cc:handler::update_auto_increment()). Don't test for
+# overflow until Bug #39828 is fixed.
+#
+# Since this asserts when compiled --with-debug, we can't properly test this
+# until Bug #39828 is fixed. For now, this test is meaningless.
+#if Bug #39828 is fixed
+#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+#else
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+#endif
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Check for overflow handling when increment and offset are odd numbers
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
+SHOW VARIABLES LIKE "%auto_inc%";
+# This should fail because of overflow but it doesn't. It fails with
+# a duplicate entry message because of a MySQL server bug, it wraps
+# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace
+# the ER_DUP_ENTRY, 1062 below with the appropriate error message
+#
+# Since this asserts when compiled --with-debug, we can't properly test this
+# until Bug #39828 is fixed. For now, this test is meaningless.
+#if Bug #39828 is fixed
+# Still need to fix this error code, error should mention overflow
+#-- error ER_DUP_ENTRY,1062
+#INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
+#else
+INSERT INTO t1 VALUES (NULL),(NULL);
+#endif
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Check for overflow handling when increment and offset are odd numbers
+# and check for large -ve numbers
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES(-9223372036854775806); #-- -2^63 + 2
+INSERT INTO t1 VALUES(-9223372036854775807); #-- -2^63 + 1
+INSERT INTO t1 VALUES(-9223372036854775808); #-- -2^63
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
+SHOW VARIABLES LIKE "%auto_inc%";
+INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# Check for overflow handling when increment and offset are very
+# large numbers 2^60
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
+SHOW VARIABLES LIKE "%auto_inc%";
+# This should fail because of overflow but it doesn't. It wraps around
+# and the autoinc values look bogus too.
+# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error
+# code expected test.
+# -- error ER_AUTOINC_READ_FAILED,1467
+#
+# Since this asserts when compiled --with-debug, we can't properly test this
+# until Bug #39828 is fixed. For now, this test is meaningless.
+#if Bug #39828 is fixed
+#-- error ER_AUTOINC_READ_FAILED,1467
+#INSERT INTO t1 VALUES (NULL),(NULL);
+#else
+INSERT INTO t1 VALUES (NULL);
+#endif
+SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/innodb-semi-consistent-master.opt b/mysql-test/t/innodb-semi-consistent-master.opt
index 2746e4e184e..e76299453d3 100644
--- a/mysql-test/t/innodb-semi-consistent-master.opt
+++ b/mysql-test/t/innodb-semi-consistent-master.opt
@@ -1 +1 @@
---innodb_locks_unsafe_for_binlog=true --innodb_lock_wait_timeout=2
+--innodb_lock_wait_timeout=2
diff --git a/mysql-test/t/innodb-semi-consistent.test b/mysql-test/t/innodb-semi-consistent.test
index a3496625e95..6d3020bb560 100644
--- a/mysql-test/t/innodb-semi-consistent.test
+++ b/mysql-test/t/innodb-semi-consistent.test
@@ -11,7 +11,7 @@ connect (a,localhost,root,,);
connect (b,localhost,root,,);
connection a;
set binlog_format=mixed;
-set session transaction isolation level read committed;
+set session transaction isolation level repeatable read;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
set autocommit=0;
@@ -19,13 +19,15 @@ set autocommit=0;
select * from t1 where a=3 lock in share mode;
connection b;
set binlog_format=mixed;
-set session transaction isolation level read committed;
+set session transaction isolation level repeatable read;
set autocommit=0;
-- error ER_LOCK_WAIT_TIMEOUT
update t1 set a=10 where a=5;
connection a;
commit;
connection b;
+# perform a semi-consisent read (and unlock non-matching rows)
+set session transaction isolation level read committed;
update t1 set a=10 where a=5;
connection a;
-- error ER_LOCK_WAIT_TIMEOUT
@@ -33,6 +35,7 @@ select * from t1 where a=2 for update;
# this should lock the records (1),(2)
select * from t1 where a=2 limit 1 for update;
connection b;
+# semi-consistent read will skip non-matching locked rows a=1, a=2
update t1 set a=11 where a=6;
-- error ER_LOCK_WAIT_TIMEOUT
update t1 set a=12 where a=2;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 339be87419a..b0353ed5268 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1163,7 +1163,7 @@ drop table t2;
# Test error handling
# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error ER_WRONG_FK_DEF
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
@@ -1317,6 +1317,7 @@ set global innodb_sync_spin_loops=20;
show variables like "innodb_sync_spin_loops";
# Test for innodb_thread_concurrency variable
+SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
show variables like "innodb_thread_concurrency";
set global innodb_thread_concurrency=1001;
show variables like "innodb_thread_concurrency";
@@ -1324,6 +1325,7 @@ set global innodb_thread_concurrency=0;
show variables like "innodb_thread_concurrency";
set global innodb_thread_concurrency=16;
show variables like "innodb_thread_concurrency";
+SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
# Test for innodb_concurrency_tickets variable
show variables like "innodb_concurrency_tickets";
@@ -1356,7 +1358,7 @@ source include/varchar.inc;
#
# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
create table t1 (v varchar(65530), key(v));
drop table t1;
create table t1 (v varchar(65536));
@@ -1631,7 +1633,7 @@ disconnect b;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
-- error 1005
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
set foreign_key_checks=1;
@@ -1643,7 +1645,7 @@ drop table t2;
set foreign_key_checks=0;
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
-- error 1005
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
set foreign_key_checks=1;
@@ -1674,7 +1676,7 @@ set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
-- error 1025
rename table t3 to t1;
set foreign_key_checks=1;
@@ -2314,7 +2316,7 @@ ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
# mysqltest first does replace_regex, then replace_result
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error 1025
ALTER TABLE t2 MODIFY a INT NOT NULL;
DELETE FROM t1;
@@ -2475,6 +2477,7 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
DROP TABLE t2;
DROP TABLE t1;
# End 34920 test
+#
# Bug #29507 TRUNCATE shows to many rows effected
#
CONNECTION default;
@@ -2491,6 +2494,36 @@ TRUNCATE TABLE t1;
--disable_info
DROP TABLE t1;
#
+# Bug#35537 Innodb doesn't increment handler_update and handler_delete.
+#
+-- disable_query_log
+-- disable_result_log
+
+CONNECT (c1,localhost,root,,);
+
+DROP TABLE IF EXISTS bug35537;
+CREATE TABLE bug35537 (
+ c1 int
+) ENGINE=InnoDB;
+
+INSERT INTO bug35537 VALUES (1);
+
+-- enable_result_log
+
+SHOW SESSION STATUS LIKE 'Handler_update%';
+SHOW SESSION STATUS LIKE 'Handler_delete%';
+
+UPDATE bug35537 SET c1 = 2 WHERE c1 = 1;
+DELETE FROM bug35537 WHERE c1 = 2;
+
+SHOW SESSION STATUS LIKE 'Handler_update%';
+SHOW SESSION STATUS LIKE 'Handler_delete%';
+
+DROP TABLE bug35537;
+
+DISCONNECT c1;
+CONNECTION default;
+
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt b/mysql-test/t/innodb_bug30919-master.opt
index 8636d2d8734..8636d2d8734 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt
+++ b/mysql-test/t/innodb_bug30919-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test b/mysql-test/t/innodb_bug30919.test
index 56b2c7bc03d..56b2c7bc03d 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test
+++ b/mysql-test/t/innodb_bug30919.test
diff --git a/mysql-test/t/innodb_bug34300.test b/mysql-test/t/innodb_bug34300.test
index 114bcf98c25..432ddd03547 100644
--- a/mysql-test/t/innodb_bug34300.test
+++ b/mysql-test/t/innodb_bug34300.test
@@ -21,6 +21,7 @@ CREATE TABLE bug34300 (
INSERT INTO bug34300 VALUES ('xxx', repeat('a', 8459264), 'zzz');
+-- enable_query_log
-- enable_result_log
SELECT f4, f8 FROM bug34300;
@@ -30,3 +31,7 @@ ALTER TABLE bug34300 ADD COLUMN (f10 INT);
SELECT f4, f8 FROM bug34300;
DROP TABLE bug34300;
+
+disconnect newconn;
+connection default;
+SET @@global.max_allowed_packet=default;
diff --git a/mysql-test/t/innodb_bug38231.test b/mysql-test/t/innodb_bug38231.test
new file mode 100644
index 00000000000..b3fcd89f371
--- /dev/null
+++ b/mysql-test/t/innodb_bug38231.test
@@ -0,0 +1,75 @@
+#
+# Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK
+# http://bugs.mysql.com/38231
+#
+
+-- source include/have_innodb.inc
+
+SET storage_engine=InnoDB;
+
+# we care only that the following SQL commands do not crash the server
+-- disable_query_log
+-- disable_result_log
+
+DROP TABLE IF EXISTS bug38231;
+CREATE TABLE bug38231 (a INT);
+
+-- connect (con1,localhost,root,,)
+-- connect (con2,localhost,root,,)
+
+-- connection con1
+SET autocommit=0;
+LOCK TABLE bug38231 WRITE;
+
+-- connection con2
+SET autocommit=0;
+-- send
+LOCK TABLE bug38231 WRITE;
+
+-- connection default
+-- send
+TRUNCATE TABLE bug38231;
+
+-- connection con1
+# give time to TRUNCATE and others to be executed; without sleep, sometimes
+# UNLOCK executes before TRUNCATE
+# TODO: Replace with wait_condition once possible under embedded server.
+-- sleep 0.2
+# this crashes the server if the bug is present
+UNLOCK TABLES;
+
+# clean up
+
+-- connection con2
+-- reap
+UNLOCK TABLES;
+
+-- connection default
+-- reap
+-- disconnect con1
+-- disconnect con2
+
+# test that TRUNCATE works with with row-level locks
+
+-- enable_query_log
+-- enable_result_log
+
+INSERT INTO bug38231 VALUES (1), (10), (300);
+
+-- connect (con4,localhost,root,,)
+
+-- connection con4
+SET autocommit=0;
+SELECT * FROM bug38231 FOR UPDATE;
+
+-- connection default
+TRUNCATE TABLE bug38231;
+
+-- connection con4
+COMMIT;
+
+-- connection default
+
+-- disconnect con4
+
+DROP TABLE bug38231;
diff --git a/mysql-test/t/innodb_bug39438-master.opt b/mysql-test/t/innodb_bug39438-master.opt
new file mode 100644
index 00000000000..43fac202fd4
--- /dev/null
+++ b/mysql-test/t/innodb_bug39438-master.opt
@@ -0,0 +1 @@
+--innodb-file-per-table=1
diff --git a/mysql-test/t/innodb_bug39438.test b/mysql-test/t/innodb_bug39438.test
new file mode 100644
index 00000000000..4dc3d957c39
--- /dev/null
+++ b/mysql-test/t/innodb_bug39438.test
@@ -0,0 +1,27 @@
+#
+# Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
+# http://bugs.mysql.com/39438
+#
+# This test must be run with innodb_file_per_table=1 because the crash
+# only occurs if that option is turned on and DISCARD TABLESPACE only
+# works with innodb_file_per_table.
+#
+
+-- source include/have_innodb.inc
+
+SET storage_engine=InnoDB;
+
+# we care only that the following SQL commands do not crash the server
+-- disable_query_log
+-- disable_result_log
+
+DROP TABLE IF EXISTS bug39438;
+
+CREATE TABLE bug39438 (id INT) ENGINE=INNODB;
+
+ALTER TABLE bug39438 DISCARD TABLESPACE;
+
+# this crashes the server if the bug is present
+SHOW TABLE STATUS;
+
+DROP TABLE bug39438;
diff --git a/mysql-test/t/innodb_ignore_builtin-master.opt b/mysql-test/t/innodb_ignore_builtin-master.opt
new file mode 100644
index 00000000000..f7289eed20e
--- /dev/null
+++ b/mysql-test/t/innodb_ignore_builtin-master.opt
@@ -0,0 +1 @@
+--ignore_builtin_innodb
diff --git a/mysql-test/t/innodb_ignore_builtin.test b/mysql-test/t/innodb_ignore_builtin.test
new file mode 100644
index 00000000000..6f987bcf891
--- /dev/null
+++ b/mysql-test/t/innodb_ignore_builtin.test
@@ -0,0 +1,8 @@
+#
+# Bug #42610: Dynamic plugin broken in 5.1.31
+#
+show variables like 'ignore_builtin_innodb';
+select PLUGIN_NAME from information_schema.plugins
+where PLUGIN_NAME = "InnoDb";
+select ENGINE from information_schema.engines
+where ENGINE = "InnoDB";
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index d47406697f8..21ee440f10b 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -53,3 +53,135 @@ CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
CREATE INDEX i1 on t1 (a(3));
SELECT * FROM t1 WHERE a = 'abcde';
DROP TABLE t1;
+
+#
+# Bug #37742: HA_EXTRA_KEYREAD flag is set when key contains only prefix of
+# requested column
+#
+
+CREATE TABLE foo (a int, b int, c char(10),
+ PRIMARY KEY (c(3)),
+ KEY b (b)
+) engine=innodb;
+
+CREATE TABLE foo2 (a int, b int, c char(10),
+ PRIMARY KEY (c),
+ KEY b (b)
+) engine=innodb;
+
+CREATE TABLE bar (a int, b int, c char(10),
+ PRIMARY KEY (c(3)),
+ KEY b (b)
+) engine=myisam;
+
+INSERT INTO foo VALUES
+ (1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'),
+ (4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe');
+
+INSERT INTO bar SELECT * FROM foo;
+INSERT INTO foo2 SELECT * FROM foo;
+
+--query_vertical EXPLAIN SELECT c FROM bar WHERE b>2;
+--query_vertical EXPLAIN SELECT c FROM foo WHERE b>2;
+--query_vertical EXPLAIN SELECT c FROM foo2 WHERE b>2;
+
+--query_vertical EXPLAIN SELECT c FROM bar WHERE c>2;
+--query_vertical EXPLAIN SELECT c FROM foo WHERE c>2;
+--query_vertical EXPLAIN SELECT c FROM foo2 WHERE c>2;
+
+DROP TABLE foo, bar, foo2;
+
+#
+# Bug#41348: INSERT INTO tbl SELECT * FROM temp_tbl overwrites locking type of temp table
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t3,t2;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+DELIMITER |;
+CREATE FUNCTION f1() RETURNS VARCHAR(250)
+ BEGIN
+ return 'hhhhhhh' ;
+ END|
+DELIMITER ;|
+
+CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20), c VARCHAR(20)) ENGINE=INNODB;
+
+BEGIN WORK;
+
+CREATE TEMPORARY TABLE t2 (a VARCHAR(20), b VARCHAR(20), c varchar(20)) ENGINE=INNODB;
+CREATE TEMPORARY TABLE t3 LIKE t2;
+
+INSERT INTO t1 VALUES ('a','b',NULL),('c','d',NULL),('e','f',NULL);
+
+SET @stmt := CONCAT('INSERT INTO t2 SELECT tbl.a, tbl.b, f1()',' FROM t1 tbl');
+PREPARE stmt1 FROM @stmt;
+
+SET @stmt := CONCAT('INSERT INTO t3', ' SELECT * FROM t2');
+PREPARE stmt3 FROM @stmt;
+
+EXECUTE stmt1;
+
+COMMIT;
+
+DEALLOCATE PREPARE stmt1;
+DEALLOCATE PREPARE stmt3;
+
+DROP TABLE t1,t3,t2;
+DROP FUNCTION f1;
+
+#
+# Bug#37016: TRUNCATE TABLE removes some rows but not all
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY,
+ t1_id INT, INDEX par_ind (t1_id),
+ FOREIGN KEY (t1_id) REFERENCES t1(id)) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (3,2);
+
+SET AUTOCOMMIT = 0;
+
+START TRANSACTION;
+--error ER_ROW_IS_REFERENCED_2
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+COMMIT;
+SELECT * FROM t1;
+
+START TRANSACTION;
+--error ER_ROW_IS_REFERENCED_2
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+ROLLBACK;
+SELECT * FROM t1;
+
+SET AUTOCOMMIT = 1;
+
+START TRANSACTION;
+SELECT * FROM t1;
+COMMIT;
+
+--error ER_ROW_IS_REFERENCED_2
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+DELETE FROM t2 WHERE id = 3;
+
+START TRANSACTION;
+SELECT * FROM t1;
+TRUNCATE TABLE t1;
+ROLLBACK;
+SELECT * FROM t1;
+TRUNCATE TABLE t2;
+
+DROP TABLE t2;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/innodb_mysql_rbk-master.opt b/mysql-test/t/innodb_mysql_rbk-master.opt
new file mode 100644
index 00000000000..0e400f9c36b
--- /dev/null
+++ b/mysql-test/t/innodb_mysql_rbk-master.opt
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=1 --innodb_rollback_on_timeout=1
diff --git a/mysql-test/t/innodb_mysql_rbk.test b/mysql-test/t/innodb_mysql_rbk.test
new file mode 100644
index 00000000000..d2368c81f95
--- /dev/null
+++ b/mysql-test/t/innodb_mysql_rbk.test
@@ -0,0 +1,35 @@
+-- source include/have_innodb.inc
+
+#
+# Bug #41453: Assertion `m_status == DA_ERROR' failed in
+# Diagnostics_area::sql_errno
+#
+
+CREATE TABLE t1(a INT, b INT NOT NULL, PRIMARY KEY (a)) ENGINE=innodb
+DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
+CONNECT (con1,localhost,root,,);
+CONNECT (con2,localhost,root,,);
+
+CONNECTION con1;
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
+CONNECTION con2;
+START TRANSACTION;
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET b=b+12 WHERE a > 2 ORDER BY a;
+ROLLBACK;
+
+CONNECTION con1;
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
+CONNECTION con2;
+START TRANSACTION;
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET b=10 WHERE a > 1 ORDER BY a;
+SELECT * FROM t1 WHERE b = 10;
+
+CONNECTION default;
+DISCONNECT con1;
+DISCONNECT con2;
+DROP TABLE t1;
diff --git a/mysql-test/t/innodb_notembedded.test b/mysql-test/t/innodb_notembedded.test
index 2731f8e33ed..564b947c75e 100644
--- a/mysql-test/t/innodb_notembedded.test
+++ b/mysql-test/t/innodb_notembedded.test
@@ -5,6 +5,8 @@
drop table if exists t1;
--enable_warnings
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
+
connect (a,localhost,root,,);
connect (b,localhost,root,,);
@@ -39,4 +41,4 @@ drop table t1;
drop function f1;
disconnect a;
disconnect b;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index 67f21731afe..de38ae0b0d3 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -76,7 +76,7 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100;
SELECT * FROM t1;
INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0;
SELECT * FROM t1;
---error 1052
+--error ER_NON_UNIQ_ERROR
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a);
SELECT *, VALUES(a) FROM t1;
@@ -95,9 +95,9 @@ insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ;
select * from t1;
insert into t1 select 1 on duplicate key update a=2;
select * from t1;
---error 1052
+--error ER_NON_UNIQ_ERROR
insert into t1 select a from t1 on duplicate key update a=a+1 ;
---error 1052
+--error ER_NON_UNIQ_ERROR
insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ;
drop table t1;
@@ -171,13 +171,13 @@ SET SQL_MODE = 'TRADITIONAL';
CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL);
---error 1364
+--error ER_NO_DEFAULT_FOR_FIELD
INSERT INTO t1 (a) VALUES (1);
---error 1364
+--error ER_NO_DEFAULT_FOR_FIELD
INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b;
---error 1364
+--error ER_NO_DEFAULT_FOR_FIELD
INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b;
SELECT * FROM t1;
@@ -278,7 +278,7 @@ INSERT INTO t1 (id,c1) VALUES (1,10);
SELECT * FROM t1;
CREATE TABLE t2 (id INT, c1 INT);
INSERT INTO t2 VALUES (1,NULL), (2,2);
---error 1048
+--error ER_BAD_NULL_ERROR
INSERT INTO t1 (id,c1) SELECT 1,NULL
ON DUPLICATE KEY UPDATE c1=NULL;
SELECT * FROM t1;
@@ -290,6 +290,7 @@ INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
SELECT * FROM t1;
DROP TABLE t1;
+DROP TABLE t2;
#
# Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 46de411677c..7bfe2491c7c 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -7,25 +7,25 @@ drop table if exists t1, t2;
--enable_warnings
create table t1 (a date, b date, c date not null, d date);
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
SELECT * from t1;
truncate table t1;
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
SELECT * from t1;
drop table t1;
create table t1 (a text, b text);
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1;
drop table t1;
create table t1 (a int, b char(10));
-load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
select * from t1;
truncate table t1;
-load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
# The empty line last comes from the end line field in the file
select * from t1;
@@ -63,7 +63,7 @@ drop table t1;
# ENCLOSED
#
create table t1 (a varchar(20), b varchar(20));
-load data infile '../std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
+load data infile '../../std_data/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
select * from t1;
drop table t1;
@@ -108,44 +108,44 @@ DROP TABLE t1,t2;
#
create table t1 (a int default 100, b int, c varchar(60));
# we can do something like this
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1;
truncate table t1;
# we can use filled fields in expressions
# we also assigning NULL value to field with non-NULL default here
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
select * from t1;
truncate table t1;
# we even can use variables in set clause, and missed columns will be set
# with default values
set @c:=123;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
select * from t1;
# let us test side-effect of such load
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, @b);
select * from t1;
select @a, @b;
truncate table t1;
# Reading of all columns with set
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 set c=b;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 set c=b;
select * from t1;
truncate table t1;
# now going to test fixed field-row file format
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
select * from t1;
truncate table t1;
# this also should work
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
select * from t1;
# and this should bark
--error 1409
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
# Now let us test LOAD DATA with subselect
create table t2 (num int primary key, str varchar(10));
insert into t2 values (10,'Ten'), (15,'Fifteen');
truncate table t1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
select * from t1;
#
@@ -163,7 +163,7 @@ set @@secure_file_priv= 0;
# Test "load data"
truncate table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT, ER_TEXTFILE_NOT_READABLE
eval load data infile '$MYSQL_TEST_DIR/t/loaddata.test' into table t1;
select * from t1;
@@ -264,7 +264,7 @@ CREATE VIEW v2 AS SELECT 1 + 2 AS c0, c1, c2 FROM t1;
CREATE VIEW v3 AS SELECT 1 AS d1, 2 AS d2;
--echo
-LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v1
+LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v1
FIELDS ESCAPED BY '\\'
TERMINATED BY ','
ENCLOSED BY '"'
@@ -280,7 +280,7 @@ SELECT * FROM v1;
DELETE FROM t1;
--echo
-LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2
+LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v2
FIELDS ESCAPED BY '\\'
TERMINATED BY ','
ENCLOSED BY '"'
@@ -297,7 +297,7 @@ DELETE FROM t1;
--echo
--error ER_LOAD_DATA_INVALID_COLUMN
-LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2
+LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v2
FIELDS ESCAPED BY '\\'
TERMINATED BY ','
ENCLOSED BY '"'
@@ -305,7 +305,7 @@ LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2
--echo
--error ER_NON_UPDATABLE_TABLE
-LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v3
+LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v3
FIELDS ESCAPED BY '\\'
TERMINATED BY ','
ENCLOSED BY '"'
@@ -526,7 +526,8 @@ select @@character_set_filesystem;
LOAD DATA INFILE 't@002d1' INTO TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
-remove_file $MYSQLTEST_VARDIR/master-data/test/t@002d1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/t@002d1;
SET character_set_filesystem=default;
select @@character_set_filesystem;
diff --git a/mysql-test/t/lock_tables_lost_commit.test b/mysql-test/t/lock_tables_lost_commit.test
index d31b4b7dfb5..754c8f3c378 100644
--- a/mysql-test/t/lock_tables_lost_commit.test
+++ b/mysql-test/t/lock_tables_lost_commit.test
@@ -1,24 +1,33 @@
-# This is a test for bug 578
+# Test for Bug#578 mysqlimport -l silently fails when binlog-ignore-db is set
--- source include/have_innodb.inc
+--source include/have_innodb.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
--disable_warnings
-drop table if exists t1;
-create table t1(a int) engine=innodb;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT) ENGINE=innodb;
--enable_warnings
-lock tables t1 write;
-insert into t1 values(10);
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 VALUES(10);
disconnect con1;
connection con2;
# The bug was that, because of the LOCK TABLES, the handler "forgot" to commit,
# and the other commit when we write to the binlog was not done because of
-# binlog-ignore-db
-select * from t1;
-drop table t1;
+# binlog-ignore-db
+SELECT * FROM t1;
+DROP TABLE t1;
+
+connection default;
+disconnect con2;
# End of 4.1 tests
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/log_bin_trust_function_creators_func-master.opt b/mysql-test/t/log_bin_trust_function_creators_func-master.opt
deleted file mode 100644
index 2dd562ea1aa..00000000000
--- a/mysql-test/t/log_bin_trust_function_creators_func-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-bin=test.log
diff --git a/mysql-test/t/log_queries_not_using_indexes_basic.test b/mysql-test/t/log_queries_not_using_indexes_basic.test
deleted file mode 100644
index d6de4d4ca02..00000000000
--- a/mysql-test/t/log_queries_not_using_indexes_basic.test
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-################## mysql-test\t\log_queries_not_using_indexes_basic.test ######
-# #
-# Variable Name: log_queries_not_using_indexes #
-# Scope: Global #
-# Access Type: Static #
-# Data Type: #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author : Sharique Abdullah #
-# #
-# #
-# Description:Test Cases of Dynamic System Variable log_queries_not_using_indexes#
-# that checks the behavior of this variable in the following ways #
-# * Value Check #
-# * Scope Check #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
-###############################################################################
-
---echo '#---------------------BS_STVARS_041_01----------------------#'
-####################################################################
-# Displaying default value #
-####################################################################
-SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
---echo 1 Expected
-
-
---echo '#---------------------BS_STVARS_041_02----------------------#'
-#
-# Test case for Bug #35433
-#
-####################################################################
-# Check if Value can set #
-####################################################################
-
-#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.log_queries_not_using_indexes=1;
---echo Expected error 'Read only variable'
---ECHO "BUG:It should give error on setting this variable as it is readonly variable"
-SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
---echo 1 Expected
-
-
-
-
---echo '#---------------------BS_STVARS_041_03----------------------#'
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-#################################################################
-
-SELECT @@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='log_queries_not_using_indexes';
---echo 1 Expected
-
-SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
---echo 1 Expected
-
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='log_queries_not_using_indexes';
---echo 1 Expected
-
-
-
---echo '#---------------------BS_STVARS_041_04----------------------#'
-################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
-################################################################################
-SELECT @@log_queries_not_using_indexes = @@GLOBAL.log_queries_not_using_indexes;
---echo 1 Expected
-
-
-
---echo '#---------------------BS_STVARS_041_05----------------------#'
-################################################################################
-# Check if log_queries_not_using_indexes can be accessed with and without @@ sign #
-################################################################################
-
-SELECT COUNT(@@log_queries_not_using_indexes);
---echo 1 Expected
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.log_queries_not_using_indexes);
---echo Expected error 'Variable is a GLOBAL variable'
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.log_queries_not_using_indexes);
---echo Expected error 'Variable is a GLOBAL variable'
-
-SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
---echo 1 Expected
-
---Error ER_BAD_FIELD_ERROR
-SELECT log_queries_not_using_indexes = @@SESSION.log_queries_not_using_indexes;
---echo Expected error 'Readonly variable'
-
-
diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test
index 977b74aa1e3..e40dd1e3491 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -1,7 +1,30 @@
--- source include/not_embedded.inc
+### t/log_state.test ###
+#
+# This test suffers from server
+# Bug#38124 "general_log_file" variable silently unset when using expression
+# In short:
+# SET GLOBAL general_log_file = @<whatever>
+# SET GLOBAL slow_query_log = @<whatever>
+# cause that the value of these server system variables is set to default
+# instead of the assigned values. There comes no error message or warning.
+# If this bug is fixed please
+# 1. try this test with "let $fixed_bug38124 = 0;"
+# 2. remove all workarounds if 1. was successful.
+let $fixed_bug38124 = 0;
+
+--source include/not_embedded.inc
--source include/have_csv.inc
+# Several subtests modify global variables. Save the initial values only here,
+# but reset to the initial values per subtest.
+SET @old_general_log= @@global.general_log;
+SET @old_general_log_file= @@global.general_log_file;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_slow_query_log_file= @@global.slow_query_log_file;
+
+
--disable_ps_protocol
+
set global general_log= OFF;
truncate table mysql.general_log;
truncate table mysql.slow_log;
@@ -23,20 +46,32 @@ show global variables
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
+--echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
+--echo # Switch to connection con1
connection con1;
-set session long_query_time=1;
-select sleep(2);
+# Please increase @long_query_time if the corresponding selects show an
+# additional unexpected entry like
+# start_time ... sql_text
+# TIMESTAMP ... set session long_query_time=...
+# (Bug#40377 sporadic pushbuild failure in log_state: result mismatch)
+--replace_result 2 <long_query_time>
+set @long_query_time = 2;
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
+--echo # Switch to connection default
connection default;
set global slow_query_log= ON;
+--echo # Switch to connection con1
connection con1;
-set session long_query_time=1;
-select sleep(2);
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
+--echo # Switch to connection default
connection default;
show global variables
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
@@ -71,16 +106,16 @@ show variables like 'slow_query_log_file';
show variables like 'log_output';
# Can't set general_log_file to a non existing file
---error 1231
-set global general_log_file='/not exiting path/log.master';
+--error ER_WRONG_VALUE_FOR_VAR
+set global general_log_file='/not existing path/log.master';
# Can't set general_log_file to a directory
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
eval set global general_log_file='$MYSQLTEST_VARDIR';
# Can't set general_log_file to empty string
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set global general_log_file='';
--replace_column 2 #
@@ -126,17 +161,30 @@ drop table t1;
--replace_column 1 TIMESTAMP 2 USER_HOST 3 #
select * from mysql.general_log;
-#
-# Bug#29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
-# a deadlock)
+# Reset to initial values
+SET @@global.general_log = @old_general_log;
+SET @@global.general_log_file = @old_general_log_file;
+SET @@global.slow_query_log = @old_slow_query_log;
+SET @@global.slow_query_log_file = @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
-# save state
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
+###########################################################################
-# Test ON->OFF transition under a GLOBAL READ LOCK
+#
+# Bug#29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
+# a deadlock)
+#
+# Test ON->OFF transition under a GLOBAL READ LOCK
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
@@ -148,7 +196,6 @@ SET GLOBAL slow_query_log = OFF;
UNLOCK TABLES;
# Test OFF->ON transition under a GLOBAL READ LOCK
-
FLUSH TABLES WITH READ LOCK;
SET GLOBAL general_log = ON;
@@ -157,7 +204,6 @@ SET GLOBAL slow_query_log = ON;
UNLOCK TABLES;
# Test ON->OFF transition under a GLOBAL READ_ONLY
-
SET GLOBAL READ_ONLY = ON;
SET GLOBAL general_log = OFF;
@@ -166,7 +212,6 @@ SET GLOBAL slow_query_log = OFF;
SET GLOBAL READ_ONLY = OFF;
# Test OFF->ON transition under a GLOBAL READ_ONLY
-
SET GLOBAL READ_ONLY = ON;
SET GLOBAL general_log = ON;
@@ -174,17 +219,18 @@ SET GLOBAL slow_query_log = ON;
SET GLOBAL READ_ONLY = OFF;
-# Restore state
+# Reset to initial values
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
+
+###########################################################################
#
-# Bug #29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
+# Bug#29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
#
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
+SET GLOBAL general_log = ON;
SHOW VARIABLES LIKE 'general_log';
SHOW VARIABLES LIKE 'log';
@@ -210,67 +256,84 @@ SHOW VARIABLES LIKE 'slow_query_log';
SHOW VARIABLES LIKE 'log_slow_queries';
SELECT @@slow_query_log, @@log_slow_queries;
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+
+
+###########################################################################
#
-# Bug #31604: server crash when setting slow_query_log_file/general_log_file
+# Bug#31604: server crash when setting slow_query_log_file/general_log_file
#
-set @old_general_log_file= @@global.general_log_file;
-set @old_slow_query_log_file= @@global.slow_query_log_file;
-
---error 1231
-set global general_log_file= concat('/not exiting path/log.maste', 'r');
---error 1231
-set global general_log_file= NULL;
---error 1231
-set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
---error 1231
-set global slow_query_log_file= NULL;
-set global general_log_file= @old_general_log_file;
-set global slow_query_log_file= @old_slow_query_log_file;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL general_log_file= CONCAT('/not existing path/log.maste', 'r');
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL general_log_file= NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL slow_query_log_file= CONCAT('/not existing path/log.maste', 'r');
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL slow_query_log_file= NULL;
+
+# Reset to initial values in case a setting above was successful.
+SET GLOBAL general_log_file= @old_general_log_file;
+SET GLOBAL slow_query_log_file= @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
###########################################################################
--echo
--echo # --
--echo # -- Bug#32748: Inconsistent handling of assignments to
---echo # -- general_log_file/slow_query_log_file.
+--echo # -- general_log_file/slow_query_log_file.
--echo # --
--echo
-SET @general_log_file_saved = @@global.general_log_file;
-SET @slow_query_log_file_saved = @@global.slow_query_log_file;
-
---echo
SET GLOBAL general_log_file = 'bug32748.query.log';
SET GLOBAL slow_query_log_file = 'bug32748.slow.log';
--echo
SHOW VARIABLES LIKE '%log_file';
+# Reset to initial values
--echo
-SET GLOBAL general_log_file = @general_log_file_saved;
-SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
+SET GLOBAL general_log_file = @old_general_log_file;
+SET GLOBAL slow_query_log_file = @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
--echo
--echo # -- End of Bug#32748.
-###########################################################################
-
+###########################################################################
-## WL#4403 - deprecate @log and @slow_log_queries variables
+# WL#4403 - deprecate @log and @slow_log_queries variables
-## these are all deprecated -- show for command-line as well!
+# These server system variables are all deprecated
+# -- show for command-line as well!
--echo deprecated:
SET GLOBAL log = 0;
SET GLOBAL log_slow_queries = 0;
SET GLOBAL log = DEFAULT;
SET GLOBAL log_slow_queries = DEFAULT;
-## these are NOT deprecated
+# These server system variables are NOT deprecated.
--echo not deprecated:
SELECT @@global.general_log_file INTO @my_glf;
SELECT @@global.slow_query_log_file INTO @my_sqlf;
@@ -283,6 +346,20 @@ SET GLOBAL slow_query_log_file = @my_sqlf;
SET GLOBAL general_log = DEFAULT;
SET GLOBAL slow_query_log = DEFAULT;
+## Reset to initial values
+SET @@global.general_log = @old_general_log;
+SET @@global.general_log_file = @old_general_log_file;
+SET @@global.slow_query_log = @old_slow_query_log;
+SET @@global.slow_query_log_file = @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
--echo End of 5.1 tests
@@ -290,10 +367,30 @@ SET GLOBAL slow_query_log = DEFAULT;
--enable_ps_protocol
#
-# Cleanup (must be done last to avoid delayed 'Quit' message in general log)
+# Cleanup
#
+# Disconnect must be done last to avoid delayed 'Quit' message in general log
+--echo # Close connection con1
disconnect con1;
+# set back the saved default values
+connection default;
+
+# Reset global system variables to initial values if forgotten somewhere above.
+SET global general_log = @old_general_log;
+SET global general_log_file = @old_general_log_file;
+SET global slow_query_log = @old_slow_query_log;
+SET global slow_query_log_file = @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
# Remove the log files that was created in the "default location"
# i.e var/run
---remove_file $MYSQLTEST_VARDIR/run/master.log
+--remove_file $MYSQLTEST_VARDIR/run/mysqld.log
+--remove_file $MYSQLTEST_VARDIR/tmp/log.master
diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test
index bdd22538c14..326914f09d9 100644
--- a/mysql-test/t/log_tables.test
+++ b/mysql-test/t/log_tables.test
@@ -7,6 +7,12 @@
# check that CSV engine was compiled in
--source include/have_csv.inc
+SET @old_general_log_state = @@global.general_log;
+SET @old_log_output= @@global.log_output;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_general_log= @@global.general_log;
+SET @old_long_query_time= @@session.long_query_time;
+
--disable_ps_protocol
use mysql;
@@ -525,7 +531,8 @@ FLUSH LOGS;
ALTER TABLE mysql.slow_log DROP COLUMN seq;
ALTER TABLE mysql.slow_log ENGINE = CSV;
-SET GLOBAL slow_query_log = @saved_slow_query_log;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
#
# Bug#25422 (Hang with log tables)
@@ -829,8 +836,8 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
DROP DATABASE IF EXISTS `db_17876`;
-SET GLOBAL general_log = @saved_general_log;
-SET GLOBAL slow_query_log = @saved_slow_query_log;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
#
# Bug#21557 entries in the general query log truncated at 1000 characters.
@@ -948,7 +955,7 @@ execute long_query using @lparam;
set global general_log = off;
select command_type, argument from mysql.general_log where thread_id = @thread_id;
deallocate prepare long_query;
-set global general_log = @saved_general_log;
+set global general_log = @old_general_log;
#
# Bug#34306: Can't make copy of log tables when server binary log is enabled
@@ -1020,10 +1027,8 @@ DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
-# RESET altered system variables before exiting the test
-SET GLOBAL slow_query_log = @saved_slow_query_log;
-SET GLOBAL general_log=@saved_general_log;
-SET SESSION long_query_time =@saved_long_query_time;
-SET GLOBAL LOG_OUTPUT = @saved_log_output;
-
+SET @@session.long_query_time= @old_long_query_time;
+SET @@global.log_output= @old_log_output;
+SET @@global.slow_query_log= @old_slow_query_log;
+SET @@global.general_log= @old_general_log;
diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test
index d3c9ec5145e..e71d9029606 100644
--- a/mysql-test/t/lowercase_table3.test
+++ b/mysql-test/t/lowercase_table3.test
@@ -9,6 +9,8 @@
--source include/have_case_insensitive_file_system.inc
--source include/not_windows.inc
+call mtr.add_suppression("Cannot find or open table test/BUG29839 from");
+
--disable_warnings
DROP TABLE IF EXISTS t1,T1;
--enable_warnings
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index dd3e4e28aeb..118f8771f91 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -613,6 +613,19 @@ ALTER TABLE m1 UNION=();
SHOW CREATE TABLE m1;
DROP TABLE t1, m1;
+#
+# BUG#32047 - 'Spurious' errors while opening MERGE tables
+#
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a VARCHAR(10));
+CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
+CREATE TABLE m2(a INT) ENGINE=MERGE UNION=(t1);
+SELECT * FROM t1;
+--error ER_WRONG_MRG_TABLE
+SELECT * FROM m1;
+SELECT * FROM m2;
+DROP TABLE t1, t2, m1, m2;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/myisam-system.test b/mysql-test/t/myisam-system.test
index c4a7651ac7d..dc5bb58b6a2 100644
--- a/mysql-test/t/myisam-system.test
+++ b/mysql-test/t/myisam-system.test
@@ -7,14 +7,15 @@ drop table if exists t1,t2;
--enable_warnings
create table t1 (a int) engine=myisam;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI
+let $MYSQLD_DATADIR= `select @@datadir`;
+--remove_file $MYSQLD_DATADIR/test/t1.MYI
drop table if exists t1;
create table t1 (a int) engine=myisam;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI
+--remove_file $MYSQLD_DATADIR/test/t1.MYI
--error 1051,6
drop table t1;
create table t1 (a int) engine=myisam;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD
+--remove_file $MYSQLD_DATADIR/test/t1.MYD
--error 1105,6,29
drop table t1;
--error 1051
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index f8d9f15fab1..6d7e03b1c28 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1473,8 +1473,9 @@ CREATE TABLE t1 (
KEY (c1),
KEY (c2)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYISAMCHK -d $MYSQLTEST_VARDIR/master-data/test/t1
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--exec $MYISAMCHK -d $MYSQLD_DATADIR/test/t1
DROP TABLE t1;
--echo End of 5.1 tests
diff --git a/mysql-test/t/myisampack.test b/mysql-test/t/myisampack.test
index 6598af6318a..f554e7d0184 100644
--- a/mysql-test/t/myisampack.test
+++ b/mysql-test/t/myisampack.test
@@ -26,8 +26,38 @@ INSERT INTO t1 VALUES
(2.22402118719591e-05,2.37546284320705e-05,2.58463051055541e-05,1.83391609130854e-05,1.6300720519646e-05,1.74559091886791e-05,1.63733785575587e-05,2.26616253279828e-05,1.79541237435621e-05,45),
(3.01092775359837e-05,3.23865212934412e-05,4.09444584045994e-05,0,2.15470966302776e-05,2.39082636344032e-05,2.28296706429177e-05,2.9007671511595e-05,2.44201138973326e-05,46);
FLUSH TABLES;
---exec $MYISAMPACK -s $MYSQLTEST_VARDIR/master-data/test/t1
---exec $MYISAMCHK -srq $MYSQLTEST_VARDIR/master-data/test/t1
---exec $MYISAMCHK -s --unpack $MYSQLTEST_VARDIR/master-data/test/t1
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYISAMPACK -s $MYSQLD_DATADIR/test/t1
+--exec $MYISAMCHK -srq $MYSQLD_DATADIR/test/t1
+--exec $MYISAMCHK -s --unpack $MYSQLD_DATADIR/test/t1
CHECK TABLE t1 EXTENDED;
DROP TABLE t1;
+
+#
+# Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table.
+# expanded with testcase for
+# BUG#41574 - REPAIR TABLE: crashes for compressed tables
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1(f1 int, f2 char(255));
+insert into t1 values(1, 'foo'), (2, 'bar');
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+flush tables;
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYISAMPACK $MYSQLD_DATADIR/test/t1
+optimize table t1;
+repair table t1;
+drop table t1;
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 528337da77b..a182da5fbea 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -291,6 +291,30 @@ EOF
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29323.sql 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql;
+#
+# Bug #33812: mysql client incorrectly parsing DELIMITER
+#
+# The space and ; after delimiter are important
+--exec $MYSQL -e "select 1 delimiter ;"
+
+#
+# Bug #38158: mysql client regression, can't read dump files
+#
+--write_file $MYSQLTEST_VARDIR/tmp/bug38158.sql
+-- Testing
+--
+delimiter ||
+select 2 ||
+EOF
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug38158.sql 2>&1
+--exec $MYSQL -c < $MYSQLTEST_VARDIR/tmp/bug38158.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/bug38158.sql;
+
+#
+# Bug #41437: Value stored in 'case' lacks charset, causees segfault
+#
+--exec $MYSQL -e "select @z:='1',@z=database()"
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test
index 7667522feaf..15c0cd4ac84 100644
--- a/mysql-test/t/mysql_client_test.test
+++ b/mysql-test/t/mysql_client_test.test
@@ -1,6 +1,8 @@
# This test should work in embedded server after we fix mysqltest
-- source include/not_embedded.inc
+SET @old_general_log= @@global.general_log;
+
# We run with different binaries for normal and --embedded-server
#
# If this test fails with "command "$MYSQL_CLIENT_TEST" failed",
@@ -14,3 +16,4 @@
# End of 4.1 tests
echo ok;
+SET @@global.general_log= @old_general_log;
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index 233e8c7c256..6b2ce0cd2d6 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -15,7 +15,8 @@ select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
--exec $MYSQL_UPGRADE --skip-verbose 2>&1
# It should have created a file in the MySQL Servers datadir
-file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
+let $MYSQLD_DATADIR= `select @@datadir`;
+file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
--echo Run it again - should say already completed
--replace_result $MYSQL_SERVER_VERSION VERSION
@@ -23,13 +24,13 @@ file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
--exec $MYSQL_UPGRADE --skip-verbose 2>&1
# It should have created a file in the MySQL Servers datadir
-file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
+file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
--echo Force should run it regardless of wether it's been run before
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
# It should have created a file in the MySQL Servers datadir
-file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
+file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
#
diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/t/mysqlbinlog-cp932.test
index 4ca0eedaece..a7055bfc8ca 100644
--- a/mysql-test/t/mysqlbinlog-cp932.test
+++ b/mysql-test/t/mysqlbinlog-cp932.test
@@ -13,7 +13,8 @@ create table t4 (f text character set cp932);
--exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'ƒ\');"
flush logs;
rename table t3 to t03, t4 to t04;
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000002 | $MYSQL --default-character-set=utf8
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000002 | $MYSQL --default-character-set=utf8
# original and recovered data must be equal
select HEX(f) from t03;
select HEX(f) from t3;
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index eb364c60e71..e0595674cf9 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -4,6 +4,9 @@
-- source include/have_log_bin.inc
+# Deletes all the binary logs
+reset master;
+
# we need this for getting fixed timestamps inside of this test
set timestamp=1000000000;
@@ -23,11 +26,11 @@ insert into t2 values ();
# test for load data and load data distributed among the several
# files (we need to fill up first binlog)
-load data infile '../std_data_ln/words.dat' into table t1;
-load data infile '../std_data_ln/words.dat' into table t1;
-load data infile '../std_data_ln/words.dat' into table t1;
-load data infile '../std_data_ln/words.dat' into table t1;
-load data infile '../std_data_ln/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
# simple query to show more in second binlog
insert into t1 values ("Alas");
flush logs;
@@ -41,10 +44,10 @@ select "--- Local --" as "";
# We should use --short-form everywhere because in other case output will
# be time dependend. Better than nothing.
#
-
+let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001
# this should not fail but shouldn't produce any working statements
--disable_query_log
@@ -52,7 +55,7 @@ select "--- Broken LOAD DATA --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000002 2> /dev/null
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000002 2> /dev/null
# this should show almost nothing
--disable_query_log
@@ -60,7 +63,7 @@ select "--- --database --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLTEST_VARDIR/log/master-bin.000001 2> /dev/null
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLD_DATADIR/master-bin.000001 2> /dev/null
# this test for position option
--disable_query_log
@@ -68,7 +71,7 @@ select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=239 $MYSQLTEST_VARDIR/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=239 $MYSQLD_DATADIR/master-bin.000002
# These are tests for remote binlog.
# They should return the same as previous test.
@@ -137,7 +140,7 @@ EOF
# must be digestable for both client and server. In 4.1 the client
# should use default-character-set same as the server.
flush logs;
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000004 | $MYSQL
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL
select * from t5 /* must be (1),(1) */;
drop table t5;
@@ -156,7 +159,7 @@ insert into t5 values (3, date_format('2001-01-01','%W'));
select * from t5 order by c1;
flush logs;
drop table t5;
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000006 | $MYSQL
select * from t5 order by c1;
drop table t5;
@@ -180,8 +183,8 @@ drop procedure p1;
--error 1305
call p1();
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 | $MYSQL
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008 | $MYSQL
call p1();
drop procedure p1;
@@ -200,23 +203,23 @@ drop procedure p1;
flush logs;
create table t1 (a varchar(64) character set utf8);
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=latin1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=latin1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8r;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r;
select hex(a) from t1;
drop table t1;
flush logs;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000010
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000010
#
# Bug#28293 missed '#' sign in the hex dump when the dump length
@@ -229,7 +232,7 @@ flush logs;
INSERT INTO t1 VALUES ('0123456789');
flush logs;
DROP TABLE t1;
---exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000012 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g'
+--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000012 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g'
#
# Bug #29928: incorrect connection_id() restoring from mysqlbinlog out
@@ -239,7 +242,7 @@ create table t1(a int);
insert into t1 values(connection_id());
let $a= `select a from t1`;
flush logs;
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000014 > $MYSQLTEST_VARDIR/tmp/bug29928.sql
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $MYSQLTEST_VARDIR/tmp/bug29928.sql
drop table t1;
connect (con1, localhost, root, , test);
connection con1;
@@ -263,8 +266,8 @@ exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTES
#
flush logs;
--error 1
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000016 >/dev/null 2>/dev/null
---exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000016 >/dev/null 2>/dev/null
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
+--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
--echo BUG#31611: Security risk with BINLOG statement
@@ -280,7 +283,7 @@ flush logs;
INSERT INTO t1 VALUES (1,USER());
flush logs;
echo mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql;
-exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql;
+exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql;
connect (unsecure,localhost,untrusted,,mysqltest1);
echo mysql mysqltest1 -uuntrusted < var/tmp/bug31611.sql;
error 1;
@@ -313,7 +316,7 @@ query_vertical SELECT * FROM t1;
DROP TABLE t1;
echo >> mysqlbinlog var/log/master-bin.000019 > var/tmp/bug32580.sql;
-exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000019 > $MYSQLTEST_VARDIR/tmp/bug32580.sql;
+exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000019 > $MYSQLTEST_VARDIR/tmp/bug32580.sql;
echo >> mysql test < var/tmp/bug32580.sql;
exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug32580.sql;
remove_file $MYSQLTEST_VARDIR/tmp/bug32580.sql;
diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test
index 59017b09c54..d6be029ea56 100644
--- a/mysql-test/t/mysqlbinlog2.test
+++ b/mysql-test/t/mysqlbinlog2.test
@@ -40,33 +40,33 @@ select "--- Local --" as "";
# We should use --short-form everywhere because in other case output will
# be time dependent (the Start events). Better than nothing.
#
-
---exec $MYSQL_BINLOG --short-form --base64-output=never $MYSQLTEST_VARDIR/log/master-bin.000001
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYSQL_BINLOG --short-form --base64-output=never $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- offset --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start and stop positions ---" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- stop-datetime --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- Local with 2 binlogs on command line --" as "";
@@ -75,28 +75,28 @@ select "--- Local with 2 binlogs on command line --" as "";
# This is to verify that some options apply only to first, or last binlog
flush logs;
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- offset --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- stop-datetime --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- Remote --" as "";
diff --git a/mysql-test/t/mysqlbinlog_base64.test b/mysql-test/t/mysqlbinlog_base64.test
index 1b5dc67c150..fb21e28fdcb 100644
--- a/mysql-test/t/mysqlbinlog_base64.test
+++ b/mysql-test/t/mysqlbinlog_base64.test
@@ -1,5 +1,10 @@
-- source include/have_binlog_format_row.inc
#
+# Reset master to cleanup binlog
+#
+reset master;
+
+#
# Write different events to binlog
#
create table t1 (a int);
@@ -10,13 +15,14 @@ update t1 set a=a+2 where a=2;
update t1 set a=a+2 where a=3;
create table t2 (word varchar(20));
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
#
# Save binlog
#
+let $MYSQLD_DATADIR=`select @@datadir`;
flush logs;
---exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
+--exec $MYSQL_BINLOG --hexdump $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
#
# Clear database and restore from binlog
@@ -38,7 +44,7 @@ select * from t2;
flush logs;
drop table t2;
create table t2 (word varchar(20));
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
insert into t2 select * from t2;
insert into t2 select * from t2;
insert into t2 select * from t2;
@@ -51,7 +57,7 @@ insert into t2 select * from t2;
select count(*) from t2;
flush logs;
---exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000003 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
+--exec $MYSQL_BINLOG --hexdump $MYSQLD_DATADIR/master-bin.000003 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
#
@@ -62,6 +68,6 @@ select count(*) from t2;
#
# Test cleanup
#
---exec rm $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
drop table t1;
drop table t2;
diff --git a/mysql-test/t/mysqlbinlog_row.test b/mysql-test/t/mysqlbinlog_row.test
index 9d94e1f55e7..9b41c63d195 100644
--- a/mysql-test/t/mysqlbinlog_row.test
+++ b/mysql-test/t/mysqlbinlog_row.test
@@ -443,4 +443,4 @@ flush logs;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/
---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
diff --git a/mysql-test/t/mysqlbinlog_row_big.test b/mysql-test/t/mysqlbinlog_row_big.test
index 62c8c7df327..14e818e7214 100644
--- a/mysql-test/t/mysqlbinlog_row_big.test
+++ b/mysql-test/t/mysqlbinlog_row_big.test
@@ -38,7 +38,7 @@ SET timestamp=1000000000;
--echo #
--echo # We need big packets.
--echo #
-SET @@session.max_allowed_packet= 1024*1024*1024;
+SET @@global.max_allowed_packet= 1024*1024*1024;
--echo #
--echo # Delete all existing binary logs.
@@ -115,7 +115,7 @@ FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/
---exec $MYSQL_BINLOG -v -v $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output
+--exec $MYSQL_BINLOG -v -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output
--echo #
--echo # Cleanup.
diff --git a/mysql-test/t/mysqlbinlog_row_trans.test b/mysql-test/t/mysqlbinlog_row_trans.test
index d84b1743783..24abc441c4c 100644
--- a/mysql-test/t/mysqlbinlog_row_trans.test
+++ b/mysql-test/t/mysqlbinlog_row_trans.test
@@ -151,7 +151,7 @@ FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/
---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo # Cleanup.
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index 0e675731fd5..e834c60dcb5 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -14,6 +14,9 @@
DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
drop view if exists v1;
drop database if exists client_test_db;
+# Repair any tables in mysql, sometimes the slow_log is marked as crashed
+# after server has been killed
+--exec $MYSQL_CHECK --repair --databases mysql > /dev/null 2>&1
--enable_warnings
#
@@ -55,9 +58,10 @@ create table t_bug25347 (a int);
create view v_bug25347 as select * from t_bug25347;
insert into t_bug25347 values (1),(2),(3);
flush tables;
+let $MYSQLD_DATADIR= `select @@datadir`;
--echo removing and creating
---remove_file $MYSQLTEST_VARDIR/master-data/d_bug25347/t_bug25347.MYI
---write_file $MYSQLTEST_VARDIR/master-data/d_bug25347/t_bug25347.MYI
+--remove_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI
+--write_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI
EOF
--exec $MYSQL_CHECK --repair --databases d_bug25347
--error 130
@@ -78,7 +82,6 @@ create view v1 as select * from information_schema.routines;
check table v1, information_schema.routines;
drop view v1;
-
#
# Bug#37527: mysqlcheck fails to report entire database
# when frm file corruption
@@ -86,29 +89,109 @@ drop view v1;
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
# backup then null t1.frm
---copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
---write_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
+--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t1.frm.bak
+--remove_file $MYSQLD_DATADIR/test/t1.frm
+--write_file $MYSQLD_DATADIR/test/t1.frm
EOF
--exec $MYSQL_CHECK test
# restore t1.frm
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
---copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak $MYSQLTEST_VARDIR/master-data/test/t1.frm
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak
+--remove_file $MYSQLD_DATADIR/test/t1.frm
+--copy_file $MYSQLD_DATADIR/test/t1.frm.bak $MYSQLD_DATADIR/test/t1.frm
+--remove_file $MYSQLD_DATADIR/test/t1.frm.bak
DROP TABLE t1, t2;
--echo End of 5.0 tests
+
#
# Bug #30679: 5.1 name encoding not performed for views during upgrade
#
create table t1(a int);
create view v1 as select * from t1;
show tables;
---copy_file $MYSQLTEST_VARDIR/master-data/test/v1.frm $MYSQLTEST_VARDIR/master-data/test/v-1.frm
+let $MYSQLD_DATADIR= `select @@datadir`;
+--copy_file $MYSQLD_DATADIR/test/v1.frm $MYSQLD_DATADIR/test/v-1.frm
show tables;
--exec $MYSQL_CHECK --check-upgrade --fix-table-names --databases test
show tables;
drop view v1, `v-1`;
drop table t1;
+
+
+#
+# Bug #33094: Error in upgrading from 5.0 to 5.1 when table contains triggers
+# Bug #41385: Crash when attempting to repair a #mysql50# upgraded table with
+# triggers
+#
+SET NAMES utf8;
+CREATE TABLE `#mysql50#@` (a INT);
+SHOW TABLES;
+SET NAMES DEFAULT;
+--echo mysqlcheck --fix-table-names --databases test
+--exec $MYSQL_CHECK --fix-table-names --databases test
+SET NAMES utf8;
+SHOW TABLES;
+DROP TABLE `@`;
+
+CREATE TABLE `Ñ` (a INT);
+SET NAMES DEFAULT;
+--echo mysqlcheck --default-character-set="latin1" --databases test
+# Error returned depends on platform, replace it with "Table doesn't exist"
+--replace_result "Can't find file: './test/@003f.frm' (errno: 22)" "Table doesn't exist" "Table 'test.?' doesn't exist" "Table doesn't exist"
+--exec $MYSQL_CHECK --default-character-set="latin1" --databases test
+--echo mysqlcheck --default-character-set="utf8" --databases test
+--exec $MYSQL_CHECK --default-character-set="utf8" --databases test
+SET NAMES utf8;
+DROP TABLE `Ñ`;
+SET NAMES DEFAULT;
+
+CREATE DATABASE `#mysql50#a@b`;
+USE `#mysql50#a@b`;
+CREATE TABLE `#mysql50#c@d` (a INT);
+CREATE TABLE t1 (a INT);
+
+# Create 5.0 like triggers
+let $MYSQLTEST_VARDIR= `select @@datadir`;
+--write_file $MYSQLTEST_VARDIR/a@b/c@d.TRG
+TYPE=TRIGGERS
+triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON `c@d` FOR EACH ROW SET NEW.a = 10 * NEW.a'
+sql_modes=0
+definers='root@localhost'
+EOF
+--write_file $MYSQLTEST_VARDIR/a@b/tr1.TRN
+TYPE=TRIGGERNAME
+trigger_table=c@d
+EOF
+--write_file $MYSQLTEST_VARDIR/a@b/t1.TRG
+TYPE=TRIGGERS
+triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr2 BEFORE INSERT ON `a@b`.t1 FOR EACH ROW SET NEW.a = 100 * NEW.a'
+sql_modes=0
+definers='root@localhost'
+EOF
+--write_file $MYSQLTEST_VARDIR/a@b/tr2.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+ WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
+
+--echo mysqlcheck --fix-db-names --fix-table-names --all-databases
+--exec $MYSQL_CHECK --fix-db-names --fix-table-names --all-databases
+
+USE `a@b`;
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+ WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name;
+
+INSERT INTO `c@d` VALUES (2), (1);
+SELECT * FROM `c@d`;
+INSERT INTO t1 VALUES (3), (5);
+SELECT * FROM t1;
+
+DROP DATABASE `a@b`;
+
+USE test;
+
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 8084457b92b..e93c9cbd274 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -5,10 +5,13 @@
# Binlog is required
--source include/have_log_bin.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
---echo Bug#37938 - Test "mysqldump" lacks various insert statements
---echo Turn off concurrent inserts to avoid random errors
---echo NOTE: We reset the variable back to saved value at the end of test
+
+--echo # Bug#37938 Test "mysqldump" lacks various insert statements
+--echo # Turn off concurrent inserts to avoid random errors
+--echo # NOTE: We reset the variable back to saved value at the end of test
SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT = 0;
@@ -23,13 +26,13 @@ drop view if exists v1, v2, v3;
# XML output
-CREATE TABLE t1(a int, key (a)) key_block_size=1024;
+CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments -X test t1
DROP TABLE t1;
--echo #
---echo # Bug #2005
+--echo # Bug#2005 Long decimal comparison bug.
--echo #
CREATE TABLE t1 (a decimal(64, 20));
@@ -39,7 +42,7 @@ INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
DROP TABLE t1;
--echo #
---echo # Bug #2055
+--echo # Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL"
--echo #
CREATE TABLE t1 (a double);
@@ -51,7 +54,7 @@ INSERT INTO t1 VALUES ('-9e999999');
DROP TABLE t1;
--echo #
---echo # Bug #3361 mysqldump quotes DECIMAL values inconsistently
+--echo # Bug#3361 mysqldump quotes DECIMAL values inconsistently
--echo #
CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
@@ -65,7 +68,7 @@ INSERT INTO t1 VALUES ("1.2345", 2.3456);
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES';
INSERT INTO t1 VALUES (1.2345, 2.3456);
INSERT INTO t1 VALUES ('1.2345', 2.3456);
---error 1054
+--error ER_BAD_FIELD_ERROR
INSERT INTO t1 VALUES ("1.2345", 2.3456);
SET SQL_MODE=@OLD_SQL_MODE;
@@ -82,7 +85,7 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
DROP TABLE t1;
--echo #
---echo # Bug #1707
+--echo # Bug#1707 mysqldump -X does't quote field and table names
--echo #
CREATE TABLE t1 (`a"b"` char(2));
@@ -91,8 +94,8 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
DROP TABLE t1;
--echo #
---echo # Bug #1994
---echo # Bug #4261
+--echo # Bug#1994 mysqldump does not correctly dump UCS2 data
+--echo # Bug#4261 mysqldump 10.7 (mysql 4.1.2) --skip-extended-insert drops NULL from inserts
--echo #
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
@@ -101,7 +104,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
DROP TABLE t1;
--echo #
---echo # Bug #2634
+--echo # Bug#2634 mysqldump in --compatible=mysql4
--echo #
CREATE TABLE t1 (a int) ENGINE=MYISAM;
@@ -111,7 +114,7 @@ INSERT INTO t1 VALUES (1), (2);
DROP TABLE t1;
--echo #
---echo # Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
+--echo # Bug#2592 mysqldump doesn't quote "tricky" names correctly
--echo #
create table ```a` (i int);
@@ -119,7 +122,7 @@ create table ```a` (i int);
drop table ```a`;
--echo #
---echo # Bug #2591 "mysqldump quotes names inconsistently"
+--echo # Bug#2591 mysqldump quotes names inconsistently
--echo #
create table t1(a int);
@@ -132,7 +135,7 @@ set global sql_mode='';
drop table t1;
--echo #
---echo # Bug #2705 'mysqldump --tab extra output'
+--echo # Bug#2705 mysqldump --tab extra output
--echo #
create table t1(a int);
@@ -148,7 +151,7 @@ insert into t1 values (1),(2),(3);
drop table t1;
--echo #
---echo # Bug #6101: create database problem
+--echo # Bug#6101 create database problem
--echo #
--exec $MYSQL_DUMP --skip-comments --databases test
@@ -158,7 +161,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
drop database mysqldump_test_db;
--echo #
---echo # Bug #7020
+--echo # Bug#7020 mysqldump --compatible=mysql40 should set --skip-set-charset --default-char...
--echo # Check that we don't dump in UTF8 in compatible mode by default,
--echo # but use the default compiled values, or the values given in
--echo # --default-character-set=xxx. However, we should dump in UTF8
@@ -169,8 +172,8 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
--echo #
---echo # Bug#8063: make test mysqldump [ fail ]
---echo # We cannot tes this command because its output depends
+--echo # Bug#8063 make test mysqldump [ fail ]
+--echo # We cannot test this command because its output depends
--echo # on --default-character-set incompiled into "mysqldump" program.
--echo # If the future we can move this command into a separate test with
--echo # checking that "mysqldump" is compiled with "latin1"
@@ -183,7 +186,7 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
DROP TABLE t1;
--echo #
---echo # WL #2319: Exclude Tables from dump
+--echo # WL#2319 Exclude Tables from dump
--echo #
CREATE TABLE t1 (a int);
@@ -195,7 +198,7 @@ DROP TABLE t1;
DROP TABLE t2;
--echo #
---echo # Bug #8830
+--echo # Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values
--echo #
CREATE TABLE t1 (`b` blob);
@@ -207,7 +210,7 @@ DROP TABLE t1;
--echo # Test for --insert-ignore
--echo #
-CREATE TABLE t1 (a int);
+CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t1 VALUES (4),(5),(6);
--exec $MYSQL_DUMP --skip-comments --insert-ignore test t1
@@ -215,9 +218,9 @@ INSERT INTO t1 VALUES (4),(5),(6);
DROP TABLE t1;
--echo #
---echo # Bug #10286: mysqldump -c crashes on table that has many fields with long
---echo # names
---echo #
+--echo # Bug#10286 mysqldump -c crashes on table that has many fields with long
+--echo # names
+--echo #
create table t1 (
F_c4ca4238a0b923820dcc509a6f75849b int,
F_c81e728d9d4c2f636f067f89cc14862c int,
@@ -563,7 +566,7 @@ INSERT INTO t1 VALUES (1),(2),(3);
DROP TABLE t1;
--echo #
---echo # Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
+--echo # Bug#9558 mysqldump --no-data db t1 t2 format still dumps data
--echo #
CREATE DATABASE mysqldump_test_db;
@@ -582,7 +585,7 @@ DROP DATABASE mysqldump_test_db;
--echo #
--echo # Testing with tables and databases that don't exists
--echo # or contains illegal characters
---echo # (Bug #9358 mysqldump crashes if tablename starts with \)
+--echo # (Bug#9358 mysqldump crashes if tablename starts with \)
--echo #
create database mysqldump_test_db;
use mysqldump_test_db;
@@ -601,7 +604,7 @@ select '------ Testing with illegal table names ------' as test_sequence ;
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
-
+
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1
@@ -644,7 +647,7 @@ use test;
--echo #
---echo # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
+--echo # Bug#9657 mysqldump xml ( -x ) does not format NULL fields correctly
--echo #
create table t1 (a int(10));
@@ -655,8 +658,9 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
--exec $MYSQL_DUMP --skip-comments --xml --no-create-info test
drop table t1, t2;
+
--echo #
---echo # BUG #12123
+--echo # Bug#12123 mysqldump --tab results in text file which can't be imported
--echo #
create table t1 (a text character set utf8, b text character set latin1);
@@ -669,14 +673,15 @@ select * from t1;
drop table t1;
+
--echo #
---echo # BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
+--echo # Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
--echo #
--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
--echo #
---echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
+--echo # Bug#19025 mysqldump doesn't correctly dump "auto_increment = [int]"
--echo #
create table `t1` (
@@ -704,9 +709,11 @@ select * from t1;
show create table `t1`;
drop table `t1`;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug19025.sql
+
--echo #
---echo # Bug #18536: wrong table order
+--echo # Bug#18536 wrong table order
--echo #
create table t1(a int);
@@ -716,8 +723,9 @@ create table t3(a int);
--exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
drop table t1, t2, t3;
+
--echo #
---echo # Bug #21288: mysqldump segmentation fault when using --where
+--echo # Bug#21288 mysqldump segmentation fault when using --where
--echo #
create table t1 (a int);
@@ -725,8 +733,9 @@ create table t1 (a int);
--exec $MYSQL_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1
drop table t1;
+
--echo #
---echo # BUG#13926: --order-by-primary fails if PKEY contains quote character
+--echo # Bug#13926 --order-by-primary fails if PKEY contains quote character
--echo #
--disable_warnings
@@ -746,8 +755,9 @@ DROP TABLE `t1`;
--echo End of 4.1 tests
+
--echo #
---echo # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
+--echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
--echo #
create database db1;
@@ -770,8 +780,9 @@ drop view v2;
drop database db1;
use test;
+
--echo #
---echo # Bug 10713 mysqldump includes database in create view and referenced tables
+--echo # Bug#10713 mysqldump includes database in create view and referenced tables
--echo #
# create table and views in db2
@@ -805,10 +816,11 @@ select * from t2 order by a;
drop table t1, t2;
drop database db1;
use test;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug10713.sql
---echo #
---echo # dump of view
---echo #
+#
+# dump of view
+#
create table t1(a int);
create view v1 as select * from t1;
@@ -816,8 +828,9 @@ create view v1 as select * from t1;
drop view v1;
drop table t1;
+
--echo #
---echo # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
+--echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
--echo #
create database mysqldump_test_db;
@@ -841,7 +854,7 @@ drop database mysqldump_test_db;
use test;
--echo #
---echo # Bug #9756
+--echo # Bug#9756 mysql client failing on dumps containing certain \ sequences
--echo #
CREATE TABLE t1 (a char(10));
@@ -850,7 +863,7 @@ INSERT INTO t1 VALUES ('\'');
DROP TABLE t1;
--echo #
---echo # Bug #10927 mysqldump: Can't reload dump with view that consist of other view
+--echo # Bug#10927 mysqldump: Can't reload dump with view that consist of other view
--echo #
create table t1(a int, b int, c varchar(30));
@@ -922,7 +935,9 @@ show triggers;
DROP TABLE t1, t2;
--echo #
---echo # Bugs #9136, #12917: problems with --defaults-extra-file option
+--echo # Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a
+--echo # Bug#12917 The --defaults-extra-file option is ignored by the 5.0 client binaries
+--echo # (Problems with --defaults-extra-file option)
--echo #
--write_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
@@ -934,7 +949,7 @@ EOF
--remove_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
--echo #
---echo # Test of fix to BUG 12597
+--echo # Test of fix to Bug#12597 mysqldump dumps triggers wrongly
--echo #
DROP TABLE IF EXISTS `test1`;
@@ -970,9 +985,11 @@ SELECT * FROM `test2`;
DROP TRIGGER testref;
DROP TABLE test1;
DROP TABLE test2;
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqldump.sql
+
--echo #
---echo # BUG#9056 - mysqldump does not dump routines
+--echo # Bug#9056 mysqldump does not dump routines
--echo #
--disable_warnings
@@ -998,9 +1015,9 @@ begin
return f1;
end //
-CREATE PROCEDURE bug9056_proc2(OUT a INT)
-BEGIN
- select sum(id) from t1 into a;
+CREATE PROCEDURE bug9056_proc2(OUT a INT)
+BEGIN
+ select sum(id) from t1 into a;
END //
DELIMITER ;//
@@ -1009,7 +1026,7 @@ set sql_mode='ansi';
create procedure `a'b` () select 1; # to fix syntax highlighting :')
set sql_mode='';
-# Dump the DB and ROUTINES
+# Dump the DB and ROUTINES
--exec $MYSQL_DUMP --skip-comments --routines --databases test
# ok, now blow it all away
@@ -1020,8 +1037,9 @@ DROP PROCEDURE bug9056_proc2;
DROP PROCEDURE `a'b`;
drop table t1;
+
--echo #
---echo # BUG# 13052 - mysqldump timestamp reloads broken
+--echo # Bug#13052 mysqldump timestamp reloads broken
--echo #
--disable_warnings
@@ -1044,7 +1062,7 @@ set global time_zone=default;
set time_zone=default;
--echo #
---echo # Test of fix to BUG 13146 - ansi quotes break loading of triggers
+--echo # Test of fix to Bug#13146 ansi quotes break loading of triggers
--echo #
--disable_warnings
@@ -1069,7 +1087,7 @@ INSERT INTO `t1 test` VALUES (1);
INSERT INTO `t1 test` VALUES (2);
INSERT INTO `t1 test` VALUES (3);
SELECT * FROM `t2 test`;
-# dump with compatible=ansi. Everything except triggers should be double
+# dump with compatible=ansi. Everything except triggers should be double
# quoted
--exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test
@@ -1078,7 +1096,7 @@ DROP TABLE `t1 test`;
DROP TABLE `t2 test`;
--echo #
---echo # BUG# 12838 mysqldump -x with views exits with error
+--echo # Bug#12838 mysqldump -x with views exits with error
--echo #
--disable_warnings
@@ -1095,13 +1113,14 @@ create view v2 as select * from v0;
select * from v2;
--exec $MYSQL_DUMP -x --skip-comments --databases test
+
drop view v2;
drop view v0;
drop view v1;
drop table t1;
--echo #
---echo # BUG#14554 - mysqldump does not separate words "ROW" and "BEGIN"
+--echo # Bug#14554 mysqldump does not separate words "ROW" and "BEGIN"
--echo # for tables with trigger created in the IGNORE_SPACE sql mode.
--echo #
@@ -1125,8 +1144,8 @@ DROP TRIGGER tr1;
DROP TABLE t1;
--echo #
---echo # Bug #13318: Bad result with empty field and --hex-blob
---echo #
+--echo # Bug#13318 Bad result with empty field and --hex-blob
+--echo #
create table t1 (a binary(1), b blob);
insert into t1 values ('','');
@@ -1135,7 +1154,7 @@ insert into t1 values ('','');
drop table t1;
--echo #
---echo # Bug 14871 Invalid view dump output
+--echo # Bug#14871 Invalid view dump output
--echo #
create table t1 (a int);
@@ -1162,9 +1181,11 @@ select * from v3 order by a;
drop table t1;
drop view v1, v2, v3, v4, v5;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug14871.sql
+
--echo #
---echo # Bug #16878 dump of trigger
+--echo # Bug#16878 dump of trigger
--echo #
create table t1 (a int, created datetime);
@@ -1192,6 +1213,8 @@ show triggers;
drop trigger tr1;
drop trigger tr2;
drop table t1, t2;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug16878.sql
+
--echo #
--echo # Bug#18462 mysqldump does not dump view structures correctly
@@ -1211,11 +1234,15 @@ create view v2 as select qty from v1;
drop view v1;
drop view v2;
drop table t;
+--remove_file $MYSQLTEST_VARDIR/tmp/v1.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/v2.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/t.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/t.txt
--echo #
--echo # Bug#14857 Reading dump files with single statement stored routines fails.
---echo # fixed by patch for bug#16878
+--echo # fixed by patch for Bug#16878
--echo #
DELIMITER |;
@@ -1230,7 +1257,7 @@ drop function f;
drop procedure p;
--echo #
---echo # Bug #17371 Unable to dump a schema with invalid views
+--echo # Bug#17371 Unable to dump a schema with invalid views
--echo #
create table t1 ( id serial );
@@ -1243,7 +1270,8 @@ drop table t1;
--echo } mysqldump
drop view v1;
---echo # BUG#17201 Spurious 'DROP DATABASE' in output,
+
+--echo # Bug#17201 Spurious 'DROP DATABASE' in output,
--echo # also confusion between tables and views.
--echo # Example code from Markus Popp
@@ -1260,8 +1288,9 @@ drop view v1;
drop table t1;
drop database mysqldump_test_db;
+
--echo #
---echo # Bug21014 Segmentation fault of mysqldump on view
+--echo # Bug#21014 Segmentation fault of mysqldump on view
--echo #
create database mysqldump_tables;
@@ -1280,7 +1309,7 @@ drop table mysqldump_tables.basetable;
drop database mysqldump_tables;
--echo #
---echo # Bug20221 Dumping of multiple databases containing view(s) yields maleformed dumps
+--echo # Bug#20221 Dumping of multiple databases containing view(s) yields maleformed dumps
--echo #
create database mysqldump_dba;
@@ -1318,6 +1347,7 @@ use mysqldump_dbb;
drop view v1;
drop table t1;
drop database mysqldump_dbb;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug20221_backup
use test;
--echo #
@@ -1364,11 +1394,12 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
+
--echo #
---echo # Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
---echo # information_schema database.
+--echo # Bug#21527 mysqldump incorrectly tries to LOCK TABLES on the
+--echo # information_schema database.
--echo #
---echo # Bug #21424 mysqldump failing to export/import views
+--echo # Bug#21424 mysqldump failing to export/import views
--echo #
# Do as root
@@ -1389,7 +1420,7 @@ create table u1 (f1 int);
insert into u1 values (4);
create view v1 (c1) as select * from t1;
-# Backup should not fail for Bug #21527. Flush priviliges test begins.
+# Backup should not fail for Bug#21527. Flush priviliges test begins.
--exec $MYSQL_DUMP --skip-comments --add-drop-table --flush-privileges --ignore-table=mysql.general_log --ignore-table=mysql.slow_log --databases mysqldump_myDB mysql > $MYSQLTEST_VARDIR/tmp/bug21527.sql
# Clean up
@@ -1403,8 +1434,9 @@ drop user myDB_User@localhost;
drop database mysqldump_myDB;
flush privileges;
---echo # Bug #21424 continues from here.
---echo # Restore. Flush Privileges test ends.
+
+--echo # Bug#21424 continues from here.
+--echo # Restore. Flush Privileges test ends.
--echo #
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21527.sql
@@ -1417,8 +1449,9 @@ use mysqldump_myDB;
select * from mysqldump_myDB.v1;
select * from mysqldump_myDB.u1;
-#Final cleanup.
+# Final cleanup.
connection root;
+disconnect user1;
use mysqldump_myDB;
drop view v1;
drop table t1;
@@ -1426,10 +1459,14 @@ drop table u1;
revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
drop user myDB_User@localhost;
drop database mysqldump_myDB;
+connection default;
+disconnect root;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug21527.sql
use test;
+
--echo #
---echo # Bug #19745: mysqldump --xml produces invalid xml
+--echo # Bug#19745 mysqldump --xml produces invalid xml
--echo #
--disable_warnings
@@ -1444,9 +1481,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
DROP TABLE t1;
-
--echo #
---echo # Bug#26346: stack + buffer overrun in mysqldump
+--echo # Bug#26346 stack + buffer overrun in mysqldump
--echo #
CREATE TABLE t1(a int);
@@ -1467,18 +1503,20 @@ INSERT INTO t1 VALUES (1), (2);
DROP TABLE t1;
+
#
-# Bug #25993: crashe with a merge table and -c
+# Bug#25993 crashes with a merge table and -c
#
-CREATE TABLE t2 (a int);
-CREATE TABLE t3 (a int);
-CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3);
+CREATE TABLE t2 (a INT);
+CREATE TABLE t3 (a INT);
+CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
--exec $MYSQL_DUMP --skip-comments -c test
DROP TABLE t1, t2, t3;
+
--echo #
---echo # Bug #23491: MySQLDump prefix function call in a view by database name
+--echo # Bug#23491 MySQLDump prefix function call in a view by database name
--echo #
# Setup
@@ -1508,13 +1546,16 @@ show create view bug23491_restore.v3;
drop database bug23491_original;
drop database bug23491_restore;
use test;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql
+
+
---echo #
---echo # Bug 27293: mysqldump crashes when dumping routines
---echo # defined by a different user
--echo #
---echo # Bug #22761: mysqldump reports no errors when using
---echo # --routines without mysql.proc privileges
+--echo # Bug#27293 mysqldump crashes when dumping routines
+--echo # defined by a different user
+--echo #
+--echo # Bug#22761 mysqldump reports no errors when using
+--echo # --routines without mysql.proc privileges
--echo #
create database mysqldump_test_db;
@@ -1535,13 +1576,14 @@ create procedure mysqldump_test_db.sp1() select 'hello';
drop procedure sp1;
connection default;
+disconnect user27293;
drop user user1;
drop user user2;
drop database mysqldump_test_db;
--echo #
---echo # Bug #28522: buffer overrun by '\0' byte using --hex-blob.
+--echo # Bug#28522 buffer overrun by '\0' byte using --hex-blob.
--echo #
CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
@@ -1550,8 +1592,8 @@ INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
DROP TABLE t1;
--echo #
---echo # Bug #28524: mysqldump --skip-add-drop-table is not
---echo # compatible with views
+--echo # Bug#28524 mysqldump --skip-add-drop-table is not
+--echo # compatible with views
--echo #
CREATE VIEW v1 AS SELECT 1;
@@ -1561,10 +1603,12 @@ DROP VIEW v1;
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug28524.sql
SELECT * FROM v1;
DROP VIEW v1;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug28524.sql
+
--echo #
---echo # Bug #29788: mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
---echo # the SQL_MODE variable after the dumping of triggers.
+--echo # Bug#29788 mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
+--echo # the SQL_MODE variable after the dumping of triggers.
--echo #
CREATE TABLE t1 (c1 INT);
@@ -1583,10 +1627,12 @@ SELECT * FROM t2;
SELECT * FROM t2;
DROP TABLE t1,t2;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug29788.sql
+
--echo #
---echo # Bug#29815: new option for suppressing last line of mysqldump:
---echo # "Dump completed on"
+--echo # Bug#29815 new option for suppressing last line of mysqldump:
+--echo # "Dump completed on"
--echo #
--echo # --skip-dump-date:
@@ -1623,7 +1669,7 @@ DROP TABLE t1;
# Added for use-thread option
#
-# THIS PART OF THE TEST IS DISABLED UNTIL BUG#32991 IS FIXED
+# THIS PART OF THE TEST IS DISABLED UNTIL Bug#32991 IS FIXED
if ($bug32991_fixed) {
create table t1 (a text , b text);
@@ -1646,7 +1692,7 @@ select * from t2;
# Now we test with multiple threads, but less threads than files.
create table words(a varchar(255));
create table words2(b varchar(255));
---exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data_ln/words.dat $MYSQLTEST_VARDIR/std_data_ln/words2.dat
+--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat
select * from t1;
select * from t2;
select * from words;
@@ -1656,7 +1702,7 @@ select * from words2;
drop table words;
--replace_regex /.*mysqlimport(\.exe)*/mysql-import/
--error 1
---exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data_ln/words.dat $MYSQLTEST_VARDIR/std_data_ln/words2.dat 2>&1
+--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat 2>&1
drop table t1;
drop table t2;
@@ -1666,7 +1712,7 @@ drop table words2;
}
--echo #
---echo # BUG# 16853: mysqldump doesn't show events
+--echo # Bug#16853 mysqldump doesn't show events
--echo #
create database first;
@@ -1685,6 +1731,7 @@ use second;
--exec $MYSQL second < $MYSQLTEST_VARDIR/tmp/bug16853-1.sql
show events;
show create event ee1;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug16853-1.sql
## prove three works (with spaces and tabs on the end)
# start with one from the previous restore
@@ -1699,13 +1746,14 @@ use third;
--exec $MYSQL third < $MYSQLTEST_VARDIR/tmp/bug16853-2.sql
show events;
drop database third;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug16853-2.sql
# revert back to normal settings
set time_zone = 'SYSTEM';
use test;
--echo #
---echo # BUG#17201 Spurious 'DROP DATABASE' in output,
+--echo # Bug#17201 Spurious 'DROP DATABASE' in output,
--echo # also confusion between tables and views.
--echo # Example code from Markus Popp
--echo #
@@ -1724,7 +1772,7 @@ drop table t1;
drop database mysqldump_test_db;
#
-# BUG#26121 mysqldump includes LOCK TABLES general_log WRITE
+# Bug#26121 mysqldump includes LOCK TABLES general_log WRITE
#
--exec $MYSQL_DUMP --all-databases > $MYSQLTEST_VARDIR/tmp/bug26121.sql
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug26121.sql
@@ -1733,8 +1781,8 @@ drop database mysqldump_test_db;
###########################################################################
--echo #
---echo # Bug #30027: mysqldump does not dump views properly.
---echo #
+--echo # Bug#30027 mysqldump does not dump views properly.
+--echo #
--echo
--echo # Cleanup.
@@ -1784,12 +1832,13 @@ set names latin1;
--echo # Cleanup.
DROP DATABASE mysqldump_test_db;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug30027.sql
###########################################################################
--echo #
---echo # BUG#29938: wrong behavior of mysqldump --skip-events
---echo # with --all-databases
+--echo # Bug#29938 wrong behavior of mysqldump --skip-events
+--echo # with --all-databases
--echo #
TRUNCATE mysql.event;
@@ -1802,6 +1851,7 @@ SHOW EVENTS;
TRUNCATE mysql.event;
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29938.sql
SHOW EVENTS;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug29938.sql
--echo #
@@ -1818,7 +1868,7 @@ use test;
--echo
--echo # -----------------------------------------------------------------
---echo # -- Bug#30217: Views: changes in metadata behaviour between 5.0 and 5.1.
+--echo # -- Bug#30217 Views: changes in metadata behaviour between 5.0 and 5.1.
--echo # -----------------------------------------------------------------
--echo
@@ -1863,6 +1913,7 @@ WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1';
--echo
DROP DATABASE mysqldump_test_db;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug30217.sql
--echo
--echo # -- End of test case for Bug#32538.
@@ -1877,3 +1928,6 @@ SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
--echo #
--echo # End of 5.1 tests
--echo #
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index b4b4cf2f308..6c5efba8b5b 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1229,7 +1229,7 @@ select "a" as col1, "c" as col2;
--exec echo "replace_result a;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_result a ;" | $MYSQL_TEST 2>&1
---exec echo "replace_result a b; echo OK;" | $MYSQL_TEST 2>&1
+--exec echo "replace_result a b; echo OK; exit;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_result a b c" | $MYSQL_TEST 2>&1
--error 1
@@ -1293,7 +1293,7 @@ while ($i)
dec $i;
}
EOF
---exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1
+--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK; exit;" | $MYSQL_TEST 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
# Repeat connect/disconnect
@@ -1500,6 +1500,7 @@ echo Multi statement using expected error;
--exec echo "select 'select-me';" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "insertz "error query"||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "delimiter ;||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
+--exec echo "exit;" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
# These two should work since the error is expected
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql 2>&1
@@ -1692,6 +1693,7 @@ EOF
--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff4.tmp
--error 1
--diff_files $MYSQLTEST_VARDIR/tmp/diff4.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
+exit;
EOF
# Execute the above diffs, and send their output to /dev/null - only
@@ -2147,5 +2149,71 @@ rmdir $MYSQLTEST_VARDIR/tmp/testdir;
--replace_result c:\\a.txt z
SELECT 'c:\\a.txt' AS col;
+#
+# Bug #32307 mysqltest - does not detect illegal if syntax
+#
+
+let $test= 1;
+if ($test){
+ echo hej;
+}
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+if ($mysql_errno != 1436)
+{
+ echo ^ Should not be allowed!
+}
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+
+
+# ----------------------------------------------------------------------------
+# Test that -- is not allowed as comment, only as mysqltest builtin command
+# ----------------------------------------------------------------------------
+
+# valid
+select 1;
+--query select 1
+--query -- a comment for the server
+
+# Not valid, "select" is not a mysqltest command
+--error 1
+--exec echo "--select 1;" | $MYSQL_TEST 2>&1
+
+
+# ----------------------------------------------------------------------------
+# BUG#35701: please allow test language variables in connection and sync_slave_with_master
+# Test that "connection $variable" works and that $CURRENT_CONNECTION has the right value.
+# ----------------------------------------------------------------------------
+
+connect (con1,localhost,root,,);
+--echo $CURRENT_CONNECTION
+
+connection default;
+--echo $CURRENT_CONNECTION
+
+connection con1;
+--echo $CURRENT_CONNECTION
+
+let $x= default;
+let $y= con1;
+
+connection $x;
+--echo $CURRENT_CONNECTION
+
+connection $y;
+--echo $CURRENT_CONNECTION
+
+# Disconnect the not selected connection
+disconnect $x;
+--echo $CURRENT_CONNECTION
+
+# Disconnect the selected connection
+disconnect $y;
+--echo $CURRENT_CONNECTION
+
+
--echo End of tests
diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test
index ffc13cf80f7..233ac3edfbb 100644
--- a/mysql-test/t/not_embedded_server.test
+++ b/mysql-test/t/not_embedded_server.test
@@ -5,53 +5,35 @@
-- source include/not_embedded.inc
#
-# Show full process list with prepare
-# To not show other connections, this must be the first test and we must
-# have a server restart before this one
-#
-# We don't have any 4.1 tests as we use I_S to query the PROCESSLIST to
-# exclude system threads that may/may not be active in the server
-# (namely the ndb injector thread)
-#
-# End of 4.1 tests
-
-prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!=\'Daemon\' ';
---replace_column 1 number 6 time 3 localhost
-execute stmt1;
-deallocate prepare stmt1;
-
-
-#
-# Bug#31222: com_% global status counters behave randomly with
-# mysql_change_user.
-#
-# Moved from change_user.test due to Bug#34517: SHOW GLOBAL STATUS does not
-# work properly in embedded server.
-#
-# TODO: move it back when Bug#34517 is fixed.
-#
-
-FLUSH STATUS;
-
---disable_result_log
---disable_query_log
-
-let $i = 100;
-
-while ($i)
-{
- dec $i;
-
- SELECT 1;
-}
-
---enable_query_log
---enable_result_log
-
-SHOW GLOBAL STATUS LIKE 'com_select';
-
---change_user
-
-SHOW GLOBAL STATUS LIKE 'com_select';
+# Produce output
+#
+
+select 1;
+
+# The following fails sporadically because 'check-testcase' runs
+# queries before this test and there is no way to guarantee that any
+# previous process finishes. The purpose of the test is not clearly
+# stated, there is no reference to any bug report, and "select from
+# I_S from prepared statement" doesn't look like something that's
+# really imporant to test. I'm commenting out this for now. If
+# anyone wants to keep this, please fix the race and motivate why we
+# need to test this. If you see this comment and it is after mid-2009
+# or so, feel free to remove this test from the file. /Sven
+#
+#
+## Show full process list with prepare
+## To not show other connections, this must be the first test and we must
+## have a server restart before this one
+##
+## We don't have any 4.1 tests as we use I_S to query the PROCESSLIST to
+## exclude system threads that may/may not be active in the server
+## (namely the ndb injector thread)
+##
+## End of 4.1 tests
+#
+#prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!=\'Daemon\' ';
+#--replace_column 1 number 6 time 3 localhost
+#execute stmt1;
+#deallocate prepare stmt1;
# End of 5.1 tests
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index ddf6b8870fa..2878b54c357 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -61,9 +61,7 @@ drop table t1;
#
CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0);
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
---error 1048
UPDATE t1 SET d=1/NULL;
---error 1048
UPDATE t1 SET d=NULL;
--error 1048
INSERT INTO t1 (a) values (null);
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 1f5ada76366..240a977fdca 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -1,7 +1,11 @@
# Tests for SSL connections, only run if mysqld is compiled
# with support for SSL.
--- source include/have_ssl.inc
+--source include/have_ssl.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
--disable_warnings
drop table if exists t1;
@@ -11,8 +15,8 @@ insert into t1 values (5);
grant select on test.* to ssl_user1@localhost require SSL;
grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA";
-grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com";
-grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
+grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com";
+grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges;
@@ -21,38 +25,42 @@ connect (con2,localhost,ssl_user2,,,,,SSL);
connect (con3,localhost,ssl_user3,,,,,SSL);
connect (con4,localhost,ssl_user4,,,,,SSL);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
+--error ER_ACCESS_DENIED_ERROR
connect (con5,localhost,ssl_user5,,,,,SSL);
connection con1;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection con2;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection con3;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection con4;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+disconnect con4;
drop user ssl_user1@localhost, ssl_user2@localhost,
ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
@@ -97,11 +105,11 @@ drop table t1;
--exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
#
-# BUG#21611 Slave can't connect when master-ssl-cipher specified
+# Bug#21611 Slave can't connect when master-ssl-cipher specified
# - Apparently selecting a cipher doesn't work at all
# - Usa a cipher that both yaSSL and OpenSSL supports
#
---exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql
+--exec echo "SHOW STATUS LIKE 'Ssl_cipher'; exit;" > $MYSQLTEST_VARDIR/tmp/test.sql
--exec $MYSQL_TEST --ssl-cipher=DHE-RSA-AES256-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
#
@@ -115,7 +123,7 @@ drop table t1;
--echo End of 5.0 tests
#
-# Bug #26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in
+# Bug#26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in
# Event (see also information_schema.test for the other part of test for
# this bug).
#
@@ -155,23 +163,23 @@ SET GLOBAL event_scheduler=0;
#
# Test to connect using a list of ciphers
#
---exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql
+--exec echo "SHOW STATUS LIKE 'Ssl_cipher'; exit;" > $MYSQLTEST_VARDIR/tmp/test.sql
--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER:AES128-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
# Test to connect using a specifi cipher
#
---exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql
+--exec echo "SHOW STATUS LIKE 'Ssl_cipher'; exit;" > $MYSQLTEST_VARDIR/tmp/test.sql
--exec $MYSQL_TEST --ssl-cipher=AES128-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
# Test to connect using an unknown cipher
#
---exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql
+--exec echo "SHOW STATUS LIKE 'Ssl_cipher'; exit" > $MYSQLTEST_VARDIR/tmp/test.sql
--error 1
--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
#
-# Bug #27669 mysqldump: SSL connection error when trying to connect
+# Bug#27669 mysqldump: SSL connection error when trying to connect
#
CREATE TABLE t1(a int);
@@ -190,10 +198,11 @@ INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
DROP TABLE t1;
+--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
#
-# Bug#39172: Asking for DH+non-RSA key with server set to use other key caused
-# YaSSL to crash the server.
+# Bug#39172 Asking for DH+non-RSA key with server set to use other key caused
+# YaSSL to crash the server.
#
# Common ciphers to openssl and yassl
@@ -201,7 +210,8 @@ DROP TABLE t1;
--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC3-SHA
--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC-SHA
--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=RC4-SHA
---disable_output
+--disable_query_log
+--disable_result_log
# Below here caused crashes. ################
--error 1,0
@@ -224,8 +234,12 @@ DROP TABLE t1;
# End of crashers. ##########################
# If this gives a result, then the bug is fixed.
---enable_output
+--enable_result_log
+--enable_query_log
select 'is still running; no cipher request crashed the server' as result from dual;
##
--echo End of 5.1 tests
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index 527a4d398d8..45b13f141f7 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -1,10 +1,14 @@
disable_query_log;
-- source include/test_outfile.inc
-# Server are started in "var/master-data", so "../tmp" will be "var/tmp"
-eval set @tmpdir="../tmp";
+# Server are started in "var/master-data", so "../../tmp" will be "var/tmp"
+eval set @tmpdir="../../tmp";
enable_query_log;
-- source include/have_outfile.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+
#
# test of into outfile|dumpfile
#
@@ -16,15 +20,15 @@ drop table if exists t1;
create table t1 (`a` blob);
insert into t1 values("hello world"),("Hello mars"),(NULL);
disable_query_log;
-eval select * into outfile "../tmp/outfile-test.1" from t1;
+eval select * into outfile "../../tmp/outfile-test.1" from t1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.1"));
disable_query_log;
-eval select * into dumpfile "../tmp/outfile-test.2" from t1 limit 1;
+eval select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.2"));
disable_query_log;
-eval select * into dumpfile "../tmp/outfile-test.3" from t1 where a is null;
+eval select * into dumpfile "../../tmp/outfile-test.3" from t1 where a is null;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.3"));
@@ -32,13 +36,13 @@ select load_file(concat(@tmpdir,"/outfile-test.3"));
disable_query_log;
--error ER_FILE_EXISTS_ERROR
-eval select * into outfile "../tmp/outfile-test.1" from t1;
+eval select * into outfile "../../tmp/outfile-test.1" from t1;
--error ER_FILE_EXISTS_ERROR
-eval select * into dumpfile "../tmp/outfile-test.2" from t1;
+eval select * into dumpfile "../../tmp/outfile-test.2" from t1;
--error ER_FILE_EXISTS_ERROR
-eval select * into dumpfile "../tmp/outfile-test.3" from t1;
+eval select * into dumpfile "../../tmp/outfile-test.3" from t1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.1
@@ -46,19 +50,19 @@ select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3
drop table t1;
-# Bug#8191
+# Bug#8191 SELECT INTO OUTFILE insists on FROM clause
disable_query_log;
-eval select 1 into outfile "../tmp/outfile-test.4";
+eval select 1 into outfile "../../tmp/outfile-test.4";
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.4"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
#
-# Bug #5382: 'explain select into outfile' crashes the server
+# Bug#5382 'explain select into outfile' crashes the server
#
CREATE TABLE t1 (a INT);
-EXPLAIN
+EXPLAIN
SELECT *
INTO OUTFILE '/tmp/t1.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
@@ -68,10 +72,10 @@ DROP TABLE t1;
# End of 4.1 tests
#
-# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
+# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
#
disable_query_log;
-eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
+eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM information_schema.schemata LIMIT 0, 5;
# enable_query_log;
@@ -79,7 +83,7 @@ FROM information_schema.schemata LIMIT 0, 5;
use information_schema;
# disable_query_log;
-eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
+eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM schemata LIMIT 0, 5;
enable_query_log;
@@ -107,27 +111,31 @@ connect (con28181_1,localhost,user_1,,mysqltest);
--error ER_DBACCESS_DENIED_ERROR
eval select schema_name
-into outfile "../tmp/outfile-test.4"
+into outfile "../../tmp/outfile-test.4"
fields terminated by ',' optionally enclosed by '"'
lines terminated by '\n'
from information_schema.schemata
where schema_name like 'mysqltest';
connection default;
+disconnect con28181_1;
grant file on *.* to user_1@localhost;
connect (con28181_2,localhost,user_1,,mysqltest);
eval select schema_name
-into outfile "../tmp/outfile-test.4"
+into outfile "../../tmp/outfile-test.4"
fields terminated by ',' optionally enclosed by '"'
lines terminated by '\n'
from information_schema.schemata
where schema_name like 'mysqltest';
connection default;
+disconnect con28181_2;
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use test;
revoke all privileges on *.* from user_1@localhost;
drop user user_1@localhost;
drop database mysqltest;
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 6a12e4a4d12..23a300de9e5 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -10,6 +10,8 @@
#
--source include/have_partition.inc
+SET @old_general_log= @@global.general_log;
+
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
@@ -1913,3 +1915,6 @@ select count(*) from t1;
drop table t1;
--echo End of 5.1 tests
+
+
+SET @@global.general_log= @old_general_log;
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index d470fb67b49..41b904b876f 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -121,7 +121,8 @@ partitions 3
partition x2 tablespace ts2,
partition x3 tablespace ts3);
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+let $MYSQLD_DATADIR= `select @@datadir`;
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by hash, invalid field in function
#
@@ -217,7 +218,7 @@ partition by hash (a)
partitions 2
(partition x1 values less than (4),
partition x2 values less than (5));
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by hash, values in error
@@ -232,7 +233,7 @@ partition by hash (a)
partitions 2
(partition x1 values in (4),
partition x2 values in (5));
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by hash, values in error
@@ -247,7 +248,7 @@ partition by hash (a)
partitions 2
(partition x1 values in (4,6),
partition x2 values in (5,7));
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by key, no partitions defined, single field
@@ -260,7 +261,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (b);
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by key, no partitions defined, list of fields
@@ -273,7 +274,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (a, b);
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined
@@ -286,7 +287,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by key, no partitions defined, single field
@@ -299,7 +300,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (b);
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by key, no partitions defined, list of fields
@@ -312,7 +313,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (a, b);
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined
@@ -325,7 +326,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
@@ -352,7 +353,7 @@ partition by key (a)
subpartition by hash (sin(a+b))
(partition x1 (subpartition x11, subpartition x12),
partition x2 (subpartition x21, subpartition x22));
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
@@ -381,7 +382,7 @@ partition by range (a)
subpartition by key (a,d)
(partition x1 values less than (1) (subpartition x11, subpartition x12),
partition x2 values less than (2) (subpartition x21, subpartition x22));
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
@@ -419,7 +420,7 @@ b int not null,
c int not null,
primary key(a,b))
partition by range (a);
-select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
+select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by range, invalid field in function
diff --git a/mysql-test/t/partition_federated.test b/mysql-test/t/partition_federated.test
index c8483291228..0fe692ecd01 100644
--- a/mysql-test/t/partition_federated.test
+++ b/mysql-test/t/partition_federated.test
@@ -3,7 +3,7 @@
#
-- source include/have_partition.inc
-- source include/not_embedded.inc
--- source include/have_federated_db.inc
+-- source suite/federated/have_federated_db.inc
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/t/partition_innodb_semi_consistent-master.opt b/mysql-test/t/partition_innodb_semi_consistent-master.opt
new file mode 100644
index 00000000000..e76299453d3
--- /dev/null
+++ b/mysql-test/t/partition_innodb_semi_consistent-master.opt
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=2
diff --git a/mysql-test/t/partition_innodb_semi_consistent.test b/mysql-test/t/partition_innodb_semi_consistent.test
new file mode 100644
index 00000000000..6a6a7cf958e
--- /dev/null
+++ b/mysql-test/t/partition_innodb_semi_consistent.test
@@ -0,0 +1,197 @@
+-- source include/have_partition.inc
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+# basic tests of semi-consistent reads
+# for verifying Bug#40595: Non-matching rows not released with READ-COMMITTED
+# on tables with partitions
+
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connection a;
+set binlog_format=mixed;
+set session transaction isolation level repeatable read;
+create table t1(a int not null)
+engine=innodb
+DEFAULT CHARSET=latin1
+PARTITION BY RANGE(a)
+(PARTITION p0 VALUES LESS THAN (20),
+ PARTITION p1 VALUES LESS THAN MAXVALUE);
+insert into t1 values (1),(2),(3),(4),(5),(6),(7);
+set autocommit=0;
+# this should lock the entire table
+select * from t1 where a=3 lock in share mode;
+connection b;
+set binlog_format=mixed;
+set session transaction isolation level repeatable read;
+set autocommit=0;
+-- error ER_LOCK_WAIT_TIMEOUT
+update t1 set a=10 where a=5;
+connection a;
+#DELETE FROM t1 WHERE a=5;
+commit;
+connection b;
+# perform a semi-consisent read (and unlock non-matching rows)
+set session transaction isolation level read committed;
+update t1 set a=10 where a=5;
+connection a;
+-- error ER_LOCK_WAIT_TIMEOUT
+select * from t1 where a=2 for update;
+# this should lock the records (1),(2)
+select * from t1 where a=2 limit 1 for update;
+connection b;
+# semi-consistent read will skip non-matching locked rows a=1, a=2
+update t1 set a=11 where a=6;
+-- error ER_LOCK_WAIT_TIMEOUT
+update t1 set a=12 where a=2;
+-- error ER_LOCK_WAIT_TIMEOUT
+update t1 set a=13 where a=1;
+connection a;
+commit;
+connection b;
+update t1 set a=14 where a=1;
+commit;
+connection a;
+--sorted_result
+select * from t1;
+drop table t1;
+
+connection default;
+disconnect a;
+disconnect b;
+
+#
+# Bug #31310: Locked rows silently skipped in read-committed isolation level.
+# (This also tests the '*_semi_consistent*' functions in partitioning)
+# Copied from include/mix1.inc
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+SET SESSION AUTOCOMMIT = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+set binlog_format=mixed;
+--echo # Switch to connection con1
+connection con1;
+
+eval
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (300),
+ PARTITION p1 VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1,2);
+
+--echo # 1. test for locking:
+
+BEGIN;
+--enable_info
+UPDATE t1 SET b = 12 WHERE a = 1;
+--disable_info
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+
+--enable_info
+--disable_abort_on_error
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET b = 21 WHERE a = 1;
+--disable_info
+
+--echo # Switch to connection con1
+connection con1;
+SELECT * FROM t1;
+ROLLBACK;
+
+--echo # 2. test for serialized update:
+
+CREATE TABLE t2 (a INT);
+
+TRUNCATE t1;
+INSERT INTO t1 VALUES (1,'init');
+
+DELIMITER |;
+CREATE PROCEDURE p1()
+BEGIN
+ UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+ INSERT INTO t2 VALUES ();
+END|
+DELIMITER ;|
+
+BEGIN;
+--enable_info
+UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1;
+--disable_info
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+
+--send CALL p1;
+
+--echo # Switch to connection con1
+connection con1;
+SELECT * FROM t1;
+COMMIT;
+
+let $bug31310 = 1;
+while ($bug31310)
+{
+ let $bug31310= `SELECT 1 - COUNT(*) FROM t2`;
+}
+
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+--reap
+SELECT * FROM t1;
+
+--echo # Switch to connection con1
+connection con1;
+
+--echo # 3. test for updated key column:
+
+TRUNCATE t1;
+TRUNCATE t2;
+
+INSERT INTO t1 VALUES (1,'init');
+
+BEGIN;
+--enable_info
+UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1;
+--disable_info
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+
+--send CALL p1;
+
+--echo # Switch to connection con1
+connection con1;
+SELECT * FROM t1;
+COMMIT;
+
+let $bug31310 = 1;
+while ($bug31310)
+{
+ let $bug31310= `SELECT 1 - COUNT(*) FROM t2`;
+}
+
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+SELECT * FROM t1;
+
+connection default;
+disconnect con1;
+disconnect con2;
+DROP PROCEDURE p1;
+DROP TABLE t1, t2;
+
diff --git a/mysql-test/t/partition_innodb_stmt.test b/mysql-test/t/partition_innodb_stmt.test
index 2ed5baee0ac..d6181ce068e 100644
--- a/mysql-test/t/partition_innodb_stmt.test
+++ b/mysql-test/t/partition_innodb_stmt.test
@@ -1,3 +1,4 @@
+--source include/have_partition.inc
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test
index 524a2e04b25..e17edf0a4e5 100644
--- a/mysql-test/t/partition_mgm.test
+++ b/mysql-test/t/partition_mgm.test
@@ -4,6 +4,17 @@ DROP TABLE IF EXISTS t1;
--enable_warnings
#
+# Bug 40389: REORGANIZE PARTITION crashes when only using one partition
+#
+CREATE TABLE t1 (a INT PRIMARY KEY)
+ENGINE MYISAM
+PARTITION BY HASH (a)
+PARTITIONS 1;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+ALTER TABLE t1 REORGANIZE PARTITION;
+DROP TABLE t1;
+
+#
# Bug 21143: mysqld hang when error in number of subparts in
# REORGANIZE command
#
@@ -22,18 +33,19 @@ drop table t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2;
SHOW CREATE TABLE t1;
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
+let $MYSQLD_DATADIR= `select @@datadir`;
+-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
+-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
+-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYD
+-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYI
+-- file_exists $MYSQLD_DATADIR/test/t1.frm
+-- file_exists $MYSQLD_DATADIR/test/t1.par
ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
--- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
+-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
+-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
+-- file_exists $MYSQLD_DATADIR/test/t1.frm
+-- file_exists $MYSQLD_DATADIR/test/t1.par
drop table t1;
#
# Bug 20767: REORGANIZE partition crashes
diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test
index d7108d5af98..333e12e2b16 100644
--- a/mysql-test/t/partition_not_windows.test
+++ b/mysql-test/t/partition_not_windows.test
@@ -11,8 +11,8 @@
# Bug 20770 Partitions: DATA DIRECTORY clause change in reorganize
# doesn't remove old directory
+let $MYSQLD_DATADIR= `select @@datadir`;
let $data_directory = DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp';
-
let $inx_directory = INDEX DIRECTORY = '$MYSQLTEST_VARDIR/tmp';
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@@ -23,12 +23,12 @@ subpartition by hash (a)
(SUBPARTITION subpart00, SUBPARTITION subpart01));
--echo # Checking if file exists before alter
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYD
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart01.MYD
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart01.MYI
+--file_exists $MYSQLD_DATADIR/test/t1.frm
+--file_exists $MYSQLD_DATADIR/test/t1.par
+--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart00.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart00.MYI
+--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart01.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart01.MYI
--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart00.MYD
--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart01.MYD
--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart00.MYI
@@ -42,16 +42,16 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
(SUBPARTITION subpart20, SUBPARTITION subpart21));
--echo # Checking if file exists after alter
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart10.MYD
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart10.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart11.MYD
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart11.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart20.MYD
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart20.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart21.MYD
---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart21.MYI
+--file_exists $MYSQLD_DATADIR/test/t1.frm
+--file_exists $MYSQLD_DATADIR/test/t1.par
+--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart10.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart10.MYI
+--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart11.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart11.MYI
+--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart20.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart20.MYI
+--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart21.MYD
+--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart21.MYI
--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p1#SP#subpart10.MYD
--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p1#SP#subpart11.MYD
--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p2#SP#subpart20.MYD
@@ -93,39 +93,43 @@ set @@sql_mode=@org_mode;
#
# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY
#
---replace_result $MYSQLTEST_VARDIR TEST_DIR
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
PARTITION BY KEY (a)
-(PARTITION p0 DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test');
---replace_result $MYSQLTEST_VARDIR TEST_DIR
+(PARTITION p0 DATA DIRECTORY '$MYSQLD_DATADIR/test');
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
PARTITION BY KEY (a)
-(PARTITION p0 INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test');
+(PARTITION p0 INDEX DIRECTORY '$MYSQLD_DATADIR/test');
---replace_result $MYSQLTEST_VARDIR TEST_DIR
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--error ER_WRONG_ARGUMENTS
eval CREATE TABLE ts (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) (
PARTITION p0 VALUES LESS THAN (1990) (
SUBPARTITION s0a
- DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test',
+ DATA DIRECTORY = '$MYSQLD_DATADIR/test',
SUBPARTITION s0b
- DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test'
+ DATA DIRECTORY = '$MYSQLD_DATADIR/test'
));
---replace_result $MYSQLTEST_VARDIR TEST_DIR
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--error ER_WRONG_ARGUMENTS
eval CREATE TABLE ts (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) (
PARTITION p0 VALUES LESS THAN (1990) (
SUBPARTITION s0a
- INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test',
+ INDEX DIRECTORY = '$MYSQLD_DATADIR/test',
SUBPARTITION s0b
- INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test'
+ INDEX DIRECTORY = '$MYSQLD_DATADIR/test'
));
# End Windows specific test failures.
@@ -165,21 +169,24 @@ INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p2Index',
PARTITION p3 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p3Data'
INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p3Index'
);
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
--echo # Checking that MyISAM .MYD and .MYI are in test db and data/idx dir
---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYD
+--file_exists $MYSQLD_DATADIR/test/example#P#p0.MYI
+--file_exists $MYSQLD_DATADIR/test/example#P#p0.MYD
--file_exists $MYSQLTEST_VARDIR/p0Data/example#P#p0.MYD
--file_exists $MYSQLTEST_VARDIR/p0Index/example#P#p0.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYD
+--file_exists $MYSQLD_DATADIR/test/example#P#p1.MYI
+--file_exists $MYSQLD_DATADIR/test/example#P#p1.MYD
--file_exists $MYSQLTEST_VARDIR/p1Data/example#P#p1.MYD
--file_exists $MYSQLTEST_VARDIR/p1Index/example#P#p1.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYD
+--file_exists $MYSQLD_DATADIR/test/example#P#p2.MYI
+--file_exists $MYSQLD_DATADIR/test/example#P#p2.MYD
--file_exists $MYSQLTEST_VARDIR/p2Data/example#P#p2.MYD
--file_exists $MYSQLTEST_VARDIR/p2Index/example#P#p2.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYI
---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYD
+--file_exists $MYSQLD_DATADIR/test/example#P#p3.MYI
+--file_exists $MYSQLD_DATADIR/test/example#P#p3.MYD
--file_exists $MYSQLTEST_VARDIR/p3Data/example#P#p3.MYD
--file_exists $MYSQLTEST_VARDIR/p3Index/example#P#p3.MYI
DROP TABLE example;
diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test
index 31008d2b011..ad102062ef8 100644
--- a/mysql-test/t/partition_pruning.test
+++ b/mysql-test/t/partition_pruning.test
@@ -8,6 +8,22 @@
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
+#
+# Bug#40972: some sql execution lead the whole database crashing
+#
+# Setup so the start is at partition pX and end is at p1
+# Pruning does handle 'bad' dates differently.
+CREATE TABLE t1
+(a INT NOT NULL AUTO_INCREMENT,
+ b DATETIME,
+ PRIMARY KEY (a,b),
+ KEY (b))
+PARTITION BY RANGE (to_days(b))
+(PARTITION p0 VALUES LESS THAN (733681) COMMENT = 'LESS THAN 2008-10-01',
+ PARTITION p1 VALUES LESS THAN (733712) COMMENT = 'LESS THAN 2008-11-01',
+ PARTITION pX VALUES LESS THAN MAXVALUE);
+SELECT a,b FROM t1 WHERE b >= '2008-12-01' AND b < '2009-12-00';
+DROP TABLE t1;
# Check if we can infer from condition on partition fields that
# no records will match.
diff --git a/mysql-test/t/profiling.test b/mysql-test/t/profiling.test
index 5cb3f66aa2b..275c2d77c4a 100644
--- a/mysql-test/t/profiling.test
+++ b/mysql-test/t/profiling.test
@@ -14,6 +14,7 @@ select @@profiling;
set global profiling = ON;
# But size is okay
+set @start_value= @@global.profiling_history_size;
set global profiling_history_size=100;
show global variables like 'profil%';
@@ -261,6 +262,6 @@ drop function if exists f1;
## last thing in the file
set session profiling = OFF;
-
+set global profiling_history_size= @start_value;
##
--echo End of 5.0 tests
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 3e1a41d32c8..91cb6eef8ad 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1665,7 +1665,7 @@ DROP PROCEDURE IF EXISTS p1;
let $iterations= 100;
--disable_query_log
--disable_result_log
-while ($iterations > 0)
+while ($iterations)
{
--error ER_PARSE_ERROR
PREPARE stmt FROM "CREATE PROCEDURE p1()";
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
index 95cbd908933..3ad3f394840 100644
--- a/mysql-test/t/ps_1general.test
+++ b/mysql-test/t/ps_1general.test
@@ -576,7 +576,7 @@ prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ;
create table t5 (a int) ;
# rename must fail, t7 does not exist
# Clean up the filename here because embedded server reports whole path
---replace_result $MYSQLTEST_VARDIR . master-data/ '' t7.frm t7
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' t7.frm t7
--error 1017
execute stmt1 ;
create table t7 (a int) ;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 88287e53b34..7841e7274dd 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -300,7 +300,7 @@ select * from t1;
select * from t1;
show status like "Qcache_queries_in_cache";
insert delayed into t1 values (4);
---sleep 5 # Wait for insert delayed to be executed.
+--sleep 5 # Wait for insert delayed to be executed.
select a from t1;
show status like "Qcache_queries_in_cache";
drop table t1;
@@ -410,10 +410,10 @@ create table t1(id int auto_increment primary key);
insert into t1 values (NULL), (NULL), (NULL);
select * from t1 where id=2;
alter table t1 rename to t2;
--- error 1146
+--error ER_NO_SUCH_TABLE
select * from t1 where id=2;
drop table t2;
--- error 1146
+--error ER_NO_SUCH_TABLE
select * from t1 where id=2;
#
@@ -423,7 +423,7 @@ create table t1 (word char(20) not null);
select * from t1;
show status like "Qcache_queries_in_cache";
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data infile '$MYSQLTEST_VARDIR/std_data_ln/words.dat' into table t1;
+eval load data infile '$MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
show status like "Qcache_queries_in_cache";
select count(*) from t1;
drop table t1;
@@ -435,11 +435,14 @@ create table t1 (a int);
insert into t1 values (1),(2),(3);
show status like "Qcache_queries_in_cache";
select * from t1 into outfile "query_cache.out.file";
---error 1086
+--error ER_FILE_EXISTS_ERROR
select * from t1 into outfile "query_cache.out.file";
select * from t1 limit 1 into dumpfile "query_cache.dump.file";
show status like "Qcache_queries_in_cache";
drop table t1;
+let $datadir=`select @@datadir`;
+--remove_file $datadir/test/query_cache.dump.file
+--remove_file $datadir/test/query_cache.out.file
#
# test of SQL_SELECT_LIMIT
@@ -537,7 +540,7 @@ drop table t1;
# If at least one of the above variables has changed,
# the cached query can't be reused. In the below test
# absolutely the same query is used several times,
-# SELECT should fetch different results for every instance.
+# SELECT should fetch different results for every instance.
# No hits should be produced.
# New cache entry should appear for every SELECT.
#
@@ -554,21 +557,21 @@ show status like "Qcache_queries_in_cache";
# Change collation_connection and run the same query again
#
set collation_connection=koi8r_bin;
-SELECT a,'Â','â'='Â' FROM t1;
+SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
#
# Now change character_set_client and run the same query again
#
set character_set_client=cp1251;
-SELECT a,'Â','â'='Â' FROM t1;
+SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
#
# And finally change character_set_results and run the same query again
#
set character_set_results=cp1251;
-SELECT a,'Â','â'='Â' FROM t1;
+SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
SET NAMES default;
@@ -602,12 +605,12 @@ insert into t1 set c = repeat('x',24);
insert into t1 set c = concat(repeat('x',24),'x');
insert into t1 set c = concat(repeat('x',24),'w');
insert into t1 set c = concat(repeat('x',24),'y');
-set max_sort_length=200;
+set max_sort_length=200;
select c from t1 order by c, id;
reset query cache;
set max_sort_length=20;
select c from t1 order by c, id;
-set max_sort_length=200;
+set max_sort_length=200;
select c from t1 order by c, id;
set max_sort_length=default;
# sql_mode
@@ -801,9 +804,10 @@ create procedure `p1`()
begin
select a, f1() from t1;
end//
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
call p1()//
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET GLOBAL log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
drop procedure p1//
drop function f1//
@@ -1016,7 +1020,7 @@ set GLOBAL query_cache_size= default;
#
-# Bug #28897 UUID() returns non-unique values when query cache is enabled
+# Bug#28897 UUID() returns non-unique values when query cache is enabled
#
set GLOBAL query_cache_size=1000000;
@@ -1025,7 +1029,7 @@ create table t1 (a char);
insert into t1 values ('c');
let $q1= `select UUID(), a from t1`;
-let $q2= `select UUID(), a from t1`;
+let $q2= `select UUID(), a from t1`;
# disabling the logging of the query because the UUIDs are different each run.
--disable_query_log
@@ -1046,7 +1050,7 @@ create table t1 (a char);
insert into t1 values ('c');
let $q1= `select RAND() from t1 union select sql_cache 1 from t1;`;
-let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`;
+let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`;
# disabling the logging of the query because the times are different each run.
--disable_query_log
@@ -1182,75 +1186,6 @@ DROP TABLE t1;
SET GLOBAL query_cache_size= default;
#
-# Bug #28249 Query Cache returns wrong result with concurrent insert / certain lock
-#
---echo Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
-connect (user1,localhost,root,,test,,);
-connect (user2,localhost,root,,test,,);
-connect (user3,localhost,root,,test,,);
-
-connection user1;
-
-set GLOBAL query_cache_type=1;
-set GLOBAL query_cache_limit=10000;
-set GLOBAL query_cache_min_res_unit=0;
-set GLOBAL query_cache_size= 100000;
-
-flush tables;
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-create table t1 (a int);
-create table t2 (a int);
-insert into t1 values (1),(2),(3);
-connection user2;
---echo Locking table T2 with a write lock.
-lock table t2 write;
-
-connection user1;
---echo Select blocked by write lock.
---send select *, (select count(*) from t2) from t1;
---echo Sleeing is ok, because selecting should be done very fast.
-sleep 5;
-
-connection user3;
---echo Inserting into table T1.
-insert into t1 values (4);
-
-connection user2;
---echo Unlocking the tables.
-unlock tables;
-
-connection user1;
---echo Collecting result from previously blocked select.
-#
-# Since the lock ordering rule in thr_multi_lock depends on
-# pointer values, from execution to execution we might have
-# different lock order, and therefore, sometimes lock t1 and block
-# on t2, and sometimes block on t2 right away. In the second case,
-# the following insert succeeds, and only then this select can
-# proceed, and we actually test nothing, as the very first select
-# returns 4 rows right away.
-# It's fine to have a test case that covers the problematic area
-# at least once in a while.
-# We, however, need to disable the result log here to make the
-# test repeatable.
---disable_result_log
---reap
---enable_result_log
---echo Next select should contain 4 rows, as the insert is long finished.
-select *, (select count(*) from t2) from t1;
-reset query cache;
-select *, (select count(*) from t2) from t1;
-
-drop table t1,t2;
-
-connection default;
-disconnect user1;
-disconnect user2;
-disconnect user3;
-
-#
--echo #
--echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1
--echo #
@@ -1260,7 +1195,7 @@ set global query_cache_type=0;
show status like 'Qcache_free_blocks';
--echo Restore default values.
-# Bug #28211 RENAME DATABASE and query cache don't play nicely together
+# Bug#28211 RENAME DATABASE and query cache don't play nicely together
#
# TODO: enable these tests when RENAME DATABASE is implemented.
# --disable_warnings
@@ -1278,7 +1213,7 @@ show status like 'Qcache_free_blocks';
# show status like 'Qcache_queries_in_cache';
# drop database db2;
# set global query_cache_size=default;
-#
+#
# --disable_warnings
# drop database if exists db1;
# drop database if exists db3;
@@ -1326,6 +1261,33 @@ DROP TABLE t1;
SET GLOBAL concurrent_insert= @save_concurrent_insert;
SET GLOBAL query_cache_size= default;
+#
+# Bug#36326: nested transaction and select
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+FLUSH STATUS;
+SET GLOBAL query_cache_size=1048576;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+SHOW STATUS LIKE 'Qcache_queries_in_cache';
+SELECT * FROM t1;
+BEGIN;
+SELECT * FROM t1;
+COMMIT;
+SHOW STATUS LIKE 'Qcache_queries_in_cache';
+SHOW STATUS LIKE "Qcache_hits";
+SELECT * FROM t1;
+BEGIN;
+SELECT * FROM t1;
+COMMIT;
+SHOW STATUS LIKE "Qcache_hits";
+DROP TABLE t1;
+SET GLOBAL query_cache_size= default;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/query_cache_28249.test b/mysql-test/t/query_cache_28249.test
new file mode 100644
index 00000000000..3cf6c89369e
--- /dev/null
+++ b/mysql-test/t/query_cache_28249.test
@@ -0,0 +1,123 @@
+### t/query_cache_28249.test ###
+#
+# Test for
+# Bug#28249 Query Cache returns wrong result with concurrent insert / certain lock
+#
+# Last modification:
+# 2008-11-27 mleich - Move this test out of query_cache.test
+# - Fix Bug#40179 Test main.query_cache failing randomly on Pushbuild,
+# test weakness
+# - Minor improvements (comments,formatting etc.)
+#
+
+--source include/have_query_cache.inc
+
+SET @query_cache_type= @@global.query_cache_type;
+SET @query_cache_limit= @@global.query_cache_limit;
+SET @query_cache_min_res_unit= @@global.query_cache_min_res_unit;
+SET @query_cache_size= @@global.query_cache_size;
+
+--echo # Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
+--echo # Establish connections user1,user2,user3 (user=root)
+connect (user1,localhost,root,,test,,);
+connect (user2,localhost,root,,test,,);
+connect (user3,localhost,root,,test,,);
+
+--echo # Switch to connection user1
+connection user1;
+
+SET GLOBAL query_cache_type=1;
+SET GLOBAL query_cache_limit=10000;
+SET GLOBAL query_cache_min_res_unit=0;
+SET GLOBAL query_cache_size= 100000;
+
+FLUSH TABLES;
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+
+--echo # Switch to connection user2
+connection user2;
+LOCK TABLE t2 WRITE;
+
+--echo # Switch to connection user1
+connection user1;
+--echo # "send" the next select, "reap" the result later.
+--echo # The select will be blocked by the write lock on the t1.
+let $select_for_qc =
+SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
+send;
+eval $select_for_qc;
+
+--echo # Switch to connection user3
+connection user3;
+# Typical information_schema.processlist content after sufficient sleep time
+# ID USER COMMAND TIME STATE INFO
+# ....
+# 2 root Query 5 Locked SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
+# ....
+# XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+# The values marked with 'X' must be reached.
+--echo # Poll till the select of connection user1 is blocked by the write lock on t1.
+let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
+WHERE state = 'Locked'
+ AND info = '$select_for_qc';
+--source include/wait_condition.inc
+eval
+SELECT user,command,state,info FROM information_schema.processlist
+WHERE state = 'Locked'
+ AND info = '$select_for_qc';
+INSERT INTO t1 VALUES (4);
+
+--echo # Switch to connection user2
+connection user2;
+UNLOCK TABLES;
+
+--echo # Switch to connection user1
+connection user1;
+#
+# Since the lock ordering rule in thr_multi_lock depends on
+# pointer values, from execution to execution we might have
+# different lock order, and therefore, sometimes lock t1 and block
+# on t2, and sometimes block on t2 right away. In the second case,
+# the following insert succeeds, and only then this select can
+# proceed, and we actually test nothing, as the very first select
+# returns 4 rows right away.
+# It's fine to have a test case that covers the problematic area
+# at least once in a while.
+--echo # Collecting ("reap") the result from the previously blocked select.
+--echo # The printing of the result (varies between 3 and 4 rows) set has to be suppressed.
+--disable_result_log
+--reap
+--enable_result_log
+
+--echo # Switch to connection user3
+connection user3;
+--echo # The next select enforces that effects of "concurrent_inserts" like the
+--echo # record with a = 4 is missing in result sets can no more happen.
+SELECT 1 FROM t1 WHERE a = 4;
+
+--echo # Switch to connection user1
+connection user1;
+--echo # The next result set must contain 4 rows.
+# If not, we have a regression of Bug#28249
+eval $select_for_qc;
+RESET QUERY CACHE;
+eval $select_for_qc;
+
+DROP TABLE t1,t2;
+
+--echo # Switch to connection default + close connections user1,user2,user3
+connection default;
+disconnect user1;
+disconnect user2;
+disconnect user3;
+
+SET GLOBAL query_cache_type= @query_cache_type;
+SET GLOBAL query_cache_limit= @query_cache_limit;
+SET GLOBAL query_cache_min_res_unit= @query_cache_min_res_unit;
+SET GLOBAL query_cache_size= @query_cache_size;
+
diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test
index 929b93e10d5..c3889ef0267 100644
--- a/mysql-test/t/query_cache_notembedded.test
+++ b/mysql-test/t/query_cache_notembedded.test
@@ -183,6 +183,8 @@ drop table t1;
#
# bug#14767: INSERT in SF + concurrent SELECT with query cache
#
+connection default;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
reset query cache;
@@ -224,7 +226,10 @@ disconnect con2;
connection default;
set GLOBAL query_cache_size=0;
-SET GLOBAL log_bin_trust_function_creators = 0;
+
+# End of 5.0 tests
+
+SET @@global.log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
#
# Bug #30269 Query cache eats memory
diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test
index 94a9fda6757..eb2ca7992a6 100644
--- a/mysql-test/t/repair.test
+++ b/mysql-test/t/repair.test
@@ -29,7 +29,8 @@ repair table t1 use_frm;
create table t1 engine=myisam SELECT 1,"table 1";
flush tables;
-system echo 1 > $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
+let $MYSQLD_DATADIR= `select @@datadir`;
+system echo 1 > $MYSQLD_DATADIR/test/t1.MYI ;
repair table t1;
repair table t1 use_frm;
drop table t1;
@@ -119,9 +120,10 @@ DROP TABLE t1;
#
--echo # Test with a saved table from 4.1
---copy_file std_data/bug36055.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm
---copy_file std_data/bug36055.MYD $MYSQLTEST_VARDIR/master-data/test/t1.MYD
---copy_file std_data/bug36055.MYI $MYSQLTEST_VARDIR/master-data/test/t1.MYI
+let $MYSQLD_DATADIR= `select @@datadir`;
+--copy_file std_data/bug36055.frm $MYSQLD_DATADIR/test/t1.frm
+--copy_file std_data/bug36055.MYD $MYSQLD_DATADIR/test/t1.MYD
+--copy_file std_data/bug36055.MYI $MYSQLD_DATADIR/test/t1.MYI
--replace_column 12 # 13 #
SHOW TABLE STATUS LIKE 't1';
diff --git a/mysql-test/t/rpl_init_slave_func-slave.opt b/mysql-test/t/rpl_init_slave_func-slave.opt
deleted file mode 100644
index 337e8a60d97..00000000000
--- a/mysql-test/t/rpl_init_slave_func-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---init-slave="set global max_connections=500"
diff --git a/mysql-test/t/rpl_init_slave_func.test b/mysql-test/t/rpl_init_slave_func.test
deleted file mode 100644
index b3d647f4394..00000000000
--- a/mysql-test/t/rpl_init_slave_func.test
+++ /dev/null
@@ -1,96 +0,0 @@
-###################### mysql-test\t\init_slave_func.test #####################
-# #
-# Variable Name: init_slave #
-# Scope: GLOBAL #
-# Access Type: Dynamic #
-# Data Type: string #
-# Default Value: #
-# Range: #
-# #
-# #
-# Creation Date: 2008-03-08 #
-# Author: Rizwan #
-# #
-# Description: Test Cases of Dynamic System Variable init_slave #
-# that checks the behavior of this variable #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
-###############################################################################
-
-source include/master-slave.inc;
-
---echo '#--------------------FN_DYNVARS_037_01-------------------------#'
-##################################################################
-# Check if setting init_slave is changed in every new connection #
-##################################################################
-
-SET @@global.init_slave = "SET @a = 10";
-
---echo 'connect (con1,localhost,root,,)'
-connect (con1,localhost,root,,);
---echo 'connection con1'
-connection con1;
-SELECT @@global.init_slave;
-disconnect con1;
---echo 'connection master'
-connection master;
-
---echo '#--------------------FN_DYNVARS_037_02-------------------------#'
-####################################################
-# Begin the functionality Testing of init_slave #
-####################################################
-
-#====================================================
---echo 'check if value in slave opt file is executed'
-#====================================================
-save_master_pos;
---echo 'connection slave'
-connection slave;
-sleep 1;
-show variables like 'init_slave';
-show variables like 'max_connections';
-sync_with_master;
-reset master;
-
-#===============================================================
---echo 'check if value in slave opt file doesnt apply to master'
-#===============================================================
-
---echo 'connection master'
-connection master;
-show variables like 'init_slave';
-show variables like 'max_connections';
-save_master_pos;
---echo 'connection slave'
-connection slave;
-sync_with_master;
-
-#=======================================================
---echo 'try creating a temporary variable in init_slave'
-#=======================================================
-
-SET @@global.init_slave = "SET @a=5";
-
-stop slave;
---wait_for_slave_to_stop
-reset slave;
-# Clean up old test tables
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
-start slave;
-
-SHOW VARIABLES LIKE 'init_slave';
-SELECT @a;
-
---echo 'Bug#35365 SET statement in init_slave not execute if slave is restarted'
-
-# Restore value
-set global max_connections= default;
-
-##################################################
-# End of functionality Testing for init_slave #
-##################################################
-
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 30abb797e83..ccdb53ec11f 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -3690,6 +3690,42 @@ SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3;
SHOW STATUS LIKE 'Handler_read%';
DROP TABLE t1, t2;
+#
+# Bug#40953 SELECT query throws "ERROR 1062 (23000): Duplicate entry..." error
+#
+CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0',
+ f2 int(11) NOT NULL default '0',
+ f3 bigint(20) NOT NULL default '0',
+ f4 varchar(255) NOT NULL default '',
+ PRIMARY KEY (f1),
+ KEY key1 (f4),
+ KEY key2 (f2));
+CREATE TABLE t2 (f1 int(11) NOT NULL default '0',
+ f2 enum('A1','A2','A3') NOT NULL default 'A1',
+ f3 int(11) NOT NULL default '0',
+ PRIMARY KEY (f1),
+ KEY key1 (f3));
+CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0',
+ f2 datetime NOT NULL default '1980-01-01 00:00:00',
+ PRIMARY KEY (f1));
+
+insert into t1 values (1, 1, 1, 'abc');
+insert into t1 values (2, 1, 2, 'def');
+insert into t1 values (3, 1, 2, 'def');
+insert into t2 values (1, 'A1', 1);
+insert into t3 values (1, '1980-01-01');
+
+SELECT a.f3, cr.f4, count(*) count
+FROM t2 a
+STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1
+LEFT JOIN
+(t1 cr2
+ JOIN t3 ae2 ON cr2.f3 = ae2.f1
+) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND
+cr.f4 = cr2.f4
+GROUP BY a.f3, cr.f4;
+
+drop table t1, t2, t3;
--echo End of 5.0 tests
#
@@ -3701,3 +3737,36 @@ SELECT a FROM t1 ORDER BY a LIMIT 2;
SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296;
SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297;
DROP TABLE t1;
+
+#
+# Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store ,
+# Field_varstring::store
+#
+
+CREATE TABLE A (date_key date);
+
+CREATE TABLE C (
+ pk int,
+ int_nokey int,
+ int_key int,
+ date_key date NOT NULL,
+ date_nokey date,
+ varchar_key varchar(1)
+);
+
+INSERT INTO C VALUES
+(1,1,1,'0000-00-00',NULL,NULL),
+(1,1,1,'0000-00-00',NULL,NULL);
+
+SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C);
+
+SELECT COUNT(DISTINCT 1) FROM C
+ WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk;
+SELECT date_nokey FROM C
+ WHERE int_key IN (SELECT 1 FROM A)
+ HAVING date_nokey = '10:41:7'
+ ORDER BY date_key;
+
+DROP TABLE A,C;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 765a69aaa5f..116298a9c80 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -422,14 +422,15 @@ DROP TABLE t1;
flush tables;
# Create a junk frm file on disk
-system echo "this is a junk file for test" >> $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
+let $MYSQLD_DATADIR= `select @@datadir`;
+system echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ;
--replace_column 6 # 7 # 8 # 9 #
SHOW TABLE STATUS like 't1';
--error 1033
show create table t1;
drop table if exists t1;
--error 1,0
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
+--remove_file $MYSQLD_DATADIR/test/t1.frm
#
# BUG 12183 - SHOW OPEN TABLES behavior doesn't match grammar
diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test
index 56d99c4435c..14c38a2fdb4 100644
--- a/mysql-test/t/sp-destruct.test
+++ b/mysql-test/t/sp-destruct.test
@@ -13,9 +13,10 @@
-- source include/not_embedded.inc
# Backup proc table
---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/proc.frm
---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/proc.MYD
---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/proc.MYI
+let $MYSQLD_DATADIR= `select @@datadir`;
+--copy_file $MYSQLD_DATADIR/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/proc.frm
+--copy_file $MYSQLD_DATADIR/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/proc.MYD
+--copy_file $MYSQLD_DATADIR/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/proc.MYI
use test;
@@ -50,8 +51,8 @@ insert into t1 values (0);
flush table mysql.proc;
# Thrashing the .frm file
---remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
---write_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
+--remove_file $MYSQLD_DATADIR/mysql/proc.frm
+--write_file $MYSQLD_DATADIR/mysql/proc.frm
saljdfa
EOF
--replace_result $MYSQLTEST_VARDIR . master-data// '' '\\' '/'
@@ -67,9 +68,9 @@ insert into t1 values (0);
flush table mysql.proc;
# Drop the mysql.proc table
---remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
---remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD
---remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI
+--remove_file $MYSQLD_DATADIR/mysql/proc.frm
+--remove_file $MYSQLD_DATADIR/mysql/proc.MYD
+--remove_file $MYSQLD_DATADIR/mysql/proc.MYI
--error ER_NO_SUCH_TABLE
call bug14233();
--error ER_NO_SUCH_TABLE
@@ -78,9 +79,9 @@ create view v1 as select bug14233_f();
insert into t1 values (0);
# Restore mysql.proc
---copy_file $MYSQLTEST_VARDIR/tmp/proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
---copy_file $MYSQLTEST_VARDIR/tmp/proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD
---copy_file $MYSQLTEST_VARDIR/tmp/proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI
+--copy_file $MYSQLTEST_VARDIR/tmp/proc.frm $MYSQLD_DATADIR/mysql/proc.frm
+--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYD $MYSQLD_DATADIR/mysql/proc.MYD
+--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYI $MYSQLD_DATADIR/mysql/proc.MYI
--remove_file $MYSQLTEST_VARDIR/tmp/proc.frm
--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYD
--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYI
@@ -152,5 +153,5 @@ drop function bug14233_1;
drop function bug14233_2;
drop procedure bug14233_3;
# Assert: These should show nothing.
-show procedure status;
-show function status;
+show procedure status where db=DATABASE();
+show function status where db=DATABASE();
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 5437f3a156f..8d7c6d75a34 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -6,6 +6,10 @@
drop table if exists t1, t2;
--enable_warnings
+# Backup the mysql.proc table
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT * FROM mysql.proc INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/proc.txt';
+
# Make sure we don't have any procedures left.
delete from mysql.proc;
@@ -2425,3 +2429,9 @@ delimiter ;$$
#--enable_warnings
#create procedure bugNNNN...
#create function bugNNNN...
+
+#
+# CLEANUP and RESTORE
+#
+LOAD DATA INFILE '../../tmp/proc.txt' INTO TABLE mysql.proc;
+remove_file $MYSQLTEST_VARDIR/tmp/proc.txt;
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index 91de14116d4..b372c05b6e3 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -243,11 +243,11 @@ disconnect con2user1;
disconnect con3anon;
disconnect con4user2;
use test;
-select type,db,name from mysql.proc;
+select type,db,name from mysql.proc where db like 'db%';
drop database db1_secret;
drop database db2;
# Make sure the routines are gone
-select type,db,name from mysql.proc;
+select type,db,name from mysql.proc where db like 'db%';
# Get rid of the users
delete from mysql.user where user='user1' or user='user2';
delete from mysql.user where user='' and host='%';
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 05bccae67aa..d57fe777953 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -703,7 +703,7 @@ drop procedure into_test4|
--disable_warnings
drop procedure if exists into_outfile|
--enable_warnings
---replace_result $MYSQLTEST_VARDIR ..
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create procedure into_outfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -722,7 +722,7 @@ drop procedure into_outfile|
--disable_warnings
drop procedure if exists into_dumpfile|
--enable_warnings
---replace_result $MYSQLTEST_VARDIR ..
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create procedure into_dumpfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -1540,7 +1540,7 @@ begin
end|
show create procedure opp|
--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
-show procedure status like '%p%'|
+show procedure status where name like '%p%' and db='test'|
# This isn't the fastest way in the world to compute prime numbers, so
# don't be too ambitious. ;-)
@@ -1558,7 +1558,7 @@ drop table t3|
drop procedure opp|
drop procedure ip|
--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
-show procedure status like '%p%'|
+show procedure status where name like '%p%' and db='test'|
# Fibonacci, for recursion test. (Yet Another Numerical series :)
@@ -2280,7 +2280,7 @@ drop procedure if exists bug2267_1|
--enable_warnings
create procedure bug2267_1()
begin
- show procedure status;
+ show procedure status where db='test';
end|
--disable_warnings
@@ -2288,7 +2288,7 @@ drop procedure if exists bug2267_2|
--enable_warnings
create procedure bug2267_2()
begin
- show function status;
+ show function status where db='test';
end|
--disable_warnings
@@ -5261,9 +5261,9 @@ drop procedure if exists bug13012|
create procedure bug13012()
BEGIN
REPAIR TABLE t1;
- BACKUP TABLE t1 to '../tmp';
+ BACKUP TABLE t1 to '../../tmp';
DROP TABLE t1;
- RESTORE TABLE t1 FROM '../tmp';
+ RESTORE TABLE t1 FROM '../../tmp';
END|
call bug13012()|
--enable_warnings
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index bc241423417..69ae56ff9a2 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -4,6 +4,9 @@
# embedded server causes different stat
-- source include/not_embedded.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
# Disable concurrent inserts to avoid sporadic test failures as it might
# affect the the value of variables used throughout the test case.
set @old_concurrent_insert= @@global.concurrent_insert;
@@ -88,7 +91,7 @@ show status like 'last_query_cost';
drop table t1;
#
-# Test for Bug #15933 max_used_connections is wrong after FLUSH STATUS
+# Test for Bug#15933 max_used_connections is wrong after FLUSH STATUS
# if connections are cached
#
#
@@ -188,7 +191,7 @@ disconnect con1;
#
-# Bug #30377: EXPLAIN loses last_query_cost when used with UNION
+# Bug#30377 EXPLAIN loses last_query_cost when used with UNION
#
CREATE TABLE t1 ( a INT );
@@ -238,8 +241,10 @@ let $tmp_table2 = `show global status like 'Created_tmp_tables'`;
--disable_query_log
eval select substring_index('$rnd_next2',0x9,-1)-substring_index('$rnd_next',0x9,-1) as rnd_diff, substring_index('$tmp_table2',0x9,-1)-substring_index('$tmp_table',0x9,-1) as tmp_table_diff;
--enable_query_log
+disconnect con1;
+connection default;
-#
+#
# Bug#30252 Com_create_function is not incremented.
#
flush status;
@@ -259,7 +264,7 @@ drop function f1;
show status like 'Com%function';
#
-# Bug#37908: Skipped access right check caused server crash.
+# Bug#37908 Skipped access right check caused server crash.
#
connect (root, localhost, root,,test);
connection root;
@@ -271,28 +276,75 @@ insert into db37908.t1 values(1);
grant usage,execute on test.* to mysqltest_1@localhost;
delimiter |;
create procedure proc37908() begin select 1; end |
-create function func37908() returns int sql security invoker
+create function func37908() returns int sql security invoker
return (select * from db37908.t1 limit 1)|
delimiter ;|
-
+
connect (user1,localhost,mysqltest_1,,test);
connection user1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
select * from db37908.t1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
show status where variable_name ='uptime' and 2 in (select * from db37908.t1);
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
show procedure status where name ='proc37908' and 1 in (select f1 from db37908.t1);
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
show function status where name ='func37908' and 1 in (select func37908());
-connection root;
+connection default;
+disconnect user1;
+disconnect root;
drop database db37908;
drop procedure proc37908;
drop function func37908;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+DROP USER mysqltest_1@localhost;
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
+
+#
+# Bug#41131 "Questions" fails to increment - ignores statements instead stored procs
+#
+connect (con1,localhost,root,,);
+connection con1;
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+DELIMITER $$;
+CREATE FUNCTION f1() RETURNS INTEGER
+BEGIN
+ DECLARE foo INTEGER;
+ DECLARE bar INTEGER;
+ SET foo=1;
+ SET bar=2;
+ RETURN foo;
+END $$
+CREATE PROCEDURE p1()
+ BEGIN
+ SELECT 1;
+END $$
+DELIMITER ;$$
+let $org_queries= `SHOW STATUS LIKE 'Queries'`;
+SELECT f1();
+CALL p1();
+let $new_queries= `SHOW STATUS LIKE 'Queries'`;
+--disable_query_log
+let $diff= `SELECT SUBSTRING('$new_queries',9)-SUBSTRING('$org_queries',9)`;
+--enable_query_log
+eval SELECT $diff;
+disconnect con1;
+connection default;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+
# End of 5.1 tests
# Restore global concurrent_insert value. Keep in the end of the test file.
--connection default
set @@global.concurrent_insert= @old_concurrent_insert;
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
+
diff --git a/mysql-test/t/status2.test b/mysql-test/t/status2.test
new file mode 100644
index 00000000000..2d1541c54f2
--- /dev/null
+++ b/mysql-test/t/status2.test
@@ -0,0 +1,68 @@
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
+--echo #
+FLUSH STATUS;
+DELIMITER $$;
+CREATE FUNCTION testQuestion() RETURNS INTEGER
+BEGIN
+ DECLARE foo INTEGER;
+ DECLARE bar INTEGER;
+ SET foo=1;
+ SET bar=2;
+ RETURN foo;
+END $$
+CREATE PROCEDURE testQuestion2()
+BEGIN
+ SELECT 1;
+END $$
+DELIMITER ;$$
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
+ DO INSERT INTO t1 VALUES(1);
+
+--echo Assert Questions == 7
+SHOW STATUS LIKE 'Questions';
+SELECT testQuestion();
+--echo Assert Questions == 9
+SHOW STATUS LIKE 'Questions';
+CALL testQuestion2();
+--echo Assert Questions == 11
+SHOW STATUS LIKE 'Questions';
+SELECT 1;
+--echo Assert Questions == 13
+SHOW STATUS LIKE 'Questions';
+connect (con1,localhost,root,,);
+connection con1;
+SELECT 1;
+connection default;
+disconnect con1;
+--echo Assert Questions == 14
+SHOW STATUS LIKE 'Questions';
+DELIMITER $$;
+CREATE TRIGGER trigg1 AFTER INSERT ON t1
+ FOR EACH ROW BEGIN
+ INSERT INTO t2 VALUES (1);
+ END;
+$$
+DELIMITER ;$$
+--echo Assert Questions == 16
+SHOW STATUS LIKE 'Questions';
+INSERT INTO t1 VALUES (1);
+--echo Assert Questions == 18
+SHOW STATUS LIKE 'Questions';
+# TODO: Uncomment the lines below when FLUSH GLOBAL STATUS is implemented.
+# FLUSH STATUS;
+# SHOW GLOBAL STATUS LIKE 'Questions';
+DROP PROCEDURE testQuestion2;
+DROP TRIGGER trigg1;
+DROP FUNCTION testQuestion;
+DROP EVENT ev1;
+DROP TABLE t1,t2;
+--echo End of 6.0 tests
+
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index 486f7ce7897..f2ce045840c 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -1199,6 +1199,15 @@ show create table t1;
drop table t1;
#
+# Bug #39591: Crash if table comment is longer than 62 characters
+#
+
+#60 chars, 120 (+1) bytes (UTF-8 with 2-byte chars)
+CREATE TABLE t3 (f1 INT) COMMENT 'כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן';
+SHOW CREATE TABLE t3;
+DROP TABLE t3;
+
+#
# Bug #26359: Strings becoming truncated and converted to numbers under STRICT mode
#
set sql_mode= 'traditional';
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 493857fb463..9dcb645b28d 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1041,13 +1041,14 @@ DROP TABLE t1;
create table t1 (a int, b decimal(13, 3));
insert into t1 values (1, 0.123);
-let $outfile = $MYSQLTEST_VARDIR/master-data/test/subselect.out.file.1;
+let $outfile_abs= $MYSQLTEST_VARDIR/tmp/subselect.out.file.1;
+let $outfile_rel= ../../tmp/subselect.out.file.1;
--error 0,1
---remove_file $outfile
-select a, (select max(b) from t1) into outfile "subselect.out.file.1" from t1;
+--remove_file $outfile_abs
+eval select a, (select max(b) from t1) into outfile "$outfile_rel" from t1;
delete from t1;
-load data infile "subselect.out.file.1" into table t1;
---remove_file $outfile
+eval load data infile "$outfile_rel" into table t1;
+--remove_file $outfile_abs
select * from t1;
drop table t1;
@@ -3391,4 +3392,39 @@ DELETE FROM v3;
DROP VIEW v1,v2,v3;
DROP TABLE t1,t2;
+--echo #
+--echo # BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result
+--echo #
+create table t1(id integer primary key, g integer, v integer, s char(1));
+create table t2(id integer primary key, g integer, v integer, s char(1));
+insert into t1 values
+ (10, 10, 10, 'l'),
+ (20, 20, 20, 'l'),
+ (40, 40, 40, 'l'),
+ (41, 40, null, 'l'),
+ (50, 50, 50, 'l'),
+ (51, 50, null, 'l'),
+ (60, 60, 60, 'l'),
+ (61, 60, null, 'l'),
+ (70, 70, 70, 'l'),
+ (90, 90, null, 'l');
+insert into t2 values
+ (10, 10, 10, 'r'),
+ (30, 30, 30, 'r'),
+ (50, 50, 50, 'r'),
+ (60, 60, 60, 'r'),
+ (61, 60, null, 'r'),
+ (70, 70, 70, 'r'),
+ (71, 70, null, 'r'),
+ (80, 80, 80, 'r'),
+ (81, 80, null, 'r'),
+ (100,100,null, 'r');
+
+select *
+from t1
+where v in(select v
+ from t2
+ where t1.g=t2.g) is unknown;
+drop table t1, t2;
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
index 7c3d5013b8d..bf461f83a20 100644
--- a/mysql-test/t/subselect3.test
+++ b/mysql-test/t/subselect3.test
@@ -640,6 +640,35 @@ WHERE NULL NOT IN (
DROP TABLE t1;
+#
+# Bug #39069: <row constructor> IN <table-subquery> seriously messed up
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2), (11);
+
+--echo # 2nd and 3rd columns should be same
+SELECT a, ROW(11, 12) = (SELECT a, 22), ROW(11, 12) IN (SELECT a, 22) FROM t1 GROUP BY t1.a;
+SELECT a, ROW(11, 12) = (SELECT a, 12), ROW(11, 12) IN (SELECT a, 12) FROM t1 GROUP BY t1.a;
+SELECT a, ROW(11, 12) = (SELECT a, 22), ROW(11, 12) IN (SELECT a, 22) FROM t1;
+SELECT a, ROW(11, 12) = (SELECT a, 12), ROW(11, 12) IN (SELECT a, 12) FROM t1;
+
+# The x alias is used below to workaround bug #40674.
+# Regression tests for sum function on outer column in subselect from dual:
+SELECT a AS x, ROW(11, 12) = (SELECT MAX(x), 22), ROW(11, 12) IN (SELECT MAX(x), 22) FROM t1;
+--echo # 2nd and 3rd columns should be same for x == 11 only
+SELECT a AS x, ROW(11, 12) = (SELECT MAX(x), 12), ROW(11, 12) IN (SELECT MAX(x), 12) FROM t1;
+
+DROP TABLE t1;
+
+--echo # both columns should be same
+SELECT ROW(1,2) = (SELECT NULL, NULL), ROW(1,2) IN (SELECT NULL, NULL);
+SELECT ROW(1,2) = (SELECT 1, NULL), ROW(1,2) IN (SELECT 1, NULL);
+SELECT ROW(1,2) = (SELECT NULL, 2), ROW(1,2) IN (SELECT NULL, 2);
+SELECT ROW(1,2) = (SELECT NULL, 1), ROW(1,2) IN (SELECT NULL, 1);
+SELECT ROW(1,2) = (SELECT 1, 1), ROW(1,2) IN (SELECT 1, 1);
+SELECT ROW(1,2) = (SELECT 1, 2), ROW(1,2) IN (SELECT 1, 2);
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index b13640e7f3b..c805dd40fe8 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -176,14 +176,15 @@ drop table t1;
#
# Bug #29325: create table overwrites .MYD file of other table (datadir)
#
+let $MYSQLD_DATADIR= `select @@datadir`;
SET SESSION keep_files_on_create = TRUE;
---write_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD
+--write_file $MYSQLD_DATADIR/test/t1.MYD
EOF
--disable_abort_on_error
--error 1,1,ER_TABLE_EXISTS_ERROR
CREATE TABLE t1 (a INT) ENGINE MYISAM;
--error 0,1
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD;
+--remove_file $MYSQLD_DATADIR/test/t1.MYD;
--enable_abort_on_error
SET SESSION keep_files_on_create = FALSE;
CREATE TABLE t1 (a INT) ENGINE MYISAM;
@@ -199,34 +200,35 @@ DROP TABLE t1;
# home directory is symlinked, e.g. mysql-test-run --mem.
# This will be fixed in 6.0 only.
#
---replace_result $MYSQLTEST_VARDIR TEST_DIR
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--error 0,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
-INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
+INDEX DIRECTORY='$MYSQLD_DATADIR/mysql';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
---replace_result $MYSQLTEST_VARDIR TEST_DIR
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--error 0,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
-DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test';
+DATA DIRECTORY='$MYSQLD_DATADIR/test';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
---replace_result $MYSQLTEST_VARDIR TEST_DIR
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--error 0,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
-DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/';
+DATA DIRECTORY='$MYSQLD_DATADIR/';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
---replace_result $MYSQLTEST_VARDIR TEST_DIR
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--error 0,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
-INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data';
+INDEX DIRECTORY='$MYSQLD_DATADIR';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -240,6 +242,7 @@ INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data_var';
# BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is
# silently ignored
#
+
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE';
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp';
diff --git a/mysql-test/t/system_mysql_db.test b/mysql-test/t/system_mysql_db.test
index e3d58ab7139..398a222b642 100644
--- a/mysql-test/t/system_mysql_db.test
+++ b/mysql-test/t/system_mysql_db.test
@@ -6,11 +6,6 @@
# depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
-# First delete some tables maybe left over from previous tests
---disable_warnings
-drop table if exists t1,t1aa,t2aa;
---enable_warnings
-
-- disable_query_log
use mysql;
-- enable_query_log
diff --git a/mysql-test/t/system_mysql_db_fix30020.test b/mysql-test/t/system_mysql_db_fix30020.test
index dc68f469d3a..0a7d9dad7c9 100644
--- a/mysql-test/t/system_mysql_db_fix30020.test
+++ b/mysql-test/t/system_mysql_db_fix30020.test
@@ -21,10 +21,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_SYSTEM_TABLES") <= 0`)
# mysql_fix_system_tables which should be ignored.
# Instead, concentrate on the errors in r/system_mysql_db.reject
---disable_warnings
-drop table if exists t1,t1aa,t2aa;
---enable_warnings
-
-- disable_result_log
-- disable_query_log
@@ -108,4 +104,5 @@ time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index;
# check that we dropped all system tables
show tables;
+exit;
# End of 4.1 tests
diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test
index 419a9cd1827..440fcc8aa8a 100644
--- a/mysql-test/t/system_mysql_db_fix40123.test
+++ b/mysql-test/t/system_mysql_db_fix40123.test
@@ -18,10 +18,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
# mysql_fix_system_tables which should be ignored.
# Instead, concentrate on the errors in r/system_mysql_db.reject
---disable_warnings
-drop table if exists t1,t1aa,t2aa;
---enable_warnings
-
-- disable_result_log
-- disable_query_log
diff --git a/mysql-test/t/system_mysql_db_fix50030.test b/mysql-test/t/system_mysql_db_fix50030.test
index 80365cfdff4..4924c625d57 100644
--- a/mysql-test/t/system_mysql_db_fix50030.test
+++ b/mysql-test/t/system_mysql_db_fix50030.test
@@ -18,10 +18,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
# mysql_fix_system_tables which should be ignored.
# Instead, concentrate on the errors in r/system_mysql_db.reject
---disable_warnings
-drop table if exists t1,t1aa,t2aa;
---enable_warnings
-
-- disable_result_log
-- disable_query_log
diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test
index 1eed4d671ef..d88c4edba93 100644
--- a/mysql-test/t/system_mysql_db_fix50117.test
+++ b/mysql-test/t/system_mysql_db_fix50117.test
@@ -18,10 +18,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
# mysql_fix_system_tables which should be ignored.
# Instead, concentrate on the errors in r/system_mysql_db.reject
---disable_warnings
- drop table if exists t1,t1aa,t2aa;
---enable_warnings
-
-- disable_result_log
-- disable_query_log
diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test
index 4ab8a982e63..2bfa4936c91 100644
--- a/mysql-test/t/temp_table.test
+++ b/mysql-test/t/temp_table.test
@@ -204,4 +204,35 @@ DELETE FROM t1;
SELECT * FROM t1;
DROP TABLE t1;
+#
+# Bug#41348: INSERT INTO tbl SELECT * FROM temp_tbl overwrites locking type of temp table
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+CREATE TEMPORARY TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 LIKE t1;
+
+DELIMITER |;
+CREATE FUNCTION f1() RETURNS INT
+ BEGIN
+ return 1;
+ END|
+DELIMITER ;|
+
+INSERT INTO t2 SELECT * FROM t1;
+INSERT INTO t1 SELECT f1();
+
+CREATE TABLE t3 SELECT * FROM t1;
+INSERT INTO t1 SELECT f1();
+
+UPDATE t1,t2 SET t1.a = t2.a;
+INSERT INTO t2 SELECT f1();
+
+DROP TABLE t1,t2,t3;
+DROP FUNCTION f1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test
index 4f70539ca8d..15ddceb8d68 100644
--- a/mysql-test/t/timezone2.test
+++ b/mysql-test/t/timezone2.test
@@ -228,6 +228,7 @@ drop table t1;
# Test for bug #11081 "Using a CONVERT_TZ function in a stored function
# or trigger fails".
#
+SET @old_log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (ldt datetime, udt datetime);
@@ -243,7 +244,7 @@ select ldt, f1(udt) as ldt2 from t1;
drop table t1;
drop function f1;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
# End of 5.0 tests
diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test
index 9f7fd8bc505..bf119cd89e6 100644
--- a/mysql-test/t/trigger-compat.test
+++ b/mysql-test/t/trigger-compat.test
@@ -60,8 +60,9 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1
--echo
--echo ---> patching t1.TRG...
---exec grep -v 'definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
---exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec grep -v 'definers=' $MYSQLD_DATADIR/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
+--exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLD_DATADIR/mysqltest_db1/t1.TRG
#
# Create a new trigger.
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index c57178c1928..6974a4cc5da 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -472,11 +472,11 @@ create trigger trg1 before insert on t1 for each row set new.k = new.i;
create trigger trg2 after insert on t1 for each row set @b:= "Fired";
set @b:="";
# Test triggers with file with separators
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, i);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, i);
select *, @b from t1;
set @b:="";
# Test triggers with fixed size row file
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
select *, @b from t1;
# This also will drop triggers
drop table t1;
@@ -510,7 +510,7 @@ delete from t1 where i = 2;
select * from t1;
# Should fail and insert only 1 row
--error ER_BAD_FIELD_ERROR
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
select * from t1;
--error ER_BAD_FIELD_ERROR
insert into t1 select 3, 3;
@@ -567,7 +567,7 @@ select * from t1;
delete from t1;
select * from t1;
--error ER_BAD_FIELD_ERROR
-load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
+load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
select * from t1;
--error ER_BAD_FIELD_ERROR
insert into t1 select 3, 3;
@@ -1141,12 +1141,13 @@ select trigger_schema, trigger_name, event_object_schema,
event_object_table, action_statement from information_schema.triggers
where event_object_schema = 'test';
# Trick which makes update of second .TRN file impossible
-write_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
+let $MYSQLD_DATADIR= `select @@datadir`;
+write_file $MYSQLD_DATADIR/test/t1_ai.TRN~;
dummy
EOF
-chmod 0000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
+chmod 0000 $MYSQLD_DATADIR/test/t1_ai.TRN~;
# Normalize the datadir path; the embedded server doesn't chdir to datadir
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error 1
rename table t1 to t2;
# 't1' should be still there and triggers should work correctly
@@ -1155,8 +1156,8 @@ select @a, @b;
select trigger_schema, trigger_name, event_object_schema,
event_object_table, action_statement from information_schema.triggers
where event_object_schema = 'test';
-chmod 0600 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
-remove_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
+chmod 0600 $MYSQLD_DATADIR/test/t1_ai.TRN~;
+remove_file $MYSQLD_DATADIR/test/t1_ai.TRN~;
# Let us check that updates to .TRN files were rolled back too
drop trigger t1_bi;
drop trigger t1_ai;
@@ -1189,7 +1190,7 @@ insert into t1 (a) values
create trigger t2_ai after insert on t2 for each row
set @a:= (select max(a) from t2);
insert into t2 select * from t1;
-load data infile '../std_data_ln/words.dat' into table t1 (a);
+load data infile '../../std_data/words.dat' into table t1 (a);
drop trigger t1_ai;
drop trigger t2_ai;
# Test that the problem for functions is fixed as well
@@ -1199,7 +1200,7 @@ insert into t1 values
("And",f1()),("the",f1()),("mome", f1()),("raths",f1()),("outgrabe",f1());
create function f2() returns int return (select max(b) from t2);
insert into t2 select a, f2() from t1;
-load data infile '../std_data_ln/words.dat' into table t1 (a) set b:= f1();
+load data infile '../../std_data/words.dat' into table t1 (a) set b:= f1();
drop function f1;
drop function f2;
drop table t1, t2;
diff --git a/mysql-test/t/trigger_notembedded.test b/mysql-test/t/trigger_notembedded.test
index 5d2ab84adaf..9588ec6e3ed 100644
--- a/mysql-test/t/trigger_notembedded.test
+++ b/mysql-test/t/trigger_notembedded.test
@@ -360,10 +360,11 @@ CREATE TRIGGER trg5 BEFORE DELETE ON t1
SET @a = 5;
# Replace definers with the "weird" definers
+let MYSQLD_DATADIR= `select @@datadir`;
perl;
use strict;
use warnings;
-my $fname= "$ENV{'MYSQLTEST_VARDIR'}/master-data/mysqltest_db1/t1.TRG";
+my $fname= "$ENV{'MYSQLD_DATADIR'}/mysqltest_db1/t1.TRG";
open(FILE, "<", $fname) or die;
my @content= grep($_ !~ /^definers=/, <FILE>);
close FILE;
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 5793846a0b2..dc5120db430 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -352,6 +352,51 @@ SELECT HEX(b1), HEX(b2), i2 FROM t2
DROP TABLE t1, t2;
+#
+# Bug #35796 SHOW CREATE TABLE and default value for BIT field
+#
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b'10',
+f2 bit(14) NOT NULL default b'11110000111100'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--error ER_INVALID_DEFAULT
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+
+#
+# Bug#31399 Wrong query result when doing join buffering over BIT fields
+#
+create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(7)) engine=MyISAM;
+
+insert into t1bit7 values (b'1100000');
+insert into t1bit7 values (b'1100001');
+insert into t1bit7 values (b'1100010');
+insert into t2bit7 values (b'1100001');
+insert into t2bit7 values (b'1100010');
+insert into t2bit7 values (b'1100110');
+
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+drop table t1bit7, t2bit7;
+
+create table t1bit7 (a1 bit(15) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(15)) engine=MyISAM;
+
+insert into t1bit7 values (b'110000011111111');
+insert into t1bit7 values (b'110000111111111');
+insert into t1bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110000111111111');
+insert into t2bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110011011111111');
+
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+drop table t1bit7, t2bit7;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index 35e5b30ecb8..460da1c1614 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -308,20 +308,20 @@ create table t1 (id integer auto_increment unique,imagem LONGBLOB not null defau
insert into t1 (id) values (1);
# We have to clean up the path in the results for safe comparison
eval select
- charset(load_file('../std_data_ln/words.dat')),
- collation(load_file('../std_data_ln/words.dat')),
- coercibility(load_file('../std_data_ln/words.dat'));
+ charset(load_file('../../std_data/words.dat')),
+ collation(load_file('../../std_data/words.dat')),
+ coercibility(load_file('../../std_data/words.dat'));
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval explain extended select
- charset(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat')),
- collation(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat')),
- coercibility(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat'));
+ charset(load_file('$MYSQLTEST_VARDIR/std_data/words.dat')),
+ collation(load_file('$MYSQLTEST_VARDIR/std_data/words.dat')),
+ coercibility(load_file('$MYSQLTEST_VARDIR/std_data/words.dat'));
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval update t1 set imagem=load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat') where id=1;
+eval update t1 set imagem=load_file('$MYSQLTEST_VARDIR/std_data/words.dat') where id=1;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
drop table t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval create table t1 select load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat') l;
+eval create table t1 select load_file('$MYSQLTEST_VARDIR/std_data/words.dat') l;
# We mask out the Privileges column because it differs for embedded server
--replace_column 8 #
show full fields from t1;
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 9bc428c3715..aec60bc2dee 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -62,7 +62,7 @@ drop table t1;
# Test of date and not null
#
-create table t1 (date date);
+create table t1 (date date);
insert into t1 values ("2000-08-10"),("2000-08-11");
select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1;
drop table t1;
@@ -75,9 +75,12 @@ CREATE TABLE t1(AFIELD INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(GMT VARCHAR(32));
INSERT INTO t2 VALUES('GMT-0800');
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
+FROM t1, t2 GROUP BY t1.AFIELD;
INSERT INTO t1 VALUES(1);
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)),
+ DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
+FROM t1,t2 GROUP BY t1.AFIELD;
drop table t1,t2;
#
@@ -90,7 +93,7 @@ SELECT DATE_FORMAT(f1, "%l.%i %p") , DATE_FORMAT(f2, "%l.%i %p") FROM t1;
DROP TABLE t1;
#
-# Bug 4937: different date -> string conversion when using SELECT ... UNION
+# Bug#4937: different date -> string conversion when using SELECT ... UNION
# and INSERT ... SELECT ... UNION
#
@@ -141,7 +144,7 @@ select * from t1;
drop table t1;
#
-# Bug #30942: select str_to_date from derived table returns varying results
+# Bug#30942: select str_to_date from derived table returns varying results
#
CREATE TABLE t1 (
a INT
@@ -155,10 +158,22 @@ DROP TABLE t1;
#
-# Bug #31221: Optimizer incorrectly identifies impossible WHERE clause
+# Bug#31221: Optimizer incorrectly identifies impossible WHERE clause
#
-CREATE TABLE t1 (a DATE, b int, PRIMARY KEY (a,b));
+CREATE TABLE t1 (a DATE, b INT, PRIMARY KEY (a,b));
+## The current sub test could fail (difference to expected result) if we
+## have just reached midnight.
+## (Bug#41776 type_date.test may fail if run around midnight)
+## Therefore we sleep a bit if we are too close to midnight.
+## The complete test itself needs in average less than 1 second.
+## Therefore a time_distance to midnight of 5 seconds should be sufficient.
+if (`SELECT CURTIME() > SEC_TO_TIME(24 * 3600 - 5)`)
+{
+ # We are here when CURTIME() is between '23:59:56' and '23:59:59'.
+ # So a sleep time of 5 seconds brings us between '00:00:01' and '00:00:04'.
+ --real_sleep 5
+}
INSERT INTO t1 VALUES (DATE(NOW()), 1);
SELECT COUNT(*) FROM t1 WHERE a = NOW();
EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
@@ -174,7 +189,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
DROP TABLE t1;
#
-# Bug #28687: Search fails on '0000-00-00' date after sql_mode change
+# Bug#28687: Search fails on '0000-00-00' date after sql_mode change
#
CREATE TABLE t1 (a DATE);
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index 9aa8c00d24a..53bcf44061d 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -252,4 +252,19 @@ insert into t1 values (2e30), (-2e30);
select f1 + 0e0 from t1;
drop table t1;
+#
+# Bug #27483: Casting 'scientific notation type' to 'unsigned bigint' fails on
+# windows.
+#
+
+create table t1(d double, u bigint unsigned);
+
+insert into t1(d) values (9.22337203685479e18),
+ (1.84e19);
+
+update t1 set u = d;
+select u from t1;
+
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index 27922a16a37..e8374e0ebfc 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -324,7 +324,7 @@ insert into t1 (a, c) values (4, '2004-04-04 00:00:00'),
select * from t1;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
# Restore timezone to default
set time_zone= @@global.time_zone;
@@ -339,3 +339,21 @@ PRIMARY KEY (`id`)
show fields from t1;
select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and COLUMN_NAME='posted_on';
drop table t1;
+
+#
+# Bug#41370: TIMESTAMP field does not accepts NULL from FROM_UNIXTIME()
+#
+
+CREATE TABLE t1 ( f1 INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ f2 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ f3 TIMESTAMP);
+INSERT INTO t1 (f2,f3) VALUES (NOW(), "0000-00-00 00:00:00");
+INSERT INTO t1 (f2,f3) VALUES (NOW(), NULL);
+INSERT INTO t1 (f2,f3) VALUES (NOW(), ASCII(NULL));
+INSERT INTO t1 (f2,f3) VALUES (NOW(), FROM_UNIXTIME('9999999999'));
+INSERT INTO t1 (f2,f3) VALUES (NOW(), TIME(NULL));
+UPDATE t1 SET f2=NOW(), f3=FROM_UNIXTIME('9999999999') WHERE f1=1;
+SELECT f1,f2-f3 FROM t1;
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/type_varchar.test b/mysql-test/t/type_varchar.test
index 1eb949a21e3..9098881e379 100644
--- a/mysql-test/t/type_varchar.test
+++ b/mysql-test/t/type_varchar.test
@@ -3,7 +3,8 @@ drop table if exists t1, t2;
--enable_warnings
create table t1 (v varchar(30), c char(3), e enum('abc','def','ghi'), t text);
-copy_file $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLTEST_VARDIR/master-data/test/vchar.frm;
+let $MYSQLD_DATADIR= `select @@datadir`;
+copy_file $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLD_DATADIR/test/vchar.frm;
truncate table vchar;
show create table t1;
show create table vchar;
@@ -162,8 +163,8 @@ create table t3 (
en varchar(255) character set utf8,
cz varchar(255) character set utf8
);
-remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm;
-copy_file $MYSQL_TEST_DIR/std_data/14897.frm $MYSQLTEST_VARDIR/master-data/test/t3.frm;
+remove_file $MYSQLD_DATADIR/test/t3.frm;
+copy_file $MYSQL_TEST_DIR/std_data/14897.frm $MYSQLD_DATADIR/test/t3.frm;
truncate table t3;
insert into t3 (id, en, cz) values
(1,'en string 1','cz string 1'),
diff --git a/mysql-test/t/upgrade.test b/mysql-test/t/upgrade.test
index ce40ec8ed77..a96d1f47cb2 100644
--- a/mysql-test/t/upgrade.test
+++ b/mysql-test/t/upgrade.test
@@ -52,7 +52,8 @@ drop table `txu#p#p1`;
# Check if old tables work
#
-system cp $MYSQL_TEST_DIR/std_data/old_table-323.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm;
+let $MYSQLD_DATADIR= `select @@datadir`;
+system cp $MYSQL_TEST_DIR/std_data/old_table-323.frm $MYSQLD_DATADIR/test/t1.frm;
truncate t1;
drop table t1;
@@ -70,11 +71,11 @@ create table tabc.t1 (a int);
FLUSH TABLES;
# Manually make a 5.0 database from the template
---mkdir $MYSQLTEST_VARDIR/master-data/a-b-c
---copy_file $MYSQLTEST_VARDIR/master-data/tabc/db.opt $MYSQLTEST_VARDIR/master-data/a-b-c/db.opt
---copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.frm $MYSQLTEST_VARDIR/master-data/a-b-c/t1.frm
---copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYD $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYD
---copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYI $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYI
+--mkdir $MYSQLD_DATADIR/a-b-c
+--copy_file $MYSQLD_DATADIR/tabc/db.opt $MYSQLD_DATADIR/a-b-c/db.opt
+--copy_file $MYSQLD_DATADIR/tabc/t1.frm $MYSQLD_DATADIR/a-b-c/t1.frm
+--copy_file $MYSQLD_DATADIR/tabc/t1.MYD $MYSQLD_DATADIR/a-b-c/t1.MYD
+--copy_file $MYSQLD_DATADIR/tabc/t1.MYI $MYSQLD_DATADIR/a-b-c/t1.MYI
show databases like '%a-b-c%';
ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;
diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test
index 70f2f0fa7a6..0098f237de9 100644
--- a/mysql-test/t/user_var-binlog.test
+++ b/mysql-test/t/user_var-binlog.test
@@ -16,9 +16,9 @@ source include/show_binlog_events.inc;
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
# absolutely need variables names to be quoted and strings to be
# escaped).
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+let $MYSQLD_DATADIR= `select @@datadir`;
flush logs;
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001
drop table t1;
# End of 4.1 tests
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 5d916e410e3..fd4e538ea6c 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -285,4 +285,15 @@ set @lastid=-1;
select @lastid != id, @lastid, @lastid := id from t1;
drop table t1;
+#
+# Bug#42188: crash and/or memory corruption with user variables in trigger
+#
+
+CREATE TABLE t1 (i INT);
+CREATE TRIGGER t_after_insert AFTER INSERT ON t1 FOR EACH ROW SET @bug42188 = 10;
+INSERT INTO t1 VALUES (1);
+--change_user root,,test
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test
index 1db561183a7..1f9f7b5412d 100644
--- a/mysql-test/t/varbinary.test
+++ b/mysql-test/t/varbinary.test
@@ -47,12 +47,13 @@ drop table t1;
#
# Test with a saved table from 4.1
-copy_file std_data/bug19371.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm;
-chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.frm;
-copy_file std_data/bug19371.MYD $MYSQLTEST_VARDIR/master-data/test/t1.MYD;
-chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.MYD;
-copy_file std_data/bug19371.MYI $MYSQLTEST_VARDIR/master-data/test/t1.MYI;
-chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.MYI;
+let $MYSQLD_DATADIR= `select @@datadir`;
+copy_file std_data/bug19371.frm $MYSQLD_DATADIR/test/t1.frm;
+chmod 0777 $MYSQLD_DATADIR/test/t1.frm;
+copy_file std_data/bug19371.MYD $MYSQLD_DATADIR/test/t1.MYD;
+chmod 0777 $MYSQLD_DATADIR/test/t1.MYD;
+copy_file std_data/bug19371.MYI $MYSQLD_DATADIR/test/t1.MYI;
+chmod 0777 $MYSQLD_DATADIR/test/t1.MYI;
# Everything _looks_ fine
show create table t1;
diff --git a/mysql-test/t/variables-notembedded.test b/mysql-test/t/variables-notembedded.test
index 823fecb8791..7cc068c68c7 100644
--- a/mysql-test/t/variables-notembedded.test
+++ b/mysql-test/t/variables-notembedded.test
@@ -28,6 +28,7 @@ set global slave_net_timeout=default;
# sql_slave_skip_counter is write-only, so we can't save previous
# value and restore it here. That's ok, because it's normally 0.
set global sql_slave_skip_counter= 0;
+set @@global.slave_net_timeout= @my_slave_net_timeout;
#
# Bug#28234 - global/session scope - documentation vs implementation
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 828cb3a2916..a54ac497c4c 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -6,7 +6,7 @@ drop table if exists t1,t2;
--enable_warnings
#
-# Bug #19263: variables.test doesn't clean up after itself (I/II -- save)
+# Bug#19263: variables.test doesn't clean up after itself (I/II -- save)
#
set @my_binlog_cache_size =@@global.binlog_cache_size;
set @my_connect_timeout =@@global.connect_timeout;
@@ -24,6 +24,7 @@ set @my_max_heap_table_size =@@global.max_heap_table_size;
set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads;
set @my_max_join_size =@@global.max_join_size;
set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size;
+set @my_myisam_max_sort_file_size =@@global.myisam_max_sort_file_size;
set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout;
set @my_net_read_timeout =@@global.net_read_timeout;
@@ -34,7 +35,7 @@ set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time;
set @my_storage_engine =@@global.storage_engine;
set @my_thread_cache_size =@@global.thread_cache_size;
-
+set @my_max_allowed_packet =@@global.max_allowed_packet;
# case insensitivity tests (new in 5.0)
set @`test`=1;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
@@ -197,46 +198,46 @@ SELECT @@version_compile_os LIKE 'non-existent';
# The following should give errors
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set big_tables=OFFF;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set big_tables="OFFF";
---error 1193
+--error ER_UNKNOWN_SYSTEM_VARIABLE
set unknown_variable=1;
---error 1232
+--error ER_WRONG_TYPE_FOR_VAR
set max_join_size="hello";
---error 1286
+--error ER_UNKNOWN_STORAGE_ENGINE
set storage_engine=UNKNOWN_TABLE_TYPE;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set storage_engine=MERGE, big_tables=2;
show local variables like 'storage_engine';
---error 1229
+--error ER_GLOBAL_VARIABLE
set SESSION query_cache_size=10000;
---error 1230
+--error ER_NO_DEFAULT
set GLOBAL storage_engine=DEFAULT;
---error 1115
+--error ER_UNKNOWN_CHARACTER_SET
set character_set_client=UNKNOWN_CHARACTER_SET;
---error 1273
+--error ER_UNKNOWN_COLLATION
set collation_connection=UNKNOWN_COLLATION;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set character_set_client=NULL;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set collation_connection=NULL;
---error 1228
+--error ER_LOCAL_VARIABLE
set global autocommit=1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@global.timestamp;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@version='';
---error 1229
+--error ER_GLOBAL_VARIABLE
set @@concurrent_insert=1;
---error 1228
+--error ER_LOCAL_VARIABLE
set @@global.sql_auto_is_null=1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@global.sql_auto_is_null;
---error 1229
+--error ER_GLOBAL_VARIABLE
set myisam_max_sort_file_size=100;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set @@SQL_WARNINGS=NULL;
# Test setting all variables
@@ -367,23 +368,23 @@ drop table t1,t2;
# error conditions
#
---error 1193
+--error ER_UNKNOWN_SYSTEM_VARIABLE
select @@xxxxxxxxxx;
select 1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.key_buffer_size;
---error 1229
+--error ER_GLOBAL_VARIABLE
set ft_boolean_syntax = @@init_connect;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set global ft_boolean_syntax = @@init_connect;
---error 1229
+--error ER_GLOBAL_VARIABLE
set init_connect = NULL;
set global init_connect = NULL;
---error 1229
+--error ER_GLOBAL_VARIABLE
set ft_boolean_syntax = @@init_connect;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set global ft_boolean_syntax = @@init_connect;
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
@@ -416,15 +417,15 @@ select @a, @b;
#
# Bug#2586:Disallow global/session/local as structured var. instance names
#
---error 1064
+--error ER_PARSE_ERROR
set @@global.global.key_buffer_size= 1;
---error 1064
+--error ER_PARSE_ERROR
set GLOBAL global.key_buffer_size= 1;
---error 1064
+--error ER_PARSE_ERROR
SELECT @@global.global.key_buffer_size;
---error 1064
+--error ER_PARSE_ERROR
SELECT @@global.session.key_buffer_size;
---error 1064
+--error ER_PARSE_ERROR
SELECT @@global.local.key_buffer_size;
# BUG#5135: cannot turn on log_warnings with SET in 4.1 (and 4.0)
@@ -515,27 +516,27 @@ select @@lc_time_names;
--echo *** LC_TIME_NAMES: testing with string expressions
set lc_time_names=concat('de','_','DE');
select @@lc_time_names;
---error 1105
+--error ER_UNKNOWN_ERROR
set lc_time_names=concat('de','+','DE');
select @@lc_time_names;
--echo LC_TIME_NAMES: testing with numeric expressions
set @@lc_time_names=1+2;
select @@lc_time_names;
---error 1232
+--error ER_WRONG_TYPE_FOR_VAR
set @@lc_time_names=1/0;
select @@lc_time_names;
set lc_time_names=en_US;
--echo LC_TIME_NAMES: testing NULL and a negative number:
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set lc_time_names=NULL;
---error 1105
+--error ER_UNKNOWN_ERROR
set lc_time_names=-1;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing locale with the last ID:
set lc_time_names=108;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
---error 1105
+--error ER_UNKNOWN_ERROR
set lc_time_names=109;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing that 0 is en_US:
@@ -577,7 +578,7 @@ select @@query_prealloc_size = @test;
# Bug#31588 buffer overrun when setting variables
#
# Buffer-size Off By One. Should throw valgrind-warning without fix #31588.
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set global sql_mode=repeat('a',80);
--echo End of 4.1 tests
@@ -595,9 +596,9 @@ drop table t1;
# Bug #10339: read only variables.
#
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@warning_count=1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@global.error_count=1;
#
@@ -615,9 +616,9 @@ select @@max_heap_table_size > 0;
# Bug #11775 Variable character_set_system does not exist (sometimes)
#
select @@character_set_system;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global character_set_system = latin1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@global.version_compile_os='234';
#
@@ -728,7 +729,7 @@ select @@@;
# Don't actually output, since it depends on the system
--replace_column 1 #
select @@hostname;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@hostname= "anothername";
--replace_column 2 #
show variables like 'hostname';
@@ -748,7 +749,7 @@ set global delayed_queue_size =@my_delayed_queue_size;
set global flush =@my_flush;
set global flush_time =@my_flush_time;
set global key_buffer_size =@my_key_buffer_size;
-set global max_binlog_cache_size =default; #@my_max_binlog_cache_size;
+set global max_binlog_cache_size =@my_max_binlog_cache_size;
set global max_binlog_size =@my_max_binlog_size;
set global max_connect_errors =@my_max_connect_errors;
set global max_connections =@my_max_connections;
@@ -759,6 +760,7 @@ set global max_join_size =@my_max_join_size;
set global max_user_connections =default;
set global max_write_lock_count =default;
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
+set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size;
set global net_buffer_length =@my_net_buffer_length;
set global net_write_timeout =@my_net_write_timeout;
set global net_read_timeout =@my_net_read_timeout;
@@ -769,7 +771,7 @@ set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
set global storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size;
-
+set global max_allowed_packet =@my_max_allowed_packet;
#
# Bug#28580 Repeatation of status variables
#
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 1ea248f1fe9..9e22006ea67 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -1228,11 +1228,11 @@ drop table t1;
create table t1 (a int, b char(10));
create view v1 as select * from t1 where a != 0 with check option;
-- error 1369
-load data infile '../std_data_ln/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
select * from t1;
select * from v1;
delete from t1;
-load data infile '../std_data_ln/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
select * from t1 order by a,b;
select * from v1 order by a,b;
drop view v1;
@@ -1241,11 +1241,11 @@ drop table t1;
create table t1 (a text, b text);
create view v1 as select * from t1 where a <> 'Field A' with check option;
-- error 1369
-load data infile '../std_data_ln/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1;
select concat('|',a,'|'), concat('|',b,'|') from v1;
delete from t1;
-load data infile '../std_data_ln/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1;
select concat('|',a,'|'), concat('|',b,'|') from v1;
drop view v1;
diff --git a/mysql-test/t/wait_timeout-master.opt b/mysql-test/t/wait_timeout-master.opt
deleted file mode 100644
index 9e5c2289eb2..00000000000
--- a/mysql-test/t/wait_timeout-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---wait-timeout=1
diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test
index 255947fa79f..63809252a01 100644
--- a/mysql-test/t/wait_timeout.test
+++ b/mysql-test/t/wait_timeout.test
@@ -1,40 +1,51 @@
-# This tests not performed with embedded server
+# Last modification:
+# 2009-01-19 H.Hunger Fix Bug#39108 main.wait_timeout fails sporadically
+# - Increase wait timeout to 2 seconds
+# - Eliminated the corresponding opt file,
+# set global wait timeout within the test.
+# - Replaced sleeps by wait condition
+# - Minor improvements
+###############################################################################
+# These tests cannot run with the embedded server
-- source include/not_embedded.inc
-- source include/one_thread_per_connection.inc
#
-# Bug #8731: wait_timeout does not work on Mac OS X
+# Bug#8731: wait_timeout does not work on Mac OS X
#
+let $start_value= `SELECT @@global.wait_timeout`;
+SET @@global.wait_timeout= 2;
+--echo disconnect default;
+disconnect default;
# Connect with another connection and reset counters
--disable_query_log
connect (wait_con,localhost,root,,test,,);
+--echo connection wait_con;
connection wait_con;
-set session wait_timeout=100;
+SET SESSION wait_timeout=100;
let $retries=300;
-set @aborted_clients= 0;
+SET @aborted_clients= 0;
--enable_query_log
# Disable reconnect and do the query
+connect (default,localhost,root,,test,,);
+--echo connection default;
connection default;
-# If slow host (Valgrind...), we may have already timed out here.
-# So force a reconnect if necessary, using a dummy query. And issue a
-# 'flush status' to reset the 'aborted_clients' counter.
---enable_reconnect
-select 0;
-flush status;
+--echo --disable_reconnect;
--disable_reconnect
-select 1;
+SELECT 1;
# Switch to wait_con and wait until server has aborted the connection
--disable_query_log
+--echo connection wait_con;
connection wait_con;
while (!`select @aborted_clients`)
{
- sleep 0.1;
+ real_sleep 0.1;
let $aborted_clients = `SHOW STATUS LIKE 'aborted_clients'`;
- eval set @aborted_clients= SUBSTRING('$aborted_clients', 16)+0;
+ eval SET @aborted_clients= SUBSTRING('$aborted_clients', 16)+0;
dec $retries;
if (!$retries)
@@ -45,44 +56,51 @@ while (!`select @aborted_clients`)
--enable_query_log
# The server has disconnected, add small sleep to make sure
# the disconnect has reached client
-sleep 1;
-
+let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist;
+--source include/wait_condition.inc
+--echo connection default;
connection default;
# When the connection is closed in this way, the error code should
-# be consistent see bug#2845 for an explanation
+# be consistent see Bug#2845 for an explanation
# depending on platform/client, either errno 2006 or 2013 can occur below
--error 2006,2013
-select 2;
+SELECT 2;
+--echo --enable_reconnect;
--enable_reconnect
-select 3;
+SELECT 3;
# Disconnect so that we will not be confused by a future abort from this
# connection.
+--echo disconnection default;
disconnect default;
#
# Do the same test as above on a TCP connection
-# (which we get by specifying a ip adress)
+# (which we get by specifying an ip adress)
# Connect with another connection and reset counters
--disable_query_log
+--echo connection wait_con;
connection wait_con;
-flush status; # Reset counters
+FLUSH STATUS; # Reset counters
let $retries=300;
-set @aborted_clients= 0;
+SET @aborted_clients= 0;
--enable_query_log
+--echo connection con1;
connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,);
+--echo --disable_reconnect;
--disable_reconnect
-select 1;
+SELECT 1;
# Switch to wait_con and wait until server has aborted the connection
--disable_query_log
+--echo connection wait_con;
connection wait_con;
while (!`select @aborted_clients`)
{
- sleep 0.1;
+ real_sleep 0.1;
let $aborted_clients = `SHOW STATUS LIKE 'aborted_clients'`;
- eval set @aborted_clients= SUBSTRING('$aborted_clients', 16)+0;
+ eval SET @aborted_clients= SUBSTRING('$aborted_clients', 16)+0;
dec $retries;
if (!$retries)
@@ -93,14 +111,23 @@ while (!`select @aborted_clients`)
--enable_query_log
# The server has disconnected, add small sleep to make sure
# the disconnect has reached client
-sleep 1;
+let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist;
+--source include/wait_condition.inc
+--echo connection con1;
connection con1;
# When the connection is closed in this way, the error code should
-# be consistent see bug#2845 for an explanation
+# be consistent see Bug#2845 for an explanation
# depending on platform/client, either errno 2006 or 2013 can occur below
--error 2006,2013
-select 2;
+SELECT 2;
+--echo --enable_reconnect;
--enable_reconnect
-select 3;
+SELECT 3;
+--replace_result $start_value <start_value>
+eval SET @@global.wait_timeout= $start_value;
+# ML: The start value might be changed in future ...
+--echo disconnection con1;
disconnect con1;
+
+
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test
index 9e7e3e4f945..12421170eba 100644
--- a/mysql-test/t/warnings.test
+++ b/mysql-test/t/warnings.test
@@ -50,7 +50,7 @@ drop table t1;
#
create table t1(a tinyint, b int not null, c date, d char(5));
-load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
+load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
# PS doesn't work good with @@warning_count
--disable_ps_protocol
select @@warning_count;
@@ -65,7 +65,6 @@ create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5));
insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
alter table t1 modify c char(4);
alter table t1 add d char(2);
---error 1048
update t1 set a=NULL where a=10;
update t1 set c='mysql ab' where c='test';
update t1 set d=c;
diff --git a/mysql-test/t/warnings_engine_disabled.test b/mysql-test/t/warnings_engine_disabled.test
index 0b09cff7b1e..b8751a062b7 100644
--- a/mysql-test/t/warnings_engine_disabled.test
+++ b/mysql-test/t/warnings_engine_disabled.test
@@ -4,7 +4,7 @@
#
disable_query_log;
--require r/true.require
-select support = 'Disabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+select support = 'NO' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
enable_query_log;
@@ -16,4 +16,9 @@ create table t1 (id int) engine=NDB;
alter table t1 engine=NDB;
drop table t1;
-
+#
+# Bug#29263 disabled storage engines omitted in SHOW ENGINES
+#
+SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster';
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE
+PLUGIN_NAME='ndbcluster';
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 5ca9c7afd76..74bce8dc962 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -551,4 +551,43 @@ INSERT INTO t1 VALUES (0), (0);
SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
DROP TABLE t1;
+#
+# BUG#38227 EXTRACTVALUE doesn't work with DTD declarations
+#
+# Check that quoted strings work fine in DOCTYPE declaration.
+#
+
+SET @xml=
+'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title> Title - document with document declaration</title>
+ </head>
+ <body> Hi, Im a webpage with document a declaration </body>
+</html>';
+
+SELECT ExtractValue(@xml, 'html/head/title');
+SELECT ExtractValue(@xml, 'html/body');
+
+# These two documents will fail.
+# Quoted strings are not allowed in regular tags
+#
+SELECT ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml');
+SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml');
+
+#
+# Bug#42495 updatexml: Assertion failed: xpath->context, file .\item_xmlfunc.cc, line 2507
+#
+set @x=10;
+--error ER_UNKNOWN_ERROR
+select extractvalue('<a></a>','$@x/a');
+--error ER_UNKNOWN_ERROR
+select extractvalue('<a></a>','round(123.4)/a');
+--error ER_UNKNOWN_ERROR
+select extractvalue('<a></a>','1/a');
+--error ER_UNKNOWN_ERROR
+select extractvalue('<a></a>','"b"/a');
+--error ER_UNKNOWN_ERROR
+select extractvalue('<a></a>','(1)/a');
+
--echo End of 5.1 tests
diff --git a/mysys/charset.c b/mysys/charset.c
index 9bd8de4316a..8f47b4027ef 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -212,6 +212,8 @@ copy_uca_collation(CHARSET_INFO *to, CHARSET_INFO *from)
to->max_sort_char= from->max_sort_char;
to->mbminlen= from->mbminlen;
to->mbmaxlen= from->mbmaxlen;
+ to->state|= MY_CS_AVAILABLE | MY_CS_LOADED |
+ MY_CS_STRNXFRM | MY_CS_UNICODE;
}
@@ -246,14 +248,12 @@ static int add_collation(CHARSET_INFO *cs)
{
#if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS)
copy_uca_collation(newcs, &my_charset_ucs2_unicode_ci);
- newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED;
#endif
}
else if (!strcmp(cs->csname, "utf8"))
{
#if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS)
copy_uca_collation(newcs, &my_charset_utf8_unicode_ci);
- newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED;
#endif
}
else
diff --git a/mysys/hash.c b/mysys/hash.c
index 65a60c9e341..dd2d589e509 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/mysys/my_error.c b/mysys/my_error.c
index 75701536dd3..07656dda979 100644
--- a/mysys/my_error.c
+++ b/mysys/my_error.c
@@ -19,6 +19,10 @@
#include <stdarg.h>
#include <m_ctype.h>
+/* Max length of a error message. Should be kept in sync with MYSQL_ERRMSG_SIZE. */
+#define ERRMSGSIZE (512)
+
+
/* Define some external variables for error handling */
/*
@@ -30,8 +34,6 @@
my_printf_error(ER_CODE, format, MYF(N), ...)
*/
-char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
-
/*
Message texts are registered into a linked list of 'my_err_head' structs.
Each struct contains (1.) an array of pointers to C character strings with
@@ -75,7 +77,7 @@ int my_error(int nr, myf MyFlags, ...)
const char *format;
struct my_err_head *meh_p;
va_list args;
- char ebuff[ERRMSGSIZE + 20];
+ char ebuff[ERRMSGSIZE];
DBUG_ENTER("my_error");
DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d", nr, MyFlags, errno));
@@ -112,7 +114,7 @@ int my_error(int nr, myf MyFlags, ...)
int my_printf_error(uint error, const char *format, myf MyFlags, ...)
{
va_list args;
- char ebuff[ERRMSGSIZE+20];
+ char ebuff[ERRMSGSIZE];
DBUG_ENTER("my_printf_error");
DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d Format: %s",
error, MyFlags, errno, format));
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 0f8055860d4..f97550d4429 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -976,24 +976,26 @@ static void init_one_value(const struct my_option *option, uchar* *variable,
*((my_bool*) variable)= (my_bool) value;
break;
case GET_INT:
- *((int*) variable)= (int) value;
+ *((int*) variable)= (int) getopt_ll_limit_value((int) value, option, NULL);
break;
- case GET_UINT:
case GET_ENUM:
*((uint*) variable)= (uint) value;
break;
+ case GET_UINT:
+ *((uint*) variable)= (uint) getopt_ull_limit_value((uint) value, option, NULL);
+ break;
case GET_LONG:
- *((long*) variable)= (long) value;
+ *((long*) variable)= (long) getopt_ll_limit_value((long) value, option, NULL);
break;
case GET_ULONG:
- *((ulong*) variable)= (ulong) value;
+ *((ulong*) variable)= (ulong) getopt_ull_limit_value((ulong) value, option, NULL);
break;
case GET_LL:
- *((longlong*) variable)= (longlong) value;
+ *((longlong*) variable)= (longlong) getopt_ll_limit_value((longlong) value, option, NULL);
break;
case GET_ULL:
case GET_SET:
- *((ulonglong*) variable)= (ulonglong) value;
+ *((ulonglong*) variable)= (ulonglong) getopt_ull_limit_value((ulonglong) value, option, NULL);
break;
case GET_DOUBLE:
*((double*) variable)= (double) value;
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 4b45d5ddc1a..b330ffac65a 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -30,7 +30,6 @@
#endif
my_bool have_tcpip=0;
static void my_win_init(void);
-static my_bool win32_have_tcpip(void);
static my_bool win32_init_tcp_ip();
#else
#define my_win_init()
@@ -78,8 +77,12 @@ my_bool my_init(void)
my_umask= 0660; /* Default umask for new files */
my_umask_dir= 0700; /* Default umask for new directories */
init_glob_errs();
-#if defined(THREAD) && defined(SAFE_MUTEX)
+#if defined(THREAD)
+ if (my_thread_global_init())
+ return 1;
+# if defined(SAFE_MUTEX)
safe_mutex_global_init(); /* Must be called early */
+# endif
#endif
#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
fastmutex_global_init(); /* Must be called early */
@@ -89,8 +92,6 @@ my_bool my_init(void)
#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
- if (my_thread_global_init())
- return 1;
#if !defined( __WIN__) && !defined(__NETWARE__)
sigfillset(&my_signals); /* signals blocked by mf_brkhant */
#endif
@@ -152,9 +153,11 @@ void my_end(int infoflag)
{ /* Test if some file is left open */
if (my_file_opened | my_stream_opened)
{
- sprintf(errbuff[0],EE(EE_OPEN_WARNING),my_file_opened,my_stream_opened);
- (void) my_message_no_curses(EE_OPEN_WARNING,errbuff[0],ME_BELL);
- DBUG_PRINT("error",("%s",errbuff[0]));
+ char ebuff[512];
+ my_snprintf(ebuff, sizeof(ebuff), EE(EE_OPEN_WARNING),
+ my_file_opened, my_stream_opened);
+ my_message_no_curses(EE_OPEN_WARNING, ebuff, ME_BELL);
+ DBUG_PRINT("error", ("%s", ebuff));
my_print_open_files();
}
}
@@ -235,29 +238,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
#ifdef __WIN__
-/*
- This code is specially for running MySQL, but it should work in
- other cases too.
-
- Inizializzazione delle variabili d'ambiente per Win a 32 bit.
-
- Vengono inserite nelle variabili d'ambiente (utilizzando cosi'
- le funzioni getenv e putenv) i valori presenti nelle chiavi
- del file di registro:
-
- HKEY_LOCAL_MACHINE\software\MySQL
-
- Se la kiave non esiste nonn inserisce nessun valore
-*/
-
-/* Crea la stringa d'ambiente */
-
-void setEnvString(char *ret, const char *name, const char *value)
-{
- DBUG_ENTER("setEnvString");
- strxmov(ret, name,"=",value,NullS);
- DBUG_VOID_RETURN ;
-}
/*
my_parameter_handler
@@ -307,17 +287,6 @@ int handle_rtc_failure(int err_type, const char *file, int line,
static void my_win_init(void)
{
- HKEY hSoftMysql ;
- DWORD dimName = 256 ;
- DWORD dimData = 1024 ;
- DWORD dimNameValueBuffer = 256 ;
- DWORD dimDataValueBuffer = 1024 ;
- DWORD indexValue = 0 ;
- long retCodeEnumValue ;
- char NameValueBuffer[256] ;
- char DataValueBuffer[1024] ;
- char EnvString[1271] ;
- const char *targetKey = "Software\\MySQL" ;
DBUG_ENTER("my_win_init");
#if defined(_MSC_VER)
@@ -343,6 +312,30 @@ static void my_win_init(void)
_tzset();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/* The following is used by time functions */
#define OFFSET_TO_EPOC ((__int64) 134774 * 24 * 60 * 60 * 1000 * 1000 * 10)
#define MS 10000000
@@ -367,43 +360,57 @@ static void my_win_init(void)
}
}
- /* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,(LPCTSTR)targetKey,0,
- KEY_READ,&hSoftMysql) != ERROR_SUCCESS)
- DBUG_VOID_RETURN;
-
- /*
- ** Ne legge i valori e li inserisce nell'ambiente
- ** suppone che tutti i valori letti siano di tipo stringa + '\0'
- ** Legge il valore con indice 0 e lo scarta
- */
- retCodeEnumValue = RegEnumValue(hSoftMysql, indexValue++,
- (LPTSTR)NameValueBuffer, &dimNameValueBuffer,
- NULL, NULL, (LPBYTE)DataValueBuffer,
- &dimDataValueBuffer) ;
-
- while (retCodeEnumValue != ERROR_NO_MORE_ITEMS)
{
- char *my_env;
- /* Crea la stringa d'ambiente */
- setEnvString(EnvString, NameValueBuffer, DataValueBuffer) ;
-
- /* Inserisce i dati come variabili d'ambiente */
- my_env=strdup(EnvString); /* variable for putenv must be allocated ! */
- putenv(my_env) ;
-
- dimNameValueBuffer = dimName ;
- dimDataValueBuffer = dimData ;
+ /*
+ Open HKEY_LOCAL_MACHINE\SOFTWARE\MySQL and set any strings found
+ there as environment variables
+ */
+ HKEY key_handle;
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, (LPCTSTR)"SOFTWARE\\MySQL",
+ 0, KEY_READ, &key_handle) == ERROR_SUCCESS)
+ {
+ LONG ret;
+ DWORD index= 0;
+ DWORD type;
+ char key_name[256], key_data[1024];
+ DWORD key_name_len= sizeof(key_name) - 1;
+ DWORD key_data_len= sizeof(key_data) - 1;
+
+ while ((ret= RegEnumValue(key_handle, index++,
+ key_name, &key_name_len,
+ NULL, &type, (LPBYTE)&key_data,
+ &key_data_len)) != ERROR_NO_MORE_ITEMS)
+ {
+ char env_string[sizeof(key_name) + sizeof(key_data) + 2];
+
+ if (ret == ERROR_MORE_DATA)
+ {
+ /* Registry value larger than 'key_data', skip it */
+ DBUG_PRINT("error", ("Skipped registry value that was too large"));
+ }
+ else if (ret == ERROR_SUCCESS)
+ {
+ if (type == REG_SZ)
+ {
+ strxmov(env_string, key_name, "=", key_data, NullS);
+
+ /* variable for putenv must be allocated ! */
+ putenv(strdup(env_string)) ;
+ }
+ }
+ else
+ {
+ /* Unhandled error, break out of loop */
+ break;
+ }
+
+ key_name_len= sizeof(key_name) - 1;
+ key_data_len= sizeof(key_data) - 1;
+ }
- retCodeEnumValue = RegEnumValue(hSoftMysql, indexValue++,
- NameValueBuffer, &dimNameValueBuffer,
- NULL, NULL, (LPBYTE)DataValueBuffer,
- &dimDataValueBuffer) ;
+ RegCloseKey(key_handle) ;
+ }
}
-
- /* chiude la chiave */
- RegCloseKey(hSoftMysql) ;
-
DBUG_VOID_RETURN ;
}
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index 905733524e3..c484f1d4c54 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -147,7 +147,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
error_handler_hook=fatal_error_handler_hook;
if (MyFlags & (MY_FAE+MY_WME))
{
- char buff[SC_MAXWIDTH];
+ char buff[256];
my_errno=errno;
sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename);
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index b13e8411771..31638ecee9a 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -1359,7 +1359,8 @@ void thr_downgrade_write_lock(THR_LOCK_DATA *in_data,
/* Upgrade a WRITE_DELAY lock to a WRITE_LOCK */
-my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data)
+my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data,
+ enum thr_lock_type new_lock_type)
{
THR_LOCK *lock=data->lock;
DBUG_ENTER("thr_upgrade_write_delay_lock");
@@ -1372,7 +1373,7 @@ my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data)
}
check_locks(lock,"before upgrading lock",0);
/* TODO: Upgrade to TL_WRITE_CONCURRENT_INSERT in some cases */
- data->type=TL_WRITE; /* Upgrade lock */
+ data->type= new_lock_type; /* Upgrade lock */
/* Check if someone has given us the lock */
if (!data->cond)
@@ -1411,6 +1412,7 @@ my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data)
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data)
{
THR_LOCK *lock=data->lock;
+ enum thr_lock_type write_lock_type;
DBUG_ENTER("thr_reschedule_write_lock");
pthread_mutex_lock(&lock->mutex);
@@ -1420,6 +1422,7 @@ my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data)
DBUG_RETURN(0);
}
+ write_lock_type= data->type;
data->type=TL_WRITE_DELAYED;
if (lock->update_status)
(*lock->update_status)(data->status_param);
@@ -1438,7 +1441,7 @@ my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data)
free_all_read_locks(lock,0);
pthread_mutex_unlock(&lock->mutex);
- DBUG_RETURN(thr_upgrade_write_delay_lock(data));
+ DBUG_RETURN(thr_upgrade_write_delay_lock(data, write_lock_type));
}
diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap
deleted file mode 100755
index 4dc2ea6fa37..00000000000
--- a/netware/BUILD/nwbootstrap
+++ /dev/null
@@ -1,196 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-path=`dirname $0`
-
-# repository direcotry
-repo_dir=`pwd`
-
-# build directory
-build_dir="$HOME/mydev"
-wine_build_dir="F:/mydev"
-
-# doc directory
-doc_dir="$repo_dir/../mysqldoc"
-
-# init
-target_dir=""
-temp_dir=""
-revision=""
-rev=""
-build=""
-suffix=""
-#obsolete mwenv=""
-
-# show usage
-show_usage()
-{
- cat << EOF
-
-usage: nwbootstrap [options]
-
-Exports a revision of the BitKeeper tree (nwbootstrap must be run inside a
-directory of the BitKeeper tree to be used). Creates the ChangeLog file.
-Adds the latest manual.texi from the mysqldoc BitKeeper tree. Builds the
-Linux tools required for cross-platform builds. Optionally, builds the
-binary distributions for NetWare.
-
-options:
-
---build=<opt> Build the binary distributions for NetWare,
- where <opt> is "standard", "debug", or "all"
- (default is to not build a binary distribution)
-
---build-dir=<dir> Export the BitKeeper tree to the <dir> directroy
- (default is "$build_dir")
-
---doc-dir=<dir> Use the mysqldoc BitKeeper tree located in the
- <dir> directory
- (default is parallel to current BitKeeper tree)
-
---help Show this help information
-
---revision=<rev> Export the BitKeeper tree as of revision <rev>
- (default is the latest revision)
-
---wine-build-dir=<dir> Use the WINE directory <dir>, which should
- correspond to the --build-dir directory
- (default is "$wine_build_dir")
-
-examples:
-
- nwbootstrap
-
- nwbootstrap --revision=1.1594 --build=all
-
- nwbootstrap --build-dir=/home/jdoe/dev --wine-build-dir=F:/dev
-
-
-EOF
- exit 0;
-}
-
-# parse arguments
-for arg do
- case "$arg" in
- --build-dir=*) build_dir=`echo "$arg" | sed -e "s;--build-dir=;;"` ;;
- --wine-build-dir=*) wine_build_dir=`echo "$arg" | sed -e "s;--wine-build-dir=;;"` ;;
- --revision=*) revision=`echo "$arg" | sed -e "s;--revision=;;"` ;;
- --build=*) build=`echo "$arg" | sed -e "s;--build=;;"` ;;
- --suffix=*) suffix=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
- --doc-dir=*) doc_dir=`echo "$arg" | sed -e "s;--doc-dir=;;"` ;;
- *) show_usage ;;
- esac
-done
-
-echo "starting build..."
-
-# check for bk and repo_dir
-bzr help > /dev/null
-repo_dir=`bzr root $repo_dir`
-cd $repo_dir
-doc_dir="$repo_dir/../mysqldoc"
-
-# build temporary directory
-temp_dir="$build_dir/mysql-$$.tmp"
-
-# export the bk tree
-command="bzr export";
-if test $revision; then command="$command -r$revision"; fi
-command="$command $temp_dir"
-echo "exporting $repo_dir..."
-$command
-
-# determine version
-version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < $temp_dir/configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"`
-echo "version: $version"
-
-# build target directory
-target_dir="$build_dir/mysql-$version"
-
-# add suffix
-if test $suffix
-then
- target_dir="$target_dir-$suffix"
-fi
-
-# delete any old target
-if test -d $target_dir.old; then rm -rf $target_dir.old; fi
-
-# rename old target
-if test -d $target_dir; then mv -f $target_dir $target_dir.old; fi
-
-# rename directory to use version
-mv $temp_dir $target_dir
-
-# create ChangeLog
-if test $revision
-then
- rev=`bk changes -r..$revision -t -d':REV:' -n | head -2 | tail -1`
-else
- rev=`bk changes -t -d':REV:' -n | head -1`
-fi
-
-echo "creating ChangeLog..."
-bk changes -v -r$rev..$revision > $target_dir/ChangeLog
-
-# add the latest manual
-if test -d $doc_dir
-then
- echo "adding the latest manual..."
- install -m 644 $doc_dir/Docs/{manual,reservedwords}.texi $target_dir/Docs/
-fi
-
-# make files writeable
-echo "making files writable..."
-cd $target_dir
-chmod -R u+rw,g+rw .
-
-#obsolete # edit the mvenv file
-#obsolete echo "updating the mwenv environment file..."
-#obsolete mwenv="./netware/BUILD/mwenv"
-#obsolete mv -f $mwenv $mwenv.org
-#obsolete sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \
-#obsolete -e "s;BUILD_DIR;$build_dir;g" \
-#obsolete -e "s;VERSION;$version;g" $mwenv.org > $mwenv
-#obsolete chmod +rwx $mwenv
-#obsolete
-#obsolete PWD=`pwd`
-#obsolete # This line will catch the default value only, let's hope it is correct
-#obsolete SRC_DIR=`grep "^ *export MYDEV=" $mwenv | cut -d'=' -f2 | \
-#obsolete sed -e 's;";;g' -e "s;^;echo ;g" -e "s;$;/\`basename $PWD\`;g" | /bin/sh`
-
-# edit the def file versions
-echo "updating *.def file versions..."
-nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"`
-
-for file in ./netware/*.def
-do
- mv -f $file $file.org
- sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file
- rm $file.org
-done
-
-# create the libmysql.imp file in netware folder from libmysql/libmysql.def
-# file
-echo "generating libmysql.imp file..."
-awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {printf(",\n %s", $1);next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp
-# build linux tools
-echo "compiling linux tools..."
-./netware/BUILD/compile-linux-tools
-test -f ./netware/init_db.sql # this must exist
-test -f ./netware/test_db.sql # this must exist
-
-# compile
-if test $build
-then
- echo "compiling $build..."
- ./netware/BUILD/compile-netware-$build
-fi
-
-echo "done"
diff --git a/netware/BUILD/nwbuild b/netware/BUILD/nwbuild
new file mode 100755
index 00000000000..d431f70add8
--- /dev/null
+++ b/netware/BUILD/nwbuild
@@ -0,0 +1,86 @@
+#! /bin/sh
+
+# This script builds a Netware binary from a MySQL source tarball
+
+# debug
+#set -x
+
+# stop on errors
+set -e
+
+# init
+build=""
+
+# show usage
+show_usage()
+{
+ cat << EOF
+
+usage: nwbuild [options]
+
+Build Netware binary from source .tar.gz
+
+options:
+
+--build=<opt> Build the binary distributions for NetWare,
+ where <opt> is "standard", "debug", or "all"
+ (default is to not build a binary distribution)
+
+--help Show this help information
+
+Examples:
+
+ ./netware/BUILD/nwbuild --build=debug
+ ./netware/BUILD/nwbuild --build=standard
+
+EOF
+}
+
+# parse arguments
+for arg do
+ case "$arg" in
+ --build=*) build=`echo "$arg" | sed -e "s;--build=;;"` ;;
+ --help) show_usage; exit 0 ;;
+ *) show_usage >&2; exit 1 ;;
+ esac
+done
+
+# determine version
+version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"`
+echo "version: $version"
+
+# make files writeable
+echo "making files writable..."
+chmod -R u+rw,g+rw .
+
+# edit the def file versions
+nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"`
+echo "updating *.def file versions to $nlm_version..."
+
+for file in ./netware/*.def
+do
+ mv -f $file $file.org
+ sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file
+ rm $file.org
+done
+
+# create the libmysql.imp file in netware folder from libmysql/libmysql.def
+# file
+echo "generating libmysql.imp file..."
+awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {printf(",\n %s", $1);next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp
+# build linux tools
+echo "compiling linux tools..."
+./netware/BUILD/compile-linux-tools
+test -f ./netware/init_db.sql # this must exist
+test -f ./netware/test_db.sql # this must exist
+
+# compile
+if test $build
+then
+ echo "compiling $build..."
+ ./netware/BUILD/compile-netware-$build
+else
+ echo "Preparation complete. Use ./netware/BUILD/compile-netware-* to build MySQL."
+fi
+
+echo "done"
diff --git a/netware/Makefile.am b/netware/Makefile.am
index 0b30da17609..3d0402ce714 100644
--- a/netware/Makefile.am
+++ b/netware/Makefile.am
@@ -94,7 +94,7 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \
BUILD/compile-netware-standard BUILD/create-patch \
BUILD/cron-build BUILD/crontab BUILD/knetware.imp \
BUILD/mwasmnlm BUILD/mwccnlm BUILD/mwenv BUILD/mwldnlm \
- BUILD/nwbootstrap BUILD/openssl.imp BUILD/save-patch
+ BUILD/nwbuild BUILD/openssl.imp BUILD/save-patch
endif
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 8b191cf2cf4..f73de69f5b3 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -60,13 +60,16 @@ STRIP=1 # Option ignored
SILENT=0
PLATFORM=""
TMP=/tmp
+NEW_NAME="" # Final top directory and TAR package name
SUFFIX=""
+SHORT_PRODUCT_TAG="" # If don't want server suffix in package name
NDBCLUSTER="" # Option ignored
for arg do
case "$arg" in
--tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;;
--suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
+ --short-product-tag=*) SHORT_PRODUCT_TAG=`echo "$arg" | sed -e "s;--short-product-tag=;;"` ;;
--no-strip) STRIP=0 ;;
--machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;;
--platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;;
@@ -113,7 +116,11 @@ case $PLATFORM in
esac
# Change the distribution to a long descriptive name
-NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX
+if [ x"$SHORT_PRODUCT_TAG" != x"" ] ; then
+ NEW_NAME=mysql-$SHORT_PRODUCT_TAG-@VERSION@-$PLATFORM$SUFFIX
+else
+ NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX
+fi
# ----------------------------------------------------------------------
# Define BASE, and remove the old BASE directory if any
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 5a2409eeb6f..20b7973cb4e 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -21,6 +21,7 @@
basedir=""
builddir=""
ldata="@localstatedir@"
+langdir=""
srcdir=""
args=""
@@ -106,7 +107,7 @@ parse_arguments()
# Note that the user will be passed to mysqld so that it runs
# as 'user' (crucial e.g. if log-bin=/some_other_path/
# where a chown of datadir won't help)
- user=`parse_arg "$arg"` ;;
+ user=`parse_arg "$arg"` ;;
--skip-name-resolve) ip_only=1 ;;
--verbose) verbose=1 ;; # Obsolete
--rpm) in_rpm=1 ;;
@@ -171,7 +172,20 @@ find_in_basedir()
cannot_find_file()
{
echo
- echo "FATAL ERROR: Could not find $*"
+ echo "FATAL ERROR: Could not find $1"
+
+ shift
+ if test $# -ne 0
+ then
+ echo
+ echo "The following directories were searched:"
+ echo
+ for dir in "$@"
+ do
+ echo " $dir"
+ done
+ fi
+
echo
echo "If you compiled from source, you need to run 'make install' to"
echo "copy the software into the correct location ready for operation."
@@ -210,6 +224,11 @@ then
elif test -n "$basedir"
then
print_defaults=`find_in_basedir my_print_defaults bin extra`
+ if test -z "$print_defaults"
+ then
+ cannot_find_file my_print_defaults $basedir/bin $basedir/extra
+ exit 1
+ fi
else
print_defaults="@bindir@/my_print_defaults"
fi
@@ -232,7 +251,7 @@ then
bindir="$basedir/client"
extra_bindir="$basedir/extra"
mysqld="$basedir/sql/mysqld"
- mysqld_opt="--language=$srcdir/sql/share/english"
+ langdir="$srcdir/sql/share/english"
pkgdatadir="$srcdir/scripts"
scriptdir="$srcdir/scripts"
elif test -n "$basedir"
@@ -240,7 +259,23 @@ then
bindir="$basedir/bin"
extra_bindir="$bindir"
mysqld=`find_in_basedir mysqld libexec sbin bin`
+ if test -z "$mysqld"
+ then
+ cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin
+ exit 1
+ fi
+ langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english`
+ if test -z "$langdir"
+ then
+ cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english
+ exit 1
+ fi
pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql`
+ if test -z "$pkgdatadir"
+ then
+ cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql
+ exit 1
+ fi
scriptdir="$basedir/scripts"
else
basedir="@prefix@"
@@ -271,6 +306,16 @@ then
exit 1
fi
+if test -n "$langdir"
+then
+ if test ! -f "$langdir/errmsg.sys"
+ then
+ cannot_find_file "$langdir/errmsg.sys"
+ exit 1
+ fi
+ mysqld_opt="--language=$langdir"
+fi
+
# Try to determine the hostname
hostname=`@HOSTNAME@`
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 3cb4665eb1c..631e1e38cc7 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -293,7 +293,12 @@ sub start_mysqlds()
@groups = &find_groups($groupids);
for ($i = 0; defined($groups[$i]); $i++)
{
+ # Defaults are made explicit parameters to server execution...
@options = defaults_for_group($groups[$i]);
+ # ...so server MUST NOT try to read again from some config file, especially
+ # as the "right" file may be unknown to the server if we are using
+ # --defaults-file=... params in here.
+ unshift(@options,"--no-defaults");
$mysqld_found= 1; # The default
$mysqld_found= 0 if (!length($mysqld));
diff --git a/sql-bench/bench-init.pl.sh b/sql-bench/bench-init.pl.sh
index a728086760a..588e518a648 100644
--- a/sql-bench/bench-init.pl.sh
+++ b/sql-bench/bench-init.pl.sh
@@ -47,7 +47,7 @@ $opt_machine=""; $opt_suffix="";
$opt_create_options=undef;
$opt_optimization="None";
$opt_hw="";
-$opt_threads=5;
+$opt_threads=-1;
if (!defined($opt_time_limit))
{
@@ -68,6 +68,11 @@ $limits=merge_limits($server,$opt_cmp);
$date=date();
@estimated=(0.0,0.0,0.0); # For estimated time support
+if ($opt_threads != -1)
+{
+ print "WARNING: Option --threads is deprecated and has no effect\n"
+}
+
if ($opt_hires)
{
eval "use Time::HiRes;";
@@ -560,8 +565,8 @@ All benchmarks takes the following options:
Inform test suite that we are generate random inital values for sequence of
test executions. It should be used for imitation of real conditions.
---threads=# (Default 5)
- Number of threads for multi-user benchmarks.
+--threads=# **DEPRECATED**
+ This option has no effect, and will be removed in a future version.
--tcpip
Inform test suite that we are using TCP/IP to connect to the server. In
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 23532027883..155e0237e3c 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -762,19 +762,20 @@ long calc_daynr(uint year,uint month,uint day)
{
long delsum;
int temp;
+ int y= year; /* may be < 0 temporarily */
DBUG_ENTER("calc_daynr");
- if (year == 0 && month == 0 && day == 0)
+ if (y == 0 && month == 0 && day == 0)
DBUG_RETURN(0); /* Skip errors */
- delsum= (long) (365L * year+ 31*(month-1) +day);
+ delsum= (long) (365L * y+ 31*(month-1) +day);
if (month <= 2)
- year--;
+ y--;
else
delsum-= (long) (month*4+23)/10;
- temp=(int) ((year/100+1)*3)/4;
+ temp=(int) ((y/100+1)*3)/4;
DBUG_PRINT("exit",("year: %d month: %d day: %d -> daynr: %ld",
- year+(month <= 2),month,day,delsum+year/4-temp));
- DBUG_RETURN(delsum+(int) year/4-temp);
+ y+(month <= 2),month,day,delsum+y/4-temp));
+ DBUG_RETURN(delsum+(int) y/4-temp);
} /* calc_daynr */
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index c26b740d24a..9a253d74546 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2006 MySQL AB
+/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/event_parse_data.cc b/sql/event_parse_data.cc
index df419e92d0d..63ecc3006dd 100644
--- a/sql/event_parse_data.cc
+++ b/sql/event_parse_data.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/event_parse_data.h b/sql/event_parse_data.h
index 87a800c2078..8b42eb23937 100644
--- a/sql/event_parse_data.h
+++ b/sql/event_parse_data.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/field.cc b/sql/field.cc
index e815320bc9e..973170223e4 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3835,7 +3835,7 @@ int Field_longlong::store(double nr)
error= 1;
}
else
- res=(longlong) (ulonglong) nr;
+ res=(longlong) double2ulonglong(nr);
}
else
{
diff --git a/sql/field.h b/sql/field.h
index 81905cc64ae..5136f760fc1 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -209,7 +209,7 @@ public:
memcpy(ptr, ptr + l_offset, pack_length());
if (null_ptr)
*null_ptr= ((*null_ptr & (uchar) ~null_bit) |
- null_ptr[l_offset] & null_bit);
+ (null_ptr[l_offset] & null_bit));
}
virtual bool binary() const { return 1; }
virtual bool zero_pack() const { return 1; }
diff --git a/sql/filesort.cc b/sql/filesort.cc
index d23715a0149..8f18471b378 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -566,10 +566,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
if (quick_select)
{
if ((error= select->quick->get_next()))
- {
- error= HA_ERR_END_OF_FILE;
break;
- }
file->position(sort_form->record[0]);
DBUG_EXECUTE_IF("debug_filesort", dbug_print_record(sort_form, TRUE););
}
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index 7b2395673eb..214ee4c99d2 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -451,7 +451,7 @@ int main(int argc,char **argv)
printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
printf("\
-/* Copyright (C) 2001-2004 MySQL AB\n\
+/* Copyright 2001-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n\
\n\
This program is free software; you can redistribute it and/or modify\n\
it under the terms of the GNU General Public License as published by\n\
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index be7ca278302..c804b84ca87 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -5256,6 +5256,7 @@ int ha_ndbcluster::create(const char *name,
strcmp(m_tabname, NDB_SCHEMA_TABLE) == 0))
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
+ DBUG_ASSERT(ndb_schema_share);
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
single_user_mode = NdbDictionary::Table::SingleUserModeReadWrite;
@@ -6083,6 +6084,7 @@ ha_ndbcluster::delete_table(ha_ndbcluster *h, Ndb *ndb,
if (!ndb_schema_share)
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
+ DBUG_ASSERT(ndb_schema_share);
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
/* ndb_share reference temporary */
@@ -6264,6 +6266,7 @@ int ha_ndbcluster::delete_table(const char *name)
if (!ndb_schema_share)
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
+ DBUG_ASSERT(ndb_schema_share);
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
#endif
@@ -6550,8 +6553,11 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN(res);
}
#ifdef HAVE_NDB_BINLOG
- if (!ndb_binlog_tables_inited && ndb_binlog_running)
+ if (!ndb_binlog_tables_inited)
+ {
table->db_stat|= HA_READ_ONLY;
+ sql_print_information("table '%s' opened read only", name);
+ }
#endif
DBUG_RETURN(0);
}
@@ -6915,8 +6921,8 @@ static void ndbcluster_drop_database(handlerton *hton, char *path)
if (!ndb_schema_share)
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
+ DBUG_ASSERT(ndb_schema_share);
DBUG_VOID_RETURN;
- //DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
#endif
ndbcluster_drop_database_impl(path);
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 4fd5ee1b402..baf86d739eb 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -815,9 +815,10 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd)
" end_pos BIGINT UNSIGNED NOT NULL, "
" PRIMARY KEY USING HASH (server_id) ) ENGINE=NDB CHARACTER SET latin1");
- const int no_print_error[5]= {ER_TABLE_EXISTS_ERROR,
+ const int no_print_error[6]= {ER_TABLE_EXISTS_ERROR,
701,
702,
+ 721, // Table already exist
4009,
0}; // do not print error 701 etc
run_query(thd, buf, end, no_print_error, TRUE);
@@ -876,9 +877,10 @@ static int ndbcluster_create_schema_table(THD *thd)
" type INT UNSIGNED NOT NULL,"
" PRIMARY KEY USING HASH (db,name) ) ENGINE=NDB CHARACTER SET latin1");
- const int no_print_error[5]= {ER_TABLE_EXISTS_ERROR,
+ const int no_print_error[6]= {ER_TABLE_EXISTS_ERROR,
701,
702,
+ 721, // Table already exist
4009,
0}; // do not print error 701 etc
run_query(thd, buf, end, no_print_error, TRUE);
@@ -919,12 +921,9 @@ int ndbcluster_setup_binlog_table_shares(THD *thd)
{
pthread_mutex_lock(&LOCK_open);
ndb_binlog_tables_inited= TRUE;
- if (ndb_binlog_running)
- {
- if (ndb_extra_logging)
- sql_print_information("NDB Binlog: ndb tables writable");
- close_cached_tables(NULL, NULL, TRUE, FALSE, FALSE);
- }
+ if (ndb_extra_logging)
+ sql_print_information("NDB Binlog: ndb tables writable");
+ close_cached_tables(NULL, NULL, TRUE, FALSE, FALSE);
pthread_mutex_unlock(&LOCK_open);
/* Signal injector thread that all is setup */
pthread_cond_signal(&injector_cond);
@@ -2069,6 +2068,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
ndb_schema_share->use_count));
free_share(&ndb_schema_share);
ndb_schema_share= 0;
+ ndb_binlog_tables_inited= 0;
pthread_mutex_unlock(&ndb_schema_share_mutex);
/* end protect ndb_schema_share */
@@ -3269,6 +3269,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
share->key, share->use_count));
free_share(&ndb_apply_status_share);
ndb_apply_status_share= 0;
+ ndb_binlog_tables_inited= 0;
}
DBUG_PRINT("error", ("CLUSTER FAILURE EVENT: "
"%s received share: 0x%lx op: 0x%lx share op: 0x%lx "
@@ -3288,6 +3289,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
share->key, share->use_count));
free_share(&ndb_apply_status_share);
ndb_apply_status_share= 0;
+ ndb_binlog_tables_inited= 0;
}
/* ToDo: remove printout */
if (ndb_extra_logging)
@@ -4311,6 +4313,7 @@ err:
ndb_schema_share->use_count));
free_share(&ndb_schema_share);
ndb_schema_share= 0;
+ ndb_binlog_tables_inited= 0;
pthread_mutex_unlock(&ndb_schema_share_mutex);
/* end protect ndb_schema_share */
}
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 0c96b06381c..0e36a868b3e 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2818,6 +2818,36 @@ void ha_partition::unlock_row()
DBUG_VOID_RETURN;
}
+/**
+ Check if semi consistent read was used
+
+ SYNOPSIS
+ was_semi_consistent_read()
+
+ RETURN VALUE
+ TRUE Previous read was a semi consistent read
+ FALSE Previous read was not a semi consistent read
+
+ DESCRIPTION
+ See handler.h:
+ In an UPDATE or DELETE, if the row under the cursor was locked by another
+ transaction, and the engine used an optimistic read of the last
+ committed row value under the cursor, then the engine returns 1 from this
+ function. MySQL must NOT try to update this optimistic value. If the
+ optimistic value does not match the WHERE condition, MySQL can decide to
+ skip over this row. Currently only works for InnoDB. This can be used to
+ avoid unnecessary lock waits.
+
+ If this method returns nonzero, it will also signal the storage
+ engine that the next read will be a locking re-read of the row.
+*/
+bool ha_partition::was_semi_consistent_read()
+{
+ DBUG_ENTER("ha_partition::was_semi_consistent_read");
+ DBUG_ASSERT(m_last_part < m_tot_parts &&
+ bitmap_is_set(&(m_part_info->used_partitions), m_last_part));
+ DBUG_RETURN(m_file[m_last_part]->was_semi_consistent_read());
+}
/**
Use semi consistent read if possible
@@ -3431,7 +3461,7 @@ int ha_partition::rnd_next(uchar *buf)
while (TRUE)
{
- int result= file->rnd_next(buf);
+ result= file->rnd_next(buf);
if (!result)
{
m_last_part= part_id;
@@ -4785,7 +4815,7 @@ int ha_partition::info(uint flag)
/*
Calculates statistical variables
records: Estimate of number records in table
- We report sum (always at least 2)
+ We report sum (always at least 2 if not empty)
deleted: Estimate of number holes in the table due to
deletes
We report sum
@@ -4824,13 +4854,13 @@ int ha_partition::info(uint flag)
stats.check_time= file->stats.check_time;
}
} while (*(++file_array));
- if (stats.records < 2 &&
+ if (stats.records && stats.records < 2 &&
!(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT))
stats.records= 2;
if (stats.records > 0)
stats.mean_rec_length= (ulong) (stats.data_file_length / stats.records);
else
- stats.mean_rec_length= 1; //? What should we set here
+ stats.mean_rec_length= 0;
}
if (flag & HA_STATUS_CONST)
{
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index dd06d8d647b..8a81a759e2a 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -112,7 +112,7 @@ private:
uint m_reorged_parts; // Number of reorganised parts
uint m_tot_parts; // Total number of partitions;
uint m_no_locks; // For engines like ha_blackhole, which needs no locks
- uint m_last_part; // Last file that we update,write
+ uint m_last_part; // Last file that we update,write,read
int m_lock_type; // Remembers type of last
// external_lock
part_id_range m_part_spec; // Which parts to scan
@@ -326,6 +326,10 @@ public:
*/
virtual void unlock_row();
/*
+ Check if semi consistent read
+ */
+ virtual bool was_semi_consistent_read();
+ /*
Call to hint about semi consistent read
*/
virtual void try_semi_consistent_read(bool);
diff --git a/sql/handler.cc b/sql/handler.cc
index 675c21d9522..2145d7c84eb 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2656,8 +2656,12 @@ void handler::print_error(int error, myf errflag)
break;
case HA_ERR_RECORD_FILE_FULL:
case HA_ERR_INDEX_FILE_FULL:
+ {
textno=ER_RECORD_FILE_FULL;
+ /* Write the error message to error log */
+ errflag|= ME_NOREFRESH;
break;
+ }
case HA_ERR_LOCK_WAIT_TIMEOUT:
textno=ER_LOCK_WAIT_TIMEOUT;
break;
diff --git a/sql/handler.h b/sql/handler.h
index a218de6a1e5..d43fc4725dd 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/item.cc b/sql/item.cc
index 7b7c44b4719..8356dee0560 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -327,7 +327,7 @@ int Item::save_time_in_field(Field *field)
{
MYSQL_TIME ltime;
if (get_time(&ltime))
- return set_field_to_null(field);
+ return set_field_to_null_with_conversions(field, 0);
field->set_notnull();
return field->store_time(&ltime, MYSQL_TIMESTAMP_TIME);
}
@@ -337,7 +337,7 @@ int Item::save_date_in_field(Field *field)
{
MYSQL_TIME ltime;
if (get_date(&ltime, TIME_FUZZY_DATE))
- return set_field_to_null(field);
+ return set_field_to_null_with_conversions(field, 0);
field->set_notnull();
return field->store_time(&ltime, MYSQL_TIMESTAMP_DATETIME);
}
@@ -1274,13 +1274,26 @@ Item::Type Item_name_const::type() const
valid_args guarantees value_item->basic_const_item(); if type is
FUNC_ITEM, then we have a fudged item_func_neg() on our hands
and return the underlying type.
+ For Item_func_set_collation()
+ e.g. NAME_CONST('name', 'value' COLLATE collation) we return its
+ 'value' argument type.
*/
- return valid_args ?
- (((value_item->type() == FUNC_ITEM) &&
- (((Item_func *) value_item)->functype() == Item_func::NEG_FUNC)) ?
- ((Item_func *) value_item)->key_item()->type() :
- value_item->type()) :
- NULL_ITEM;
+ if (!valid_args)
+ return NULL_ITEM;
+ Item::Type value_type= value_item->type();
+ if (value_type == FUNC_ITEM)
+ {
+ /*
+ The second argument of NAME_CONST('name', 'value') must be
+ a simple constant item or a NEG_FUNC/COLLATE_FUNC.
+ */
+ DBUG_ASSERT(((Item_func *) value_item)->functype() ==
+ Item_func::NEG_FUNC ||
+ ((Item_func *) value_item)->functype() ==
+ Item_func::COLLATE_FUNC);
+ return ((Item_func *) value_item)->key_item()->type();
+ }
+ return value_type;
}
@@ -2090,6 +2103,12 @@ bool Item_field::val_bool_result()
}
+bool Item_field::is_null_result()
+{
+ return (null_value=result_field->is_null());
+}
+
+
bool Item_field::eq(const Item *item, bool binary_cmp) const
{
Item *real_item= ((Item *) item)->real_item();
@@ -2628,7 +2647,7 @@ void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type,
if (value.time.year > 9999 || value.time.month > 12 ||
value.time.day > 31 ||
- time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23 ||
+ (time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23) ||
value.time.minute > 59 || value.time.second > 59)
{
char buff[MAX_DATE_STRING_REP_LENGTH];
@@ -4840,8 +4859,8 @@ int Item::save_in_field(Field *field, bool no_conversions)
{
int error;
if (result_type() == STRING_RESULT ||
- result_type() == REAL_RESULT &&
- field->result_type() == STRING_RESULT)
+ (result_type() == REAL_RESULT &&
+ field->result_type() == STRING_RESULT))
{
String *result;
CHARSET_INFO *cs= collation.collation;
@@ -5114,6 +5133,9 @@ int Item_hex_string::save_in_field(Field *field, bool no_conversions)
ulonglong nr;
uint32 length= str_value.length();
+ if (!length)
+ return 1;
+
if (length > 8)
{
nr= field->flags & UNSIGNED_FLAG ? ULONGLONG_MAX : LONGLONG_MAX;
@@ -5797,6 +5819,15 @@ double Item_ref::val_result()
}
+bool Item_ref::is_null_result()
+{
+ if (result_field)
+ return (null_value=result_field->is_null());
+
+ return is_null();
+}
+
+
longlong Item_ref::val_int_result()
{
if (result_field)
@@ -5902,7 +5933,9 @@ String *Item_ref::val_str(String* tmp)
bool Item_ref::is_null()
{
DBUG_ASSERT(fixed);
- return (*ref)->is_null();
+ bool tmp=(*ref)->is_null_result();
+ null_value=(*ref)->null_value;
+ return tmp;
}
diff --git a/sql/item.h b/sql/item.h
index a3c3cbc78c1..be9daf672f0 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -729,6 +729,7 @@ public:
virtual my_decimal *val_decimal_result(my_decimal *val)
{ return val_decimal(val); }
virtual bool val_bool_result() { return val_bool(); }
+ virtual bool is_null_result() { return is_null(); }
/* bit map of tables used by item */
virtual table_map used_tables() const { return (table_map) 0L; }
@@ -1436,6 +1437,7 @@ public:
String *str_result(String* tmp);
my_decimal *val_decimal_result(my_decimal *);
bool val_bool_result();
+ bool is_null_result();
bool send(Protocol *protocol, String *str_arg);
void reset_field(Field *f);
bool fix_fields(THD *, Item **);
@@ -2178,6 +2180,7 @@ public:
String *str_result(String* tmp);
my_decimal *val_decimal_result(my_decimal *);
bool val_bool_result();
+ bool is_null_result();
bool send(Protocol *prot, String *tmp);
void make_field(Send_field *field);
bool fix_fields(THD *, Item **);
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index c5de0b3df08..bd90dd81365 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -394,19 +394,16 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
TABLE *table= field->table;
ulong orig_sql_mode= thd->variables.sql_mode;
enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields;
- my_bitmap_map *old_write_map;
- my_bitmap_map *old_read_map;
+ my_bitmap_map *old_maps[2];
ulonglong orig_field_val; /* original field value if valid */
- LINT_INIT(old_write_map);
- LINT_INIT(old_read_map);
+ LINT_INIT(old_maps[0]);
+ LINT_INIT(old_maps[1]);
LINT_INIT(orig_field_val);
if (table)
- {
- old_write_map= dbug_tmp_use_all_columns(table, table->write_set);
- old_read_map= dbug_tmp_use_all_columns(table, table->read_set);
- }
+ dbug_tmp_use_all_columns(table, old_maps,
+ table->read_set, table->write_set);
/* For comparison purposes allow invalid dates like 2000-01-32 */
thd->variables.sql_mode= (orig_sql_mode & ~MODE_NO_ZERO_DATE) |
MODE_INVALID_DATES;
@@ -441,10 +438,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
thd->variables.sql_mode= orig_sql_mode;
thd->count_cuted_fields= orig_count_cuted_fields;
if (table)
- {
- dbug_tmp_restore_column_map(table->write_set, old_write_map);
- dbug_tmp_restore_column_map(table->read_set, old_read_map);
- }
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_maps);
}
return result;
}
@@ -1629,8 +1623,8 @@ void Item_in_optimizer::cleanup()
bool Item_in_optimizer::is_null()
{
- cache->store(args[0]);
- return (null_value= (cache->null_value || args[1]->is_null()));
+ val_int();
+ return null_value;
}
@@ -2719,6 +2713,16 @@ void Item_func_case::fix_length_and_dec()
nagg++;
if (!(found_types= collect_cmp_types(agg, nagg)))
return;
+ if (with_sum_func || current_thd->lex->current_select->group_list.elements)
+ {
+ /*
+ See TODO commentary in the setup_copy_fields function:
+ item in a group may be wrapped with an Item_copy_string item.
+ That item has a STRING_RESULT result type, so we need
+ to take this type into account.
+ */
+ found_types |= (1 << item_cmp_type(left_result_type, STRING_RESULT));
+ }
for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
{
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 33b5f21774f..34cb50ee7fa 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3808,6 +3808,13 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
}
+void Item_func_set_user_var::cleanup()
+{
+ Item_func::cleanup();
+ entry= NULL;
+}
+
+
bool Item_func_set_user_var::set_entry(THD *thd, bool create_if_not_exists)
{
if (entry && thd->thread_id == entry_thread_id)
@@ -4307,6 +4314,15 @@ my_decimal *Item_func_set_user_var::val_decimal_result(my_decimal *val)
}
+bool Item_func_set_user_var::is_null_result()
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return is_null();
+}
+
+
void Item_func_set_user_var::print(String *str, enum_query_type query_type)
{
str->append(STRING_WITH_LEN("(@"));
diff --git a/sql/item_func.h b/sql/item_func.h
index 3acda817d26..d23d821baf6 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -362,7 +362,10 @@ public:
Item_func_unsigned(Item *a) :Item_func_signed(a) {}
const char *func_name() const { return "cast_as_unsigned"; }
void fix_length_and_dec()
- { max_length=args[0]->max_length; unsigned_flag=1; }
+ {
+ max_length= min(args[0]->max_length, DECIMAL_MAX_PRECISION + 2);
+ unsigned_flag=1;
+ }
longlong val_int();
virtual void print(String *str, enum_query_type query_type);
};
@@ -1332,6 +1335,7 @@ public:
longlong val_int_result();
String *str_result(String *str);
my_decimal *val_decimal_result(my_decimal *);
+ bool is_null_result();
bool update_hash(void *ptr, uint length, enum Item_result type,
CHARSET_INFO *cs, Derivation dv, bool unsigned_arg);
bool send(Protocol *protocol, String *str_arg);
@@ -1353,6 +1357,7 @@ public:
void save_org_in_field(Field *field) { (void)save_in_field(field, 1, 0); }
bool register_field_in_read_map(uchar *arg);
bool set_entry(THD *thd, bool create_if_not_exists);
+ void cleanup();
};
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 4e01728f71c..fc9375e68a5 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1782,6 +1782,12 @@ Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs)
Item_string *conv;
uint conv_errors;
String tmp, cstr, *ostr= val_str(&tmp);
+ if (null_value)
+ {
+ Item *null_item= new Item_null((char *) fully_qualified_func_name());
+ null_item->collation.set (tocs);
+ return null_item;
+ }
cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors);
if (conv_errors ||
!(conv= new Item_static_string_func(fully_qualified_func_name(),
@@ -2033,10 +2039,11 @@ Item_func_format::Item_func_format(Item *org, Item *dec)
void Item_func_format::fix_length_and_dec()
{
- collation.set(default_charset());
uint char_length= args[0]->max_length/args[0]->collation.collation->mbmaxlen;
- max_length= ((char_length + (char_length-args[0]->decimals)/3) *
- collation.collation->mbmaxlen);
+ uint max_sep_count= char_length/3 + (decimals ? 1 : 0) + /*sign*/1;
+ collation.set(default_charset());
+ max_length= (char_length + max_sep_count + decimals) *
+ collation.collation->mbmaxlen;
}
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index c2b3b954634..1821136cc9d 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -654,8 +654,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
return TRUE;
// 'item' can be changed during fix_fields
- if (!item->fixed &&
- item->fix_fields(thd, args) ||
+ if ((!item->fixed && item->fix_fields(thd, args)) ||
(item= args[0])->check_cols(1))
return TRUE;
decimals=item->decimals;
@@ -981,8 +980,8 @@ void Item_sum_distinct::fix_length_and_dec()
integers each <= 2^32.
*/
if (table_field_type == MYSQL_TYPE_INT24 ||
- table_field_type >= MYSQL_TYPE_TINY &&
- table_field_type <= MYSQL_TYPE_LONG)
+ (table_field_type >= MYSQL_TYPE_TINY &&
+ table_field_type <= MYSQL_TYPE_LONG))
{
val.traits= Hybrid_type_traits_fast_decimal::instance();
break;
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 843a48ae118..ab20ed17cd7 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1033,12 +1033,25 @@ longlong Item_func_month::val_int()
}
+void Item_func_monthname::fix_length_and_dec()
+{
+ THD* thd= current_thd;
+ CHARSET_INFO *cs= thd->variables.collation_connection;
+ uint32 repertoire= my_charset_repertoire(cs);
+ locale= thd->variables.lc_time_names;
+ collation.set(cs, DERIVATION_COERCIBLE, repertoire);
+ decimals=0;
+ max_length= locale->max_month_name_length * collation.collation->mbmaxlen;
+ maybe_null=1;
+}
+
+
String* Item_func_monthname::val_str(String* str)
{
DBUG_ASSERT(fixed == 1);
const char *month_name;
- uint month= (uint) val_int();
- THD *thd= current_thd;
+ uint month= (uint) val_int();
+ uint err;
if (null_value || !month)
{
@@ -1046,8 +1059,9 @@ String* Item_func_monthname::val_str(String* str)
return (String*) 0;
}
null_value=0;
- month_name= thd->variables.lc_time_names->month_names->type_names[month-1];
- str->set(month_name, strlen(month_name), system_charset_info);
+ month_name= locale->month_names->type_names[month-1];
+ str->copy(month_name, strlen(month_name), &my_charset_utf8_bin,
+ collation.collation, &err);
return str;
}
@@ -1172,19 +1186,32 @@ longlong Item_func_weekday::val_int()
odbc_type) + test(odbc_type);
}
+void Item_func_dayname::fix_length_and_dec()
+{
+ THD* thd= current_thd;
+ CHARSET_INFO *cs= thd->variables.collation_connection;
+ uint32 repertoire= my_charset_repertoire(cs);
+ locale= thd->variables.lc_time_names;
+ collation.set(cs, DERIVATION_COERCIBLE, repertoire);
+ decimals=0;
+ max_length= locale->max_day_name_length * collation.collation->mbmaxlen;
+ maybe_null=1;
+}
+
String* Item_func_dayname::val_str(String* str)
{
DBUG_ASSERT(fixed == 1);
uint weekday=(uint) val_int(); // Always Item_func_daynr()
const char *day_name;
- THD *thd= current_thd;
+ uint err;
if (null_value)
return (String*) 0;
- day_name= thd->variables.lc_time_names->day_names->type_names[weekday];
- str->set(day_name, strlen(day_name), system_charset_info);
+ day_name= locale->day_names->type_names[weekday];
+ str->copy(day_name, strlen(day_name), &my_charset_utf8_bin,
+ collation.collation, &err);
return str;
}
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 99240b1c759..9e3c2e8c89f 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -116,18 +116,13 @@ public:
class Item_func_monthname :public Item_func_month
{
+ MY_LOCALE *locale;
public:
Item_func_monthname(Item *a) :Item_func_month(a) {}
const char *func_name() const { return "monthname"; }
String *val_str(String *str);
enum Item_result result_type () const { return STRING_RESULT; }
- void fix_length_and_dec()
- {
- collation.set(&my_charset_bin);
- decimals=0;
- max_length=10*my_charset_bin.mbmaxlen;
- maybe_null=1;
- }
+ void fix_length_and_dec();
bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -291,18 +286,13 @@ public:
class Item_func_dayname :public Item_func_weekday
{
+ MY_LOCALE *locale;
public:
Item_func_dayname(Item *a) :Item_func_weekday(a,0) {}
const char *func_name() const { return "dayname"; }
String *val_str(String *str);
enum Item_result result_type () const { return STRING_RESULT; }
- void fix_length_and_dec()
- {
- collation.set(&my_charset_bin);
- decimals=0;
- max_length=9*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
- }
+ void fix_length_and_dec();
bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -429,6 +419,7 @@ public:
{
return save_time_in_field(field);
}
+ longlong val_int() { return val_int_from_decimal(); }
bool result_as_longlong() { return TRUE; }
};
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 68d85418324..5601a2b18c6 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -1969,6 +1969,13 @@ my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(MY_XPATH *xpath)
if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH))
return 1;
+ if (xpath->item->type() != Item::XPATH_NODESET)
+ {
+ xpath->lasttok= xpath->prevtok;
+ xpath->error= 1;
+ return 0;
+ }
+
my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH);
return my_xpath_parse_RelativeLocationPath(xpath);
}
@@ -1976,7 +1983,6 @@ static int my_xpath_parse_PathExpr(MY_XPATH *xpath)
{
return my_xpath_parse_LocationPath(xpath) ||
my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(xpath);
-
}
diff --git a/sql/lock.cc b/sql/lock.cc
index faddb8c586c..f36e8d605d3 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/log.cc b/sql/log.cc
index fb8669a5731..74dc75702ae 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -207,6 +207,7 @@ public:
truncate(0);
before_stmt_pos= MY_OFF_T_UNDEF;
trans_log.end_of_file= max_binlog_cache_size;
+ DBUG_ASSERT(empty());
}
Rows_log_event *pending() const
@@ -1377,8 +1378,6 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT),
FLAGSTR(thd->options, OPTION_BEGIN)));
- thd->binlog_flush_pending_rows_event(TRUE);
-
/*
NULL denotes ROLLBACK with nothing to replicate: i.e., rollback of
only transactional tables. If the transaction contain changes to
@@ -1387,6 +1386,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
*/
if (end_ev != NULL)
{
+ thd->binlog_flush_pending_rows_event(TRUE);
/*
Doing a commit or a rollback including non-transactional tables,
i.e., ending a transaction where we might write the transaction
@@ -1435,6 +1435,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
mysql_bin_log.update_table_map_version();
}
+ DBUG_ASSERT(thd->binlog_get_pending_rows_event() == NULL);
DBUG_RETURN(error);
}
@@ -1449,8 +1450,6 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all)
return 0;
}
-#define YESNO(X) ((X) ? "yes" : "no")
-
/**
This function is called once after each statement.
@@ -1466,6 +1465,7 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all)
*/
static int binlog_commit(handlerton *hton, THD *thd, bool all)
{
+ int error= 0;
DBUG_ENTER("binlog_commit");
binlog_trx_data *const trx_data=
(binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
@@ -1478,60 +1478,11 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
}
/*
- Decision table for committing a transaction. The top part, the
- *conditions* represent different cases that can occur, and hte
- bottom part, the *actions*, represent what should be done in that
- particular case.
-
- Real transaction 'all' was true
-
- Statement in cache There were at least one statement in the
- transaction cache
-
- In transaction We are inside a transaction
-
- Stmt modified non-trans The statement being committed modified a
- non-transactional table
-
- All modified non-trans Some statement before this one in the
- transaction modified a non-transactional
- table
-
-
- ============================= = = = = = = = = = = = = = = = =
- Real transaction N N N N N N N N N N N N N N N N
- Statement in cache N N N N N N N N Y Y Y Y Y Y Y Y
- In transaction N N N N Y Y Y Y N N N N Y Y Y Y
- Stmt modified non-trans N N Y Y N N Y Y N N Y Y N N Y Y
- All modified non-trans N Y N Y N Y N Y N Y N Y N Y N Y
+ We commit the transaction if:
- Action: (C)ommit/(A)ccumulate C C - C A C - C - - - - A A - A
- ============================= = = = = = = = = = = = = = = = =
+ - We are not in a transaction and committing a statement, or
-
- ============================= = = = = = = = = = = = = = = = =
- Real transaction Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
- Statement in cache N N N N N N N N Y Y Y Y Y Y Y Y
- In transaction N N N N Y Y Y Y N N N N Y Y Y Y
- Stmt modified non-trans N N Y Y N N Y Y N N Y Y N N Y Y
- All modified non-trans N Y N Y N Y N Y N Y N Y N Y N Y
-
- (C)ommit/(A)ccumulate/(-) - - - - C C - C - - - - C C - C
- ============================= = = = = = = = = = = = = = = = =
-
- In other words, we commit the transaction if and only if both of
- the following are true:
- - We are not in a transaction and committing a statement
-
- - We are in a transaction and one (or more) of the following are
- true:
-
- - A full transaction is committed
-
- OR
-
- - A non-transactional statement is committed and there is
- no statement cached
+ - We are in a transaction and a full transaction is committed
Otherwise, we accumulate the statement
*/
@@ -1544,18 +1495,18 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
YESNO(in_transaction),
YESNO(thd->transaction.all.modified_non_trans_table),
YESNO(thd->transaction.stmt.modified_non_trans_table)));
- if (in_transaction &&
- (all ||
- (!trx_data->at_least_one_stmt &&
- thd->transaction.stmt.modified_non_trans_table)) ||
- !in_transaction && !all)
+ if (!in_transaction || all)
{
Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE);
qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
- int error= binlog_end_trans(thd, trx_data, &qev, all);
- DBUG_RETURN(error);
+ error= binlog_end_trans(thd, trx_data, &qev, all);
+ goto end;
}
- DBUG_RETURN(0);
+
+end:
+ if (!all)
+ trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt commit
+ DBUG_RETURN(error);
}
/**
@@ -1615,6 +1566,8 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
*/
error= binlog_end_trans(thd, trx_data, 0, all);
}
+ if (!all)
+ trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt rollback
DBUG_RETURN(error);
}
@@ -2349,6 +2302,7 @@ const char *MYSQL_LOG::generate_name(const char *log_name,
MYSQL_BIN_LOG::MYSQL_BIN_LOG()
:bytes_written(0), prepared_xids(0), file_id(1), open_count(1),
need_start_event(TRUE), m_table_map_version(0),
+ is_relay_log(0),
description_event_for_exec(0), description_event_for_queue(0)
{
/*
@@ -2359,6 +2313,7 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG()
*/
index_file_name[0] = 0;
bzero((char*) &index_file, sizeof(index_file));
+ bzero((char*) &purge_temp, sizeof(purge_temp));
}
/* this is called only once */
@@ -2546,7 +2501,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
*/
description_event_for_queue->created= 0;
/* Don't set log_pos in event header */
- description_event_for_queue->artificial_event=1;
+ description_event_for_queue->set_artificial_event();
if (description_event_for_queue->write(&log_file))
goto err;
@@ -2953,6 +2908,7 @@ err:
int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
{
int error;
+ char *to_purge_if_included= NULL;
DBUG_ENTER("purge_first_log");
DBUG_ASSERT(is_open());
@@ -2960,36 +2916,20 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
DBUG_ASSERT(!strcmp(rli->linfo.log_file_name,rli->event_relay_log_name));
pthread_mutex_lock(&LOCK_index);
- pthread_mutex_lock(&rli->log_space_lock);
- rli->relay_log.purge_logs(rli->group_relay_log_name, included,
- 0, 0, &rli->log_space_total);
- // Tell the I/O thread to take the relay_log_space_limit into account
- rli->ignore_log_space_limit= 0;
- pthread_mutex_unlock(&rli->log_space_lock);
+ to_purge_if_included= my_strdup(rli->group_relay_log_name, MYF(0));
/*
- Ok to broadcast after the critical region as there is no risk of
- the mutex being destroyed by this thread later - this helps save
- context switches
- */
- pthread_cond_broadcast(&rli->log_space_cond);
-
- /*
Read the next log file name from the index file and pass it back to
- the caller
- If included is true, we want the first relay log;
- otherwise we want the one after event_relay_log_name.
+ the caller.
*/
- if ((included && (error=find_log_pos(&rli->linfo, NullS, 0))) ||
- (!included &&
- ((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0)) ||
- (error=find_next_log(&rli->linfo, 0)))))
+ if((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0)) ||
+ (error=find_next_log(&rli->linfo, 0)))
{
char buff[22];
sql_print_error("next log error: %d offset: %s log: %s included: %d",
error,
llstr(rli->linfo.index_file_offset,buff),
- rli->group_relay_log_name,
+ rli->event_relay_log_name,
included);
goto err;
}
@@ -3017,7 +2957,42 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
/* Store where we are in the new file for the execution thread */
flush_relay_log_info(rli);
+ DBUG_EXECUTE_IF("crash_before_purge_logs", abort(););
+
+ pthread_mutex_lock(&rli->log_space_lock);
+ rli->relay_log.purge_logs(to_purge_if_included, included,
+ 0, 0, &rli->log_space_total);
+ // Tell the I/O thread to take the relay_log_space_limit into account
+ rli->ignore_log_space_limit= 0;
+ pthread_mutex_unlock(&rli->log_space_lock);
+
+ /*
+ Ok to broadcast after the critical region as there is no risk of
+ the mutex being destroyed by this thread later - this helps save
+ context switches
+ */
+ pthread_cond_broadcast(&rli->log_space_cond);
+
+ /*
+ * Need to update the log pos because purge logs has been called
+ * after fetching initially the log pos at the begining of the method.
+ */
+ if((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0)))
+ {
+ char buff[22];
+ sql_print_error("next log error: %d offset: %s log: %s included: %d",
+ error,
+ llstr(rli->linfo.index_file_offset,buff),
+ rli->group_relay_log_name,
+ included);
+ goto err;
+ }
+
+ /* If included was passed, rli->linfo should be the first entry. */
+ DBUG_ASSERT(!included || rli->linfo.index_file_start_offset == 0);
+
err:
+ my_free(to_purge_if_included, MYF(0));
pthread_mutex_unlock(&LOCK_index);
DBUG_RETURN(error);
}
@@ -3068,7 +3043,6 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
ulonglong *decrease_log_space)
{
int error;
- int ret = 0;
bool exit_loop= 0;
LOG_INFO log_info;
THD *thd= current_thd;
@@ -3077,8 +3051,36 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
if (need_mutex)
pthread_mutex_lock(&LOCK_index);
- if ((error=find_log_pos(&log_info, to_log, 0 /*no mutex*/)))
+ if ((error=find_log_pos(&log_info, to_log, 0 /*no mutex*/)))
+ {
+ sql_print_error("MYSQL_LOG::purge_logs was called with file %s not "
+ "listed in the index.", to_log);
goto err;
+ }
+
+ /*
+ For crash recovery reasons the index needs to be updated before
+ any files are deleted. Move files to be deleted into a temp file
+ to be processed after the index is updated.
+ */
+ if (!my_b_inited(&purge_temp))
+ {
+ if ((error=open_cached_file(&purge_temp, mysql_tmpdir, TEMP_PREFIX,
+ DISK_BUFFER_SIZE, MYF(MY_WME))))
+ {
+ sql_print_error("MYSQL_LOG::purge_logs failed to open purge_temp");
+ goto err;
+ }
+ }
+ else
+ {
+ if ((error=reinit_io_cache(&purge_temp, WRITE_CACHE, 0, 0, 1)))
+ {
+ sql_print_error("MYSQL_LOG::purge_logs failed to reinit purge_temp "
+ "for write");
+ goto err;
+ }
+ }
/*
File name exists in index file; delete until we find this file
@@ -3089,6 +3091,61 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
while ((strcmp(to_log,log_info.log_file_name) || (exit_loop=included)) &&
!log_in_use(log_info.log_file_name))
{
+ if ((error=my_b_write(&purge_temp, (const uchar*)log_info.log_file_name,
+ strlen(log_info.log_file_name))) ||
+ (error=my_b_write(&purge_temp, (const uchar*)"\n", 1)))
+ {
+ sql_print_error("MYSQL_LOG::purge_logs failed to copy %s to purge_temp",
+ log_info.log_file_name);
+ goto err;
+ }
+
+ if (find_next_log(&log_info, 0) || exit_loop)
+ break;
+ }
+
+ /* We know how many files to delete. Update index file. */
+ if ((error=update_log_index(&log_info, need_update_threads)))
+ {
+ sql_print_error("MSYQL_LOG::purge_logs failed to update the index file");
+ goto err;
+ }
+
+ DBUG_EXECUTE_IF("crash_after_update_index", abort(););
+
+ /* Switch purge_temp for read. */
+ if ((error=reinit_io_cache(&purge_temp, READ_CACHE, 0, 0, 0)))
+ {
+ sql_print_error("MSYQL_LOG::purge_logs failed to reinit purge_temp "
+ "for read");
+ goto err;
+ }
+
+ /* Read each entry from purge_temp and delete the file. */
+ for (;;)
+ {
+ uint length;
+
+ if ((length=my_b_gets(&purge_temp, log_info.log_file_name,
+ FN_REFLEN)) <= 1)
+ {
+ if (purge_temp.error)
+ {
+ error= purge_temp.error;
+ sql_print_error("MSYQL_LOG::purge_logs error %d reading from "
+ "purge_temp", error);
+ goto err;
+ }
+
+ /* Reached EOF */
+ break;
+ }
+
+ /* Get rid of the trailing '\n' */
+ log_info.log_file_name[length-1]= 0;
+
+ ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
+
MY_STAT s;
if (!my_stat(log_info.log_file_name, &s, MYF(0)))
{
@@ -3189,23 +3246,10 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
}
}
}
-
- ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
-
- if (find_next_log(&log_info, 0) || exit_loop)
- break;
- }
-
- /*
- If we get killed -9 here, the sysadmin would have to edit
- the log index file after restart - otherwise, this should be safe
- */
- error= update_log_index(&log_info, need_update_threads);
- if (error == 0) {
- error = ret;
}
err:
+ close_cached_file(&purge_temp);
if (need_mutex)
pthread_mutex_unlock(&LOCK_index);
DBUG_RETURN(error);
@@ -3216,7 +3260,7 @@ err:
index file.
@param thd Thread pointer
- @param before_date Delete all log files before given date.
+ @param purge_time Delete all log files before given date.
@note
If any of the logs before the deleted one is in use,
@@ -3233,6 +3277,7 @@ err:
int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
{
int error;
+ char to_log[FN_REFLEN];
LOG_INFO log_info;
MY_STAT stat_area;
THD *thd= current_thd;
@@ -3240,12 +3285,8 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
DBUG_ENTER("purge_logs_before_date");
pthread_mutex_lock(&LOCK_index);
+ to_log[0]= 0;
- /*
- Delete until we find curren file
- or a file that is used or a file
- that is older than purge_time.
- */
if ((error=find_log_pos(&log_info, NullS, 0 /*no mutex*/)))
goto err;
@@ -3295,55 +3336,18 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
}
else
{
- if (stat_area.st_mtime >= purge_time)
+ if (stat_area.st_mtime < purge_time)
+ strmake(to_log,
+ log_info.log_file_name,
+ sizeof(log_info.log_file_name));
+ else
break;
- if (my_delete(log_info.log_file_name, MYF(0)))
- {
- if (my_errno == ENOENT)
- {
- /* It's not fatal even if we can't delete a log file */
- if (thd)
- {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
- log_info.log_file_name);
- }
- sql_print_information("Failed to delete file '%s'",
- log_info.log_file_name);
- my_errno= 0;
- }
- else
- {
- if (thd)
- {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_BINLOG_PURGE_FATAL_ERR,
- "a problem with deleting %s; "
- "consider examining correspondence "
- "of your binlog index file "
- "to the actual binlog files",
- log_info.log_file_name);
- }
- else
- {
- sql_print_information("Failed to delete log file '%s'",
- log_info.log_file_name);
- }
- error= LOG_INFO_FATAL;
- goto err;
- }
- }
- ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
}
if (find_next_log(&log_info, 0))
break;
}
- /*
- If we get killed -9 here, the sysadmin would have to edit
- the log index file after restart - otherwise, this should be safe
- */
- error= update_log_index(&log_info, 1);
+ error= (to_log[0] ? purge_logs(to_log, 1, 0, 1, (ulonglong *) 0) : 0);
err:
pthread_mutex_unlock(&LOCK_index);
@@ -3469,7 +3473,7 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock)
to change base names at some point.
*/
Rotate_log_event r(new_name+dirname_length(new_name),
- 0, LOG_EVENT_OFFSET, 0);
+ 0, LOG_EVENT_OFFSET, is_relay_log ? Rotate_log_event::RELAY_LOG : 0);
r.write(&log_file);
bytes_written += r.data_written;
}
diff --git a/sql/log.h b/sql/log.h
index 891134a9762..d54df8add3b 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -233,6 +233,13 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
pthread_cond_t update_cond;
ulonglong bytes_written;
IO_CACHE index_file;
+ /*
+ purge_temp is a temp file used in purge_logs so that the index file
+ can be updated before deleting files from disk, yielding better crash
+ recovery. It is created on demand the first time purge_logs is called
+ and then reused for subsequent calls. It is cleaned up in cleanup().
+ */
+ IO_CACHE purge_temp;
char index_file_name[FN_REFLEN];
/*
The max size before rotation (usable only if log_type == LOG_BIN: binary
@@ -274,6 +281,10 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
public:
MYSQL_LOG::generate_name;
MYSQL_LOG::is_open;
+
+ /* This is relay log */
+ bool is_relay_log;
+
/*
These describe the log's format. This is used only for relay logs.
_for_exec is used by the SQL thread, _for_queue by the I/O thread. It's
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 0d03593946d..0e400ac2705 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -53,6 +53,8 @@
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD* thd);
+
static const char *HA_ERR(int i)
{
switch (i) {
@@ -810,9 +812,8 @@ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
if (is_artificial_event())
{
/*
- We should not do any cleanup on slave when reading this. We
- mark this by setting log_pos to 0. Start_log_event_v3() will
- detect this on reading and set artificial_event=1 for the event.
+ Artificial events are automatically generated and do not exist
+ in master's binary log, so log_pos should be set to 0.
*/
log_pos= 0;
}
@@ -2680,7 +2681,7 @@ void Query_log_event::print_query_header(IO_CACHE* file,
if (!(flags & LOG_EVENT_SUPPRESS_USE_F) && db)
{
- if (different_db= memcmp(print_event_info->db, db, db_len + 1))
+ if ((different_db= memcmp(print_event_info->db, db, db_len + 1)))
memcpy(print_event_info->db, db, db_len + 1);
if (db[0] && different_db)
my_b_printf(file, "use %s%s\n", db, print_event_info->delimiter);
@@ -2724,11 +2725,13 @@ void Query_log_event::print_query_header(IO_CACHE* file,
bool need_comma= 0;
my_b_printf(file, "SET ");
print_set_option(file, tmp, OPTION_NO_FOREIGN_KEY_CHECKS, ~flags2,
- "@@session.foreign_key_checks", &need_comma);
+ "@@session.foreign_key_checks", &need_comma);
print_set_option(file, tmp, OPTION_AUTO_IS_NULL, flags2,
- "@@session.sql_auto_is_null", &need_comma);
+ "@@session.sql_auto_is_null", &need_comma);
print_set_option(file, tmp, OPTION_RELAXED_UNIQUE_CHECKS, ~flags2,
- "@@session.unique_checks", &need_comma);
+ "@@session.unique_checks", &need_comma);
+ print_set_option(file, tmp, OPTION_NOT_AUTOCOMMIT, ~flags2,
+ "@@session.autocommit", &need_comma);
my_b_printf(file,"%s\n", print_event_info->delimiter);
print_event_info->flags2= flags2;
}
@@ -2893,7 +2896,37 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos));
clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
- const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
+ if (strcmp("COMMIT", query) == 0 && rli->tables_to_lock)
+ {
+ /*
+ Cleaning-up the last statement context:
+ the terminal event of the current statement flagged with
+ STMT_END_F got filtered out in ndb circular replication.
+ */
+ int error;
+ char llbuff[22];
+ if ((error= rows_event_stmt_cleanup(const_cast<Relay_log_info*>(rli), thd)))
+ {
+ const_cast<Relay_log_info*>(rli)->report(ERROR_LEVEL, error,
+ "Error in cleaning up after an event preceeding the commit; "
+ "the group log file/position: %s %s",
+ const_cast<Relay_log_info*>(rli)->group_master_log_name,
+ llstr(const_cast<Relay_log_info*>(rli)->group_master_log_pos,
+ llbuff));
+ }
+ /*
+ Executing a part of rli->stmt_done() logics that does not deal
+ with group position change. The part is redundant now but is
+ future-change-proof addon, e.g if COMMIT handling will start checking
+ invariants like IN_STMT flag must be off at committing the transaction.
+ */
+ const_cast<Relay_log_info*>(rli)->inc_event_relay_log_pos();
+ const_cast<Relay_log_info*>(rli)->clear_flag(Relay_log_info::IN_STMT);
+ }
+ else
+ {
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
+ }
/*
Note: We do not need to execute reset_one_shot_variables() if this
@@ -3196,7 +3229,7 @@ Query_log_event::do_shall_skip(Relay_log_info *rli)
#ifndef MYSQL_CLIENT
Start_log_event_v3::Start_log_event_v3()
:Log_event(), created(0), binlog_version(BINLOG_VERSION),
- artificial_event(0), dont_set_created(0)
+ dont_set_created(0)
{
memcpy(server_version, ::server_version, ST_SERVER_VER_LEN);
}
@@ -3244,7 +3277,7 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
my_b_printf(&cache, "# Warning: this binlog was not closed properly. "
"Most probably mysqld crashed writing it.\n");
}
- if (!artificial_event && created)
+ if (!is_artificial_event() && created)
{
#ifdef WHEN_WE_HAVE_THE_RESET_CONNECTION_SQL_COMMAND
/*
@@ -3287,8 +3320,6 @@ Start_log_event_v3::Start_log_event_v3(const char* buf,
// prevent overrun if log is corrupted on disk
server_version[ST_SERVER_VER_LEN-1]= 0;
created= uint4korr(buf+ST_CREATED_OFFSET);
- /* We use log_pos to mark if this was an artificial event or not */
- artificial_event= (log_pos == 0);
dont_set_created= 1;
}
@@ -3425,7 +3456,8 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
number_of_event_types= LOG_EVENT_TYPES;
/* we'll catch my_malloc() error in is_valid() */
post_header_len=(uint8*) my_malloc(number_of_event_types*sizeof(uint8),
- MYF(MY_ZEROFILL));
+ MYF(0));
+
/*
This long list of assignments is not beautiful, but I see no way to
make it nicer, as the right members are #defines, not array members, so
@@ -3433,16 +3465,40 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
*/
if (post_header_len)
{
+ // Allows us to sanity-check that all events initialized their
+ // events (see the end of this 'if' block).
+ IF_DBUG(memset(post_header_len, 255,
+ number_of_event_types*sizeof(uint8)););
+
+ /* Note: all event types must explicitly fill in their lengths here. */
post_header_len[START_EVENT_V3-1]= START_V3_HEADER_LEN;
post_header_len[QUERY_EVENT-1]= QUERY_HEADER_LEN;
+ post_header_len[STOP_EVENT-1]= STOP_HEADER_LEN;
post_header_len[ROTATE_EVENT-1]= ROTATE_HEADER_LEN;
+ post_header_len[INTVAR_EVENT-1]= INTVAR_HEADER_LEN;
post_header_len[LOAD_EVENT-1]= LOAD_HEADER_LEN;
+ post_header_len[SLAVE_EVENT-1]= SLAVE_HEADER_LEN;
post_header_len[CREATE_FILE_EVENT-1]= CREATE_FILE_HEADER_LEN;
post_header_len[APPEND_BLOCK_EVENT-1]= APPEND_BLOCK_HEADER_LEN;
post_header_len[EXEC_LOAD_EVENT-1]= EXEC_LOAD_HEADER_LEN;
post_header_len[DELETE_FILE_EVENT-1]= DELETE_FILE_HEADER_LEN;
- post_header_len[NEW_LOAD_EVENT-1]= post_header_len[LOAD_EVENT-1];
+ post_header_len[NEW_LOAD_EVENT-1]= NEW_LOAD_HEADER_LEN;
+ post_header_len[RAND_EVENT-1]= RAND_HEADER_LEN;
+ post_header_len[USER_VAR_EVENT-1]= USER_VAR_HEADER_LEN;
post_header_len[FORMAT_DESCRIPTION_EVENT-1]= FORMAT_DESCRIPTION_HEADER_LEN;
+ post_header_len[XID_EVENT-1]= XID_HEADER_LEN;
+ post_header_len[BEGIN_LOAD_QUERY_EVENT-1]= BEGIN_LOAD_QUERY_HEADER_LEN;
+ post_header_len[EXECUTE_LOAD_QUERY_EVENT-1]= EXECUTE_LOAD_QUERY_HEADER_LEN;
+ /*
+ The PRE_GA events are never be written to any binlog, but
+ their lengths are included in Format_description_log_event.
+ Hence, we need to be assign some value here, to avoid reading
+ uninitialized memory when the array is written to disk.
+ */
+ post_header_len[PRE_GA_WRITE_ROWS_EVENT-1] = 0;
+ post_header_len[PRE_GA_UPDATE_ROWS_EVENT-1] = 0;
+ post_header_len[PRE_GA_DELETE_ROWS_EVENT-1] = 0;
+
post_header_len[TABLE_MAP_EVENT-1]= TABLE_MAP_HEADER_LEN;
post_header_len[WRITE_ROWS_EVENT-1]= ROWS_HEADER_LEN;
post_header_len[UPDATE_ROWS_EVENT-1]= ROWS_HEADER_LEN;
@@ -3462,9 +3518,14 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
post_header_len[WRITE_ROWS_EVENT-1]=
post_header_len[UPDATE_ROWS_EVENT-1]=
post_header_len[DELETE_ROWS_EVENT-1]= 6;);
- post_header_len[BEGIN_LOAD_QUERY_EVENT-1]= post_header_len[APPEND_BLOCK_EVENT-1];
- post_header_len[EXECUTE_LOAD_QUERY_EVENT-1]= EXECUTE_LOAD_QUERY_HEADER_LEN;
post_header_len[INCIDENT_EVENT-1]= INCIDENT_HEADER_LEN;
+
+ // Sanity-check that all post header lengths are initialized.
+ IF_DBUG({
+ int i;
+ for (i=0; i<number_of_event_types; i++)
+ assert(post_header_len[i] != 255);
+ });
}
break;
@@ -3700,7 +3761,7 @@ int Format_description_log_event::do_apply_event(Relay_log_info const *rli)
original place when it comes to us; we'll know this by checking
log_pos ("artificial" events have log_pos == 0).
*/
- if (!artificial_event && created && thd->transaction.all.ha_list)
+ if (!is_artificial_event() && created && thd->transaction.all.ha_list)
{
/* This is not an error (XA is safe), just an information */
rli->report(INFORMATION_LEVEL, 0,
@@ -4637,6 +4698,8 @@ Rotate_log_event::Rotate_log_event(const char* new_log_ident_arg,
#endif
if (flags & DUP_NAME)
new_log_ident= my_strndup(new_log_ident_arg, ident_len, MYF(MY_WME));
+ if (flags & RELAY_LOG)
+ set_relay_log_event();
DBUG_VOID_RETURN;
}
#endif
@@ -4708,8 +4771,6 @@ int Rotate_log_event::do_update_pos(Relay_log_info *rli)
DBUG_PRINT("info", ("new_log_ident: %s", this->new_log_ident));
DBUG_PRINT("info", ("pos: %s", llstr(this->pos, buf)));
- pthread_mutex_lock(&rli->data_lock);
- rli->event_relay_log_pos= my_b_tell(rli->cur_log);
/*
If we are in a transaction or in a group: the only normal case is
when the I/O thread was copying a big transaction, then it was
@@ -4727,23 +4788,24 @@ int Rotate_log_event::do_update_pos(Relay_log_info *rli)
relay log, which shall not change the group positions.
*/
if ((server_id != ::server_id || rli->replicate_same_server_id) &&
+ !is_relay_log_event() &&
!rli->is_in_group())
{
+ pthread_mutex_lock(&rli->data_lock);
DBUG_PRINT("info", ("old group_master_log_name: '%s' "
"old group_master_log_pos: %lu",
rli->group_master_log_name,
(ulong) rli->group_master_log_pos));
memcpy(rli->group_master_log_name, new_log_ident, ident_len+1);
rli->notify_group_master_log_name_update();
- rli->group_master_log_pos= pos;
- strmake(rli->group_relay_log_name, rli->event_relay_log_name,
- sizeof(rli->group_relay_log_name) - 1);
- rli->notify_group_relay_log_name_update();
- rli->group_relay_log_pos= rli->event_relay_log_pos;
+ rli->inc_group_relay_log_pos(pos, TRUE /* skip_lock */);
DBUG_PRINT("info", ("new group_master_log_name: '%s' "
"new group_master_log_pos: %lu",
rli->group_master_log_name,
(ulong) rli->group_master_log_pos));
+ pthread_mutex_unlock(&rli->data_lock);
+ flush_relay_log_info(rli);
+
/*
Reset thd->options and sql_mode etc, because this could be the signal of
a master's downgrade from 5.0 to 4.0.
@@ -4757,9 +4819,9 @@ int Rotate_log_event::do_update_pos(Relay_log_info *rli)
thd->variables.auto_increment_increment=
thd->variables.auto_increment_offset= 1;
}
- pthread_mutex_unlock(&rli->data_lock);
- pthread_cond_broadcast(&rli->data_cond);
- flush_relay_log_info(rli);
+ else
+ rli->inc_event_relay_log_pos();
+
DBUG_RETURN(0);
}
@@ -4813,7 +4875,9 @@ Intvar_log_event::Intvar_log_event(const char* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
- buf+= description_event->common_header_len;
+ /* The Post-Header is empty. The Varible Data part begins immediately. */
+ buf+= description_event->common_header_len +
+ description_event->post_header_len[INTVAR_EVENT-1];
type= buf[I_TYPE_OFFSET];
val= uint8korr(buf+I_VAL_OFFSET);
}
@@ -4957,7 +5021,9 @@ Rand_log_event::Rand_log_event(const char* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
- buf+= description_event->common_header_len;
+ /* The Post-Header is empty. The Variable Data part begins immediately. */
+ buf+= description_event->common_header_len +
+ description_event->post_header_len[RAND_EVENT-1];
seed1= uint8korr(buf+RAND_SEED1_OFFSET);
seed2= uint8korr(buf+RAND_SEED2_OFFSET);
}
@@ -5061,7 +5127,9 @@ Xid_log_event(const char* buf,
const Format_description_log_event *description_event)
:Log_event(buf, description_event)
{
- buf+= description_event->common_header_len;
+ /* The Post-Header is empty. The Variable Data part begins immediately. */
+ buf+= description_event->common_header_len +
+ description_event->post_header_len[XID_EVENT-1];
memcpy((char*) &xid, buf, sizeof(xid));
}
@@ -5207,7 +5275,9 @@ User_var_log_event(const char* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
- buf+= description_event->common_header_len;
+ /* The Post-Header is empty. The Variable Data part begins immediately. */
+ buf+= description_event->common_header_len +
+ description_event->post_header_len[USER_VAR_EVENT-1];
name_len= uint4korr(buf);
name= (char *) buf + UV_NAME_LEN_SIZE;
buf+= UV_NAME_LEN_SIZE + name_len;
@@ -5907,8 +5977,15 @@ void Create_file_log_event::pack_info(Protocol *protocol)
#endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */
-/*
+/**
Create_file_log_event::do_apply_event()
+ Constructor for Create_file_log_event to intantiate an event
+ from the relay log on the slave.
+
+ @retval
+ 0 Success
+ @retval
+ 1 Failure
*/
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
@@ -5977,7 +6054,7 @@ err:
if (fd >= 0)
my_close(fd, MYF(0));
thd_proc_info(thd, 0);
- return error == 0;
+ return error != 0;
}
#endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */
@@ -7358,16 +7435,20 @@ Rows_log_event::do_shall_skip(Relay_log_info *rli)
return Log_event::do_shall_skip(rli);
}
-int
-Rows_log_event::do_update_pos(Relay_log_info *rli)
-{
- DBUG_ENTER("Rows_log_event::do_update_pos");
- int error= 0;
-
- DBUG_PRINT("info", ("flags: %s",
- get_flags(STMT_END_F) ? "STMT_END_F " : ""));
+/**
+ The function is called at Rows_log_event statement commit time,
+ normally from Rows_log_event::do_update_pos() and possibly from
+ Query_log_event::do_apply_event() of the COMMIT.
+ The function commits the last statement for engines, binlog and
+ releases resources have been allocated for the statement.
+
+ @retval 0 Ok.
+ @retval non-zero Error at the commit.
+ */
- if (get_flags(STMT_END_F))
+static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD * thd)
+{
+ int error;
{
/*
This is the end of a statement or transaction, so close (and
@@ -7409,14 +7490,39 @@ Rows_log_event::do_update_pos(Relay_log_info *rli)
thd->reset_current_stmt_binlog_row_based();
- rli->cleanup_context(thd, 0);
- if (error == 0)
+ const_cast<Relay_log_info*>(rli)->cleanup_context(thd, 0);
+ }
+ return error;
+}
+
+/**
+ The method either increments the relay log position or
+ commits the current statement and increments the master group
+ possition if the event is STMT_END_F flagged and
+ the statement corresponds to the autocommit query (i.e replicated
+ without wrapping in BEGIN/COMMIT)
+
+ @retval 0 Success
+ @retval non-zero Error in the statement commit
+ */
+int
+Rows_log_event::do_update_pos(Relay_log_info *rli)
+{
+ DBUG_ENTER("Rows_log_event::do_update_pos");
+ int error= 0;
+
+ DBUG_PRINT("info", ("flags: %s",
+ get_flags(STMT_END_F) ? "STMT_END_F " : ""));
+
+ if (get_flags(STMT_END_F))
+ {
+ if ((error= rows_event_stmt_cleanup(rli, thd)) == 0)
{
/*
Indicate that a statement is finished.
Step the group log position if we are not in a transaction,
otherwise increase the event log position.
- */
+ */
rli->stmt_done(log_pos, when);
/*
@@ -7430,11 +7536,13 @@ Rows_log_event::do_update_pos(Relay_log_info *rli)
thd->clear_error();
}
else
+ {
rli->report(ERROR_LEVEL, error,
"Error in %s event: commit of row events failed, "
"table `%s`.`%s`",
get_type_str(), m_table->s->db.str,
m_table->s->table_name.str);
+ }
}
else
{
@@ -8091,6 +8199,9 @@ Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability
analyze if explicit data is provided for slave's TIMESTAMP columns).
*/
m_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
+
+ /* Honor next number column if present */
+ m_table->next_number_field= m_table->found_next_number_field;
return error;
}
@@ -8099,6 +8210,7 @@ Write_rows_log_event::do_after_row_operations(const Slave_reporting_capability *
int error)
{
int local_error= 0;
+ m_table->next_number_field=0;
if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1 ||
m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER)
{
@@ -9057,7 +9169,17 @@ Incident_log_event::Incident_log_event(const char *buf, uint event_len,
DBUG_PRINT("info",("event_len: %u; common_header_len: %d; post_header_len: %d",
event_len, common_header_len, post_header_len));
- m_incident= static_cast<Incident>(uint2korr(buf + common_header_len));
+ int incident_number= uint2korr(buf + common_header_len);
+ if (incident_number >= INCIDENT_COUNT ||
+ incident_number <= INCIDENT_NONE)
+ {
+ // If the incident is not recognized, this binlog event is
+ // invalid. If we set incident_number to INCIDENT_NONE, the
+ // invalidity will be detected by is_valid().
+ incident_number= INCIDENT_NONE;
+ DBUG_VOID_RETURN;
+ }
+ m_incident= static_cast<Incident>(incident_number);
char const *ptr= buf + common_header_len + post_header_len;
char const *const str_end= buf + event_len;
uint8 len= 0; // Assignment to keep compiler happy
@@ -9085,9 +9207,6 @@ Incident_log_event::description() const
DBUG_PRINT("info", ("m_incident: %d", m_incident));
- DBUG_ASSERT(0 <= m_incident);
- DBUG_ASSERT((size_t) m_incident <= sizeof(description)/sizeof(*description));
-
return description[m_incident];
}
diff --git a/sql/log_event.h b/sql/log_event.h
index 3c109b798d3..1d11d7e2d5f 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -227,14 +227,22 @@ struct sql_ex_info
#define QUERY_HEADER_MINIMAL_LEN (4 + 4 + 1 + 2)
// where 5.0 differs: 2 for len of N-bytes vars.
#define QUERY_HEADER_LEN (QUERY_HEADER_MINIMAL_LEN + 2)
+#define STOP_HEADER_LEN 0
#define LOAD_HEADER_LEN (4 + 4 + 4 + 1 +1 + 4)
+#define SLAVE_HEADER_LEN 0
#define START_V3_HEADER_LEN (2 + ST_SERVER_VER_LEN + 4)
#define ROTATE_HEADER_LEN 8 // this is FROZEN (the Rotate post-header is frozen)
+#define INTVAR_HEADER_LEN 0
#define CREATE_FILE_HEADER_LEN 4
#define APPEND_BLOCK_HEADER_LEN 4
#define EXEC_LOAD_HEADER_LEN 4
#define DELETE_FILE_HEADER_LEN 4
+#define NEW_LOAD_HEADER_LEN LOAD_HEADER_LEN
+#define RAND_HEADER_LEN 0
+#define USER_VAR_HEADER_LEN 0
#define FORMAT_DESCRIPTION_HEADER_LEN (START_V3_HEADER_LEN+1+LOG_EVENT_TYPES)
+#define XID_HEADER_LEN 0
+#define BEGIN_LOAD_QUERY_HEADER_LEN APPEND_BLOCK_HEADER_LEN
#define ROWS_HEADER_LEN 8
#define TABLE_MAP_HEADER_LEN 8
#define EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN (4 + 4 + 4 + 1)
@@ -319,18 +327,16 @@ struct sql_ex_info
#define Q_CHARSET_DATABASE_CODE 8
#define Q_TABLE_MAP_FOR_UPDATE_CODE 9
-/* Intvar event post-header */
+/* Intvar event data */
#define I_TYPE_OFFSET 0
#define I_VAL_OFFSET 1
-/* Rand event post-header */
-
+/* Rand event data */
#define RAND_SEED1_OFFSET 0
#define RAND_SEED2_OFFSET 8
-/* User_var event post-header */
-
+/* User_var event data */
#define UV_VAL_LEN_SIZE 4
#define UV_VAL_IS_NULL 1
#define UV_VAL_TYPE_SIZE 1
@@ -338,7 +344,6 @@ struct sql_ex_info
#define UV_CHARSET_NUMBER_SIZE 4
/* Load event post-header */
-
#define L_THREAD_ID_OFFSET 0
#define L_EXEC_TIME_OFFSET 4
#define L_SKIP_LINES_OFFSET 8
@@ -349,7 +354,6 @@ struct sql_ex_info
#define L_DATA_OFFSET LOAD_HEADER_LEN
/* Rotate event post-header */
-
#define R_POS_OFFSET 0
#define R_IDENT_OFFSET 8
@@ -458,6 +462,25 @@ struct sql_ex_info
#define LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F 0x10
/**
+ @def LOG_EVENT_ARTIFICIAL_F
+
+ Artificial events are created arbitarily and not written to binary
+ log
+
+ These events should not update the master log position when slave
+ SQL thread executes them.
+*/
+#define LOG_EVENT_ARTIFICIAL_F 0x20
+
+/**
+ @def LOG_EVENT_RELAY_LOG_F
+
+ Events with this flag set are created by slave IO thread and written
+ to relay log
+*/
+#define LOG_EVENT_RELAY_LOG_F 0x40
+
+/**
@def OPTIONS_WRITTEN_TO_BIN_LOG
OPTIONS_WRITTEN_TO_BIN_LOG are the bits of thd->options which must
@@ -980,7 +1003,10 @@ public:
#endif
virtual Log_event_type get_type_code() = 0;
virtual bool is_valid() const = 0;
- virtual bool is_artificial_event() { return 0; }
+ void set_artificial_event() { flags |= LOG_EVENT_ARTIFICIAL_F; }
+ void set_relay_log_event() { flags |= LOG_EVENT_RELAY_LOG_F; }
+ bool is_artificial_event() const { return flags & LOG_EVENT_ARTIFICIAL_F; }
+ bool is_relay_log_event() const { return flags & LOG_EVENT_RELAY_LOG_F; }
inline bool get_cache_stmt() const { return cache_stmt; }
Log_event(const char* buf, const Format_description_log_event
*description_event);
@@ -2079,12 +2105,6 @@ public:
uint16 binlog_version;
char server_version[ST_SERVER_VER_LEN];
/*
- artifical_event is 1 in the case where this is a generated event that
- should not case any cleanup actions. We handle this in the log by
- setting log_event == 0 (for now).
- */
- bool artificial_event;
- /*
We set this to 1 if we don't want to have the created time in the log,
which is the case when we rollover to a new log.
*/
@@ -2112,7 +2132,6 @@ public:
{
return START_V3_HEADER_LEN; //no variable-sized part
}
- virtual bool is_artificial_event() { return artificial_event; }
protected:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
@@ -2206,10 +2225,11 @@ protected:
@section Intvar_log_event_binary_format Binary Format
- The Post-Header has two components:
+ The Post-Header for this event type is empty. The Body has two
+ components:
<table>
- <caption>Post-Header for Intvar_log_event</caption>
+ <caption>Body for Intvar_log_event</caption>
<tr>
<th>Name</th>
@@ -2283,11 +2303,12 @@ private:
which are stored internally as two 64-bit numbers.
@section Rand_log_event_binary_format Binary Format
- This event type has no Post-Header. The Body of this event type has
- two components:
+
+ The Post-Header for this event type is empty. The Body has two
+ components:
<table>
- <caption>Post-Header for Intvar_log_event</caption>
+ <caption>Body for Rand_log_event</caption>
<tr>
<th>Name</th>
@@ -2532,7 +2553,8 @@ class Rotate_log_event: public Log_event
{
public:
enum {
- DUP_NAME= 2 // if constructor should dup the string argument
+ DUP_NAME= 2, // if constructor should dup the string argument
+ RELAY_LOG=4 // rotate event for relay log
};
const char* new_log_ident;
ulonglong pos;
@@ -3870,7 +3892,10 @@ public:
virtual Log_event_type get_type_code() { return INCIDENT_EVENT; }
- virtual bool is_valid() const { return 1; }
+ virtual bool is_valid() const
+ {
+ return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT;
+ }
virtual int get_data_size() {
return INCIDENT_HEADER_LEN + 1 + m_message.length;
}
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 6367dfee91e..8671f2189bd 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -148,15 +148,20 @@ typedef struct my_locale_st
TYPELIB *ab_month_names;
TYPELIB *day_names;
TYPELIB *ab_day_names;
+ uint max_month_name_length;
+ uint max_day_name_length;
#ifdef __cplusplus
my_locale_st(uint number_par,
const char *name_par, const char *descr_par, bool is_ascii_par,
TYPELIB *month_names_par, TYPELIB *ab_month_names_par,
- TYPELIB *day_names_par, TYPELIB *ab_day_names_par) :
+ TYPELIB *day_names_par, TYPELIB *ab_day_names_par,
+ uint max_month_name_length_par, uint max_day_name_length_par) :
number(number_par),
name(name_par), description(descr_par), is_ascii(is_ascii_par),
month_names(month_names_par), ab_month_names(ab_month_names_par),
- day_names(day_names_par), ab_day_names(ab_day_names_par)
+ day_names(day_names_par), ab_day_names(ab_day_names_par),
+ max_month_name_length(max_month_name_length_par),
+ max_day_name_length(max_day_name_length_par)
{}
#endif
} MY_LOCALE;
@@ -857,6 +862,8 @@ struct Query_cache_query_flags
unsigned int client_protocol_41:1;
unsigned int result_in_binary_protocol:1;
unsigned int more_results_exists:1;
+ unsigned int in_trans:1;
+ unsigned int autocommit:1;
unsigned int pkt_nr;
uint character_set_client_num;
uint character_set_results_num;
@@ -1948,6 +1955,7 @@ extern my_bool opt_log, opt_slow_log;
extern ulong log_output_options;
extern my_bool opt_log_queries_not_using_indexes;
extern bool opt_disable_networking, opt_skip_show_db;
+extern bool opt_ignore_builtin_innodb;
extern my_bool opt_character_set_client_handshake;
extern bool volatile abort_loop, shutdown_in_progress;
extern uint volatile thread_count, thread_running, global_read_lock;
@@ -2227,6 +2235,7 @@ uint strconvert(CHARSET_INFO *from_cs, const char *from,
CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors);
uint filename_to_tablename(const char *from, char *to, uint to_length);
uint tablename_to_filename(const char *from, char *to, uint to_length);
+uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length);
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
uint build_table_filename(char *buff, size_t bufflen, const char *db,
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 32a0518c6fd..553179d68f3 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -238,6 +238,12 @@ extern "C" int gethostname(char *name, int namelen);
extern "C" sig_handler handle_segfault(int sig);
+#if defined(__linux__)
+#define ENABLE_TEMP_POOL 1
+#else
+#define ENABLE_TEMP_POOL 0
+#endif
+
/* Constants */
const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
@@ -383,7 +389,7 @@ static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
/* Global variables */
-bool opt_update_log, opt_bin_log;
+bool opt_update_log, opt_bin_log, opt_ignore_builtin_innodb= 0;
my_bool opt_log, opt_slow_log;
ulong log_output_options;
my_bool opt_log_queries_not_using_indexes= 0;
@@ -3462,8 +3468,13 @@ static int init_common_variables(const char *conf_file_name, int argc,
sys_var_slow_log_path.value= my_strdup(s, MYF(0));
sys_var_slow_log_path.value_length= strlen(s);
+#if (ENABLE_TEMP_POOL)
if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1))
return 1;
+#else
+ use_temp_pool= 0;
+#endif
+
if (my_database_names_init())
return 1;
@@ -4195,6 +4206,44 @@ void decrement_handler_count()
#ifndef EMBEDDED_LIBRARY
+#ifndef DBUG_OFF
+/*
+ Debugging helper function to keep the locale database
+ (see sql_locale.cc) and max_month_name_length and
+ max_day_name_length variable values in consistent state.
+*/
+static void test_lc_time_sz()
+{
+ DBUG_ENTER("test_lc_time_sz");
+ for (MY_LOCALE **loc= my_locales; *loc; loc++)
+ {
+ uint max_month_len= 0;
+ uint max_day_len = 0;
+ for (const char **month= (*loc)->month_names->type_names; *month; month++)
+ {
+ set_if_bigger(max_month_len,
+ my_numchars_mb(&my_charset_utf8_general_ci,
+ *month, *month + strlen(*month)));
+ }
+ for (const char **day= (*loc)->day_names->type_names; *day; day++)
+ {
+ set_if_bigger(max_day_len,
+ my_numchars_mb(&my_charset_utf8_general_ci,
+ *day, *day + strlen(*day)));
+ }
+ if ((*loc)->max_month_name_length != max_month_len ||
+ (*loc)->max_day_name_length != max_day_len)
+ {
+ DBUG_PRINT("Wrong max day name(or month name) length for locale:",
+ ("%s", (*loc)->name));
+ DBUG_ASSERT(0);
+ }
+ }
+ DBUG_VOID_RETURN;
+}
+#endif//DBUG_OFF
+
+
#ifdef __WIN__
int win_main(int argc, char **argv)
#else
@@ -4295,6 +4344,10 @@ int main(int argc, char **argv)
openlog(libwrapName, LOG_PID, LOG_AUTH);
#endif
+#ifndef DBUG_OFF
+ test_lc_time_sz();
+#endif
+
/*
We have enough space for fiddling with the argv, continue
*/
@@ -5610,7 +5663,8 @@ enum options_mysqld
OPT_OLD_MODE,
OPT_SLAVE_EXEC_MODE,
OPT_GENERAL_LOG_FILE,
- OPT_SLOW_QUERY_LOG_FILE
+ OPT_SLOW_QUERY_LOG_FILE,
+ OPT_IGNORE_BUILTIN_INNODB
};
@@ -5820,6 +5874,9 @@ Disable with --skip-super-large-pages.",
(uchar**) &opt_super_large_pages, (uchar**) &opt_super_large_pages, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
#endif
+ {"ignore-builtin-innodb", OPT_IGNORE_BUILTIN_INNODB ,
+ "Disable initialization of builtin InnoDB plugin",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"init-connect", OPT_INIT_CONNECT, "Command(s) that are executed for each new connection",
(uchar**) &opt_init_connect, (uchar**) &opt_init_connect, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -6379,9 +6436,14 @@ log and this option does nothing anymore.",
(uchar**) &opt_tc_heuristic_recover, (uchar**) &opt_tc_heuristic_recover,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"temp-pool", OPT_TEMP_POOL,
+#if (ENABLE_TEMP_POOL)
"Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.",
+#else
+ "This option is ignored on this OS.",
+#endif
(uchar**) &use_temp_pool, (uchar**) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
+
{"timed_mutexes", OPT_TIMED_MUTEXES,
"Specify whether to time mutexes (only InnoDB mutexes are currently supported)",
(uchar**) &timed_mutexes, (uchar**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0,
@@ -6635,7 +6697,7 @@ The minimum value for this variable is 4096.",
{"max_user_connections", OPT_MAX_USER_CONNECTIONS,
"The maximum number of active connections for a single user (0 = no limit).",
(uchar**) &max_user_connections, (uchar**) &max_user_connections, 0, GET_UINT,
- REQUIRED_ARG, 0, 1, UINT_MAX, 0, 1, 0},
+ REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0},
{"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT,
"After this many write locks, allow some read locks to run in between.",
(uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG,
@@ -6931,13 +6993,15 @@ The minimum value for this variable is 4096.",
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
-static int show_question(THD *thd, SHOW_VAR *var, char *buff)
+
+static int show_queries(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_LONGLONG;
var->value= (char *)&thd->query_id;
return 0;
}
+
static int show_net_compression(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_MY_BOOL;
@@ -7353,7 +7417,8 @@ SHOW_VAR status_vars[]= {
{"Qcache_queries_in_cache", (char*) &query_cache.queries_in_cache, SHOW_LONG_NOFLUSH},
{"Qcache_total_blocks", (char*) &query_cache.total_blocks, SHOW_LONG_NOFLUSH},
#endif /*HAVE_QUERY_CACHE*/
- {"Questions", (char*) &show_question, SHOW_FUNC},
+ {"Queries", (char*) &show_queries, SHOW_FUNC},
+ {"Questions", (char*) offsetof(STATUS_VAR, questions), SHOW_LONG_STATUS},
#ifdef HAVE_REPLICATION
{"Rpl_status", (char*) &show_rpl_status, SHOW_FUNC},
#endif
@@ -7503,6 +7568,7 @@ static int mysql_init_variables(void)
log_output_options= find_bit_type(log_output_str, &log_output_typelib);
opt_bin_log= 0;
opt_disable_networking= opt_skip_show_db=0;
+ opt_ignore_builtin_innodb= 0;
opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0;
opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name !
opt_secure_auth= 0;
@@ -7801,6 +7867,9 @@ mysqld_get_one_option(int optid,
case (int) OPT_BIG_TABLES:
thd_startup_options|=OPTION_BIG_TABLES;
break;
+ case (int) OPT_IGNORE_BUILTIN_INNODB:
+ opt_ignore_builtin_innodb= 1;
+ break;
case (int) OPT_ISAM_LOG:
opt_myisam_log=1;
break;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index bafc368e415..9f8f17eb4ba 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1245,6 +1245,9 @@ QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT()
quick->file= NULL;
quick_selects.delete_elements();
delete pk_quick_select;
+ /* It's ok to call the next two even if they are already deinitialized */
+ end_read_record(&read_record);
+ free_io_cache(head);
free_root(&alloc,MYF(0));
DBUG_VOID_RETURN;
}
@@ -2668,7 +2671,7 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
PART_PRUNE_PARAM prune_param;
MEM_ROOT alloc;
RANGE_OPT_PARAM *range_par= &prune_param.range_param;
- my_bitmap_map *old_read_set, *old_write_set;
+ my_bitmap_map *old_sets[2];
prune_param.part_info= part_info;
init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
@@ -2682,8 +2685,8 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
DBUG_RETURN(FALSE);
}
- old_write_set= dbug_tmp_use_all_columns(table, table->write_set);
- old_read_set= dbug_tmp_use_all_columns(table, table->read_set);
+ dbug_tmp_use_all_columns(table, old_sets,
+ table->read_set, table->write_set);
range_par->thd= thd;
range_par->table= table;
/* range_par->cond doesn't need initialization */
@@ -2773,8 +2776,7 @@ all_used:
retval= FALSE; // some partitions are used
mark_all_partitions_as_used(prune_param.part_info);
end:
- dbug_tmp_restore_column_map(table->write_set, old_write_set);
- dbug_tmp_restore_column_map(table->read_set, old_read_set);
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
thd->no_errors=0;
thd->mem_root= range_par->old_root;
free_root(&alloc,MYF(0)); // Return memory & allocator
@@ -11145,9 +11147,9 @@ print_key(KEY_PART *key_part, const uchar *key, uint used_length)
String tmp(buff,sizeof(buff),&my_charset_bin);
uint store_length;
TABLE *table= key_part->field->table;
- my_bitmap_map *old_write_set, *old_read_set;
- old_write_set= dbug_tmp_use_all_columns(table, table->write_set);
- old_read_set= dbug_tmp_use_all_columns(table, table->read_set);
+ my_bitmap_map *old_sets[2];
+
+ dbug_tmp_use_all_columns(table, old_sets, table->read_set, table->write_set);
for (; key < key_end; key+=store_length, key_part++)
{
@@ -11173,8 +11175,7 @@ print_key(KEY_PART *key_part, const uchar *key, uint used_length)
if (key+store_length < key_end)
fputc('/',DBUG_FILE);
}
- dbug_tmp_restore_column_map(table->write_set, old_write_set);
- dbug_tmp_restore_column_map(table->read_set, old_read_set);
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
}
@@ -11182,18 +11183,16 @@ static void print_quick(QUICK_SELECT_I *quick, const key_map *needed_reg)
{
char buf[MAX_KEY/8+1];
TABLE *table;
- my_bitmap_map *old_read_map, *old_write_map;
+ my_bitmap_map *old_sets[2];
DBUG_ENTER("print_quick");
if (!quick)
DBUG_VOID_RETURN;
DBUG_LOCK_FILE;
table= quick->head;
- old_read_map= dbug_tmp_use_all_columns(table, table->read_set);
- old_write_map= dbug_tmp_use_all_columns(table, table->write_set);
+ dbug_tmp_use_all_columns(table, old_sets, table->read_set, table->write_set);
quick->dbug_dump(0, TRUE);
- dbug_tmp_restore_column_map(table->read_set, old_read_map);
- dbug_tmp_restore_column_map(table->write_set, old_write_map);
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
fprintf(DBUG_FILE,"other_keys: 0x%s:\n", needed_reg->print(buf));
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index d3ece194dcd..07ea434e8e0 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -266,6 +266,11 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
if (end_io_cache(&file))
goto err_w_file;
+ if (opt_sync_frm) {
+ if (my_sync(handler, MYF(MY_WME)))
+ goto err_w_file;
+ }
+
if (my_close(handler, MYF(MY_WME)))
{
DBUG_RETURN(TRUE);
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 02f2c9b0ab1..e2027d3571e 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -867,6 +867,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
if (part_type != HASH_PARTITION || !list_of_part_fields)
{
+ DBUG_ASSERT(part_expr);
err= part_expr->walk(&Item::check_partition_func_processor, 0,
NULL);
if (!err && is_sub_partitioned() && !list_of_subpart_fields)
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 703b92305b1..415f955d5d4 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index d7e783f534f..582348608de 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -644,6 +644,16 @@ err:
}
#endif
+
+/**
+ Execute a SHOW SLAVE HOSTS statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool show_slave_hosts(THD* thd)
{
List<Item> field_list;
diff --git a/sql/rpl_constants.h b/sql/rpl_constants.h
index 426e80a328d..32fb4b8a7f2 100644
--- a/sql/rpl_constants.h
+++ b/sql/rpl_constants.h
@@ -6,10 +6,10 @@
*/
enum Incident {
/** No incident */
- INCIDENT_NONE,
+ INCIDENT_NONE = 0,
/** There are possibly lost events in the replication stream */
- INCIDENT_LOST_EVENTS,
+ INCIDENT_LOST_EVENTS = 1,
/** Shall be last event of the enumeration */
INCIDENT_COUNT
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index b6dfd1a1dc8..3a0f784d195 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -155,6 +155,7 @@ int init_relay_log_info(Relay_log_info* rli,
sql_print_error("Failed in open_log() called from init_relay_log_info()");
DBUG_RETURN(1);
}
+ rli->relay_log.is_relay_log= TRUE;
}
/* if file does not exist */
diff --git a/sql/set_var.cc b/sql/set_var.cc
index a371c1113ef..f14068fcfcb 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -275,6 +275,11 @@ static sys_var_const sys_ft_query_expansion_limit(&vars,
static sys_var_const sys_ft_stopword_file(&vars, "ft_stopword_file",
OPT_GLOBAL, SHOW_CHAR_PTR,
(uchar*) &ft_stopword_file);
+
+static sys_var_const sys_ignore_builtin_innodb(&vars, "ignore_builtin_innodb",
+ OPT_GLOBAL, SHOW_BOOL,
+ (uchar*) &opt_ignore_builtin_innodb);
+
sys_var_str sys_init_connect(&vars, "init_connect", 0,
sys_update_init_connect,
sys_default_init_connect,0);
@@ -1527,14 +1532,14 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var)
ulonglong tmp= var->save_result.ulonglong_value;
/* Don't use bigger value than given with --maximum-variable-name=.. */
- if ((ulong) tmp > max_system_variables.*offset)
+ if (tmp > max_system_variables.*offset)
{
throw_bounds_warning(thd, TRUE, TRUE, name, (longlong) tmp);
tmp= max_system_variables.*offset;
}
if (option_limits)
- tmp= (ulong) fix_unsigned(thd, tmp, option_limits);
+ tmp= fix_unsigned(thd, tmp, option_limits);
#if SIZEOF_LONG < SIZEOF_LONG_LONG
else if (tmp > ULONG_MAX)
{
@@ -1543,6 +1548,7 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var)
}
#endif
+ DBUG_ASSERT(tmp <= ULONG_MAX);
if (var->type == OPT_GLOBAL)
global_system_variables.*offset= (ulong) tmp;
else
@@ -3548,6 +3554,7 @@ int set_var_password::check(THD *thd)
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (!user->host.str)
{
+ DBUG_ASSERT(thd->security_ctx->priv_host);
if (*thd->security_ctx->priv_host != 0)
{
user->host.str= (char *) thd->security_ctx->priv_host;
@@ -3559,6 +3566,12 @@ int set_var_password::check(THD *thd)
user->host.length= 1;
}
}
+ if (!user->user.str)
+ {
+ DBUG_ASSERT(thd->security_ctx->priv_user);
+ user->user.str= (char *) thd->security_ctx->priv_user;
+ user->user.length= strlen(thd->security_ctx->priv_user);
+ }
/* Returns 1 as the function sends error to client */
return check_change_password(thd, user->host.str, user->user.str,
password, strlen(password)) ? 1 : 0;
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index fd75fee9737..befd064e3e3 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -571,30 +571,30 @@ ER_ERROR_ON_READ
swe "Fick fel vid läsning av '%-.200s' (Felkod %d)"
ukr "îÅ ÍÏÖÕ ÐÒÏÞÉÔÁÔÉ ÆÁÊÌ '%-.200s' (ÐÏÍÉÌËÁ: %d)"
ER_ERROR_ON_RENAME
- cze "Chyba p-Bøi pøejmenování '%-.150s' na '%-.150s' (chybový kód: %d)"
- dan "Fejl ved omdøbning af '%-.150s' til '%-.150s' (Fejlkode: %d)"
- nla "Fout bij het hernoemen van '%-.150s' naar '%-.150s' (Errcode: %d)"
- eng "Error on rename of '%-.150s' to '%-.150s' (errno: %d)"
- jps "'%-.150s' ‚ð '%-.150s' ‚É rename ‚Å‚«‚Ü‚¹‚ñ (errno: %d)",
- est "Viga faili '%-.150s' ümbernimetamisel '%-.150s'-ks (veakood: %d)"
- fre "Erreur en renommant '%-.150s' en '%-.150s' (Errcode: %d)"
- ger "Fehler beim Umbenennen von '%-.150s' in '%-.150s' (Fehler: %d)"
- greek "Ðñüâëçìá êáôÜ ôçí ìåôïíïìáóßá ôïõ áñ÷åßïõ '%-.150s' to '%-.150s' (êùäéêüò ëÜèïõò: %d)"
- hun "Hiba a '%-.150s' file atnevezesekor '%-.150s'. (hibakod: %d)"
- ita "Errore durante la rinominazione da '%-.150s' a '%-.150s' (errno: %d)"
- jpn "'%-.150s' ¤ò '%-.150s' ¤Ë rename ¤Ç¤­¤Þ¤»¤ó (errno: %d)"
- kor "'%-.150s'¸¦ '%-.150s'·Î À̸§ º¯°æÁß ¿¡·¯ (¿¡·¯¹øÈ£: %d)"
- nor "Feil ved omdøping av '%-.150s' til '%-.150s' (Feilkode: %d)"
- norwegian-ny "Feil ved omdøyping av '%-.150s' til '%-.150s' (Feilkode: %d)"
- pol "B³?d podczas zmieniania nazwy '%-.150s' na '%-.150s' (Kod b³êdu: %d)"
- por "Erro ao renomear '%-.150s' para '%-.150s' (erro no. %d)"
- rum "Eroare incercind sa renumesc '%-.150s' in '%-.150s' (errno: %d)"
- rus "ïÛÉÂËÁ ÐÒÉ ÐÅÒÅÉÍÅÎÏ×ÁÎÉÉ '%-.150s' × '%-.150s' (ÏÛÉÂËÁ: %d)"
- serbian "Greška pri promeni imena '%-.150s' na '%-.150s' (errno: %d)"
- slo "Chyba pri premenovávaní '%-.150s' na '%-.150s' (chybový kód: %d)"
- spa "Error en el renombrado de '%-.150s' a '%-.150s' (Error: %d)"
- swe "Kan inte byta namn från '%-.150s' till '%-.150s' (Felkod: %d)"
- ukr "îÅ ÍÏÖÕ ÐÅÒÅÊÍÅÎÕ×ÁÔÉ '%-.150s' Õ '%-.150s' (ÐÏÍÉÌËÁ: %d)"
+ cze "Chyba p-Bøi pøejmenování '%-.210s' na '%-.210s' (chybový kód: %d)"
+ dan "Fejl ved omdøbning af '%-.210s' til '%-.210s' (Fejlkode: %d)"
+ nla "Fout bij het hernoemen van '%-.210s' naar '%-.210s' (Errcode: %d)"
+ eng "Error on rename of '%-.210s' to '%-.210s' (errno: %d)"
+ jps "'%-.210s' ‚ð '%-.210s' ‚É rename ‚Å‚«‚Ü‚¹‚ñ (errno: %d)",
+ est "Viga faili '%-.210s' ümbernimetamisel '%-.210s'-ks (veakood: %d)"
+ fre "Erreur en renommant '%-.210s' en '%-.210s' (Errcode: %d)"
+ ger "Fehler beim Umbenennen von '%-.210s' in '%-.210s' (Fehler: %d)"
+ greek "Ðñüâëçìá êáôÜ ôçí ìåôïíïìáóßá ôïõ áñ÷åßïõ '%-.210s' to '%-.210s' (êùäéêüò ëÜèïõò: %d)"
+ hun "Hiba a '%-.210s' file atnevezesekor '%-.210s'. (hibakod: %d)"
+ ita "Errore durante la rinominazione da '%-.210s' a '%-.210s' (errno: %d)"
+ jpn "'%-.210s' ¤ò '%-.210s' ¤Ë rename ¤Ç¤­¤Þ¤»¤ó (errno: %d)"
+ kor "'%-.210s'¸¦ '%-.210s'·Î À̸§ º¯°æÁß ¿¡·¯ (¿¡·¯¹øÈ£: %d)"
+ nor "Feil ved omdøping av '%-.210s' til '%-.210s' (Feilkode: %d)"
+ norwegian-ny "Feil ved omdøyping av '%-.210s' til '%-.210s' (Feilkode: %d)"
+ pol "B³?d podczas zmieniania nazwy '%-.210s' na '%-.210s' (Kod b³êdu: %d)"
+ por "Erro ao renomear '%-.210s' para '%-.210s' (erro no. %d)"
+ rum "Eroare incercind sa renumesc '%-.210s' in '%-.210s' (errno: %d)"
+ rus "ïÛÉÂËÁ ÐÒÉ ÐÅÒÅÉÍÅÎÏ×ÁÎÉÉ '%-.210s' × '%-.210s' (ÏÛÉÂËÁ: %d)"
+ serbian "Greška pri promeni imena '%-.210s' na '%-.210s' (errno: %d)"
+ slo "Chyba pri premenovávaní '%-.210s' na '%-.210s' (chybový kód: %d)"
+ spa "Error en el renombrado de '%-.210s' a '%-.210s' (Error: %d)"
+ swe "Kan inte byta namn från '%-.210s' till '%-.210s' (Felkod: %d)"
+ ukr "îÅ ÍÏÖÕ ÐÅÒÅÊÍÅÎÕ×ÁÔÉ '%-.210s' Õ '%-.210s' (ÐÏÍÉÌËÁ: %d)"
ER_ERROR_ON_WRITE
cze "Chyba p-Bøi zápisu do souboru '%-.200s' (chybový kód: %d)"
dan "Fejl ved skriving av filen '%-.200s' (Fejlkode: %d)"
diff --git a/sql/slave.cc b/sql/slave.cc
index 43b70f29a68..22c61b3ec6c 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1357,6 +1357,17 @@ int register_slave_on_master(MYSQL* mysql, Master_info *mi,
}
+/**
+ Execute a SHOW SLAVE STATUS statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param mi Pointer to Master_info object for the IO thread.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool show_master_info(THD* thd, Master_info* mi)
{
// TODO: fix this for multi-master
@@ -2062,7 +2073,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli,
fewer times, 0 is returned.
- init_master_info or init_relay_log_pos failed. (These are called
- if a failure occurs when applying the event.)</li>
+ if a failure occurs when applying the event.)
- An error occurred when updating the binlog position.
@@ -2307,8 +2318,14 @@ static int try_to_reconnect(THD *thd, MYSQL *mysql, Master_info *mi,
}
-/* Slave I/O Thread entry point */
+/**
+ Slave IO thread entry point.
+
+ @param arg Pointer to Master_info struct that holds information for
+ the IO thread.
+ @return Always 0.
+*/
pthread_handler_t handle_slave_io(void *arg)
{
THD *thd; // needs to be first for thread_stack
@@ -2616,8 +2633,14 @@ err:
}
-/* Slave SQL Thread entry point */
+/**
+ Slave SQL thread entry point.
+
+ @param arg Pointer to Relay_log_info object that holds information
+ for the SQL thread.
+ @return Always 0.
+*/
pthread_handler_t handle_slave_sql(void *arg)
{
THD *thd; /* needs to be first for thread_stack */
@@ -3710,6 +3733,16 @@ static IO_CACHE *reopen_relay_log(Relay_log_info *rli, const char **errmsg)
}
+/**
+ Reads next event from the relay log. Should be called from the
+ slave IO thread.
+
+ @param rli Relay_log_info structure for the slave IO thread.
+
+ @return The event read, or NULL on error. If an error occurs, the
+ error is reported through the sql_print_information() or
+ sql_print_error() functions.
+*/
static Log_event* next_event(Relay_log_info* rli)
{
Log_event* ev;
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 95cea22ecd9..34b6c483637 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB
+/* Copyright 2002-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/spatial.h b/sql/spatial.h
index f806861290e..69a1f24506e 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -116,12 +116,12 @@ struct MBR
int touches(const MBR *mbr)
{
/* The following should be safe, even if we compare doubles */
- return ((((mbr->xmin == xmax) || (mbr->xmax == xmin)) &&
- ((mbr->ymin >= ymin) && (mbr->ymin <= ymax) ||
- (mbr->ymax >= ymin) && (mbr->ymax <= ymax))) ||
+ return ((((mbr->xmin == xmax) || (mbr->xmax == xmin)) &&
+ (((mbr->ymin >= ymin) && (mbr->ymin <= ymax)) ||
+ ((mbr->ymax >= ymin) && (mbr->ymax <= ymax)))) ||
(((mbr->ymin == ymax) || (mbr->ymax == ymin)) &&
- ((mbr->xmin >= xmin) && (mbr->xmin <= xmax) ||
- (mbr->xmax >= xmin) && (mbr->xmax <= xmax))));
+ (((mbr->xmin >= xmin) && (mbr->xmin <= xmax)) ||
+ ((mbr->xmax >= xmin) && (mbr->xmax <= xmax)))));
}
int within(const MBR *mbr)
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 0043ef09229..bd940608a07 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -6304,10 +6304,12 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr)
}
-void update_schema_privilege(TABLE *table, char *buff, const char* db,
- const char* t_name, const char* column,
- uint col_length, const char *priv,
- uint priv_length, const char* is_grantable)
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+static bool update_schema_privilege(THD *thd, TABLE *table, char *buff,
+ const char* db, const char* t_name,
+ const char* column, uint col_length,
+ const char *priv, uint priv_length,
+ const char* is_grantable)
{
int i= 2;
CHARSET_INFO *cs= system_charset_info;
@@ -6320,14 +6322,16 @@ void update_schema_privilege(TABLE *table, char *buff, const char* db,
if (column)
table->field[i++]->store(column, col_length, cs);
table->field[i++]->store(priv, priv_length, cs);
- table->field[i]->store(is_grantable, (uint) strlen(is_grantable), cs);
- table->file->ha_write_row(table->record[0]);
+ table->field[i]->store(is_grantable, strlen(is_grantable), cs);
+ return schema_table_store_record(thd, table);
}
+#endif
int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ int error= 0;
uint counter;
ACL_USER *acl_user;
ulong want_access;
@@ -6361,8 +6365,14 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
strxmov(buff,"'",user,"'@'",host,"'",NullS);
if (!(want_access & ~GRANT_ACL))
- update_schema_privilege(table, buff, 0, 0, 0, 0,
- STRING_WITH_LEN("USAGE"), is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, 0, 0, 0, 0,
+ STRING_WITH_LEN("USAGE"), is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
else
{
uint priv_id;
@@ -6370,16 +6380,22 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
for (priv_id=0, j = SELECT_ACL;j <= GLOBAL_ACLS; priv_id++,j <<= 1)
{
if (test_access & j)
- update_schema_privilege(table, buff, 0, 0, 0, 0,
- command_array[priv_id],
- command_lengths[priv_id], is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, 0, 0, 0, 0,
+ command_array[priv_id],
+ command_lengths[priv_id], is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
}
}
}
-
+err:
pthread_mutex_unlock(&acl_cache->lock);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
#else
return(0);
#endif
@@ -6389,6 +6405,7 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ int error= 0;
uint counter;
ACL_DB *acl_db;
ulong want_access;
@@ -6426,24 +6443,36 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
}
strxmov(buff,"'",user,"'@'",host,"'",NullS);
if (!(want_access & ~GRANT_ACL))
- update_schema_privilege(table, buff, acl_db->db, 0, 0,
- 0, STRING_WITH_LEN("USAGE"), is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, acl_db->db, 0, 0,
+ 0, STRING_WITH_LEN("USAGE"), is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
else
{
int cnt;
ulong j,test_access= want_access & ~GRANT_ACL;
for (cnt=0, j = SELECT_ACL; j <= DB_ACLS; cnt++,j <<= 1)
if (test_access & j)
- update_schema_privilege(table, buff, acl_db->db, 0, 0, 0,
- command_array[cnt], command_lengths[cnt],
- is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, acl_db->db, 0, 0, 0,
+ command_array[cnt], command_lengths[cnt],
+ is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
}
}
}
-
+err:
pthread_mutex_unlock(&acl_cache->lock);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
#else
return (0);
#endif
@@ -6453,6 +6482,7 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ int error= 0;
uint index;
char buff[100];
TABLE *table= tables->table;
@@ -6492,8 +6522,15 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
strxmov(buff, "'", user, "'@'", host, "'", NullS);
if (!test_access)
- update_schema_privilege(table, buff, grant_table->db, grant_table->tname,
- 0, 0, STRING_WITH_LEN("USAGE"), is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, grant_table->db,
+ grant_table->tname, 0, 0,
+ STRING_WITH_LEN("USAGE"), is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
else
{
ulong j;
@@ -6501,17 +6538,24 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
for (cnt= 0, j= SELECT_ACL; j <= TABLE_ACLS; cnt++, j<<= 1)
{
if (test_access & j)
- update_schema_privilege(table, buff, grant_table->db,
- grant_table->tname, 0, 0, command_array[cnt],
- command_lengths[cnt], is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, grant_table->db,
+ grant_table->tname, 0, 0,
+ command_array[cnt],
+ command_lengths[cnt], is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
}
}
- }
+ }
}
-
+err:
rw_unlock(&LOCK_grant);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
#else
return (0);
#endif
@@ -6521,6 +6565,7 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ int error= 0;
uint index;
char buff[100];
TABLE *table= tables->table;
@@ -6570,22 +6615,28 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
GRANT_COLUMN *grant_column = (GRANT_COLUMN*)
hash_element(&grant_table->hash_columns,col_index);
if ((grant_column->rights & j) && (table_access & j))
- update_schema_privilege(table, buff, grant_table->db,
- grant_table->tname,
- grant_column->column,
- grant_column->key_length,
- command_array[cnt],
- command_lengths[cnt], is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, grant_table->db,
+ grant_table->tname,
+ grant_column->column,
+ grant_column->key_length,
+ command_array[cnt],
+ command_lengths[cnt], is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
}
}
}
}
}
}
-
+err:
rw_unlock(&LOCK_grant);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
#else
return (0);
#endif
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6dcd11fac71..d17bf085e3b 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1111,6 +1111,27 @@ static void mark_temp_tables_as_free_for_reuse(THD *thd)
*/
if (table->child_l || table->parent)
detach_merge_children(table, TRUE);
+ /*
+ Reset temporary table lock type to it's default value (TL_WRITE).
+
+ Statements such as INSERT INTO .. SELECT FROM tmp, CREATE TABLE
+ .. SELECT FROM tmp and UPDATE may under some circumstances modify
+ the lock type of the tables participating in the statement. This
+ isn't a problem for non-temporary tables since their lock type is
+ reset at every open, but the same does not occur for temporary
+ tables for historical reasons.
+
+ Furthermore, the lock type of temporary tables is not really that
+ important because they can only be used by one query at a time and
+ not even twice in a query -- a temporary table is represented by
+ only one TABLE object. Nonetheless, it's safer from a maintenance
+ point of view to reset the lock type of this singleton TABLE object
+ as to not cause problems when the table is reused.
+
+ Even under LOCK TABLES mode its okay to reset the lock type as
+ LOCK TABLES is allowed (but ignored) for a temporary table.
+ */
+ table->reginfo.lock_type= TL_WRITE;
}
}
}
@@ -4681,7 +4702,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
else if (tables->lock_type == TL_READ_DEFAULT)
tables->table->reginfo.lock_type=
read_lock_type_for_table(thd, tables->table);
- else if (tables->table->s->tmp_table == NO_TMP_TABLE)
+ else
tables->table->reginfo.lock_type= tables->lock_type;
}
tables->table->grant= tables->grant;
@@ -5082,8 +5103,15 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables)
{
if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG))
{
- handler::Table_flags flags_some_set= handler::Table_flags();
- handler::Table_flags flags_all_set= ~handler::Table_flags();
+ /*
+ Compute the starting vectors for the computations by creating a
+ set with all the capabilities bits set and one with no
+ capabilities bits set.
+ */
+ handler::Table_flags flags_some_set= 0;
+ handler::Table_flags flags_all_set=
+ HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE;
+
my_bool multi_engine= FALSE;
void* prev_ht= NULL;
for (TABLE_LIST *table= tables; table; table= table->next_global)
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index 7ca7bef3a56..96e99b57e3c 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -18,7 +18,7 @@
#include "base64.h"
/**
- Execute a BINLOG statement
+ Execute a BINLOG statement.
To execute the BINLOG command properly the server needs to know
which format the BINLOG command's event is in. Therefore, the first
@@ -26,6 +26,9 @@
Format_description_log_event, as outputted by mysqlbinlog. This
Format_description_log_event is cached in
rli->description_event_for_exec.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
*/
void mysql_client_binlog_statement(THD* thd)
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 1d907bb1f16..fcea4153eb0 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -782,6 +782,9 @@ void query_cache_end_of_result(THD *thd)
if (query_cache.is_disabled() || thd->net.query_cache_query == 0)
DBUG_VOID_RETURN;
+ /* Ensure that only complete results are cached. */
+ DBUG_ASSERT(thd->main_da.is_eof());
+
if (thd->killed)
{
query_cache_abort(&thd->net);
@@ -1003,6 +1006,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
flags.result_in_binary_protocol= (unsigned int) thd->protocol->type();
flags.more_results_exists= test(thd->server_status &
SERVER_MORE_RESULTS_EXISTS);
+ flags.in_trans= test(thd->server_status & SERVER_STATUS_IN_TRANS);
+ flags.autocommit= test(thd->server_status & SERVER_STATUS_AUTOCOMMIT);
flags.pkt_nr= net->pkt_nr;
flags.character_set_client_num=
thd->variables.character_set_client->number;
@@ -1024,7 +1029,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \
CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
-def_week_frmt: %lu",
+def_week_frmt: %lu, in_trans: %d, autocommit: %d",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
(int)flags.result_in_binary_protocol,
@@ -1039,7 +1044,10 @@ def_week_frmt: %lu",
flags.max_sort_length,
flags.group_concat_max_len,
flags.div_precision_increment,
- flags.default_week_format));
+ flags.default_week_format,
+ (int)flags.in_trans,
+ (int)flags.autocommit));
+
/*
Make InnoDB to release the adaptive hash index latch before
acquiring the query cache mutex.
@@ -1278,6 +1286,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
flags.result_in_binary_protocol= (unsigned int)thd->protocol->type();
flags.more_results_exists= test(thd->server_status &
SERVER_MORE_RESULTS_EXISTS);
+ flags.in_trans= test(thd->server_status & SERVER_STATUS_IN_TRANS);
+ flags.autocommit= test(thd->server_status & SERVER_STATUS_AUTOCOMMIT);
flags.pkt_nr= thd->net.pkt_nr;
flags.character_set_client_num= thd->variables.character_set_client->number;
flags.character_set_results_num=
@@ -1297,7 +1307,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \
CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
-def_week_frmt: %lu",
+def_week_frmt: %lu, in_trans: %d, autocommit: %d",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
(int)flags.result_in_binary_protocol,
@@ -1312,7 +1322,9 @@ def_week_frmt: %lu",
flags.max_sort_length,
flags.group_concat_max_len,
flags.div_precision_increment,
- flags.default_week_format));
+ flags.default_week_format,
+ (int)flags.in_trans,
+ (int)flags.autocommit));
memcpy((uchar *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)),
(uchar*) &flags, QUERY_CACHE_FLAGS_SIZE);
query_block = (Query_cache_block *) hash_search(&queries, (uchar*) sql,
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 58981e4913f..118dc5af68f 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3601,7 +3601,6 @@ show_query_type(THD::enum_binlog_query_type qtype)
default:
DBUG_ASSERT(0 <= qtype && qtype < THD::QUERY_TYPE_COUNT);
}
-
static char buf[64];
sprintf(buf, "UNKNOWN#%d", qtype);
return buf;
@@ -3661,16 +3660,14 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
if (lex->is_stmt_unsafe() &&
variables.binlog_format == BINLOG_FORMAT_STMT)
{
- DBUG_ASSERT(this->query != NULL);
push_warning(this, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_UNSAFE_STATEMENT,
ER(ER_BINLOG_UNSAFE_STATEMENT));
if (!(binlog_flags & BINLOG_FLAG_UNSAFE_STMT_PRINTED))
{
- char warn_buf[MYSQL_ERRMSG_SIZE];
- my_snprintf(warn_buf, MYSQL_ERRMSG_SIZE, "%s Statement: %s",
- ER(ER_BINLOG_UNSAFE_STATEMENT), this->query);
- sql_print_warning(warn_buf);
+ sql_print_warning("%s Statement: %.*s",
+ ER(ER_BINLOG_UNSAFE_STATEMENT),
+ MYSQL_ERRMSG_SIZE, query_arg);
binlog_flags|= BINLOG_FLAG_UNSAFE_STMT_PRINTED;
}
}
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 58f5d0080cb..413e2f5be86 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -456,8 +456,15 @@ typedef struct system_status_var
ulong com_stmt_fetch;
ulong com_stmt_reset;
ulong com_stmt_close;
-
/*
+ Number of statements sent from the client
+ */
+ ulong questions;
+ /*
+ IMPORTANT!
+ SEE last_system_status_var DEFINITION BELOW.
+ Below 'last_system_status_var' are all variables which doesn't make any
+ sense to add to the /global/ status variable counter.
Status variables which it does not make sense to add to
global status variable counter
*/
@@ -470,7 +477,7 @@ typedef struct system_status_var
counter
*/
-#define last_system_status_var com_stmt_close
+#define last_system_status_var questions
void mark_transaction_to_rollback(THD *thd, bool all);
@@ -1003,6 +1010,7 @@ show_system_thread(enum_thread_type thread)
{
#define RETURN_NAME_AS_STRING(NAME) case (NAME): return #NAME
switch (thread) {
+ static char buf[64];
RETURN_NAME_AS_STRING(NON_SYSTEM_THREAD);
RETURN_NAME_AS_STRING(SYSTEM_THREAD_DELAYED_INSERT);
RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_IO);
@@ -1010,9 +1018,11 @@ show_system_thread(enum_thread_type thread)
RETURN_NAME_AS_STRING(SYSTEM_THREAD_NDBCLUSTER_BINLOG);
RETURN_NAME_AS_STRING(SYSTEM_THREAD_EVENT_SCHEDULER);
RETURN_NAME_AS_STRING(SYSTEM_THREAD_EVENT_WORKER);
+ default:
+ sprintf(buf, "<UNKNOWN SYSTEM THREAD: %d>", thread);
+ return buf;
}
#undef RETURN_NAME_AS_STRING
- return "UNKNOWN"; /* keep gcc happy */
}
/**
@@ -2111,8 +2121,8 @@ public:
Don't reset binlog format for NDB binlog injector thread.
*/
DBUG_PRINT("debug",
- ("temporary_tables: %p, in_sub_stmt: %d, system_thread: %s",
- temporary_tables, in_sub_stmt,
+ ("temporary_tables: %s, in_sub_stmt: %s, system_thread: %s",
+ YESNO(temporary_tables), YESNO(in_sub_stmt),
show_system_thread(system_thread)));
if ((temporary_tables == NULL) && (in_sub_stmt == 0) &&
(system_thread != SYSTEM_THREAD_NDBCLUSTER_BINLOG))
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index 1f6c9fdee53..553342f155b 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -86,6 +86,7 @@ class Materialized_cursor: public Server_side_cursor
List<Item> item_list;
ulong fetch_limit;
ulong fetch_count;
+ bool is_rnd_inited;
public:
Materialized_cursor(select_result *result, TABLE *table);
@@ -197,7 +198,11 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result,
such command is SHOW VARIABLES or SHOW STATUS.
*/
if (rc)
+ {
+ if (result_materialize->materialized_cursor)
+ delete result_materialize->materialized_cursor;
goto err_open;
+ }
if (sensitive_cursor->is_open())
{
@@ -549,7 +554,8 @@ Materialized_cursor::Materialized_cursor(select_result *result_arg,
:Server_side_cursor(&table_arg->mem_root, result_arg),
table(table_arg),
fetch_limit(0),
- fetch_count(0)
+ fetch_count(0),
+ is_rnd_inited(0)
{
fake_unit.init_query();
fake_unit.thd= table->in_use;
@@ -606,11 +612,12 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
THD *thd= fake_unit.thd;
int rc;
Query_arena backup_arena;
-
thd->set_n_backup_active_arena(this, &backup_arena);
/* Create a list of fields and start sequential scan */
- rc= (result->prepare(item_list, &fake_unit) ||
- table->file->ha_rnd_init(TRUE));
+ rc= result->prepare(item_list, &fake_unit);
+ if (!rc && !(rc= table->file->ha_rnd_init(TRUE)))
+ is_rnd_inited= 1;
+
thd->restore_active_arena(this, &backup_arena);
if (rc == 0)
{
@@ -685,7 +692,8 @@ void Materialized_cursor::close()
{
/* Free item_list items */
free_items();
- (void) table->file->ha_rnd_end();
+ if (is_rnd_inited)
+ (void) table->file->ha_rnd_end();
/*
We need to grab table->mem_root to prevent free_tmp_table from freeing:
the cursor object was allocated in this memory.
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index c538dfb08bc..72ae664bba1 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -907,7 +907,6 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
remove_db_from_cache(db);
pthread_mutex_unlock(&LOCK_open);
-
error= -1;
/*
We temporarily disable the binary log while dropping the objects
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index f7c44152571..d87eafa3e0c 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -51,6 +51,11 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
THD::killed_state killed_status= THD::NOT_KILLED;
DBUG_ENTER("mysql_delete");
+ THD::enum_binlog_query_type query_type=
+ thd->lex->sql_command == SQLCOM_TRUNCATE ?
+ THD::STMT_QUERY_TYPE :
+ THD::ROW_QUERY_TYPE;
+
if (open_and_lock_tables(thd, table_list))
DBUG_RETURN(TRUE);
if (!(table= table_list->table))
@@ -135,6 +140,11 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
DBUG_PRINT("debug", ("Trying to use delete_all_rows()"));
if (!(error=table->file->ha_delete_all_rows()))
{
+ /*
+ If delete_all_rows() is used, it is not possible to log the
+ query in row format, so we have to log it in statement format.
+ */
+ query_type= THD::STMT_QUERY_TYPE;
error= -1; // ok
deleted= maybe_deleted;
goto cleanup;
@@ -374,6 +384,11 @@ cleanup:
{
if (mysql_bin_log.is_open())
{
+ bool const is_trans=
+ thd->lex->sql_command == SQLCOM_TRUNCATE ?
+ FALSE :
+ transactional_table;
+
if (error < 0)
thd->clear_error();
/*
@@ -381,10 +396,13 @@ cleanup:
storage engine does not inject the rows itself, we replicate
statement-based; otherwise, 'ha_delete_row()' was used to
delete specific rows which we might log row-based.
+
+ Note that TRUNCATE TABLE is not transactional and should
+ therefore be treated as a DDL.
*/
- int log_result= thd->binlog_query(THD::ROW_QUERY_TYPE,
+ int log_result= thd->binlog_query(query_type,
thd->query, thd->query_length,
- transactional_table, FALSE, killed_status);
+ is_trans, FALSE, killed_status);
if (log_result && transactional_table)
{
@@ -951,6 +969,26 @@ bool multi_delete::send_eof()
****************************************************************************/
/*
+ Row-by-row truncation if the engine does not support table recreation.
+ Probably a InnoDB table.
+*/
+
+static bool mysql_truncate_by_delete(THD *thd, TABLE_LIST *table_list)
+{
+ bool error, save_binlog_row_based= thd->current_stmt_binlog_row_based;
+ DBUG_ENTER("mysql_truncate_by_delete");
+ table_list->lock_type= TL_WRITE;
+ mysql_init_select(thd->lex);
+ thd->clear_current_stmt_binlog_row_based();
+ error= mysql_delete(thd, table_list, NULL, NULL, HA_POS_ERROR, LL(0), TRUE);
+ ha_autocommit_or_rollback(thd, error);
+ end_trans(thd, error ? ROLLBACK : COMMIT);
+ thd->current_stmt_binlog_row_based= save_binlog_row_based;
+ DBUG_RETURN(error);
+}
+
+
+/*
Optimize delete of all rows by doing a full generate of the table
This will work even if the .ISM and .ISD tables are destroyed
@@ -990,6 +1028,9 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
share->db.str,
share->table_name.str, 1))))
(void) rm_temporary_table(table_type, path);
+ else
+ thd->thread_specific_used= TRUE;
+
free_table_share(share);
my_free((char*) table,MYF(0));
/*
@@ -1055,24 +1096,6 @@ end:
DBUG_RETURN(error);
trunc_by_del:
- /* Probably InnoDB table */
- ulonglong save_options= thd->options;
- table_list->lock_type= TL_WRITE;
- thd->options&= ~(OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT);
- ha_enable_transaction(thd, FALSE);
- mysql_init_select(thd->lex);
- bool save_binlog_row_based= thd->current_stmt_binlog_row_based;
- thd->clear_current_stmt_binlog_row_based();
- error= mysql_delete(thd, table_list, (COND*) 0, (SQL_LIST*) 0,
- HA_POS_ERROR, LL(0), TRUE);
- ha_enable_transaction(thd, TRUE);
- /*
- Safety, in case the engine ignored ha_enable_transaction(FALSE)
- above. Also clears thd->transaction.*.
- */
- error= ha_autocommit_or_rollback(thd, error);
- ha_commit(thd);
- thd->options= save_options;
- thd->current_stmt_binlog_row_based= save_binlog_row_based;
+ error= mysql_truncate_by_delete(thd, table_list);
DBUG_RETURN(error);
}
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 79da1936eb9..bd8f9469571 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -177,7 +177,7 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
uint code, const char *format, ...)
{
va_list args;
- char warning[ERRMSGSIZE+20];
+ char warning[MYSQL_ERRMSG_SIZE];
DBUG_ENTER("push_warning_printf");
DBUG_PRINT("enter",("warning: %u", code));
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 2c811ad03a0..322391b63e8 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1690,6 +1690,7 @@ public:
class Delayed_insert :public ilink {
uint locks_in_memory;
+ thr_lock_type delayed_lock;
public:
THD thd;
TABLE *table;
@@ -1731,6 +1732,8 @@ public:
pthread_cond_init(&cond_client,NULL);
VOID(pthread_mutex_lock(&LOCK_thread_count));
delayed_insert_threads++;
+ delayed_lock= global_system_variables.low_priority_updates ?
+ TL_WRITE_LOW_PRIORITY : TL_WRITE;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
}
~Delayed_insert()
@@ -2540,7 +2543,7 @@ bool Delayed_insert::handle_inserts(void)
table->use_all_columns();
thd_proc_info(&thd, "upgrading lock");
- if (thr_upgrade_write_delay_lock(*thd.lock->locks))
+ if (thr_upgrade_write_delay_lock(*thd.lock->locks, delayed_lock))
{
/*
This can happen if thread is killed either by a shutdown
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 983d53a041d..9619d26893c 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2002,7 +2002,7 @@ void st_select_lex::print_limit(THD *thd,
item->substype() == Item_subselect::ALL_SUBS))
{
DBUG_ASSERT(!item->fixed ||
- select_limit->val_int() == LL(1) && offset_limit == 0);
+ (select_limit->val_int() == LL(1) && offset_limit == 0));
return;
}
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 24731b600e9..ed6b9e7d8df 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -190,6 +190,15 @@ typedef struct st_lex_server_options
char *server_name, *host, *db, *username, *password, *scheme, *socket, *owner;
} LEX_SERVER_OPTIONS;
+
+/**
+ Structure to hold parameters for CHANGE MASTER or START/STOP SLAVE
+ or SHOW NEW MASTER.
+
+ Remark: this should not be confused with Master_info (and perhaps
+ would better be renamed to st_lex_replication_info). Some fields,
+ e.g., delay, are saved in Relay_log_info, not in Master_info.
+*/
typedef struct st_lex_master_info
{
char *host, *user, *password, *log_file_name;
diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc
index 4e61c664106..3def9864c29 100644
--- a/sql/sql_locale.cc
+++ b/sql/sql_locale.cc
@@ -49,7 +49,9 @@ MY_LOCALE my_locale_ar_AE
&my_locale_typelib_month_names_ar_AE,
&my_locale_typelib_ab_month_names_ar_AE,
&my_locale_typelib_day_names_ar_AE,
- &my_locale_typelib_ab_day_names_ar_AE
+ &my_locale_typelib_ab_day_names_ar_AE,
+ 6,
+ 8
);
/***** LOCALE END ar_AE *****/
@@ -79,7 +81,9 @@ MY_LOCALE my_locale_ar_BH
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_BH *****/
@@ -109,7 +113,9 @@ MY_LOCALE my_locale_ar_JO
&my_locale_typelib_month_names_ar_JO,
&my_locale_typelib_ab_month_names_ar_JO,
&my_locale_typelib_day_names_ar_JO,
- &my_locale_typelib_ab_day_names_ar_JO
+ &my_locale_typelib_ab_day_names_ar_JO,
+ 12,
+ 8
);
/***** LOCALE END ar_JO *****/
@@ -139,7 +145,9 @@ MY_LOCALE my_locale_ar_SA
&my_locale_typelib_month_names_ar_SA,
&my_locale_typelib_ab_month_names_ar_SA,
&my_locale_typelib_day_names_ar_SA,
- &my_locale_typelib_ab_day_names_ar_SA
+ &my_locale_typelib_ab_day_names_ar_SA,
+ 12,
+ 8
);
/***** LOCALE END ar_SA *****/
@@ -169,7 +177,9 @@ MY_LOCALE my_locale_ar_SY
&my_locale_typelib_month_names_ar_SY,
&my_locale_typelib_ab_month_names_ar_SY,
&my_locale_typelib_day_names_ar_SY,
- &my_locale_typelib_ab_day_names_ar_SY
+ &my_locale_typelib_ab_day_names_ar_SY,
+ 12,
+ 8
);
/***** LOCALE END ar_SY *****/
@@ -199,7 +209,9 @@ MY_LOCALE my_locale_be_BY
&my_locale_typelib_month_names_be_BY,
&my_locale_typelib_ab_month_names_be_BY,
&my_locale_typelib_day_names_be_BY,
- &my_locale_typelib_ab_day_names_be_BY
+ &my_locale_typelib_ab_day_names_be_BY,
+ 10,
+ 10
);
/***** LOCALE END be_BY *****/
@@ -229,7 +241,9 @@ MY_LOCALE my_locale_bg_BG
&my_locale_typelib_month_names_bg_BG,
&my_locale_typelib_ab_month_names_bg_BG,
&my_locale_typelib_day_names_bg_BG,
- &my_locale_typelib_ab_day_names_bg_BG
+ &my_locale_typelib_ab_day_names_bg_BG,
+ 9,
+ 10
);
/***** LOCALE END bg_BG *****/
@@ -259,7 +273,9 @@ MY_LOCALE my_locale_ca_ES
&my_locale_typelib_month_names_ca_ES,
&my_locale_typelib_ab_month_names_ca_ES,
&my_locale_typelib_day_names_ca_ES,
- &my_locale_typelib_ab_day_names_ca_ES
+ &my_locale_typelib_ab_day_names_ca_ES,
+ 8,
+ 9
);
/***** LOCALE END ca_ES *****/
@@ -289,7 +305,9 @@ MY_LOCALE my_locale_cs_CZ
&my_locale_typelib_month_names_cs_CZ,
&my_locale_typelib_ab_month_names_cs_CZ,
&my_locale_typelib_day_names_cs_CZ,
- &my_locale_typelib_ab_day_names_cs_CZ
+ &my_locale_typelib_ab_day_names_cs_CZ,
+ 8,
+ 7
);
/***** LOCALE END cs_CZ *****/
@@ -319,7 +337,9 @@ MY_LOCALE my_locale_da_DK
&my_locale_typelib_month_names_da_DK,
&my_locale_typelib_ab_month_names_da_DK,
&my_locale_typelib_day_names_da_DK,
- &my_locale_typelib_ab_day_names_da_DK
+ &my_locale_typelib_ab_day_names_da_DK,
+ 9,
+ 7
);
/***** LOCALE END da_DK *****/
@@ -349,7 +369,9 @@ MY_LOCALE my_locale_de_AT
&my_locale_typelib_month_names_de_AT,
&my_locale_typelib_ab_month_names_de_AT,
&my_locale_typelib_day_names_de_AT,
- &my_locale_typelib_ab_day_names_de_AT
+ &my_locale_typelib_ab_day_names_de_AT,
+ 9,
+ 10
);
/***** LOCALE END de_AT *****/
@@ -379,7 +401,9 @@ MY_LOCALE my_locale_de_DE
&my_locale_typelib_month_names_de_DE,
&my_locale_typelib_ab_month_names_de_DE,
&my_locale_typelib_day_names_de_DE,
- &my_locale_typelib_ab_day_names_de_DE
+ &my_locale_typelib_ab_day_names_de_DE,
+ 9,
+ 10
);
/***** LOCALE END de_DE *****/
@@ -409,7 +433,9 @@ MY_LOCALE my_locale_en_US
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_US *****/
@@ -439,7 +465,9 @@ MY_LOCALE my_locale_es_ES
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_ES *****/
@@ -469,7 +497,9 @@ MY_LOCALE my_locale_et_EE
&my_locale_typelib_month_names_et_EE,
&my_locale_typelib_ab_month_names_et_EE,
&my_locale_typelib_day_names_et_EE,
- &my_locale_typelib_ab_day_names_et_EE
+ &my_locale_typelib_ab_day_names_et_EE,
+ 9,
+ 9
);
/***** LOCALE END et_EE *****/
@@ -499,7 +529,9 @@ MY_LOCALE my_locale_eu_ES
&my_locale_typelib_month_names_eu_ES,
&my_locale_typelib_ab_month_names_eu_ES,
&my_locale_typelib_day_names_eu_ES,
- &my_locale_typelib_ab_day_names_eu_ES
+ &my_locale_typelib_ab_day_names_eu_ES,
+ 9,
+ 10
);
/***** LOCALE END eu_ES *****/
@@ -529,7 +561,9 @@ MY_LOCALE my_locale_fi_FI
&my_locale_typelib_month_names_fi_FI,
&my_locale_typelib_ab_month_names_fi_FI,
&my_locale_typelib_day_names_fi_FI,
- &my_locale_typelib_ab_day_names_fi_FI
+ &my_locale_typelib_ab_day_names_fi_FI,
+ 9,
+ 11
);
/***** LOCALE END fi_FI *****/
@@ -559,7 +593,9 @@ MY_LOCALE my_locale_fo_FO
&my_locale_typelib_month_names_fo_FO,
&my_locale_typelib_ab_month_names_fo_FO,
&my_locale_typelib_day_names_fo_FO,
- &my_locale_typelib_ab_day_names_fo_FO
+ &my_locale_typelib_ab_day_names_fo_FO,
+ 9,
+ 12
);
/***** LOCALE END fo_FO *****/
@@ -589,7 +625,9 @@ MY_LOCALE my_locale_fr_FR
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_FR *****/
@@ -619,7 +657,9 @@ MY_LOCALE my_locale_gl_ES
&my_locale_typelib_month_names_gl_ES,
&my_locale_typelib_ab_month_names_gl_ES,
&my_locale_typelib_day_names_gl_ES,
- &my_locale_typelib_ab_day_names_gl_ES
+ &my_locale_typelib_ab_day_names_gl_ES,
+ 8,
+ 8
);
/***** LOCALE END gl_ES *****/
@@ -649,7 +689,9 @@ MY_LOCALE my_locale_gu_IN
&my_locale_typelib_month_names_gu_IN,
&my_locale_typelib_ab_month_names_gu_IN,
&my_locale_typelib_day_names_gu_IN,
- &my_locale_typelib_ab_day_names_gu_IN
+ &my_locale_typelib_ab_day_names_gu_IN,
+ 10,
+ 8
);
/***** LOCALE END gu_IN *****/
@@ -679,7 +721,9 @@ MY_LOCALE my_locale_he_IL
&my_locale_typelib_month_names_he_IL,
&my_locale_typelib_ab_month_names_he_IL,
&my_locale_typelib_day_names_he_IL,
- &my_locale_typelib_ab_day_names_he_IL
+ &my_locale_typelib_ab_day_names_he_IL,
+ 7,
+ 5
);
/***** LOCALE END he_IL *****/
@@ -709,7 +753,9 @@ MY_LOCALE my_locale_hi_IN
&my_locale_typelib_month_names_hi_IN,
&my_locale_typelib_ab_month_names_hi_IN,
&my_locale_typelib_day_names_hi_IN,
- &my_locale_typelib_ab_day_names_hi_IN
+ &my_locale_typelib_ab_day_names_hi_IN,
+ 7,
+ 9
);
/***** LOCALE END hi_IN *****/
@@ -739,7 +785,9 @@ MY_LOCALE my_locale_hr_HR
&my_locale_typelib_month_names_hr_HR,
&my_locale_typelib_ab_month_names_hr_HR,
&my_locale_typelib_day_names_hr_HR,
- &my_locale_typelib_ab_day_names_hr_HR
+ &my_locale_typelib_ab_day_names_hr_HR,
+ 8,
+ 11
);
/***** LOCALE END hr_HR *****/
@@ -769,7 +817,9 @@ MY_LOCALE my_locale_hu_HU
&my_locale_typelib_month_names_hu_HU,
&my_locale_typelib_ab_month_names_hu_HU,
&my_locale_typelib_day_names_hu_HU,
- &my_locale_typelib_ab_day_names_hu_HU
+ &my_locale_typelib_ab_day_names_hu_HU,
+ 10,
+ 9
);
/***** LOCALE END hu_HU *****/
@@ -799,7 +849,9 @@ MY_LOCALE my_locale_id_ID
&my_locale_typelib_month_names_id_ID,
&my_locale_typelib_ab_month_names_id_ID,
&my_locale_typelib_day_names_id_ID,
- &my_locale_typelib_ab_day_names_id_ID
+ &my_locale_typelib_ab_day_names_id_ID,
+ 9,
+ 6
);
/***** LOCALE END id_ID *****/
@@ -829,7 +881,9 @@ MY_LOCALE my_locale_is_IS
&my_locale_typelib_month_names_is_IS,
&my_locale_typelib_ab_month_names_is_IS,
&my_locale_typelib_day_names_is_IS,
- &my_locale_typelib_ab_day_names_is_IS
+ &my_locale_typelib_ab_day_names_is_IS,
+ 9,
+ 12
);
/***** LOCALE END is_IS *****/
@@ -859,7 +913,9 @@ MY_LOCALE my_locale_it_CH
&my_locale_typelib_month_names_it_CH,
&my_locale_typelib_ab_month_names_it_CH,
&my_locale_typelib_day_names_it_CH,
- &my_locale_typelib_ab_day_names_it_CH
+ &my_locale_typelib_ab_day_names_it_CH,
+ 9,
+ 9
);
/***** LOCALE END it_CH *****/
@@ -889,7 +945,9 @@ MY_LOCALE my_locale_ja_JP
&my_locale_typelib_month_names_ja_JP,
&my_locale_typelib_ab_month_names_ja_JP,
&my_locale_typelib_day_names_ja_JP,
- &my_locale_typelib_ab_day_names_ja_JP
+ &my_locale_typelib_ab_day_names_ja_JP,
+ 3,
+ 3
);
/***** LOCALE END ja_JP *****/
@@ -919,7 +977,9 @@ MY_LOCALE my_locale_ko_KR
&my_locale_typelib_month_names_ko_KR,
&my_locale_typelib_ab_month_names_ko_KR,
&my_locale_typelib_day_names_ko_KR,
- &my_locale_typelib_ab_day_names_ko_KR
+ &my_locale_typelib_ab_day_names_ko_KR,
+ 3,
+ 3
);
/***** LOCALE END ko_KR *****/
@@ -949,7 +1009,9 @@ MY_LOCALE my_locale_lt_LT
&my_locale_typelib_month_names_lt_LT,
&my_locale_typelib_ab_month_names_lt_LT,
&my_locale_typelib_day_names_lt_LT,
- &my_locale_typelib_ab_day_names_lt_LT
+ &my_locale_typelib_ab_day_names_lt_LT,
+ 9,
+ 14
);
/***** LOCALE END lt_LT *****/
@@ -979,7 +1041,9 @@ MY_LOCALE my_locale_lv_LV
&my_locale_typelib_month_names_lv_LV,
&my_locale_typelib_ab_month_names_lv_LV,
&my_locale_typelib_day_names_lv_LV,
- &my_locale_typelib_ab_day_names_lv_LV
+ &my_locale_typelib_ab_day_names_lv_LV,
+ 10,
+ 11
);
/***** LOCALE END lv_LV *****/
@@ -1009,7 +1073,9 @@ MY_LOCALE my_locale_mk_MK
&my_locale_typelib_month_names_mk_MK,
&my_locale_typelib_ab_month_names_mk_MK,
&my_locale_typelib_day_names_mk_MK,
- &my_locale_typelib_ab_day_names_mk_MK
+ &my_locale_typelib_ab_day_names_mk_MK,
+ 9,
+ 10
);
/***** LOCALE END mk_MK *****/
@@ -1039,7 +1105,9 @@ MY_LOCALE my_locale_mn_MN
&my_locale_typelib_month_names_mn_MN,
&my_locale_typelib_ab_month_names_mn_MN,
&my_locale_typelib_day_names_mn_MN,
- &my_locale_typelib_ab_day_names_mn_MN
+ &my_locale_typelib_ab_day_names_mn_MN,
+ 18,
+ 6
);
/***** LOCALE END mn_MN *****/
@@ -1069,7 +1137,9 @@ MY_LOCALE my_locale_ms_MY
&my_locale_typelib_month_names_ms_MY,
&my_locale_typelib_ab_month_names_ms_MY,
&my_locale_typelib_day_names_ms_MY,
- &my_locale_typelib_ab_day_names_ms_MY
+ &my_locale_typelib_ab_day_names_ms_MY,
+ 9,
+ 6
);
/***** LOCALE END ms_MY *****/
@@ -1099,7 +1169,9 @@ MY_LOCALE my_locale_nb_NO
&my_locale_typelib_month_names_nb_NO,
&my_locale_typelib_ab_month_names_nb_NO,
&my_locale_typelib_day_names_nb_NO,
- &my_locale_typelib_ab_day_names_nb_NO
+ &my_locale_typelib_ab_day_names_nb_NO,
+ 9,
+ 7
);
/***** LOCALE END nb_NO *****/
@@ -1129,7 +1201,9 @@ MY_LOCALE my_locale_nl_NL
&my_locale_typelib_month_names_nl_NL,
&my_locale_typelib_ab_month_names_nl_NL,
&my_locale_typelib_day_names_nl_NL,
- &my_locale_typelib_ab_day_names_nl_NL
+ &my_locale_typelib_ab_day_names_nl_NL,
+ 9,
+ 9
);
/***** LOCALE END nl_NL *****/
@@ -1159,7 +1233,9 @@ MY_LOCALE my_locale_pl_PL
&my_locale_typelib_month_names_pl_PL,
&my_locale_typelib_ab_month_names_pl_PL,
&my_locale_typelib_day_names_pl_PL,
- &my_locale_typelib_ab_day_names_pl_PL
+ &my_locale_typelib_ab_day_names_pl_PL,
+ 11,
+ 12
);
/***** LOCALE END pl_PL *****/
@@ -1189,7 +1265,9 @@ MY_LOCALE my_locale_pt_BR
&my_locale_typelib_month_names_pt_BR,
&my_locale_typelib_ab_month_names_pt_BR,
&my_locale_typelib_day_names_pt_BR,
- &my_locale_typelib_ab_day_names_pt_BR
+ &my_locale_typelib_ab_day_names_pt_BR,
+ 9,
+ 7
);
/***** LOCALE END pt_BR *****/
@@ -1219,7 +1297,9 @@ MY_LOCALE my_locale_pt_PT
&my_locale_typelib_month_names_pt_PT,
&my_locale_typelib_ab_month_names_pt_PT,
&my_locale_typelib_day_names_pt_PT,
- &my_locale_typelib_ab_day_names_pt_PT
+ &my_locale_typelib_ab_day_names_pt_PT,
+ 9,
+ 7
);
/***** LOCALE END pt_PT *****/
@@ -1249,7 +1329,9 @@ MY_LOCALE my_locale_ro_RO
&my_locale_typelib_month_names_ro_RO,
&my_locale_typelib_ab_month_names_ro_RO,
&my_locale_typelib_day_names_ro_RO,
- &my_locale_typelib_ab_day_names_ro_RO
+ &my_locale_typelib_ab_day_names_ro_RO,
+ 10,
+ 8
);
/***** LOCALE END ro_RO *****/
@@ -1279,7 +1361,9 @@ MY_LOCALE my_locale_ru_RU
&my_locale_typelib_month_names_ru_RU,
&my_locale_typelib_ab_month_names_ru_RU,
&my_locale_typelib_day_names_ru_RU,
- &my_locale_typelib_ab_day_names_ru_RU
+ &my_locale_typelib_ab_day_names_ru_RU,
+ 8,
+ 11
);
/***** LOCALE END ru_RU *****/
@@ -1309,7 +1393,9 @@ MY_LOCALE my_locale_ru_UA
&my_locale_typelib_month_names_ru_UA,
&my_locale_typelib_ab_month_names_ru_UA,
&my_locale_typelib_day_names_ru_UA,
- &my_locale_typelib_ab_day_names_ru_UA
+ &my_locale_typelib_ab_day_names_ru_UA,
+ 8,
+ 11
);
/***** LOCALE END ru_UA *****/
@@ -1339,7 +1425,9 @@ MY_LOCALE my_locale_sk_SK
&my_locale_typelib_month_names_sk_SK,
&my_locale_typelib_ab_month_names_sk_SK,
&my_locale_typelib_day_names_sk_SK,
- &my_locale_typelib_ab_day_names_sk_SK
+ &my_locale_typelib_ab_day_names_sk_SK,
+ 9,
+ 8
);
/***** LOCALE END sk_SK *****/
@@ -1369,7 +1457,9 @@ MY_LOCALE my_locale_sl_SI
&my_locale_typelib_month_names_sl_SI,
&my_locale_typelib_ab_month_names_sl_SI,
&my_locale_typelib_day_names_sl_SI,
- &my_locale_typelib_ab_day_names_sl_SI
+ &my_locale_typelib_ab_day_names_sl_SI,
+ 9,
+ 10
);
/***** LOCALE END sl_SI *****/
@@ -1399,7 +1489,9 @@ MY_LOCALE my_locale_sq_AL
&my_locale_typelib_month_names_sq_AL,
&my_locale_typelib_ab_month_names_sq_AL,
&my_locale_typelib_day_names_sq_AL,
- &my_locale_typelib_ab_day_names_sq_AL
+ &my_locale_typelib_ab_day_names_sq_AL,
+ 7,
+ 10
);
/***** LOCALE END sq_AL *****/
@@ -1429,7 +1521,9 @@ MY_LOCALE my_locale_sr_YU
&my_locale_typelib_month_names_sr_YU,
&my_locale_typelib_ab_month_names_sr_YU,
&my_locale_typelib_day_names_sr_YU,
- &my_locale_typelib_ab_day_names_sr_YU
+ &my_locale_typelib_ab_day_names_sr_YU,
+ 9,
+ 10
);
/***** LOCALE END sr_YU *****/
@@ -1459,7 +1553,9 @@ MY_LOCALE my_locale_sv_SE
&my_locale_typelib_month_names_sv_SE,
&my_locale_typelib_ab_month_names_sv_SE,
&my_locale_typelib_day_names_sv_SE,
- &my_locale_typelib_ab_day_names_sv_SE
+ &my_locale_typelib_ab_day_names_sv_SE,
+ 9,
+ 7
);
/***** LOCALE END sv_SE *****/
@@ -1489,7 +1585,9 @@ MY_LOCALE my_locale_ta_IN
&my_locale_typelib_month_names_ta_IN,
&my_locale_typelib_ab_month_names_ta_IN,
&my_locale_typelib_day_names_ta_IN,
- &my_locale_typelib_ab_day_names_ta_IN
+ &my_locale_typelib_ab_day_names_ta_IN,
+ 10,
+ 8
);
/***** LOCALE END ta_IN *****/
@@ -1519,7 +1617,9 @@ MY_LOCALE my_locale_te_IN
&my_locale_typelib_month_names_te_IN,
&my_locale_typelib_ab_month_names_te_IN,
&my_locale_typelib_day_names_te_IN,
- &my_locale_typelib_ab_day_names_te_IN
+ &my_locale_typelib_ab_day_names_te_IN,
+ 10,
+ 9
);
/***** LOCALE END te_IN *****/
@@ -1549,7 +1649,9 @@ MY_LOCALE my_locale_th_TH
&my_locale_typelib_month_names_th_TH,
&my_locale_typelib_ab_month_names_th_TH,
&my_locale_typelib_day_names_th_TH,
- &my_locale_typelib_ab_day_names_th_TH
+ &my_locale_typelib_ab_day_names_th_TH,
+ 10,
+ 8
);
/***** LOCALE END th_TH *****/
@@ -1579,7 +1681,9 @@ MY_LOCALE my_locale_tr_TR
&my_locale_typelib_month_names_tr_TR,
&my_locale_typelib_ab_month_names_tr_TR,
&my_locale_typelib_day_names_tr_TR,
- &my_locale_typelib_ab_day_names_tr_TR
+ &my_locale_typelib_ab_day_names_tr_TR,
+ 7,
+ 9
);
/***** LOCALE END tr_TR *****/
@@ -1609,7 +1713,9 @@ MY_LOCALE my_locale_uk_UA
&my_locale_typelib_month_names_uk_UA,
&my_locale_typelib_ab_month_names_uk_UA,
&my_locale_typelib_day_names_uk_UA,
- &my_locale_typelib_ab_day_names_uk_UA
+ &my_locale_typelib_ab_day_names_uk_UA,
+ 8,
+ 9
);
/***** LOCALE END uk_UA *****/
@@ -1639,7 +1745,9 @@ MY_LOCALE my_locale_ur_PK
&my_locale_typelib_month_names_ur_PK,
&my_locale_typelib_ab_month_names_ur_PK,
&my_locale_typelib_day_names_ur_PK,
- &my_locale_typelib_ab_day_names_ur_PK
+ &my_locale_typelib_ab_day_names_ur_PK,
+ 6,
+ 6
);
/***** LOCALE END ur_PK *****/
@@ -1669,7 +1777,9 @@ MY_LOCALE my_locale_vi_VN
&my_locale_typelib_month_names_vi_VN,
&my_locale_typelib_ab_month_names_vi_VN,
&my_locale_typelib_day_names_vi_VN,
- &my_locale_typelib_ab_day_names_vi_VN
+ &my_locale_typelib_ab_day_names_vi_VN,
+ 16,
+ 11
);
/***** LOCALE END vi_VN *****/
@@ -1699,7 +1809,9 @@ MY_LOCALE my_locale_zh_CN
&my_locale_typelib_month_names_zh_CN,
&my_locale_typelib_ab_month_names_zh_CN,
&my_locale_typelib_day_names_zh_CN,
- &my_locale_typelib_ab_day_names_zh_CN
+ &my_locale_typelib_ab_day_names_zh_CN,
+ 3,
+ 3
);
/***** LOCALE END zh_CN *****/
@@ -1729,7 +1841,9 @@ MY_LOCALE my_locale_zh_TW
&my_locale_typelib_month_names_zh_TW,
&my_locale_typelib_ab_month_names_zh_TW,
&my_locale_typelib_day_names_zh_TW,
- &my_locale_typelib_ab_day_names_zh_TW
+ &my_locale_typelib_ab_day_names_zh_TW,
+ 3,
+ 2
);
/***** LOCALE END zh_TW *****/
@@ -1743,7 +1857,9 @@ MY_LOCALE my_locale_ar_DZ
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_DZ *****/
@@ -1757,7 +1873,9 @@ MY_LOCALE my_locale_ar_EG
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_EG *****/
@@ -1771,7 +1889,9 @@ MY_LOCALE my_locale_ar_IN
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_IN *****/
@@ -1785,7 +1905,9 @@ MY_LOCALE my_locale_ar_IQ
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_IQ *****/
@@ -1799,7 +1921,9 @@ MY_LOCALE my_locale_ar_KW
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_KW *****/
@@ -1813,7 +1937,9 @@ MY_LOCALE my_locale_ar_LB
&my_locale_typelib_month_names_ar_JO,
&my_locale_typelib_ab_month_names_ar_JO,
&my_locale_typelib_day_names_ar_JO,
- &my_locale_typelib_ab_day_names_ar_JO
+ &my_locale_typelib_ab_day_names_ar_JO,
+ 12,
+ 8
);
/***** LOCALE END ar_LB *****/
@@ -1827,7 +1953,9 @@ MY_LOCALE my_locale_ar_LY
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_LY *****/
@@ -1841,7 +1969,9 @@ MY_LOCALE my_locale_ar_MA
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_MA *****/
@@ -1855,7 +1985,9 @@ MY_LOCALE my_locale_ar_OM
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_OM *****/
@@ -1869,7 +2001,9 @@ MY_LOCALE my_locale_ar_QA
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_QA *****/
@@ -1883,7 +2017,9 @@ MY_LOCALE my_locale_ar_SD
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_SD *****/
@@ -1897,7 +2033,9 @@ MY_LOCALE my_locale_ar_TN
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_TN *****/
@@ -1911,7 +2049,9 @@ MY_LOCALE my_locale_ar_YE
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_YE *****/
@@ -1925,7 +2065,9 @@ MY_LOCALE my_locale_de_BE
&my_locale_typelib_month_names_de_DE,
&my_locale_typelib_ab_month_names_de_DE,
&my_locale_typelib_day_names_de_DE,
- &my_locale_typelib_ab_day_names_de_DE
+ &my_locale_typelib_ab_day_names_de_DE,
+ 9,
+ 10
);
/***** LOCALE END de_BE *****/
@@ -1939,7 +2081,9 @@ MY_LOCALE my_locale_de_CH
&my_locale_typelib_month_names_de_DE,
&my_locale_typelib_ab_month_names_de_DE,
&my_locale_typelib_day_names_de_DE,
- &my_locale_typelib_ab_day_names_de_DE
+ &my_locale_typelib_ab_day_names_de_DE,
+ 9,
+ 10
);
/***** LOCALE END de_CH *****/
@@ -1953,7 +2097,9 @@ MY_LOCALE my_locale_de_LU
&my_locale_typelib_month_names_de_DE,
&my_locale_typelib_ab_month_names_de_DE,
&my_locale_typelib_day_names_de_DE,
- &my_locale_typelib_ab_day_names_de_DE
+ &my_locale_typelib_ab_day_names_de_DE,
+ 9,
+ 10
);
/***** LOCALE END de_LU *****/
@@ -1967,7 +2113,9 @@ MY_LOCALE my_locale_en_AU
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_AU *****/
@@ -1981,7 +2129,9 @@ MY_LOCALE my_locale_en_CA
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_CA *****/
@@ -1995,7 +2145,9 @@ MY_LOCALE my_locale_en_GB
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_GB *****/
@@ -2009,7 +2161,9 @@ MY_LOCALE my_locale_en_IN
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_IN *****/
@@ -2023,7 +2177,9 @@ MY_LOCALE my_locale_en_NZ
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_NZ *****/
@@ -2037,7 +2193,9 @@ MY_LOCALE my_locale_en_PH
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_PH *****/
@@ -2051,7 +2209,9 @@ MY_LOCALE my_locale_en_ZA
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_ZA *****/
@@ -2065,7 +2225,9 @@ MY_LOCALE my_locale_en_ZW
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_ZW *****/
@@ -2079,7 +2241,9 @@ MY_LOCALE my_locale_es_AR
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_AR *****/
@@ -2093,7 +2257,9 @@ MY_LOCALE my_locale_es_BO
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_BO *****/
@@ -2107,7 +2273,9 @@ MY_LOCALE my_locale_es_CL
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_CL *****/
@@ -2121,7 +2289,9 @@ MY_LOCALE my_locale_es_CO
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_CO *****/
@@ -2135,7 +2305,9 @@ MY_LOCALE my_locale_es_CR
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_CR *****/
@@ -2149,7 +2321,9 @@ MY_LOCALE my_locale_es_DO
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_DO *****/
@@ -2163,7 +2337,9 @@ MY_LOCALE my_locale_es_EC
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_EC *****/
@@ -2177,7 +2353,9 @@ MY_LOCALE my_locale_es_GT
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_GT *****/
@@ -2191,7 +2369,9 @@ MY_LOCALE my_locale_es_HN
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_HN *****/
@@ -2205,7 +2385,9 @@ MY_LOCALE my_locale_es_MX
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_MX *****/
@@ -2219,7 +2401,9 @@ MY_LOCALE my_locale_es_NI
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_NI *****/
@@ -2233,7 +2417,9 @@ MY_LOCALE my_locale_es_PA
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_PA *****/
@@ -2247,7 +2433,9 @@ MY_LOCALE my_locale_es_PE
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_PE *****/
@@ -2261,7 +2449,9 @@ MY_LOCALE my_locale_es_PR
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_PR *****/
@@ -2275,7 +2465,9 @@ MY_LOCALE my_locale_es_PY
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_PY *****/
@@ -2289,7 +2481,9 @@ MY_LOCALE my_locale_es_SV
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_SV *****/
@@ -2303,7 +2497,9 @@ MY_LOCALE my_locale_es_US
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_US *****/
@@ -2317,7 +2513,9 @@ MY_LOCALE my_locale_es_UY
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_UY *****/
@@ -2331,7 +2529,9 @@ MY_LOCALE my_locale_es_VE
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_VE *****/
@@ -2345,7 +2545,9 @@ MY_LOCALE my_locale_fr_BE
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_BE *****/
@@ -2359,7 +2561,9 @@ MY_LOCALE my_locale_fr_CA
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_CA *****/
@@ -2373,7 +2577,9 @@ MY_LOCALE my_locale_fr_CH
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_CH *****/
@@ -2387,7 +2593,9 @@ MY_LOCALE my_locale_fr_LU
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_LU *****/
@@ -2401,7 +2609,9 @@ MY_LOCALE my_locale_it_IT
&my_locale_typelib_month_names_it_CH,
&my_locale_typelib_ab_month_names_it_CH,
&my_locale_typelib_day_names_it_CH,
- &my_locale_typelib_ab_day_names_it_CH
+ &my_locale_typelib_ab_day_names_it_CH,
+ 9,
+ 9
);
/***** LOCALE END it_IT *****/
@@ -2415,7 +2625,9 @@ MY_LOCALE my_locale_nl_BE
&my_locale_typelib_month_names_nl_NL,
&my_locale_typelib_ab_month_names_nl_NL,
&my_locale_typelib_day_names_nl_NL,
- &my_locale_typelib_ab_day_names_nl_NL
+ &my_locale_typelib_ab_day_names_nl_NL,
+ 9,
+ 9
);
/***** LOCALE END nl_BE *****/
@@ -2429,7 +2641,9 @@ MY_LOCALE my_locale_no_NO
&my_locale_typelib_month_names_nb_NO,
&my_locale_typelib_ab_month_names_nb_NO,
&my_locale_typelib_day_names_nb_NO,
- &my_locale_typelib_ab_day_names_nb_NO
+ &my_locale_typelib_ab_day_names_nb_NO,
+ 9,
+ 7
);
/***** LOCALE END no_NO *****/
@@ -2443,7 +2657,9 @@ MY_LOCALE my_locale_sv_FI
&my_locale_typelib_month_names_sv_SE,
&my_locale_typelib_ab_month_names_sv_SE,
&my_locale_typelib_day_names_sv_SE,
- &my_locale_typelib_ab_day_names_sv_SE
+ &my_locale_typelib_ab_day_names_sv_SE,
+ 9,
+ 7
);
/***** LOCALE END sv_FI *****/
@@ -2457,7 +2673,9 @@ MY_LOCALE my_locale_zh_HK
&my_locale_typelib_month_names_zh_CN,
&my_locale_typelib_ab_month_names_zh_CN,
&my_locale_typelib_day_names_zh_CN,
- &my_locale_typelib_ab_day_names_zh_CN
+ &my_locale_typelib_ab_day_names_zh_CN,
+ 3,
+ 3
);
/***** LOCALE END zh_HK *****/
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 50a55c3a587..68bb7d81e6b 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -976,8 +976,24 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->set_time();
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id= global_query_id;
- if (command != COM_STATISTICS && command != COM_PING)
+
+ switch( command ) {
+ /* Ignore these statements. */
+ case COM_STATISTICS:
+ case COM_PING:
+ break;
+ /* Only increase id on these statements but don't count them. */
+ case COM_STMT_PREPARE:
+ case COM_STMT_CLOSE:
+ case COM_STMT_RESET:
next_query_id();
+ break;
+ /* Increase id and count all other statements. */
+ default:
+ statistic_increment(thd->status_var.questions, &LOCK_status);
+ next_query_id();
+ }
+
thread_running++;
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
VOID(pthread_mutex_unlock(&LOCK_thread_count));
@@ -1248,6 +1264,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_length= length;
thd->query= beginning_of_next_stmt;
+ /*
+ Count each statement from the client.
+ */
+ statistic_increment(thd->status_var.questions, &LOCK_status);
thd->query_id= next_query_id();
thd->set_time(); /* Reset the query start time. */
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
@@ -5497,9 +5517,10 @@ bool check_stack_overrun(THD *thd, long margin,
if ((stack_used=used_stack(thd->thread_stack,(char*) &stack_used)) >=
(long) (my_thread_stack_size - margin))
{
- sprintf(errbuff[0],ER(ER_STACK_OVERRUN_NEED_MORE),
- stack_used,my_thread_stack_size,margin);
- my_message(ER_STACK_OVERRUN_NEED_MORE,errbuff[0],MYF(0));
+ char ebuff[MYSQL_ERRMSG_SIZE];
+ my_snprintf(ebuff, sizeof(ebuff), ER(ER_STACK_OVERRUN_NEED_MORE),
+ stack_used, my_thread_stack_size, margin);
+ my_message(ER_STACK_OVERRUN_NEED_MORE, ebuff, MYF(ME_FATALERROR));
thd->fatal_error();
return 1;
}
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 5ed64ea8fd5..ae55c194c3c 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 MySQL AB
+/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -4233,9 +4233,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
after the change as before. Thus we can reply ok immediately
without any changes at all.
*/
- DBUG_RETURN(fast_end_partition(thd, ULL(0), ULL(0),
- table, NULL,
- TRUE, NULL, FALSE));
+ *fast_alter_partition= TRUE;
+ DBUG_RETURN(FALSE);
}
else if (new_part_no > curr_part_no)
{
@@ -5304,8 +5303,8 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
DDL_LOG_ENTRY ddl_log_entry;
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
- char tmp_path[FN_LEN];
- char normal_path[FN_LEN];
+ char tmp_path[FN_REFLEN];
+ char normal_path[FN_REFLEN];
List_iterator<partition_element> part_it(part_info->partitions);
uint temp_partitions= part_info->temp_partitions.elements;
uint no_elements= part_info->partitions.elements;
@@ -5516,7 +5515,7 @@ static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= NULL;
- char shadow_path[FN_LEN];
+ char shadow_path[FN_REFLEN];
DBUG_ENTER("write_log_drop_shadow_frm");
build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
@@ -5559,8 +5558,8 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
- char path[FN_LEN];
- char shadow_path[FN_LEN];
+ char path[FN_REFLEN];
+ char shadow_path[FN_REFLEN];
DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
DBUG_ENTER("write_log_rename_frm");
@@ -5610,8 +5609,8 @@ static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
- char tmp_path[FN_LEN];
- char path[FN_LEN];
+ char tmp_path[FN_REFLEN];
+ char path[FN_REFLEN];
uint next_entry= 0;
DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
DBUG_ENTER("write_log_drop_partition");
@@ -5669,8 +5668,8 @@ static bool write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= NULL;
- char tmp_path[FN_LEN];
- char path[FN_LEN];
+ char tmp_path[FN_REFLEN];
+ char path[FN_REFLEN];
uint next_entry= 0;
DBUG_ENTER("write_log_add_change_partition");
@@ -5723,8 +5722,8 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
- char path[FN_LEN];
- char shadow_path[FN_LEN];
+ char path[FN_REFLEN];
+ char shadow_path[FN_REFLEN];
DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
uint next_entry= 0;
DBUG_ENTER("write_log_final_change_partition");
@@ -6679,6 +6678,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
uint32 max_endpoint_val;
get_endpoint_func get_endpoint;
uint field_len= field->pack_length_in_rec();
+ part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
if (part_info->part_type == RANGE_PARTITION)
{
@@ -6699,7 +6699,6 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
max_endpoint_val= part_info->no_list_values;
part_iter->get_next= get_next_partition_id_list;
part_iter->part_info= part_info;
- part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
if (max_endpoint_val == 0)
{
/*
@@ -6761,7 +6760,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
store_key_image_to_rec(field, max_value, field_len);
bool include_endp= !test(flags & NEAR_MAX);
part_iter->part_nums.end= get_endpoint(part_info, 0, include_endp);
- if (part_iter->part_nums.start == part_iter->part_nums.end &&
+ if (part_iter->part_nums.start >= part_iter->part_nums.end &&
!part_iter->ret_null_part)
return 0; /* No partitions */
}
@@ -6939,7 +6938,7 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
uint32 get_next_partition_id_range(PARTITION_ITERATOR* part_iter)
{
- if (part_iter->part_nums.cur == part_iter->part_nums.end)
+ if (part_iter->part_nums.cur >= part_iter->part_nums.end)
{
part_iter->part_nums.cur= part_iter->part_nums.start;
return NOT_A_PARTITION_ID;
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 13b2bfef24d..60f205ec8e8 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -751,21 +751,22 @@ static bool plugin_add(MEM_ROOT *tmp_root,
tmp.name.length= name_len;
tmp.ref_count= 0;
tmp.state= PLUGIN_IS_UNINITIALIZED;
- if (!test_plugin_options(tmp_root, &tmp, argc, argv, true))
+ if (test_plugin_options(tmp_root, &tmp, argc, argv, true))
+ tmp.state= PLUGIN_IS_DISABLED;
+
+ if ((tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
{
- if ((tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
+ plugin_array_version++;
+ if (!my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
{
- plugin_array_version++;
- if (!my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
- {
- init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
- DBUG_RETURN(FALSE);
- }
- tmp_plugin_ptr->state= PLUGIN_IS_FREED;
+ init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
+ DBUG_RETURN(FALSE);
}
- mysql_del_sys_var_chain(tmp.system_vars);
- goto err;
+ tmp_plugin_ptr->state= PLUGIN_IS_FREED;
}
+ mysql_del_sys_var_chain(tmp.system_vars);
+ goto err;
+
/* plugin was disabled */
plugin_dl_del(dl);
DBUG_RETURN(FALSE);
@@ -1137,6 +1138,9 @@ int plugin_init(int *argc, char **argv, int flags)
{
for (plugin= *builtins; plugin->info; plugin++)
{
+ if (opt_ignore_builtin_innodb &&
+ !my_strcasecmp(&my_charset_latin1, plugin->name, "InnoDB"))
+ continue;
/* by default, ndbcluster and federated are disabled */
def_enabled=
my_strcasecmp(&my_charset_latin1, plugin->name, "NDBCLUSTER") != 0 &&
@@ -1145,11 +1149,12 @@ int plugin_init(int *argc, char **argv, int flags)
tmp.plugin= plugin;
tmp.name.str= (char *)plugin->name;
tmp.name.length= strlen(plugin->name);
-
+ tmp.state= 0;
free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE));
if (test_plugin_options(&tmp_root, &tmp, argc, argv, def_enabled))
- continue;
-
+ tmp.state= PLUGIN_IS_DISABLED;
+ else
+ tmp.state= PLUGIN_IS_UNINITIALIZED;
if (register_builtin(plugin, &tmp, &plugin_ptr))
goto err_unlock;
@@ -1159,7 +1164,8 @@ int plugin_init(int *argc, char **argv, int flags)
my_strcasecmp(&my_charset_latin1, plugin->name, "CSV"))
continue;
- if (plugin_initialize(plugin_ptr))
+ if (plugin_ptr->state == PLUGIN_IS_UNINITIALIZED &&
+ plugin_initialize(plugin_ptr))
goto err_unlock;
/*
@@ -1246,8 +1252,6 @@ static bool register_builtin(struct st_mysql_plugin *plugin,
struct st_plugin_int **ptr)
{
DBUG_ENTER("register_builtin");
-
- tmp->state= PLUGIN_IS_UNINITIALIZED;
tmp->ref_count= 0;
tmp->plugin_dl= 0;
@@ -1296,7 +1300,7 @@ bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin)
if (test_plugin_options(thd->mem_root, &tmp, &dummy_argc, NULL, true))
goto end;
-
+ tmp.state= PLUGIN_IS_UNINITIALIZED;
if ((result= register_builtin(plugin, &tmp, &ptr)))
mysql_del_sys_var_chain(tmp.system_vars);
@@ -1555,7 +1559,8 @@ void plugin_shutdown(void)
We loop through all plugins and call deinit() if they have one.
*/
for (i= 0; i < count; i++)
- if (!(plugins[i]->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_FREED)))
+ if (!(plugins[i]->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_FREED |
+ PLUGIN_IS_DISABLED)))
{
sql_print_information("Plugin '%s' will be forced to shutdown",
plugins[i]->name.str);
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index e8f2cb6ee5e..8ae38d58845 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -54,6 +54,7 @@ typedef struct st_mysql_show_var SHOW_VAR;
#define PLUGIN_IS_UNINITIALIZED 4
#define PLUGIN_IS_READY 8
#define PLUGIN_IS_DYING 16
+#define PLUGIN_IS_DISABLED 32
/* A handle for the dynamic library containing a plugin or plugins. */
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index c62cf6401ba..cb5b3722559 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -552,8 +552,8 @@ int PROFILING::fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond)
The order of these fields is set by the query_profile_statistics_info
array.
*/
- table->field[0]->store((ulonglong) query->profiling_query_id);
- table->field[1]->store((ulonglong) seq); /* the step in the sequence */
+ table->field[0]->store((ulonglong) query->profiling_query_id, TRUE);
+ table->field[1]->store((ulonglong) seq, TRUE); /* the step in the sequence */
/*
This entry, n, has a point in time, T(n), and a status phrase, S(n).
The status phrase S(n) describes the period of time that begins at
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index eac7a50417a..81db5469891 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -63,7 +63,7 @@ static int fake_rotate_event(NET* net, String* packet, char* log_file_name,
ulong event_len = ident_len + LOG_EVENT_HEADER_LEN + ROTATE_HEADER_LEN;
int4store(header + SERVER_ID_OFFSET, server_id);
int4store(header + EVENT_LEN_OFFSET, event_len);
- int2store(header + FLAGS_OFFSET, 0);
+ int2store(header + FLAGS_OFFSET, LOG_EVENT_ARTIFICIAL_F);
// TODO: check what problems this may cause and fix them
int4store(header + LOG_POS_OFFSET, 0);
@@ -257,6 +257,17 @@ bool purge_error_message(THD* thd, int res)
}
+/**
+ Execute a PURGE BINARY LOGS TO <log> command.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param to_log Name of the last log to purge.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool purge_master_logs(THD* thd, const char* to_log)
{
char search_file_name[FN_REFLEN];
@@ -273,6 +284,17 @@ bool purge_master_logs(THD* thd, const char* to_log)
}
+/**
+ Execute a PURGE BINARY LOGS BEFORE <date> command.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param purge_time Date before which logs should be purged.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool purge_master_logs_before_date(THD* thd, time_t purge_time)
{
if (!mysql_bin_log.is_open())
@@ -765,6 +787,20 @@ err:
DBUG_VOID_RETURN;
}
+
+/**
+ Execute a START SLAVE statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param mi Pointer to Master_info object for the slave's IO thread.
+
+ @param net_report If true, saves the exit status into thd->main_da.
+
+ @retval 0 success
+ @retval 1 error
+*/
int start_slave(THD* thd , Master_info* mi, bool net_report)
{
int slave_errno= 0;
@@ -890,6 +926,19 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
}
+/**
+ Execute a STOP SLAVE statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param mi Pointer to Master_info object for the slave's IO thread.
+
+ @param net_report If true, saves the exit status into thd->main_da.
+
+ @retval 0 success
+ @retval 1 error
+*/
int stop_slave(THD* thd, Master_info* mi, bool net_report )
{
DBUG_ENTER("stop_slave");
@@ -942,20 +991,17 @@ int stop_slave(THD* thd, Master_info* mi, bool net_report )
}
-/*
- Remove all relay logs and start replication from the start
-
- SYNOPSIS
- reset_slave()
- thd Thread handler
- mi Master info for the slave
+/**
+ Execute a RESET SLAVE statement.
- RETURN
- 0 ok
- 1 error
-*/
+ @param thd Pointer to THD object of the client thread executing the
+ statement.
+ @param mi Pointer to Master_info object for the slave.
+ @retval 0 success
+ @retval 1 error
+*/
int reset_slave(THD *thd, Master_info* mi)
{
MY_STAT stat_area;
@@ -1070,6 +1116,18 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
}
+/**
+ Execute a CHANGE MASTER statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param mi Pointer to Master_info object belonging to the slave's IO
+ thread.
+
+ @retval FALSE success
+ @retval TRUE error
+*/
bool change_master(THD* thd, Master_info* mi)
{
int thread_mask;
@@ -1283,6 +1341,16 @@ bool change_master(THD* thd, Master_info* mi)
DBUG_RETURN(FALSE);
}
+
+/**
+ Execute a RESET MASTER statement.
+
+ @param thd Pointer to THD object of the client thread executing the
+ statement.
+
+ @retval 0 success
+ @retval 1 error
+*/
int reset_master(THD* thd)
{
if (!mysql_bin_log.is_open())
@@ -1312,6 +1380,15 @@ int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
}
+/**
+ Execute a SHOW BINLOG EVENTS statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool mysql_show_binlog_events(THD* thd)
{
Protocol *protocol= thd->protocol;
@@ -1462,6 +1539,15 @@ err:
}
+/**
+ Execute a SHOW MASTER STATUS statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool show_binlog_info(THD* thd)
{
Protocol *protocol= thd->protocol;
@@ -1495,18 +1581,15 @@ bool show_binlog_info(THD* thd)
}
-/*
- Send a list of all binary logs to client
+/**
+ Execute a SHOW BINARY LOGS statement.
- SYNOPSIS
- show_binlogs()
- thd Thread specific variable
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
- RETURN VALUES
- FALSE OK
- TRUE error
+ @retval FALSE success
+ @retval TRUE failure
*/
-
bool show_binlogs(THD* thd)
{
IO_CACHE *index_file;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 97fba012c08..9dd72ab55ba 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -88,7 +88,6 @@ static store_key *get_store_key(THD *thd,
KEYUSE *keyuse, table_map used_tables,
KEY_PART_INFO *key_part, uchar *key_buff,
uint maybe_null);
-static bool make_simple_join(JOIN *join,TABLE *tmp_table);
static void make_outerjoin_info(JOIN *join);
static bool make_join_select(JOIN *join,SQL_SELECT *select,COND *item);
static void make_join_readinfo(JOIN *join, ulonglong options);
@@ -110,7 +109,7 @@ static COND* substitute_for_best_equal_field(COND *cond,
void *table_join_idx);
static COND *simplify_joins(JOIN *join, List<TABLE_LIST> *join_list,
COND *conds, bool top);
-static bool check_interleaving_with_nj(JOIN_TAB *last, JOIN_TAB *next);
+static bool check_interleaving_with_nj(JOIN_TAB *next);
static void restore_prev_nj_state(JOIN_TAB *last);
static void reset_nj_counters(List<TABLE_LIST> *join_list);
static uint build_bitmap_for_nested_joins(List<TABLE_LIST> *join_list,
@@ -1670,14 +1669,22 @@ JOIN::exec()
(zero_result_cause?zero_result_cause:"No tables used"));
else
{
- result->send_fields(*columns_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
+ if (result->send_fields(*columns_list,
+ Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
+ {
+ DBUG_VOID_RETURN;
+ }
/*
We have to test for 'conds' here as the WHERE may not be constant
even if we don't have any tables for prepared statements or if
conds uses something like 'rand()'.
+ If the HAVING clause is either impossible or always true, then
+ JOIN::having is set to NULL by optimize_cond.
+ In this case JOIN::exec must check for JOIN::having_value, in the
+ same way it checks for JOIN::cond_value.
*/
if (cond_value != Item::COND_FALSE &&
+ having_value != Item::COND_FALSE &&
(!conds || conds->val_int()) &&
(!having || having->val_int()))
{
@@ -1874,7 +1881,7 @@ JOIN::exec()
/* Free first data from old join */
curr_join->join_free();
- if (make_simple_join(curr_join, curr_tmp_table))
+ if (curr_join->make_simple_join(this, curr_tmp_table))
DBUG_VOID_RETURN;
calc_group_buffer(curr_join, group_list);
count_field_types(select_lex, &curr_join->tmp_table_param,
@@ -1997,7 +2004,7 @@ JOIN::exec()
curr_join->select_distinct=0;
}
curr_tmp_table->reginfo.lock_type= TL_UNLOCK;
- if (make_simple_join(curr_join, curr_tmp_table))
+ if (curr_join->make_simple_join(this, curr_tmp_table))
DBUG_VOID_RETURN;
calc_group_buffer(curr_join, curr_join->group_list);
count_field_types(select_lex, &curr_join->tmp_table_param,
@@ -2587,7 +2594,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
if (s->dependent & table->map)
s->dependent |= table->reginfo.join_tab->dependent;
}
- if (s->dependent)
+ if (outer_join & s->table->map)
s->table->maybe_null= 1;
}
/* Catch illegal cross references for outer joins */
@@ -4889,6 +4896,18 @@ greedy_search(JOIN *join,
*/
join->positions[idx]= best_pos;
+ /*
+ Update the interleaving state after extending the current partial plan
+ with a new table.
+ We are doing this here because best_extension_by_limited_search reverts
+ the interleaving state to the one of the non-extended partial plan
+ on exit.
+ */
+ IF_DBUG(bool is_interleave_error= )
+ check_interleaving_with_nj (best_table);
+ /* This has been already checked by best_extension_by_limited_search */
+ DBUG_ASSERT(!is_interleave_error);
+
/* find the position of 'best_table' in 'join->best_ref' */
best_idx= idx;
JOIN_TAB *pos= join->best_ref[best_idx];
@@ -4906,7 +4925,7 @@ greedy_search(JOIN *join,
--size_remain;
++idx;
- DBUG_EXECUTE("opt", print_plan(join, join->tables,
+ DBUG_EXECUTE("opt", print_plan(join, idx,
record_count, read_time, read_time,
"extended"););
} while (TRUE);
@@ -5064,7 +5083,7 @@ best_extension_by_limited_search(JOIN *join,
table_map real_table_bit= s->table->map;
if ((remaining_tables & real_table_bit) &&
!(remaining_tables & s->dependent) &&
- (!idx || !check_interleaving_with_nj(join->positions[idx-1].table, s)))
+ (!idx || !check_interleaving_with_nj(s)))
{
double current_record_count, current_read_time;
@@ -5210,7 +5229,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
{
table_map real_table_bit=s->table->map;
if ((rest_tables & real_table_bit) && !(rest_tables & s->dependent) &&
- (!idx|| !check_interleaving_with_nj(join->positions[idx-1].table, s)))
+ (!idx|| !check_interleaving_with_nj(s)))
{
double records, best;
best_access_path(join, s, thd, rest_tables, idx, record_count,
@@ -5669,48 +5688,42 @@ store_val_in_field(Field *field, Item *item, enum_check_fields check_flag)
}
-static bool
-make_simple_join(JOIN *join,TABLE *tmp_table)
+/**
+ @details Initialize a JOIN as a query execution plan
+ that accesses a single table via a table scan.
+
+ @param parent contains JOIN_TAB and TABLE object buffers for this join
+ @param tmp_table temporary table
+
+ @retval FALSE success
+ @retval TRUE error occurred
+*/
+bool
+JOIN::make_simple_join(JOIN *parent, TABLE *tmp_table)
{
- TABLE **tableptr;
- JOIN_TAB *join_tab;
- DBUG_ENTER("make_simple_join");
+ DBUG_ENTER("JOIN::make_simple_join");
/*
Reuse TABLE * and JOIN_TAB if already allocated by a previous call
to this function through JOIN::exec (may happen for sub-queries).
*/
- if (!join->table_reexec)
- {
- if (!(join->table_reexec= (TABLE**) join->thd->alloc(sizeof(TABLE*))))
- DBUG_RETURN(TRUE); /* purecov: inspected */
- if (join->tmp_join)
- join->tmp_join->table_reexec= join->table_reexec;
- }
- if (!join->join_tab_reexec)
- {
- if (!(join->join_tab_reexec=
- (JOIN_TAB*) join->thd->alloc(sizeof(JOIN_TAB))))
- DBUG_RETURN(TRUE); /* purecov: inspected */
- if (join->tmp_join)
- join->tmp_join->join_tab_reexec= join->join_tab_reexec;
- }
- tableptr= join->table_reexec;
- join_tab= join->join_tab_reexec;
-
- join->join_tab=join_tab;
- join->table=tableptr; tableptr[0]=tmp_table;
- join->tables=1;
- join->const_tables=0;
- join->const_table_map=0;
- join->tmp_table_param.field_count= join->tmp_table_param.sum_func_count=
- join->tmp_table_param.func_count=0;
- join->tmp_table_param.copy_field=join->tmp_table_param.copy_field_end=0;
- join->first_record=join->sort_and_group=0;
- join->send_records=(ha_rows) 0;
- join->group=0;
- join->row_limit=join->unit->select_limit_cnt;
- join->do_send_rows = (join->row_limit) ? 1 : 0;
+ if (!parent->join_tab_reexec &&
+ !(parent->join_tab_reexec= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB))))
+ DBUG_RETURN(TRUE); /* purecov: inspected */
+
+ join_tab= parent->join_tab_reexec;
+ table= &parent->table_reexec[0]; parent->table_reexec[0]= tmp_table;
+ tables= 1;
+ const_tables= 0;
+ const_table_map= 0;
+ tmp_table_param.field_count= tmp_table_param.sum_func_count=
+ tmp_table_param.func_count= 0;
+ tmp_table_param.copy_field= tmp_table_param.copy_field_end=0;
+ first_record= sort_and_group=0;
+ send_records= (ha_rows) 0;
+ group= 0;
+ row_limit= unit->select_limit_cnt;
+ do_send_rows= row_limit ? 1 : 0;
join_tab->cache.buff=0; /* No caching */
join_tab->table=tmp_table;
@@ -5727,7 +5740,7 @@ make_simple_join(JOIN *join,TABLE *tmp_table)
join_tab->ref.key = -1;
join_tab->not_used_in_distinct=0;
join_tab->read_first_record= join_init_read_record;
- join_tab->join=join;
+ join_tab->join= this;
join_tab->ref.key_parts= 0;
bzero((char*) &join_tab->read_record,sizeof(join_tab->read_record));
tmp_table->status=0;
@@ -8790,9 +8803,6 @@ static void reset_nj_counters(List<TABLE_LIST> *join_list)
the partial join order.
@endverbatim
- @param join Join being processed
- @param last_tab Last table in current partial join order (this function is
- not called for empty partial join orders)
@param next_tab Table we're going to extend the current partial join with
@retval
@@ -8802,10 +8812,10 @@ static void reset_nj_counters(List<TABLE_LIST> *join_list)
TRUE Requested join order extension not allowed.
*/
-static bool check_interleaving_with_nj(JOIN_TAB *last_tab, JOIN_TAB *next_tab)
+static bool check_interleaving_with_nj(JOIN_TAB *next_tab)
{
TABLE_LIST *next_emb= next_tab->table->pos_in_table_list->embedding;
- JOIN *join= last_tab->join;
+ JOIN *join= next_tab->join;
if (join->cur_embedding_map & ~next_tab->embedding_map)
{
@@ -13866,6 +13876,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
length=0;
for (i=0 ; i < table_count ; i++)
{
+ bool have_bit_fields= FALSE;
uint null_fields=0,used_fields;
Field **f_ptr,*field;
MY_BITMAP *read_set= tables[i].table->read_set;
@@ -13880,13 +13891,16 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
length+=field->fill_cache_field(copy);
if (copy->blob_field)
(*blob_ptr++)=copy;
- if (field->maybe_null())
+ if (field->real_maybe_null())
null_fields++;
+ if (field->type() == MYSQL_TYPE_BIT &&
+ ((Field_bit*)field)->bit_len)
+ have_bit_fields= TRUE;
copy++;
}
}
/* Copy null bits from table */
- if (null_fields && tables[i].table->s->null_fields)
+ if (null_fields || have_bit_fields)
{ /* must copy null bits */
copy->str= tables[i].table->null_flags;
copy->length= tables[i].table->s->null_bytes;
diff --git a/sql/sql_select.h b/sql/sql_select.h
index be159c523e0..7d794b71f4d 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -285,7 +285,11 @@ public:
fetching data from a cursor
*/
bool resume_nested_loop;
- table_map const_table_map,found_const_table_map,outer_join;
+ table_map const_table_map,found_const_table_map;
+ /*
+ Bitmap of all inner tables from outer joins
+ */
+ table_map outer_join;
ha_rows send_records,found_records,examined_rows,row_limit, select_limit;
/**
Used to fetch no more than given amount of rows per one
@@ -398,9 +402,12 @@ public:
cleared only at the end of the execution of the whole query and not caching
allocations that occur in repetition at execution time will result in
excessive memory usage.
+ Note: make_simple_join always creates an execution plan that accesses
+ a single table, thus it is sufficient to have a one-element array for
+ table_reexec.
*/
SORT_FIELD *sortorder; // make_unireg_sortorder()
- TABLE **table_reexec; // make_simple_join()
+ TABLE *table_reexec[1]; // make_simple_join()
JOIN_TAB *join_tab_reexec; // make_simple_join()
/* end of allocation caching storage */
@@ -430,7 +437,7 @@ public:
exec_tmp_table1= 0;
exec_tmp_table2= 0;
sortorder= 0;
- table_reexec= 0;
+ table_reexec[0]= 0;
join_tab_reexec= 0;
thd= thd_arg;
sum_funcs= sum_funcs2= 0;
@@ -522,6 +529,8 @@ public:
return (unit == &thd->lex->unit && (unit->fake_select_lex == 0 ||
select_lex == unit->fake_select_lex));
}
+private:
+ bool make_simple_join(JOIN *join, TABLE *tmp_table);
};
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 28e8c028362..3c4dc103ddd 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -124,6 +124,9 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin,
case PLUGIN_IS_READY:
table->field[2]->store(STRING_WITH_LEN("ACTIVE"), cs);
break;
+ case PLUGIN_IS_DISABLED:
+ table->field[2]->store(STRING_WITH_LEN("DISABLED"), cs);
+ break;
default:
DBUG_ASSERT(0);
}
@@ -471,6 +474,7 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
if (wild && !wild[0])
wild=0;
+
bzero((char*) &table_list,sizeof(table_list));
if (!(dirp = my_dir(path,MYF(dir ? MY_WANT_STAT : 0))))
@@ -993,7 +997,7 @@ static bool get_field_default_value(THD *thd, TABLE *table,
{
bool has_default;
bool has_now_default;
-
+ enum enum_field_types field_type= field->type();
/*
We are using CURRENT_TIMESTAMP instead of NOW because it is
more standard
@@ -1001,7 +1005,7 @@ static bool get_field_default_value(THD *thd, TABLE *table,
has_now_default= table->timestamp_field == field &&
field->unireg_check != Field::TIMESTAMP_UN_FIELD;
- has_default= (field->type() != FIELD_TYPE_BLOB &&
+ has_default= (field_type != FIELD_TYPE_BLOB &&
!(field->flags & NO_DEFAULT_VALUE_FLAG) &&
field->unireg_check != Field::NEXT_NUMBER &&
!((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40))
@@ -1016,7 +1020,19 @@ static bool get_field_default_value(THD *thd, TABLE *table,
{ // Not null by default
char tmp[MAX_FIELD_WIDTH];
String type(tmp, sizeof(tmp), field->charset());
- field->val_str(&type);
+ if (field_type == MYSQL_TYPE_BIT)
+ {
+ longlong dec= field->val_int();
+ char *ptr= longlong2str(dec, tmp + 2, 2);
+ uint32 length= (uint32) (ptr - tmp);
+ tmp[0]= 'b';
+ tmp[1]= '\'';
+ tmp[length]= '\'';
+ type.length(length + 1);
+ quoted= 0;
+ }
+ else
+ field->val_str(&type);
if (type.length())
{
String def_val;
@@ -3577,6 +3593,11 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
(share->transactional == HA_CHOICE_YES ? "1" : "0"),
NullS);
}
+ if (share->key_block_size)
+ {
+ ptr= strmov(ptr, " KEY_BLOCK_SIZE=");
+ ptr= longlong10_to_str(share->key_block_size, ptr, 10);
+ }
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (is_partitioned)
ptr= strmov(ptr, " partitioned");
@@ -3913,6 +3934,25 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
handlerton *default_type= ha_default_handlerton(thd);
DBUG_ENTER("iter_schema_engines");
+
+ /* Disabled plugins */
+ if (plugin_state(plugin) != PLUGIN_IS_READY)
+ {
+
+ struct st_mysql_plugin *plug= plugin_decl(plugin);
+ if (!(wild && wild[0] &&
+ wild_case_compare(scs, plug->name,wild)))
+ {
+ restore_record(table, s->default_values);
+ table->field[0]->store(plug->name, strlen(plug->name), scs);
+ table->field[1]->store(C_STRING_WITH_LEN("NO"), scs);
+ table->field[2]->store(plug->descr, strlen(plug->descr), scs);
+ if (schema_table_store_record(thd, table))
+ DBUG_RETURN(1);
+ }
+ DBUG_RETURN(0);
+ }
+
if (!(hton->flags & HTON_HIDDEN))
{
LEX_STRING *name= plugin_name(plugin);
@@ -3933,10 +3973,13 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
strlen(plugin_decl(plugin)->descr), scs);
tmp= &yesno[test(hton->commit)];
table->field[3]->store(tmp->str, tmp->length, scs);
+ table->field[3]->set_notnull();
tmp= &yesno[test(hton->prepare)];
table->field[4]->store(tmp->str, tmp->length, scs);
+ table->field[4]->set_notnull();
tmp= &yesno[test(hton->savepoint_set)];
table->field[5]->store(tmp->str, tmp->length, scs);
+ table->field[5]->set_notnull();
if (schema_table_store_record(thd, table))
DBUG_RETURN(1);
@@ -3947,8 +3990,12 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
int fill_schema_engines(THD *thd, TABLE_LIST *tables, COND *cond)
{
- return plugin_foreach(thd, iter_schema_engines,
- MYSQL_STORAGE_ENGINE_PLUGIN, tables->table);
+ DBUG_ENTER("fill_schema_engines");
+ if (plugin_foreach_with_mask(thd, iter_schema_engines,
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ ~PLUGIN_IS_FREED, tables->table))
+ DBUG_RETURN(1);
+ DBUG_RETURN(0);
}
@@ -6145,9 +6192,9 @@ ST_FIELD_INFO engines_fields_info[]=
{"ENGINE", 64, MYSQL_TYPE_STRING, 0, 0, "Engine", SKIP_OPEN_TABLE},
{"SUPPORT", 8, MYSQL_TYPE_STRING, 0, 0, "Support", SKIP_OPEN_TABLE},
{"COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment", SKIP_OPEN_TABLE},
- {"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 0, "Transactions", SKIP_OPEN_TABLE},
- {"XA", 3, MYSQL_TYPE_STRING, 0, 0, "XA", SKIP_OPEN_TABLE},
- {"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 0, "Savepoints", SKIP_OPEN_TABLE},
+ {"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 1, "Transactions", SKIP_OPEN_TABLE},
+ {"XA", 3, MYSQL_TYPE_STRING, 0, 1, "XA", SKIP_OPEN_TABLE},
+ {"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 1, "Savepoints", SKIP_OPEN_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
diff --git a/sql/sql_show.h b/sql/sql_show.h
index 3baaef00a7d..fa067a46033 100644
--- a/sql/sql_show.h
+++ b/sql/sql_show.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index ec35616bc89..aa2a5739f17 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -114,6 +114,30 @@ uint filename_to_tablename(const char *from, char *to, uint to_length)
}
+/**
+ Check if given string begins with "#mysql50#" prefix, cut it if so.
+
+ @param from string to check and cut
+ @param to[out] buffer for result string
+ @param to_length its size
+
+ @retval
+ 0 no prefix found
+ @retval
+ non-0 result string length
+*/
+
+uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length)
+{
+ if (from[0] == '#' &&
+ !strncmp(from, MYSQL50_TABLE_NAME_PREFIX,
+ MYSQL50_TABLE_NAME_PREFIX_LENGTH))
+ return (uint) (strmake(to, from + MYSQL50_TABLE_NAME_PREFIX_LENGTH,
+ to_length - 1) - to);
+ return 0;
+}
+
+
/*
Translate a table name to a file name (WL #1324).
@@ -133,11 +157,8 @@ uint tablename_to_filename(const char *from, char *to, uint to_length)
DBUG_ENTER("tablename_to_filename");
DBUG_PRINT("enter", ("from '%s'", from));
- if (from[0] == '#' && !strncmp(from, MYSQL50_TABLE_NAME_PREFIX,
- MYSQL50_TABLE_NAME_PREFIX_LENGTH))
- DBUG_RETURN((uint) (strmake(to, from+MYSQL50_TABLE_NAME_PREFIX_LENGTH,
- to_length-1) -
- (from + MYSQL50_TABLE_NAME_PREFIX_LENGTH)));
+ if ((length= check_n_cut_mysql50_prefix(from, to, to_length)))
+ DBUG_RETURN(length);
length= strconvert(system_charset_info, from,
&my_charset_filename, to, to_length, &errors);
if (check_if_legal_tablename(to) &&
@@ -3111,10 +3132,12 @@ static bool prepare_blob_field(THD *thd, Create_field *sql_field)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_AUTO_CONVERT,
warn_buff);
}
-
+
if ((sql_field->flags & BLOB_FLAG) && sql_field->length)
{
- if (sql_field->sql_type == MYSQL_TYPE_BLOB)
+ if (sql_field->sql_type == FIELD_TYPE_BLOB ||
+ sql_field->sql_type == FIELD_TYPE_TINY_BLOB ||
+ sql_field->sql_type == FIELD_TYPE_MEDIUM_BLOB)
{
/* The user has given a length to the blob column */
sql_field->sql_type= get_blob_type_from_length(sql_field->length);
@@ -3425,14 +3448,6 @@ bool mysql_create_table_no_lock(THD *thd,
}
else
{
- #ifdef FN_DEVCHAR
- /* check if the table name contains FN_DEVCHAR when defined */
- if (strchr(alias, FN_DEVCHAR))
- {
- my_error(ER_WRONG_TABLE_NAME, MYF(0), alias);
- DBUG_RETURN(TRUE);
- }
-#endif
path_length= build_table_filename(path, sizeof(path), db, alias, reg_ext,
internal_tmp_table ? FN_IS_TMP : 0);
}
@@ -4319,6 +4334,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
table->table=0; // For query cache
if (protocol->write())
goto err;
+ thd->main_da.reset_diagnostics_area();
continue;
/* purecov: end */
}
@@ -4419,8 +4435,8 @@ send_result_message:
switch (result_code) {
case HA_ADMIN_NOT_IMPLEMENTED:
{
- char buf[ERRMSGSIZE+20];
- uint length=my_snprintf(buf, ERRMSGSIZE,
+ char buf[MYSQL_ERRMSG_SIZE];
+ uint length=my_snprintf(buf, sizeof(buf),
ER(ER_CHECK_NOT_IMPLEMENTED), operator_name);
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(buf, length, system_charset_info);
@@ -4429,8 +4445,8 @@ send_result_message:
case HA_ADMIN_NOT_BASE_TABLE:
{
- char buf[ERRMSGSIZE+20];
- uint length= my_snprintf(buf, ERRMSGSIZE,
+ char buf[MYSQL_ERRMSG_SIZE];
+ uint length= my_snprintf(buf, sizeof(buf),
ER(ER_BAD_TABLE_ERROR), table_name);
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(buf, length, system_charset_info);
@@ -4557,11 +4573,12 @@ send_result_message:
case HA_ADMIN_NEEDS_UPGRADE:
case HA_ADMIN_NEEDS_ALTER:
{
- char buf[ERRMSGSIZE];
+ char buf[MYSQL_ERRMSG_SIZE];
uint length;
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
- length=my_snprintf(buf, ERRMSGSIZE, ER(ER_TABLE_NEEDS_UPGRADE), table->table_name);
+ length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE),
+ table->table_name);
protocol->store(buf, length, system_charset_info);
fatal_error=1;
break;
@@ -4569,8 +4586,8 @@ send_result_message:
default: // Probably HA_ADMIN_INTERNAL_ERROR
{
- char buf[ERRMSGSIZE+20];
- uint length=my_snprintf(buf, ERRMSGSIZE,
+ char buf[MYSQL_ERRMSG_SIZE];
+ uint length=my_snprintf(buf, sizeof(buf),
"Unknown - internal error %d during operation",
result_code);
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
@@ -4967,6 +4984,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
dst_path); /* purecov: inspected */
goto err; /* purecov: inspected */
}
+ thd->thread_specific_used= TRUE;
}
else if (err)
{
@@ -5867,7 +5885,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if (key_info->flags & HA_USES_BLOCK_SIZE)
key_create_info.block_size= key_info->block_size;
if (key_info->flags & HA_USES_PARSER)
- key_create_info.parser_name= *key_info->parser_name;
+ key_create_info.parser_name= *plugin_name(key_info->parser);
if (key_info->flags & HA_SPATIAL)
key_type= Key::SPATIAL;
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 01363714484..78932396efe 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -513,7 +513,7 @@ Next alarm time: %lu\n",
fprintf(stdout,"\nBegin safemalloc memory dump:\n"); // tag needed for test suite
TERMINATE(stdout, 1); // Write malloc information
fprintf(stdout,"\nEnd safemalloc memory dump.\n");
-
+ fflush(stdout);
#ifdef HAVE_MALLINFO
struct mallinfo info= mallinfo();
printf("\nMemory status:\n\
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 5c8b1d96646..108d5095691 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1368,15 +1368,27 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
if (triggers->on_table_names_list.push_back(on_table_name, &table->mem_root))
goto err_with_lex_cleanup;
-
+#ifndef DBUG_OFF
/*
Let us check that we correctly update trigger definitions when we
rename tables with triggers.
+
+ In special cases like "RENAME TABLE `#mysql50#somename` TO `somename`"
+ or "ALTER DATABASE `#mysql50#somename` UPGRADE DATA DIRECTORY NAME"
+ we might be given table or database name with "#mysql50#" prefix (and
+ trigger's definiton contains un-prefixed version of the same name).
+ To remove this prefix we use check_n_cut_mysql50_prefix().
*/
- DBUG_ASSERT(!my_strcasecmp(table_alias_charset, lex.query_tables->db, db) &&
- !my_strcasecmp(table_alias_charset, lex.query_tables->table_name,
- table_name));
+ char fname[NAME_LEN + 1];
+ DBUG_ASSERT((!my_strcasecmp(table_alias_charset, lex.query_tables->db, db) ||
+ (check_n_cut_mysql50_prefix(db, fname, sizeof(fname)) &&
+ !my_strcasecmp(table_alias_charset, lex.query_tables->db, fname))) &&
+ (!my_strcasecmp(table_alias_charset, lex.query_tables->table_name,
+ table_name) ||
+ (check_n_cut_mysql50_prefix(table_name, fname, sizeof(fname)) &&
+ !my_strcasecmp(table_alias_charset, lex.query_tables->table_name, fname))));
+#endif
if (names_only)
{
lex_end(&lex);
@@ -1692,7 +1704,8 @@ end:
(change name of table in triggers' definitions).
@param thd Thread context
- @param db_name Database of subject table
+ @param old_db_name Old database of subject table
+ @param new_db_name New database of subject table
@param old_table_name Old subject table's name
@param new_table_name New subject table's name
@@ -1704,7 +1717,8 @@ end:
bool
Table_triggers_list::change_table_name_in_triggers(THD *thd,
- const char *db_name,
+ const char *old_db_name,
+ const char *new_db_name,
LEX_STRING *old_table_name,
LEX_STRING *new_table_name)
{
@@ -1757,11 +1771,11 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
if (thd->is_fatal_error)
return TRUE; /* OOM */
- if (save_trigger_file(this, db_name, new_table_name->str))
+ if (save_trigger_file(this, new_db_name, new_table_name->str))
return TRUE;
- if (rm_trigger_file(path_buff, db_name, old_table_name->str))
+ if (rm_trigger_file(path_buff, old_db_name, old_table_name->str))
{
- (void) rm_trigger_file(path_buff, db_name, new_table_name->str);
+ (void) rm_trigger_file(path_buff, new_db_name, new_table_name->str);
return TRUE;
}
return FALSE;
@@ -1772,7 +1786,8 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
Iterate though Table_triggers_list::names_list list and update
.TRN files after renaming triggers' subject table.
- @param db_name Database of subject table
+ @param old_db_name Old database of subject table
+ @param new_db_name New database of subject table
@param new_table_name New subject table's name
@param stopper Pointer to Table_triggers_list::names_list at
which we should stop updating.
@@ -1785,7 +1800,8 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
*/
LEX_STRING*
-Table_triggers_list::change_table_name_in_trignames(const char *db_name,
+Table_triggers_list::change_table_name_in_trignames(const char *old_db_name,
+ const char *new_db_name,
LEX_STRING *new_table_name,
LEX_STRING *stopper)
{
@@ -1798,7 +1814,7 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name,
while ((trigger= it_name++) != stopper)
{
trigname_file.length= build_table_filename(trigname_buff, FN_REFLEN-1,
- db_name, trigger->str,
+ new_db_name, trigger->str,
TRN_EXT, 0);
trigname_file.str= trigname_buff;
@@ -1807,6 +1823,16 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name,
if (sql_create_definition_file(NULL, &trigname_file, &trigname_file_type,
(uchar*)&trigname, trigname_file_parameters))
return trigger;
+
+ /* Remove stale .TRN file in case of database upgrade */
+ if (old_db_name)
+ {
+ if (rm_trigname_file(trigname_buff, old_db_name, trigger->str))
+ {
+ (void) rm_trigname_file(trigname_buff, new_db_name, trigger->str);
+ return trigger;
+ }
+ }
}
return 0;
@@ -1840,6 +1866,7 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
{
TABLE table;
bool result= 0;
+ bool upgrading50to51= FALSE;
LEX_STRING *err_trigname;
DBUG_ENTER("change_table_name");
@@ -1877,14 +1904,27 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
moving table with them between two schemas raises too many questions.
(E.g. what should happen if in new schema we already have trigger
with same name ?).
+
+ In case of "ALTER DATABASE `#mysql50#db1` UPGRADE DATA DIRECTORY NAME"
+ we will be given table name with "#mysql50#" prefix
+ To remove this prefix we use check_n_cut_mysql50_prefix().
*/
if (my_strcasecmp(table_alias_charset, db, new_db))
{
- my_error(ER_TRG_IN_WRONG_SCHEMA, MYF(0));
- result= 1;
- goto end;
+ char dbname[NAME_LEN + 1];
+ if (check_n_cut_mysql50_prefix(db, dbname, sizeof(dbname)) &&
+ !my_strcasecmp(table_alias_charset, dbname, new_db))
+ {
+ upgrading50to51= TRUE;
+ }
+ else
+ {
+ my_error(ER_TRG_IN_WRONG_SCHEMA, MYF(0));
+ result= 1;
+ goto end;
+ }
}
- if (table.triggers->change_table_name_in_triggers(thd, db,
+ if (table.triggers->change_table_name_in_triggers(thd, db, new_db,
&old_table_name,
&new_table_name))
{
@@ -1892,7 +1932,8 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
goto end;
}
if ((err_trigname= table.triggers->change_table_name_in_trignames(
- db, &new_table_name, 0)))
+ upgrading50to51 ? db : NULL,
+ new_db, &new_table_name, 0)))
{
/*
If we were unable to update one of .TRN files properly we will
@@ -1900,16 +1941,17 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
We assume that we will be able to undo our changes without errors
(we can't do much if there will be an error anyway).
*/
- (void) table.triggers->change_table_name_in_trignames(db,
- &old_table_name,
- err_trigname);
- (void) table.triggers->change_table_name_in_triggers(thd, db,
- &new_table_name,
- &old_table_name);
+ (void) table.triggers->change_table_name_in_trignames(
+ upgrading50to51 ? new_db : NULL, db,
+ &old_table_name, err_trigname);
+ (void) table.triggers->change_table_name_in_triggers(
+ thd, db, new_db,
+ &new_table_name, &old_table_name);
result= 1;
goto end;
}
}
+
end:
delete table.triggers;
free_root(&table.mem_root, MYF(0));
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index 1b0edf6bea8..f6754a75284 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -146,11 +146,13 @@ public:
private:
bool prepare_record1_accessors(TABLE *table);
- LEX_STRING* change_table_name_in_trignames(const char *db_name,
+ LEX_STRING* change_table_name_in_trignames(const char *old_db_name,
+ const char *new_db_name,
LEX_STRING *new_table_name,
LEX_STRING *stopper);
bool change_table_name_in_triggers(THD *thd,
- const char *db_name,
+ const char *old_db_name,
+ const char *new_db_name,
LEX_STRING *old_table_name,
LEX_STRING *new_table_name);
};
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 2f3282f58f6..fd3036e3d80 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 49ec1a33873..1edd6952a34 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -528,9 +528,11 @@ int mysql_update(THD *thd,
init_read_record(&info, thd, table, select, 0, 1, FALSE);
updated= found= 0;
- /* Generate an error when trying to set a NOT NULL field to NULL. */
- thd->count_cuted_fields= ignore ? CHECK_FIELD_WARN
- : CHECK_FIELD_ERROR_FOR_NULL;
+ /*
+ Generate an error (in TRADITIONAL mode) or warning
+ when trying to set a NOT NULL field to NULL.
+ */
+ thd->count_cuted_fields= CHECK_FIELD_WARN;
thd->cuted_fields=0L;
thd_proc_info(thd, "Updating");
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 93f6ac4391d..7df035bbfc3 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/table.cc b/sql/table.cc
index 89714e4e47e..17454ffb012 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -400,6 +400,8 @@ void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
void free_table_share(TABLE_SHARE *share)
{
MEM_ROOT mem_root;
+ uint idx;
+ KEY *key_info;
DBUG_ENTER("free_table_share");
DBUG_PRINT("enter", ("table: %s.%s", share->db.str, share->table_name.str));
DBUG_ASSERT(share->ref_count == 0);
@@ -426,6 +428,16 @@ void free_table_share(TABLE_SHARE *share)
plugin_unlock(NULL, share->db_plugin);
share->db_plugin= NULL;
+ /* Release fulltext parsers */
+ key_info= share->key_info;
+ for (idx= share->keys; idx; idx--, key_info++)
+ {
+ if (key_info->flags & HA_USES_PARSER)
+ {
+ plugin_unlock(NULL, key_info->parser);
+ key_info->flags= 0;
+ }
+ }
/* We must copy mem_root from share because share is allocated through it */
memcpy((char*) &mem_root, (char*) &share->mem_root, sizeof(mem_root));
free_root(&mem_root, MYF(0)); // Free's share
@@ -1416,7 +1428,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
*/
if (ha_option & HA_PRIMARY_KEY_IN_READ_INDEX)
{
- field->part_of_key= share->keys_in_use;
+ if (field->key_length() == key_part->length &&
+ !(field->flags & BLOB_FLAG))
+ field->part_of_key= share->keys_in_use;
if (field->part_of_sortkey.is_set(key))
field->part_of_sortkey= share->keys_in_use;
}
@@ -1941,22 +1955,11 @@ partititon_err:
int closefrm(register TABLE *table, bool free_share)
{
int error=0;
- uint idx;
- KEY *key_info;
DBUG_ENTER("closefrm");
DBUG_PRINT("enter", ("table: 0x%lx", (long) table));
if (table->db_stat)
error=table->file->close();
- key_info= table->key_info;
- for (idx= table->s->keys; idx; idx--, key_info++)
- {
- if (key_info->flags & HA_USES_PARSER)
- {
- plugin_unlock(NULL, key_info->parser);
- key_info->flags= 0;
- }
- }
my_free((char*) table->alias, MYF(MY_ALLOW_ZERO_PTR));
table->alias= 0;
if (table->field)
diff --git a/sql/table.h b/sql/table.h
index 77bd7bb9e77..cb53013cd59 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1363,7 +1363,7 @@ struct TABLE_LIST
void cleanup_items();
bool placeholder()
{
- return derived || view || schema_table || create && !table->db_stat ||
+ return derived || view || schema_table || (create && !table->db_stat) ||
!table;
}
void print(THD *thd, String *str, enum_query_type query_type);
@@ -1691,5 +1691,35 @@ static inline void dbug_tmp_restore_column_map(MY_BITMAP *bitmap,
#endif
}
+
+/*
+ Variant of the above : handle both read and write sets.
+ Provide for the possiblity of the read set being the same as the write set
+*/
+static inline void dbug_tmp_use_all_columns(TABLE *table,
+ my_bitmap_map **save,
+ MY_BITMAP *read_set,
+ MY_BITMAP *write_set)
+{
+#ifndef DBUG_OFF
+ save[0]= read_set->bitmap;
+ save[1]= write_set->bitmap;
+ (void) tmp_use_all_columns(table, read_set);
+ (void) tmp_use_all_columns(table, write_set);
+#endif
+}
+
+
+static inline void dbug_tmp_restore_column_maps(MY_BITMAP *read_set,
+ MY_BITMAP *write_set,
+ my_bitmap_map **old)
+{
+#ifndef DBUG_OFF
+ tmp_restore_column_map(read_set, old[0]);
+ tmp_restore_column_map(write_set, old[1]);
+#endif
+}
+
+
size_t max_row_length(TABLE *table, const uchar *data);
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 9e42aabfef7..da018ebec3d 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -92,8 +92,8 @@ handle_error(uint sql_errno,
db_file Handler to use. May be zero, in which case we use
create_info->db_type
RETURN
- 0 ok
- 1 error
+ false ok
+ true error
*/
bool mysql_create_frm(THD *thd, const char *file_name,
@@ -205,6 +205,24 @@ bool mysql_create_frm(THD *thd, const char *file_name,
(create_info->min_rows == 1) && (keys == 0));
int2store(fileinfo+28,key_info_length);
+ /*
+ This gives us the byte-position of the character at
+ (character-position, not byte-position) TABLE_COMMENT_MAXLEN.
+ The trick here is that character-positions start at 0, so the last
+ character in a maximum-allowed length string would be at char-pos
+ MAXLEN-1; charpos MAXLEN will be the position of the terminator.
+ Consequently, bytepos(charpos(MAXLEN)) should be equal to
+ comment[length] (which should also be the terminator, or at least
+ the first byte after the payload in the strict sense). If this is
+ not so (bytepos(charpos(MAXLEN)) comes /before/ the end of the
+ string), the string is too long.
+
+ For additional credit, realise that UTF-8 has 1-3 bytes before 6.0,
+ and 1-4 bytes in 6.0 (6.0 also has UTF-32). This means that the
+ inlined COMMENT supposedly does not exceed 60 character plus
+ terminator, vulgo, 181 bytes.
+ */
+
tmp_len= system_charset_info->cset->charpos(system_charset_info,
create_info->comment.str,
create_info->comment.str +
@@ -227,14 +245,6 @@ bool mysql_create_frm(THD *thd, const char *file_name,
strmake((char*) forminfo+47, create_info->comment.str ?
create_info->comment.str : "", create_info->comment.length);
forminfo[46]=(uchar) create_info->comment.length;
-#ifdef EXTRA_DEBUG
- /*
- EXTRA_DEBUG causes strmake() to initialize its buffer behind the
- payload with a magic value to detect wrong buffer-sizes. We
- explicitly zero that segment again.
- */
- memset((char*) forminfo+47 + forminfo[46], 0, 61 - forminfo[46]);
-#endif
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (part_info)
{
diff --git a/storage/archive/archive_reader.c b/storage/archive/archive_reader.c
index bfc01073161..84d4e318b49 100644
--- a/storage/archive/archive_reader.c
+++ b/storage/archive/archive_reader.c
@@ -374,10 +374,8 @@ static struct my_option my_long_options[] =
static void usage(void)
{
print_version();
- puts("Copyright (C) 2007 MySQL AB");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\
- \nand you are welcome to modify and redistribute it under the GPL \
- license\n");
+ puts("Copyright 2007-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
+ puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Read and modify Archive files directly\n");
printf("Usage: %s [OPTIONS] file_to_be_looked_at [file_for_backup]\n", my_progname);
print_defaults("my", load_default_groups);
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index be747e2d1de..03ed57f38e8 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index 085840cce43..289e449be10 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index cc801b33955..e40c2db77db 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -1456,6 +1456,17 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
a file, which descriptor is still open. EACCES will be returned
when trying to delete the "to"-file in my_rename().
*/
+ if (share->tina_write_opened)
+ {
+ /*
+ Data file might be opened twice, on table opening stage and
+ during write_row execution. We need to close both instances
+ to satisfy Win.
+ */
+ if (my_close(share->tina_write_filedes, MYF(0)))
+ DBUG_RETURN(my_errno ? my_errno : -1);
+ share->tina_write_opened= FALSE;
+ }
if (my_close(data_file,MYF(0)) || my_close(repair_file, MYF(0)) ||
my_rename(repaired_fname, share->data_file_name, MYF(0)))
DBUG_RETURN(-1);
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 4b81edc1111..e46379c25c9 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -2856,7 +2856,7 @@ int ha_federated::info(uint flag)
if (!(row= mysql_fetch_row(result)))
goto error;
- if (flag & HA_STATUS_VARIABLE | HA_STATUS_CONST)
+ if (flag & (HA_STATUS_VARIABLE | HA_STATUS_CONST))
{
/*
deleted is set in ha_federated::info
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 2cadfa1c24d..1f74ad0f941 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -92,7 +92,7 @@ const char **ha_heap::bas_ext() const
int ha_heap::open(const char *name, int mode, uint test_if_locked)
{
if ((test_if_locked & HA_OPEN_INTERNAL_TABLE) ||
- !(file= heap_open(name, mode)) && my_errno == ENOENT)
+ (!(file= heap_open(name, mode)) && my_errno == ENOENT))
{
HA_CREATE_INFO create_info;
internal_table= test(test_if_locked & HA_OPEN_INTERNAL_TABLE);
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index b5e5c5375dc..7410bf7e591 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -15,21 +15,21 @@
# Process this file with automake to create Makefile.in
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
+MYSQLDATAdir= $(localstatedir)
+MYSQLSHAREdir= $(pkgdatadir)
+MYSQLBASEdir= $(prefix)
+MYSQLLIBdir= $(pkglibdir)
+pkgplugindir= $(pkglibdir)/plugin
+INCLUDES= -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/storage/innobase/include \
-I$(top_srcdir)/sql \
- -I$(srcdir)
+ -I$(srcdir)
-DEFS = @DEFS@
+DEFS= @DEFS@
-noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
+noinst_HEADERS= include/btr0btr.h include/btr0btr.ic \
include/btr0cur.h include/btr0cur.ic \
include/btr0pcur.h include/btr0pcur.ic \
include/btr0sea.h include/btr0sea.ic \
@@ -121,9 +121,9 @@ noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
include/ut0list.ic include/ut0wqueue.h \
include/ha_prototypes.h handler/ha_innodb.h
-EXTRA_LIBRARIES = libinnobase.a
-noinst_LIBRARIES = @plugin_innobase_static_target@
-libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
+EXTRA_LIBRARIES= libinnobase.a
+noinst_LIBRARIES= @plugin_innobase_static_target@
+libinnobase_a_SOURCES= btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c \
buf/buf0lru.c buf/buf0rea.c data/data0data.c \
data/data0type.c dict/dict0boot.c \
@@ -156,17 +156,17 @@ libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
handler/ha_innodb.cc
libinnobase_a_CXXFLAGS= $(AM_CFLAGS)
-libinnobase_a_CFLAGS = $(AM_CFLAGS)
+libinnobase_a_CFLAGS= $(AM_CFLAGS)
-EXTRA_LTLIBRARIES = ha_innodb.la
+EXTRA_LTLIBRARIES= ha_innodb.la
pkgplugin_LTLIBRARIES= @plugin_innobase_shared_target@
-ha_innodb_la_LDFLAGS = -module -rpath $(pkgplugindir)
-ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_innodb_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_innodb_la_SOURCES = $(libinnobase_a_SOURCES)
+ha_innodb_la_LDFLAGS= -module -rpath $(pkgplugindir)
+ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
+ha_innodb_la_CFLAGS= $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
+ha_innodb_la_SOURCES= $(libinnobase_a_SOURCES)
-EXTRA_DIST = CMakeLists.txt plug.in \
+EXTRA_DIST= CMakeLists.txt plug.in \
pars/make_bison.sh pars/make_flex.sh \
pars/pars0grm.y pars/pars0lex.l
diff --git a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
index b0ce5db6ccd..6a13ca863bd 100644
--- a/storage/innobase/btr/btr0sea.c
+++ b/storage/innobase/btr/btr0sea.c
@@ -161,6 +161,7 @@ btr_search_info_create(
info->magic_n = BTR_SEARCH_MAGIC_N;
#endif /* UNIV_DEBUG */
+ info->ref_count = 0;
info->root_guess = NULL;
info->hash_analysis = 0;
@@ -184,6 +185,31 @@ btr_search_info_create(
return(info);
}
+/*********************************************************************
+Returns the value of ref_count. The value is protected by
+btr_search_latch. */
+ulint
+btr_search_info_get_ref_count(
+/*==========================*/
+ /* out: ref_count value. */
+ btr_search_t* info) /* in: search info. */
+{
+ ulint ret;
+
+ ut_ad(info);
+
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
+
+ rw_lock_s_lock(&btr_search_latch);
+ ret = info->ref_count;
+ rw_lock_s_unlock(&btr_search_latch);
+
+ return(ret);
+}
+
/*************************************************************************
Updates the search info of an index about hash successes. NOTE that info
is NOT protected by any semaphore, to save CPU time! Do not assume its fields
@@ -1022,8 +1048,12 @@ next_rec:
ha_remove_all_nodes_to_page(table, folds[i], page);
}
+ ut_a(index->search_info->ref_count > 0);
+ index->search_info->ref_count--;
+
block->is_hashed = FALSE;
block->index = NULL;
+
cleanup:
if (UNIV_UNLIKELY(block->n_pointers)) {
/* Corruption */
@@ -1244,6 +1274,15 @@ btr_search_build_page_hash_index(
goto exit_func;
}
+ /* This counter is decremented every time we drop page
+ hash index entries and is incremented here. Since we can
+ rebuild hash index for a page that is already hashed, we
+ have to take care not to increment the counter in that
+ case. */
+ if (!block->is_hashed) {
+ index->search_info->ref_count++;
+ }
+
block->is_hashed = TRUE;
block->n_hash_helps = 0;
diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
index f3913ed49b7..d3c787d1578 100644
--- a/storage/innobase/buf/buf0lru.c
+++ b/storage/innobase/buf/buf0lru.c
@@ -42,6 +42,11 @@ initial segment in buf_LRU_get_recent_limit */
#define BUF_LRU_INITIAL_RATIO 8
+/* When dropping the search hash index entries before deleting an ibd
+file, we build a local array of pages belonging to that tablespace
+in the buffer pool. Following is the size of that array. */
+#define BUF_LRU_DROP_SEARCH_HASH_SIZE 1024
+
/* If we switch on the InnoDB monitor because there are too few available
frames in the buffer pool, we set this to TRUE */
ibool buf_lru_switched_on_innodb_mon = FALSE;
@@ -66,6 +71,120 @@ buf_LRU_block_free_hashed_page(
be in a state where it can be freed */
/**********************************************************************
+Attempts to drop page hash index on a batch of pages belonging to a
+particular space id. */
+static
+void
+buf_LRU_drop_page_hash_batch(
+/*=========================*/
+ ulint id, /* in: space id */
+ const ulint* arr, /* in: array of page_no */
+ ulint count) /* in: number of entries in array */
+{
+ ulint i;
+
+ ut_ad(arr != NULL);
+ ut_ad(count <= BUF_LRU_DROP_SEARCH_HASH_SIZE);
+
+ for (i = 0; i < count; ++i) {
+ btr_search_drop_page_hash_when_freed(id, arr[i]);
+ }
+}
+
+/**********************************************************************
+When doing a DROP TABLE/DISCARD TABLESPACE we have to drop all page
+hash index entries belonging to that table. This function tries to
+do that in batch. Note that this is a 'best effort' attempt and does
+not guarantee that ALL hash entries will be removed. */
+static
+void
+buf_LRU_drop_page_hash_for_tablespace(
+/*==================================*/
+ ulint id) /* in: space id */
+{
+ buf_block_t* block;
+ ulint* page_arr;
+ ulint num_entries;
+
+ page_arr = ut_malloc(sizeof(ulint)
+ * BUF_LRU_DROP_SEARCH_HASH_SIZE);
+ mutex_enter(&buf_pool->mutex);
+
+scan_again:
+ num_entries = 0;
+ block = UT_LIST_GET_LAST(buf_pool->LRU);
+
+ while (block != NULL) {
+ buf_block_t* prev_block;
+
+ mutex_enter(&block->mutex);
+ prev_block = UT_LIST_GET_PREV(LRU, block);
+
+ ut_a(block->state == BUF_BLOCK_FILE_PAGE);
+
+ if (block->space != id
+ || block->buf_fix_count > 0
+ || block->io_fix != 0) {
+ /* We leave the fixed pages as is in this scan.
+ To be dealt with later in the final scan. */
+ mutex_exit(&block->mutex);
+ goto next_page;
+ }
+
+ ut_ad(block->space == id);
+ if (block->is_hashed) {
+
+ /* Store the offset(i.e.: page_no) in the array
+ so that we can drop hash index in a batch
+ later. */
+ page_arr[num_entries] = block->offset;
+ mutex_exit(&block->mutex);
+ ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE);
+ ++num_entries;
+
+ if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) {
+ goto next_page;
+ }
+ /* Array full. We release the buf_pool->mutex to
+ obey the latching order. */
+ mutex_exit(&buf_pool->mutex);
+
+ buf_LRU_drop_page_hash_batch(id, page_arr,
+ num_entries);
+ num_entries = 0;
+ mutex_enter(&buf_pool->mutex);
+ } else {
+ mutex_exit(&block->mutex);
+ }
+
+next_page:
+ /* Note that we may have released the buf_pool->mutex
+ above after reading the prev_block during processing
+ of a page_hash_batch (i.e.: when the array was full).
+ This means that prev_block can change in LRU list.
+ This is OK because this function is a 'best effort'
+ to drop as many search hash entries as possible and
+ it does not guarantee that ALL such entries will be
+ dropped. */
+ block = prev_block;
+
+ /* If, however, block has been removed from LRU list
+ to the free list then we should restart the scan.
+ block->state is protected by buf_pool->mutex. */
+ if (block && block->state != BUF_BLOCK_FILE_PAGE) {
+ ut_a(num_entries == 0);
+ goto scan_again;
+ }
+ }
+
+ mutex_exit(&buf_pool->mutex);
+
+ /* Drop any remaining batch of search hashed pages. */
+ buf_LRU_drop_page_hash_batch(id, page_arr, num_entries);
+ ut_free(page_arr);
+}
+
+/**********************************************************************
Invalidates all pages belonging to a given tablespace when we are deleting
the data file(s) of that tablespace. */
@@ -78,6 +197,14 @@ buf_LRU_invalidate_tablespace(
ulint page_no;
ibool all_freed;
+ /* Before we attempt to drop pages one by one we first
+ attempt to drop page hash index entries in batches to make
+ it more efficient. The batching attempt is a best effort
+ attempt and does not guarantee that all pages hash entries
+ will be dropped. We get rid of remaining page hash entries
+ one by one below. */
+ buf_LRU_drop_page_hash_for_tablespace(id);
+
scan_again:
mutex_enter(&(buf_pool->mutex));
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index 5eaa44b4615..c7a57d6a2b8 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -422,8 +422,7 @@ dict_table_autoinc_lock(
}
/************************************************************************
-Initializes the autoinc counter. It is not an error to initialize an already
-initialized counter. */
+Unconditionally set the autoinc counter. */
void
dict_table_autoinc_initialize(
@@ -433,7 +432,6 @@ dict_table_autoinc_initialize(
{
ut_ad(mutex_own(&table->autoinc_mutex));
- table->autoinc_inited = TRUE;
table->autoinc = value;
}
@@ -447,32 +445,25 @@ dict_table_autoinc_read(
/* out: value for a new row, or 0 */
dict_table_t* table) /* in: table */
{
- ib_longlong value;
-
ut_ad(mutex_own(&table->autoinc_mutex));
- if (!table->autoinc_inited) {
-
- value = 0;
- } else {
- value = table->autoinc;
- }
-
- return(value);
+ return(table->autoinc);
}
/************************************************************************
Updates the autoinc counter if the value supplied is greater than the
-current value. If not inited, does nothing. */
+current value. */
void
-dict_table_autoinc_update(
-/*======================*/
+dict_table_autoinc_update_if_greater(
+/*=================================*/
dict_table_t* table, /* in: table */
ib_ulonglong value) /* in: value which was assigned to a row */
{
- if (table->autoinc_inited && value > table->autoinc) {
+ ut_ad(mutex_own(&table->autoinc_mutex));
+
+ if (value > table->autoinc) {
table->autoinc = value;
}
@@ -1394,12 +1385,59 @@ dict_index_remove_from_cache(
dict_index_t* index) /* in, own: index */
{
ulint size;
+ ulint retries = 0;
+ btr_search_t* info;
ut_ad(table && index);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(mutex_own(&(dict_sys->mutex)));
+ /* We always create search info whether or not adaptive
+ hash index is enabled or not. */
+ info = index->search_info;
+ ut_ad(info);
+
+ /* We are not allowed to free the in-memory index struct
+ dict_index_t until all entries in the adaptive hash index
+ that point to any of the page belonging to his b-tree index
+ are dropped. This is so because dropping of these entries
+ require access to dict_index_t struct. To avoid such scenario
+ We keep a count of number of such pages in the search_info and
+ only free the dict_index_t struct when this count drops to
+ zero. */
+
+ for (;;) {
+ ulint ref_count = btr_search_info_get_ref_count(info);
+ if (ref_count == 0) {
+ break;
+ }
+
+ /* Sleep for 10ms before trying again. */
+ os_thread_sleep(10000);
+ ++retries;
+
+ if (retries % 500 == 0) {
+ /* No luck after 5 seconds of wait. */
+ fprintf(stderr, "InnoDB: Error: Waited for"
+ " %lu secs for hash index"
+ " ref_count (%lu) to drop"
+ " to 0.\n"
+ "index: \"%s\""
+ " table: \"%s\"\n",
+ retries/100,
+ ref_count,
+ index->name,
+ table->name);
+ }
+
+ /* To avoid a hang here we commit suicide if the
+ ref_count doesn't drop to zero in 600 seconds. */
+ if (retries >= 60000) {
+ ut_error;
+ }
+ }
+
rw_lock_free(&index->lock);
/* Remove the index from the list of indexes of the table */
diff --git a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c
index 47cf7a0bc9c..168771ca307 100644
--- a/storage/innobase/dict/dict0mem.c
+++ b/storage/innobase/dict/dict0mem.c
@@ -89,11 +89,7 @@ dict_mem_table_create(
mutex_create(&table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
- table->autoinc_inited = FALSE;
-
- /* The actual increment value will be set by MySQL, we simply
- default to 1 here.*/
- table->autoinc_increment = 1;
+ table->autoinc = 0;
/* The number of transactions that are either waiting on the
AUTOINC lock or have been granted the lock. */
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 5c7366ef4c3..cffa79300c7 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -128,7 +128,7 @@ static my_bool innobase_file_per_table = FALSE;
static my_bool innobase_locks_unsafe_for_binlog = FALSE;
static my_bool innobase_rollback_on_timeout = FALSE;
static my_bool innobase_create_status_file = FALSE;
-static my_bool innobase_stats_on_metadata = TRUE;
+static my_bool innobase_stats_on_metadata = TRUE;
static my_bool innobase_adaptive_hash_index = TRUE;
static char* internal_innobase_data_file_path = NULL;
@@ -485,7 +485,7 @@ innodb_srv_conc_exit_innodb(
/*========================*/
trx_t* trx) /* in: transaction handle */
{
- if (UNIV_LIKELY(!srv_thread_concurrency)) {
+ if (UNIV_LIKELY(!trx->declared_to_be_inside_innodb)) {
return;
}
@@ -531,6 +531,18 @@ thd_has_edited_nontrans_tables(
return((ibool) thd_non_transactional_update((THD*) thd));
}
+/**********************************************************************
+Returns true if the thread is executing a SELECT statement. */
+extern "C"
+ibool
+thd_is_select(
+/*==========*/
+ /* out: true if thd is executing SELECT */
+ const void* thd) /* in: thread handle (THD*) */
+{
+ return(thd_sql_command((const THD*) thd) == SQLCOM_SELECT);
+}
+
/************************************************************************
Obtain the InnoDB transaction of a MySQL thread. */
inline
@@ -934,6 +946,81 @@ innobase_convert_string(
}
/*************************************************************************
+Compute the next autoinc value.
+
+For MySQL replication the autoincrement values can be partitioned among
+the nodes. The offset is the start or origin of the autoincrement value
+for a particular node. For n nodes the increment will be n and the offset
+will be in the interval [1, n]. The formula tries to allocate the next
+value for a particular node.
+
+Note: This function is also called with increment set to the number of
+values we want to reserve for multi-value inserts e.g.,
+
+ INSERT INTO T VALUES(), (), ();
+
+innobase_next_autoinc() will be called with increment set to
+n * 3 where autoinc_lock_mode != TRADITIONAL because we want
+to reserve 3 values for the multi-value INSERT above. */
+static
+ulonglong
+innobase_next_autoinc(
+/*==================*/
+ /* out: the next value */
+ ulonglong current, /* in: Current value */
+ ulonglong increment, /* in: increment current by */
+ ulonglong offset, /* in: AUTOINC offset */
+ ulonglong max_value) /* in: max value for type */
+{
+ ulonglong next_value;
+
+ /* Should never be 0. */
+ ut_a(increment > 0);
+
+ if (max_value <= current) {
+ next_value = max_value;
+ } else if (offset <= 1) {
+ /* Offset 0 and 1 are the same, because there must be at
+ least one node in the system. */
+ if (max_value - current <= increment) {
+ next_value = max_value;
+ } else {
+ next_value = current + increment;
+ }
+ } else {
+ if (current > offset) {
+ next_value = ((current - offset) / increment) + 1;
+ } else {
+ next_value = ((offset - current) / increment) + 1;
+ }
+
+ ut_a(increment > 0);
+ ut_a(next_value > 0);
+
+ /* Check for multiplication overflow. */
+ if (increment > (max_value / next_value)) {
+
+ next_value = max_value;
+ } else {
+ next_value *= increment;
+
+ ut_a(max_value >= next_value);
+
+ /* Check for overflow. */
+ if (max_value - next_value <= offset) {
+ next_value = max_value;
+ } else {
+ next_value += offset;
+ }
+ }
+ }
+
+ ut_a(next_value <= max_value);
+
+ return(next_value);
+}
+
+/*************************************************************************
Gets the InnoDB transaction handle for a MySQL handler object, creates
an InnoDB transaction struct if the corresponding MySQL thread struct still
lacks one. */
@@ -1658,8 +1745,6 @@ innobase_init(
srv_max_n_open_files = (ulint) innobase_open_files;
srv_innodb_status = (ibool) innobase_create_status_file;
- srv_stats_on_metadata = (ibool) innobase_stats_on_metadata;
-
srv_use_adaptive_hash_indexes =
(ibool) innobase_adaptive_hash_index;
@@ -2294,6 +2379,44 @@ normalize_table_name(
#endif
}
+/************************************************************************
+Set the autoinc column max value. This should only be called once from
+ha_innobase::open(). Therefore there's no need for a covering lock. */
+
+ulong
+ha_innobase::innobase_initialize_autoinc()
+/*======================================*/
+{
+ dict_index_t* index;
+ ulonglong auto_inc;
+ const char* col_name;
+ ulint error = DB_SUCCESS;
+ dict_table_t* innodb_table = prebuilt->table;
+
+ col_name = table->found_next_number_field->field_name;
+ index = innobase_get_index(table->s->next_number_index);
+
+ /* Execute SELECT MAX(col_name) FROM TABLE; */
+ error = row_search_max_autoinc(index, col_name, &auto_inc);
+
+ if (error == DB_SUCCESS) {
+
+ /* At the this stage we dont' know the increment
+ or the offset, so use default inrement of 1. */
+ ++auto_inc;
+
+ dict_table_autoinc_initialize(innodb_table, auto_inc);
+
+ } else {
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Error: (%lu) Couldn't read "
+ "the MAX(%s) autoinc value from the "
+ "index (%s).\n", error, col_name, index->name);
+ }
+
+ return(ulong(error));
+}
+
/*********************************************************************
Creates and opens a handle to a table which already exists in an InnoDB
database. */
@@ -2318,6 +2441,14 @@ ha_innobase::open(
UT_NOT_USED(test_if_locked);
thd = ha_thd();
+
+ /* Under some cases MySQL seems to call this function while
+ holding btr_search_latch. This breaks the latching order as
+ we acquire dict_sys->mutex below and leads to a deadlock. */
+ if (thd != NULL) {
+ innobase_release_temporary_latches(ht, thd);
+ }
+
normalize_table_name(norm_name, name);
user_thd = NULL;
@@ -2409,6 +2540,8 @@ retry:
prebuilt = row_create_prebuilt(ib_table);
prebuilt->mysql_row_len = table->s->reclength;
+ prebuilt->default_rec = table->s->default_values;
+ ut_ad(prebuilt->default_rec);
/* Looks like MySQL-3.23 sometimes has primary key number != 0 */
@@ -2477,6 +2610,26 @@ retry:
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
+ /* Only if the table has an AUTOINC column. */
+ if (prebuilt->table != NULL && table->found_next_number_field != NULL) {
+ ulint error;
+
+ dict_table_autoinc_lock(prebuilt->table);
+
+ /* Since a table can already be "open" in InnoDB's internal
+ data dictionary, we only init the autoinc counter once, the
+ first time the table is loaded. We can safely reuse the
+ autoinc value from a previous MySQL open. */
+ if (dict_table_autoinc_read(prebuilt->table) == 0) {
+
+ error = innobase_initialize_autoinc();
+ /* Should always succeed! */
+ ut_a(error == DB_SUCCESS);
+ }
+
+ dict_table_autoinc_unlock(prebuilt->table);
+ }
+
DBUG_RETURN(0);
}
@@ -3284,6 +3437,59 @@ skip_field:
}
/************************************************************************
+Get the upper limit of the MySQL integral type. */
+
+ulonglong
+ha_innobase::innobase_get_int_col_max_value(
+/*========================================*/
+ const Field* field)
+{
+ ulonglong max_value = 0;
+
+ switch(field->key_type()) {
+ /* TINY */
+ case HA_KEYTYPE_BINARY:
+ max_value = 0xFFULL;
+ break;
+ case HA_KEYTYPE_INT8:
+ max_value = 0x7FULL;
+ break;
+ /* SHORT */
+ case HA_KEYTYPE_USHORT_INT:
+ max_value = 0xFFFFULL;
+ break;
+ case HA_KEYTYPE_SHORT_INT:
+ max_value = 0x7FFFULL;
+ break;
+ /* MEDIUM */
+ case HA_KEYTYPE_UINT24:
+ max_value = 0xFFFFFFULL;
+ break;
+ case HA_KEYTYPE_INT24:
+ max_value = 0x7FFFFFULL;
+ break;
+ /* LONG */
+ case HA_KEYTYPE_ULONG_INT:
+ max_value = 0xFFFFFFFFULL;
+ break;
+ case HA_KEYTYPE_LONG_INT:
+ max_value = 0x7FFFFFFFULL;
+ break;
+ /* BIG */
+ case HA_KEYTYPE_ULONGLONG:
+ max_value = 0xFFFFFFFFFFFFFFFFULL;
+ break;
+ case HA_KEYTYPE_LONGLONG:
+ max_value = 0x7FFFFFFFFFFFFFFFULL;
+ break;
+ default:
+ ut_error;
+ }
+
+ return(max_value);
+}
+
+/************************************************************************
This special handling is really to overcome the limitations of MySQL's
binlogging. We need to eliminate the non-determinism that will arise in
INSERT ... SELECT type of statements, since MySQL binlog only stores the
@@ -3291,7 +3497,7 @@ min value of the autoinc interval. Once that is fixed we can get rid of
the special lock handling.*/
ulong
-ha_innobase::innobase_autoinc_lock(void)
+ha_innobase::innobase_lock_autoinc(void)
/*====================================*/
/* out: DB_SUCCESS if all OK else
error code */
@@ -3356,7 +3562,7 @@ ha_innobase::innobase_reset_autoinc(
{
ulint error;
- error = innobase_autoinc_lock();
+ error = innobase_lock_autoinc();
if (error == DB_SUCCESS) {
@@ -3381,11 +3587,11 @@ ha_innobase::innobase_set_max_autoinc(
{
ulint error;
- error = innobase_autoinc_lock();
+ error = innobase_lock_autoinc();
if (error == DB_SUCCESS) {
- dict_table_autoinc_update(prebuilt->table, auto_inc);
+ dict_table_autoinc_update_if_greater(prebuilt->table, auto_inc);
dict_table_autoinc_unlock(prebuilt->table);
}
@@ -3403,7 +3609,8 @@ ha_innobase::write_row(
/* out: error code */
uchar* record) /* in: a row in MySQL format */
{
- int error = 0;
+ ulint error = 0;
+ int error_result= 0;
ibool auto_inc_used= FALSE;
ulint sql_command;
trx_t* trx = thd_to_trx(user_thd);
@@ -3505,8 +3712,21 @@ no_commit:
/* This is the case where the table has an auto-increment column */
if (table->next_number_field && record == table->record[0]) {
+ /* Reset the error code before calling
+ innobase_get_auto_increment(). */
+ prebuilt->autoinc_error = DB_SUCCESS;
+
if ((error = update_auto_increment())) {
+ /* We don't want to mask autoinc overflow errors. */
+ if (prebuilt->autoinc_error != DB_SUCCESS) {
+ error = (int) prebuilt->autoinc_error;
+
+ goto report_error;
+ }
+
+ /* MySQL errors are passed straight back. */
+ error_result = (int) error;
goto func_exit;
}
@@ -3530,6 +3750,7 @@ no_commit:
if (auto_inc_used) {
ulint err;
ulonglong auto_inc;
+ ulonglong col_max_value;
/* Note the number of rows processed for this statement, used
by get_auto_increment() to determine the number of AUTO-INC
@@ -3539,6 +3760,11 @@ no_commit:
--trx->n_autoinc_rows;
}
+ /* We need the upper limit of the col type to check for
+ whether we update the table autoinc counter or not. */
+ col_max_value = innobase_get_int_col_max_value(
+ table->next_number_field);
+
/* Get the value that MySQL attempted to store in the table.*/
auto_inc = table->next_number_field->val_int();
@@ -3577,27 +3803,24 @@ no_commit:
update the table upper limit. Note: last_value
will be 0 if get_auto_increment() was not called.*/
- if (auto_inc > prebuilt->last_value) {
+ if (auto_inc <= col_max_value
+ && auto_inc > prebuilt->autoinc_last_value) {
set_max_autoinc:
- ut_a(prebuilt->table->autoinc_increment > 0);
+ ut_a(prebuilt->autoinc_increment > 0);
- ulonglong have;
ulonglong need;
+ ulonglong offset;
- /* Check for overflow conditions. */
- need = prebuilt->table->autoinc_increment;
- have = ~0x0ULL - auto_inc;
+ offset = prebuilt->autoinc_offset;
+ need = prebuilt->autoinc_increment;
- if (have < need) {
- need = have;
- }
-
- auto_inc += need;
+ auto_inc = innobase_next_autoinc(
+ auto_inc, need, offset, col_max_value);
err = innobase_set_max_autoinc(auto_inc);
if (err != DB_SUCCESS) {
- error = (int) err;
+ error = err;
}
}
break;
@@ -3606,12 +3829,13 @@ set_max_autoinc:
innodb_srv_conc_exit_innodb(prebuilt->trx);
- error = convert_error_code_to_mysql(error, user_thd);
+report_error:
+ error_result = convert_error_code_to_mysql((int) error, user_thd);
func_exit:
innobase_active_small();
- DBUG_RETURN(error);
+ DBUG_RETURN(error_result);
}
/**************************************************************************
@@ -3787,6 +4011,8 @@ ha_innobase::update_row(
ut_a(prebuilt->trx == trx);
+ ha_statistic_increment(&SSV::ha_update_count);
+
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
@@ -3827,12 +4053,26 @@ ha_innobase::update_row(
&& (trx->duplicates & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))
== TRX_DUP_IGNORE) {
- longlong auto_inc;
+ ulonglong auto_inc;
+ ulonglong col_max_value;
auto_inc = table->next_number_field->val_int();
- if (auto_inc != 0) {
- auto_inc += prebuilt->table->autoinc_increment;
+ /* We need the upper limit of the col type to check for
+ whether we update the table autoinc counter or not. */
+ col_max_value = innobase_get_int_col_max_value(
+ table->next_number_field);
+
+ if (auto_inc <= col_max_value && auto_inc != 0) {
+
+ ulonglong need;
+ ulonglong offset;
+
+ offset = prebuilt->autoinc_offset;
+ need = prebuilt->autoinc_increment;
+
+ auto_inc = innobase_next_autoinc(
+ auto_inc, need, offset, col_max_value);
error = innobase_set_max_autoinc(auto_inc);
}
@@ -3876,29 +4116,7 @@ ha_innobase::delete_row(
ut_a(prebuilt->trx == trx);
- /* Only if the table has an AUTOINC column */
- if (table->found_next_number_field && record == table->record[0]) {
- ulonglong dummy = 0;
-
- /* First check whether the AUTOINC sub-system has been
- initialized using the AUTOINC mutex. If not then we
- do it the "proper" way, by acquiring the heavier locks. */
- dict_table_autoinc_lock(prebuilt->table);
-
- if (!prebuilt->table->autoinc_inited) {
- dict_table_autoinc_unlock(prebuilt->table);
-
- error = innobase_get_auto_increment(&dummy);
-
- if (error == DB_SUCCESS) {
- dict_table_autoinc_unlock(prebuilt->table);
- } else {
- goto error_exit;
- }
- } else {
- dict_table_autoinc_unlock(prebuilt->table);
- }
- }
+ ha_statistic_increment(&SSV::ha_delete_count);
if (!prebuilt->upd_node) {
row_get_prebuilt_update_vector(prebuilt);
@@ -3914,7 +4132,6 @@ ha_innobase::delete_row(
innodb_srv_conc_exit_innodb(trx);
-error_exit:
error = convert_error_code_to_mysql(error, user_thd);
/* Tell the InnoDB server that there might be work for
@@ -3946,7 +4163,8 @@ ha_innobase::unlock_row(void)
switch (prebuilt->row_read_type) {
case ROW_READ_WITH_LOCKS:
if (!srv_locks_unsafe_for_binlog
- || prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED) {
+ && prebuilt->trx->isolation_level
+ != TRX_ISO_READ_COMMITTED) {
break;
}
/* fall through */
@@ -5018,6 +5236,29 @@ ha_innobase::create(
DBUG_ENTER("ha_innobase::create");
DBUG_ASSERT(thd != NULL);
+ DBUG_ASSERT(create_info != NULL);
+
+#ifdef __WIN__
+ /* Names passed in from server are in two formats:
+ 1. <database_name>/<table_name>: for normal table creation
+ 2. full path: for temp table creation, or sym link
+
+ When srv_file_per_table is on, check for full path pattern, i.e.
+ X:\dir\..., X is a driver letter, or
+ \\dir1\dir2\..., UNC path
+ returns error if it is in full path format, but not creating a temp.
+ table. Currently InnoDB does not support symbolic link on Windows. */
+
+ if (srv_file_per_table
+ && (!create_info->options & HA_LEX_CREATE_TMP_TABLE)) {
+
+ if ((name[1] == ':')
+ || (name[0] == '\\' && name[1] == '\\')) {
+ sql_print_error("Cannot create table %s\n", name);
+ DBUG_RETURN(HA_ERR_GENERIC);
+ }
+ }
+#endif
if (form->s->fields > 1000) {
/* The limit probably should be REC_MAX_N_FIELDS - 3 = 1020,
@@ -5248,7 +5489,8 @@ ha_innobase::delete_all_rows(void)
if (thd_sql_command(user_thd) != SQLCOM_TRUNCATE) {
fallback:
/* We only handle TRUNCATE TABLE t as a special case.
- DELETE FROM t will have to use ha_innobase::delete_row(). */
+ DELETE FROM t will have to use ha_innobase::delete_row(),
+ because DELETE is transactional while TRUNCATE is not. */
DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
}
@@ -5769,7 +6011,7 @@ ha_innobase::info(
ib_table = prebuilt->table;
if (flag & HA_STATUS_TIME) {
- if (srv_stats_on_metadata) {
+ if (innobase_stats_on_metadata) {
/* In sql_show we call with this flag: update
then statistics so that they are up-to-date */
@@ -5817,11 +6059,13 @@ ha_innobase::info(
n_rows++;
}
- /* Fix bug#29507: TRUNCATE shows too many rows affected.
- Do not show the estimates for TRUNCATE command. */
+ /* Fix bug#40386: Not flushing query cache after truncate.
+ n_rows can not be 0 unless the table is empty, set to 1
+ instead. The original problem of bug#29507 is actually
+ fixed in the server code. */
if (thd_sql_command(user_thd) == SQLCOM_TRUNCATE) {
- n_rows = 0;
+ n_rows = 1;
/* We need to reset the prebuilt value too, otherwise
checks for values greater than the last value written
@@ -5829,7 +6073,7 @@ ha_innobase::info(
not be updated. This will force write_row() into
attempting an update of the table's AUTOINC counter. */
- prebuilt->last_value = 0;
+ prebuilt->autoinc_last_value = 0;
}
stats.records = (ha_rows)n_rows;
@@ -5850,9 +6094,39 @@ ha_innobase::info(
so the "old" value can remain. delete_length is initialized
to 0 in the ha_statistics' constructor. */
if (!(flag & HA_STATUS_NO_LOCK)) {
- stats.delete_length =
- fsp_get_available_space_in_free_extents(
- ib_table->space) * 1024;
+
+ /* lock the data dictionary to avoid races with
+ ibd_file_missing and tablespace_discarded */
+ row_mysql_lock_data_dictionary(prebuilt->trx);
+
+ /* ib_table->space must be an existent tablespace */
+ if (!ib_table->ibd_file_missing
+ && !ib_table->tablespace_discarded) {
+
+ stats.delete_length =
+ fsp_get_available_space_in_free_extents(
+ ib_table->space) * 1024;
+ } else {
+
+ THD* thd;
+
+ thd = ha_thd();
+
+ push_warning_printf(
+ thd,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_CANT_GET_STAT,
+ "InnoDB: Trying to get the free "
+ "space for table %s but its "
+ "tablespace has been discarded or "
+ "the .ibd file is missing. Setting "
+ "the free space to zero.",
+ ib_table->name);
+
+ stats.delete_length = 0;
+ }
+
+ row_mysql_unlock_data_dictionary(prebuilt->trx);
}
stats.check_time = 0;
@@ -5937,29 +6211,7 @@ ha_innobase::info(
}
if (flag & HA_STATUS_AUTO && table->found_next_number_field) {
- ulonglong auto_inc;
- int ret;
-
- /* The following function call can the first time fail in
- a lock wait timeout error because it reserves the auto-inc
- lock on the table. If it fails, then someone is already initing
- the auto-inc counter, and the second call is guaranteed to
- succeed. */
-
- ret = innobase_read_and_init_auto_inc(&auto_inc);
-
- if (ret != 0) {
- ret = innobase_read_and_init_auto_inc(&auto_inc);
-
- if (ret != 0) {
- sql_print_error("Cannot get table %s auto-inc"
- "counter value in ::info\n",
- ib_table->name);
- auto_inc = 0;
- }
- }
-
- stats.auto_increment_value = auto_inc;
+ stats.auto_increment_value = innobase_peek_autoinc();
}
prebuilt->trx->op_info = (char*)"";
@@ -6422,15 +6674,26 @@ ha_innobase::extra(
return(0);
}
+/**********************************************************************
+Reset state of file to after 'open'.
+This function is called after every statement for all tables used
+by that statement. */
int ha_innobase::reset()
{
- if (prebuilt->blob_heap) {
- row_mysql_prebuilt_free_blob_heap(prebuilt);
- }
- reset_template(prebuilt);
- return 0;
-}
+ if (prebuilt->blob_heap) {
+ row_mysql_prebuilt_free_blob_heap(prebuilt);
+ }
+ reset_template(prebuilt);
+
+ /* TODO: This should really be reset in reset_template() but for now
+ it's safer to do it explicitly here. */
+
+ /* This is a statement level counter. */
+ prebuilt->autoinc_last_value = 0;
+
+ return(0);
+}
/**********************************************************************
MySQL calls this function at the start of each SQL statement inside LOCK
@@ -7305,169 +7568,59 @@ ha_innobase::store_lock(
return(to);
}
-/***********************************************************************
-This function initializes the auto-inc counter if it has not been
-initialized yet. This function does not change the value of the auto-inc
-counter if it already has been initialized. In parameter ret returns
-the value of the auto-inc counter. */
-
-int
-ha_innobase::innobase_read_and_init_auto_inc(
-/*=========================================*/
- /* out: 0 or generic MySQL
- error code */
- ulonglong* value) /* out: the autoinc value */
-{
- ulonglong auto_inc;
- ibool stmt_start;
- int mysql_error = 0;
- dict_table_t* innodb_table = prebuilt->table;
- ibool trx_was_not_started = FALSE;
-
- ut_a(prebuilt);
- ut_a(prebuilt->table);
-
- /* Remember if we are in the beginning of an SQL statement.
- This function must not change that flag. */
- stmt_start = prebuilt->sql_stat_start;
-
- /* Prepare prebuilt->trx in the table handle */
- update_thd(ha_thd());
-
- if (prebuilt->trx->conc_state == TRX_NOT_STARTED) {
- trx_was_not_started = TRUE;
- }
-
- /* In case MySQL calls this in the middle of a SELECT query, release
- possible adaptive hash latch to avoid deadlocks of threads */
-
- trx_search_latch_release_if_reserved(prebuilt->trx);
-
- dict_table_autoinc_lock(prebuilt->table);
-
- auto_inc = dict_table_autoinc_read(prebuilt->table);
-
- /* Was the AUTOINC counter reset during normal processing, if
- so then we simply start count from 1. No need to go to the index.*/
- if (auto_inc == 0 && innodb_table->autoinc_inited) {
- ++auto_inc;
- dict_table_autoinc_initialize(innodb_table, auto_inc);
- }
-
- if (auto_inc == 0) {
- dict_index_t* index;
- ulint error;
- const char* autoinc_col_name;
-
- ut_a(!innodb_table->autoinc_inited);
-
- index = innobase_get_index(table->s->next_number_index);
-
- autoinc_col_name = table->found_next_number_field->field_name;
-
- error = row_search_max_autoinc(
- index, autoinc_col_name, &auto_inc);
-
- if (error == DB_SUCCESS) {
- if (auto_inc < ~0x0ULL) {
- ++auto_inc;
- }
- dict_table_autoinc_initialize(innodb_table, auto_inc);
- } else {
- ut_print_timestamp(stderr);
- fprintf(stderr, " InnoDB: Error: (%lu) Couldn't read "
- "the max AUTOINC value from the index (%s).\n",
- error, index->name);
-
- mysql_error = 1;
- }
- }
-
- *value = auto_inc;
-
- dict_table_autoinc_unlock(prebuilt->table);
-
- /* Since MySQL does not seem to call autocommit after SHOW TABLE
- STATUS (even if we would register the trx here), we commit our
- transaction here if it was started here. This is to eliminate a
- dangling transaction. If the user had AUTOCOMMIT=0, then SHOW
- TABLE STATUS does leave a dangling transaction if the user does not
- himself call COMMIT. */
-
- if (trx_was_not_started) {
-
- innobase_commit_low(prebuilt->trx);
- }
-
- prebuilt->sql_stat_start = stmt_start;
-
- return(mysql_error);
-}
-
/*******************************************************************************
-Read the next autoinc value, initialize the table if it's not initialized.
-On return if there is no error then the tables AUTOINC lock is locked.*/
+Read the next autoinc value. Acquire the relevant locks before reading
+the AUTOINC value. If SUCCESS then the table AUTOINC mutex will be locked
+on return and all relevant locks acquired. */
ulong
-ha_innobase::innobase_get_auto_increment(
-/*=====================================*/
+ha_innobase::innobase_get_autoinc(
+/*==============================*/
+ /* out: DB_SUCCESS or error code */
ulonglong* value) /* out: autoinc value */
{
- ulong error;
+ *value = 0;
+
+ prebuilt->autoinc_error = innobase_lock_autoinc();
- *value = 0;
+ if (prebuilt->autoinc_error == DB_SUCCESS) {
- /* Note: If the table is not initialized when we attempt the
- read below. We initialize the table's auto-inc counter and
- always do a reread of the AUTOINC value. */
- do {
- error = innobase_autoinc_lock();
+ /* Determine the first value of the interval */
+ *value = dict_table_autoinc_read(prebuilt->table);
- if (error == DB_SUCCESS) {
- ulonglong autoinc;
+ /* It should have been initialized during open. */
+ ut_a(*value != 0);
+ }
+
+ return(ulong(prebuilt->autoinc_error));
+}
- /* Determine the first value of the interval */
- autoinc = dict_table_autoinc_read(prebuilt->table);
+/***********************************************************************
+This function reads the global auto-inc counter. It doesn't use the
+AUTOINC lock even if the lock mode is set to TRADITIONAL. */
- /* We need to initialize the AUTO-INC value, for
- that we release all locks.*/
- if (autoinc == 0) {
- trx_t* trx;
+ulonglong
+ha_innobase::innobase_peek_autoinc()
+/*================================*/
+ /* out: the autoinc value */
+{
+ ulonglong auto_inc;
+ dict_table_t* innodb_table;
- trx = prebuilt->trx;
- dict_table_autoinc_unlock(prebuilt->table);
+ ut_a(prebuilt != NULL);
+ ut_a(prebuilt->table != NULL);
- /* If we had reserved the AUTO-INC
- lock in this SQL statement we release
- it before retrying.*/
- row_unlock_table_autoinc_for_mysql(trx);
+ innodb_table = prebuilt->table;
- /* Just to make sure */
- ut_a(!trx->auto_inc_lock);
+ dict_table_autoinc_lock(innodb_table);
- int mysql_error;
+ auto_inc = dict_table_autoinc_read(innodb_table);
- mysql_error = innobase_read_and_init_auto_inc(
- &autoinc);
+ ut_a(auto_inc > 0);
- if (mysql_error) {
- error = DB_ERROR;
- }
- } else {
- *value = autoinc;
- }
- /* A deadlock error during normal processing is OK
- and can be ignored. */
- } else if (error != DB_DEADLOCK) {
-
- sql_print_error("InnoDB: Error: %lu in "
- "::innobase_get_auto_increment()",
- error);
- }
-
- } while (*value == 0 && error == DB_SUCCESS);
-
- return(error);
+ dict_table_autoinc_unlock(innodb_table);
+
+ return(auto_inc);
}
/*******************************************************************************
@@ -7494,7 +7647,7 @@ ha_innobase::get_auto_increment(
/* Prepare prebuilt->trx in the table handle */
update_thd(ha_thd());
- error = innobase_get_auto_increment(&autoinc);
+ error = innobase_get_autoinc(&autoinc);
if (error != DB_SUCCESS) {
*first_value = (~(ulonglong) 0);
@@ -7530,7 +7683,7 @@ ha_innobase::get_auto_increment(
set_if_bigger(*first_value, autoinc);
/* Not in the middle of a mult-row INSERT. */
- } else if (prebuilt->last_value == 0) {
+ } else if (prebuilt->autoinc_last_value == 0) {
set_if_bigger(*first_value, autoinc);
}
@@ -7539,35 +7692,40 @@ ha_innobase::get_auto_increment(
/* With old style AUTOINC locking we only update the table's
AUTOINC counter after attempting to insert the row. */
if (innobase_autoinc_lock_mode != AUTOINC_OLD_STYLE_LOCKING) {
- ulonglong have;
ulonglong need;
+ ulonglong next_value;
+ ulonglong col_max_value;
- /* Check for overflow conditions. */
- need = *nb_reserved_values * increment;
- have = ~0x0ULL - *first_value;
+ /* We need the upper limit of the col type to check for
+ whether we update the table autoinc counter or not. */
+ col_max_value = innobase_get_int_col_max_value(
+ table->next_number_field);
- if (have < need) {
- need = have;
- }
+ need = *nb_reserved_values * increment;
/* Compute the last value in the interval */
- prebuilt->last_value = *first_value + need;
+ next_value = innobase_next_autoinc(
+ *first_value, need, offset, col_max_value);
- ut_a(prebuilt->last_value >= *first_value);
+ prebuilt->autoinc_last_value = next_value;
+
+ ut_a(prebuilt->autoinc_last_value >= *first_value);
/* Update the table autoinc variable */
- dict_table_autoinc_update(
- prebuilt->table, prebuilt->last_value);
+ dict_table_autoinc_update_if_greater(
+ prebuilt->table, prebuilt->autoinc_last_value);
} else {
/* This will force write_row() into attempting an update
of the table's AUTOINC counter. */
- prebuilt->last_value = 0;
+ prebuilt->autoinc_last_value = 0;
}
/* The increment to be used to increase the AUTOINC value, we use
this in write_row() and update_row() to increase the autoinc counter
- for columns that are filled by the user.*/
- prebuilt->table->autoinc_increment = increment;
+ for columns that are filled by the user. We need the offset and
+ the increment. */
+ prebuilt->autoinc_offset = offset;
+ prebuilt->autoinc_increment = increment;
dict_table_autoinc_unlock(prebuilt->table);
}
@@ -7592,6 +7750,11 @@ ha_innobase::reset_auto_increment(
DBUG_RETURN(error);
}
+ /* The next value can never be 0. */
+ if (value == 0) {
+ value = 1;
+ }
+
innobase_reset_autoinc(value);
DBUG_RETURN(0);
@@ -8146,7 +8309,7 @@ static MYSQL_SYSVAR_BOOL(status_file, innobase_create_status_file,
NULL, NULL, FALSE);
static MYSQL_SYSVAR_BOOL(stats_on_metadata, innobase_stats_on_metadata,
- PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_NOSYSVAR,
+ PLUGIN_VAR_OPCMDARG,
"Enable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)",
NULL, NULL, TRUE);
@@ -8159,7 +8322,7 @@ static MYSQL_SYSVAR_BOOL(adaptive_hash_index, innobase_adaptive_hash_index,
static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.",
- NULL, NULL, 8*1024*1024L, 2*1024*1024L, ~0L, 1024);
+ NULL, NULL, 8*1024*1024L, 2*1024*1024L, LONG_MAX, 1024);
static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
PLUGIN_VAR_RQCMDARG,
@@ -8209,7 +8372,7 @@ static MYSQL_SYSVAR_LONG(lock_wait_timeout, innobase_lock_wait_timeout,
static MYSQL_SYSVAR_LONG(log_buffer_size, innobase_log_buffer_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"The size of the buffer which InnoDB uses to write log to the log files on disk.",
- NULL, NULL, 16*1024*1024L, 2*1024*1024L, ~0L, 1024);
+ NULL, NULL, 16*1024*1024L, 2*1024*1024L, LONG_MAX, 1024);
static MYSQL_SYSVAR_LONGLONG(log_file_size, innobase_log_file_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
@@ -8229,7 +8392,7 @@ static MYSQL_SYSVAR_LONG(mirrored_log_groups, innobase_mirrored_log_groups,
static MYSQL_SYSVAR_LONG(open_files, innobase_open_files,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"How many files at the maximum InnoDB keeps open at the same time.",
- NULL, NULL, 300L, 10L, ~0L, 0);
+ NULL, NULL, 300L, 10L, LONG_MAX, 0);
static MYSQL_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds,
PLUGIN_VAR_RQCMDARG,
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 4ffcdb1e3c2..8ca72ee1a60 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -72,12 +72,15 @@ class ha_innobase: public handler
int update_thd(THD* thd);
int change_active_index(uint keynr);
int general_fetch(uchar* buf, uint direction, uint match_mode);
- int innobase_read_and_init_auto_inc(ulonglong* ret);
- ulong innobase_autoinc_lock();
+ ulong innobase_lock_autoinc();
+ ulonglong innobase_peek_autoinc();
ulong innobase_set_max_autoinc(ulonglong auto_inc);
ulong innobase_reset_autoinc(ulonglong auto_inc);
- ulong innobase_get_auto_increment(ulonglong* value);
+ ulong innobase_get_autoinc(ulonglong* value);
+ ulong innobase_update_autoinc(ulonglong auto_inc);
+ ulong innobase_initialize_autoinc();
dict_index_t* innobase_get_index(uint keynr);
+ ulonglong innobase_get_int_col_max_value(const Field* field);
/* Init values for the class: */
public:
diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h
index 281587ad060..6d1c2bb86d3 100644
--- a/storage/innobase/include/btr0sea.h
+++ b/storage/innobase/include/btr0sea.h
@@ -40,6 +40,14 @@ btr_search_info_create(
/*===================*/
/* out, own: search info struct */
mem_heap_t* heap); /* in: heap where created */
+/*********************************************************************
+Returns the value of ref_count. The value is protected by
+btr_search_latch. */
+ulint
+btr_search_info_get_ref_count(
+/*==========================*/
+ /* out: ref_count value. */
+ btr_search_t* info); /* in: search info. */
/*************************************************************************
Updates the search info. */
UNIV_INLINE
@@ -137,6 +145,13 @@ btr_search_validate(void);
/* The search info struct in an index */
struct btr_search_struct{
+ ulint ref_count; /* Number of blocks in this index tree
+ that have search index built
+ i.e. block->index points to this index.
+ Protected by btr_search_latch except
+ when during initialization in
+ btr_search_info_create(). */
+
/* The following fields are not protected by any latch.
Unfortunately, this means that they must be aligned to
the machine word, i.e., they cannot be turned into bit-fields. */
diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic
index b8c24bb074a..ad0f95755d2 100644
--- a/storage/innobase/include/data0type.ic
+++ b/storage/innobase/include/data0type.ic
@@ -558,5 +558,5 @@ dtype_get_sql_null_size(
const dtype_t* type) /* in: type */
{
return(dtype_get_fixed_size_low(type->mtype, type->prtype, type->len,
- type->mbminlen, type->mbmaxlen) > 0);
+ type->mbminlen, type->mbmaxlen));
}
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index f60775c8c2f..7d5ff09c7a6 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -178,8 +178,7 @@ dict_table_autoinc_lock(
/*====================*/
dict_table_t* table); /* in: table */
/************************************************************************
-Initializes the autoinc counter. It is not an error to initialize an already
-initialized counter. */
+Unconditionally set the autoinc counter. */
void
dict_table_autoinc_initialize(
@@ -196,12 +195,12 @@ dict_table_autoinc_read(
/* out: value for a new row, or 0 */
dict_table_t* table); /* in: table */
/************************************************************************
-Updates the autoinc counter if the value supplied is equal or bigger than the
-current value. If not inited, does nothing. */
+Updates the autoinc counter if the value supplied is greater than the
+current value. */
void
-dict_table_autoinc_update(
-/*======================*/
+dict_table_autoinc_update_if_greater(
+/*=================================*/
dict_table_t* table, /* in: table */
ib_ulonglong value); /* in: value which was assigned to a row */
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 2fe72498989..ac28fdb1bae 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -405,17 +405,8 @@ struct dict_table_struct{
mutex_t autoinc_mutex;
/* mutex protecting the autoincrement
counter */
- ibool autoinc_inited;
- /* TRUE if the autoinc counter has been
- inited; MySQL gets the init value by executing
- SELECT MAX(auto inc column) */
ib_ulonglong autoinc;/* autoinc counter value to give to the
next inserted row */
-
- ib_longlong autoinc_increment;
- /* The increment step of the auto increment
- column. Value must be greater than or equal
- to 1 */
ulong n_waiting_or_granted_auto_inc_locks;
/* This counter is used to track the number
of granted and pending autoinc locks on this
@@ -425,6 +416,7 @@ struct dict_table_struct{
acquired the AUTOINC lock or not. Of course
only one transaction can be granted the
lock but there can be multiple waiters. */
+ /*----------------------*/
#ifdef UNIV_DEBUG
ulint magic_n;/* magic number */
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index ef0722321af..6bfc43579b3 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -63,5 +63,14 @@ thd_has_edited_nontrans_tables(
been edited */
void* thd); /* in: thread handle (THD*) */
+/**********************************************************************
+Returns true if the thread is executing a SELECT statement. */
+
+ibool
+thd_is_select(
+/*==========*/
+ /* out: true if thd is executing SELECT */
+ const void* thd); /* in: thread handle (THD*) */
+
#endif
#endif
diff --git a/storage/innobase/include/hash0hash.ic b/storage/innobase/include/hash0hash.ic
index 49bcc7b31d0..d246d8ee831 100644
--- a/storage/innobase/include/hash0hash.ic
+++ b/storage/innobase/include/hash0hash.ic
@@ -58,7 +58,8 @@ hash_get_mutex_no(
hash_table_t* table, /* in: hash table */
ulint fold) /* in: fold */
{
- return(ut_2pow_remainder(fold, table->n_mutexes));
+ return(ut_2pow_remainder(hash_calc_hash(fold, table),
+ table->n_mutexes));
}
/****************************************************************
diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h
index 8b08b6284f6..635724bf5a1 100644
--- a/storage/innobase/include/lock0lock.h
+++ b/storage/innobase/include/lock0lock.h
@@ -463,14 +463,21 @@ void
lock_cancel_waiting_and_release(
/*============================*/
lock_t* lock); /* in: waiting lock request */
+
/*************************************************************************
-Resets all locks, both table and record locks, on a table to be dropped.
-No lock is allowed to be a wait lock. */
+Removes locks on a table to be dropped or truncated.
+If remove_also_table_sx_locks is TRUE then table-level S and X locks are
+also removed in addition to other table-level and record-level locks.
+No lock, that is going to be removed, is allowed to be a wait lock. */
void
-lock_reset_all_on_table(
-/*====================*/
- dict_table_t* table); /* in: table to be dropped */
+lock_remove_all_on_table(
+/*=====================*/
+ dict_table_t* table, /* in: table to be dropped
+ or truncated */
+ ibool remove_also_table_sx_locks);/* in: also removes
+ table S and X locks */
+
/*************************************************************************
Calculates the fold value of a page file address: used in inserting or
searching for a lock in the hash table. */
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index ca9d9c6b8f8..9b2f3250486 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -594,6 +594,8 @@ struct row_prebuilt_struct {
byte* ins_upd_rec_buff;/* buffer for storing data converted
to the Innobase format from the MySQL
format */
+ const byte* default_rec; /* the default values of all columns
+ (a "default row") in MySQL format */
ulint hint_need_to_fetch_extra_cols;
/* normally this is set to 0; if this
is set to ROW_RETRIEVE_PRIMARY_KEY,
@@ -683,7 +685,21 @@ struct row_prebuilt_struct {
to this heap */
mem_heap_t* old_vers_heap; /* memory heap where a previous
version is built in consistent read */
- ulonglong last_value; /* last value of AUTO-INC interval */
+ /*----------------------*/
+ ulonglong autoinc_last_value;/* last value of AUTO-INC interval */
+ ulonglong autoinc_increment;/* The increment step of the auto
+ increment column. Value must be
+ greater than or equal to 1. Required to
+ calculate the next value */
+ ulonglong autoinc_offset; /* The offset passed to
+ get_auto_increment() by MySQL. Required
+ to calculate the next value */
+ ulint autoinc_error; /* The actual error code encountered
+ while trying to init or read the
+ autoinc value from the table. We
+ store it here so that we can return
+ it to MySQL */
+ /*----------------------*/
ulint magic_n2; /* this should be the same as
magic_n */
};
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index 3f9465175c1..6816823641c 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -139,8 +139,6 @@ extern ulint srv_fast_shutdown; /* If this is 1, do not do a
transactions). */
extern ibool srv_innodb_status;
-extern ibool srv_stats_on_metadata;
-
extern ibool srv_use_doublewrite_buf;
extern ibool srv_use_checksums;
diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic
index f48077e43fe..f5a85e0e7fb 100644
--- a/storage/innobase/include/sync0sync.ic
+++ b/storage/innobase/include/sync0sync.ic
@@ -185,7 +185,7 @@ mutex_exit(
{
ut_ad(mutex_own(mutex));
- ut_d(mutex->thread_id = ULINT_UNDEFINED);
+ ut_d(mutex->thread_id = (os_thread_id_t) ULINT_UNDEFINED);
#ifdef UNIV_SYNC_DEBUG
sync_thread_reset_level(mutex);
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index 17c5f0a665c..95d7ba017f1 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -163,11 +163,15 @@ ib_time_t
ut_time(void);
/*=========*/
/**************************************************************
-Returns system time in args, 0 on success. */
+Returns system time.
+Upon successful completion, the value 0 is returned; otherwise the
+value -1 is returned and the global variable errno is set to indicate the
+error. */
int
ut_usectime(
/*========*/
+ /* out: 0 on success, -1 otherwise */
ulint* sec, /* out: seconds since the Epoch */
ulint* ms); /* out: microseconds since the Epoch+*sec */
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index c2ede22dccb..173d074cb82 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -3920,15 +3920,25 @@ lock_cancel_waiting_and_release(
trx_end_lock_wait(lock->trx);
}
+/* True if a lock mode is S or X */
+#define IS_LOCK_S_OR_X(lock) \
+ (lock_get_mode(lock) == LOCK_S \
+ || lock_get_mode(lock) == LOCK_X)
+
+
/*************************************************************************
-Resets all record and table locks of a transaction on a table to be dropped.
-No lock is allowed to be a wait lock. */
+Removes locks of a transaction on a table to be dropped.
+If remove_also_table_sx_locks is TRUE then table-level S and X locks are
+also removed in addition to other table-level and record-level locks.
+No lock, that is going to be removed, is allowed to be a wait lock. */
static
void
-lock_reset_all_on_table_for_trx(
-/*============================*/
- dict_table_t* table, /* in: table to be dropped */
- trx_t* trx) /* in: a transaction */
+lock_remove_all_on_table_for_trx(
+/*=============================*/
+ dict_table_t* table, /* in: table to be dropped */
+ trx_t* trx, /* in: a transaction */
+ ibool remove_also_table_sx_locks)/* in: also removes
+ table S and X locks */
{
lock_t* lock;
lock_t* prev_lock;
@@ -3946,7 +3956,9 @@ lock_reset_all_on_table_for_trx(
lock_rec_discard(lock);
} else if (lock_get_type(lock) & LOCK_TABLE
- && lock->un_member.tab_lock.table == table) {
+ && lock->un_member.tab_lock.table == table
+ && (remove_also_table_sx_locks
+ || !IS_LOCK_S_OR_X(lock))) {
ut_a(!lock_get_wait(lock));
@@ -3958,26 +3970,65 @@ lock_reset_all_on_table_for_trx(
}
/*************************************************************************
-Resets all locks, both table and record locks, on a table to be dropped.
-No lock is allowed to be a wait lock. */
+Removes locks on a table to be dropped or truncated.
+If remove_also_table_sx_locks is TRUE then table-level S and X locks are
+also removed in addition to other table-level and record-level locks.
+No lock, that is going to be removed, is allowed to be a wait lock. */
void
-lock_reset_all_on_table(
-/*====================*/
- dict_table_t* table) /* in: table to be dropped */
+lock_remove_all_on_table(
+/*=====================*/
+ dict_table_t* table, /* in: table to be dropped
+ or truncated */
+ ibool remove_also_table_sx_locks)/* in: also removes
+ table S and X locks */
{
lock_t* lock;
+ lock_t* prev_lock;
mutex_enter(&kernel_mutex);
lock = UT_LIST_GET_FIRST(table->locks);
- while (lock) {
- ut_a(!lock_get_wait(lock));
+ while (lock != NULL) {
- lock_reset_all_on_table_for_trx(table, lock->trx);
+ prev_lock = UT_LIST_GET_PREV(un_member.tab_lock.locks,
+ lock);
- lock = UT_LIST_GET_FIRST(table->locks);
+ /* If we should remove all locks (remove_also_table_sx_locks
+ is TRUE), or if the lock is not table-level S or X lock,
+ then check we are not going to remove a wait lock. */
+ if (remove_also_table_sx_locks
+ || !(lock_get_type(lock) == LOCK_TABLE
+ && IS_LOCK_S_OR_X(lock))) {
+
+ ut_a(!lock_get_wait(lock));
+ }
+
+ lock_remove_all_on_table_for_trx(table, lock->trx,
+ remove_also_table_sx_locks);
+
+ if (prev_lock == NULL) {
+ if (lock == UT_LIST_GET_FIRST(table->locks)) {
+ /* lock was not removed, pick its successor */
+ lock = UT_LIST_GET_NEXT(
+ un_member.tab_lock.locks, lock);
+ } else {
+ /* lock was removed, pick the first one */
+ lock = UT_LIST_GET_FIRST(table->locks);
+ }
+ } else if (UT_LIST_GET_NEXT(un_member.tab_lock.locks,
+ prev_lock) != lock) {
+ /* If lock was removed by
+ lock_remove_all_on_table_for_trx() then pick the
+ successor of prev_lock ... */
+ lock = UT_LIST_GET_NEXT(
+ un_member.tab_lock.locks, prev_lock);
+ } else {
+ /* ... otherwise pick the successor of lock. */
+ lock = UT_LIST_GET_NEXT(
+ un_member.tab_lock.locks, lock);
+ }
}
mutex_exit(&kernel_mutex);
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index 2907fddc33b..4a9d3334e7d 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -1330,9 +1330,19 @@ try_again:
if (file == INVALID_HANDLE_VALUE) {
*success = FALSE;
- retry = os_file_handle_error(name,
- create_mode == OS_FILE_CREATE ?
- "create" : "open");
+ /* When srv_file_per_table is on, file creation failure may not
+ be critical to the whole instance. Do not crash the server in
+ case of unknown errors. */
+ if (srv_file_per_table) {
+ retry = os_file_handle_error_no_exit(name,
+ create_mode == OS_FILE_CREATE ?
+ "create" : "open");
+ } else {
+ retry = os_file_handle_error(name,
+ create_mode == OS_FILE_CREATE ?
+ "create" : "open");
+ }
+
if (retry) {
goto try_again;
}
@@ -1407,9 +1417,19 @@ try_again:
if (file == -1) {
*success = FALSE;
- retry = os_file_handle_error(name,
- create_mode == OS_FILE_CREATE ?
- "create" : "open");
+ /* When srv_file_per_table is on, file creation failure may not
+ be critical to the whole instance. Do not crash the server in
+ case of unknown errors. */
+ if (srv_file_per_table) {
+ retry = os_file_handle_error_no_exit(name,
+ create_mode == OS_FILE_CREATE ?
+ "create" : "open");
+ } else {
+ retry = os_file_handle_error(name,
+ create_mode == OS_FILE_CREATE ?
+ "create" : "open");
+ }
+
if (retry) {
goto try_again;
} else {
diff --git a/storage/innobase/plug.in b/storage/innobase/plug.in
index b252d471fba..f7d2abed751 100644
--- a/storage/innobase/plug.in
+++ b/storage/innobase/plug.in
@@ -15,25 +15,30 @@ MYSQL_PLUGIN_ACTIONS(innobase, [
AC_CHECK_FUNCS(localtime_r)
AC_C_BIGENDIAN
case "$target_os" in
- lin*)
- CFLAGS="$CFLAGS -DUNIV_LINUX";;
- hpux10*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
- hp*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
- aix*)
- CFLAGS="$CFLAGS -DUNIV_AIX";;
- irix*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
- osf*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
- *solaris*|*SunOS*)
- CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
- sysv5uw7*)
- # Problem when linking on SCO
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
- openbsd*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
+ lin*)
+ CFLAGS="$CFLAGS -DUNIV_LINUX";;
+ hpux10*)
+ CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
+ hp*)
+ CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
+ aix*)
+ CFLAGS="$CFLAGS -DUNIV_AIX";;
+ irix*|osf*|sysv5uw7*|openbsd*)
+ CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
+ *solaris*|*SunOS*)
+ CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
esac
+ INNODB_DYNAMIC_CFLAGS="-DMYSQL_DYNAMIC_PLUGIN"
+ case "$target_cpu" in
+ x86_64)
+ # The AMD64 ABI forbids absolute addresses in shared libraries
+ ;;
+ *86)
+ # Use absolute addresses on IA-32
+ INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
+ ;;
+ esac
+ AC_SUBST(INNODB_DYNAMIC_CFLAGS)
])
+# vim: set ft=config:
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index d5ef12d0af2..088d944cb91 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -342,7 +342,7 @@ row_mysql_store_col_in_innobase_format(
/* In some cases we strip trailing spaces from UTF-8 and other
multibyte charsets, from FIXED-length CHAR columns, to save
space. UTF-8 would otherwise normally use 3 * the string length
- bytes to store a latin1 string! */
+ bytes to store an ASCII string! */
/* We assume that this CHAR field is encoded in a
variable-length character set where spaces have
@@ -620,6 +620,7 @@ row_create_prebuilt(
prebuilt->ins_node = NULL;
prebuilt->ins_upd_rec_buff = NULL;
+ prebuilt->default_rec = NULL;
prebuilt->upd_node = NULL;
prebuilt->ins_graph = NULL;
@@ -661,7 +662,14 @@ row_create_prebuilt(
prebuilt->old_vers_heap = NULL;
- prebuilt->last_value = 0;
+ prebuilt->autoinc_error = 0;
+ prebuilt->autoinc_offset = 0;
+
+ /* Default to 1, we will set the actual value later in
+ ha_innobase::get_auto_increment(). */
+ prebuilt->autoinc_increment = 1;
+
+ prebuilt->autoinc_last_value = 0;
return(prebuilt);
}
@@ -1478,12 +1486,13 @@ row_unlock_for_mysql(
ut_ad(prebuilt && trx);
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
- if (!(srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)) {
+ if (UNIV_UNLIKELY
+ (!srv_locks_unsafe_for_binlog
+ && trx->isolation_level != TRX_ISO_READ_COMMITTED)) {
fprintf(stderr,
"InnoDB: Error: calling row_unlock_for_mysql though\n"
- "InnoDB: srv_locks_unsafe_for_binlog is FALSE and\n"
+ "InnoDB: innodb_locks_unsafe_for_binlog is FALSE and\n"
"InnoDB: this session is not using"
" READ COMMITTED isolation level.\n");
@@ -1963,6 +1972,7 @@ row_create_index_for_mysql(
ulint err;
ulint i, j;
ulint len;
+ char* table_name;
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
@@ -1972,6 +1982,11 @@ row_create_index_for_mysql(
trx->op_info = "creating index";
+ /* Copy the table name because we may want to drop the
+ table later, after the index object is freed (inside
+ que_run_threads()) and thus index->table_name is not available. */
+ table_name = mem_strdup(index->table_name);
+
trx_start_if_not_started(trx);
/* Check that the same column does not appear twice in the index.
@@ -2044,13 +2059,15 @@ error_handling:
trx_general_rollback_for_mysql(trx, FALSE, NULL);
- row_drop_table_for_mysql(index->table_name, trx, FALSE);
+ row_drop_table_for_mysql(table_name, trx, FALSE);
trx->error_state = DB_SUCCESS;
}
trx->op_info = "";
+ mem_free(table_name);
+
return((int) err);
}
@@ -2443,8 +2460,8 @@ row_discard_tablespace_for_mysql(
new_id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID);
- /* Remove any locks there are on the table or its records */
- lock_reset_all_on_table(table);
+ /* Remove all locks except the table-level S and X locks. */
+ lock_remove_all_on_table(table, FALSE);
info = pars_info_create();
@@ -2779,9 +2796,8 @@ row_truncate_table_for_mysql(
goto funct_exit;
}
- /* Remove any locks there are on the table or its records */
-
- lock_reset_all_on_table(table);
+ /* Remove all locks except the table-level S and X locks. */
+ lock_remove_all_on_table(table, FALSE);
trx->table_id = table->id;
@@ -2896,7 +2912,7 @@ next_rec:
/* MySQL calls ha_innobase::reset_auto_increment() which does
the same thing. */
dict_table_autoinc_lock(table);
- dict_table_autoinc_initialize(table, 0);
+ dict_table_autoinc_initialize(table, 1);
dict_table_autoinc_unlock(table);
dict_update_statistics(table);
@@ -3131,9 +3147,8 @@ check_next_foreign:
goto funct_exit;
}
- /* Remove any locks there are on the table or its records */
-
- lock_reset_all_on_table(table);
+ /* Remove all locks there are on the table or its records */
+ lock_remove_all_on_table(table, TRUE);
trx->dict_operation = TRUE;
trx->table_id = table->id;
@@ -3429,8 +3444,6 @@ loop:
err = row_drop_table_for_mysql(table_name, trx, TRUE);
- mem_free(table_name);
-
if (err != DB_SUCCESS) {
fputs("InnoDB: DROP DATABASE ", stderr);
ut_print_name(stderr, trx, TRUE, name);
@@ -3438,8 +3451,11 @@ loop:
(ulint) err);
ut_print_name(stderr, trx, TRUE, table_name);
putc('\n', stderr);
+ mem_free(table_name);
break;
}
+
+ mem_free(table_name);
}
if (err == DB_SUCCESS) {
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index 05721014078..8c3b00a7841 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -32,6 +32,7 @@ Created 12/19/1997 Heikki Tuuri
#include "row0mysql.h"
#include "read0read.h"
#include "buf0lru.h"
+#include "ha_prototypes.h"
/* Maximum number of rows to prefetch; MySQL interface has another parameter */
#define SEL_MAX_N_PREFETCH 16
@@ -2596,6 +2597,7 @@ row_sel_store_mysql_rec(
ulint i;
ut_ad(prebuilt->mysql_template);
+ ut_ad(prebuilt->default_rec);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (UNIV_LIKELY_NULL(prebuilt->blob_heap)) {
@@ -2682,58 +2684,14 @@ row_sel_store_mysql_rec(
&= ~(byte) templ->mysql_null_bit_mask;
}
} else {
- /* MySQL seems to assume the field for an SQL NULL
- value is set to zero or space. Not taking this into
- account caused seg faults with NULL BLOB fields, and
- bug number 154 in the MySQL bug database: GROUP BY
- and DISTINCT could treat NULL values inequal. */
- int pad_char;
+ /* MySQL assumes that the field for an SQL
+ NULL value is set to the default value. */
mysql_rec[templ->mysql_null_byte_offset]
|= (byte) templ->mysql_null_bit_mask;
- switch (templ->type) {
- case DATA_VARCHAR:
- case DATA_BINARY:
- case DATA_VARMYSQL:
- if (templ->mysql_type
- == DATA_MYSQL_TRUE_VARCHAR) {
- /* This is a >= 5.0.3 type
- true VARCHAR. Zero the field. */
- pad_char = 0x00;
- break;
- }
- /* Fall through */
- case DATA_CHAR:
- case DATA_FIXBINARY:
- case DATA_MYSQL:
- /* MySQL pads all string types (except
- BLOB, TEXT and true VARCHAR) with space. */
- if (UNIV_UNLIKELY(templ->mbminlen == 2)) {
- /* Treat UCS2 as a special case. */
- data = mysql_rec
- + templ->mysql_col_offset;
- len = templ->mysql_col_len;
- /* There are two UCS2 bytes per char,
- so the length has to be even. */
- ut_a(!(len & 1));
- /* Pad with 0x0020. */
- while (len) {
- *data++ = 0x00;
- *data++ = 0x20;
- len -= 2;
- }
- continue;
- }
- pad_char = 0x20;
- break;
- default:
- pad_char = 0x00;
- break;
- }
-
- ut_ad(!pad_char || templ->mbminlen == 1);
- memset(mysql_rec + templ->mysql_col_offset,
- pad_char, templ->mysql_col_len);
+ memcpy(mysql_rec + templ->mysql_col_offset,
+ prebuilt->default_rec + templ->mysql_col_offset,
+ templ->mysql_col_len);
}
}
@@ -3577,20 +3535,12 @@ shortcut_fails_too_big_rec:
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
&& prebuilt->select_lock_type != LOCK_NONE
- && trx->mysql_query_str != NULL
- && *trx->mysql_query_str != NULL
- && trx->mysql_thd != NULL) {
-
- /* Scan the MySQL query string; check if SELECT is the first
- word there */
+ && trx->mysql_thd != NULL
+ && thd_is_select(trx->mysql_thd)) {
+ /* It is a plain locking SELECT and the isolation
+ level is low: do not lock gaps */
- if (dict_str_starts_with_keyword(
- trx->mysql_thd, *trx->mysql_query_str, "SELECT")) {
- /* It is a plain locking SELECT and the isolation
- level is low: do not lock gaps */
-
- set_also_gap_locks = FALSE;
- }
+ set_also_gap_locks = FALSE;
}
/* Note that if the search mode was GE or G, then the cursor
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index c721a1f18e3..e0fe6f40197 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -293,14 +293,17 @@ ulong srv_commit_concurrency = 0;
os_fast_mutex_t srv_conc_mutex; /* this mutex protects srv_conc data
structures */
-lint srv_conc_n_threads = 0; /* number of OS threads currently
- inside InnoDB; it is not an error
- if this drops temporarily below zero
- because we do not demand that every
- thread increments this, but a thread
- waiting for a lock decrements this
- temporarily */
-ulint srv_conc_n_waiting_threads = 0; /* number of OS threads waiting in the
+lint srv_conc_n_threads = 0; /* number of transactions that
+ have declared_to_be_inside_innodb
+ set. It used to be a non-error
+ for this value to drop below
+ zero temporarily. This is no
+ longer true. We'll, however,
+ keep the lint datatype to add
+ assertions to catch any corner
+ cases that we may have
+ missed. */
+ulint srv_conc_n_waiting_threads = 0; /* number of OS threads waiting in the
FIFO for a permission to enter InnoDB
*/
@@ -338,8 +341,6 @@ ulint srv_fast_shutdown = 0;
/* Generate a innodb_status.<pid> file */
ibool srv_innodb_status = FALSE;
-ibool srv_stats_on_metadata = TRUE;
-
ibool srv_use_doublewrite_buf = TRUE;
ibool srv_use_checksums = TRUE;
@@ -1196,6 +1197,8 @@ retry:
return;
}
+ ut_ad(srv_conc_n_threads >= 0);
+
if (srv_conc_n_threads < (lint)srv_thread_concurrency) {
srv_conc_n_threads++;
@@ -1323,6 +1326,7 @@ srv_conc_force_enter_innodb(
return;
}
+ ut_ad(srv_conc_n_threads >= 0);
#ifdef UNIV_SYNC_ATOMIC
if (srv_thread_concurrency_timer_based) {
lint conc_n_threads;
@@ -1352,11 +1356,6 @@ srv_conc_force_exit_innodb(
{
srv_conc_slot_t* slot = NULL;
- if (UNIV_LIKELY(!srv_thread_concurrency)) {
-
- return;
- }
-
if (trx->mysql_thd != NULL
&& thd_is_replication_slave_thread(trx->mysql_thd)) {
@@ -1378,6 +1377,7 @@ srv_conc_force_exit_innodb(
os_fast_mutex_lock(&srv_conc_mutex);
+ ut_ad(srv_conc_n_threads > 0);
srv_conc_n_threads--;
trx->declared_to_be_inside_innodb = FALSE;
trx->n_tickets_to_enter_innodb = 0;
@@ -1644,8 +1644,11 @@ srv_suspend_mysql_thread(
srv_n_lock_wait_count++;
srv_n_lock_wait_current_count++;
- ut_usectime(&sec, &ms);
- start_time = (ib_longlong)sec * 1000000 + ms;
+ if (ut_usectime(&sec, &ms) == -1) {
+ start_time = -1;
+ } else {
+ start_time = (ib_longlong)sec * 1000000 + ms;
+ }
}
/* Wake the lock timeout monitor thread, if it is suspended */
@@ -1699,14 +1702,20 @@ srv_suspend_mysql_thread(
wait_time = ut_difftime(ut_time(), slot->suspend_time);
if (thr->lock_state == QUE_THR_LOCK_ROW) {
- ut_usectime(&sec, &ms);
- finish_time = (ib_longlong)sec * 1000000 + ms;
+ if (ut_usectime(&sec, &ms) == -1) {
+ finish_time = -1;
+ } else {
+ finish_time = (ib_longlong)sec * 1000000 + ms;
+ }
diff_time = (ulint) (finish_time - start_time);
srv_n_lock_wait_current_count--;
srv_n_lock_wait_time = srv_n_lock_wait_time + diff_time;
- if (diff_time > srv_n_lock_max_wait_time) {
+ if (diff_time > srv_n_lock_max_wait_time &&
+ /* only update the variable if we successfully
+ retrieved the start and finish times. See Bug#36819. */
+ start_time != -1 && finish_time != -1) {
srv_n_lock_max_wait_time = diff_time;
}
}
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index f64ebab1281..2acefbb22c2 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -202,13 +202,13 @@ srv_parse_data_file_paths_and_sizes(
str = srv_parse_megabytes(str, &size);
- if (0 == memcmp(str, ":autoextend",
- (sizeof ":autoextend") - 1)) {
+ if (0 == strncmp(str, ":autoextend",
+ (sizeof ":autoextend") - 1)) {
str += (sizeof ":autoextend") - 1;
- if (0 == memcmp(str, ":max:",
- (sizeof ":max:") - 1)) {
+ if (0 == strncmp(str, ":max:",
+ (sizeof ":max:") - 1)) {
str += (sizeof ":max:") - 1;
@@ -290,14 +290,15 @@ srv_parse_data_file_paths_and_sizes(
(*data_file_names)[i] = path;
(*data_file_sizes)[i] = size;
- if (0 == memcmp(str, ":autoextend",
- (sizeof ":autoextend") - 1)) {
+ if (0 == strncmp(str, ":autoextend",
+ (sizeof ":autoextend") - 1)) {
*is_auto_extending = TRUE;
str += (sizeof ":autoextend") - 1;
- if (0 == memcmp(str, ":max:", (sizeof ":max:") - 1)) {
+ if (0 == strncmp(str, ":max:",
+ (sizeof ":max:") - 1)) {
str += (sizeof ":max:") - 1;
diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
index 69b72451f2b..1fceaa3562c 100644
--- a/storage/innobase/trx/trx0trx.c
+++ b/storage/innobase/trx/trx0trx.c
@@ -287,6 +287,10 @@ trx_free(
"InnoDB: inside InnoDB.\n", stderr);
trx_print(stderr, trx, 600);
putc('\n', stderr);
+
+ /* This is an error but not a fatal error. We must keep
+ the counters like srv_conc_n_threads accurate. */
+ srv_conc_force_exit_innodb(trx);
}
if (trx->n_mysql_tables_in_use != 0
diff --git a/storage/innobase/trx/trx0undo.c b/storage/innobase/trx/trx0undo.c
index 2aa7752d292..b31580d0ce0 100644
--- a/storage/innobase/trx/trx0undo.c
+++ b/storage/innobase/trx/trx0undo.c
@@ -410,7 +410,7 @@ trx_undo_seg_create(
if (slot_no == ULINT_UNDEFINED) {
ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Warning: cannot find a free slot for"
+ " InnoDB: Warning: cannot find a free slot for"
" an undo log. Do you have too\n"
"InnoDB: many active transactions"
" running concurrently?\n");
diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c
index 4a0bd802404..1ae43172894 100644
--- a/storage/innobase/ut/ut0ut.c
+++ b/storage/innobase/ut/ut0ut.c
@@ -112,20 +112,45 @@ ut_time(void)
}
/**************************************************************
-Returns system time. */
+Returns system time.
+Upon successful completion, the value 0 is returned; otherwise the
+value -1 is returned and the global variable errno is set to indicate the
+error. */
int
ut_usectime(
/*========*/
+ /* out: 0 on success, -1 otherwise */
ulint* sec, /* out: seconds since the Epoch */
ulint* ms) /* out: microseconds since the Epoch+*sec */
{
struct timeval tv;
+ int ret;
+ int errno_gettimeofday;
+ int i;
+
+ for (i = 0; i < 10; i++) {
+
+ ret = ut_gettimeofday(&tv, NULL);
+
+ if (ret == -1) {
+ errno_gettimeofday = errno;
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: gettimeofday(): %s\n",
+ strerror(errno_gettimeofday));
+ os_thread_sleep(100000); /* 0.1 sec */
+ errno = errno_gettimeofday;
+ } else {
+ break;
+ }
+ }
+
+ if (ret != -1) {
+ *sec = (ulint) tv.tv_sec;
+ *ms = (ulint) tv.tv_usec;
+ }
- int r = ut_gettimeofday(&tv, NULL);
- *sec = (ulint) tv.tv_sec;
- *ms = (ulint) tv.tv_usec;
- return r;
+ return(ret);
}
/**************************************************************
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index 051a21b3307..66097864622 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -161,11 +161,11 @@ static int FTB_WORD_cmp(my_off_t *v, FTB_WORD *a, FTB_WORD *b)
static int FTB_WORD_cmp_list(CHARSET_INFO *cs, FTB_WORD **a, FTB_WORD **b)
{
- /* ORDER BY word DESC, ndepth DESC */
- int i= ha_compare_text(cs, (uchar*) (*b)->word+1,(*b)->len-1,
- (uchar*) (*a)->word+1,(*a)->len-1,0,0);
+ /* ORDER BY word, ndepth */
+ int i= ha_compare_text(cs, (uchar*) (*a)->word + 1, (*a)->len - 1,
+ (uchar*) (*b)->word + 1, (*b)->len - 1, 0, 0);
if (!i)
- i=CMP_NUM((*b)->ndepth,(*a)->ndepth);
+ i= CMP_NUM((*a)->ndepth, (*b)->ndepth);
return i;
}
@@ -865,23 +865,49 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
FT_INFO *ftb= ftb_param->ftb;
FTB_WORD *ftbw;
int a, b, c;
+ /*
+ Find right-most element in the array of query words matching this
+ word from a document.
+ */
for (a= 0, b= ftb->queue.elements, c= (a+b)/2; b-a>1; c= (a+b)/2)
{
ftbw= ftb->list[c];
if (ha_compare_text(ftb->charset, (uchar*)word, len,
(uchar*)ftbw->word+1, ftbw->len-1,
- (my_bool)(ftbw->flags&FTB_FLAG_TRUNC), 0) > 0)
+ (my_bool) (ftbw->flags & FTB_FLAG_TRUNC), 0) < 0)
b= c;
else
a= c;
}
+ /*
+ If there were no words with truncation operator, we iterate to the
+ beginning of an array until array element is equal to the word from
+ a document. This is done mainly because the same word may be
+ mentioned twice (or more) in the query.
+
+ In case query has words with truncation operator we must iterate
+ to the beginning of the array. There may be non-matching query words
+ between matching word with truncation operator and the right-most
+ matching element. E.g., if we're looking for 'aaa15' in an array of
+ 'aaa1* aaa14 aaa15 aaa16'.
+
+ Worse of that there still may be match even if the binary search
+ above didn't find matching element. E.g., if we're looking for
+ 'aaa15' in an array of 'aaa1* aaa14 aaa16'. The binary search will
+ stop at 'aaa16'.
+ */
for (; c >= 0; c--)
{
ftbw= ftb->list[c];
if (ha_compare_text(ftb->charset, (uchar*)word, len,
(uchar*)ftbw->word + 1,ftbw->len - 1,
(my_bool)(ftbw->flags & FTB_FLAG_TRUNC), 0))
- break;
+ {
+ if (ftb->with_scan & FTB_FLAG_TRUNC)
+ continue;
+ else
+ break;
+ }
if (ftbw->docid[1] == ftb->info->lastpos)
continue;
ftbw->docid[1]= ftb->info->lastpos;
diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c
index 042a999fffa..4cde3834ed7 100644
--- a/storage/myisam/ft_parser.c
+++ b/storage/myisam/ft_parser.c
@@ -323,60 +323,41 @@ int ft_parse(TREE *wtree, uchar *doc, int doclen,
DBUG_RETURN(parser->parse(param));
}
+
#define MAX_PARAM_NR 2
-MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info,
- uint keynr, uint paramnr)
+
+MYSQL_FTPARSER_PARAM* ftparser_alloc_param(MI_INFO *info)
{
- uint32 ftparser_nr;
- struct st_mysql_ftparser *parser;
- if (! info->ftparser_param)
+ if (!info->ftparser_param)
{
- /* info->ftparser_param can not be zero after the initialization,
- because it always includes built-in fulltext parser. And built-in
- parser can be called even if the table has no fulltext indexes and
- no varchar/text fields. */
- if (! info->s->ftparsers)
- {
- /* It's ok that modification to shared structure is done w/o mutex
- locks, because all threads would set the same variables to the
- same values. */
- uint i, j, keys= info->s->state.header.keys, ftparsers= 1;
- for (i= 0; i < keys; i++)
- {
- MI_KEYDEF *keyinfo= &info->s->keyinfo[i];
- if (keyinfo->flag & HA_FULLTEXT)
- {
- for (j= 0;; j++)
- {
- if (j == i)
- {
- keyinfo->ftparser_nr= ftparsers++;
- break;
- }
- if (info->s->keyinfo[j].flag & HA_FULLTEXT &&
- keyinfo->parser == info->s->keyinfo[j].parser)
- {
- keyinfo->ftparser_nr= info->s->keyinfo[j].ftparser_nr;
- break;
- }
- }
- }
- }
- info->s->ftparsers= ftparsers;
- }
- /*
- We have to allocate two MYSQL_FTPARSER_PARAM structures per plugin
- because in a boolean search a parser is called recursively
- ftb_find_relevance* calls ftb_check_phrase*
- (MAX_PARAM_NR=2)
+ /*
+. info->ftparser_param can not be zero after the initialization,
+ because it always includes built-in fulltext parser. And built-in
+ parser can be called even if the table has no fulltext indexes and
+ no varchar/text fields.
+
+ ftb_find_relevance... parser (ftb_find_relevance_parse,
+ ftb_find_relevance_add_word) calls ftb_check_phrase... parser
+ (ftb_check_phrase_internal, ftb_phrase_add_word). Thus MAX_PARAM_NR=2.
*/
info->ftparser_param= (MYSQL_FTPARSER_PARAM *)
my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) *
- info->s->ftparsers, MYF(MY_WME|MY_ZEROFILL));
+ info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL));
init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0);
- if (! info->ftparser_param)
- return 0;
}
+ return info->ftparser_param;
+}
+
+
+MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info,
+ uint keynr, uint paramnr)
+{
+ uint32 ftparser_nr;
+ struct st_mysql_ftparser *parser;
+
+ if (!ftparser_alloc_param(info))
+ return 0;
+
if (keynr == NO_SUCH_KEY)
{
ftparser_nr= 0;
@@ -384,7 +365,7 @@ MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info,
}
else
{
- ftparser_nr= info->s->keyinfo[keynr].ftparser_nr;
+ ftparser_nr= info->s->keyinfo[keynr].ftkey_nr;
parser= info->s->keyinfo[keynr].parser;
}
DBUG_ASSERT(paramnr < MAX_PARAM_NR);
@@ -416,7 +397,7 @@ void ftparser_call_deinitializer(MI_INFO *info)
for (j=0; j < MAX_PARAM_NR; j++)
{
MYSQL_FTPARSER_PARAM *ftparser_param=
- &info->ftparser_param[keyinfo->ftparser_nr*MAX_PARAM_NR + j];
+ &info->ftparser_param[keyinfo->ftkey_nr * MAX_PARAM_NR + j];
if (keyinfo->flag & HA_FULLTEXT && ftparser_param->mysql_add_word)
{
if (keyinfo->parser->deinit)
diff --git a/storage/myisam/ftdefs.h b/storage/myisam/ftdefs.h
index 22443807b87..ddcf1a8dc26 100644
--- a/storage/myisam/ftdefs.h
+++ b/storage/myisam/ftdefs.h
@@ -146,6 +146,7 @@ void ft_boolean_close_search(FT_INFO *);
float ft_boolean_get_relevance(FT_INFO *);
my_off_t ft_boolean_get_docid(FT_INFO *);
void ft_boolean_reinit_search(FT_INFO *);
+MYSQL_FTPARSER_PARAM* ftparser_alloc_param(MI_INFO *info);
extern MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info,
uint keynr,
uint paramnr);
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 4b0fb15a5c6..c6411a6a273 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1261,7 +1261,7 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
ulonglong map;
TABLE_LIST *table_list= table->pos_in_table_list;
my_bool ignore_leaves= table_list->ignore_leaves;
- char buf[ERRMSGSIZE+20];
+ char buf[MYSQL_ERRMSG_SIZE];
DBUG_ENTER("ha_myisam::preload_keys");
@@ -1289,7 +1289,7 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
errmsg= "Failed to allocate buffer";
break;
default:
- my_snprintf(buf, ERRMSGSIZE,
+ my_snprintf(buf, sizeof(buf),
"Failed to read from index file (errno: %d)", my_errno);
errmsg= buf;
}
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index b132000b356..bdca1a1f0b8 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -2397,7 +2397,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
Note, built-in parser is always nr. 0 - see ftparser_call_initializer()
*/
- if (sort_param.keyinfo->ftparser_nr == 0)
+ if (sort_param.keyinfo->ftkey_nr == 0)
{
/*
for built-in parser the number of generated index entries
@@ -2895,6 +2895,9 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
sort_param[0].fix_datafile= (my_bool)(! rep_quick);
sort_param[0].calc_checksum= test(param->testflag & T_CALC_CHECKSUM);
+ if (!ftparser_alloc_param(info))
+ goto err;
+
sort_info.got_error=0;
pthread_mutex_lock(&sort_info.mutex);
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 605dea6594e..78749d50fe5 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -331,6 +331,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->blocksize=min(IO_SIZE,myisam_block_size);
{
HA_KEYSEG *pos=share->keyparts;
+ uint32 ftkey_nr= 1;
for (i=0 ; i < keys ; i++)
{
share->keyinfo[i].share= share;
@@ -412,6 +413,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->ft2_keyinfo.end=pos;
setup_key_functions(& share->ft2_keyinfo);
}
+ share->keyinfo[i].ftkey_nr= ftkey_nr++;
}
setup_key_functions(share->keyinfo+i);
share->keyinfo[i].end=pos;
@@ -421,6 +423,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
pos->flag=0; /* For purify */
pos++;
}
+
for (i=0 ; i < uniques ; i++)
{
disk_pos=mi_uniquedef_read(disk_pos, &share->uniqueinfo[i]);
@@ -449,7 +452,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
pos->flag=0;
pos++;
}
- share->ftparsers= 0;
+ share->ftkeys= ftkey_nr;
}
disk_pos_assert(disk_pos + share->base.fields *MI_COLUMNDEF_SIZE, end_pos);
@@ -1112,7 +1115,7 @@ uchar *mi_keydef_read(uchar *ptr, MI_KEYDEF *keydef)
keydef->underflow_block_length=keydef->block_length/3;
keydef->version = 0; /* Not saved */
keydef->parser = &ft_default_parser;
- keydef->ftparser_nr = 0;
+ keydef->ftkey_nr = 0;
return ptr;
}
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 2ca79608408..9af3f652c5f 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -193,7 +193,7 @@ typedef struct st_mi_isam_share { /* Shared between opens */
ulong state_diff_length;
uint rec_reflength; /* rec_reflength in use now */
uint unique_name_length;
- uint32 ftparsers; /* Number of distinct ftparsers + 1 */
+ uint32 ftkeys; /* Number of full-text keys + 1 */
File kfile; /* Shared keyfile */
File data_file; /* Shared data file */
int mode; /* mode of file on open */
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index 0ca6a10fad4..908c32e48d3 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -300,7 +300,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright (C) 2002 MySQL AB");
+ puts("Copyright 2002-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
puts("and you are welcome to modify and redistribute it under the GPL license\n");
diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c
index b5002116164..64b4be2b7ca 100644
--- a/storage/myisammrg/myrg_open.c
+++ b/storage/myisammrg/myrg_open.c
@@ -47,6 +47,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
MI_INFO *isam=0;
uint found_merge_insert_method= 0;
size_t name_buff_length;
+ my_bool bad_children= FALSE;
DBUG_ENTER("myrg_open");
LINT_INIT(key_parts);
@@ -97,13 +98,13 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
fn_format(buff, buff, "", "", 0);
if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0))))
{
- my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
if (handle_locking & HA_OPEN_FOR_REPAIR)
{
myrg_print_wrong_table(buff);
+ bad_children= TRUE;
continue;
}
- goto err;
+ goto bad_children;
}
if (!m_info) /* First file */
{
@@ -128,13 +129,13 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
files++;
if (m_info->reclength != isam->s->base.reclength)
{
- my_errno=HA_ERR_WRONG_MRG_TABLE_DEF;
if (handle_locking & HA_OPEN_FOR_REPAIR)
{
myrg_print_wrong_table(buff);
+ bad_children= TRUE;
continue;
}
- goto err;
+ goto bad_children;
}
m_info->options|= isam->s->options;
m_info->records+= isam->state->records;
@@ -147,8 +148,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
m_info->tables);
}
- if (my_errno == HA_ERR_WRONG_MRG_TABLE_DEF)
- goto err;
+ if (bad_children)
+ goto bad_children;
if (!m_info && !(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO),
MYF(MY_WME | MY_ZEROFILL))))
goto err;
@@ -178,12 +179,14 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
pthread_mutex_unlock(&THR_LOCK_open);
DBUG_RETURN(m_info);
+bad_children:
+ my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
err:
save_errno=my_errno;
switch (errpos) {
case 3:
while (files)
- mi_close(m_info->open_tables[--files].table);
+ (void) mi_close(m_info->open_tables[--files].table);
my_free((char*) m_info,MYF(0));
/* Fall through */
case 2:
@@ -392,6 +395,7 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
uint child_nr;
uint key_parts;
uint min_keys;
+ my_bool bad_children= FALSE;
DBUG_ENTER("myrg_attach_children");
DBUG_PRINT("myrg", ("handle_locking: %d", handle_locking));
@@ -441,13 +445,13 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
DBUG_PRINT("error", ("definition mismatch table: '%s' repair: %d",
myisam->filename,
(handle_locking & HA_OPEN_FOR_REPAIR)));
- my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
if (handle_locking & HA_OPEN_FOR_REPAIR)
{
myrg_print_wrong_table(myisam->filename);
+ bad_children= TRUE;
continue;
}
- goto err;
+ goto bad_children;
}
m_info->options|= myisam->s->options;
@@ -462,6 +466,9 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
child_nr++;
}
+ if (bad_children)
+ goto bad_children;
+ /* Note: callback() resets my_errno, so it is safe to check it here */
if (my_errno == HA_ERR_WRONG_MRG_TABLE_DEF)
goto err;
if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L)
@@ -477,6 +484,8 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
pthread_mutex_unlock(&m_info->mutex);
DBUG_RETURN(0);
+bad_children:
+ my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
err:
save_errno= my_errno;
switch (errpos) {
diff --git a/storage/ndb/docs/doxygen/postdoxy.pl b/storage/ndb/docs/doxygen/postdoxy.pl
index ad0edb44a31..3bf54e4ff75 100755
--- a/storage/ndb/docs/doxygen/postdoxy.pl
+++ b/storage/ndb/docs/doxygen/postdoxy.pl
@@ -81,9 +81,9 @@ open (OUTFILE, "> ${destdir}/doxygen.sty.new")
while (<INFILE>)
{
if (/\\rfoot/) {
- print OUTFILE "\\rfoot[\\fancyplain{}{\\bfseries\\small \\copyright~Copyright 2003-2004 MySQL AB\\hfill support-cluster\@mysql.com}]{}\n";
+ print OUTFILE "\\rfoot[\\fancyplain{}{\\bfseries\\small \\copyright~Copyright 2003-2008 MySQL AB, 2008 Sun Microsystems, Inc.\\hfill support-cluster\@mysql.com}]{}\n";
} elsif (/\\lfoot/) {
- print OUTFILE "\\lfoot[]{\\fancyplain{}{\\bfseries\\small support-cluster\@mysql.com\\hfill \\copyright~Copyright 2003-2004 MySQL AB}}\n";
+ print OUTFILE "\\lfoot[]{\\fancyplain{}{\\bfseries\\small support-cluster\@mysql.com\\hfill \\copyright~Copyright 2003-2008 MySQL AB, 2008 Sun Microsystems, Inc.}}\n";
} else {
print OUTFILE;
}
diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index 043df5d5038..7bd61dfe8b3 100644
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -551,7 +551,7 @@ Dbtc::execDROP_TAB_REQ(Signal* signal)
Uint32 senderRef = req->senderRef;
Uint32 senderData = req->senderData;
DropTabReq::RequestType rt = (DropTabReq::RequestType)req->requestType;
-
+
if(!tabPtr.p->get_enabled() && rt == DropTabReq::OnlineDropTab){
jam();
DropTabRef* ref = (DropTabRef*)signal->getDataPtrSend();
diff --git a/storage/ndb/test/run-test/atrt.hpp b/storage/ndb/test/run-test/atrt.hpp
index 14d2dccd245..db26bd9bfc0 100644
--- a/storage/ndb/test/run-test/atrt.hpp
+++ b/storage/ndb/test/run-test/atrt.hpp
@@ -2,8 +2,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+ the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/storage/ndb/test/tools/connect.cpp b/storage/ndb/test/tools/connect.cpp
index 2d3ac34d3e8..278dbe833ea 100644
--- a/storage/ndb/test/tools/connect.cpp
+++ b/storage/ndb/test/tools/connect.cpp
@@ -2,8 +2,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+ the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index dc2a300a2ec..7e742050aa8 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -249,7 +249,7 @@ static void
fprint_copyright(FILE *file)
{
fprintf(file,
-"/* Copyright (C) 2000-2007 MySQL AB\n"
+"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n"
"\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
diff --git a/strings/ctype.c b/strings/ctype.c
index c313708f3f6..2c0fe09c07b 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -339,6 +339,16 @@ my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong length)
/*
+ Returns repertoire for charset
+*/
+uint my_charset_repertoire(CHARSET_INFO *cs)
+{
+ return cs->state & MY_CS_PUREASCII ?
+ MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
+}
+
+
+/*
Detect whether a character set is ASCII compatible.
Returns TRUE for:
diff --git a/strings/xml.c b/strings/xml.c
index 5c62a8e8603..1b697ec6b26 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -328,7 +328,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
}
while ((MY_XML_IDENT == (lex=my_xml_scan(p,&a))) ||
- (MY_XML_STRING == lex))
+ ((MY_XML_STRING == lex && exclam)))
{
MY_XML_ATTR b;
if (MY_XML_EQ == (lex=my_xml_scan(p,&b)))
@@ -349,13 +349,22 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
return MY_XML_ERROR;
}
}
- else if ((MY_XML_STRING == lex) || (MY_XML_IDENT == lex))
+ else if (MY_XML_IDENT == lex)
{
p->current_node_type= MY_XML_NODE_ATTR;
if ((MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg))) ||
(MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg))))
return MY_XML_ERROR;
}
+ else if ((MY_XML_STRING == lex) && exclam)
+ {
+ /*
+ We are in <!DOCTYPE>, e.g.
+ <!DOCTYPE name SYSTEM "SystemLiteral">
+ <!DOCTYPE name PUBLIC "PublidLiteral" "SystemLiteral">
+ Just skip "SystemLiteral" and "PublicidLiteral"
+ */
+ }
else
break;
}
diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
index 11ad69f1f71..7bf8f323d57 100644
--- a/support-files/my-small.cnf.sh
+++ b/support-files/my-small.cnf.sh
@@ -34,7 +34,7 @@ sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
-thread_stack = 64K
+thread_stack = 128K
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index e7c090484b7..7c08fdf4734 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -1,4 +1,4 @@
-# Copyright (C) 2000-2007 MySQL AB
+# Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,7 +15,11 @@
# MA 02110-1301 USA.
%define mysql_version @VERSION@
-%define mysql_vendor MySQL AB
+
+# NOTE: "vendor" is used in upgrade/downgrade check, so you can't
+# change these, has to be exactly as is.
+%define mysql_old_vendor MySQL AB
+%define mysql_vendor Sun Microsystems, Inc.
# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x)
# to enable static linking (off by default)
@@ -38,7 +42,7 @@
%define release 0.glibc23
%endif
%define license GPL
-%define mysqld_user mysql
+%define mysqld_user mysql
%define mysqld_group mysql
%define server_suffix -standard
%define mysqldatadir /var/lib/mysql
@@ -71,10 +75,10 @@ Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases
Version: @MYSQL_NO_DASH_VERSION@
Release: %{release}
-License: %{license}
+License: Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Under %{license} license as shown in the Description field.
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
URL: http://www.mysql.com/
-Packager: MySQL Production Engineering Team <build@mysql.com>
+Packager: Sun Microsystems, Inc. Product Engineering Team <build@mysql.com>
Vendor: %{mysql_vendor}
Provides: msqlormysql MySQL-server mysql
BuildRequires: ncurses-devel
@@ -90,9 +94,11 @@ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
-MySQL AB.
+Sun Microsystems, Inc.
+
+Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. All rights reserved.
+Use is subject to license terms.
-Copyright (C) 2000-2007 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license.
@@ -112,9 +118,11 @@ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
-MySQL AB.
+Sun Microsystems, Inc.
+
+Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. All rights reserved.
+Use is subject to license terms.
-Copyright (C) 2000-2007 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license.
@@ -264,7 +272,11 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-pic \
--prefix=/ \
+%if %{CLUSTER_BUILD}
--with-extra-charsets=all \
+%else
+ --with-extra-charsets=complex \
+%endif
%if %{YASSL_BUILD}
--with-ssl \
%endif
@@ -279,7 +291,20 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--mandir=%{_mandir} \
--enable-thread-safe-client \
--with-readline \
- "
+ --with-innodb \
+%if %{CLUSTER_BUILD}
+ --with-ndbcluster \
+%else
+ --without-ndbcluster \
+%endif
+ --with-archive-storage-engine \
+ --with-csv-storage-engine \
+ --with-blackhole-storage-engine \
+ --with-federated-storage-engine \
+ --with-partition \
+ --with-big-tables \
+ --enable-shared \
+ "
make
}
@@ -306,6 +331,8 @@ mkdir -p $RBR%{_libdir}/mysql
PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin}
export PATH
+# Build the Debug binary.
+
# Use gcc for C and C++ code (to avoid a dependency on libstdc++ and
# including exceptions into the code
if [ -z "$CXX" -a -z "$CC" ]
@@ -326,28 +353,20 @@ CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-except
(
# We are in a subshell, so we can modify variables just for one run.
-CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]* //' -e 's/-unroll2 //' -e 's/-ip //' -e 's/$/ -g/'`
-CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-O[0-9]* //' -e 's/-unroll2 //' -e 's/-ip //' -e 's/$/ -g/'`
+CFLAGS=`echo " $CFLAGS " | \
+ sed -e 's/ -O[0-9]* / /' -e 's/ -unroll2 / /' -e 's/ -ip / /' \
+ -e 's/^ //' -e 's/ $//'`
+CXXFLAGS=`echo " $CXXFLAGS " | \
+ sed -e 's/ -O[0-9]* / /' -e 's/ -unroll2 / /' -e 's/ -ip / /' \
+ -e 's/^ //' -e 's/ $//'`
# Add -g and --with-debug.
cd mysql-debug-%{mysql_version} &&
-CFLAGS=\"$CFLAGS\" \
-CXXFLAGS=\"$CXXFLAGS\" \
-BuildMySQL "--enable-shared \
+CFLAGS="$CFLAGS" \
+CXXFLAGS="$CXXFLAGS" \
+BuildMySQL "\
--with-debug \
- --with-innodb \
-%if %{CLUSTER_BUILD}
- --with-ndbcluster \
-%else
- --without-ndbcluster \
-%endif
- --with-archive-storage-engine \
- --with-csv-storage-engine \
- --with-blackhole-storage-engine \
- --with-federated-storage-engine \
- --with-partition \
- --with-big-tables \
- --with-comment=\"MySQL Community Server - Debug (GPL)\"")
+ --with-comment=\"MySQL Community Server - Debug (%{license})\"")
# We might want to save the config log file
if test -n "$MYSQL_DEBUGCONFLOG_DEST"
@@ -364,23 +383,11 @@ fi
##############################################################################
(cd mysql-release-%{mysql_version} &&
-CFLAGS=\"$CFLAGS\" \
-CXXFLAGS=\"$CXXFLAGS\" \
-BuildMySQL "--enable-shared \
- --with-innodb \
-%if %{CLUSTER_BUILD}
- --with-ndbcluster \
-%else
- --without-ndbcluster \
-%endif
- --with-archive-storage-engine \
- --with-csv-storage-engine \
- --with-blackhole-storage-engine \
- --with-federated-storage-engine \
- --with-partition \
+CFLAGS="$CFLAGS" \
+CXXFLAGS="$CXXFLAGS" \
+BuildMySQL "\
--with-embedded-server \
- --with-big-tables \
- --with-comment=\"MySQL Community Server (GPL)\"")
+ --with-comment=\"MySQL Community Server (%{license})\"")
# We might want to save the config log file
if test -n "$MYSQL_CONFLOG_DEST"
then
@@ -460,6 +467,7 @@ installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
if [ $? -eq 0 -a -n "$installed" ]; then
vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
+ myoldvendor='%{mysql_old_vendor}'
myvendor='%{mysql_vendor}'
myversion='%{mysql_version}'
@@ -471,12 +479,12 @@ if [ $? -eq 0 -a -n "$installed" ]; then
[ -z "$new_family" ] && new_family="<bad package specification: version $myversion>"
error_text=
- if [ "$vendor" != "$myvendor" ]; then
+ if [ "$vendor" != "$myoldvendor" -a "$vendor" != "$myvendor" ]; then
error_text="$error_text
The current MySQL server package is provided by a different
-vendor ($vendor) than $myvendor. Some files may be installed
-to different locations, including log files and the service
-startup script in %{_sysconfdir}/init.d/.
+vendor ($vendor) than $myoldvendor or $myvendor.
+Some files may be installed to different locations, including log
+files and the service startup script in %{_sysconfdir}/init.d/.
"
fi
@@ -700,7 +708,6 @@ fi
%attr(755, root, root) %{_bindir}/msql2mysql
%attr(755, root, root) %{_bindir}/mysql
%attr(755, root, root) %{_bindir}/mysql_find_rows
-%attr(755, root, root) %{_bindir}/mysql_upgrade_shell
%attr(755, root, root) %{_bindir}/mysql_waitpid
%attr(755, root, root) %{_bindir}/mysqlaccess
%attr(755, root, root) %{_bindir}/mysqladmin
@@ -840,6 +847,16 @@ fi
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
+* Fri Nov 07 2008 Joerg Bruehe <joerg@mysql.com>
+
+- Correct yesterday's fix, so that it also works for the last flag,
+ and fix a wrong quoting: un-quoted quote marks must not be escaped.
+
+* Thu Nov 06 2008 Kent Boortz <kent.boortz@sun.com>
+
+- Removed "mysql_upgrade_shell"
+- Removed some copy/paste between debug and normal build
+
* Thu Nov 06 2008 Joerg Bruehe <joerg@mysql.com>
- Modify CFLAGS and CXXFLAGS such that a debug build is not optimized.
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 94ede2a625b..4f30d43f53f 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -16552,6 +16552,61 @@ static void test_change_user()
DBUG_VOID_RETURN;
}
+#ifdef HAVE_SPATIAL
+/**
+ Bug#37956 memory leak and / or crash with geometry and prepared statements!
+*/
+
+static void test_bug37956(void)
+{
+ const char *query="select point(?,?)";
+ MYSQL_STMT *stmt=NULL;
+ ulong val=0;
+ MYSQL_BIND bind_param[2];
+ unsigned char buff[2]= { 134, 211 };
+ DBUG_ENTER("test_bug37956");
+ myheader("test_bug37956");
+
+ stmt= mysql_simple_prepare(mysql, query);
+ check_stmt(stmt);
+
+ val=1;
+ mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void *)&val);
+ val=CURSOR_TYPE_READ_ONLY;
+ mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&val);
+ val=0;
+ mysql_stmt_attr_set(stmt, STMT_ATTR_PREFETCH_ROWS, (void *)&val);
+
+ memset(bind_param, 0, sizeof(bind_param));
+ bind_param[0].buffer_type=MYSQL_TYPE_TINY;
+ bind_param[0].buffer= (void *)buff;
+ bind_param[0].is_null=NULL;
+ bind_param[0].error=NULL;
+ bind_param[0].is_unsigned=1;
+ bind_param[1].buffer_type=MYSQL_TYPE_TINY;
+ bind_param[1].buffer= (void *)(buff+1);
+ bind_param[1].is_null=NULL;
+ bind_param[1].error=NULL;
+ bind_param[1].is_unsigned=1;
+
+ if (mysql_stmt_bind_param(stmt, bind_param))
+ {
+ mysql_stmt_close(stmt);
+ DIE_UNLESS(0);
+ }
+
+ if (mysql_stmt_execute(stmt))
+ {
+ mysql_stmt_close(stmt);
+ DBUG_VOID_RETURN;
+ }
+ /* Should never reach here: execution returns an error. */
+ mysql_stmt_close(stmt);
+ DIE_UNLESS(0);
+ DBUG_VOID_RETURN;
+}
+#endif
+
/*
Bug#27592 (stack overrun when storing datetime value using prepared statements)
*/
@@ -17657,6 +17712,63 @@ static void test_bug40365(void)
DBUG_VOID_RETURN;
}
+
+
+/**
+ Bug#36326: nested transaction and select
+*/
+
+#ifdef HAVE_QUERY_CACHE
+
+static void test_bug36326()
+{
+ int rc;
+
+ DBUG_ENTER("test_bug36326");
+ myheader("test_bug36326");
+
+ rc= mysql_autocommit(mysql, TRUE);
+ myquery(rc);
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "CREATE TABLE t1 (a INTEGER)");
+ myquery(rc);
+ rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)");
+ myquery(rc);
+ rc= mysql_query(mysql, "SET GLOBAL query_cache_type = 1");
+ myquery(rc);
+ rc= mysql_query(mysql, "SET GLOBAL query_cache_size = 1048576");
+ myquery(rc);
+ DIE_UNLESS(!(mysql->server_status & SERVER_STATUS_IN_TRANS));
+ DIE_UNLESS(mysql->server_status & SERVER_STATUS_AUTOCOMMIT);
+ rc= mysql_query(mysql, "BEGIN");
+ myquery(rc);
+ DIE_UNLESS(mysql->server_status & SERVER_STATUS_IN_TRANS);
+ rc= mysql_query(mysql, "SELECT * FROM t1");
+ myquery(rc);
+ rc= my_process_result(mysql);
+ DIE_UNLESS(rc == 1);
+ rc= mysql_rollback(mysql);
+ myquery(rc);
+ rc= mysql_query(mysql, "ROLLBACK");
+ myquery(rc);
+ DIE_UNLESS(!(mysql->server_status & SERVER_STATUS_IN_TRANS));
+ rc= mysql_query(mysql, "SELECT * FROM t1");
+ myquery(rc);
+ DIE_UNLESS(!(mysql->server_status & SERVER_STATUS_IN_TRANS));
+ rc= my_process_result(mysql);
+ DIE_UNLESS(rc == 1);
+ rc= mysql_query(mysql, "DROP TABLE t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "SET GLOBAL query_cache_size = 0");
+ myquery(rc);
+
+ DBUG_VOID_RETURN;
+}
+
+#endif
+
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -17967,6 +18079,12 @@ static struct my_tests_st my_tests[]= {
{ "test_wl4166_2", test_wl4166_2 },
{ "test_bug38486", test_bug38486 },
{ "test_bug40365", test_bug40365 },
+#ifdef HAVE_SPATIAL
+ { "test_bug37956", test_bug37956 },
+#endif
+#ifdef HAVE_QUERY_CACHE
+ { "test_bug36326", test_bug36326 },
+#endif
{ 0, 0 }
};
diff --git a/win/configure.js b/win/configure.js
index c86ec0cf47c..ac51b15b9f0 100644
--- a/win/configure.js
+++ b/win/configure.js
@@ -48,6 +48,7 @@ try
case "__NT__":
case "CYBOZU":
case "EMBED_MANIFESTS":
+ case "EXTRA_DEBUG":
case "WITH_EMBEDDED_SERVER":
configfile.WriteLine("SET (" + args.Item(i) + " TRUE)");
break;