Below is the list of changes that have just been committed into a local
5.1 repository of dlenev. When dlenev 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
1.2224 06/03/24 19:36:44 dlenev@stripped +5 -0
Merge mysql.com:/home/dlenev/mysql-5.0-bg18153
into mysql.com:/home/dlenev/mysql-5.1-merges
sql/sql_table.cc
1.317 06/03/24 19:36:40 dlenev@stripped +0 -0
Manual merge.
sql/ha_ndbcluster.cc
1.292 06/03/24 19:36:40 dlenev@stripped +0 -1
Manual merge.
sql/sql_trigger.cc
1.53 06/03/24 19:28:10 dlenev@stripped +0 -0
Auto merged
mysql-test/t/trigger.test
1.40 06/03/24 19:28:10 dlenev@stripped +0 -0
Auto merged
mysql-test/r/trigger.result
1.35 06/03/24 19:28:10 dlenev@stripped +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: dlenev
# Host: jabberwock.site
# Root: /home/dlenev/mysql-5.1-merges/RESYNC
--- 1.316/sql/sql_table.cc 2006-03-21 05:52:57 +03:00
+++ 1.317/sql/sql_table.cc 2006-03-24 19:36:40 +03:00
@@ -4948,7 +4948,6 @@
Win32 and InnoDB can't drop a table that is in use, so we must
close the original table at before doing the rename
*/
- table_name=thd->strdup(table_name); // must be saved
table->s->version= 0; // Force removal of table def
close_cached_table(thd, table);
table=0; // Marker that table is closed
--- 1.34/mysql-test/r/trigger.result 2006-03-07 22:00:41 +03:00
+++ 1.35/mysql-test/r/trigger.result 2006-03-24 19:28:10 +03:00
@@ -860,6 +860,37 @@
mysqltest t1_bi mysqltest t1 set @a:=new.id
drop trigger test.t1_bi;
ERROR HY000: Trigger does not exist
+alter table t1 rename to test.t1;
+ERROR HY000: Trigger in wrong schema
+insert into t1 values (103);
+select @a;
+@a
+103
+select trigger_schema, trigger_name, event_object_schema,
+event_object_table, action_statement from information_schema.triggers
+where event_object_schema = 'test' or event_object_schema = 'mysqltest';
+trigger_schema trigger_name event_object_schema event_object_table action_statement
+mysqltest t1_bi mysqltest t1 set @a:=new.id
+drop trigger test.t1_bi;
+ERROR HY000: Trigger does not exist
+alter table t1 rename to test.t1, add column val int default 0;
+ERROR HY000: Trigger in wrong schema
+insert into t1 values (104);
+select @a;
+@a
+104
+select trigger_schema, trigger_name, event_object_schema,
+event_object_table, action_statement from information_schema.triggers
+where event_object_schema = 'test' or event_object_schema = 'mysqltest';
+trigger_schema trigger_name event_object_schema event_object_table action_statement
+mysqltest t1_bi mysqltest t1 set @a:=new.id
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop trigger test.t1_bi;
+ERROR HY000: Trigger does not exist
drop trigger t1_bi;
drop table t1;
drop database mysqltest;
--- 1.39/mysql-test/t/trigger.test 2006-03-07 22:00:41 +03:00
+++ 1.40/mysql-test/t/trigger.test 2006-03-24 19:28:10 +03:00
@@ -1017,6 +1017,29 @@
# There should be no fantom .TRN files
--error ER_TRG_DOES_NOT_EXIST
drop trigger test.t1_bi;
+# Let us also check handling of this restriction in ALTER TABLE ... RENAME
+--error ER_TRG_IN_WRONG_SCHEMA
+alter table t1 rename to test.t1;
+insert into t1 values (103);
+select @a;
+select trigger_schema, trigger_name, event_object_schema,
+ event_object_table, action_statement from information_schema.triggers
+ where event_object_schema = 'test' or event_object_schema = 'mysqltest';
+# Again there should be no fantom .TRN files
+--error ER_TRG_DOES_NOT_EXIST
+drop trigger test.t1_bi;
+--error ER_TRG_IN_WRONG_SCHEMA
+alter table t1 rename to test.t1, add column val int default 0;
+insert into t1 values (104);
+select @a;
+select trigger_schema, trigger_name, event_object_schema,
+ event_object_table, action_statement from information_schema.triggers
+ where event_object_schema = 'test' or event_object_schema = 'mysqltest';
+# Table definition should not change
+show create table t1;
+# And once again check for fantom .TRN files
+--error ER_TRG_DOES_NOT_EXIST
+drop trigger test.t1_bi;
drop trigger t1_bi;
drop table t1;
drop database mysqltest;
--- 1.52/sql/sql_trigger.cc 2006-03-10 04:05:57 +03:00
+++ 1.53/sql/sql_trigger.cc 2006-03-24 19:28:10 +03:00
@@ -1367,6 +1367,7 @@
This method tries to leave trigger related files in consistent state,
i.e. it either will complete successfully, or will fail leaving files
in their initial state.
+ Also this method assumes that subject table is not renamed to itself.
RETURN VALUE
FALSE Success
@@ -1387,6 +1388,9 @@
init_alloc_root(&table.mem_root, 8192, 0);
safe_mutex_assert_owner(&LOCK_open);
+
+ DBUG_ASSERT(my_strcasecmp(table_alias_charset, db, new_db) ||
+ my_strcasecmp(table_alias_charset, old_table, new_table));
if (Table_triggers_list::check_n_load(thd, db, old_table, &table, TRUE))
{
| Thread |
|---|
| • bk commit into 5.1 tree (dlenev:1.2224) | dlenev | 24 Mar |