1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Don't use row level logging on optimize or repair table.

(Fixes core dump in rpl_failed_optimize.test)
Ensure we end active transcations if we do an admin command (like optimize, repair etc)


mysql-test/extra/rpl_tests/rpl_failed_optimize.test:
  Added extra test + drop of table at end of test
mysql-test/lib/mtr_report.pl:
  Fail if mysqld asserts or prints stack
mysql-test/mysql-test-run.sh:
  Fail if mysqld asserts or prints stack
mysql-test/r/exampledb.result:
  Cleanup of events_tests (as this caused a lot of problems if it didn't work)
mysql-test/r/innodb.result:
  Extra test to see that we can do an optimize table on an active transaction
mysql-test/r/rpl_failed_optimize.result:
  Added extra test + drop of table at end of test
mysql-test/t/exampledb.test:
  Cleanup of events_tests (as this caused a lot of problems if it didn't work)
mysql-test/t/innodb.test:
  Extra test to see that we can do an optimize table on an active transaction
sql/handler.cc:
  Don't use row level logging on optimize or repair table.
sql/log.cc:
  Simplify code (no logic changes)
sql/mysql_priv.h:
  Added prototype
sql/sql_base.cc:
  Better name for define
sql/sql_class.cc:
  Indentation fix
sql/sql_parse.cc:
  Make end_active_trans() global
sql/sql_table.cc:
  Ensure we end active transcations if we do an admin command (like optimize, repair etc)
This commit is contained in:
unknown
2006-05-05 20:08:40 +03:00
parent d1b6779ade
commit 3995b06b40
15 changed files with 92 additions and 42 deletions

View File

@@ -288,13 +288,13 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
if (!(share= alloc_table_share(table_list, key, key_length)))
{
#ifdef NOT_YET
#ifdef WAITING_FOR_TABLE_DEF_CACHE_STAGE_3
pthread_mutex_unlock(&LOCK_open);
#endif
DBUG_RETURN(0);
}
#ifdef NOT_YET
#ifdef WAITING_FOR_TABLE_DEF_CACHE_STAGE_3
// We need a write lock to be able to add a new entry
pthread_mutex_unlock(&LOCK_open);
pthread_mutex_lock(&LOCK_open);
@@ -331,19 +331,19 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
if (my_hash_insert(&table_def_cache, (byte*) share))
{
#ifdef NOT_YET
#ifdef WAITING_FOR_TABLE_DEF_CACHE_STAGE_3
pthread_mutex_unlock(&LOCK_open);
(void) pthread_mutex_unlock(&share->mutex);
#endif
free_table_share(share);
DBUG_RETURN(0); // return error
}
#ifdef NOT_YET
#ifdef WAITING_FOR_TABLE_DEF_CACHE_STAGE_3
pthread_mutex_unlock(&LOCK_open);
#endif
if (open_table_def(thd, share, db_flags))
{
#ifdef NOT_YET
#ifdef WAITING_FOR_TABLE_DEF_CACHE_STAGE_3
/*
No such table or wrong table definition file
Lock first the table cache and then the mutex.
@@ -372,7 +372,7 @@ found:
/* We must do a lock to ensure that the structure is initialized */
(void) pthread_mutex_lock(&share->mutex);
#ifdef NOT_YET
#ifdef WAITING_FOR_TABLE_DEF_CACHE_STAGE_3
pthread_mutex_unlock(&LOCK_open);
#endif
if (share->error)
@@ -540,7 +540,7 @@ void release_table_share(TABLE_SHARE *share, enum release_type type)
DBUG_VOID_RETURN;
#ifdef NOT_YET
#ifdef WAITING_FOR_TABLE_DEF_CACHE_STAGE_3
if (to_be_deleted)
{
/*
@@ -1069,7 +1069,7 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
handled either before writing a query log event (inside
binlog_query()) or when preparing a pending event.
*/
thd->binlog_flush_pending_rows_event(true);
thd->binlog_flush_pending_rows_event(TRUE);
mysql_unlock_tables(thd, thd->lock);
thd->lock=0;
}