Skip to content

select ... information_schema.columns ...; exception when querying with alias #2147

@wenyh1

Description

@wenyh1
  • dble version:3.20.07.99
  • preconditions :
    no
  • configs:

cluster.cnf



bootstrap.cnf



db.xml



user.xml



sharding.xml



  • steps:
    step1. select column_name as column_name from information_schema.columns where table_schema = 'schema_xx' and table_name = 'table_xx';
  • expect result:
    1. success
  • real result:
    1. ERROR 1003 (HY000): occur Exception, so see dble.log to check reason
      See in the log that the issued sql is overappended with 'as column_name', excption message:
2020-09-24 05:48:04.074  INFO [complexQueryExecutor3] (com.actiontech.dble.sqlengine.SQLJob.errorResponse(SQLJob.java:129)) - 
error response errNo:1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL 
server version for the right syntax to use near 'as column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE 
table_schema = 'schema_xx' at line 1 from of sql :SELECT column_name AS `column_name` as column_name FROM 
INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'schema_xx'AND table_name = 'table_xx'
  • supplements:
    1.

Metadata

Metadata

Assignees

Labels

autotest-addedthe case has append to autotest

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions