Commit f3d5127f authored by Praveenkumar Hulakund's avatar Praveenkumar Hulakund

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.
parent 83a5a20d
...@@ -145,8 +145,6 @@ BEGIN ...@@ -145,8 +145,6 @@ BEGIN
SELECT "PROCEDURE testp_bug11763507"; SELECT "PROCEDURE testp_bug11763507";
END END
$ $
CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO SELECT 1 $
SELECT testf_bug11763507(); SELECT testf_bug11763507();
testf_bug11763507() testf_bug11763507()
0 0
...@@ -177,12 +175,6 @@ testf_bug11763507 CREATE DEFINER=`root`@`localhost` FUNCTION `testf_bug11763507 ...@@ -177,12 +175,6 @@ testf_bug11763507 CREATE DEFINER=`root`@`localhost` FUNCTION `testf_bug11763507
BEGIN BEGIN
RETURN 0; RETURN 0;
END latin1 latin1_swedish_ci latin1_swedish_ci 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(); CALL testp_bug11763507();
PROCEDURE testp_bug11763507 PROCEDURE testp_bug11763507
PROCEDURE testp_bug11763507 PROCEDURE testp_bug11763507
...@@ -213,24 +205,6 @@ testp_bug11763507 CREATE DEFINER=`root`@`localhost` PROCEDURE `testp_bug1176350 ...@@ -213,24 +205,6 @@ testp_bug11763507 CREATE DEFINER=`root`@`localhost` PROCEDURE `testp_bug1176350
BEGIN BEGIN
SELECT "PROCEDURE testp_bug11763507"; SELECT "PROCEDURE testp_bug11763507";
END latin1 latin1_swedish_ci latin1_swedish_ci 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'; SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'testf_bug11763507';
specific_name specific_name
testf_bug11763507 testf_bug11763507
...@@ -243,7 +217,6 @@ testf_bug11763507 ...@@ -243,7 +217,6 @@ testf_bug11763507
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='TESTF_bug11763507'; SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='TESTF_bug11763507';
specific_name specific_name
testf_bug11763507 testf_bug11763507
DROP EVENT teste_bug11763507;
DROP PROCEDURE testp_bug11763507; DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507; DROP FUNCTION testf_bug11763507;
#END OF BUG#11763507 test. #END OF BUG#11763507 test.
...@@ -888,3 +888,32 @@ Pos Instruction ...@@ -888,3 +888,32 @@ Pos Instruction
4 jump 6 4 jump 6
5 error 1339 5 error 1339
DROP PROCEDURE p1; 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.
...@@ -279,6 +279,26 @@ ERROR 70100: Query execution was interrupted ...@@ -279,6 +279,26 @@ ERROR 70100: Query execution was interrupted
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
DROP FUNCTION f1; 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 # -- End of 5.1 tests
# ------------------------------------------------------------------ # ------------------------------------------------------------------
...@@ -183,9 +183,6 @@ BEGIN ...@@ -183,9 +183,6 @@ BEGIN
END END
$ $
CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO SELECT 1 $
DELIMITER ;$ DELIMITER ;$
# STORED FUNCTIONS # STORED FUNCTIONS
...@@ -204,9 +201,6 @@ SHOW FUNCTION STATUS WHERE NAME='TESTF_bug11763507'; ...@@ -204,9 +201,6 @@ SHOW FUNCTION STATUS WHERE NAME='TESTF_bug11763507';
SHOW CREATE FUNCTION testf_bug11763507; SHOW CREATE FUNCTION testf_bug11763507;
SHOW CREATE FUNCTION TESTF_bug11763507; SHOW CREATE FUNCTION TESTF_bug11763507;
SHOW FUNCTION CODE testf_bug11763507;
SHOW FUNCTION CODE TESTF_bug11763507;
# STORED PROCEDURE # STORED PROCEDURE
CALL testp_bug11763507(); CALL testp_bug11763507();
CALL TESTP_bug11763507(); CALL TESTP_bug11763507();
...@@ -223,20 +217,6 @@ SHOW PROCEDURE STATUS WHERE NAME='TESTP_bug11763507'; ...@@ -223,20 +217,6 @@ SHOW PROCEDURE STATUS WHERE NAME='TESTP_bug11763507';
SHOW CREATE PROCEDURE testp_bug11763507; SHOW CREATE PROCEDURE 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 # 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';
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 ' ...@@ -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';
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 PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507; DROP FUNCTION testf_bug11763507;
......
...@@ -649,3 +649,35 @@ END// ...@@ -649,3 +649,35 @@ END//
DELIMITER ;// DELIMITER ;//
SHOW PROCEDURE CODE p1; SHOW PROCEDURE CODE p1;
DROP PROCEDURE 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.
...@@ -449,6 +449,29 @@ DROP FUNCTION f1; ...@@ -449,6 +449,29 @@ DROP FUNCTION f1;
--disconnect con1 --disconnect con1
--disconnect con2 --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 # ------------------------------------------------------------------
--echo # -- End of 5.1 tests --echo # -- End of 5.1 tests
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment