Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on natural join with Subquery alias #266

Closed
FlyingMao opened this issue Sep 19, 2017 · 0 comments
Closed

Error on natural join with Subquery alias #266

FlyingMao opened this issue Sep 19, 2017 · 0 comments

Comments

@FlyingMao
Copy link

steps:

mysql> CREATE TABLE a_test(`id` int(10) unsigned NOT NULL,`t_id` int(10) unsigned NOT NULL DEFAULT '0',`name` char(120) NOT NULL DEFAULT '',`pad` int(11) NOT NULL,PRIMARY KEY (`id`),KEY `k_1` (`t_id`));
Query OK, 0 rows affected (0.16 sec)

mysql> CREATE TABLE a_order(`id` int(10) unsigned NOT NULL,`o_id` int(10) unsigned NOT NULL DEFAULT '0',`name` char(120) NOT NULL DEFAULT '',`pad` int(11) NOT NULL,PRIMARY KEY (`id`),KEY `k_1` (`o_id`));
Query OK, 0 rows affected (0.09 sec)

mysql> insert into a_test values(1,1,'test中id为1',1),(2,2,'test_2',2),(3,3,'test中id为3',4),(4,4,'$test$4',3),(5,5,'test...5',1),(6,6,'test6',6);
Query OK, 6 rows affected (0.02 sec)

mysql> insert into a_order values(1,1,'order中id为1',1),(2,2,'test_2',2),(3,3,'order中id为3',3),(4,4,'$order$4',4),(5,5,'order...5',1);
Query OK, 5 rows affected (0.01 sec)

mysql> select * from a_test a natural join (select * from a_order where pad>2) b ;
ERROR 1003 (HY000): Unknown column 'b.o_id' in 'field list'
@FlyingMao FlyingMao changed the title Natural join with Subquery alias error Error on natural join with Subquery alias Sep 22, 2017
@yanhuqing666 yanhuqing666 added this to the 2.17.09.0 milestone Sep 25, 2017
yanhuqing666 added a commit that referenced this issue Sep 25, 2017
yanhuqing666 added a commit that referenced this issue Sep 29, 2017
yanhuqing666 added a commit that referenced this issue Oct 25, 2017
yanhuqing666 added a commit that referenced this issue Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants