Skip to content

without default database explain failed even referring database at table quote #813

@irene-coming

Description

@irene-coming

dble version:5.6.29-dble-9.9.9.9-08136d5-20181106070356
schema.xml

<schema name="testdb">
<table name="sharding_two_node" dataNode="dn1,dn2" rule="hash-two"/>
<table name="sharding_two_node2" dataNode="dn1,dn2" rule="hash-two"/>
</schema>

steps:
step1. login mysql without assign default db(don't use -Ddbname)
step2. execute D.1(or D.2):

mysql> explain select * from testdb.sharding_two_node a join testdb2.sharding_two_node2 b on a.id = b.id where a.id =1 and b.id=1;
ERROR 1046 (HY000): No database selected
mysql> show databases;
+----------+
| DATABASE |
+----------+
| testdb     |
| testdb2   |
+----------+
2 rows in set (0.00 sec)

expect:
step2 "explain ... " get success like:

+-----------+----------+-----------------------------------------------------------------------------------------------------+
| DATA_NODE | TYPE     | SQL/REF                                                                                             |
+-----------+----------+-----------------------------------------------------------------------------------------------------+
| dn1       | BASE SQL | select * from sharding_two_node a join sharding_two_node2 b on a.id = b.id where a.id =1 and b.id=1 |
+-----------+----------+-----------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

supplements:
issue context is same as (#752)

Metadata

Metadata

Assignees

Labels

Explainresolveproblem has been fixed by developerverifiedissue's resolve was verified by tester

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions