shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Use Sharding-Proxy to query bit type data, the returned result column is empty

Open ReyYang opened this issue 4 years ago • 3 comments

Use Sharding-proxy to query bit type data, the returned result column is empty

Which version of ShardingSphere did you use?

master branch MySQL 5.6,5.7

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

"bit" column returns normally

Actual behavior

"bit" column returns empty

Reason analyze (If you can)

The bit type is not judged when SQL parsing returns

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

-- create table
create table table_numeric
(
    id        bigint 
        primary key,
    shard_id  bigint    not null,
    t_int     int       null,
    t_sint    smallint  not null,
    t_ting    tinyint   null,
    t_mint    mediumint null,
    t_bint    bigint    null,
    t_decimal decimal   null,
    t_numeric decimal   null,
    t_float   float     null,
    t_double  double    null,
    t_bit     bit       null,
    t_real    double    null
);
-- insert datas
insert into table_numeric (id, shard_id, t_int, t_sint, t_ting,
                             t_mint, t_bint, t_decimal,
                             t_numeric, t_float, t_double,
                             t_bit, t_real)
VALUES (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1),
       (2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2),
       (3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3),
       (4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4),
       (5, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5),
       (6, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 6);

use Sharding-Proxy select data

mysql> select * from table_numeric;
+----+----------+-------+--------+--------+--------+--------+-----------+-----------+---------+----------+-------+--------+
| id | shard_id | t_int | t_sint | t_ting | t_mint | t_bint | t_decimal | t_numeric | t_float | t_double | t_bit | t_real |
+----+----------+-------+--------+--------+--------+--------+-----------+-----------+---------+----------+-------+--------+
|  6 |        4 |     6 |      6 |      6 |      6 |      6 |         6 |         6 |     6.0 |      6.0 |      |    6.0 |
|  3 |        2 |     3 |      3 |      3 |      3 |      3 |         3 |         3 |     3.0 |      3.0 |       |    3.0 |
|  5 |        6 |     5 |      5 |      5 |      5 |      5 |         5 |         5 |     5.0 |      5.0 |       |    5.0 |
|  2 |        3 |     2 |      2 |      2 |      2 |      2 |         2 |         2 |     2.0 |      2.0 |      |    2.0 |
|  4 |        5 |     4 |      4 |      4 |      4 |      4 |         4 |         4 |     4.0 |      4.0 |      |    4.0 |
|  1 |        1 |     1 |      1 |      1 |      1 |      1 |         1 |         1 |     1.0 |      1.0 |       |    1.0 |
+----+----------+-------+--------+--------+--------+--------+-----------+-----------+---------+----------+-------+--------+

Example codes for reproduce this issue (such as a github link).

ReyYang avatar Jan 07 '22 08:01 ReyYang

I did some investigation and found this issue may be related to charset or collate. The bit value did returned, but did not displayed.

Response from MySQL image

Response from Proxy image

TeslaCN avatar Jan 07 '22 16:01 TeslaCN

Hello , this issue has not received a reply for several days. This issue is supposed to be closed.

github-actions[bot] avatar Oct 08 '22 16:10 github-actions[bot]

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

github-actions[bot] avatar Mar 28 '24 20:03 github-actions[bot]