Skip to content

When the fragment field is of decimal type, the query result is garbled #2143

@LUAgam

Description

@LUAgam
  • dble version:3.20.07.0
  • preconditions :
    no
  • configs:

cluster.cnf



bootstrap.cnf



db.xml



user.xml



sharding.xml

<shardingTable name="tb_hash_sharding_er3" shardingNode="dn1,dn2" function="func_common_hash"
                       shardingColumn="id"/>

  • steps:
    step1.
CREATE TABLE `tb_hash_sharding_er3` (
  `id` decimal(10,0) NOT NULL,
  `id2` bigint(20) NOT NULL,
  `content` varchar(250) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  • expect result:
    1.
mysql> SELECT
    -> ( CASE t.id WHEN 1 THEN '好' ELSE '坏' END ) b
    -> FROM
    -> tb_hash_sharding_er3 t
    -> INNER JOIN tb_enum_sharding tt ON t.id2 = tt.id;
+-----+
| b   |
+-----+
| 好  |
+-----+
1 row in set (0.00 sec)
  • real result:
    1.
mysql> SELECT
    -> ( CASE t.id WHEN 1 THEN '好' ELSE '坏' END ) b
    -> FROM
    -> tb_hash_sharding_er3 t
    -> INNER JOIN tb_enum_sharding tt ON t.id2 = tt.id;
+---+
| b |
+---+
| ? |
+---+
1 row in set (0.01 sec)
  • supplements:
    1.Normal in MySQL

Metadata

Metadata

Labels

autotest-addedthe case has append to autotest

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions