diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 49fe208d9bd..316921a5814 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2246,4 +2246,10 @@ HAVING b > geomfromtext("") ); 1 DROP TABLE t1; + +MDEV-612 Valgrind error in ha_maria::check_if_incompatible_data + +CREATE TABLE t1 (a INT, b INT, KEY(a)) ENGINE=Aria PARTITION BY KEY(a) PARTITIONS 2; +ALTER TABLE t1 ADD KEY (b); +drop table t1; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 831271c68bb..66dea7340b5 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2267,4 +2267,12 @@ SELECT 1 FROM t1 WHERE b < SOME DROP TABLE t1; +--echo +--echo MDEV-612 Valgrind error in ha_maria::check_if_incompatible_data +--echo + +CREATE TABLE t1 (a INT, b INT, KEY(a)) ENGINE=Aria PARTITION BY KEY(a) PARTITIONS 2; +ALTER TABLE t1 ADD KEY (b); +drop table t1; + --echo End of 5.1 tests diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 9d6e82b0356..aafa2448d85 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4347,8 +4347,8 @@ int ha_partition::common_index_read(uchar *buf, bool have_start_key) DBUG_ENTER("ha_partition::common_index_read"); LINT_INIT(key_len); /* used if have_start_key==TRUE */ - DBUG_PRINT("info", ("m_ordered %u m_ordered_scan_ong %u have_start_key %u", - m_ordered, m_ordered_scan_ongoing, have_start_key)); + DBUG_PRINT("info", ("m_ordered: %u have_start_key: %u", + m_ordered, have_start_key)); if (have_start_key) { diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 09df4c9e03b..8b1fe4d05b3 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -2343,9 +2343,10 @@ int ha_maria::info(uint flag, my_bool lock_table_share) errkey= maria_info.errkey; my_store_ptr(dup_ref, ref_length, maria_info.dup_key_pos); } - /* Faster to always update, than to do it based on flag */ - stats.update_time= maria_info.update_time; - stats.auto_increment_value= maria_info.auto_increment; + if (flag & HA_STATUS_TIME) + stats.update_time= maria_info.update_time; + if (flag & HA_STATUS_AUTO) + stats.auto_increment_value= maria_info.auto_increment; return 0; }