List:Commits« Previous MessageNext Message »
From:Marc Alff Date:August 7 2008 1:47pm
Subject:bzr commit into mysql-6.0-wl2110-review branch (marc.alff:2676) WL#2110
View as plain text  
#At file:///home/malff/BZR-TREE/mysql-6.0-wl2110-review-part10/

 2676 Marc Alff	2008-08-07
      WL#2110 (SIGNAL)
      
      Implemented code review comments from the review of patch 2/10
      
      Implemented changes to comply with the decisions documented on 2008-08-06 in
      the RESIGNAL work log (2265).
      (initialisation of condition items in RESIGNAL)
modified:
  mysql-test/r/signal.result
  mysql-test/r/signal_sqlmode.result
  mysql-test/t/signal.test

=== modified file 'mysql-test/r/signal.result'
--- a/mysql-test/r/signal.result	2008-07-23 00:30:04 +0000
+++ b/mysql-test/r/signal.result	2008-08-07 13:47:34 +0000
@@ -178,19 +178,19 @@ begin
 DECLARE foo CONDITION FOR SQLSTATE '12345';
 SIGNAL foo SET CLASS_ORIGIN = 'foo', CLASS_ORIGIN = 'bar';
 end $$
-ERROR 42000: Duplicate condition information item: CLASS_ORIGIN
+ERROR 42000: Duplicate condition information item 'CLASS_ORIGIN'
 create procedure test_invalid()
 begin
 DECLARE foo CONDITION FOR SQLSTATE '12345';
 SIGNAL foo SET MESSAGE_TEXT = 'foo', MESSAGE_TEXT = 'bar';
 end $$
-ERROR 42000: Duplicate condition information item: MESSAGE_TEXT
+ERROR 42000: Duplicate condition information item 'MESSAGE_TEXT'
 create procedure test_invalid()
 begin
 DECLARE foo CONDITION FOR SQLSTATE '12345';
 SIGNAL foo SET MYSQL_ERRNO = 'foo', MYSQL_ERRNO = 'bar';
 end $$
-ERROR 42000: Duplicate condition information item: MYSQL_ERRNO
+ERROR 42000: Duplicate condition information item 'MYSQL_ERRNO'
 create procedure test_signal_syntax()
 begin
 DECLARE foo CONDITION FOR SQLSTATE '12345';
@@ -502,19 +502,19 @@ begin
 DECLARE foo CONDITION FOR SQLSTATE '12345';
 RESIGNAL foo SET CLASS_ORIGIN = 'foo', CLASS_ORIGIN = 'bar';
 end $$
-ERROR 42000: Duplicate condition information item: CLASS_ORIGIN
+ERROR 42000: Duplicate condition information item 'CLASS_ORIGIN'
 create procedure test_invalid()
 begin
 DECLARE foo CONDITION FOR SQLSTATE '12345';
 RESIGNAL foo SET MESSAGE_TEXT = 'foo', MESSAGE_TEXT = 'bar';
 end $$
-ERROR 42000: Duplicate condition information item: MESSAGE_TEXT
+ERROR 42000: Duplicate condition information item 'MESSAGE_TEXT'
 create procedure test_invalid()
 begin
 DECLARE foo CONDITION FOR SQLSTATE '12345';
 RESIGNAL foo SET MYSQL_ERRNO = 'foo', MYSQL_ERRNO = 'bar';
 end $$
-ERROR 42000: Duplicate condition information item: MYSQL_ERRNO
+ERROR 42000: Duplicate condition information item 'MYSQL_ERRNO'
 create procedure test_resignal_syntax()
 begin
 DECLARE foo CONDITION FOR SQLSTATE '12345';
@@ -1103,17 +1103,17 @@ MYSQL_ERRNO = 10000;
 end $$
 call test_signal() $$
 Warnings:
