Skip to content

Error when the global table is joined with the non-split table and the two tables have a shared node #848

@FlyingMao

Description

@FlyingMao
  • dble version:
    5.6.29-dble-9.9.9.9-7b0e6ca-20181120123509
  • preconditions :
    no
  • configs:

schema.xml

<!DOCTYPE dble:schema SYSTEM "schema.dtd">
<dble:schema xmlns:dble="http://dble.cloud/">
    <schema name="mytest" sqlMaxLimit="100" dataNode="dn1">
        <table name="test_global" dataNode="dn1,dn2,dn3,dn4" type="global"/>
    </schema>
    <schema name="test" sqlMaxLimit="100" dataNode="dn1">
        <table name="test_db1" dataNode="dn1,dn2,dn3,dn4" rule="mod-long" primaryKey="id"/>
        <table name="test_db2" dataNode="dn1,dn2,dn3,dn4" rule="mod-long" primaryKey="id"/>
    </schema>
    <dataNode name="dn1" dataHost="10.186.24.45" database="db1"/>
    <dataNode name="dn2" dataHost="10.186.24.46" database="db1"/>
    <dataNode name="dn3" dataHost="10.186.24.45" database="db2"/>
    <dataNode name="dn4" dataHost="10.186.24.46" database="db2"/>
    <dataHost balance="0" maxCon="1000" minCon="10" name="10.186.24.45" switchType="2" slaveThreshold="100">
        <heartbeat>show slave status</heartbeat>
        <writeHost host="hostM1" url="10.186.24.45:3306" password="test" user="test">
        </writeHost>
    </dataHost>
    <dataHost balance="0" maxCon="1000" minCon="10" name="10.186.24.46" switchType="2" slaveThreshold="100">
        <heartbeat>show slave status</heartbeat>
        <writeHost host="hostW1" url="10.186.24.46:3306" password="test" user="test"/>
    </dataHost>
</dble:schema>

rule.xml

<!DOCTYPE dble:rule SYSTEM "rule.dtd">
<dble:rule xmlns:dble="http://dble.cloud/">
    <tableRule name="mod-long">
        <rule>
            <columns>id</columns>
            <algorithm>sharding</algorithm>
        </rule>
    </tableRule>
    <tableRule name="orderID">
        <rule>
            <columns>id</columns>
            <algorithm>sharding</algorithm>
        </rule>
    </tableRule>
    <tableRule name="hash-two">
        <rule>
            <columns>id</columns>
            <algorithm>two-long</algorithm>
        </rule>
    </tableRule>
    <tableRule name="hash-three">
        <rule>
            <columns>id</columns>
            <algorithm>three-long</algorithm>
        </rule>
    </tableRule>
    <function name="sharding" class="Hash">
        <property name="partitionCount">4</property>
        <property name="partitionLength">1</property>
    </function>
    <function name="two-long" class="Hash">
        <property name="partitionCount">2</property>
        <property name="partitionLength">1</property>
    </function>
    <function name="three-long" class="Hash">
        <property name="partitionCount">3</property>
        <property name="partitionLength">1</property>
    </function>
</dble:rule>

server.xml

<!DOCTYPE dble:server SYSTEM "server.dtd">
<dble:server xmlns:dble="http://dble.cloud/">
    <system>
        <property name="useGlobleTableCheck">1</property>
        <property name="dataNodeHeartbeatPeriod">60000</property>
        <property name="sqlExecuteTimeout">1000</property>
        <property name="recordTxn">1</property>
        <property name="xaRecoveryLogBaseDir">/opt/dble/tmlogs/</property>
        <property name="xaRecoveryLogBaseName">xalog</property>
        <property name="xaSessionCheckPeriod">2000</property>
        <property name="xaLogCleanPeriod">100000</property>
        <property name="processors">1</property>
        <property name="processorExecutor">4</property>
        <property name="sequnceHandlerType">2</property>
    </system>
    <firewall/>
    <user name="test">
        <property name="password">test</property>
        <property name="schemas">mytest,test</property>
         <property name="maxCon">0</property>
    </user>
    <user name="root">
        <property name="password">123456</property>
        <property name="manager">true</property>
    </user>
</dble:server>

  • steps:
    step1. prepare number in dble:
drop table if exists test_global;
drop table if exists test_no_shard;
create table test_global(id int,name varchar(33));
create table test_no_shard(id int,name varchar(33));
insert into test_global set id = 1;
insert into test_no_shard set id = 1;

step2. execute select in dble

select a.id from test_global a,test_no_shard b where a.id = b.id;
  • expect result:
    1.
mysql> select a.id from test_global a,test_no_shard b where a.id = b.id;
+------+
| id   |
+------+
|    1 |
+------+
1 row in set (0.00 sec)
  • real result:
    1.
mysql> select a.id from test_global a,test_no_shard b where a.id = b.id;
ERROR 4005 (HY000): join node mergebuild exception! Error:can not execute empty rrss!
  • supplements:
    1.

/label ~BUG

Metadata

Metadata

Assignees

Labels

from auto_testresolveproblem 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