mariadb/client
Venkata Sidagam 14aa2c020e Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY
CAUSES RESTORE PROBLEM
Problem Statement:
------------------
mysqldump is not having the dump stmts for general_log and slow_log
tables. That is because of the fix for Bug#26121. Hence, after 
dropping the mysql database, and applying the dump by enabling the 
logging, "'general_log' table not found" errors are logged into the 
server log file.

Analysis:
---------
As part of the fix for Bug#26121, we skipped the dumping of tables 
for general_log and slow_log, because the data dump of those tables 
are taking LOCKS, which is not allowed for log tables.

Fix:
----
We came up with an approach that instead of taking both meta data 
and data dump information for those tables, take only the meta data 
dump which doesn't need LOCKS.
As part of fixing the issue we came up with below algorithm.
Design before fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

Design with the fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Explicitly call the 'show create table' for general_log and 
   slow_log
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

While taking the meta data dump for general_log and slow_log the 
"CREATE TABLE" is replaced with "CREATE TABLE IF NOT EXISTS". 
This is because we skipped "DROP TABLE" for those tables, 
"DROP TABLE" fails for these tables if logging is enabled. 
Customer is applying the dump by enabling logging so, if the dump 
has "DROP TABLE" it will fail. Hence, removed the "DROP TABLE" 
stmts for those tables.
  
After the fix we could observe "Table 'mysql.general_log' 
doesn't exist" errors initially that is because in the customer 
scenario they are dropping the mysql database by enabling the 
logging, Hence, those errors are expected. Once we apply the 
dump which is taken before the "drop database mysql", the errors 
will not be there.
2012-05-07 16:46:44 +05:30
..
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
client_priv.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
CMakeLists.txt Updated/added copyright headers 2011-06-30 17:37:13 +02:00
completion_hash.cc WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
completion_hash.h - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
echo.c echo.c: 2007-03-20 18:31:49 +01:00
get_password.c fixes for build failures due to my yesterday's changeset forbidding 2008-02-19 18:45:11 +01:00
Makefile.am Updated/added copyright headers 2011-07-03 17:47:37 +02:00
my_readline.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mysql.cc BUG#11758062 - 50206: ER_TOO_BIG_SELECT REFERS TO OUTMODED 2011-09-28 15:39:21 +05:30
mysql_upgrade.c Manual merge from mysql-5.0. 2011-07-22 11:46:45 +04:00
mysqladmin.cc Manual merge from mysql-5.0. 2011-07-22 11:46:45 +04:00
mysqlbinlog.cc BUG#12695969 2011-07-11 17:13:27 +01:00
mysqlcheck.c Manual merge from mysql-5.0. 2011-07-22 11:46:45 +04:00
mysqldump.c Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY 2012-05-07 16:46:44 +05:30
mysqlimport.c Manual merge from mysql-5.0. 2011-07-22 11:46:45 +04:00
mysqlshow.c Manual merge from mysql-5.0. 2011-07-22 11:46:45 +04:00
mysqlslap.c Bug #11766072 59107: MYSQLSLAP CRASHES IF STARTED WITH NO ARGUMENTS ON WINDOWS 2012-04-09 16:42:41 +05:30
mysqltest.cc Bug #12793118 MYSQLTEST: --ERROR AND --DISABLE_ABORT_ON_ERROR DO NOT WORK FOR SQL IN COMMANDS 2011-09-14 15:19:24 +02:00
readline.cc Build broken for gcc 4.5.1 in optimized mode. 2011-11-29 15:52:47 +01:00
sql_string.cc Updated/added copyright headers 2012-02-15 17:21:38 +01:00
sql_string.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00