shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

An error is reported when PostgreSQL money type queries large numbers

Open ReyYang opened this issue 4 years ago • 5 comments

Which version of ShardingSphere did you use?

master branch PostgreSQL 14

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

ShardingSphere-Proxy

Expected behavior

return correct result

Actual behavior

return error

Reason analyze (If you can)

The money field in PostgreSQL is detected with ’ , ‘

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

1、create table

create table table_mix
(
    id       bigint primary key ,
    shard_id bigint not null,
    t_money  money  null
);

2、insert datas

insert into table_mix (id, shard_id, t_money)
values (1, 2, 9999999);

3、error

sharding_db=> select * from table_mix;
ERROR:  不良的类型值 double : 9,999,999.00

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

ReyYang avatar Jan 14 '22 08:01 ReyYang

Using psql query returns normal

demo_ds_0=# select * from table_mix;
 id | shard_id |    t_money
----+----------+---------------
  1 |        2 | $9,999,999.00
(1 row)

ReyYang avatar Jan 14 '22 08:01 ReyYang

I want to investigate this issue.

tuichenchuxin avatar Jan 18 '22 05:01 tuichenchuxin

@ReyYang I found this issue is because of postgresql jdbc bug. Avoid to use money type. And postgresql jdbc seems no plan to fix this. refer to this

tuichenchuxin avatar Jan 18 '22 06:01 tuichenchuxin

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]