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@stripped, 2006-09-29 18:26:30+04:00, dlenev@stripped +9 -0
Merge mockturtle.local:/home/dlenev/src/mysql-5.0-bg20670-2
into mockturtle.local:/home/dlenev/src/mysql-5.1-bg20670
MERGE: 1.1810.2004.16
mysql-test/r/trigger.result@stripped, 2006-09-29 18:15:16+04:00, dlenev@stripped +0 -0
Auto merged
MERGE: 1.29.1.17
mysql-test/t/trigger.test@stripped, 2006-09-29 18:15:16+04:00, dlenev@stripped +0 -0
Auto merged
MERGE: 1.34.1.18
sql/key.cc@stripped, 2006-09-29 18:16:18+04:00, dlenev@stripped +0 -2
Using 5.1 version of the code.
MERGE: 1.34.1.3
sql/mysql_priv.h@stripped, 2006-09-29 18:18:02+04:00, dlenev@stripped +0 -1
Using 5.1 version of the code.
MERGE: 1.290.1.116
sql/opt_range.cc@stripped, 2006-09-29 18:18:44+04:00, dlenev@stripped +0 -8
Using 5.1 version of the code.
MERGE: 1.159.1.59
sql/opt_range.h@stripped, 2006-09-29 18:19:15+04:00, dlenev@stripped +0 -5
Using 5.1 version of the code.
MERGE: 1.57.1.3
sql/sql_trigger.cc@stripped, 2006-09-29 18:15:16+04:00, dlenev@stripped +0 -0
Auto merged
MERGE: 1.35.1.21
sql/sql_trigger.h@stripped, 2006-09-29 18:26:27+04:00, dlenev@stripped +0 -2
Manual merge.
MERGE: 1.19.1.3
sql/sql_update.cc@stripped, 2006-09-29 18:24:54+04:00, dlenev@stripped +0 -5
Using 5.1 version of the code.
MERGE: 1.154.18.1
# 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: mockturtle.local
# Root: /home/dlenev/src/mysql-5.1-bg20670/RESYNC
--- 1.46/mysql-test/r/trigger.result 2006-09-29 18:26:37 +04:00
+++ 1.47/mysql-test/r/trigger.result 2006-09-29 18:26:37 +04:00
@@ -1173,4 +1173,16 @@
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
DROP TABLE t1;
DROP TABLE t2;
+drop table if exists t1;
+create table t1 (i int, j int key);
+insert into t1 values (1,1), (2,2), (3,3);
+create trigger t1_bu before update on t1 for each row
+set new.j = new.j + 10;
+update t1 set i= i+ 10 where j > 2;
+select * from t1;
+i j
+1 1
+2 2
+13 13
+drop table t1;
End of 5.0 tests
--- 1.50/mysql-test/t/trigger.test 2006-09-29 18:26:37 +04:00
+++ 1.51/mysql-test/t/trigger.test 2006-09-29 18:26:37 +04:00
@@ -1421,4 +1421,23 @@
DROP TABLE t2;
+#
+# Bug#20670 "UPDATE using key and invoking trigger that modifies
+# this key does not stop"
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (i int, j int key);
+insert into t1 values (1,1), (2,2), (3,3);
+create trigger t1_bu before update on t1 for each row
+ set new.j = new.j + 10;
+# This should not work indefinitely and should cause
+# expected result
+update t1 set i= i+ 10 where j > 2;
+select * from t1;
+drop table t1;
+
+
--echo End of 5.0 tests
--- 1.67/sql/sql_trigger.cc 2006-09-29 18:26:37 +04:00
+++ 1.68/sql/sql_trigger.cc 2006-09-29 18:26:37 +04:00
@@ -1583,6 +1583,38 @@
/*
+ Check if field of subject table can be changed in before update trigger.
+
+ SYNOPSIS
+ is_updated_in_before_update_triggers()
+ field Field object for field to be checked
+
+ NOTE
+ Field passed to this function should be bound to the same
+ TABLE object as Table_triggers_list.
+
+ RETURN VALUE
+ TRUE Field is changed
+ FALSE Otherwise
+*/
+
+bool Table_triggers_list::is_updated_in_before_update_triggers(Field *fld)
+{
+ Item_trigger_field *trg_fld;
+ for (trg_fld= trigger_fields[TRG_EVENT_UPDATE][TRG_ACTION_BEFORE];
+ trg_fld != 0;
+ trg_fld= trg_fld->next_trg_field)
+ {
+ if (trg_fld->get_settable_routine_parameter() &&
+ trg_fld->field_idx != (uint)-1 &&
+ table->field[trg_fld->field_idx]->eq(fld))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+/*
Trigger BUG#14090 compatibility hook
SYNOPSIS
--- 1.23/sql/sql_trigger.h 2006-09-29 18:26:37 +04:00
+++ 1.24/sql/sql_trigger.h 2006-09-29 18:26:37 +04:00
@@ -116,11 +116,6 @@
bodies[TRG_EVENT_DELETE][TRG_ACTION_AFTER]);
}
- bool has_before_update_triggers()
- {
- return test(bodies[TRG_EVENT_UPDATE][TRG_ACTION_BEFORE]);
- }
-
void set_table(TABLE *new_table);
void mark_fields_used(trg_event_type event);
| Thread |
|---|
| • bk commit into 5.1 tree (dlenev:1.2292) | dlenev | 29 Sep |