Skip to content

throw syntax error when * is combined with named columns in select clause #9519

Closed
dolthub/go-mysql-server
#3104
@angelamayxie

Description

@angelamayxie

found when trying to repro #9516

dolt

child/main*> select * from (select 'parent' as db, * from parent.t union select 'child' as db, * from child.t) as combined;
+--------+----+-------+
| db     | id | words |
+--------+----+-------+
| parent | 1  | foo   |
| parent | 2  | bar   |
| parent | 3  | baz   |
| parent | 4  | zap   |
| child  | 2  | bar   |
| child  | 3  | baz   |
| child  | 1  | foo   |
| child  | 4  | zap   |
+--------+----+-------+
8 rows in set (0.00 sec) 

mysql

mysql> select * from (select 'parent' as db, * from parent.t union select 'child' as db, * from child.t) as combined;
ERROR 1064 (42000): 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 '* from parent.t union select 'child' as db, * from child.t) as combined' at line 1

chatgpt explanation

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcorrectnessWe don't return the same result as MySQLsqlIssue with SQL

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions