Skip to content

Incorrect result on where Sharding_column=(bit_expr &/+/* bit_expr) #271

@FlyingMao

Description

@FlyingMao

dble result:

mysql> select * from test_shard where id= (b'01' & B'11');
Empty set (0.00 sec)

mysql> select * from test_shard where id= (b'01' + B'11');
Empty set (0.00 sec)

mysql> select * from test_shard where id= (b'01' * B'11');
Empty set (0.01 sec)

mysql result:

mysql> select * from test_shard where id= (b'01' & B'11');
+----+-------------+----------+-----------+
| id | R_REGIONKEY | R_NAME   | R_COMMENT |
+----+-------------+----------+-----------+
|  1 |           1 | a string | test001   |
+----+-------------+----------+-----------+
1 row in set (0.00 sec)

mysql> select * from test_shard where id= (b'01' + B'11');
+----+-------------+--------+-----------+
| id | R_REGIONKEY | R_NAME | R_COMMENT |
+----+-------------+--------+-----------+
|  4 |           4 | 中     | test004   |
+----+-------------+--------+-----------+
1 row in set (0.00 sec)

mysql> select * from test_shard where id= (b'01' * B'11');
+----+-------------+----------------+-----------+
| id | R_REGIONKEY | R_NAME         | R_COMMENT |
+----+-------------+----------------+-----------+
|  3 |           3 | another string | test003   |
+----+-------------+----------------+-----------+
1 row in set (0.00 sec)

The general log of the dble node:

170920 11:20:15	  756 Query	SELECT *
FROM test_shard
WHERE id = b'01' & b'11'
LIMIT 100
170920 11:20:21	  733 Query	select user()
170920 11:20:32	  756 Query	SELECT *
FROM test_shard
WHERE id = b'01' * b'11'
LIMIT 100

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions