Added --debug-info to most clients to detect memory leaks in mysql-test-run

Moved .progress files into the log directory
Moved 'cluster' database tables into the MySQL database, to not have 'cluster' beeing a reserved database name
Fixed bug where mysqld got a core dump when trying to use a table created by MySQL 3.23
Fixed some compiler warnings
Fixed small memory leak in libmysql
Note that this doesn't changeset doesn't include the new mysqldump.c code required to run some tests. This will be added when I merge 5.0 to 5.1


client/client_priv.h:
  Added OPT_DEBUG_INFO and OPT_COLUMN_TYPES
client/mysql.cc:
  Split --debug-info into --debug-info and --column-type-info
client/mysql_upgrade.c:
  Give only error info at end if using --debug-info
client/mysqladmin.cc:
  Added --debug-info to detect memory leaks in mysqltest
client/mysqlbinlog.cc:
  Added --debug-info to detect memory leaks in mysqltest
client/mysqlcheck.c:
  Added --debug-info to detect memory leaks in mysqltest
client/mysqlimport.c:
  Added --debug-info to detect memory leaks in mysqltest
client/mysqlshow.c:
  Added --debug-info to detect memory leaks in mysqltest
client/mysqltest.c:
  Added --debug-info to detect memory leaks in mysqltest
  Added option --logdir to force .progress files in a specific directory
libmysql/libmysql.c:
  Fixed memory leak
mysql-test/include/ndb_setup_slave.inc:
  Moved cluster tables under 'mysql'
mysql-test/include/query_cache.inc:
  Added more tests for query cache
mysql-test/lib/init_db.sql:
  Move cluster.binlog_index -> mysql.binlog_index
mysql-test/lib/mtr_report.pl:
  Find memory leaks
mysql-test/mysql-test-run-shell.sh:
  Added --debug-info to programs to detect memory leaks
mysql-test/mysql-test-run.pl:
  Added --debug-info to programs to detect memory leaks
  Force log files to var/log
  cluster tables moved under 'mysql'
mysql-test/r/cache_innodb.result:
  New query cache test with innodb
mysql-test/r/connect.result:
  binlog_index is now in mysql
mysql-test/r/drop.result:
  Removed 'cluster' database
mysql-test/r/information_schema.result:
  Removed 'cluster' database
mysql-test/r/mysqlcheck.result:
  cluster.binlog_index -> mysql.binlog_index
mysql-test/r/ndb_binlog_basic.result:
  cluster.binlog_index -> mysql.binlog_index
mysql-test/r/ndb_binlog_ddl_multi.result:
  cluster -> mysql
mysql-test/r/ndb_binlog_discover.result:
  cluster -> mysql
mysql-test/r/ndb_binlog_multi.result:
  cluster -> mysql
mysql-test/r/ndb_restore_compat.result:
  cluster -> mysql
mysql-test/r/ps_1general.result:
  Removed cluster database
mysql-test/r/rpl_create_database.result:
  Removed cluster database
mysql-test/r/rpl_load_from_master.result:
  Removed cluster database
mysql-test/r/rpl_loaddata_m.result:
  Removed cluster database
mysql-test/r/rpl_ndb_bank.result:
  cluster -> mysql
mysql-test/r/rpl_ndb_dd_advance.result:
  cluster -> mysql
mysql-test/r/rpl_ndb_dd_basic.result:
  cluster -> mysql
mysql-test/r/rpl_ndb_idempotent.result:
  cluster -> mysql
mysql-test/r/rpl_ndb_log.result:
  cluster -> mysql
mysql-test/r/rpl_ndb_multi.result:
  cluster -> mysql
mysql-test/r/rpl_ndb_sync.result:
  cluster -> mysql
mysql-test/r/rpl_row_basic_11bugs.result:
  Removed cluster database
mysql-test/r/rpl_truncate_7ndb.result:
  Position have changed
mysql-test/r/rpl_truncate_7ndb_2.result:
  cluster -> mysql
mysql-test/r/schema.result:
  Removed cluster database
mysql-test/r/show_check.result:
  Removed cluster database
mysql-test/r/system_mysql_db.result:
  binlog_index moved under mysql
mysql-test/r/upgrade.result:
  More tests
mysql-test/t/information_schema.test:
  cluster -> mysql
mysql-test/t/mysqldump.test:
  More test to detect memory leaks
mysql-test/t/ndb_binlog_basic.test:
  cluster -> mysql
mysql-test/t/ndb_binlog_multi.test:
  cluster -> mysql
mysql-test/t/ndb_restore_compat.test:
  cluster -> mysql
mysql-test/t/rpl_ndb_bank.test:
  cluster -> mysql
mysql-test/t/rpl_ndb_dd_advance.test:
  cluster -> mysql
mysql-test/t/rpl_ndb_idempotent.test:
  cluster -> mysql
mysql-test/t/rpl_ndb_multi.test:
  cluster -> mysql
mysql-test/t/rpl_ndb_sync.test:
  cluster -> mysql
mysql-test/t/system_mysql_db_fix.test:
  Drop also binlog_index
mysql-test/t/upgrade.test:
  Check that tables created with 3.23 works
mysys/my_error.c:
  Remove all registered errors (to avoid memory leaks)
mysys/my_init.c:
  call my_error_unregister_all() to avoid some possible memory leaks
mysys/mysys_priv.h:
  Added prototype
scripts/mysql_create_system_tables.sh:
  cluster -> mysql
scripts/mysql_fix_privilege_tables.sql:
  Changed -- to #
  Create binlog_index table if it dosesn't exist
sql/field.cc:
  Made offset() inline
sql/field.h:
  Changed prototype of offset() to not make it depending on TABLE structure
sql/field_conv.cc:
  Removed some usage of current_thd
sql/ha_ndbcluster_tables.h:
  cluster -> mysql
sql/item_sum.cc:
  Usage of new 'offset' parameters
sql/key.cc:
  Changed 'find_ref_key' to not be dependent on field->table
  (This fixed a crash when using a table created in MySQL 3.23)
sql/mysql_priv.h:
  Changed find_ref_key() to not use field->table
sql/mysqld.cc:
  Fix that plugin_init() works properly on bootstrap
  (Previously we got warnings from plugin_init)
sql/sql_class.cc:
  new 'field->offset()'
sql/sql_select.cc:
  New field->offset()
sql/table.cc:
  We don't need field->table to be set in find_ref_key() or find_field() anymore.
storage/archive/ha_archive.cc:
  New field->offset()
storage/federated/ha_federated.cc:
  New field->offset()
storage/innobase/handler/ha_innodb.cc:
  Fixed compiler warnings
storage/myisam/ha_myisam.cc:
  Fixed compiler warnings (Wrong paramter to sprintf())
  New field->offset()
storage/myisam/ha_myisam.h:
  Fixed wrong type of table_flags
storage/ndb/tools/restore/Restore.cpp:
  Fixed compiler warning
mysql-test/r/1st.result:
  New BitKeeper file ``mysql-test/r/1st.result''
mysql-test/std_data/old_table-323.frm:
  New BitKeeper file ``mysql-test/std_data/old_table-323.frm''
mysql-test/t/1st.test:
  New BitKeeper file ``mysql-test/t/1st.test''
This commit is contained in:
unknown 2006-11-21 22:32:58 +02:00
parent a316aebc6e
commit 85a590a26c
81 changed files with 596 additions and 329 deletions

View File

@ -58,5 +58,6 @@ enum options_client
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_CREATE_SLAP_SCHEMA, OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_CREATE_SLAP_SCHEMA,
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID,
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
OPT_DEBUG_INFO, OPT_COLUMN_TYPES
}; };

View File

@ -44,7 +44,7 @@
#include <locale.h> #include <locale.h>
#endif #endif
const char *VER= "14.12"; const char *VER= "14.13";
/* Don't try to make a nice table if the data is too big */ /* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024 #define MAX_COLUMN_LENGTH 1024
@ -140,6 +140,7 @@ static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
default_charset_used= 0, opt_secure_auth= 0, default_charset_used= 0, opt_secure_auth= 0,
default_pager_set= 0, opt_sigint_ignore= 0, default_pager_set= 0, opt_sigint_ignore= 0,
show_warnings= 0, executing_query= 0, interrupted_query= 0; show_warnings= 0, executing_query= 0, interrupted_query= 0;
static my_bool column_types_flag;
static ulong opt_max_allowed_packet, opt_net_buffer_length; static ulong opt_max_allowed_packet, opt_net_buffer_length;
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0; static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
static my_string opt_mysql_unix_port=0; static my_string opt_mysql_unix_port=0;
@ -530,7 +531,7 @@ sig_handler mysql_end(int sig)
my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR)); my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
mysql_server_end(); mysql_server_end();
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); my_end(info_flag ? MY_CHECK_ERROR : 0);
exit(status.exit_status); exit(status.exit_status);
} }
@ -585,12 +586,13 @@ static struct my_option my_long_options[] =
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are.", (gptr*) &charsets_dir, "Directory where character sets are.", (gptr*) &charsets_dir,
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
"Set the default character set.", (gptr*) &default_charset, (gptr*) &column_types_flag, (gptr*) &column_types_flag,
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.", {"compress", 'C', "Use compression in server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
#ifdef DBUG_OFF #ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit", {"debug", '#', "This is a non-debug version. Catch this and exit",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
@ -598,8 +600,13 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log", (gptr*) &default_dbug_option, {"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-info", 'T', "Print some debug info at exit.", (gptr*) &info_flag,
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'D', "Database to use.", (gptr*) &current_db, {"database", 'D', "Database to use.", (gptr*) &current_db,
(gptr*) &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (gptr*) &default_charset,
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delimiter", OPT_DELIMITER, "Delimiter to be used.", (gptr*) &delimiter_str, {"delimiter", OPT_DELIMITER, "Delimiter to be used.", (gptr*) &delimiter_str,
(gptr*) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"execute", 'e', "Execute command and quit. (Disables --force and history file)", 0, {"execute", 'e', "Execute command and quit. (Disables --force and history file)", 0,
@ -696,8 +703,6 @@ static struct my_option my_long_options[] =
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
{"table", 't', "Output in table format.", (gptr*) &output_tables, {"table", 't', "Output in table format.", (gptr*) &output_tables,
(gptr*) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "Print some debug info at exit.", (gptr*) &info_flag,
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"tee", OPT_TEE, {"tee", OPT_TEE,
"Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.", "Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -2070,7 +2075,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
time_buff[0]=0; time_buff[0]=0;
if (result) if (result)
{ {
if (!mysql_num_rows(result) && ! quick && !info_flag) if (!mysql_num_rows(result) && ! quick && !column_types_flag)
{ {
strmov(buff, "Empty set"); strmov(buff, "Empty set");
} }
@ -2307,7 +2312,7 @@ print_table_data(MYSQL_RES *result)
bool *num_flag; bool *num_flag;
num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result)); num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
if (info_flag) if (column_types_flag)
{ {
print_field_types(result); print_field_types(result);
if (!mysql_num_rows(result)) if (!mysql_num_rows(result))

View File

@ -418,6 +418,6 @@ fix_priv_tables:
err_exit: err_exit:
if (upgrade_defaults_created) if (upgrade_defaults_created)
my_delete(upgrade_defaults_path, MYF(0)); my_delete(upgrade_defaults_path, MYF(0));
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); my_end(info_flag ? MY_CHECK_ERROR : 0);
return error; return error;
} /* main */ } /* main */

View File

@ -28,7 +28,7 @@
#include "../ndb/src/mgmclient/ndb_mgmclient.h" #include "../ndb/src/mgmclient/ndb_mgmclient.h"
#endif #endif
#define ADMIN_VERSION "8.41" #define ADMIN_VERSION "8.42"
#define MAX_MYSQL_VAR 256 #define MAX_MYSQL_VAR 256
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3 #define MAX_TRUNC_LENGTH 3
@ -41,7 +41,7 @@ ulonglong last_values[MAX_MYSQL_VAR];
static int interval=0; static int interval=0;
static my_bool option_force=0,interrupted=0,new_line=0, static my_bool option_force=0,interrupted=0,new_line=0,
opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0, opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0,
tty_password=0; tty_password= 0, info_flag= 0;
static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations, static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations,
opt_count_iterations= 0; opt_count_iterations= 0;
static ulong opt_connect_timeout, opt_shutdown_timeout; static ulong opt_connect_timeout, opt_shutdown_timeout;
@ -136,6 +136,8 @@ static struct my_option my_long_options[] =
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f', {"force", 'f',
"Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs.", "Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs.",
(gptr*) &option_force, (gptr*) &option_force, 0, GET_BOOL, NO_ARG, 0, 0, (gptr*) &option_force, (gptr*) &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
@ -412,7 +414,7 @@ int main(int argc,char *argv[])
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif #endif
free_defaults(save_argv); free_defaults(save_argv);
my_end(0); my_end(info_flag ? MY_CHECK_ERROR : 0);
exit(error ? 1 : 0); exit(error ? 1 : 0);
return 0; return 0;
} }

View File

@ -66,7 +66,7 @@ static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0;
static bool opt_hexdump= 0; static bool opt_hexdump= 0;
static bool opt_base64_output= 0; static bool opt_base64_output= 0;
static const char* database= 0; static const char* database= 0;
static my_bool force_opt= 0, short_form= 0, remote_opt= 0; static my_bool force_opt= 0, short_form= 0, remote_opt= 0, info_flag;
static ulonglong offset = 0; static ulonglong offset = 0;
static const char* host = 0; static const char* host = 0;
static int port= 0; static int port= 0;
@ -716,6 +716,8 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log.", (gptr*) &default_dbug_option, {"debug", '#', "Output debug log.", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"disable-log-bin", 'D', "Disable binary log. This is useful, if you " {"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
"enabled --to-last-log and are sending the output to the same MySQL server. " "enabled --to-last-log and are sending the output to the same MySQL server. "
"This way you could avoid an endless loop. You would also like to use it " "This way you could avoid an endless loop. You would also like to use it "
@ -844,7 +846,7 @@ static void die(const char* fmt, ...)
va_end(args); va_end(args);
cleanup(); cleanup();
/* We cannot free DBUG, it is used in global destructors after exit(). */ /* We cannot free DBUG, it is used in global destructors after exit(). */
my_end(MY_DONT_FREE_DBUG); my_end((info_flag ? MY_CHECK_ERROR : 0) | MY_DONT_FREE_DBUG);
exit(1); exit(1);
} }
@ -852,7 +854,7 @@ static void die(const char* fmt, ...)
static void print_version() static void print_version()
{ {
printf("%s Ver 3.1 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); printf("%s Ver 3.2 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1); NETWARE_SET_SCREEN_MODE(1);
} }
@ -1530,7 +1532,7 @@ int main(int argc, char** argv)
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_free_open_file_info(); my_free_open_file_info();
/* We cannot free DBUG, it is used in global destructors after exit(). */ /* We cannot free DBUG, it is used in global destructors after exit(). */
my_end(MY_DONT_FREE_DBUG); my_end((info_flag ? MY_CHECK_ERROR : 0) | MY_DONT_FREE_DBUG);
exit(exit_value); exit(exit_value);
DBUG_RETURN(exit_value); // Keep compilers happy DBUG_RETURN(exit_value); // Keep compilers happy
} }

View File

@ -16,7 +16,7 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */ /* By Jani Tolonen, 2001-04-20, MySQL Development Team */
#define CHECK_VERSION "2.4.4" #define CHECK_VERSION "2.4.5"
#include "client_priv.h" #include "client_priv.h"
#include <m_ctype.h> #include <m_ctype.h>
@ -34,7 +34,7 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_compress = 0, opt_databases = 0, opt_fast = 0, opt_compress = 0, opt_databases = 0, opt_fast = 0,
opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0, opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0, opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
tty_password = 0, opt_frm = 0, tty_password= 0, opt_frm= 0, info_flag= 0,
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0; opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0;
static uint verbose = 0, opt_mysql_port=0; static uint verbose = 0, opt_mysql_port=0;
static my_string opt_mysql_unix_port = 0; static my_string opt_mysql_unix_port = 0;
@ -96,6 +96,8 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (gptr*) &default_charset, "Set the default character set.", (gptr*) &default_charset,
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -761,7 +763,7 @@ int main(int argc, char **argv)
*/ */
if (get_options(&argc, &argv)) if (get_options(&argc, &argv))
{ {
my_end(0); my_end(info_flag ? MY_CHECK_ERROR : 0);
exit(EX_USAGE); exit(EX_USAGE);
} }
if (dbConnect(current_host, current_user, opt_password)) if (dbConnect(current_host, current_user, opt_password))
@ -803,6 +805,6 @@ int main(int argc, char **argv)
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif #endif
my_end(0); my_end(info_flag ? MY_CHECK_ERROR : 0);
return(first_error!=0); return(first_error!=0);
} /* main */ } /* main */

View File

@ -25,7 +25,7 @@
** * * ** * *
** ************************* ** *************************
*/ */
#define IMPORT_VERSION "3.5" #define IMPORT_VERSION "3.6"
#include "client_priv.h" #include "client_priv.h"
#include "mysql_version.h" #include "mysql_version.h"
@ -50,7 +50,7 @@ static char *add_load_option(char *ptr,const char *object,
static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0, static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0,
replace=0,silent=0,ignore=0,opt_compress=0, replace=0,silent=0,ignore=0,opt_compress=0,
opt_low_priority= 0, tty_password= 0; opt_low_priority= 0, tty_password= 0;
static my_bool opt_use_threads= 0; static my_bool opt_use_threads= 0, info_flag= 0;
static uint opt_local_file=0; static uint opt_local_file=0;
static char *opt_password=0, *current_user=0, static char *opt_password=0, *current_user=0,
*current_host=0, *current_db=0, *fields_terminated=0, *current_host=0, *current_db=0, *fields_terminated=0,
@ -88,6 +88,8 @@ static struct my_option my_long_options[] =
0, 0, 0}, 0, 0, 0},
{"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, {"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"delete", 'd', "First delete all rows from table.", (gptr*) &opt_delete, {"delete", 'd', "First delete all rows from table.", (gptr*) &opt_delete,
(gptr*) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB, {"fields-terminated-by", OPT_FTB,
@ -663,6 +665,6 @@ int main(int argc, char **argv)
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif #endif
free_defaults(argv_to_free); free_defaults(argv_to_free);
my_end(0); my_end(info_flag ? MY_CHECK_ERROR : 0);
return(exitcode); return(exitcode);
} }

View File

@ -16,7 +16,7 @@
/* Show databases, tables or columns */ /* Show databases, tables or columns */
#define SHOW_VERSION "9.5" #define SHOW_VERSION "9.6"
#include "client_priv.h" #include "client_priv.h"
#include <my_sys.h> #include <my_sys.h>
@ -28,8 +28,8 @@
#include <sslopt-vars.h> #include <sslopt-vars.h>
static my_string host=0,opt_password=0,user=0; static my_string host=0,opt_password=0,user=0;
static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0, static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0;
tty_password= 0, opt_table_type= 0; static my_bool tty_password= 0, opt_table_type= 0, info_flag= 0;
static uint opt_verbose=0; static uint opt_verbose=0;
static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
@ -129,8 +129,7 @@ int main(int argc, char **argv)
} }
mysql.reconnect= 1; mysql.reconnect= 1;
switch (argc) switch (argc) {
{
case 0: error=list_dbs(&mysql,wild); break; case 0: error=list_dbs(&mysql,wild); break;
case 1: case 1:
if (opt_status) if (opt_status)
@ -151,7 +150,7 @@ int main(int argc, char **argv)
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif #endif
my_end(0); my_end(info_flag ? MY_CHECK_ERROR : 0);
exit(error ? 1 : 0); exit(error ? 1 : 0);
return 0; /* No compiler warnings */ return 0; /* No compiler warnings */
} }
@ -177,6 +176,8 @@ static struct my_option my_long_options[] =
0, 0, 0}, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR, {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR,

View File

@ -97,7 +97,7 @@ enum {OPT_SKIP_SAFEMALLOC=256, OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT,
OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL, OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL,
OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES, OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES,
OPT_MARK_PROGRESS}; OPT_MARK_PROGRESS, OPT_LOG_DIR, OPT_DEBUG_INFO};
/* ************************************************************************ */ /* ************************************************************************ */
/* /*
@ -145,6 +145,7 @@ static uint global_expected_errors;
static int record= 0, opt_sleep= -1; static int record= 0, opt_sleep= -1;
static char *db = 0, *pass=0; static char *db = 0, *pass=0;
const char *user = 0, *host = 0, *unix_sock = 0, *opt_basedir="./"; const char *user = 0, *host = 0, *unix_sock = 0, *opt_basedir="./";
const char *opt_logdir= "";
const char *opt_include= 0; const char *opt_include= 0;
static int port = 0; static int port = 0;
static int opt_max_connect_retries; static int opt_max_connect_retries;
@ -155,7 +156,7 @@ static my_bool ps_protocol= 0, ps_protocol_enabled= 0;
static my_bool sp_protocol= 0, sp_protocol_enabled= 0; static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
static my_bool view_protocol= 0, view_protocol_enabled= 0; static my_bool view_protocol= 0, view_protocol_enabled= 0;
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0; static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
static my_bool opt_valgrind_test= 0; static my_bool opt_valgrind_test= 0, info_flag;
static int parsing_disabled= 0; static int parsing_disabled= 0;
static char **default_argv; static char **default_argv;
@ -658,7 +659,7 @@ static void die(const char *fmt, ...)
/* Clean up and exit */ /* Clean up and exit */
free_used_memory(); free_used_memory();
my_end(MY_CHECK_ERROR); my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
if (!silent) if (!silent)
printf("not ok\n"); printf("not ok\n");
@ -698,7 +699,7 @@ static void abort_not_supported_test(const char *fmt, ...)
/* Clean up and exit */ /* Clean up and exit */
free_used_memory(); free_used_memory();
my_end(MY_CHECK_ERROR); my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
if (!silent) if (!silent)
printf("skipped\n"); printf("skipped\n");
@ -3295,12 +3296,16 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"include", 'i', "Include SQL before each test case.", (gptr*) &opt_include, {"include", 'i', "Include SQL before each test case.", (gptr*) &opt_include,
(gptr*) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"logdir", OPT_LOG_DIR, "Directory for log files", (gptr*) &opt_logdir,
(gptr*) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"mark-progress", OPT_MARK_PROGRESS, {"mark-progress", OPT_MARK_PROGRESS,
"Write linenumber and elapsed time to <testname>.progress ", "Write linenumber and elapsed time to <testname>.progress",
(gptr*) &opt_mark_progress, (gptr*) &opt_mark_progress, 0, (gptr*) &opt_mark_progress, (gptr*) &opt_mark_progress, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"max-connect-retries", OPT_MAX_CONNECT_RETRIES, {"max-connect-retries", OPT_MAX_CONNECT_RETRIES,
@ -3538,7 +3543,8 @@ void dump_result_to_reject_file(const char *record_file, char *buf, int size)
void dump_result_to_log_file(const char *record_file, char *buf, int size) void dump_result_to_log_file(const char *record_file, char *buf, int size)
{ {
char log_file[FN_REFLEN]; char log_file[FN_REFLEN];
str_to_file(fn_format(log_file, record_file, "", ".log", str_to_file(fn_format(log_file, record_file, opt_logdir, ".log",
*opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT:
MY_REPLACE_EXT), MY_REPLACE_EXT),
buf, size); buf, size);
} }
@ -3546,7 +3552,8 @@ void dump_result_to_log_file(const char *record_file, char *buf, int size)
void dump_progress(const char *record_file) void dump_progress(const char *record_file)
{ {
char log_file[FN_REFLEN]; char log_file[FN_REFLEN];
str_to_file(fn_format(log_file, record_file, "", ".progress", str_to_file(fn_format(log_file, record_file, opt_logdir, ".progress",
*opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT:
MY_REPLACE_EXT), MY_REPLACE_EXT),
ds_progress.str, ds_progress.length); ds_progress.str, ds_progress.length);
} }
@ -5600,7 +5607,7 @@ int main(int argc, char **argv)
if (!got_end_timer) if (!got_end_timer)
timer_output(); /* No end_timer cmd, end it */ timer_output(); /* No end_timer cmd, end it */
free_used_memory(); free_used_memory();
my_end(MY_CHECK_ERROR); my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
/* Yes, if we got this far the test has suceeded! Sakila smiles */ /* Yes, if we got this far the test has suceeded! Sakila smiles */
if (!silent) if (!silent)

View File

@ -176,16 +176,15 @@ void STDCALL mysql_server_end()
end_embedded_server(); end_embedded_server();
#endif #endif
/* If library called my_init(), free memory allocated by it */ /* If library called my_init(), free memory allocated by it */
finish_client_errs();
if (!org_my_init_done) if (!org_my_init_done)
{ {
my_end(MY_DONT_FREE_DBUG); my_end(MY_DONT_FREE_DBUG);
/* Remove TRACING, if enabled by mysql_debug() */ /* Remove TRACING, if enabled by mysql_debug() */
DBUG_POP(); DBUG_POP();
} }
else else
mysql_thread_end(); mysql_thread_end();
finish_client_errs();
free_charsets();
vio_end(); vio_end();
mysql_client_init= org_my_init_done= 0; mysql_client_init= org_my_init_done= 0;
#ifdef EMBEDDED_SERVER #ifdef EMBEDDED_SERVER

View File

@ -7,7 +7,7 @@
# 1. # 1.
--connection slave --connection slave
--replace_column 1 <the_epoch> --replace_column 1 <the_epoch>
SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status; SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status;
--let $the_epoch= `select @the_epoch` --let $the_epoch= `select @the_epoch`
# 2. # 2.
@ -15,7 +15,7 @@ SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status;
--replace_result $the_epoch <the_epoch> --replace_result $the_epoch <the_epoch>
--replace_column 1 <the_pos> --replace_column 1 <the_pos>
eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster.binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1; FROM mysql.binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1;
--let $the_pos= `SELECT @the_pos` --let $the_pos= `SELECT @the_pos`
--let $the_file= `SELECT @the_file` --let $the_file= `SELECT @the_file`

View File

@ -100,4 +100,82 @@ eval set GLOBAL query_cache_size=$save_query_cache_size;
--enable_query_log --enable_query_log
} }
# End of 4.1 tests #
# Test query cache with two interleaving transactions
#
# Establish connection1
connect (connection1,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
SET @@autocommit=1;
connection default;
--echo connection default
-- This should be 'YES'.
SHOW VARIABLES LIKE 'have_query_cache';
SET GLOBAL query_cache_size = 200000;
flush status;
SET @@autocommit=1;
eval SET SESSION STORAGE_ENGINE = $engine_type;
CREATE TABLE t2 (s1 int, s2 varchar(1000), key(s1));
INSERT INTO t2 VALUES (1,repeat('a',10)),(2,repeat('a',10)),(3,repeat('a',10)),(4,repeat('a',10));
COMMIT;
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
UPDATE t2 SET s2 = 'w' WHERE s1 = 3;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection connection1;
--echo connection connection1
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
INSERT INTO t2 VALUES (5,'w');
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
COMMIT;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection default;
--echo connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
COMMIT;
show status like "Qcache_queries_in_cache";
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection connection1;
--echo connection connection1
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
INSERT INTO t2 VALUES (6,'w');
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
connection default;
--echo connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
DELETE from t2 WHERE s1=3;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
COMMIT;
connection connection1;
--echo connection connection1
COMMIT;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
# Final cleanup
connection default;
drop table t2;
disconnect connection1;

View File

@ -634,5 +634,4 @@ CREATE TABLE event (
PRIMARY KEY (db, name) PRIMARY KEY (db, name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
CREATE DATABASE IF NOT EXISTS cluster; CREATE TABLE IF NOT EXISTS mysql.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
CREATE TABLE IF NOT EXISTS cluster.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;

View File

@ -38,7 +38,7 @@ sub mtr_show_failed_diff ($) {
my $reject_file= "r/$tname.reject"; my $reject_file= "r/$tname.reject";
my $result_file= "r/$tname.result"; my $result_file= "r/$tname.result";
my $log_file= "r/$tname.log"; my $log_file= "$::opt_vardir/log/$tname.log";
my $eval_file= "r/$tname.eval"; my $eval_file= "r/$tname.eval";
if ( $::opt_suite ne "main" ) if ( $::opt_suite ne "main" )
@ -251,6 +251,7 @@ sub mtr_report_stats ($) {
foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x", foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x",
"InnoDB: Warning", "missing DBUG_RETURN", "InnoDB: Warning", "missing DBUG_RETURN",
"mysqld: Warning", "mysqld: Warning",
"allocated at line",
"Attempting backtrace", "Assertion .* failed" ) "Attempting backtrace", "Assertion .* failed" )
{ {
foreach my $errlog ( sort glob("$::opt_vardir/log/*.err") ) foreach my $errlog ( sort glob("$::opt_vardir/log/*.err") )

View File

@ -882,15 +882,15 @@ fi
# Save path and name of mysqldump # Save path and name of mysqldump
MYSQL_DUMP_DIR="$MYSQL_DUMP" MYSQL_DUMP_DIR="$MYSQL_DUMP"
export MYSQL_DUMP_DIR export MYSQL_DUMP_DIR
MYSQL_CHECK="$MYSQL_CHECK --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLCHECK_OPT" MYSQL_CHECK="$MYSQL_CHECK --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLCHECK_OPT"
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_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_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_DUMP_SLAVE="$MYSQL_DUMP_DIR --no-defaults -uroot --socket=$SLAVE_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT" MYSQL_SHOW="$MYSQL_SHOW --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_BINLOG="$MYSQL_BINLOG --debug-info --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
MYSQL_IMPORT="$MYSQL_IMPORT -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT" MYSQL_IMPORT="$MYSQL_IMPORT --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_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 --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" 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 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 CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR MYSQL_MY_PRINT_DEFAULTS
export MYSQL_SLAP export MYSQL_SLAP
@ -1263,8 +1263,8 @@ start_ndbcluster()
rm_ndbcluster_tables() rm_ndbcluster_tables()
{ {
$RM -f $1/cluster/apply_status* $RM -f $1/mysql/apply_status*
$RM -f $1/cluster/schema* $RM -f $1/mysql/schema*
} }
stop_ndbcluster() stop_ndbcluster()

View File

@ -1330,7 +1330,7 @@ sub executable_setup () {
sub generate_cmdline_mysqldump ($) { sub generate_cmdline_mysqldump ($) {
my($mysqld) = @_; my($mysqld) = @_;
return return
"$exe_mysqldump --no-defaults -uroot " . "$exe_mysqldump --no-defaults --debug-info -uroot " .
"--port=$mysqld->{'port'} " . "--port=$mysqld->{'port'} " .
"--socket=$mysqld->{'path_sock'} --password="; "--socket=$mysqld->{'path_sock'} --password=";
} }
@ -1468,7 +1468,7 @@ sub environment_setup () {
# Setup env so childs can execute mysqlcheck # Setup env so childs can execute mysqlcheck
# ---------------------------------------------------- # ----------------------------------------------------
my $cmdline_mysqlcheck= my $cmdline_mysqlcheck=
"$exe_mysqlcheck --no-defaults -uroot " . "$exe_mysqlcheck --no-defaults --debug-info -uroot " .
"--port=$master->[0]->{'port'} " . "--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password="; "--socket=$master->[0]->{'path_sock'} --password=";
@ -1519,7 +1519,7 @@ sub environment_setup () {
# Setup env so childs can execute mysqlimport # Setup env so childs can execute mysqlimport
# ---------------------------------------------------- # ----------------------------------------------------
my $cmdline_mysqlimport= my $cmdline_mysqlimport=
"$exe_mysqlimport -uroot " . "$exe_mysqlimport --debug-info -uroot " .
"--port=$master->[0]->{'port'} " . "--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password="; "--socket=$master->[0]->{'path_sock'} --password=";
@ -1535,7 +1535,7 @@ sub environment_setup () {
# Setup env so childs can execute mysqlshow # Setup env so childs can execute mysqlshow
# ---------------------------------------------------- # ----------------------------------------------------
my $cmdline_mysqlshow= my $cmdline_mysqlshow=
"$exe_mysqlshow -uroot " . "$exe_mysqlshow --debug-info -uroot " .
"--port=$master->[0]->{'port'} " . "--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password="; "--socket=$master->[0]->{'path_sock'} --password=";
@ -1551,7 +1551,7 @@ sub environment_setup () {
# ---------------------------------------------------- # ----------------------------------------------------
my $cmdline_mysqlbinlog= my $cmdline_mysqlbinlog=
"$exe_mysqlbinlog" . "$exe_mysqlbinlog" .
" --no-defaults --local-load=$opt_tmpdir" . " --no-defaults --debug-info --local-load=$opt_tmpdir" .
" --character-sets-dir=$path_charsetsdir"; " --character-sets-dir=$path_charsetsdir";
if ( $opt_debug ) if ( $opt_debug )
@ -1565,7 +1565,7 @@ sub environment_setup () {
# Setup env so childs can execute mysql # Setup env so childs can execute mysql
# ---------------------------------------------------- # ----------------------------------------------------
my $cmdline_mysql= my $cmdline_mysql=
"$exe_mysql --no-defaults --host=localhost --user=root --password= " . "$exe_mysql --no-defaults --debug-info --host=localhost --user=root --password= " .
"--port=$master->[0]->{'port'} " . "--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} ". "--socket=$master->[0]->{'path_sock'} ".
"--character-sets-dir=$path_charsetsdir"; "--character-sets-dir=$path_charsetsdir";
@ -2116,8 +2116,8 @@ sub ndbcluster_start ($$) {
sub rm_ndbcluster_tables ($) { sub rm_ndbcluster_tables ($) {
my $dir= shift; my $dir= shift;
foreach my $bin ( glob("$dir/cluster/apply_status*"), foreach my $bin ( glob("$dir/mysql/apply_status*"),
glob("$dir/cluster/schema*") ) glob("$dir/mysql/schema*") )
{ {
unlink($bin); unlink($bin);
} }
@ -2616,11 +2616,11 @@ sub do_after_run_mysqltest($)
my $tname= $tinfo->{'name'}; my $tname= $tinfo->{'name'};
#MASV cleanup #MASV cleanup
# Save info from this testcase run to mysqltest.log # Save info from this testcase run to mysqltest.log
my $testcase_log= mtr_fromfile($path_timefile) if -f $path_timefile; my $testcase_log= mtr_fromfile($path_timefile) if -f $path_timefile;
mtr_tofile($path_mysqltest_log,"CURRENT TEST $tname\n"); mtr_tofile($path_mysqltest_log,"CURRENT TEST $tname\n");
mtr_tofile($path_mysqltest_log, $testcase_log); mtr_tofile($path_mysqltest_log, $testcase_log);
} }
############################################################################## ##############################################################################
@ -2670,6 +2670,8 @@ sub run_testcase ($) {
my $res= run_mysqltest($tinfo); my $res= run_mysqltest($tinfo);
mtr_report_test_name($tinfo); mtr_report_test_name($tinfo);
do_after_run_mysqltest($tinfo);
if ( $res == 0 ) if ( $res == 0 )
{ {
mtr_report_test_passed($tinfo); mtr_report_test_passed($tinfo);
@ -2702,8 +2704,6 @@ sub run_testcase ($) {
report_failure_and_restart($tinfo); report_failure_and_restart($tinfo);
} }
do_after_run_mysqltest($tinfo);
} }
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
@ -3643,11 +3643,11 @@ sub run_testcase_start_servers($) {
# First wait for first mysql server to have created ndb system tables ok # First wait for first mysql server to have created ndb system tables ok
# FIXME This is a workaround so that only one mysqld creates the tables # FIXME This is a workaround so that only one mysqld creates the tables
if ( ! sleep_until_file_created( if ( ! sleep_until_file_created(
"$master->[0]->{'path_myddir'}/cluster/apply_status.ndb", "$master->[0]->{'path_myddir'}/mysql/apply_status.ndb",
$master->[0]->{'start_timeout'}, $master->[0]->{'start_timeout'},
$master->[0]->{'pid'})) $master->[0]->{'pid'}))
{ {
mtr_report("Failed to create 'cluster/apply_status' table"); mtr_report("Failed to create 'mysql/apply_status' table");
report_failure_and_restart($tinfo); report_failure_and_restart($tinfo);
return; return;
} }
@ -3808,6 +3808,7 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "-v"); mtr_add_arg($args, "-v");
mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--skip-safemalloc");
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
if ($tinfo->{'component_id'} eq 'im') if ($tinfo->{'component_id'} eq 'im')
{ {

29
mysql-test/r/1st.result Normal file
View File

@ -0,0 +1,29 @@
show databases;
Database
information_schema
mysql
test
show tables in mysql;
Tables_in_mysql
binlog_index
columns_priv
db
event
func
general_log
help_category
help_keyword
help_relation
help_topic
host
plugin
proc
procs_priv
slow_log
tables_priv
time_zone
time_zone_leap_second
time_zone_name
time_zone_transition
time_zone_transition_type
user

View File

@ -128,3 +128,94 @@ select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t
id a id a
1 me 1 me
drop table t3,t2,t1; drop table t3,t2,t1;
SET SESSION STORAGE_ENGINE = InnoDB;
SET @@autocommit=1;
connection default
SHOW VARIABLES LIKE 'have_query_cache';
Variable_name Value
have_query_cache YES
SET GLOBAL query_cache_size = 200000;
flush status;
SET @@autocommit=1;
SET SESSION STORAGE_ENGINE = InnoDB;
CREATE TABLE t2 (s1 int, s2 varchar(1000), key(s1));
INSERT INTO t2 VALUES (1,repeat('a',10)),(2,repeat('a',10)),(3,repeat('a',10)),(4,repeat('a',10));
COMMIT;
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
0
UPDATE t2 SET s2 = 'w' WHERE s1 = 3;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
connection connection1
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
0
INSERT INTO t2 VALUES (5,'w');
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
1
COMMIT;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
1
COMMIT;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
connection connection1
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
INSERT INTO t2 VALUES (6,'w');
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
3
connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
DELETE from t2 WHERE s1=3;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
1
COMMIT;
connection connection1
COMMIT;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 2
drop table t2;

View File

@ -1,6 +1,7 @@
drop table if exists t1,t2; drop table if exists t1,t2;
show tables; show tables;
Tables_in_mysql Tables_in_mysql
binlog_index
columns_priv columns_priv
db db
event event
@ -32,6 +33,7 @@ grant ALL on *.* to test@localhost identified by "gambling";
grant ALL on *.* to test@127.0.0.1 identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling";
show tables; show tables;
Tables_in_mysql Tables_in_mysql
binlog_index
columns_priv columns_priv
db db
event event
@ -71,6 +73,7 @@ ERROR HY000: Password hash should be a 41-digit hexadecimal number
set password=old_password('gambling3'); set password=old_password('gambling3');
show tables; show tables;
Tables_in_mysql Tables_in_mysql
binlog_index
columns_priv columns_priv
db db
event event

View File

@ -47,7 +47,6 @@ create database mysqltest;
show databases; show databases;
Database Database
information_schema information_schema
cluster
mysql mysql
mysqltest mysqltest
test test
@ -59,7 +58,6 @@ drop database mysqltest;
show databases; show databases;
Database Database
information_schema information_schema
cluster
mysql mysql
test test
drop database mysqltest; drop database mysqltest;

View File

@ -14,7 +14,6 @@ NULL test latin1 latin1_swedish_ci NULL
select schema_name from information_schema.schemata; select schema_name from information_schema.schemata;
schema_name schema_name
information_schema information_schema
cluster
mysql mysql
test test
show databases like 't%'; show databases like 't%';
@ -23,7 +22,6 @@ test
show databases; show databases;
Database Database
information_schema information_schema
cluster
mysql mysql
test test
show databases where `database` = 't%'; show databases where `database` = 't%';
@ -35,7 +33,7 @@ create table t3(a int, KEY a_data (a));
create table mysqltest.t4(a int); create table mysqltest.t4(a int);
create table t5 (id int auto_increment primary key); create table t5 (id int auto_increment primary key);
insert into t5 values (10); insert into t5 values (10);
create view v1 (c) as select table_name from information_schema.TABLES where table_schema!='cluster'; create view v1 (c) as select table_name from information_schema.TABLES where table_name<>'binlog_index' AND table_name<>'apply_status';
select * from v1; select * from v1;
c c
CHARACTER_SETS CHARACTER_SETS
@ -352,7 +350,6 @@ create view v0 (c) as select schema_name from information_schema.schemata;
select * from v0; select * from v0;
c c
information_schema information_schema
cluster
mysql mysql
test test
explain select * from v0; explain select * from v0;
@ -851,7 +848,7 @@ VIEWS TABLE_NAME select
delete from mysql.user where user='mysqltest_4'; delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4'; delete from mysql.db where user='mysqltest_4';
flush privileges; flush privileges;
SELECT table_schema, count(*) FROM information_schema.TABLES where TABLE_SCHEMA!='cluster' GROUP BY TABLE_SCHEMA; SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'binlog_index' AND table_name<>'apply_status' GROUP BY TABLE_SCHEMA;
table_schema count(*) table_schema count(*)
information_schema 27 information_schema 27
mysql 21 mysql 21

View File

@ -2,7 +2,7 @@ drop database if exists client_test_db;
DROP SCHEMA test; DROP SCHEMA test;
CREATE SCHEMA test; CREATE SCHEMA test;
use test; use test;
cluster.binlog_index OK mysql.binlog_index OK
mysql.columns_priv OK mysql.columns_priv OK
mysql.db OK mysql.db OK
mysql.event OK mysql.event OK
@ -26,6 +26,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
mysql.binlog_index OK
mysql.columns_priv OK mysql.columns_priv OK
mysql.db OK mysql.db OK
mysql.event OK mysql.event OK

View File

@ -6,7 +6,7 @@ drop database mysqltest;
use test; use test;
create table t1 (a int primary key) engine=ndb; create table t1 (a int primary key) engine=ndb;
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
select @max_epoch:=max(epoch)-1 from cluster.binlog_index; select @max_epoch:=max(epoch)-1 from mysql.binlog_index;
@max_epoch:=max(epoch)-1 @max_epoch:=max(epoch)-1
# #
delete from t1; delete from t1;
@ -19,19 +19,19 @@ update t2 set b=1 where a=3;
delete from t2 where a=4; delete from t2 where a=4;
commit; commit;
drop table t2; drop table t2;
select inserts from cluster.binlog_index where epoch > @max_epoch and inserts > 5; select inserts from mysql.binlog_index where epoch > @max_epoch and inserts > 5;
inserts inserts
10 10
select deletes from cluster.binlog_index where epoch > @max_epoch and deletes > 5; select deletes from mysql.binlog_index where epoch > @max_epoch and deletes > 5;
deletes deletes
10 10
select inserts,updates,deletes from select inserts,updates,deletes from
cluster.binlog_index where epoch > @max_epoch and updates > 0; mysql.binlog_index where epoch > @max_epoch and updates > 0;
inserts updates deletes inserts updates deletes
2 1 1 2 1 1
flush logs; flush logs;
purge master logs before now(); purge master logs before now();
select count(*) from cluster.binlog_index; select count(*) from mysql.binlog_index;
count(*) count(*)
0 0
create table t1 (a int primary key, b int) engine=ndb; create table t1 (a int primary key, b int) engine=ndb;
@ -40,12 +40,12 @@ use mysqltest;
create table t1 (c int, d int primary key) engine=ndb; create table t1 (c int, d int primary key) engine=ndb;
use test; use test;
insert into mysqltest.t1 values (2,1),(2,2); insert into mysqltest.t1 values (2,1),(2,2);
select @max_epoch:=max(epoch)-1 from cluster.binlog_index; select @max_epoch:=max(epoch)-1 from mysql.binlog_index;
@max_epoch:=max(epoch)-1 @max_epoch:=max(epoch)-1
# #
drop table t1; drop table t1;
drop database mysqltest; drop database mysqltest;
select inserts,updates,deletes from select inserts,updates,deletes from
cluster.binlog_index where epoch > @max_epoch and inserts > 0; mysql.binlog_index where epoch > @max_epoch and inserts > 0;
inserts updates deletes inserts updates deletes
2 0 0 2 0 0

View File

@ -44,7 +44,7 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # table_id: # (test.t2) master-bin1.000001 # Table_map # # table_id: # (test.t2)
master-bin1.000001 # Table_map # # table_id: # (cluster.apply_status) master-bin1.000001 # Table_map # # table_id: # (mysql.apply_status)
master-bin1.000001 # Write_rows # # table_id: # master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin1.000001 # Query # # COMMIT master-bin1.000001 # Query # # COMMIT
@ -180,14 +180,14 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # use `test`; create table t1 (a int key) engine=ndb master-bin1.000001 # Query # # use `test`; create table t1 (a int key) engine=ndb
master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # table_id: # (test.t1) master-bin1.000001 # Table_map # # table_id: # (test.t1)
master-bin1.000001 # Table_map # # table_id: # (cluster.apply_status) master-bin1.000001 # Table_map # # table_id: # (mysql.apply_status)
master-bin1.000001 # Write_rows # # table_id: # master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin1.000001 # Query # # COMMIT master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; rename table `test.t1` to `test.t2` master-bin1.000001 # Query # # use `test`; rename table `test.t1` to `test.t2`
master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # table_id: # (test.t2) master-bin1.000001 # Table_map # # table_id: # (test.t2)
master-bin1.000001 # Table_map # # table_id: # (cluster.apply_status) master-bin1.000001 # Table_map # # table_id: # (mysql.apply_status)
master-bin1.000001 # Write_rows # # table_id: # master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin1.000001 # Query # # COMMIT master-bin1.000001 # Query # # COMMIT

View File

@ -5,7 +5,7 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Table_map # # table_id: # (cluster.apply_status) master-bin.000001 # Table_map # # table_id: # (mysql.apply_status)
master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # COMMIT

View File

@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB master-bin1.000001 # Query # # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # table_id: # (test.t2) master-bin1.000001 # Table_map # # table_id: # (test.t2)
master-bin1.000001 # Table_map # # table_id: # (cluster.apply_status) master-bin1.000001 # Table_map # # table_id: # (mysql.apply_status)
master-bin1.000001 # Write_rows # # table_id: # master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin1.000001 # Query # # COMMIT master-bin1.000001 # Query # # COMMIT
@ -20,7 +20,7 @@ a b
1 1 1 1
2 2 2 2
SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM
cluster.binlog_index ORDER BY epoch DESC LIMIT 1; mysql.binlog_index ORDER BY epoch DESC LIMIT 1;
@the_epoch:=epoch inserts updates deletes schemaops @the_epoch:=epoch inserts updates deletes schemaops
<the_epoch> 2 0 0 0 <the_epoch> 2 0 0 0
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
@ -33,13 +33,13 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (cluster.apply_status) master-bin.000001 # Table_map # # table_id: # (mysql.apply_status)
master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE t2 master-bin.000001 # Query # # use `test`; DROP TABLE t2
SELECT inserts,updates,deletes,schemaops FROM SELECT inserts,updates,deletes,schemaops FROM
cluster.binlog_index WHERE epoch=<the_epoch>; mysql.binlog_index WHERE epoch=<the_epoch>;
inserts updates deletes schemaops inserts updates deletes schemaops
2 0 0 0 2 0 0 0
reset master; reset master;
@ -51,16 +51,16 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB master-bin1.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # table_id: # (test.t1) master-bin1.000001 # Table_map # # table_id: # (test.t1)
master-bin1.000001 # Table_map # # table_id: # (cluster.apply_status) master-bin1.000001 # Table_map # # table_id: # (mysql.apply_status)
master-bin1.000001 # Write_rows # # table_id: # master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin1.000001 # Query # # COMMIT master-bin1.000001 # Query # # COMMIT
SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
cluster.binlog_index ORDER BY epoch DESC LIMIT 1; mysql.binlog_index ORDER BY epoch DESC LIMIT 1;
@the_epoch2:=epoch inserts updates deletes schemaops @the_epoch2:=epoch inserts updates deletes schemaops
<the_epoch2> 2 0 0 0 <the_epoch2> 2 0 0 0
SELECT inserts,updates,deletes,schemaops FROM SELECT inserts,updates,deletes,schemaops FROM
cluster.binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>; mysql.binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>;
inserts updates deletes schemaops inserts updates deletes schemaops
2 0 0 0 2 0 0 0
drop table t1; drop table t1;
@ -69,12 +69,12 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB master-bin1.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # table_id: # (test.t1) master-bin1.000001 # Table_map # # table_id: # (test.t1)
master-bin1.000001 # Table_map # # table_id: # (cluster.apply_status) master-bin1.000001 # Table_map # # table_id: # (mysql.apply_status)
master-bin1.000001 # Write_rows # # table_id: # master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin1.000001 # Query # # COMMIT master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; drop table t1 master-bin1.000001 # Query # # use `test`; drop table t1
SELECT inserts,updates,deletes,schemaops FROM SELECT inserts,updates,deletes,schemaops FROM
cluster.binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>; mysql.binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>;
inserts updates deletes schemaops inserts updates deletes schemaops
2 0 0 0 2 0 0 0

View File

@ -44,7 +44,7 @@ SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
SYSTEM_VALUES_ID VALUE SYSTEM_VALUES_ID VALUE
0 2039 0 2039
1 3 1 3
SELECT * FROM cluster.apply_status WHERE server_id=0; SELECT * FROM mysql.apply_status WHERE server_id=0;
server_id epoch server_id epoch
0 151 0 151
TRUNCATE GL; TRUNCATE GL;
@ -98,7 +98,7 @@ SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
SYSTEM_VALUES_ID VALUE SYSTEM_VALUES_ID VALUE
0 2297 0 2297
1 5 1 5
SELECT * FROM cluster.apply_status WHERE server_id=0; SELECT * FROM mysql.apply_status WHERE server_id=0;
server_id epoch server_id epoch
0 331 0 331
DROP DATABASE BANK; DROP DATABASE BANK;

View File

@ -259,7 +259,6 @@ prepare stmt4 from ' show databases ';
execute stmt4; execute stmt4;
Database Database
information_schema information_schema
cluster
mysql mysql
test test
prepare stmt4 from ' show tables from test like ''t2%'' '; prepare stmt4 from ' show tables from test like ''t2%'' ';

View File

@ -23,7 +23,6 @@ ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster
mysql mysql
mysqltest_bob mysqltest_bob
mysqltest_prometheus mysqltest_prometheus
@ -32,7 +31,6 @@ test
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster
mysql mysql
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
@ -47,7 +45,6 @@ CREATE TABLE t2 (a INT);
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster
mysql mysql
mysqltest_bob mysqltest_bob
mysqltest_prometheus mysqltest_prometheus
@ -56,7 +53,6 @@ test
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster
mysql mysql
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos

View File

@ -33,7 +33,6 @@ create database mysqltest;
show databases; show databases;
Database Database
information_schema information_schema
cluster
mysql mysql
mysqltest mysqltest
mysqltest2 mysqltest2
@ -51,7 +50,6 @@ set sql_log_bin = 1;
show databases; show databases;
Database Database
information_schema information_schema
cluster
mysql mysql
test test
create database mysqltest2; create database mysqltest2;
@ -71,7 +69,6 @@ load data from master;
show databases; show databases;
Database Database
information_schema information_schema
cluster
mysql mysql
mysqltest mysqltest
mysqltest2 mysqltest2

View File

@ -21,7 +21,6 @@ COUNT(*)
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster
mysql mysql
mysqltest mysqltest
test test

View File

@ -47,17 +47,17 @@ CREATE DATABASE IF NOT EXISTS BANK;
DROP DATABASE BANK; DROP DATABASE BANK;
CREATE DATABASE BANK; CREATE DATABASE BANK;
RESET MASTER; RESET MASTER;
CREATE TABLE IF NOT EXISTS cluster.backup_info (id INT, backup_id INT) ENGINE = HEAP; CREATE TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM cluster.backup_info; DELETE FROM mysql.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM cluster.backup_info; SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
@the_backup_id:=backup_id @the_backup_id:=backup_id
<the_backup_id> <the_backup_id>
SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status; SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status;
@the_epoch:=MAX(epoch) @the_epoch:=MAX(epoch)
<the_epoch> <the_epoch>
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster.binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1; FROM mysql.binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
<the_pos> master-bin.000001 <the_pos> master-bin.000001
CHANGE MASTER TO CHANGE MASTER TO

View File

@ -355,13 +355,13 @@ COUNT(*)
SELECT COUNT(*) FROM history; SELECT COUNT(*) FROM history;
COUNT(*) COUNT(*)
2000 2000
CREATE TEMPORARY TABLE IF NOT EXISTS cluster.backup_info (id INT, backup_id INT) ENGINE = HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM cluster.backup_info; DELETE FROM mysql.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM cluster.backup_info; SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
@the_backup_id:=backup_id @the_backup_id:=backup_id
<the_backup_id> <the_backup_id>
DROP TABLE IF EXISTS cluster.backup_info; DROP TABLE IF EXISTS mysql.backup_info;
************ Restore the slave ************************ ************ Restore the slave ************************
CREATE DATABASE tpcb; CREATE DATABASE tpcb;
***** Check a few slave restore values *************** ***** Check a few slave restore values ***************

View File

@ -57,7 +57,7 @@ tablespace ts1 storage disk
engine ndb engine ndb
master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Table_map # # table_id: # (cluster.apply_status) master-bin.000001 # Table_map # # table_id: # (mysql.apply_status)
master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # COMMIT

View File

@ -9,14 +9,14 @@ INSERT INTO t1 VALUES ("row1","will go away",1);
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
c1 c2 c3 c1 c2 c3
row1 will go away 1 row1 will go away 1
SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status; SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status;
@the_epoch:=MAX(epoch) @the_epoch:=MAX(epoch)
<the_epoch> <the_epoch>
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
c1 c2 c3 c1 c2 c3
row1 will go away 1 row1 will go away 1
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster.binlog_index WHERE epoch = <the_epoch> ; FROM mysql.binlog_index WHERE epoch = <the_epoch> ;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
<the_pos> master-bin.000001 <the_pos> master-bin.000001
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4); INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);

View File

@ -22,7 +22,7 @@ master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (cluster.apply_status) master-bin.000001 # Table_map 1 # table_id: # (mysql.apply_status)
master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT master-bin.000001 # Query 1 # COMMIT
@ -30,7 +30,7 @@ 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=NDB master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (cluster.apply_status) master-bin.000001 # Table_map 1 # table_id: # (mysql.apply_status)
master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT master-bin.000001 # Query 1 # COMMIT
@ -61,7 +61,7 @@ master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (cluster.apply_status) master-bin.000001 # Table_map 1 # table_id: # (mysql.apply_status)
master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT master-bin.000001 # Query 1 # COMMIT
@ -69,7 +69,7 @@ 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=NDB master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (cluster.apply_status) master-bin.000001 # Table_map 1 # table_id: # (mysql.apply_status)
master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT master-bin.000001 # Query 1 # COMMIT
@ -81,18 +81,18 @@ master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB
master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB
master-bin.000002 # Query 1 # BEGIN master-bin.000002 # Query 1 # BEGIN
master-bin.000002 # Table_map 1 # table_id: # (test.t2) master-bin.000002 # Table_map 1 # table_id: # (test.t2)
master-bin.000002 # Table_map 1 # table_id: # (cluster.apply_status) master-bin.000002 # Table_map 1 # table_id: # (mysql.apply_status)
master-bin.000002 # Write_rows 1 # table_id: # master-bin.000002 # Write_rows 1 # table_id: #
master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Query 1 # COMMIT master-bin.000002 # Query 1 # COMMIT
show binary logs; show binary logs;
Log_name File_size Log_name File_size
master-bin.000001 1698 master-bin.000001 1694
master-bin.000002 591 master-bin.000002 589
start slave; start slave;
show binary logs; show binary logs;
Log_name File_size Log_name File_size
slave-bin.000001 1793 slave-bin.000001 1789
slave-bin.000002 198 slave-bin.000002 198
show binlog events in 'slave-bin.000001' from 4; show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
@ -100,7 +100,7 @@ slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
slave-bin.000001 # Query 2 # BEGIN slave-bin.000001 # Query 2 # BEGIN
slave-bin.000001 # Table_map 2 # table_id: # (test.t1) slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
slave-bin.000001 # Table_map 2 # table_id: # (cluster.apply_status) slave-bin.000001 # Table_map 2 # table_id: # (mysql.apply_status)
slave-bin.000001 # Write_rows 2 # table_id: # slave-bin.000001 # Write_rows 2 # table_id: #
slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 2 # COMMIT slave-bin.000001 # Query 2 # COMMIT
@ -108,7 +108,7 @@ 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=NDB slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
slave-bin.000001 # Query 2 # BEGIN slave-bin.000001 # Query 2 # BEGIN
slave-bin.000001 # Table_map 2 # table_id: # (test.t1) slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
slave-bin.000001 # Table_map 2 # table_id: # (cluster.apply_status) slave-bin.000001 # Table_map 2 # table_id: # (mysql.apply_status)
slave-bin.000001 # Write_rows 2 # table_id: # slave-bin.000001 # Write_rows 2 # table_id: #
slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 2 # COMMIT slave-bin.000001 # Query 2 # COMMIT
@ -120,13 +120,13 @@ slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB
slave-bin.000002 # Query 2 # BEGIN slave-bin.000002 # Query 2 # BEGIN
slave-bin.000002 # Table_map 2 # table_id: # (test.t2) slave-bin.000002 # Table_map 2 # table_id: # (test.t2)
slave-bin.000002 # Table_map 2 # table_id: # (cluster.apply_status) slave-bin.000002 # Table_map 2 # table_id: # (mysql.apply_status)
slave-bin.000002 # Write_rows 2 # table_id: # slave-bin.000002 # Write_rows 2 # table_id: #
slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F
slave-bin.000002 # Query 2 # COMMIT slave-bin.000002 # Query 2 # COMMIT
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running 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 Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running 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 Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 591 # # master-bin.000002 Yes Yes # 0 0 591 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000002 589 # # master-bin.000002 Yes Yes # 0 0 589 # None 0 No #
show binlog events in 'slave-bin.000005' from 4; show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1; DROP TABLE t1;

View File

@ -16,7 +16,7 @@ row1 will go away 1
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
c1 c2 c3 c1 c2 c3
row1 will go away 1 row1 will go away 1
SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status; SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status;
@the_epoch:=MAX(epoch) @the_epoch:=MAX(epoch)
<the_epoch> <the_epoch>
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
@ -24,7 +24,7 @@ c1 c2 c3
row1 will go away 1 row1 will go away 1
stop slave; stop slave;
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster.binlog_index WHERE epoch = <the_epoch> ; FROM mysql.binlog_index WHERE epoch = <the_epoch> ;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
102 master-bin1.000001 102 master-bin1.000001
CHANGE MASTER TO CHANGE MASTER TO

View File

@ -60,11 +60,11 @@ hex(c2) hex(c3) c1
0 1 BCDEF 0 1 BCDEF
1 0 CD 1 0 CD
0 0 DEFGHIJKL 0 0 DEFGHIJKL
SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status; SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status;
@the_epoch:=MAX(epoch) @the_epoch:=MAX(epoch)
<the_epoch> <the_epoch>
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster.binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1; FROM mysql.binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
<the_pos> master-bin.000001 <the_pos> master-bin.000001
CHANGE MASTER TO CHANGE MASTER TO
@ -89,8 +89,8 @@ hex(c2) hex(c3) c1
DROP DATABASE ndbsynctest; DROP DATABASE ndbsynctest;
STOP SLAVE; STOP SLAVE;
reset master; reset master;
select * from cluster.binlog_index; select * from mysql.binlog_index;
Position File epoch inserts updates deletes schemaops Position File epoch inserts updates deletes schemaops
reset slave; reset slave;
select * from cluster.apply_status; select * from mysql.apply_status;
server_id epoch server_id epoch

View File

@ -9,7 +9,6 @@ CREATE DATABASE test_ignore;
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster
mysql mysql
test test
test_ignore test_ignore
@ -34,7 +33,6 @@ master-bin.000001 235 Write_rows 1 282 table_id: # flags: STMT_END_F
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster
mysql mysql
test test
USE test; USE test;

View File

@ -33,12 +33,12 @@ master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 93 table_id: # (cluster.apply_status) master-bin.000001 323 Table_map 1 91 table_id: # (mysql.apply_status)
master-bin.000001 376 Write_rows 1 135 table_id: # master-bin.000001 374 Write_rows 1 133 table_id: #
master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F master-bin.000001 416 Write_rows 1 180 table_id: # flags: STMT_END_F
master-bin.000001 465 Query 1 530 COMMIT master-bin.000001 463 Query 1 528 COMMIT
master-bin.000001 530 Query 1 610 use `test`; TRUNCATE TABLE t1 master-bin.000001 528 Query 1 608 use `test`; TRUNCATE TABLE t1
master-bin.000001 610 Query 1 686 use `test`; DROP TABLE t1 master-bin.000001 608 Query 1 684 use `test`; DROP TABLE t1
**** On Master **** **** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2); INSERT INTO t1 VALUES (1,1), (2,2);
@ -69,23 +69,23 @@ master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 93 table_id: # (cluster.apply_status) master-bin.000001 323 Table_map 1 91 table_id: # (mysql.apply_status)
master-bin.000001 376 Write_rows 1 135 table_id: # master-bin.000001 374 Write_rows 1 133 table_id: #
master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F master-bin.000001 416 Write_rows 1 180 table_id: # flags: STMT_END_F
master-bin.000001 465 Query 1 530 COMMIT master-bin.000001 463 Query 1 528 COMMIT
master-bin.000001 530 Query 1 610 use `test`; TRUNCATE TABLE t1 master-bin.000001 528 Query 1 608 use `test`; TRUNCATE TABLE t1
master-bin.000001 610 Query 1 686 use `test`; DROP TABLE t1 master-bin.000001 608 Query 1 684 use `test`; DROP TABLE t1
master-bin.000001 686 Query 1 803 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 684 Query 1 801 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 803 Query 1 867 BEGIN master-bin.000001 801 Query 1 865 BEGIN
master-bin.000001 867 Table_map 1 40 table_id: # (test.t1) master-bin.000001 865 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 907 Table_map 1 93 table_id: # (cluster.apply_status) master-bin.000001 905 Table_map 1 91 table_id: # (mysql.apply_status)
master-bin.000001 960 Write_rows 1 135 table_id: # master-bin.000001 956 Write_rows 1 133 table_id: #
master-bin.000001 1002 Write_rows 1 182 table_id: # flags: STMT_END_F master-bin.000001 998 Write_rows 1 180 table_id: # flags: STMT_END_F
master-bin.000001 1049 Query 1 1114 COMMIT master-bin.000001 1045 Query 1 1110 COMMIT
master-bin.000001 1114 Query 1 1178 BEGIN master-bin.000001 1110 Query 1 1174 BEGIN
master-bin.000001 1178 Table_map 1 40 table_id: # (test.t1) master-bin.000001 1174 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 1218 Table_map 1 93 table_id: # (cluster.apply_status) master-bin.000001 1214 Table_map 1 91 table_id: # (mysql.apply_status)
master-bin.000001 1271 Write_rows 1 135 table_id: # master-bin.000001 1265 Write_rows 1 133 table_id: #
master-bin.000001 1313 Delete_rows 1 174 table_id: # flags: STMT_END_F master-bin.000001 1307 Delete_rows 1 172 table_id: # flags: STMT_END_F
master-bin.000001 1352 Query 1 1417 COMMIT master-bin.000001 1346 Query 1 1411 COMMIT
master-bin.000001 1417 Query 1 1493 use `test`; DROP TABLE t1 master-bin.000001 1411 Query 1 1487 use `test`; DROP TABLE t1

View File

@ -33,7 +33,7 @@ master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 93 table_id: # (cluster.apply_status) master-bin.000001 323 Table_map 1 93 table_id: # (mysql.apply_status)
master-bin.000001 376 Write_rows 1 135 table_id: # master-bin.000001 376 Write_rows 1 135 table_id: #
master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F
master-bin.000001 465 Query 1 530 COMMIT master-bin.000001 465 Query 1 530 COMMIT
@ -69,7 +69,7 @@ master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 93 table_id: # (cluster.apply_status) master-bin.000001 323 Table_map 1 93 table_id: # (mysql.apply_status)
master-bin.000001 376 Write_rows 1 135 table_id: # master-bin.000001 376 Write_rows 1 135 table_id: #
master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F
master-bin.000001 465 Query 1 530 COMMIT master-bin.000001 465 Query 1 530 COMMIT
@ -78,13 +78,13 @@ master-bin.000001 610 Query 1 686 use `test`; DROP TABLE t1
master-bin.000001 686 Query 1 803 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 686 Query 1 803 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 803 Query 1 867 BEGIN master-bin.000001 803 Query 1 867 BEGIN
master-bin.000001 867 Table_map 1 40 table_id: # (test.t1) master-bin.000001 867 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 907 Table_map 1 93 table_id: # (cluster.apply_status) master-bin.000001 907 Table_map 1 93 table_id: # (mysql.apply_status)
master-bin.000001 960 Write_rows 1 135 table_id: # master-bin.000001 960 Write_rows 1 135 table_id: #
master-bin.000001 1002 Write_rows 1 182 table_id: # flags: STMT_END_F master-bin.000001 1002 Write_rows 1 182 table_id: # flags: STMT_END_F
master-bin.000001 1049 Query 1 1114 COMMIT master-bin.000001 1049 Query 1 1114 COMMIT
master-bin.000001 1114 Query 1 1178 BEGIN master-bin.000001 1114 Query 1 1178 BEGIN
master-bin.000001 1178 Table_map 1 40 table_id: # (test.t1) master-bin.000001 1178 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 1218 Table_map 1 93 table_id: # (cluster.apply_status) master-bin.000001 1218 Table_map 1 93 table_id: # (mysql.apply_status)
master-bin.000001 1271 Write_rows 1 135 table_id: # master-bin.000001 1271 Write_rows 1 135 table_id: #
master-bin.000001 1313 Delete_rows 1 174 table_id: # flags: STMT_END_F master-bin.000001 1313 Delete_rows 1 174 table_id: # flags: STMT_END_F
master-bin.000001 1352 Query 1 1417 COMMIT master-bin.000001 1352 Query 1 1417 COMMIT

View File

@ -6,7 +6,6 @@ foo CREATE DATABASE `foo` /*!40100 DEFAULT CHARACTER SET latin1 */
show schemas; show schemas;
Database Database
information_schema information_schema
cluster
foo foo
mysql mysql
test test

View File

@ -53,7 +53,6 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I
show databases; show databases;
Database Database
information_schema information_schema
cluster
mysql mysql
test test
show databases like "test%"; show databases like "test%";

View File

@ -1,6 +1,7 @@
drop table if exists t1,t1aa,t2aa; drop table if exists t1,t1aa,t2aa;
show tables; show tables;
Tables_in_db Tables_in_db
binlog_index
columns_priv columns_priv
db db
event event

View File

@ -57,3 +57,5 @@ s1
1 1
drop table `txu@0023p@0023p1`; drop table `txu@0023p@0023p1`;
drop table `txu#p#p1`; drop table `txu#p#p1`;
truncate t1;
drop table t1;

Binary file not shown.

5
mysql-test/t/1st.test Normal file
View File

@ -0,0 +1,5 @@
#
# Check that we haven't any strange new tables or databases
#
show databases;
show tables in mysql;

View File

@ -37,7 +37,7 @@ create table t3(a int, KEY a_data (a));
create table mysqltest.t4(a int); create table mysqltest.t4(a int);
create table t5 (id int auto_increment primary key); create table t5 (id int auto_increment primary key);
insert into t5 values (10); insert into t5 values (10);
create view v1 (c) as select table_name from information_schema.TABLES where table_schema!='cluster'; create view v1 (c) as select table_name from information_schema.TABLES where table_name<>'binlog_index' AND table_name<>'apply_status';
select * from v1; select * from v1;
select c,table_name from v1 select c,table_name from v1
@ -528,7 +528,7 @@ flush privileges;
# Bug #9404 information_schema: Weird error messages # Bug #9404 information_schema: Weird error messages
# with SELECT SUM() ... GROUP BY queries # with SELECT SUM() ... GROUP BY queries
# #
SELECT table_schema, count(*) FROM information_schema.TABLES where TABLE_SCHEMA!='cluster' GROUP BY TABLE_SCHEMA; SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'binlog_index' AND table_name<>'apply_status' GROUP BY TABLE_SCHEMA;
# #

View File

@ -1394,6 +1394,9 @@ revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
drop user myDB_User; drop user myDB_User;
drop database mysqldump_myDB; drop database mysqldump_myDB;
use test; use test;
connection default;
disconnect root;
disconnect user1;
--echo # --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

View File

@ -19,7 +19,7 @@ create table t1 (a int primary key) engine=ndb;
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
save_master_pos; save_master_pos;
--replace_column 1 # --replace_column 1 #
select @max_epoch:=max(epoch)-1 from cluster.binlog_index; select @max_epoch:=max(epoch)-1 from mysql.binlog_index;
delete from t1; delete from t1;
alter table t1 add (b int); alter table t1 add (b int);
@ -38,10 +38,10 @@ drop table t2;
# (save_master_pos waits for last gcp to complete, ensuring that we have # (save_master_pos waits for last gcp to complete, ensuring that we have
# the expected data in the binlog) # the expected data in the binlog)
save_master_pos; save_master_pos;
select inserts from cluster.binlog_index where epoch > @max_epoch and inserts > 5; select inserts from mysql.binlog_index where epoch > @max_epoch and inserts > 5;
select deletes from cluster.binlog_index where epoch > @max_epoch and deletes > 5; select deletes from mysql.binlog_index where epoch > @max_epoch and deletes > 5;
select inserts,updates,deletes from select inserts,updates,deletes from
cluster.binlog_index where epoch > @max_epoch and updates > 0; mysql.binlog_index where epoch > @max_epoch and updates > 0;
# #
# check that purge clears the binlog_index # check that purge clears the binlog_index
@ -49,7 +49,7 @@ select inserts,updates,deletes from
flush logs; flush logs;
--sleep 1 --sleep 1
purge master logs before now(); purge master logs before now();
select count(*) from cluster.binlog_index; select count(*) from mysql.binlog_index;
# #
# several tables in different databases # several tables in different databases
@ -64,9 +64,9 @@ use test;
insert into mysqltest.t1 values (2,1),(2,2); insert into mysqltest.t1 values (2,1),(2,2);
save_master_pos; save_master_pos;
--replace_column 1 # --replace_column 1 #
select @max_epoch:=max(epoch)-1 from cluster.binlog_index; select @max_epoch:=max(epoch)-1 from mysql.binlog_index;
drop table t1; drop table t1;
drop database mysqltest; drop database mysqltest;
select inserts,updates,deletes from select inserts,updates,deletes from
cluster.binlog_index where epoch > @max_epoch and inserts > 0; mysql.binlog_index where epoch > @max_epoch and inserts > 0;

View File

@ -38,7 +38,7 @@ INSERT INTO t2 VALUES (1,1),(2,2);
select * from t2 order by a; select * from t2 order by a;
--replace_column 1 <the_epoch> --replace_column 1 <the_epoch>
SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM
cluster.binlog_index ORDER BY epoch DESC LIMIT 1; mysql.binlog_index ORDER BY epoch DESC LIMIT 1;
let $the_epoch= `SELECT @the_epoch`; let $the_epoch= `SELECT @the_epoch`;
# see if we got something on server1 # see if we got something on server1
@ -50,7 +50,7 @@ DROP TABLE t2;
--source include/show_binlog_events.inc --source include/show_binlog_events.inc
--replace_result $the_epoch <the_epoch> --replace_result $the_epoch <the_epoch>
eval SELECT inserts,updates,deletes,schemaops FROM eval SELECT inserts,updates,deletes,schemaops FROM
cluster.binlog_index WHERE epoch=$the_epoch; mysql.binlog_index WHERE epoch=$the_epoch;
# reset for next test # reset for next test
connection server1; connection server1;
@ -65,12 +65,12 @@ INSERT INTO t1 VALUES (1),(2);
--source include/show_binlog_events.inc --source include/show_binlog_events.inc
--replace_column 1 <the_epoch2> --replace_column 1 <the_epoch2>
SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
cluster.binlog_index ORDER BY epoch DESC LIMIT 1; mysql.binlog_index ORDER BY epoch DESC LIMIT 1;
let $the_epoch2= `SELECT @the_epoch2`; let $the_epoch2= `SELECT @the_epoch2`;
--replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2> --replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>
eval SELECT inserts,updates,deletes,schemaops FROM eval SELECT inserts,updates,deletes,schemaops FROM
cluster.binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2; mysql.binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2;
# now see that we have the events on the other server # now see that we have the events on the other server
connection server2; connection server2;
@ -80,4 +80,4 @@ drop table t1;
--source include/show_binlog_events.inc --source include/show_binlog_events.inc
--replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2> --replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>
eval SELECT inserts,updates,deletes,schemaops FROM eval SELECT inserts,updates,deletes,schemaops FROM
cluster.binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2; mysql.binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2;

View File

@ -21,7 +21,7 @@ SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID; SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
SELECT COUNT(*) FROM TRANSACTION; SELECT COUNT(*) FROM TRANSACTION;
SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID; SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
SELECT * FROM cluster.apply_status WHERE server_id=0; SELECT * FROM mysql.apply_status WHERE server_id=0;
# #
# verify restore of 5.0 backup # verify restore of 5.0 backup
@ -39,5 +39,5 @@ SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID; SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
SELECT COUNT(*) FROM TRANSACTION; SELECT COUNT(*) FROM TRANSACTION;
SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID; SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
SELECT * FROM cluster.apply_status WHERE server_id=0; SELECT * FROM mysql.apply_status WHERE server_id=0;
DROP DATABASE BANK; DROP DATABASE BANK;

View File

@ -118,12 +118,12 @@ RESET MASTER;
# there is no neat way to find the backupid, this is a hack to find it... # 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="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
CREATE TABLE IF NOT EXISTS cluster.backup_info (id INT, backup_id INT) ENGINE = HEAP; CREATE TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM cluster.backup_info; DELETE FROM mysql.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
--exec rm $MYSQLTEST_VARDIR/tmp.dat || true --exec rm $MYSQLTEST_VARDIR/tmp.dat || true
--replace_column 1 <the_backup_id> --replace_column 1 <the_backup_id>
SELECT @the_backup_id:=backup_id FROM cluster.backup_info; SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
let the_backup_id=`select @the_backup_id`; let the_backup_id=`select @the_backup_id`;
# restore on slave, first check that nothing is there # restore on slave, first check that nothing is there

View File

@ -436,19 +436,19 @@ SELECT COUNT(*) FROM history;
--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="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
CREATE TEMPORARY TABLE IF NOT EXISTS cluster.backup_info (id INT, backup_id INT) ENGINE = HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM cluster.backup_info; DELETE FROM mysql.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
--exec rm $MYSQLTEST_VARDIR/tmp.dat || true --exec rm $MYSQLTEST_VARDIR/tmp.dat || true
--replace_column 1 <the_backup_id> --replace_column 1 <the_backup_id>
SELECT @the_backup_id:=backup_id FROM cluster.backup_info; SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
let the_backup_id=`select @the_backup_id`; let the_backup_id=`select @the_backup_id`;
DROP TABLE IF EXISTS cluster.backup_info; DROP TABLE IF EXISTS mysql.backup_info;
#RESET MASTER; #RESET MASTER;
--echo ************ Restore the slave ************************ --echo ************ Restore the slave ************************

View File

@ -4,7 +4,7 @@
# #
# Currently test only works with ndb since it retrieves "old" # Currently test only works with ndb since it retrieves "old"
# binlog positions with cluster.binlog_index and apply_status; # binlog positions with mysql.binlog_index and apply_status;
# #
# create a table with one row # create a table with one row
@ -15,7 +15,7 @@ SELECT * FROM t1 ORDER BY c3;
# sync slave and retrieve epoch # sync slave and retrieve epoch
sync_slave_with_master; sync_slave_with_master;
--replace_column 1 <the_epoch> --replace_column 1 <the_epoch>
SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status; SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status;
let $the_epoch= `select @the_epoch` ; let $the_epoch= `select @the_epoch` ;
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
@ -24,7 +24,7 @@ connection master;
--replace_result $the_epoch <the_epoch> --replace_result $the_epoch <the_epoch>
--replace_column 1 <the_pos> --replace_column 1 <the_pos>
eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster.binlog_index WHERE epoch = $the_epoch ; FROM mysql.binlog_index WHERE epoch = $the_epoch ;
let $the_pos= `SELECT @the_pos` ; let $the_pos= `SELECT @the_pos` ;
let $the_file= `SELECT @the_file` ; let $the_file= `SELECT @the_file` ;

View File

@ -7,7 +7,7 @@
# #
# Currently test only works with ndb since it retrieves "old" # Currently test only works with ndb since it retrieves "old"
# binlog positions with cluster.binlog_index and apply_status; # binlog positions with mysql.binlog_index and apply_status;
# #
# create a table with one row, and make sure the other "master" gets it # create a table with one row, and make sure the other "master" gets it
@ -25,7 +25,7 @@ SELECT * FROM t1 ORDER BY c3;
connection master; connection master;
sync_slave_with_master; sync_slave_with_master;
--replace_column 1 <the_epoch> --replace_column 1 <the_epoch>
SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status; SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status;
let $the_epoch= `select @the_epoch` ; let $the_epoch= `select @the_epoch` ;
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
stop slave; stop slave;
@ -34,7 +34,7 @@ stop slave;
connection server2; connection server2;
--replace_result $the_epoch <the_epoch> --replace_result $the_epoch <the_epoch>
eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster.binlog_index WHERE epoch = $the_epoch ; FROM mysql.binlog_index WHERE epoch = $the_epoch ;
let $the_pos= `SELECT @the_pos` ; let $the_pos= `SELECT @the_pos` ;
let $the_file= `SELECT @the_file` ; let $the_file= `SELECT @the_file` ;

View File

@ -6,7 +6,7 @@
# #
# Currently test only works with ndb since it retrieves "old" # Currently test only works with ndb since it retrieves "old"
# binlog positions with cluster.binlog_index and apply_status; # binlog positions with mysql.binlog_index and apply_status;
# #
# stop the save # stop the save
@ -94,11 +94,11 @@ STOP SLAVE;
--connection master --connection master
reset master; reset master;
# should now contain nothing # should now contain nothing
select * from cluster.binlog_index; select * from mysql.binlog_index;
--connection slave --connection slave
reset slave; reset slave;
# should now contain nothing # should now contain nothing
select * from cluster.apply_status; select * from mysql.apply_status;
# End 5.1 Test # End 5.1 Test

View File

@ -96,7 +96,7 @@ INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv,
procs_priv, help_category, help_keyword, help_relation, help_topic, proc, procs_priv, help_category, help_keyword, help_relation, help_topic, proc,
time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition,
time_zone_transition_type, general_log, slow_log, event; time_zone_transition_type, general_log, slow_log, event, binlog_index;
-- enable_query_log -- enable_query_log

View File

@ -47,3 +47,12 @@ select * from `txu@0023p@0023p1`;
select * from `txu#p#p1`; select * from `txu#p#p1`;
drop table `txu@0023p@0023p1`; drop table `txu@0023p@0023p1`;
drop table `txu#p#p1`; 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;
truncate t1;
drop table t1;

View File

@ -252,3 +252,15 @@ const char **my_error_unregister(int first, int last)
return errmsgs; return errmsgs;
} }
void my_error_unregister_all(void)
{
struct my_err_head *list, *next;
for (list= my_errmsgs_globerrs.meh_next; list; list= next)
{
next= list->meh_next;
my_free((gptr) list, MYF(0));
}
my_errmsgs_list= &my_errmsgs_globerrs;
}

View File

@ -154,6 +154,7 @@ void my_end(int infoflag)
} }
} }
free_charsets(); free_charsets();
my_error_unregister_all();
my_once_free(); my_once_free();
if ((infoflag & MY_GIVE_INFO) || print_info) if ((infoflag & MY_GIVE_INFO) || print_info)
@ -208,7 +209,8 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
Check on destroying of mutexes. A few may be left that will get cleaned Check on destroying of mutexes. A few may be left that will get cleaned
up by C++ destructors up by C++ destructors
*/ */
safe_mutex_end(infoflag & MY_GIVE_INFO ? stderr : (FILE *) 0); safe_mutex_end((infoflag & (MY_GIVE_INFO | MY_CHECK_ERROR)) ? stderr :
(FILE *) 0);
#endif /* defined(SAFE_MUTEX) */ #endif /* defined(SAFE_MUTEX) */
#endif /* THREAD */ #endif /* THREAD */

View File

@ -41,3 +41,5 @@ extern pthread_mutex_t THR_LOCK_charset;
#ifndef EDQUOT #ifndef EDQUOT
#define EDQUOT (-1) #define EDQUOT (-1)
#endif #endif
void my_error_unregister_all(void);

View File

@ -874,8 +874,7 @@ $c_pp
$c_gl $c_gl
$c_sl $c_sl
$c_ev $c_ev
CREATE DATABASE IF NOT EXISTS cluster; CREATE TABLE IF NOT EXISTS mysql.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
CREATE TABLE IF NOT EXISTS cluster.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
END_OF_DATA END_OF_DATA

View File

@ -1,13 +1,13 @@
-- This script converts any old privilege tables to privilege tables suitable # This script converts any old privilege tables to privilege tables suitable
-- for this version of MySQL # for this version of MySQL
-- You can safely ignore all 'Duplicate column' and 'Unknown column' errors" # You can safely ignore all 'Duplicate column' and 'Unknown column' errors"
-- because these just mean that your tables are already up to date. # because these just mean that your tables are already up to date.
-- This script is safe to run even if your tables are already up to date! # This script is safe to run even if your tables are already up to date!
-- On unix, you should use the mysql_fix_privilege_tables script to execute # On unix, you should use the mysql_fix_privilege_tables script to execute
-- this sql script. # this sql script.
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' # On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
set storage_engine=MyISAM; set storage_engine=MyISAM;
@ -27,7 +27,7 @@ CREATE TABLE IF NOT EXISTS plugin (
ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
-- Detect whether or not we had the Grant_priv column # Detect whether or not we had the Grant_priv column
SET @hadGrantPriv:=0; SET @hadGrantPriv:=0;
SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%';
@ -35,14 +35,14 @@ ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,a
ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
-- Fix privileges for old tables # Fix privileges for old tables
UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
-- #
-- The second alter changes ssl_type to new 4.0.2 format # The second alter changes ssl_type to new 4.0.2 format
-- Adding columns needed by GRANT .. REQUIRE (openssl)" # Adding columns needed by GRANT .. REQUIRE (openssl)"
ALTER TABLE user ALTER TABLE user
ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL,
@ -51,9 +51,9 @@ ADD x509_issuer BLOB NOT NULL,
ADD x509_subject BLOB NOT NULL; ADD x509_subject BLOB NOT NULL;
ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL;
-- #
-- Create tables_priv and columns_priv if they don't exists # Create tables_priv and columns_priv if they don't exists
-- #
CREATE TABLE IF NOT EXISTS tables_priv ( CREATE TABLE IF NOT EXISTS tables_priv (
Host char(60) binary DEFAULT '' NOT NULL, Host char(60) binary DEFAULT '' NOT NULL,
@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS tables_priv (
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name) PRIMARY KEY (Host,Db,User,Table_name)
) CHARACTER SET utf8 COLLATE utf8_bin; ) CHARACTER SET utf8 COLLATE utf8_bin;
-- Fix collation of set fields # Fix collation of set fields
ALTER TABLE tables_priv ALTER TABLE tables_priv
modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
@ -88,26 +88,26 @@ CREATE TABLE IF NOT EXISTS columns_priv (
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name,Column_name) PRIMARY KEY (Host,Db,User,Table_name,Column_name)
) CHARACTER SET utf8 COLLATE utf8_bin; ) CHARACTER SET utf8 COLLATE utf8_bin;
-- Fix collation of set fields # Fix collation of set fields
ALTER TABLE columns_priv ALTER TABLE columns_priv
MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-- #
-- Name change of Type -> Column_priv from MySQL 3.22.12 # Name change of Type -> Column_priv from MySQL 3.22.12
-- #
ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-- #
-- Add the new 'type' column to the func table. # Add the new 'type' column to the func table.
-- #
ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL;
-- #
-- Change the user,db and host tables to MySQL 4.0 format # Change the user,db and host tables to MySQL 4.0 format
-- #
# Detect whether we had Show_db_priv # Detect whether we had Show_db_priv
SET @hadShowDbPriv:=0; SET @hadShowDbPriv:=0;
@ -122,22 +122,22 @@ ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTE
ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv, ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv,
ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv;
-- Convert privileges so that users have similar privileges as before # Convert privileges so that users have similar privileges as before
UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0; UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0;
-- Add fields that can be used to limit number of questions and connections # Add fields that can be used to limit number of questions and connections
-- for some users. # for some users.
ALTER TABLE user ALTER TABLE user
ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject, ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject,
ADD max_updates int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions, ADD max_updates int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions,
ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates; ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates;
-- #
-- Add Create_tmp_table_priv and Lock_tables_priv to db and host # Add Create_tmp_table_priv and Lock_tables_priv to db and host
-- #
ALTER TABLE db ALTER TABLE db
ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
@ -156,8 +156,8 @@ alter table func comment='User defined functions';
alter table tables_priv comment='Table privileges'; alter table tables_priv comment='Table privileges';
alter table columns_priv comment='Column privileges'; alter table columns_priv comment='Column privileges';
-- Convert all tables to UTF-8 with binary collation # Convert all tables to UTF-8 with binary collation
-- and reset all char columns to correct width # and reset all char columns to correct width
ALTER TABLE user ALTER TABLE user
MODIFY Host char(60) NOT NULL default '', MODIFY Host char(60) NOT NULL default '',
MODIFY User char(16) NOT NULL default '', MODIFY User char(16) NOT NULL default '',
@ -385,7 +385,7 @@ Time_zone_id int unsigned NOT NULL auto_increment,
Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
PRIMARY KEY TzId (Time_zone_id) PRIMARY KEY TzId (Time_zone_id)
) CHARACTER SET utf8 comment='Time zones'; ) CHARACTER SET utf8 comment='Time zones';
-- Make enum field case-insensitive # Make enum field case-insensitive
ALTER TABLE time_zone ALTER TABLE time_zone
MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
@ -527,9 +527,9 @@ ALTER TABLE proc MODIFY db
MODIFY comment MODIFY comment
char(64) collate utf8_bin DEFAULT '' NOT NULL; char(64) collate utf8_bin DEFAULT '' NOT NULL;
-- #
-- Create missing log tables (5.1) # Create missing log tables (5.1)
-- #
delimiter // delimiter //
CREATE PROCEDURE create_log_tables() CREATE PROCEDURE create_log_tables()
@ -673,9 +673,9 @@ ALTER TABLE event ADD sql_mode
UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0;
ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default '';
-- #
-- TRIGGER privilege # TRIGGER privilege
-- #
SET @hadTriggerPriv := 0; SET @hadTriggerPriv := 0;
SELECT @hadTriggerPriv :=1 FROM user WHERE Trigger_priv LIKE '%'; SELECT @hadTriggerPriv :=1 FROM user WHERE Trigger_priv LIKE '%';
@ -687,6 +687,8 @@ ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete
UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0;
CREATE TABLE IF NOT EXISTS binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
# Activate the new, possible modified privilege tables # Activate the new, possible modified privilege tables
# This should not be needed, but gives us some extra testing that the above # This should not be needed, but gives us some extra testing that the above
# changes was correct # changes was correct

View File

@ -1237,12 +1237,6 @@ Field::Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
} }
uint Field::offset()
{
return (uint) (ptr - (char*) table->record[0]);
}
void Field::hash(ulong *nr, ulong *nr2) void Field::hash(ulong *nr, ulong *nr2)
{ {
if (is_null()) if (is_null())

View File

@ -342,7 +342,10 @@ public:
virtual int pack_cmp(const char *b, uint key_length_arg, virtual int pack_cmp(const char *b, uint key_length_arg,
my_bool insert_or_update) my_bool insert_or_update)
{ return cmp(ptr,b); } { return cmp(ptr,b); }
uint offset(); // Should be inline ... uint offset(byte *record)
{
return (uint) (ptr - (char*) record);
}
void copy_from_tmp(int offset); void copy_from_tmp(int offset);
uint fill_cache_field(struct st_cache_field *copy); uint fill_cache_field(struct st_cache_field *copy);
virtual bool get_date(TIME *ltime,uint fuzzydate); virtual bool get_date(TIME *ltime,uint fuzzydate);

View File

@ -119,12 +119,12 @@ set_field_to_null(Field *field)
return 0; return 0;
} }
field->reset(); field->reset();
if (current_thd->count_cuted_fields == CHECK_FIELD_WARN) if (field->table->in_use->count_cuted_fields == CHECK_FIELD_WARN)
{ {
field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
return 0; return 0;
} }
if (!current_thd->no_errors) if (!field->table->in_use->no_errors)
my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name); my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name);
return -1; return -1;
} }
@ -176,12 +176,12 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
field->table->auto_increment_field_not_null= FALSE; field->table->auto_increment_field_not_null= FALSE;
return 0; // field is set in handler.cc return 0; // field is set in handler.cc
} }
if (current_thd->count_cuted_fields == CHECK_FIELD_WARN) if (field->table->in_use->count_cuted_fields == CHECK_FIELD_WARN)
{ {
field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_BAD_NULL_ERROR, 1); field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_BAD_NULL_ERROR, 1);
return 0; return 0;
} }
if (!current_thd->no_errors) if (!field->table->in_use->no_errors)
my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name); my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name);
return -1; return -1;
} }
@ -403,7 +403,7 @@ static void do_varstring1(Copy_field *copy)
if (length > copy->to_length- 1) if (length > copy->to_length- 1)
{ {
length=copy->to_length - 1; length=copy->to_length - 1;
if (current_thd->count_cuted_fields) if (copy->from_field->table->in_use->count_cuted_fields)
copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
WARN_DATA_TRUNCATED, 1); WARN_DATA_TRUNCATED, 1);
} }
@ -418,7 +418,7 @@ static void do_varstring2(Copy_field *copy)
if (length > copy->to_length- HA_KEY_BLOB_LENGTH) if (length > copy->to_length- HA_KEY_BLOB_LENGTH)
{ {
length=copy->to_length-HA_KEY_BLOB_LENGTH; length=copy->to_length-HA_KEY_BLOB_LENGTH;
if (current_thd->count_cuted_fields) if (copy->from_field->table->in_use->count_cuted_fields)
copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
WARN_DATA_TRUNCATED, 1); WARN_DATA_TRUNCATED, 1);
} }

View File

@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#define NDB_REP_DB "cluster" #define NDB_REP_DB "mysql"
#define NDB_REP_TABLE "binlog_index" #define NDB_REP_TABLE "binlog_index"
#define NDB_APPLY_TABLE "apply_status" #define NDB_APPLY_TABLE "apply_status"
#define NDB_SCHEMA_TABLE "schema" #define NDB_SCHEMA_TABLE "schema"

View File

@ -2928,13 +2928,14 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
*/ */
Field *field= (*field_item)->get_tmp_table_field(); Field *field= (*field_item)->get_tmp_table_field();
/* /*
If field_item is a const item then either get_tp_table_field returns 0 If field_item is a const item then either get_tmp_table_field returns 0
or it is an item over a const table. or it is an item over a const table.
*/ */
if (field && !(*field_item)->const_item()) if (field && !(*field_item)->const_item())
{ {
int res; int res;
uint offset= field->offset() - table->s->null_bytes; uint offset= (field->offset(field->table->record[0]) -
table->s->null_bytes);
if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset))) if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
return res; return res;
} }
@ -2972,7 +2973,8 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
if (field && !item->const_item()) if (field && !item->const_item())
{ {
int res; int res;
uint offset= field->offset() - table->s->null_bytes; uint offset= (field->offset(field->table->record[0]) -
table->s->null_bytes);
if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset))) if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
return (*order_item)->asc ? res : -res; return (*order_item)->asc ? res : -res;
} }
@ -3039,7 +3041,8 @@ int dump_leaf_key(byte* key, element_count count __attribute__((unused)),
because it contains both order and arg list fields. because it contains both order and arg list fields.
*/ */
Field *field= (*arg)->get_tmp_table_field(); Field *field= (*arg)->get_tmp_table_field();
uint offset= field->offset() - table->s->null_bytes; uint offset= (field->offset(field->table->record[0]) -
table->s->null_bytes);
DBUG_ASSERT(offset < table->s->reclength); DBUG_ASSERT(offset < table->s->reclength);
res= field->val_str(&tmp, (char *) key + offset); res= field->val_str(&tmp, (char *) key + offset);
} }

View File

@ -19,37 +19,54 @@
#include "mysql_priv.h" #include "mysql_priv.h"
/* /*
** Search after with key field is. If no key starts with field test Search after a key that starts with 'field'
** if field is part of some key.
**
** returns number of key. keylength is set to length of key before
** (not including) field
** Used when calculating key for NEXT_NUMBER
*/
int find_ref_key(KEY *key, uint key_count, Field *field, uint *key_length) SYNOPSIS
find_ref_key()
key First key to check
key_count How many keys to check
record Start of record
field Field to search after
key_length On partial match, contains length of fields before
field
NOTES
Used when calculating key for NEXT_NUMBER
IMPLEMENTATION
If no key starts with field test if field is part of some key. If we find
one, then return first key and set key_length to the number of bytes
preceding 'field'.
RETURN
-1 field is not part of the key
# Key part for key matching key.
key_length is set to length of key before (not including) field
*/
int find_ref_key(KEY *key, uint key_count, byte *record, Field *field,
uint *key_length)
{ {
reg2 int i; reg2 int i;
reg3 KEY *key_info; reg3 KEY *key_info;
uint fieldpos; uint fieldpos;
fieldpos= field->offset(); fieldpos= field->offset(record);
/* Test if some key starts as fieldpos */
/* Test if some key starts as fieldpos */
for (i= 0, key_info= key ; for (i= 0, key_info= key ;
i < (int) key_count ; i < (int) key_count ;
i++, key_info++) i++, key_info++)
{ {
if (key_info->key_part[0].offset == fieldpos) if (key_info->key_part[0].offset == fieldpos)
{ /* Found key. Calc keylength */ { /* Found key. Calc keylength */
*key_length=0; *key_length=0;
return(i); /* Use this key */ return(i); /* Use this key */
} }
} }
/* Test if some key contains fieldpos */
/* Test if some key contains fieldpos */
for (i= 0, key_info= key; for (i= 0, key_info= key;
i < (int) key_count ; i < (int) key_count ;
i++, key_info++) i++, key_info++)
@ -62,7 +79,7 @@ int find_ref_key(KEY *key, uint key_count, Field *field, uint *key_length)
j++, key_part++) j++, key_part++)
{ {
if (key_part->offset == fieldpos) if (key_part->offset == fieldpos)
return(i); /* Use this key */ return(i); /* Use this key */
*key_length+=key_part->store_length; *key_length+=key_part->store_length;
} }
} }

View File

@ -1427,7 +1427,8 @@ void print_plan(JOIN* join,uint idx, double record_count, double read_time,
#endif #endif
void mysql_print_status(); void mysql_print_status();
/* key.cc */ /* key.cc */
int find_ref_key(KEY *key, uint key_count, Field *field, uint *key_length); int find_ref_key(KEY *key, uint key_count, byte *record, Field *field,
uint *key_length);
void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length); void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length);
void key_restore(byte *to_record, byte *from_key, KEY *key_info, void key_restore(byte *to_record, byte *from_key, KEY *key_info,
uint key_length); uint key_length);

View File

@ -3187,7 +3187,7 @@ server.");
using_update_log=1; using_update_log=1;
} }
if (plugin_init(0)) if (plugin_init(opt_bootstrap))
{ {
sql_print_error("Failed to init plugins."); sql_print_error("Failed to init plugins.");
return 1; return 1;

View File

@ -2520,7 +2520,9 @@ my_size_t THD::max_row_length_blob(TABLE *table, const byte *data) const
for (uint *ptr= beg ; ptr != end ; ++ptr) for (uint *ptr= beg ; ptr != end ; ++ptr)
{ {
Field_blob* const blob= (Field_blob*) table->field[*ptr]; Field_blob* const blob= (Field_blob*) table->field[*ptr];
length+= blob->get_length((const char *) (data + blob->offset())) + 2; length+= blob->get_length((const char*) (data +
blob->offset(table->record[0]))) +
HA_KEY_BLOB_LENGTH;
} }
return length; return length;

View File

@ -9488,7 +9488,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
bool maybe_null=(*cur_group->item)->maybe_null; bool maybe_null=(*cur_group->item)->maybe_null;
key_part_info->null_bit=0; key_part_info->null_bit=0;
key_part_info->field= field; key_part_info->field= field;
key_part_info->offset= field->offset(); key_part_info->offset= field->offset(table->record[0]);
key_part_info->length= (uint16) field->key_length(); key_part_info->length= (uint16) field->key_length();
key_part_info->type= (uint8) field->key_type(); key_part_info->type= (uint8) field->key_type();
key_part_info->key_type = key_part_info->key_type =
@ -9585,7 +9585,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
{ {
key_part_info->null_bit=0; key_part_info->null_bit=0;
key_part_info->field= *reg_field; key_part_info->field= *reg_field;
key_part_info->offset= (*reg_field)->offset(); key_part_info->offset= (*reg_field)->offset(table->record[0]);
key_part_info->length= (uint16) (*reg_field)->pack_length(); key_part_info->length= (uint16) (*reg_field)->pack_length();
key_part_info->type= (uint8) (*reg_field)->key_type(); key_part_info->type= (uint8) (*reg_field)->key_type();
key_part_info->key_type = key_part_info->key_type =
@ -12557,8 +12557,9 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
Field **first_field=entry->field+entry->s->fields - field_count; Field **first_field=entry->field+entry->s->fields - field_count;
offset= field_count ? offset= (field_count ?
entry->field[entry->s->fields - field_count]->offset() : 0; entry->field[entry->s->fields - field_count]->
offset(entry->record[0]) : 0);
reclength=entry->s->reclength-offset; reclength=entry->s->reclength-offset;
free_io_cache(entry); // Safety free_io_cache(entry); // Safety

View File

@ -30,7 +30,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share,
uchar *head, File file); uchar *head, File file);
static void fix_type_pointers(const char ***array, TYPELIB *point_to_type, static void fix_type_pointers(const char ***array, TYPELIB *point_to_type,
uint types, char **names); uint types, char **names);
static uint find_field(Field **fields, uint start, uint length); static uint find_field(Field **fields, byte *record, uint start, uint length);
/* Get column name from column hash */ /* Get column name from column hash */
@ -1070,6 +1070,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
Field *field; Field *field;
if (new_field_pack_flag <= 1) if (new_field_pack_flag <= 1)
key_part->fieldnr= (uint16) find_field(share->field, key_part->fieldnr= (uint16) find_field(share->field,
share->default_values,
(uint) key_part->offset, (uint) key_part->offset,
(uint) key_part->length); (uint) key_part->length);
if (!key_part->fieldnr) if (!key_part->fieldnr)
@ -1233,24 +1234,19 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if (share->found_next_number_field) if (share->found_next_number_field)
{ {
/*
We must have a table object for find_ref_key to calculate field offset
*/
TABLE tmp_table;
tmp_table.record[0]= share->default_values;
reg_field= *share->found_next_number_field; reg_field= *share->found_next_number_field;
reg_field->table= &tmp_table;
if ((int) (share->next_number_index= (uint) if ((int) (share->next_number_index= (uint)
find_ref_key(share->key_info, share->keys, reg_field, find_ref_key(share->key_info, share->keys,
share->default_values, reg_field,
&share->next_number_key_offset)) < 0) &share->next_number_key_offset)) < 0)
{ {
/* Wrong field definition */
DBUG_ASSERT(0);
reg_field->unireg_check= Field::NONE; /* purecov: inspected */ reg_field->unireg_check= Field::NONE; /* purecov: inspected */
share->found_next_number_field= 0; share->found_next_number_field= 0;
} }
else else
reg_field->flags |= AUTO_INCREMENT_FLAG; reg_field->flags |= AUTO_INCREMENT_FLAG;
reg_field->table= 0;
} }
if (share->blob_fields) if (share->blob_fields)
@ -1970,7 +1966,7 @@ TYPELIB *typelib(MEM_ROOT *mem_root, List<String> &strings)
# field number +1 # field number +1
*/ */
static uint find_field(Field **fields, uint start, uint length) static uint find_field(Field **fields, byte *record, uint start, uint length)
{ {
Field **field; Field **field;
uint i, pos; uint i, pos;
@ -1978,7 +1974,7 @@ static uint find_field(Field **fields, uint start, uint length)
pos= 0; pos= 0;
for (field= fields, i=1 ; *field ; i++,field++) for (field= fields, i=1 ; *field ; i++,field++)
{ {
if ((*field)->offset() == start) if ((*field)->offset(record) == start)
{ {
if ((*field)->key_length() == length) if ((*field)->key_length() == length)
return (i); return (i);

View File

@ -817,10 +817,11 @@ int ha_archive::write_row(byte *buf)
int rc; int rc;
byte *read_buf= NULL; byte *read_buf= NULL;
ulonglong temp_auto; ulonglong temp_auto;
byte *record= table->record[0];
DBUG_ENTER("ha_archive::write_row"); DBUG_ENTER("ha_archive::write_row");
if (share->crashed) if (share->crashed)
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
ha_statistic_increment(&SSV::ha_write_count); ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
@ -883,7 +884,8 @@ int ha_archive::write_row(byte *buf)
while (!(get_row(&archive, read_buf))) while (!(get_row(&archive, read_buf)))
{ {
if (!memcmp(read_buf + mfield->offset(), table->next_number_field->ptr, if (!memcmp(read_buf + mfield->offset(record),
table->next_number_field->ptr,
mfield->max_length())) mfield->max_length()))
{ {
rc= HA_ERR_FOUND_DUPP_KEY; rc= HA_ERR_FOUND_DUPP_KEY;
@ -914,15 +916,16 @@ int ha_archive::write_row(byte *buf)
for (Field **field=table->field ; *field ; field++) for (Field **field=table->field ; *field ; field++)
{ {
DBUG_PRINT("archive",("Pack is %d\n", (*field)->pack_length())); DBUG_PRINT("archive",("Pack is %d\n", (*field)->pack_length()));
DBUG_PRINT("archive",("MyPack is %d\n", (*field)->data_length((char*) buf + (*field)->offset()))); DBUG_PRINT("archive",("MyPack is %d\n", (*field)->data_length((char*) buf + (*field)->offset(record))));
if ((*field)->real_type() == MYSQL_TYPE_VARCHAR) if ((*field)->real_type() == MYSQL_TYPE_VARCHAR)
{ {
uint actual_length= (*field)->data_length((char*) buf + (*field)->offset()); uint actual_length= (*field)->data_length((char*) buf +
uint offset= (*field)->offset() + actual_length + (*field)->offset(record));
uint offset= (*field)->offset(record) + actual_length +
(actual_length > 255 ? 2 : 1); (actual_length > 255 ? 2 : 1);
DBUG_PRINT("archive",("Offset is %d -> %d\n", actual_length, offset)); DBUG_PRINT("archive",("Offset is %d -> %d\n", actual_length, offset));
/* /*
if ((*field)->pack_length() + (*field)->offset() != offset) if ((*field)->pack_length() + (*field)->offset(record) != offset)
bzero(buf + offset, (size_t)((*field)->pack_length() + (actual_length > 255 ? 2 : 1) - (*field)->data_length)); bzero(buf + offset, (size_t)((*field)->pack_length() + (actual_length > 255 ? 2 : 1) - (*field)->data_length));
*/ */
} }
@ -1306,7 +1309,8 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
{ {
Field *field= table->found_next_number_field; Field *field= table->found_next_number_field;
ulonglong auto_value= ulonglong auto_value=
(ulonglong) field->val_int((char*)(buf + field->offset())); (ulonglong) field->val_int((char*)(buf +
field->offset(table->record[0])));
if (share->auto_increment_value < auto_value) if (share->auto_increment_value < auto_value)
stats.auto_increment_value= share->auto_increment_value= stats.auto_increment_value= share->auto_increment_value=
auto_value; auto_value;

View File

@ -1856,6 +1856,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
String where_string(where_buffer, String where_string(where_buffer,
sizeof(where_buffer), sizeof(where_buffer),
&my_charset_bin); &my_charset_bin);
byte *record= table->record[0];
DBUG_ENTER("ha_federated::update_row"); DBUG_ENTER("ha_federated::update_row");
/* /*
set string lengths to 0 to avoid misc chars in string set string lengths to 0 to avoid misc chars in string
@ -1914,7 +1915,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
bool needs_quote= (*field)->str_needs_quotes(); bool needs_quote= (*field)->str_needs_quotes();
where_string.append(STRING_WITH_LEN(" = ")); where_string.append(STRING_WITH_LEN(" = "));
(*field)->val_str(&field_value, (*field)->val_str(&field_value,
(char*) (old_data + (*field)->offset())); (char*) (old_data + (*field)->offset(record)));
if (needs_quote) if (needs_quote)
where_string.append('\''); where_string.append('\'');
field_value.print(&where_string); field_value.print(&where_string);

View File

@ -6630,7 +6630,7 @@ innodb_mutex_show_status(
mutex->count_spin_rounds, mutex->count_spin_rounds,
mutex->count_os_wait, mutex->count_os_wait,
mutex->count_os_yield, mutex->count_os_yield,
mutex->lspent_time/1000); (ulong) (mutex->lspent_time/1000));
if (stat_print(thd, innobase_hton_name, if (stat_print(thd, innobase_hton_name,
hton_name_len, buf1, buf1len, hton_name_len, buf1, buf1len,
@ -6660,7 +6660,7 @@ innodb_mutex_show_status(
rw_lock_count, rw_lock_count_spin_loop, rw_lock_count, rw_lock_count_spin_loop,
rw_lock_count_spin_rounds, rw_lock_count_spin_rounds,
rw_lock_count_os_wait, rw_lock_count_os_yield, rw_lock_count_os_wait, rw_lock_count_os_yield,
rw_lock_wait_time/1000); (ulong) (rw_lock_wait_time/1000));
if (stat_print(thd, innobase_hton_name, hton_name_len, if (stat_print(thd, innobase_hton_name, hton_name_len,
STRING_WITH_LEN("rw_lock_mutexes"), buf2, buf2len)) { STRING_WITH_LEN("rw_lock_mutexes"), buf2, buf2len)) {

View File

@ -609,7 +609,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
{ {
param.testflag&= ~T_RETRY_WITHOUT_QUICK; param.testflag&= ~T_RETRY_WITHOUT_QUICK;
sql_print_information("Retrying repair of: '%s' without quick", sql_print_information("Retrying repair of: '%s' without quick",
table->s->path); table->s->path.str);
continue; continue;
} }
param.testflag&= ~T_QUICK; param.testflag&= ~T_QUICK;
@ -617,7 +617,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
{ {
param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP; param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP;
sql_print_information("Retrying repair of: '%s' with keycache", sql_print_information("Retrying repair of: '%s' with keycache",
table->s->path); table->s->path.str);
continue; continue;
} }
break; break;
@ -629,7 +629,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
sql_print_information("Found %s of %s rows when repairing '%s'", sql_print_information("Found %s of %s rows when repairing '%s'",
llstr(file->state->records, llbuff), llstr(file->state->records, llbuff),
llstr(start_records, llbuff2), llstr(start_records, llbuff2),
table->s->path); table->s->path.str);
} }
return error; return error;
} }
@ -1157,7 +1157,7 @@ bool ha_myisam::check_and_repair(THD *thd)
// Don't use quick if deleted rows // Don't use quick if deleted rows
if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK)) if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
check_opt.flags|=T_QUICK; check_opt.flags|=T_QUICK;
sql_print_warning("Checking table: '%s'",table->s->path); sql_print_warning("Checking table: '%s'",table->s->path.str);
old_query= thd->query; old_query= thd->query;
old_query_length= thd->query_length; old_query_length= thd->query_length;
@ -1168,7 +1168,7 @@ bool ha_myisam::check_and_repair(THD *thd)
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt)) if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
{ {
sql_print_warning("Recovering table: '%s'",table->s->path); sql_print_warning("Recovering table: '%s'",table->s->path.str);
check_opt.flags= check_opt.flags=
((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) | ((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
(marked_crashed ? 0 : T_QUICK) | (marked_crashed ? 0 : T_QUICK) |
@ -1460,6 +1460,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
bool found_real_auto_increment=0; bool found_real_auto_increment=0;
enum ha_base_keytype type; enum ha_base_keytype type;
char buff[FN_REFLEN]; char buff[FN_REFLEN];
byte *record;
KEY *pos; KEY *pos;
MI_KEYDEF *keydef; MI_KEYDEF *keydef;
MI_COLUMNDEF *recinfo,*recinfo_pos; MI_COLUMNDEF *recinfo,*recinfo_pos;
@ -1564,6 +1565,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
found_real_auto_increment= share->next_number_key_offset == 0; found_real_auto_increment= share->next_number_key_offset == 0;
} }
record= table_arg->record[0];
recpos=0; recinfo_pos=recinfo; recpos=0; recinfo_pos=recinfo;
while (recpos < (uint) share->reclength) while (recpos < (uint) share->reclength)
{ {
@ -1573,7 +1575,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
for (field=table_arg->field ; *field ; field++) for (field=table_arg->field ; *field ; field++)
{ {
if ((fieldpos=(*field)->offset()) >= recpos && if ((fieldpos=(*field)->offset(record)) >= recpos &&
fieldpos <= minpos) fieldpos <= minpos)
{ {
/* skip null fields */ /* skip null fields */

View File

@ -37,7 +37,7 @@ extern ulong myisam_recover_options;
class ha_myisam: public handler class ha_myisam: public handler
{ {
MI_INFO *file; MI_INFO *file;
ulong int_table_flags; ulonglong int_table_flags;
char *data_file_name, *index_file_name; char *data_file_name, *index_file_name;
bool can_enable_indexes; bool can_enable_indexes;
int repair(THD *thd, MI_CHECK &param, bool optimize); int repair(THD *thd, MI_CHECK &param, bool optimize);

View File

@ -317,7 +317,7 @@ RestoreMetaData::markSysTables()
Uint32 j; Uint32 j;
for (j = 0; j < getNoOfTables(); j++) { for (j = 0; j < getNoOfTables(); j++) {
TableS* table = allTables[j]; TableS* table = allTables[j];
if (table->getTableId() == id1) { if (table->getTableId() == (Uint32) id1) {
if (table->isSysTable) if (table->isSysTable)
blobTable->isSysTable = true; blobTable->isSysTable = true;
break; break;