Bug #25981 | editing 1 row via QB causes update trigger to fire multiple times | ||
---|---|---|---|
Submitted: | 31 Jan 2007 15:25 | Modified: | 5 Feb 2007 8:41 |
Reporter: | Hartmut Grosser | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Query Browser | Severity: | S2 (Serious) |
Version: | 1.2.8/1.2.9 | OS: | Windows (Win XP) |
Assigned to: | CPU Architecture: | Any |
[31 Jan 2007 15:25]
Hartmut Grosser
[31 Jan 2007 16:20]
MySQL Verification Team
Thank you for the bug report. Below the general query log when QB updates 3 columns in the same row: 070131 14:04:40 1 Query UPDATE `xtest`.`xtab` SET `col1`='aa' WHERE `id`='1' 1 Query UPDATE `xtest`.`xtab` SET `col2`='bb' WHERE `id`='1' 1 Query UPDATE `xtest`.`xtab` SET `col3`='cc' WHERE `id`='1'
[2 Feb 2007 12:36]
Mike Lischke
I'm sorry but currently we cannot fix it. We don't have client side cursors so it is complicated to correctly update column values from a list of changes. Hence we have this split, with the result you see now. Btw, at the time this code was designed there were no triggers available, so we would need a major overhaul of that part and needed client side cursors. As long as we don't have, I'm afraid, we cannot fix this problem.
[5 Feb 2007 8:41]
Hartmut Grosser
Hallo Mike, I understand that implementing client side cursors would make a lot of work for this, but what about collecting the changed columns in an array and then assembling 1 SQL-statement for each changed row like this: update mytable set changed_column_1 = new_value_1, changed_column_2 = new_value_2, ... changed_column_n = new_value_n where primary_key = ...; This would result in one simple statement for each changed row without needing client side cursors.