-Warning	1731	Data truncated for condition item CLASS_ORIGIN
-Warning	1731	Data truncated for condition item SUBCLASS_ORIGIN
-Warning	1731	Data truncated for condition item CONSTRAINT_CATALOG
-Warning	1731	Data truncated for condition item CONSTRAINT_SCHEMA
-Warning	1731	Data truncated for condition item CONSTRAINT_NAME
-Warning	1731	Data truncated for condition item CATALOG_NAME
-Warning	1731	Data truncated for condition item SCHEMA_NAME
-Warning	1731	Data truncated for condition item TABLE_NAME
-Warning	1731	Data truncated for condition item COLUMN_NAME
-Warning	1731	Data truncated for condition item CURSOR_NAME
-Warning	1731	Data truncated for condition item MESSAGE_TEXT
+Warning	1731	Data truncated for condition item 'CLASS_ORIGIN'
+Warning	1731	Data truncated for condition item 'SUBCLASS_ORIGIN'
+Warning	1731	Data truncated for condition item 'CONSTRAINT_CATALOG'
+Warning	1731	Data truncated for condition item 'CONSTRAINT_SCHEMA'
+Warning	1731	Data truncated for condition item 'CONSTRAINT_NAME'
+Warning	1731	Data truncated for condition item 'CATALOG_NAME'
+Warning	1731	Data truncated for condition item 'SCHEMA_NAME'
+Warning	1731	Data truncated for condition item 'TABLE_NAME'
+Warning	1731	Data truncated for condition item 'COLUMN_NAME'
+Warning	1731	Data truncated for condition item 'CURSOR_NAME'
+Warning	1731	Data truncated for condition item 'MESSAGE_TEXT'
 Warning	10000	11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222288888888
 drop procedure test_signal $$
 create procedure test_signal()
@@ -2105,10 +2105,26 @@ ERROR 42000: Hi, I am a useless error me
 show warnings $$
 Level	Code	Message
 Error	1231	Variable 'sql_mode' can't be set to the value of 'NULL'
-Error	1231	Unhandled user-defined exception
-Error	9999	Unhandled user-defined exception
+Error	1231	Variable 'sql_mode' can't be set to the value of 'NULL'
+Error	9999	Variable 'sql_mode' can't be set to the value of 'NULL'
 Error	9999	Hi, I am a useless error message
 drop procedure peter_p1 $$
 drop procedure peter_p2 $$
+drop procedure if exists peter_p3 $$
+Warnings:
+Note	1305	PROCEDURE test.peter_p3 does not exist
+create procedure peter_p3()
+begin
+declare continue handler for sqlexception
+resignal sqlstate '99002' set mysql_errno = 2;
+signal sqlstate '99001' set mysql_errno = 1, message_text = "Original";
+end $$
+call peter_p3() $$
+ERROR 99002: Original
+show warnings $$
+Level	Code	Message
+Error	1	Original
+Error	2	Original
+drop procedure peter_p3 $$
 drop table t_warn;
 drop table t_cursor;

=== modified file 'mysql-test/r/signal_sqlmode.result'
--- a/mysql-test/r/signal_sqlmode.result	2008-07-23 00:30:04 +0000
+++ b/mysql-test/r/signal_sqlmode.result	2008-08-07 13:47:34 +0000
@@ -75,11 +75,11 @@ ERROR 22001: Data too long for column 'u
 call p2;
 length(msg)	msg
 129	AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
-ERROR HY000: Data too long for condition item MESSAGE_TEXT
+ERROR HY000: Data too long for condition item 'MESSAGE_TEXT'
 call p3;
 length(name)	name
 65	AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
-ERROR HY000: Data too long for condition item TABLE_NAME
+ERROR HY000: Data too long for condition item 'TABLE_NAME'
 drop procedure p;
 drop procedure p2;
 drop procedure p3;

=== modified file 'mysql-test/t/signal.test'
--- a/mysql-test/t/signal.test	2008-07-23 00:30:04 +0000
+++ b/mysql-test/t/signal.test	2008-08-07 13:47:34 +0000
@@ -2478,6 +2478,29 @@ show warnings $$
 drop procedure peter_p1 $$
 drop procedure peter_p2 $$
 
+#
+# Test the value of MESSAGE_TEXT in RESIGNAL when no SET MESSAGE_TEXT clause
+# is provided (the expected result is the text from the SIGNALed condition)
+#
+
+drop procedure if exists peter_p3 $$
+
+create procedure peter_p3()
+begin
+  declare continue handler for sqlexception
+    resignal sqlstate '99002' set mysql_errno = 2;
+
+  signal sqlstate '99001' set mysql_errno = 1, message_text = "Original";
+end $$
+
+--error 2
+call peter_p3() $$
+
+# Expecting 2 conditions, both with the text "Original"
+show warnings $$
+
+drop procedure peter_p3 $$
+
 delimiter ;$$
 
 drop table t_warn;

Thread
bzr commit into mysql-6.0-wl2110-review branch (marc.alff:2676) WL#2110Marc Alff7 Aug