summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB/Schema
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-08-01 07:14:43 +0200
committermkanat%bugzilla.org <>2008-08-01 07:14:43 +0200
commitd165b7785df760352ce17d3677691c5be0b3b6c4 (patch)
treeffcb0a48a48d77648668e5088e83e0d59076cb2c /Bugzilla/DB/Schema
parent8cf4ef03913d7866655f40eab3dff80f1559ac5b (diff)
downloadbugzilla-d165b7785df760352ce17d3677691c5be0b3b6c4.tar.gz
bugzilla-d165b7785df760352ce17d3677691c5be0b3b6c4.tar.xz
Bug 448241: [Oracle] Foreign keys: UPDATE CASCADE trigger updates wrong tables and fields
Patch By Xiaoou Wu <xiaoou.wu@oracle.com> r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/DB/Schema')
-rw-r--r--Bugzilla/DB/Schema/Oracle.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/Bugzilla/DB/Schema/Oracle.pm b/Bugzilla/DB/Schema/Oracle.pm
index 05c2bbeb3..ba3870a76 100644
--- a/Bugzilla/DB/Schema/Oracle.pm
+++ b/Bugzilla/DB/Schema/Oracle.pm
@@ -153,15 +153,15 @@ sub get_fk_ddl {
if ( $update =~ /CASCADE/i ){
my $tr_str = "CREATE OR REPLACE TRIGGER ${fk_name}_UC"
- . " AFTER UPDATE ON ". $table
+ . " AFTER UPDATE ON ". $to_table
. " REFERENCING "
. " NEW AS NEW "
. " OLD AS OLD "
. " FOR EACH ROW "
. " BEGIN "
- . " UPDATE $to_table"
- . " SET $to_column = :NEW.$column"
- . " WHERE $to_column = :OLD.$column;"
+ . " UPDATE $table"
+ . " SET $column = :NEW.$to_column"
+ . " WHERE $column = :OLD.$to_column;"
. " END ${fk_name}_UC;";
my $dbh = Bugzilla->dbh;
$dbh->do($tr_str);