From 4a0e5e89c5fa729e71db15aa2379fef9b3475c38 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 26 Apr 2008 15:18:12 +0000 Subject: [PATCH] change querying of triggers in conformity with the example in MySQL manual --- libraries/database_interface.lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 9ca4ce7db..96467074d 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -1270,8 +1270,11 @@ function PMA_DBI_get_triggers($db, $table) { $result = array(); // available in INFORMATION_SCHEMA since MySQL 5.0.10 + // Note: in http://dev.mysql.com/doc/refman/5.0/en/faqs-triggers.html + // their example uses WHERE TRIGGER_SCHEMA='dbname' so let's use this + // instead of WHERE EVENT_OBJECT_SCHEMA='dbname' if (PMA_MYSQL_INT_VERSION >= 50010) { - $triggers = PMA_DBI_fetch_result("SELECT TRIGGER_SCHEMA, TRIGGER_NAME, EVENT_MANIPULATION, ACTION_TIMING, ACTION_STATEMENT, EVENT_OBJECT_SCHEMA, EVENT_OBJECT_TABLE FROM information_schema.TRIGGERS WHERE EVENT_OBJECT_SCHEMA= '" . PMA_sqlAddslashes($db,true) . "' and EVENT_OBJECT_TABLE = '" . PMA_sqlAddslashes($table, true) . "';"); + $triggers = PMA_DBI_fetch_result("SELECT TRIGGER_SCHEMA, TRIGGER_NAME, EVENT_MANIPULATION, ACTION_TIMING, ACTION_STATEMENT, EVENT_OBJECT_SCHEMA, EVENT_OBJECT_TABLE FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA= '" . PMA_sqlAddslashes($db,true) . "' and EVENT_OBJECT_TABLE = '" . PMA_sqlAddslashes($table, true) . "';"); if ($triggers) { $delimiter = '//';