Below is the list of changes that have just been committed into a local
5.1 repository of mattiasj. When mattiasj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-10-04 14:56:33+02:00, mattiasj@mattiasj-laptop.(none) +3 -0
Bug #30484: Partitions: crash with self-referencing trigger
Two cases in ha_partition::extra() was missing
(HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH)
which only is currently used by NDB (which not uses ha_partition)
mysql-test/r/partition.result@stripped, 2007-10-04 14:56:29+02:00,
mattiasj@mattiasj-laptop.(none) +4 -0
Added result for test of Bug #30484
mysql-test/t/partition.test@stripped, 2007-10-04 14:56:29+02:00,
mattiasj@mattiasj-laptop.(none) +9 -0
Added test for Bug #30484
sql/ha_partition.cc@stripped, 2007-10-04 14:56:29+02:00, mattiasj@mattiasj-laptop.(none)
+18 -0
Added HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH
in ha_partition::extra to do nothing
(Only currently used in NDB, which is not dependent of ha_partition)
diff -Nrup a/mysql-test/r/partition.result b/mysql-test/r/partition.result
--- a/mysql-test/r/partition.result 2007-07-02 20:11:52 +02:00
+++ b/mysql-test/r/partition.result 2007-10-04 14:56:29 +02:00
@@ -1259,6 +1259,10 @@ INSERT INTO t1 SELECT a + 8, b FROM t1;
ALTER TABLE t1 ADD PARTITION (PARTITION p1 VALUES LESS THAN (64));
ALTER TABLE t1 DROP PARTITION p1;
DROP TABLE t1;
+create table t (s1 int) engine=myisam partition by key (s1);
+create trigger t_ad after delete on t for each row insert into t values (old.s1);
+insert into t values (1);
+drop table t;
USE mysql;
SET GLOBAL general_log = 0;
ALTER TABLE general_log ENGINE = MyISAM;
diff -Nrup a/mysql-test/t/partition.test b/mysql-test/t/partition.test
--- a/mysql-test/t/partition.test 2007-07-02 20:11:52 +02:00
+++ b/mysql-test/t/partition.test 2007-10-04 14:56:29 +02:00
@@ -1481,6 +1481,15 @@ ALTER TABLE t1 DROP PARTITION p1;
DROP TABLE t1;
#
+# Bug #30484: Partitions: crash with self-referencing trigger
+#
+
+create table t (s1 int) engine=myisam partition by key (s1);
+create trigger t_ad after delete on t for each row insert into t values (old.s1);
+insert into t values (1);
+drop table t;
+
+#
# Bug #27816: Log tables ran with partitions crashes the server when logging
# is enabled.
#
diff -Nrup a/sql/ha_partition.cc b/sql/ha_partition.cc
--- a/sql/ha_partition.cc 2007-10-01 11:23:12 +02:00
+++ b/sql/ha_partition.cc 2007-10-04 14:56:29 +02:00
@@ -4546,6 +4546,8 @@ void ha_partition::get_dynamic_partition
4) Parameters only used by temporary tables for query processing
5) Parameters only used by MyISAM internally
6) Parameters not used at all
+ 7) Parameters only used by federated tables for query processing
+ 8) Parameters only used by NDB
The partition handler need to handle category 1), 2) and 3).
@@ -4812,6 +4814,15 @@ void ha_partition::get_dynamic_partition
HA_EXTRA_INSERT_WITH_UPDATE:
Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be
executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
+
+ 8) Parameters only used by NDB
+ ------------------------------
+ HA_EXTRA_DELETE_CANNOT_BATCH:
+ HA_EXTRA_UPDATE_CANNOT_BATCH:
+ Inform handler that delete_row()/update_row() cannot batch deletes/updates
+ and should perform them immediately. This may be needed when table has
+ AFTER DELETE/UPDATE triggers which access to subject table.
+ These flags are reset by the handler::extra(HA_EXTRA_RESET) call.
*/
int ha_partition::extra(enum ha_extra_function operation)
@@ -4896,6 +4907,13 @@ int ha_partition::extra(enum ha_extra_fu
/* Category 7), used by federated handlers */
case HA_EXTRA_INSERT_WITH_UPDATE:
DBUG_RETURN(loop_extra(operation));
+ /* Category 8) Parameters only used by NDB */
+ case HA_EXTRA_DELETE_CANNOT_BATCH:
+ case HA_EXTRA_UPDATE_CANNOT_BATCH:
+ {
+ /* Currently only NDB use the *_CANNOT_BATCH */
+ break;
+ }
default:
{
/* Temporary crash to discover what is wrong */