shardingsphere
shardingsphere copied to clipboard
Scaling consistency check supports PostgreSQL 14 xml data type
Which version of ShardingSphere did you use?
master brach PostgreSQL 14
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
Sharding-Scaling
Expected behavior
Migration succeeded
Actual behavior
Scaling consistency check does not support PostgreSQL 14 xml data type
Reason analyze (If you can)
The xml type fails in the final data consistency check because org.postgresql.jdbc.PgSQLXML does not implement the equals method
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
create table table_mix (
id bigint primary key,
shard_id bigint not null,
t_xml xml null
);
insert into table_mix (id, shard_id, t_xml) values (1, 2, XMLPARSE(DOCUMENT '<?xml version="1.0"?><book><title>Manual</title><chapter>...</chapter></book>'));
ADD RESOURCE ds_2 (
URL="jdbc:postgresql://127.0.0.1:5432/demo_ds_2",
USER=postgres,
PASSWORD=123456,
PROPERTIES("maximumPoolSize"=500,"idleTimeout"="30000")
);
ADD RESOURCE ds_3 (
URL="jdbc:postgresql://127.0.0.1:5432/demo_ds_3",
USER=postgres,
PASSWORD=123456,
PROPERTIES("maximumPoolSize"=500,"idleTimeout"="30000")
);
ALTER SHARDING TABLE RULE table_mix (
RESOURCES(ds_2,ds_3),
SHARDING_COLUMN=id,
TYPE(NAME=HASH_MOD,PROPERTIES("sharding-count"=2)),
GENERATED_KEY(COLUMN=id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
);
table table_mix data check failed.