pingcap/tidb

different error message for union with MySQL

Open

#8,237 opened on Nov 8, 2018

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Go (6,186 forks)batch import
help wantedpriority/P4sig/executionsig/plannertype/compatibility

Repository metrics

Stars
 (40,090 stars)
PR merge metrics
 (Avg merge 14d 4h) (346 merged PRs in 30d)

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
select * union select 1;

create table t1 (a int);
insert into t1 values (1),(2),(3);
create table t2 (a int);
insert into t2 values (3),(4),(5);
select a from t1 union select a from t2 order by t2.a;
  1. What did you expect to see?
mysql> select * union select 1;
ERROR 1096 (HY000): No tables used
mysql> select a from t1 union select a from t2 order by t2.a;
ERROR 1250 (42000): Table 't2' from one of the SELECTs cannot be used in field list
  1. What did you see instead?
tidb> select * union select 1;
ERROR 1051 (42S02): Unknown table ''
tidb> select a from t1 union select a from t2 order by t2.a;
ERROR 1054 (42S22): Unknown column 't2.a' in 'order clause'
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
tidb> select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                                     |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.0-rc.3-158-g1082d5f1a
Git Commit Hash: 1082d5f1ac90c7d73b34061ccef7c5cae1b69b6c
Git Branch: master
UTC Build Time: 2018-11-08 07:01:33
GoVersion: go version go1.11 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Contributor guide