Added verbose mode to recovery
More DBUG Added convert-debug-for-diff Added missing (from last push) federated test case .bzrignore: Ignore generated files mysql-test/README: Updated documentation for --extern mysql-test/suite/federated/federated_bug_32426.result: Added test for federatedx mysql-test/suite/federated/federated_bug_32426.test: Added test for federatedx scripts/Makefile.am: Added convert-debug-for-diff scripts/convert-debug-for-diff.sh: Added script for converting sql/log.cc: Added DBUG sql/mysqld.cc: Added DBUG storage/maria/ma_recovery.c: If verbose, write dirty pages (for debugging) storage/maria/ma_static.c: Added verbose mode to recovery storage/maria/maria_def.h: Added verbose mode to recovery storage/maria/maria_read_log.c: Added verbose mode to recovery
This commit is contained in:
parent
6795a545e3
commit
909e4eb08d
@ -1928,3 +1928,5 @@ libmysqld/ha_federatedx.cc
|
||||
tmp
|
||||
libmysqld/debug_sync.cc
|
||||
storage/pbxt/bin/xtstat
|
||||
mysql-test/mtr_command
|
||||
scripts/convert-debug-for-diff
|
||||
|
@ -18,7 +18,7 @@ the test suite expects you to provide the names of the tests to run.
|
||||
For example, here is the command to run the "alias" and "analyze" tests
|
||||
with an external server:
|
||||
|
||||
mysql-test-run --extern alias analyze
|
||||
mysql-test-run --extern socket=/tmp/mysql.sock alias analyze
|
||||
|
||||
To match your setup, you might also need to provide --socket, --user, and
|
||||
other relevant options.
|
||||
|
30
mysql-test/suite/federated/federated_bug_32426.result
Normal file
30
mysql-test/suite/federated/federated_bug_32426.result
Normal file
@ -0,0 +1,30 @@
|
||||
CREATE DATABASE federated;
|
||||
CREATE DATABASE federated;
|
||||
#
|
||||
# Bug #32426: FEDERATED query returns corrupt results for ORDER BY
|
||||
# on a TEXT column
|
||||
#
|
||||
CREATE TABLE federated.t1(a TEXT);
|
||||
INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de');
|
||||
CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
SELECT * FROM federated.t1 ORDER BY A;
|
||||
a
|
||||
abc
|
||||
de
|
||||
f
|
||||
gh
|
||||
ijk
|
||||
SELECT * FROM federated.t1 ORDER BY A DESC;
|
||||
a
|
||||
ijk
|
||||
gh
|
||||
f
|
||||
de
|
||||
abc
|
||||
DROP TABLE federated.t1;
|
||||
DROP TABLE federated.t1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
24
mysql-test/suite/federated/federated_bug_32426.test
Normal file
24
mysql-test/suite/federated/federated_bug_32426.test
Normal file
@ -0,0 +1,24 @@
|
||||
source federated.inc;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #32426: FEDERATED query returns corrupt results for ORDER BY
|
||||
--echo # on a TEXT column
|
||||
--echo #
|
||||
connection slave;
|
||||
CREATE TABLE federated.t1(a TEXT);
|
||||
INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de');
|
||||
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
SELECT * FROM federated.t1 ORDER BY A;
|
||||
SELECT * FROM federated.t1 ORDER BY A DESC;
|
||||
DROP TABLE federated.t1;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE federated.t1;
|
||||
|
||||
connection default;
|
||||
|
||||
source federated_cleanup.inc;
|
@ -37,7 +37,8 @@ bin_SCRIPTS = @server_scripts@ \
|
||||
mysqld_multi
|
||||
|
||||
noinst_SCRIPTS = make_binary_distribution \
|
||||
make_sharedlib_distribution
|
||||
make_sharedlib_distribution \
|
||||
convert-debug-for-diff
|
||||
|
||||
EXTRA_SCRIPTS = make_binary_distribution.sh \
|
||||
make_sharedlib_distribution.sh \
|
||||
@ -59,7 +60,8 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \
|
||||
mysqlhotcopy.sh \
|
||||
mysqldumpslow.sh \
|
||||
mysqld_multi.sh \
|
||||
mysqld_safe.sh
|
||||
mysqld_safe.sh \
|
||||
convert-debug-for-diff.sh
|
||||
|
||||
EXTRA_DIST = $(EXTRA_SCRIPTS) \
|
||||
mysqlaccess.conf \
|
||||
@ -91,6 +93,7 @@ CLEANFILES = @server_scripts@ \
|
||||
mysqlhotcopy \
|
||||
mysqldumpslow \
|
||||
mysqld_multi \
|
||||
convert-debug-for-diff \
|
||||
$(EXTRA_PROGRAMS)
|
||||
|
||||
pkgplugindir = $(pkglibdir)/plugin
|
||||
|
25
scripts/convert-debug-for-diff.sh
Executable file
25
scripts/convert-debug-for-diff.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/perl -i
|
||||
#
|
||||
# This script converts all numbers that look like addresses or memory sizes,
|
||||
# in a debug files generated by --debug (like mysqld --debug), to #.
|
||||
# The script also deletes all thread id's from the start of the line.
|
||||
|
||||
# This allows you to easily compare the files (for example with diff)
|
||||
# to find out what changes between different executions.
|
||||
# This is extremely useful for comparing two mysqld versions to see
|
||||
# why things now work differently.
|
||||
|
||||
# The script converts the files in place.
|
||||
#
|
||||
# Typical usage:
|
||||
#
|
||||
# convert-debug-for-diff /tmp/mysqld.trace /tmp/mysqld-old.trace
|
||||
# diff /tmp/mysqld.trace /tmp/mysqld-old.trace
|
||||
|
||||
while (<>)
|
||||
{
|
||||
s/^T@[0-9]+://g;
|
||||
s/0x[0-9a-f]+(\s|\n|\))/#$1/g;
|
||||
s/size: [0-9]+/size: #/g;
|
||||
print $_;
|
||||
}
|
@ -372,6 +372,7 @@ bool Log_to_csv_event_handler::
|
||||
Open_tables_state open_tables_backup;
|
||||
ulonglong save_thd_options;
|
||||
bool save_time_zone_used;
|
||||
DBUG_ENTER("log_general");
|
||||
|
||||
/*
|
||||
CSV uses TIME_to_timestamp() internally if table needs to be repaired
|
||||
@ -490,7 +491,7 @@ err:
|
||||
|
||||
thd->options= save_thd_options;
|
||||
thd->time_zone_used= save_time_zone_used;
|
||||
return result;
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
|
||||
|
@ -9309,6 +9309,8 @@ bool is_secure_file_path(char *path)
|
||||
static int fix_paths(void)
|
||||
{
|
||||
char buff[FN_REFLEN],*pos;
|
||||
DBUG_ENTER("fix_paths");
|
||||
|
||||
convert_dirname(mysql_home,mysql_home,NullS);
|
||||
/* Resolve symlinks to allow 'mysql_home' to be a relative symlink */
|
||||
my_realpath(mysql_home,mysql_home,MYF(0));
|
||||
@ -9353,12 +9355,12 @@ static int fix_paths(void)
|
||||
charsets_dir=mysql_charsets_dir;
|
||||
|
||||
if (init_tmpdir(&mysql_tmpdir_list, opt_mysql_tmpdir))
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
#ifdef HAVE_REPLICATION
|
||||
if (!slave_load_tmpdir)
|
||||
{
|
||||
if (!(slave_load_tmpdir = (char*) my_strdup(mysql_tmpdir, MYF(MY_FAE))))
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
#endif /* HAVE_REPLICATION */
|
||||
/*
|
||||
@ -9379,7 +9381,7 @@ static int fix_paths(void)
|
||||
if (my_realpath(buff, opt_secure_file_priv, 0))
|
||||
{
|
||||
sql_print_warning("Failed to normalize the argument for --secure-file-priv.");
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
secure_file_real_path= (char *)my_malloc(FN_REFLEN, MYF(MY_FAE));
|
||||
convert_dirname(secure_file_real_path, buff, NullS);
|
||||
@ -9387,7 +9389,7 @@ static int fix_paths(void)
|
||||
opt_secure_file_priv= secure_file_real_path;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3167,6 +3167,8 @@ static LSN parse_checkpoint_record(LSN lsn)
|
||||
return LSN_ERROR;
|
||||
next_dirty_page_in_pool= dirty_pages_pool;
|
||||
minimum_rec_lsn_of_dirty_pages= LSN_MAX;
|
||||
if (maria_recovery_verbose)
|
||||
tprint(tracef, "Table_id Is_index Page_id Rec_lsn\n");
|
||||
for (i= 0; i < nb_dirty_pages ; i++)
|
||||
{
|
||||
pgcache_page_no_t page_id;
|
||||
@ -3183,6 +3185,9 @@ static LSN parse_checkpoint_record(LSN lsn)
|
||||
if (new_page((is_index << 16) | table_id,
|
||||
page_id, rec_lsn, next_dirty_page_in_pool++))
|
||||
return LSN_ERROR;
|
||||
if (maria_recovery_verbose)
|
||||
tprint(tracef, "%8u %8u %12lu %u,0x%lx\n", (uint) table_id,
|
||||
(uint) is_index, (ulong) page_id, LSN_IN_PARTS(rec_lsn));
|
||||
set_if_smaller(minimum_rec_lsn_of_dirty_pages, rec_lsn);
|
||||
}
|
||||
/* after that, there will be no insert/delete into the hash */
|
||||
|
@ -37,7 +37,7 @@ my_bool maria_flush= 0, maria_single_user= 0;
|
||||
my_bool maria_delay_key_write= 0, maria_page_checksums= 1;
|
||||
my_bool maria_inited= FALSE;
|
||||
my_bool maria_in_ha_maria= FALSE; /* If used from ha_maria or not */
|
||||
my_bool maria_recovery_changed_data= 0;
|
||||
my_bool maria_recovery_changed_data= 0, maria_recovery_verbose= 0;
|
||||
pthread_mutex_t THR_LOCK_maria;
|
||||
#if defined(THREAD) && !defined(DONT_USE_RW_LOCKS)
|
||||
ulong maria_concurrent_insert= 2;
|
||||
|
@ -797,6 +797,7 @@ extern uint maria_quick_table_bits;
|
||||
extern char *maria_data_root;
|
||||
extern uchar maria_zero_string[];
|
||||
extern my_bool maria_inited, maria_in_ha_maria, maria_recovery_changed_data;
|
||||
extern my_bool maria_recovery_verbose;
|
||||
extern HASH maria_stored_state;
|
||||
extern int (*maria_create_trn_hook)(MARIA_HA *);
|
||||
|
||||
|
@ -211,7 +211,10 @@ static struct my_option my_long_options[] =
|
||||
"will not be applied", &opt_end_lsn, &opt_end_lsn,
|
||||
0, GET_ULL, REQUIRED_ARG, 0, 0, ~(longlong) 0, 0, 0, 0 },
|
||||
{"silent", 's', "Print less information during apply/undo phase",
|
||||
(uchar **) &opt_silent, (uchar **) &opt_silent, 0,
|
||||
&opt_silent, &opt_silent, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"verbose", 'v', "Print more information during apply/undo phase",
|
||||
&maria_recovery_verbose, &maria_recovery_verbose, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"tmpdir", 't', "Path for temporary files. Multiple paths can be specified, "
|
||||
"separated by "
|
||||
|
Loading…
x
Reference in New Issue
Block a user