summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPraveenkumar Hulakund <praveenkumar.hulakund@oracle.com>2012-03-28 12:05:31 +0530
committerPraveenkumar Hulakund <praveenkumar.hulakund@oracle.com>2012-03-28 12:05:31 +0530
commit19c375c94c26b76d486c7755ada2dc748111f805 (patch)
tree620ef3d2b4e401a2edb2d9573a916f8ed05dfb47
parent899e600b179e9395d615c2db0b6c9cbab05a1096 (diff)
downloadmariadb-git-19c375c94c26b76d486c7755ada2dc748111f805.tar.gz
Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
Analysis: ------------------------------- According to the Manual (http://dev.mysql.com/doc/refman/5.1/en/identifier-case-sensitivity.html): "Column, index, stored routine, and event names are not case sensitive on any platform, nor are column aliases." In other words, 'lower_case_table_names' does not affect the behaviour of those identifiers. On the other hand, trigger names are case sensitive on some platforms, and case insensitive on others. 'lower_case_table_names' does not affect the behaviour of trigger names either. The bug was that SHOW statements did case sensitive comparison for stored procedure / stored function / event names. Fix: Modified the code so that comparison in case insensitive for routines and events for "SHOW" operation. As part of this commit, only fixing the test failures due to the actual code fix.
-rw-r--r--mysql-test/r/sp-bugs.result27
-rw-r--r--mysql-test/r/sp-code.result29
-rw-r--r--mysql-test/r/sp_notembedded.result20
-rw-r--r--mysql-test/t/sp-bugs.test21
-rw-r--r--mysql-test/t/sp-code.test32
-rw-r--r--mysql-test/t/sp_notembedded.test23
6 files changed, 104 insertions, 48 deletions
diff --git a/mysql-test/r/sp-bugs.result b/mysql-test/r/sp-bugs.result
index d003fc9798a..eef51385fb1 100644
--- a/mysql-test/r/sp-bugs.result
+++ b/mysql-test/r/sp-bugs.result
@@ -145,8 +145,6 @@ BEGIN
SELECT "PROCEDURE testp_bug11763507";
END
$
-CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
-DO SELECT 1 $
SELECT testf_bug11763507();
testf_bug11763507()
0
@@ -177,12 +175,6 @@ testf_bug11763507 CREATE DEFINER=`root`@`localhost` FUNCTION `testf_bug11763507
BEGIN
RETURN 0;
END latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW FUNCTION CODE testf_bug11763507;
-Pos Instruction
-0 freturn 3 0
-SHOW FUNCTION CODE TESTF_bug11763507;
-Pos Instruction
-0 freturn 3 0
CALL testp_bug11763507();
PROCEDURE testp_bug11763507
PROCEDURE testp_bug11763507
@@ -213,24 +205,6 @@ testp_bug11763507 CREATE DEFINER=`root`@`localhost` PROCEDURE `testp_bug1176350
BEGIN
SELECT "PROCEDURE testp_bug11763507";
END latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE CODE testp_bug11763507;
-Pos Instruction
-0 stmt 0 "SELECT "PROCEDURE testp_bug11763507""
-SHOW PROCEDURE CODE TESTP_bug11763507;
-Pos Instruction
-0 stmt 0 "SELECT "PROCEDURE testp_bug11763507""
-SHOW EVENTS LIKE 'teste_bug11763507';
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
-test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW EVENTS LIKE 'TESTE_bug11763507';
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
-test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW CREATE EVENT teste_bug11763507;
-Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW CREATE EVENT TESTE_bug11763507;
-Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'testf_bug11763507';
specific_name
testf_bug11763507
@@ -243,7 +217,6 @@ testf_bug11763507
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='TESTF_bug11763507';
specific_name
testf_bug11763507
-DROP EVENT teste_bug11763507;
DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507;
#END OF BUG#11763507 test.
diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result
index 39770dc4f2a..bb30cf5bb49 100644
--- a/mysql-test/r/sp-code.result
+++ b/mysql-test/r/sp-code.result
@@ -888,3 +888,32 @@ Pos Instruction
4 jump 6
5 error 1339
DROP PROCEDURE p1;
+#
+# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
+#
+SET @@SQL_MODE = '';
+CREATE FUNCTION testf_bug11763507() RETURNS INT
+BEGIN
+RETURN 0;
+END
+$
+CREATE PROCEDURE testp_bug11763507()
+BEGIN
+SELECT "PROCEDURE testp_bug11763507";
+END
+$
+SHOW FUNCTION CODE testf_bug11763507;
+Pos Instruction
+0 freturn 3 0
+SHOW FUNCTION CODE TESTF_bug11763507;
+Pos Instruction
+0 freturn 3 0
+SHOW PROCEDURE CODE testp_bug11763507;
+Pos Instruction
+0 stmt 0 "SELECT "PROCEDURE testp_bug11763507""
+SHOW PROCEDURE CODE TESTP_bug11763507;
+Pos Instruction
+0 stmt 0 "SELECT "PROCEDURE testp_bug11763507""
+DROP PROCEDURE testp_bug11763507;
+DROP FUNCTION testf_bug11763507;
+#END OF BUG#11763507 test.
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 7e9ccf01d23..0e74677db02 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -279,6 +279,26 @@ ERROR 70100: Query execution was interrupted
DROP VIEW v1;
DROP TABLE t1;
DROP FUNCTION f1;
+#
+# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
+#
+SET @@SQL_MODE = '';
+CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
+DO SELECT 1 $
+SHOW EVENTS LIKE 'teste_bug11763507';
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW EVENTS LIKE 'TESTE_bug11763507';
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE EVENT teste_bug11763507;
+Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
+teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE EVENT TESTE_bug11763507;
+Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
+teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
+DROP EVENT teste_bug11763507;
+#END OF BUG#11763507 test.
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
diff --git a/mysql-test/t/sp-bugs.test b/mysql-test/t/sp-bugs.test
index 88b12b0ec61..3ab1689e8b2 100644
--- a/mysql-test/t/sp-bugs.test
+++ b/mysql-test/t/sp-bugs.test
@@ -183,9 +183,6 @@ BEGIN
END
$
-CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
-DO SELECT 1 $
-
DELIMITER ;$
# STORED FUNCTIONS
@@ -204,9 +201,6 @@ SHOW FUNCTION STATUS WHERE NAME='TESTF_bug11763507';
SHOW CREATE FUNCTION testf_bug11763507;
SHOW CREATE FUNCTION TESTF_bug11763507;
-SHOW FUNCTION CODE testf_bug11763507;
-SHOW FUNCTION CODE TESTF_bug11763507;
-
# STORED PROCEDURE
CALL testp_bug11763507();
CALL TESTP_bug11763507();
@@ -223,20 +217,6 @@ SHOW PROCEDURE STATUS WHERE NAME='TESTP_bug11763507';
SHOW CREATE PROCEDURE testp_bug11763507;
SHOW CREATE PROCEDURE TESTP_bug11763507;
-SHOW PROCEDURE CODE testp_bug11763507;
-SHOW PROCEDURE CODE TESTP_bug11763507;
-
-# EVENTS
---replace_column 6 # 7 # 8 # 9 #
-SHOW EVENTS LIKE 'teste_bug11763507';
---replace_column 6 # 7 # 8 # 9 #
-SHOW EVENTS LIKE 'TESTE_bug11763507';
-
---replace_column 4 #
-SHOW CREATE EVENT teste_bug11763507;
---replace_column 4 #
-SHOW CREATE EVENT TESTE_bug11763507;
-
# INFORMATION SCHEMA
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'testf_bug11763507';
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'TESTF_bug11763507';
@@ -244,7 +224,6 @@ SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE '
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='testf_bug11763507';
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='TESTF_bug11763507';
-DROP EVENT teste_bug11763507;
DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507;
diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test
index 247c84fda39..c7bca4865b7 100644
--- a/mysql-test/t/sp-code.test
+++ b/mysql-test/t/sp-code.test
@@ -649,3 +649,35 @@ END//
DELIMITER ;//
SHOW PROCEDURE CODE p1;
DROP PROCEDURE p1;
+
+--echo #
+--echo # Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
+--echo #
+SET @@SQL_MODE = '';
+DELIMITER $;
+CREATE FUNCTION testf_bug11763507() RETURNS INT
+BEGIN
+ RETURN 0;
+END
+$
+
+CREATE PROCEDURE testp_bug11763507()
+BEGIN
+ SELECT "PROCEDURE testp_bug11763507";
+END
+$
+
+DELIMITER ;$
+
+# STORED FUNCTIONS
+SHOW FUNCTION CODE testf_bug11763507;
+SHOW FUNCTION CODE TESTF_bug11763507;
+
+# STORED PROCEDURE
+SHOW PROCEDURE CODE testp_bug11763507;
+SHOW PROCEDURE CODE TESTP_bug11763507;
+
+DROP PROCEDURE testp_bug11763507;
+DROP FUNCTION testf_bug11763507;
+
+--echo #END OF BUG#11763507 test.
diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test
index 326cc22f1cd..396c9791c34 100644
--- a/mysql-test/t/sp_notembedded.test
+++ b/mysql-test/t/sp_notembedded.test
@@ -449,6 +449,29 @@ DROP FUNCTION f1;
--disconnect con1
--disconnect con2
+--echo #
+--echo # Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
+--echo #
+SET @@SQL_MODE = '';
+DELIMITER $;
+
+CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
+DO SELECT 1 $
+
+DELIMITER ;$
+# EVENTS
+--replace_column 6 # 7 # 8 # 9 #
+SHOW EVENTS LIKE 'teste_bug11763507';
+--replace_column 6 # 7 # 8 # 9 #
+SHOW EVENTS LIKE 'TESTE_bug11763507';
+
+--replace_column 4 #
+SHOW CREATE EVENT teste_bug11763507;
+--replace_column 4 #
+SHOW CREATE EVENT TESTE_bug11763507;
+
+DROP EVENT teste_bug11763507;
+--echo #END OF BUG#11763507 test.
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests