You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first execution returns the column name specified in the SQL statement.
When I execute the same SQL statement again, the alias in the SQL statement will be ignored in the subsequent return results.
TiDB [email protected]:case5> SELECT `User`.`id` AS `User_id`, `User`.`personId` AS `User_personId`, `User`.`name` AS `User_name` FROM `user` `User` WHERE (((`User`.`id` = 1 AND `User`.`personId` = 1)))
+---------+---------------+-----------+
| User_id | User_personId | User_name |
+---------+---------------+-----------+
+---------+---------------+-----------+
0 rows in set
Time: 0.007s
TiDB [email protected]:case5> SELECT `User`.`id` AS `User_id`, `User`.`personId` AS `User_personId`, `User`.`name` AS `User_name` FROM `user` `User` WHERE (((`User`.`id` = 1 AND `User`.`personId` = 1)))
+----+----------+------+
| id | personId | name |
+----+----------+------+
+----+----------+------+
0 rows in set
Time: 0.006s
The problem is related to the non-prepared plan cache. The nightly version will also meet the problem if we turn on it.
winoros
changed the title
The alias name of the column will be ignored when execute again
The output alias name is wrong when non-prepared plan cache is enabled
Sep 20, 2023
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
DDL:
The first execution returns the column name specified in the SQL statement.
When I execute the same SQL statement again, the alias in the SQL statement will be ignored in the subsequent return results.
2. What did you expect to see? (Required)
Query returns the specified alias based on SQL.
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: