change querying of triggers in conformity with the example in MySQL manual

This commit is contained in:
Marc Delisle
2008-04-26 15:18:12 +00:00
parent f0b01f6533
commit 4a0e5e89c5

View File

@@ -1270,8 +1270,11 @@ function PMA_DBI_get_triggers($db, $table) {
$result = array(); $result = array();
// available in INFORMATION_SCHEMA since MySQL 5.0.10 // 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) { 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) { if ($triggers) {
$delimiter = '//'; $delimiter = '//';