Skip to content

Error when join syntax contains three different types of tables and the rightmost table is global table #351

@FlyingMao

Description

@FlyingMao

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`))DEFAULT CHARSET=UTF8;/*sharding table*/
Query OK, 0 rows affected (0.44 sec)

mysql> CREATE TABLE test_global(`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`))DEFAULT CHARSET=UTF8;/*global table*/
Query OK, 0 rows affected (1.00 sec)

mysql> CREATE TABLE a_manager(`id` int(10) unsigned NOT NULL,`m_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` (`m_id`))DEFAULT CHARSET=UTF8;/*sharding table*/
Query OK, 0 rows affected (2.89 sec)

mysql> select a.id,b.id,c.pad from a_manager a,a_test b,test_global c where a.id=b.id and a.id=c.pad;
ERROR 1003 (HY000): Every derived table must have its own alias

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions