From 63927cfdb88d5275413f04cde4824a5cea9c6851 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 16 Apr 2015 14:15:37 +0800 Subject: [PATCH] UpdateDatabase/MysqlLinks.php --- UpdateDatabase/MysqlLinks.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UpdateDatabase/MysqlLinks.php b/UpdateDatabase/MysqlLinks.php index 91c27385..e2059311 100644 --- a/UpdateDatabase/MysqlLinks.php +++ b/UpdateDatabase/MysqlLinks.php @@ -192,7 +192,7 @@ 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}; + SELECT count(*) into mid FROM {$source_table} WHERE {$source_col} = OLD.{$target_col} LIMIT 1; IF mid > 0 THEN UPDATE `$err` SET x = 1; @@ -261,7 +261,7 @@ class Pman_Core_UpdateDatabase_MysqlLinks { $trigger .=" SET mid = 0; if NEW.{$source_col} > 0 THEN - SELECT {$target_col} into mid FROM {$target_table} WHERE {$target_col} = NEW.{$source_col}; + SELECT {$target_col} into mid FROM {$target_table} WHERE {$target_col} = NEW.{$source_col} LIMIT 1; IF mid < 1 THEN UPDATE `$err` SET x = 1; END IF; @@ -335,7 +335,7 @@ class Pman_Core_UpdateDatabase_MysqlLinks { $trigger .=" SET mid = 0; if NEW.{$source_col} > 0 THEN - SELECT {$target_col} into mid FROM {$target_table} WHERE {$target_col} = NEW.{$source_col}; + SELECT {$target_col} into mid FROM {$target_table} WHERE {$target_col} = NEW.{$source_col} LIMIT 1; IF mid < 1 THEN UPDATE `$err` SET x = 1; END IF; -- 2.39.2