diff options
-rw-r--r-- | mysql-test/include/default_mysqld.cnf | 1 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-autoinc.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_bug13635833.result | 45 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_bug14007649.result | 5 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_information_schema.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb.test | 2 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_bug13635833.test | 64 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_bug34053.test | 7 | ||||
-rw-r--r-- | sql/log_event.cc | 8 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 94 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.h | 3 |
12 files changed, 49 insertions, 188 deletions
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 66ff188fe55..a3dcbe9ffbb 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -44,7 +44,6 @@ loose-innodb_write_io_threads= 2 loose-innodb_read_io_threads= 2 loose-innodb_log_buffer_size= 1M loose-innodb_log_file_size= 5M -loose-innodb_additional_mem_pool_size= 1M loose-innodb_log_files_in_group= 2 slave-net-timeout=120 diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result index 9eb89bead74..d4b6c6839c2 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -366,7 +366,7 @@ c1 310 400 1000 -1010 +1110 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; @@ -648,7 +648,7 @@ t2 CREATE TABLE `t2` ( `n` int(10) unsigned NOT NULL, `o` enum('FALSE','TRUE') DEFAULT NULL, PRIMARY KEY (`m`) -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; SHOW CREATE TABLE t1; Table Create Table diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index 17fe766616a..826e80f6780 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -1598,7 +1598,7 @@ concat(a, b) drop table t1; CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); -ERROR HY000: The used table type doesn't support FULLTEXT indexes +ERROR HY000: The table does not have FULLTEXT index to support this query DROP TABLE t1; CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO t1 VALUES (1),(2),(3); diff --git a/mysql-test/suite/innodb/r/innodb_bug13635833.result b/mysql-test/suite/innodb/r/innodb_bug13635833.result deleted file mode 100644 index a92b57cc824..00000000000 --- a/mysql-test/suite/innodb/r/innodb_bug13635833.result +++ /dev/null @@ -1,45 +0,0 @@ -SET DEBUG_SYNC='reset'; -create table t1 (f1 integer, key k1 (f1)) engine=innodb; -create table t2 (f1 int, f2 int, key(f1), key(f2)) engine=innodb; -create table t3 (f2 int, key(f2)) engine=innodb; -insert into t1 values (10); -insert into t2 values (10, 20); -insert into t3 values (20); -alter table t2 add constraint c1 foreign key (f1) -references t1(f1) on update cascade; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - KEY `k1` (`f1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `f1` int(11) DEFAULT NULL, - `f2` int(11) DEFAULT NULL, - KEY `f1` (`f1`), - KEY `f2` (`f2`), - CONSTRAINT `c1` FOREIGN KEY (`f1`) REFERENCES `t1` (`f1`) ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `f2` int(11) DEFAULT NULL, - KEY `f2` (`f2`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -SET DEBUG_SYNC='innodb_rename_table_ready SIGNAL update_can_proceed - WAIT_FOR dict_unfreeze'; -alter table t2 add constraint z1 foreign key (f2) -references t3(f2) on update cascade; -SET DEBUG_SYNC='innodb_row_update_for_mysql_begin - WAIT_FOR update_can_proceed'; -SET DEBUG_SYNC='innodb_dml_cascade_dict_unfreeze SIGNAL dict_unfreeze - WAIT_FOR foreign_free_cache'; -update ignore t1 set f1 = 20; -ERROR HY000: Error on rename of './test/t2' to '#sql2-temporary' (errno: 182 "Table is being used in foreign key check") -SET DEBUG_SYNC='now SIGNAL foreign_free_cache'; -drop table t2; -drop table t1; -drop table t3; -SET DEBUG_SYNC='reset'; diff --git a/mysql-test/suite/innodb/r/innodb_bug14007649.result b/mysql-test/suite/innodb/r/innodb_bug14007649.result index 50de5868be4..8338c7b2ba2 100644 --- a/mysql-test/suite/innodb/r/innodb_bug14007649.result +++ b/mysql-test/suite/innodb/r/innodb_bug14007649.result @@ -39,18 +39,17 @@ update t1 set f2 = 6 where f1 = 1 and f2 is null; (a) Number of rows updated: select row_count(); row_count() -1 +0 (a) After the update statement is executed. select rowid, f1, f2 from t1; rowid f1 f2 1 1 10 2 1 NULL -3 1 6 commit; "The trx with consistent snapshot ended." select rowid, f1, f2 from t1; rowid f1 f2 1 1 10 2 1 4 -3 1 6 +3 1 NULL drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb_information_schema.result b/mysql-test/suite/innodb/r/innodb_information_schema.result index 13de084bc09..0c4413282f7 100644 --- a/mysql-test/suite/innodb/r/innodb_information_schema.result +++ b/mysql-test/suite/innodb/r/innodb_information_schema.result @@ -44,6 +44,8 @@ trx_foreign_key_checks int(1) NO 0 trx_last_foreign_key_error varchar(256) YES NULL trx_adaptive_hash_latched int(1) NO 0 trx_adaptive_hash_timeout bigint(21) unsigned NO 0 +trx_is_read_only int(1) NO 0 +trx_autocommit_non_locking int(1) NO 0 trx_state trx_weight trx_tables_in_use trx_tables_locked trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks RUNNING 4 0 0 7 1 0 REPEATABLE READ 1 1 trx_isolation_level trx_unique_checks trx_foreign_key_checks diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index d57a52a2362..600d602c6fc 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -1259,7 +1259,7 @@ drop table t1; # CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; ---error 1214 +--error 1765 SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_bug13635833.test b/mysql-test/suite/innodb/t/innodb_bug13635833.test deleted file mode 100644 index 47185b9d526..00000000000 --- a/mysql-test/suite/innodb/t/innodb_bug13635833.test +++ /dev/null @@ -1,64 +0,0 @@ ---source include/have_innodb.inc ---source include/have_debug_sync.inc ---source include/not_embedded.inc - -SET DEBUG_SYNC='reset'; - -# Save the initial number of concurrent sessions ---source include/count_sessions.inc - -create table t1 (f1 integer, key k1 (f1)) engine=innodb; -create table t2 (f1 int, f2 int, key(f1), key(f2)) engine=innodb; -create table t3 (f2 int, key(f2)) engine=innodb; - -insert into t1 values (10); -insert into t2 values (10, 20); -insert into t3 values (20); - -alter table t2 add constraint c1 foreign key (f1) - references t1(f1) on update cascade; - -show create table t1; -show create table t2; -show create table t3; - -SET DEBUG_SYNC='innodb_rename_table_ready SIGNAL update_can_proceed - WAIT_FOR dict_unfreeze'; - ---send -alter table t2 add constraint z1 foreign key (f2) - references t3(f2) on update cascade; - -connect (thr2,localhost,root,,); -connection thr2; - -SET DEBUG_SYNC='innodb_row_update_for_mysql_begin - WAIT_FOR update_can_proceed'; -SET DEBUG_SYNC='innodb_dml_cascade_dict_unfreeze SIGNAL dict_unfreeze - WAIT_FOR foreign_free_cache'; - ---send -update ignore t1 set f1 = 20; - -connection default; ---replace_regex /'[^']*test\/#sql2-[0-9a-f-]*'/'#sql2-temporary'/ ---error ER_ERROR_ON_RENAME -reap; - -SET DEBUG_SYNC='now SIGNAL foreign_free_cache'; - -connection thr2; -reap; -disconnect thr2; ---source include/wait_until_disconnected.inc - -connection default; - -drop table t2; -drop table t1; -drop table t3; - -# Wait till we reached the initial number of concurrent sessions ---source include/wait_until_count_sessions.inc - -SET DEBUG_SYNC='reset'; diff --git a/mysql-test/suite/innodb/t/innodb_bug34053.test b/mysql-test/suite/innodb/t/innodb_bug34053.test index b935e45c06d..56c26acb632 100644 --- a/mysql-test/suite/innodb/t/innodb_bug34053.test +++ b/mysql-test/suite/innodb/t/innodb_bug34053.test @@ -21,8 +21,11 @@ FLUSH PRIVILEGES; -- connection con1 -- error ER_SPECIFIC_ACCESS_DENIED_ERROR CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB; --- error ER_SPECIFIC_ACCESS_DENIED_ERROR +# this should only fail with UNIV_MEM_DEBUG CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB; +DROP TABLE innodb_mem_validate; +CREATE TABLE innodb_sql (a INT) ENGINE=INNODB; +DROP TABLE innodb_sql; CREATE TABLE innodb_monitorx (a INT) ENGINE=INNODB; DROP TABLE innodb_monitorx; CREATE TABLE innodb_monito (a INT) ENGINE=INNODB; @@ -39,12 +42,10 @@ CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB; -- connection con1 -- error ER_SPECIFIC_ACCESS_DENIED_ERROR DROP TABLE innodb_monitor; --- error ER_SPECIFIC_ACCESS_DENIED_ERROR DROP TABLE innodb_mem_validate; -- connection default DROP TABLE innodb_monitor; -DROP TABLE innodb_mem_validate; DROP USER 'shane'@'localhost'; -- disconnect con1 diff --git a/sql/log_event.cc b/sql/log_event.cc index 60e074deaca..b6c1d15a0d6 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -10272,8 +10272,14 @@ int Rows_log_event::find_row(const Relay_log_info *rli) table->s->reclength) == 0); */ + int error; DBUG_PRINT("info",("locating record using primary key (position)")); - int error= table->file->ha_rnd_pos_by_record(table->record[0]); + + if (!table->file->inited && + (error= table->file->ha_rnd_init_with_error(0))) + DBUG_RETURN(error); + + error= table->file->ha_rnd_pos_by_record(table->record[0]); if (error) { DBUG_PRINT("info",("rnd_pos returns error %d",error)); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index df655bc6f42..65b42ed4d3b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1831,7 +1831,8 @@ innobase_next_autoinc( ulonglong current, /*!< in: Current value */ ulonglong increment, /*!< in: increment current by */ ulonglong offset, /*!< in: AUTOINC offset */ - ulonglong max_value) /*!< in: max value for type */ + ulonglong max_value, /*!< in: max value for type */ + ulonglong reserve) /*!< in: how many values to reserve */ { ulonglong next_value; @@ -1840,51 +1841,16 @@ innobase_next_autoinc( /* According to MySQL documentation, if the offset is greater than the increment then the offset is ignored. */ - if (offset > increment) { + if (offset >= increment) offset = 0; - } - - if (max_value <= current) { - next_value = max_value; - } else if (offset <= 1) { - /* Offset 0 and 1 are the same, because there must be at - least one node in the system. */ - if (max_value - current <= increment) { - next_value = max_value; - } else { - next_value = current + increment; - } - } else if (max_value > current) { - if (current > offset) { - next_value = ((current - offset) / increment) + 1; - } else { - next_value = ((offset - current) / increment) + 1; - } - - ut_a(increment > 0); - ut_a(next_value > 0); - - /* Check for multiplication overflow. */ - if (increment > (max_value / next_value)) { - - next_value = max_value; - } else { - next_value *= increment; - - ut_a(max_value >= next_value); - - /* Check for overflow. */ - if (max_value - next_value <= offset) { - next_value = max_value; - } else { - next_value += offset; - } - } - } else { - next_value = max_value; - } - ut_a(next_value <= max_value); + if (max_value <= current) + return max_value; + next_value = (current / increment) + reserve; + next_value = next_value * increment + offset; + /* Check for overflow. */ + if (next_value < current || next_value > max_value) + next_value = max_value; return(next_value); } @@ -2039,7 +2005,7 @@ ha_innobase::ha_innobase( TABLE_SHARE* table_arg) :handler(hton, table_arg), int_table_flags(HA_REC_NOT_IN_SEQ | - HA_NULL_IN_KEY | + HA_NULL_IN_KEY | HA_CAN_VIRTUAL_COLUMNS | HA_CAN_INDEX_BLOBS | HA_CAN_SQL_HANDLER | HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | @@ -4324,8 +4290,7 @@ ha_innobase::innobase_initialize_autoinc() nor the offset, so use a default increment of 1. */ auto_inc = innobase_next_autoinc( - read_auto_inc, 1, 1, col_max_value); - + read_auto_inc, 1, 1, col_max_value, 1); break; } case DB_RECORD_NOT_FOUND: @@ -6329,7 +6294,7 @@ set_max_autoinc: auto_inc = innobase_next_autoinc( auto_inc, - need, offset, col_max_value); + need, offset, col_max_value, 1); err = innobase_set_max_autoinc( auto_inc); @@ -6743,7 +6708,7 @@ ha_innobase::update_row( need = prebuilt->autoinc_increment; auto_inc = innobase_next_autoinc( - auto_inc, need, offset, col_max_value); + auto_inc, need, offset, col_max_value, 1); error = innobase_set_max_autoinc(auto_inc); } @@ -7063,6 +7028,11 @@ ha_innobase::index_read( index = prebuilt->index; if (UNIV_UNLIKELY(index == NULL) || dict_index_is_corrupted(index)) { + DBUG_PRINT("error", ("index: %p index_corrupt: %d data_corrupt: %d", + index, + index ? test(index->type & DICT_CORRUPT) : 0, + (index && index->table ? + test(index->table->corrupted) : 0))); prebuilt->index_usable = FALSE; DBUG_RETURN(HA_ERR_CRASHED); } @@ -12249,16 +12219,14 @@ ha_innobase::get_auto_increment( /* With old style AUTOINC locking we only update the table's AUTOINC counter after attempting to insert the row. */ if (innobase_autoinc_lock_mode != AUTOINC_OLD_STYLE_LOCKING) { - ulonglong need; ulonglong current; ulonglong next_value; current = *first_value > col_max_value ? autoinc : *first_value; - need = *nb_reserved_values * increment; - + /* Compute the last value in the interval */ next_value = innobase_next_autoinc( - current, need, offset, col_max_value); + current, increment, offset, col_max_value, *nb_reserved_values); prebuilt->autoinc_last_value = next_value; @@ -15333,6 +15301,11 @@ ha_innobase::multi_range_read_info( flags, cost)); } +int ha_innobase::multi_range_read_explain_info(uint mrr_mode, char *str, size_t size) +{ + return ds_mrr.dsmrr_explain_info(mrr_mode, str, size); +} + /** * Index Condition Pushdown interface implementation @@ -15347,20 +15320,7 @@ innobase_index_cond( /*================*/ void* file) /*!< in/out: pointer to ha_innobase */ { - DBUG_ENTER("innobase_index_cond"); - - ha_innobase* h = reinterpret_cast<class ha_innobase*>(file); - - DBUG_ASSERT(h->pushed_idx_cond); - DBUG_ASSERT(h->pushed_idx_cond_keyno != MAX_KEY); - - if (h->end_range && h->compare_key2(h->end_range) > 0) { - - /* caller should return HA_ERR_END_OF_FILE already */ - DBUG_RETURN(ICP_OUT_OF_RANGE); - } - - DBUG_RETURN(h->pushed_idx_cond->val_int() ? ICP_MATCH : ICP_NO_MATCH); + return handler_index_cond_check(file); } /** Attempt to push down an index condition. diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index cbb2f9e7e0e..9039a91d56f 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -288,6 +288,9 @@ public: uint* bufsz, uint* mrr_mode, Cost_estimate* cost); + int multi_range_read_explain_info(uint mrr_mode, + char *str, size_t size); + /** Attempt to push down an index condition. * @param[in] keyno MySQL key number * @param[in] idx_cond Index condition to be checked |