Loading mysql-test/r/partition.result +25 −0 Original line number Diff line number Diff line Loading @@ -1057,4 +1057,29 @@ alter table t1 add partition (partition p2 values in (3)); alter table t1 drop partition p2; use test; drop database db99; drop procedure if exists mysqltest_1; create table t1 (a int) partition by list (a) (partition p0 values in (0)); insert into t1 values (0); create procedure mysqltest_1 () begin begin declare continue handler for sqlexception begin end; update ignore t1 set a = 1 where a = 0; end; prepare stmt1 from 'alter table t1'; execute stmt1; end// call mysqltest_1()// drop table t1; drop procedure mysqltest_1; create table t1 (a int, index(a)) partition by hash(a); insert into t1 values (1),(2); select * from t1 ORDER BY a DESC; a 2 1 drop table t1; End of 5.1 tests mysql-test/t/partition.test +38 −0 Original line number Diff line number Diff line Loading @@ -1223,4 +1223,42 @@ alter table t1 drop partition p2; use test; drop database db99; # #BUG 17138 Problem with stored procedure and analyze partition # --disable_warnings drop procedure if exists mysqltest_1; --enable_warnings create table t1 (a int) partition by list (a) (partition p0 values in (0)); insert into t1 values (0); delimiter //; create procedure mysqltest_1 () begin begin declare continue handler for sqlexception begin end; update ignore t1 set a = 1 where a = 0; end; prepare stmt1 from 'alter table t1'; execute stmt1; end// call mysqltest_1()// delimiter ;// drop table t1; drop procedure mysqltest_1; # # Bug 20583 Partitions: Crash using index_last # create table t1 (a int, index(a)) partition by hash(a); insert into t1 values (1),(2); select * from t1 ORDER BY a DESC; drop table t1; --echo End of 5.1 tests sql/ha_ndbcluster.h +7 −0 Original line number Diff line number Diff line Loading @@ -655,6 +655,13 @@ class ha_ndbcluster: public handler int get_default_no_partitions(HA_CREATE_INFO *info); bool get_no_parts(const char *name, uint *no_parts); void set_auto_partitions(partition_info *part_info); virtual bool is_fatal_error(int error, uint flags) { if (!handler::is_fatal_error(error, flags) || error == HA_ERR_NO_PARTITION_FOUND) return FALSE; return TRUE; } THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, Loading sql/ha_partition.cc +2 −1 Original line number Diff line number Diff line Loading @@ -3400,7 +3400,8 @@ int ha_partition::common_first_last(byte *buf) if ((error= partition_scan_set_up(buf, FALSE))) return error; if (!m_ordered_scan_ongoing) if (!m_ordered_scan_ongoing && m_index_scan_type != partition_index_last) return handle_unordered_scan_next_partition(buf); return handle_ordered_index_scan(buf); } Loading sql/ha_partition.h +7 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,13 @@ class ha_partition :public handler virtual void start_bulk_insert(ha_rows rows); virtual int end_bulk_insert(); virtual bool is_fatal_error(int error, uint flags) { if (!handler::is_fatal_error(error, flags) || error == HA_ERR_NO_PARTITION_FOUND) return FALSE; return TRUE; } /* ------------------------------------------------------------------------- MODULE full table scan Loading Loading
mysql-test/r/partition.result +25 −0 Original line number Diff line number Diff line Loading @@ -1057,4 +1057,29 @@ alter table t1 add partition (partition p2 values in (3)); alter table t1 drop partition p2; use test; drop database db99; drop procedure if exists mysqltest_1; create table t1 (a int) partition by list (a) (partition p0 values in (0)); insert into t1 values (0); create procedure mysqltest_1 () begin begin declare continue handler for sqlexception begin end; update ignore t1 set a = 1 where a = 0; end; prepare stmt1 from 'alter table t1'; execute stmt1; end// call mysqltest_1()// drop table t1; drop procedure mysqltest_1; create table t1 (a int, index(a)) partition by hash(a); insert into t1 values (1),(2); select * from t1 ORDER BY a DESC; a 2 1 drop table t1; End of 5.1 tests
mysql-test/t/partition.test +38 −0 Original line number Diff line number Diff line Loading @@ -1223,4 +1223,42 @@ alter table t1 drop partition p2; use test; drop database db99; # #BUG 17138 Problem with stored procedure and analyze partition # --disable_warnings drop procedure if exists mysqltest_1; --enable_warnings create table t1 (a int) partition by list (a) (partition p0 values in (0)); insert into t1 values (0); delimiter //; create procedure mysqltest_1 () begin begin declare continue handler for sqlexception begin end; update ignore t1 set a = 1 where a = 0; end; prepare stmt1 from 'alter table t1'; execute stmt1; end// call mysqltest_1()// delimiter ;// drop table t1; drop procedure mysqltest_1; # # Bug 20583 Partitions: Crash using index_last # create table t1 (a int, index(a)) partition by hash(a); insert into t1 values (1),(2); select * from t1 ORDER BY a DESC; drop table t1; --echo End of 5.1 tests
sql/ha_ndbcluster.h +7 −0 Original line number Diff line number Diff line Loading @@ -655,6 +655,13 @@ class ha_ndbcluster: public handler int get_default_no_partitions(HA_CREATE_INFO *info); bool get_no_parts(const char *name, uint *no_parts); void set_auto_partitions(partition_info *part_info); virtual bool is_fatal_error(int error, uint flags) { if (!handler::is_fatal_error(error, flags) || error == HA_ERR_NO_PARTITION_FOUND) return FALSE; return TRUE; } THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, Loading
sql/ha_partition.cc +2 −1 Original line number Diff line number Diff line Loading @@ -3400,7 +3400,8 @@ int ha_partition::common_first_last(byte *buf) if ((error= partition_scan_set_up(buf, FALSE))) return error; if (!m_ordered_scan_ongoing) if (!m_ordered_scan_ongoing && m_index_scan_type != partition_index_last) return handle_unordered_scan_next_partition(buf); return handle_ordered_index_scan(buf); } Loading
sql/ha_partition.h +7 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,13 @@ class ha_partition :public handler virtual void start_bulk_insert(ha_rows rows); virtual int end_bulk_insert(); virtual bool is_fatal_error(int error, uint flags) { if (!handler::is_fatal_error(error, flags) || error == HA_ERR_NO_PARTITION_FOUND) return FALSE; return TRUE; } /* ------------------------------------------------------------------------- MODULE full table scan Loading