Bug #106273 `*` syntax incompatibility
Submitted: 25 Jan 2022 9:44 Modified: 25 Jan 2022 23:22
Reporter: lyp tennyson Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:8.0.27, 8.0.28, 5.7.37 OS:Linux
Assigned to: CPU Architecture:x86
Tags: regression

[25 Jan 2022 9:44] lyp tennyson
Description:
select alias.`*` from information_schema.innodb_trx alias where 1=0;

report error in the mysql-server

How to repeat:
## 8016 works well:

mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.18    |
+-----------+
1 row in set (0.00 sec)

mysql> select alias.`*` from information_schema.innodb_trx alias where 1=0;
Empty set (0.00 sec)

## but 8027 reports error:

mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.27    |
+-----------+
1 row in set (0.00 sec)

mysql> select alias.`*` from information_schema.innodb_trx alias where 1=0;
ERROR 1054 (42S22): Unknown column 'alias.*' in 'field list'
mysql>

Suggested fix:
Be consistent with previous versions.
[25 Jan 2022 11:04] MySQL Verification Team
Hello lyp tennyson,

Thank you for the report and test case.

regards,
Umesh
[25 Jan 2022 23:22] Roy Lyseng
Posted by developer:
 
This is not a bug.

An asterisk enclosed in back ticks names a column with name given by the asterisk.
Example:
  create table t(`*` int);
  insert into t values(1);
  select `*` from t;

Earlier versions of MySQL allowed `*` to be treated similarly as the wild card for column expansion (a simple asterisk character), which is incompatible with the SQL standard.