Loading mysql-test/r/partition.result +17 −0 Original line number Diff line number Diff line Loading @@ -1057,4 +1057,21 @@ 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; End of 5.1 tests mysql-test/t/partition.test +29 −0 Original line number Diff line number Diff line Loading @@ -1223,4 +1223,33 @@ 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; --echo End of 5.1 tests sql/ha_ndbcluster.h +8 −0 Original line number Diff line number Diff line Loading @@ -654,6 +654,14 @@ class ha_ndbcluster: public handler int get_default_no_partitions(ulonglong max_rows); 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)) return FALSE; if (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.h +8 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,14 @@ 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)) return FALSE; if (error == HA_ERR_NO_PARTITION_FOUND) return FALSE; return TRUE; } /* ------------------------------------------------------------------------- MODULE full table scan Loading sql/handler.h +25 −7 Original line number Diff line number Diff line Loading @@ -216,11 +216,6 @@ #define HA_BLOCK_LOCK 256 /* unlock when reading some records */ #define HA_OPEN_TEMPORARY 512 /* Errors on write which is recoverable (Key exist) */ #define HA_WRITE_SKIP 121 /* Duplicate key on write */ #define HA_READ_CHECK 123 /* Update with is recoverable */ #define HA_CANT_DO_THAT 131 /* Databasehandler can't do it */ /* Some key definitions */ #define HA_KEY_NULL_LENGTH 1 #define HA_KEY_BLOB_LENGTH 2 Loading Loading @@ -971,6 +966,29 @@ class handler :public Sql_alloc { return (ha_table_flags() & HA_NO_TRANSACTIONS) == 0; } virtual uint extra_rec_buf_length() const { return 0; } /* This method is used to analyse the error to see whether the error is ignorable or not, certain handlers can have more error that are ignorable than others. E.g. the partition handler can get inserts into a range where there is no partition and this is an ignorable error. HA_ERR_FOUND_DUPP_UNIQUE is a special case in MyISAM that means the same thing as HA_ERR_FOUND_DUPP_KEY but can in some cases lead to a slightly different error message. */ #define HA_CHECK_DUPP_KEY 1 #define HA_CHECK_DUPP_UNIQUE 2 #define HA_CHECK_DUPP (HA_CHECK_DUPP_KEY + HA_CHECK_DUPP_UNIQUE) virtual bool is_fatal_error(int error, uint flags) { if (!error || ((flags & HA_CHECK_DUPP_KEY) && (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE))) return FALSE; return TRUE; } /* Number of rows in table. It will only be called if (table_flags() & (HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT)) != 0 Loading Loading
mysql-test/r/partition.result +17 −0 Original line number Diff line number Diff line Loading @@ -1057,4 +1057,21 @@ 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; End of 5.1 tests
mysql-test/t/partition.test +29 −0 Original line number Diff line number Diff line Loading @@ -1223,4 +1223,33 @@ 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; --echo End of 5.1 tests
sql/ha_ndbcluster.h +8 −0 Original line number Diff line number Diff line Loading @@ -654,6 +654,14 @@ class ha_ndbcluster: public handler int get_default_no_partitions(ulonglong max_rows); 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)) return FALSE; if (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.h +8 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,14 @@ 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)) return FALSE; if (error == HA_ERR_NO_PARTITION_FOUND) return FALSE; return TRUE; } /* ------------------------------------------------------------------------- MODULE full table scan Loading
sql/handler.h +25 −7 Original line number Diff line number Diff line Loading @@ -216,11 +216,6 @@ #define HA_BLOCK_LOCK 256 /* unlock when reading some records */ #define HA_OPEN_TEMPORARY 512 /* Errors on write which is recoverable (Key exist) */ #define HA_WRITE_SKIP 121 /* Duplicate key on write */ #define HA_READ_CHECK 123 /* Update with is recoverable */ #define HA_CANT_DO_THAT 131 /* Databasehandler can't do it */ /* Some key definitions */ #define HA_KEY_NULL_LENGTH 1 #define HA_KEY_BLOB_LENGTH 2 Loading Loading @@ -971,6 +966,29 @@ class handler :public Sql_alloc { return (ha_table_flags() & HA_NO_TRANSACTIONS) == 0; } virtual uint extra_rec_buf_length() const { return 0; } /* This method is used to analyse the error to see whether the error is ignorable or not, certain handlers can have more error that are ignorable than others. E.g. the partition handler can get inserts into a range where there is no partition and this is an ignorable error. HA_ERR_FOUND_DUPP_UNIQUE is a special case in MyISAM that means the same thing as HA_ERR_FOUND_DUPP_KEY but can in some cases lead to a slightly different error message. */ #define HA_CHECK_DUPP_KEY 1 #define HA_CHECK_DUPP_UNIQUE 2 #define HA_CHECK_DUPP (HA_CHECK_DUPP_KEY + HA_CHECK_DUPP_UNIQUE) virtual bool is_fatal_error(int error, uint flags) { if (!error || ((flags & HA_CHECK_DUPP_KEY) && (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE))) return FALSE; return TRUE; } /* Number of rows in table. It will only be called if (table_flags() & (HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT)) != 0 Loading