diff options
author | unknown <monty@mashka.mysql.fi> | 2003-09-12 05:54:12 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-09-12 05:54:12 +0300 |
commit | 32a4e783c3bf627313c6187344b2512b190817f9 (patch) | |
tree | c464a6fb9f120446ecd35c4f9426716dea1984d6 | |
parent | 3500763b6e156bcdcb627fbc448681ec3c74c50e (diff) | |
download | mariadb-git-32a4e783c3bf627313c6187344b2512b190817f9.tar.gz |
Fix results for mix_innodb_myisam_binlog
Optimize calls to current_thd
mysql-test/r/mix_innodb_myisam_binlog.result:
updated results
mysql-test/t/mix_innodb_myisam_binlog.test:
Fix for 4.1
sql/ha_innodb.cc:
Don't call current_thd in an assert that is not deleted in release version
(Because current_thd is slow)
-rw-r--r-- | mysql-test/r/mix_innodb_myisam_binlog.result | 9 | ||||
-rw-r--r-- | mysql-test/t/mix_innodb_myisam_binlog.test | 3 | ||||
-rw-r--r-- | sql/ha_innodb.cc | 67 |
3 files changed, 39 insertions, 40 deletions
diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result index 85e92037ada..d6da3604fd2 100644 --- a/mysql-test/r/mix_innodb_myisam_binlog.result +++ b/mysql-test/r/mix_innodb_myisam_binlog.result @@ -19,7 +19,8 @@ begin; insert into t1 values(2); insert into t2 select * from t1; rollback; -Warning: Some non-transactional changed tables couldn't be rolled back +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.000001 79 Query 1 79 use `test`; BEGIN @@ -35,7 +36,8 @@ savepoint my_savepoint; insert into t1 values(4); insert into t2 select * from t1; rollback to savepoint my_savepoint; -Warning: Some non-transactional changed tables couldn't be rolled back +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back commit; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info @@ -55,7 +57,8 @@ savepoint my_savepoint; insert into t1 values(6); insert into t2 select * from t1; rollback to savepoint my_savepoint; -Warning: Some non-transactional changed tables couldn't be rolled back +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back insert into t1 values(7); commit; select a from t1 order by a; diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test index be45c2c3133..314587feda6 100644 --- a/mysql-test/t/mix_innodb_myisam_binlog.test +++ b/mysql-test/t/mix_innodb_myisam_binlog.test @@ -35,7 +35,6 @@ begin; insert into t1 values(2); insert into t2 select * from t1; # should say some changes to non-transact1onal tables couldn't be rolled back ---error 1196 rollback; show binlog events from 79; @@ -49,7 +48,6 @@ insert into t1 values(3); savepoint my_savepoint; insert into t1 values(4); insert into t2 select * from t1; ---error 1196 rollback to savepoint my_savepoint; commit; @@ -64,7 +62,6 @@ insert into t1 values(5); savepoint my_savepoint; insert into t1 values(6); insert into t2 select * from t1; ---error 1196 rollback to savepoint my_savepoint; insert into t1 values(7); commit; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 017151dfca0..bc014c621fd 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -393,7 +393,7 @@ check_trx_exists( { trx_t* trx; - ut_a(thd == current_thd); + DBUG_ASSERT(thd == current_thd); trx = (trx_t*) thd->transaction.all.innobase_tid; @@ -1807,7 +1807,7 @@ build_template( ibool fetch_all_in_key = FALSE; ulint i; - ut_a(templ_type != ROW_MYSQL_REC_FIELDS || thd == current_thd); + DBUG_ASSERT(templ_type != ROW_MYSQL_REC_FIELDS || thd == current_thd); clust_index = dict_table_get_first_index_noninline(prebuilt->table); @@ -1978,8 +1978,8 @@ ha_innobase::write_row( DBUG_ENTER("ha_innobase::write_row"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); + DBUG_ASSERT(prebuilt->trx == + (trx_t*) current_thd->transaction.all.innobase_tid); statistic_increment(ha_write_count, &LOCK_status); @@ -2351,8 +2351,8 @@ ha_innobase::update_row( DBUG_ENTER("ha_innobase::update_row"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); + DBUG_ASSERT(prebuilt->trx == + (trx_t*) current_thd->transaction.all.innobase_tid); if (table->time_stamp) { update_timestamp(new_row + table->time_stamp - 1); @@ -2413,8 +2413,8 @@ ha_innobase::delete_row( DBUG_ENTER("ha_innobase::delete_row"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); + DBUG_ASSERT(prebuilt->trx == + (trx_t*) current_thd->transaction.all.innobase_tid); if (last_query_id != user_thd->query_id) { prebuilt->sql_stat_start = TRUE; @@ -2591,8 +2591,8 @@ ha_innobase::index_read( DBUG_ENTER("index_read"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); + DBUG_ASSERT(prebuilt->trx == + (trx_t*) current_thd->transaction.all.innobase_tid); statistic_increment(ha_read_key_count, &LOCK_status); @@ -2705,12 +2705,9 @@ ha_innobase::change_active_index( statistic_increment(ha_read_key_count, &LOCK_status); DBUG_ENTER("change_active_index"); + DBUG_ASSERT(user_thd == current_thd); ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); - ut_a(user_thd == current_thd); - - ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); + (trx_t*) user_thd->transaction.all.innobase_tid); active_index = keynr; @@ -2795,8 +2792,8 @@ ha_innobase::general_fetch( DBUG_ENTER("general_fetch"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); + DBUG_ASSERT(prebuilt->trx == + (trx_t*) current_thd->transaction.all.innobase_tid); innodb_srv_conc_enter_innodb(prebuilt->trx); @@ -3029,8 +3026,8 @@ ha_innobase::rnd_pos( statistic_increment(ha_read_rnd_count, &LOCK_status); - ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); + DBUG_ASSERT(prebuilt->trx == + (trx_t*) current_thd->transaction.all.innobase_tid); if (prebuilt->clust_index_was_generated) { /* No primary key was defined for the table and we @@ -3078,8 +3075,8 @@ ha_innobase::position( row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; uint len; - ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); + DBUG_ASSERT(prebuilt->trx == + (trx_t*) current_thd->transaction.all.innobase_tid); if (prebuilt->clust_index_was_generated) { /* No primary key was defined for the table and we @@ -3361,7 +3358,7 @@ ha_innobase::create( /* Get the transaction associated with the current thd, or create one if not yet created */ - parent_trx = check_trx_exists(current_thd); + parent_trx = check_trx_exists(thd); /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads */ @@ -3474,10 +3471,10 @@ ha_innobase::create( } } - if (current_thd->query != NULL) { + if (thd->query != NULL) { error = row_table_add_foreign_constraints(trx, - current_thd->query, norm_name); + thd->query, norm_name); error = convert_error_code_to_mysql(error, NULL); @@ -3534,13 +3531,13 @@ ha_innobase::delete_table( trx_t* parent_trx; trx_t* trx; char norm_name[1000]; - + THD *thd= current_thd; DBUG_ENTER("ha_innobase::delete_table"); /* Get the transaction associated with the current thd, or create one if not yet created */ - parent_trx = check_trx_exists(current_thd); + parent_trx = check_trx_exists(thd); /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads */ @@ -3555,8 +3552,8 @@ ha_innobase::delete_table( trx = trx_allocate_for_mysql(); - trx->mysql_thd = current_thd; - trx->mysql_query_str = &((*current_thd).query); + trx->mysql_thd = thd; + trx->mysql_query_str = &(thd->query); name_len = strlen(name); @@ -3609,11 +3606,12 @@ innobase_drop_database( char* ptr; int error; char namebuf[10000]; + THD *thd= current_thd; /* Get the transaction associated with the current thd, or create one if not yet created */ - parent_trx = check_trx_exists(current_thd); + parent_trx = check_trx_exists(thd); /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads */ @@ -3636,8 +3634,8 @@ innobase_drop_database( my_casedn_str(system_charset_info, namebuf); #endif trx = trx_allocate_for_mysql(); - trx->mysql_thd = current_thd; - trx->mysql_query_str = &((*current_thd).query); + trx->mysql_thd = thd; + trx->mysql_query_str = &(thd->query); error = row_drop_database_for_mysql(namebuf, trx); @@ -3677,13 +3675,14 @@ ha_innobase::rename_table( trx_t* trx; char norm_from[1000]; char norm_to[1000]; + THD *thd= current_thd; DBUG_ENTER("ha_innobase::rename_table"); /* Get the transaction associated with the current thd, or create one if not yet created */ - parent_trx = check_trx_exists(current_thd); + parent_trx = check_trx_exists(thd); /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads */ @@ -3697,8 +3696,8 @@ ha_innobase::rename_table( } trx = trx_allocate_for_mysql(); - trx->mysql_thd = current_thd; - trx->mysql_query_str = &((*current_thd).query); + trx->mysql_thd = thd; + trx->mysql_query_str = &(thd->query); name_len1 = strlen(from); name_len2 = strlen(to); |