List:Commits« Previous MessageNext Message »
From:kgeorge Date:November 1 2007 12:42pm
Subject:bk commit into 5.1 tree (gkodinov:1.2615) BUG#31866
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-11-01 14:42:14+02:00, gkodinov@stripped +3 -0
  Bug #31866: MySQL Server crashes on SHOW CREATE TRIGGER statement
  
  SHOW CREATE TRIGGER was not checking for detected errors 
  opening/reading the trigger file. 
  Fixed to return the already generated error.

  mysql-test/r/trigger.result@stripped, 2007-11-01 14:42:13+02:00, gkodinov@stripped +6 -0
    Bug #31866: test case

  mysql-test/t/trigger.test@stripped, 2007-11-01 14:42:13+02:00, gkodinov@stripped +12 -0
    Bug #31866: test case

  sql/sql_show.cc@stripped, 2007-11-01 14:42:13+02:00, gkodinov@stripped +3 -0
    Bug #31866: test for error and return it.

diff -Nrup a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
--- a/mysql-test/r/trigger.result	2007-07-19 18:40:42 +03:00
+++ b/mysql-test/r/trigger.result	2007-11-01 14:42:13 +02:00
@@ -1978,3 +1978,9 @@ a
 1
 drop table table_25411_a;
 drop table table_25411_b;
+DROP TRIGGER IF EXISTS trg;
+Warnings:
+Note	1360	Trigger does not exist
+SHOW CREATE TRIGGER trg;
+ERROR HY000: Trigger does not exist
+End of 5.1 tests.
diff -Nrup a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
--- a/mysql-test/t/trigger.test	2007-08-15 11:18:40 +03:00
+++ b/mysql-test/t/trigger.test	2007-11-01 14:42:13 +02:00
@@ -2246,3 +2246,15 @@ select * from table_25411_a;
 drop table table_25411_a;
 drop table table_25411_b;
 
+#
+# Bug #31866: MySQL Server crashes on SHOW CREATE TRIGGER statement
+#
+
+--disable-warnings
+DROP TRIGGER IF EXISTS trg;
+--enable-warnings
+
+--error ER_TRG_DOES_NOT_EXIST
+SHOW CREATE TRIGGER trg;
+
+--echo End of 5.1 tests.
diff -Nrup a/sql/sql_show.cc b/sql/sql_show.cc
--- a/sql/sql_show.cc	2007-10-23 11:20:49 +03:00
+++ b/sql/sql_show.cc	2007-11-01 14:42:13 +02:00
@@ -6862,6 +6862,9 @@ bool show_create_trigger(THD *thd, const
 {
   TABLE_LIST *lst= get_trigger_table(thd, trg_name);
 
+  if (!lst)
+    return TRUE;
+
   /*
     Open the table by name in order to load Table_triggers_list object.
 
Thread
bk commit into 5.1 tree (gkodinov:1.2615) BUG#31866kgeorge1 Nov