From bf58448f9761018961ffe48d857b47b4b632859e Mon Sep 17 00:00:00 2001 From: marko Date: Fri, 27 Jan 2006 09:34:55 +0000 Subject: [PATCH] Import those changes from mysql-5.1-new ChangeSet 1.1979 (Lars Thalmann) that were not part of r154. (Bug #3300) innodb.test, innodb.result: Remove binlog related tests, because they are not InnoDB specific; they merely require a transactional table. ha_innobase::ha_innobase(): Add HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS to table_flags. ha_innobase::rnd_init(): Disable semi-consistent read for random access. --- handler/ha_innodb.cc | 8 ++++++++ mysql-test/innodb.result | 38 ----------------------------------- mysql-test/innodb.test | 43 ---------------------------------------- 3 files changed, 8 insertions(+), 81 deletions(-) diff --git a/handler/ha_innodb.cc b/handler/ha_innodb.cc index 433b03c01fd..e645e2d7b0a 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -828,6 +828,7 @@ ha_innobase::ha_innobase(TABLE_SHARE *table_arg) HA_CAN_INDEX_BLOBS | HA_CAN_SQL_HANDLER | HA_NOT_EXACT_COUNT | + HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS | HA_PRIMARY_KEY_IN_READ_INDEX | HA_CAN_GEOMETRY | HA_TABLE_SCAN_ON_INDEX), @@ -4401,6 +4402,13 @@ ha_innobase::rnd_init( err = change_active_index(primary_key); } + /* Don't use semi-consistent read in random row reads (by position). + This means we must disable semi_consistent_read if scan is false */ + + if (!scan) { + try_semi_consistent_read(0); + } + start_of_scan = 1; return(err); diff --git a/mysql-test/innodb.result b/mysql-test/innodb.result index 8e5a9c2222c..ee87d0673df 100644 --- a/mysql-test/innodb.result +++ b/mysql-test/innodb.result @@ -1640,29 +1640,6 @@ t2 CREATE TABLE `t2` ( CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t2, t1; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 155 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 0 -create table t1 (a int) engine=innodb; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 156 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -begin; -delete from t1; -commit; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 157 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -drop table t1; create table t1 (c char(10), index (c,c)) engine=innodb; ERROR 42S21: Duplicate column name 'c' create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb; @@ -1774,21 +1751,6 @@ select count(*) from t1 where x = 18446744073709551601; count(*) 1 drop table t1; -show status like "Innodb_buffer_pool_pages_total"; -Variable_name Value -Innodb_buffer_pool_pages_total 512 -show status like "Innodb_page_size"; -Variable_name Value -Innodb_page_size 16384 -show status like "Innodb_rows_deleted"; -Variable_name Value -Innodb_rows_deleted 2070 -show status like "Innodb_rows_inserted"; -Variable_name Value -Innodb_rows_inserted 31727 -show status like "Innodb_rows_updated"; -Variable_name Value -Innodb_rows_updated 29530 show status like "Innodb_row_lock_waits"; Variable_name Value Innodb_row_lock_waits 0 diff --git a/mysql-test/innodb.test b/mysql-test/innodb.test index a47e635cf74..970c18b3558 100644 --- a/mysql-test/innodb.test +++ b/mysql-test/innodb.test @@ -1141,40 +1141,6 @@ show create table t2; drop table t2, t1; -# -# Let us test binlog_cache_use and binlog_cache_disk_use status vars. -# Actually this test has nothing to do with innodb per se, it just requires -# transactional table. -# -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; - -create table t1 (a int) engine=innodb; - -# Now we are going to create transaction which is long enough so its -# transaction binlog will be flushed to disk... -let $1=2000; -disable_query_log; -begin; -while ($1) -{ - eval insert into t1 values( $1 ); - dec $1; -} -commit; -enable_query_log; -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; - -# Transaction which should not be flushed to disk and so should not -# increase binlog_cache_disk_use. -begin; -delete from t1; -commit; -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; -drop table t1; - # # Bug #6126: Duplicate columns in keys gives misleading error message # @@ -1289,15 +1255,6 @@ select * from t1 where x > -16; select count(*) from t1 where x = 18446744073709551601; drop table t1; - -# Test for testable InnoDB status variables. This test -# uses previous ones(pages_created, rows_deleted, ...). -show status like "Innodb_buffer_pool_pages_total"; -show status like "Innodb_page_size"; -show status like "Innodb_rows_deleted"; -show status like "Innodb_rows_inserted"; -show status like "Innodb_rows_updated"; - # Test for row locks InnoDB status variables. show status like "Innodb_row_lock_waits"; show status like "Innodb_row_lock_current_waits";