Skip to content

hint sql error with multiple nodes #670

@yexiaoli88

Description

@yexiaoli88

**dble version:version: 5.6.29-dble-9.9.9.9-84bb96d-20180824025838 **

schema.xml

<table name="test" dataNode="dn1,dn2,dn3,dn4" rule="sharding-by-mod" />

rule.xml


 <tableRule name="sharding-by-mod">
        <rule>
            <columns>id</columns>
            <algorithm>hashmod</algorithm>
        </rule>
    </tableRule>
<function name="hashmod" class="Hash">
        <property name="partitionCount">4</property>
        <property name="partitionLength">1</property>
    </function>

  • steps:
1. MySQL [testdb]> /*!dble:datanode=dn1,dn2*/ select * from test;
+------+------+
| id   | name |
+------+------+
|   20 | dn1  |
|   50 | dn1  |
|    2 | dn1  |
+------+------+
3 rows in set (0.00 sec)

2. MySQL [testdb]> /*!dble:datanode=dn2,dn1*/ select * from test;
+------+-------+
| id   | name  |
+------+-------+
|    1 | test1 |
|    5 | test5 |
+------+-------+
2 rows in set (0.00 sec)

3. MySQL [testdb]> /*!dble:datanode=dn1*/ select * from test;
+------+------+
| id   | name |
+------+------+
|   20 | dn1  |
|   50 | dn1  |
|    2 | dn1  |
+------+------+
3 rows in set (0.01 sec)

4. MySQL [testdb]> /*!dble:datanode=dn2*/ select * from test;
+------+-------+
| id   | name  |
+------+-------+
|    1 | test1 |
|    5 | test5 |
+------+-------+
2 rows in set (0.00 sec)

5.MySQL [testdb]> select * from test;
+------+--------+
| id   | name   |
+------+--------+
|    1 | test1  |
|    5 | test5  |
|    3 | test3  |
|   20 | dn1    |
|   50 | dn1    |
|    2 | dn1    |
|    2 | test2  |
|   34 | test34 |
|   30 | test30 |
+------+--------+


  • expect result:
    1. hint sql with multiple nodes return correct results
  • real result:
    1. hint sql with multiple nodes return incorrect results

Metadata

Metadata

Assignees

Labels

hintresolveproblem 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