From 35c5732630a362af7b0d9b208f859fc4a2cccfbd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Mar 2006 19:27:38 +0200 Subject: [PATCH 01/11] Declare innobase "srv_*" variables as extern "C" sql/mysqld.cc: Declare variables using "extern C" just as they are declared in srv0srv.c and set_var.cc --- sql/mysqld.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ccb74730bc3..584c3727dd6 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -8173,6 +8173,7 @@ my_bool innobase_log_archive, innobase_file_per_table, innobase_locks_unsafe_for_binlog; +extern "C" { ulong srv_max_buf_pool_modified_pct; ulong srv_max_purge_lag; ulong srv_auto_extend_increment; @@ -8181,6 +8182,8 @@ ulong srv_n_free_tickets_to_enter; ulong srv_thread_sleep_delay; ulong srv_thread_concurrency; ulong srv_commit_concurrency; +} + #endif #ifndef WITH_NDBCLUSTER_STORAGE_ENGINE From d02b57ceb8e165687ae1e1259c5a5e78b3f399f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Mar 2006 19:30:08 +0200 Subject: [PATCH 02/11] Remove duplicate declaration of stress_basdir --- mysql-test/lib/mtr_stress.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/lib/mtr_stress.pl b/mysql-test/lib/mtr_stress.pl index 77c3d8bb030..92bb220461b 100644 --- a/mysql-test/lib/mtr_stress.pl +++ b/mysql-test/lib/mtr_stress.pl @@ -21,7 +21,6 @@ sub run_stress_test () { my $args; - my $stress_basedir; my $stress_suitedir; mtr_report("Starting stress testing\n"); From bc609ffbd0e1546878854d721cf1b1e2f6235dce Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Mar 2006 19:32:50 +0200 Subject: [PATCH 03/11] Add new paths where to look for mysql_client_test --- mysql-test/mysql-test-run.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3a3dedfd963..a914b816ed2 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1063,6 +1063,8 @@ sub executable_setup () { $exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest"); $exe_mysql_client_test= mtr_exe_exists("$glob_basedir/tests/mysql_client_test", + "$glob_basedir/tests/release/mysql_client_test", + "$glob_basedir/tests/debug/mysql_client_test", "$path_client_bindir/mysql_client_test", "/usr/bin/false"); } From caeb6e274e4766e4f44e566894a6aa2bd2659ce3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Mar 2006 19:34:44 +0200 Subject: [PATCH 04/11] Remove unused variable --- sql/ha_heap.cc | 1 - sql/handler.cc | 2 -- sql/item_timefunc.cc | 1 - sql/key.cc | 1 - sql/log.cc | 2 -- sql/sp.cc | 1 - sql/sp_cache.cc | 1 - sql/sql_base.cc | 4 ---- 8 files changed, 13 deletions(-) diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 96f760a7a44..02af9fb6918 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -524,7 +524,6 @@ THR_LOCK_DATA **ha_heap::store_lock(THD *thd, int ha_heap::delete_table(const char *name) { - char buff[FN_REFLEN]; int error= heap_delete_table(name); return error == ENOENT ? 0 : error; } diff --git a/sql/handler.cc b/sql/handler.cc index 16381972200..782d367bf40 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -445,8 +445,6 @@ static my_bool init_handlerton(THD *unused1, st_plugin_int *plugin, int ha_init() { int error= 0; - handlerton **types; - show_table_alias_st *table_alias; total_ha= savepoint_alloc_size= 0; if (ha_init_errors()) diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index c4f7dec70d0..7ee206a4195 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2028,7 +2028,6 @@ void Item_date_add_interval::fix_length_and_dec() bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date) { - long period,sign; INTERVAL interval; if (args[0]->get_date(ltime, TIME_NO_ZERO_DATE) || diff --git a/sql/key.cc b/sql/key.cc index 4001c6177a1..fd9e8a89b17 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -468,7 +468,6 @@ int key_rec_cmp(void *key, byte *first_rec, byte *second_rec) do { Field *field= key_part->field; - uint length; if (key_part->null_bit) { diff --git a/sql/log.cc b/sql/log.cc index 02bf5ec3015..4b5fcffffbf 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -717,8 +717,6 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length, bool error= FALSE; Log_event_handler **current_handler= slow_log_handler_list; bool is_command= FALSE; - - char message_buff[MAX_LOG_BUFFER_SIZE]; char user_host_buff[MAX_USER_HOST_SIZE]; my_time_t current_time; diff --git a/sql/sp.cc b/sql/sp.cc index 022417d15d1..ac63847daa3 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -668,7 +668,6 @@ db_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics) { TABLE *table; int ret; - bool opened; DBUG_ENTER("db_update_routine"); DBUG_PRINT("enter", ("type: %d name: %.*s", type, name->m_name.length, name->m_name.str)); diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc index fea6a67f32c..f5912caddaf 100644 --- a/sql/sp_cache.cc +++ b/sql/sp_cache.cc @@ -124,7 +124,6 @@ void sp_cache_clear(sp_cache **cp) void sp_cache_insert(sp_cache **cp, sp_head *sp) { sp_cache *c; - ulong v; if (!(c= *cp)) { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 6c2ca06164f..9f01f763f41 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1408,10 +1408,7 @@ void update_non_unique_table_error(TABLE_LIST *update, TABLE *find_temporary_table(THD *thd, const char *db, const char *table_name) { - char key[MAX_DBKEY_LENGTH]; - uint key_length; TABLE_LIST table_list; - TABLE *table; table_list.db= (char*) db; table_list.table_name= (char*) table_name; @@ -1939,7 +1936,6 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, } else { - TABLE_SHARE *share; /* Free cache if too big */ while (open_cache.records > table_cache_size && unused_tables) VOID(hash_delete(&open_cache,(byte*) unused_tables)); /* purecov: tested */ From 9d682d54d9d3183de27d8176312ff0fdfb32f442 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Mar 2006 08:55:29 +0200 Subject: [PATCH 05/11] Add comments for "--big-test" aka "--big" and move it to the section "Control what tests to run" --- mysql-test/mysql-test-run.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a914b816ed2..afd2d2f9e1e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -592,6 +592,7 @@ sub command_line_setup () { 'skip-rpl' => \$opt_skip_rpl, 'skip-im' => \$opt_skip_im, 'skip-test=s' => \$opt_skip_test, + 'big-test' => \$opt_big_test, # Specify ports 'master_port=i' => \$opt_master_myport, @@ -607,7 +608,7 @@ sub command_line_setup () { 'record' => \$opt_record, 'check-testcases' => \$opt_check_testcases, - # ??? + # Extra options used when starting mysqld 'mysqld=s' => \@opt_extra_mysqld_opt, # Run test on running server @@ -652,7 +653,6 @@ sub command_line_setup () { 'vardir=s' => \$opt_vardir, # Misc - 'big-test' => \$opt_big_test, 'comment=s' => \$opt_comment, 'debug' => \$opt_debug, 'fast' => \$opt_fast, @@ -3557,6 +3557,8 @@ Options to control what test suites or cases to run skip-rpl Skip the replication test cases. skip-im Don't start IM, and skip the IM test cases skip-test=PREFIX Skip test cases which name are prefixed with PREFIX + big-test Pass "--big-test" to mysqltest which will set the environment + variable BIG_TEST, which can be checked from test cases. Options that specify ports @@ -3624,8 +3626,6 @@ Deprecated options Options not yet described, or that I want to look into more - - big-test debug local local-master From c603c5acc478e0054478b15912cc6ede8775f1e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Mar 2006 09:00:48 +0200 Subject: [PATCH 06/11] "ndbconnectstring" => "ndb-connectstring" --- mysql-test/mysql-test-run.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index afd2d2f9e1e..33d3f676821 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -613,8 +613,8 @@ sub command_line_setup () { # Run test on running server 'extern' => \$opt_extern, - 'ndbconnectstring=s' => \$opt_ndbconnectstring, - 'ndbconnectstring-slave=s' => \$opt_ndbconnectstring_slave, + 'ndb-connectstring=s' => \$opt_ndbconnectstring, + 'ndb-connectstring-slave=s' => \$opt_ndbconnectstring_slave, # Debugging 'gdb' => \$opt_gdb, From 5eef76cfed6972911fb7ca4cf0d2135066e21d77 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Mar 2006 09:15:29 +0200 Subject: [PATCH 07/11] "ndbcluster_port" => "ndbcluster-port" "ndbcluster_port_slave" => "ndbcluster-port-slave" --- mysql-test/mysql-test-run.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 33d3f676821..d6b4c21d97c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -597,8 +597,8 @@ sub command_line_setup () { # Specify ports 'master_port=i' => \$opt_master_myport, 'slave_port=i' => \$opt_slave_myport, - 'ndbcluster_port=i' => \$opt_ndbcluster_port, - 'ndbcluster_port_slave=i' => \$opt_ndbcluster_port_slave, + 'ndbcluster-port=i' => \$opt_ndbcluster_port, + 'ndbcluster-port-slave=i' => \$opt_ndbcluster_port_slave, 'manager-port=i' => \$opt_manager_port, # Currently not used 'im-port=i' => \$im_port, # Instance Manager port. 'im-mysqld1-port=i' => \$im_mysqld1_port, # Port of mysqld, controlled by IM @@ -3564,7 +3564,8 @@ 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=PORT Specify the port number used by cluster + ndbcluster-port-slave=PORT Specify the port number used by slave cluster Options for test case authoring From 1ae58ddfa40b26c984a8b2ab1f330afeecd30a43 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Mar 2006 09:30:07 +0200 Subject: [PATCH 08/11] Remove "restart-cleanup" not needed any more as a snapshot of the db will be restored after a failed test case --- mysql-test/mysql-test-run.pl | 8 -------- 1 file changed, 8 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d6b4c21d97c..e472f141bb8 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -166,7 +166,6 @@ our $path_my_basedir; our $opt_vardir; # A path but set directly on cmd line our $opt_vardir_trace; # unix formatted opt_vardir for trace files our $opt_tmpdir; # A path but set directly on cmd line -our $opt_restart_cleanup; # Source a file with SQL drop statements our $opt_usage; our $opt_suite; @@ -661,7 +660,6 @@ sub command_line_setup () { 'netware' => \$opt_netware, 'old-master' => \$opt_old_master, 'reorder' => \$opt_reorder, - 'restart-cleanup' => \$opt_restart_cleanup, 'script-debug' => \$opt_script_debug, 'sleep=i' => \$opt_sleep, 'socket=s' => \$opt_socket, @@ -3256,12 +3254,6 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--sleep=%d", $opt_sleep); } - if ( $opt_restart_cleanup and $glob_mysqld_restart ) - { - mtr_add_arg($args, "--include=%s", "include/drop-on-restart.inc"); - $glob_mysqld_restart= 0; - } - if ( $opt_debug ) { mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir_trace); From 29ca093e60f0e4c11e2719e2d48fe364062b47fb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Mar 2006 09:39:18 +0200 Subject: [PATCH 09/11] Use default value variable when printing out the default timeouts --- mysql-test/mysql-test-run.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e472f141bb8..c73603b0961 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3611,8 +3611,8 @@ Misc options help Get this help text unified-diff | udiff When presenting differences, use unified diff - testcase-timeout=MINUTES Max test case run time (default 5) - suite-timeout=MINUTES Max test suite run time (default 120) + testcase-timeout=MINUTES Max test case run time (default $default_testcase_timeout) + suite-timeout=MINUTES Max test suite run time (default $default_suite_timeout) Deprecated options with-openssl Deprecated option for ssl From 7c1c4c7167ba61538342cebf92d10cc48c608533 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Mar 2006 09:59:16 +0200 Subject: [PATCH 10/11] Move "start-from" into section "Control what tests to run" --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c73603b0961..a4d210f36b6 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -587,6 +587,7 @@ sub command_line_setup () { 'with-ndbcluster-only' => \$opt_with_ndbcluster_only, 'ndb-extra-test' => \$opt_ndb_extra_test, 'do-test=s' => \$opt_do_test, + 'start-from=s' => \$opt_start_from, 'suite=s' => \$opt_suite, 'skip-rpl' => \$opt_skip_rpl, 'skip-im' => \$opt_skip_im, @@ -665,7 +666,6 @@ sub command_line_setup () { 'socket=s' => \$opt_socket, 'start-dirty' => \$opt_start_dirty, 'start-and-exit' => \$opt_start_and_exit, - 'start-from=s' => \$opt_start_from, 'timer' => \$opt_timer, 'unified-diff|udiff' => \$opt_udiff, 'user-test=s' => \$opt_user_test, From af74454572800464515a068f9efcbb560f6b30bc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Mar 2006 13:13:39 +0200 Subject: [PATCH 11/11] Added more debugging printouts --- sql/ha_ndbcluster.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 30dc90ee630..1a174867189 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3397,6 +3397,7 @@ int ha_ndbcluster::rnd_pos(byte *buf, byte *pos) The partition id has been fetched from ndb and has been stored directly after the hidden key */ + DBUG_DUMP("key+part", (char *)pos, key_length); key_length= ref_length - sizeof(m_part_id); part_spec.start_part= part_spec.end_part= *(pos + key_length); } @@ -3413,6 +3414,7 @@ int ha_ndbcluster::rnd_pos(byte *buf, byte *pos) } DBUG_PRINT("info", ("partition id %u", part_spec.start_part)); } + DBUG_DUMP("key", (char *)pos, key_length); DBUG_RETURN(pk_read(pos, key_length, buf, part_spec.start_part)); } } @@ -3498,7 +3500,10 @@ void ha_ndbcluster::position(const byte *record) #endif memcpy(ref, m_ref, key_length); } - +#ifndef DBUG_OFF + if (table_share->primary_key == MAX_KEY && m_use_partition_function) + DBUG_DUMP("key+part", (char*)ref, key_length+sizeof(m_part_id)); +#endif DBUG_DUMP("ref", (char*)ref, key_length); DBUG_VOID_RETURN; }