incubator-doris [Bug] When set ‘lower_case_table_names=1’ , the table alias cannot be capitalized

pu3pd22g  于 2022-04-22  发布在  Java
关注(0)|答案(3)|浏览(264)

Search before asking

  • I had searched in the issues and found no similar issues.

Version

Version : 0.15.1-rc09

What's Wrong?

Database changed
mysql> select * from TB1 a where A.apply_id='001' limit 10 \G;
Empty set (0.01 sec)

ERROR:
No query specified

mysql> select * from TB1 A where A.apply_id='001' limit 10 \G;
ERROR 1054 (42S22): errCode = 2, detailMessage = Unknown column 'apply_id' in 'a'
ERROR:
No query specified

mysql> show variables like '%low%' ;
+---------------------------------+---------+
| Variable_name | Value |
+---------------------------------+---------+
| allow_partition_column_nullable | true |
| lower_case_table_names | 1 |
| max_allowed_packet | 1048576 |
+---------------------------------+---------+
3 rows in set (0.01 sec)

mysql>

What You Expected?

When using SQL queries, I want table aliases to be capitalized

How to Reproduce?

  • No response*

Anything Else?

  • No response*

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

vybvopom

vybvopom1#

it must be configured at cluster initialization.

knsnq2tg

knsnq2tg2#

it happened in 0.15.1-rc09 and has been fixed in 1.0.0-preview and following version.

zvms9eto

zvms9eto3#

under version 0.15.9-rc09, it looks like:

mysql> select * from part A where A.p_name = "rose moccasin";
ERROR 1054 (42S22): errCode = 2, detailMessage = Unknown column 'p_partkey' in 'a'
mysql> select * from part A where a.p_name = "rose moccasin";
ERROR 1054 (42S22): errCode = 2, detailMessage = Unknown column 'p_partkey' in 'a'
mysql> select * from part a where a.p_name = "rose moccasin";
+-----------+---------------+--------+------------+-----------+------------+--------------------------+--------+-------------+
| p_partkey | p_name        | p_mfgr | p_category | p_brand   | p_color    | p_type                   | p_size | p_container |
+-----------+---------------+--------+------------+-----------+------------+--------------------------+--------+-------------+
|     94251 | rose moccasin | MFGR#1 | MFGR#15    | MFGR#1510 | forest     | LARGE POLISHED COPPER    |     22 | MED CAN     |
|    132258 | rose moccasin | MFGR#4 | MFGR#41    | MFGR#4123 | bisque     | SMALL BURNISHED NICKEL   |     46 | WRAP BAG    |

mysql> select * from part a where A.p_name = "rose moccasin";
+-----------+---------------+--------+------------+-----------+------------+--------------------------+--------+-------------+
| p_partkey | p_name        | p_mfgr | p_category | p_brand   | p_color    | p_type                   | p_size | p_container |
+-----------+---------------+--------+------------+-----------+------------+--------------------------+--------+-------------+
|      3187 | rose moccasin | MFGR#5 | MFGR#55    | MFGR#5529 | honeydew   | SMALL POLISHED NICKEL    |      1 | SM DRUM     |
|     10974 | rose moccasin | MFGR#1 | MFGR#12    | MFGR#1211 | steel      | LARGE POLISHED BRASS     |     29 | WRAP DRUM   |
|     55272 | rose moccasin | MFGR#3 | MFGR#33    | MFGR#3325 | seashell   | MEDIUM PLATED COPPER     |     32 | WRAP PKG    |

And in 1.0.0-preview

mysql> select * from part C where c.p_name = "turquoise sandy";
+-----------+-----------------+--------+------------+-----------+------------+---------------------------+--------+-------------+
| p_partkey | p_name          | p_mfgr | p_category | p_brand   | p_color    | p_type                    | p_size | p_container |
+-----------+-----------------+--------+------------+-----------+------------+---------------------------+--------+-------------+
|    233418 | turquoise sandy | MFGR#1 | MFGR#14    | MFGR#1418 | lace       | LARGE ANODIZED COPPER     |     29 | LG PACK     |

相关问题