Description:
mysqld selects an unexpected function.
How to repeat:
my.cnf:
lower_case_table_names = 0
mysql> set global log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.00 sec)
mysql> create database test;
Query OK, 1 row affected (0.00 sec)
mysql> create database TEST;
Query OK, 1 row affected (0.00 sec)
mysql> use test
Database changed
mysql> delimiter $$
mysql> create function foo() returns int begin return 10; end $$
Query OK, 0 rows affected (0.00 sec)
mysql> use TEST$$
Database changed
mysql> create function foo() returns int begin return 20; end $$
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter ;
mysql> select test.foo();
+------------+
| test.foo() |
+------------+
| 10 |
+------------+
1 row in set (0.00 sec)
### It is OK.
mysql> select TEST.foo();
+------------+
| TEST.foo() |
+------------+
| 10 |
+------------+
1 row in set (0.00 sec)
### 'foo' in schema 'TEST' should be executed and 20 is returned.
mysql> select Test.foo();
+------------+
| Test.foo() |
+------------+
| 10 |
+------------+
1 row in set (0.00 sec)
### There is no schema named 'Test', it should not run successfully ?