Bug #102825 mysqld selects an unexpected function

Submitted: 5 Mar 2021 11:34 Modified: 6 Mar 2021 11:43
Reporter: lyp tennyson Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:8.0.23, 5.7.23 OS:Any
Assigned to: CPU Architecture:Any

[5 Mar 2021 11:34] lyp tennyson
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 ?
[6 Mar 2021 11:43] MySQL Verification Team
Hello lyp tennyson,

Thank you for the report and test case.
Verified as described.

regards,
Umesh

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.