projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78b95bc
)
UpdateDatabase/MysqlLinks.php
author
Alan Knowles
<alan@roojs.com>
Tue, 21 Apr 2015 08:55:39 +0000
(16:55 +0800)
committer
Alan Knowles
<alan@roojs.com>
Tue, 21 Apr 2015 08:55:39 +0000
(16:55 +0800)
UpdateDatabase/MysqlLinks.php
patch
|
blob
|
history
diff --git
a/UpdateDatabase/MysqlLinks.php
b/UpdateDatabase/MysqlLinks.php
index
865f182
..
f8513d0
100644
(file)
--- a/
UpdateDatabase/MysqlLinks.php
+++ b/
UpdateDatabase/MysqlLinks.php
@@
-195,9
+195,11
@@
class Pman_Core_UpdateDatabase_MysqlLinks {
$err = substr("Failed Delete {$target_table} refs {$source_table}:{$source_col}", 0, 64);
$trigger .="
SET mid = 0;
- SELECT count(*) into mid FROM {$source_table} WHERE {$source_col} = OLD.{$target_col} LIMIT 1;
- IF mid > 0 THEN
- UPDATE `$err` SET x = 1;
+ IF OLD.id > 0 THEN
+ SELECT count(*) into mid FROM {$source_table} WHERE {$source_col} = OLD.{$target_col} LIMIT 1;
+ IF mid > 0 THEN
+ UPDATE `$err` SET x = 1;
+ END IF;
END IF;
";
}