Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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-03-20 00:24:08+03:00, evgen@stripped +4 -0
sql_insert.cc, sql_class.h:
Removed wrong fix for the bug#27006.
The bug was added by the fix for the bug#19978 and fixed by Monty on 2007/02/21.
trigger.test, trigger.result:
Corrected test case for the bug#27006.
mysql-test/r/trigger.result@stripped, 2007-03-20 00:16:08+03:00, evgen@stripped +6 -5
Corrected test case for the bug#27006.
mysql-test/t/trigger.test@stripped, 2007-03-20 00:16:07+03:00, evgen@stripped +3 -3
Corrected test case for the bug#27006.
sql/sql_class.h@stripped, 2007-03-20 00:23:45+03:00, evgen@stripped +0 -4
Removed wrong fix for the bug#27006.
The bug was added by the fix for the bug#19978 and fixed by Monty on 2007/02/21.
sql/sql_insert.cc@stripped, 2007-03-20 00:23:40+03:00, evgen@stripped +7 -8
Removed wrong fix for the bug#27006.
The bug was added by the fix for the bug#19978 and fixed by Monty on 2007/02/21.
# 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: evgen
# Host: moonbone.local
# Root: /mnt/gentoo64/work/27006-bug-5.0-opt-mysql
--- 1.325/sql/sql_class.h 2007-03-15 23:20:57 +03:00
+++ 1.326/sql/sql_class.h 2007-03-20 00:23:45 +03:00
@@ -364,9 +364,6 @@
If a row is updated by the INSERT ... ON DUPLICATE KEY UPDATE and the
new data differs from the old one then the copied and the updated
variables are incremented.
- The touched variable is incremented if a row was touched by the update part
- of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row
- was actually changed or not.
*/
typedef struct st_copy_info {
ha_rows records; /* Number of processed records */
@@ -374,7 +371,6 @@
ha_rows updated; /* Number of updated records */
ha_rows copied; /* Number of copied records */
ha_rows error_count;
- ha_rows touched; /* Number of touched records */
enum enum_duplicates handle_duplicates;
int escape_char, last_errno;
bool ignore;
--- 1.224/sql/sql_insert.cc 2007-03-16 17:20:54 +03:00
+++ 1.225/sql/sql_insert.cc 2007-03-20 00:23:40 +03:00
@@ -526,7 +526,7 @@
/*
Fill in the given fields and dump it to the table file
*/
- info.records= info.deleted= info.copied= info.updated= info.touched= 0;
+ info.records= info.deleted= info.copied= info.updated= 0;
info.ignore= ignore;
info.handle_duplicates=duplic;
info.update_fields= &update_fields;
@@ -763,8 +763,8 @@
(!table->triggers || !table->triggers->has_delete_triggers()))
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
- /* Reset value of LAST_INSERT_ID if no rows were inserted or touched */
- if (!info.copied && !info.touched && thd->insert_id_used)
+ /* Reset value of LAST_INSERT_ID if no rows were inserted */
+ if (!info.copied && thd->insert_id_used)
{
thd->insert_id(0);
id=0;
@@ -1239,18 +1239,17 @@
table->file->adjust_next_insert_id_after_explicit_value(
table->next_number_field->val_int());
- info->touched++;
if ((table->file->table_flags() & HA_PARTIAL_COLUMN_READ) ||
compare_record(table, thd->query_id))
{
info->updated++;
info->copied++;
+ trg_error= (table->triggers &&
+ table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
+ TRG_ACTION_AFTER,
+ TRUE));
}
- trg_error= (table->triggers &&
- table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
- TRG_ACTION_AFTER,
- TRUE));
goto ok_or_after_trg_err;
}
else /* DUP_REPLACE */
--- 1.56/mysql-test/r/trigger.result 2007-03-16 17:21:22 +03:00
+++ 1.57/mysql-test/r/trigger.result 2007-03-20 00:16:08 +03:00
@@ -1398,18 +1398,19 @@
1 test1
2 test2
INSERT INTO t1 VALUES (2,'test2') ON DUPLICATE KEY UPDATE val=VALUES(val);
-INSERT INTO t1 VALUES (3,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val);
+INSERT INTO t1 VALUES (2,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val);
+INSERT INTO t1 VALUES (3,'test4') ON DUPLICATE KEY UPDATE val=VALUES(val);
SELECT * FROM t1;
id val
1 test1
-2 test2
-3 test3
+2 test3
+3 test4
SELECT * FROM t2;
id val
1 test1
2 test2
-3 test2
-4 test3
+3 test3
+4 test4
DROP TRIGGER trg27006_a_insert;
DROP TRIGGER trg27006_a_update;
drop table t1,t2;
--- 1.63/mysql-test/t/trigger.test 2007-03-16 17:21:43 +03:00
+++ 1.64/mysql-test/t/trigger.test 2007-03-20 00:16:07 +03:00
@@ -1700,8 +1700,7 @@
DROP PROCEDURE bug22580_proc_2;
#
-# Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY
-# UPDATE if the row wasn't actually changed.
+# Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE
#
--disable_warnings
DROP TRIGGER IF EXISTS trg27006_a_update;
@@ -1730,7 +1729,8 @@
SELECT * FROM t1;
SELECT * FROM t2;
INSERT INTO t1 VALUES (2,'test2') ON DUPLICATE KEY UPDATE val=VALUES(val);
-INSERT INTO t1 VALUES (3,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val);
+INSERT INTO t1 VALUES (2,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val);
+INSERT INTO t1 VALUES (3,'test4') ON DUPLICATE KEY UPDATE val=VALUES(val);
SELECT * FROM t1;
SELECT * FROM t2;
DROP TRIGGER trg27006_a_insert;
| Thread |
|---|
| • bk commit into 5.0 tree (evgen:1.2486) BUG#27006 | eugene | 19 Mar |