shardingsphere
shardingsphere copied to clipboard
DDL execute failed,BUT output is SUCESS
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed GitHub issues.
- Read documentation: ShardingSphere Doc.
Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will close it.
Please answer these questions before submitting your issue. Thanks!
Which version of ShardingSphere did you use?
master 9dd0d3990c849d50c17c6dc7c92ec2d4ce0ad7e5
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
Expected behavior
sharding_db=> CREATE VIEW t_order_view as select order_id, status from t_order where order_id >= 1000;
ERROR: relation "t_order_1" does not exist on gaussdb
LINE 1: ...EW t_order_view as select order_id, status from t_order wher...
Actual behavior
sharding_db=> CREATE VIEW t_order_view as select order_id, status from t_order where order_id >= 1000;
CREATE VIEW
Reason analyze (If you can)
can't
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
prepare proxy
databaseName: readwrite_splitting_db
#
dataSources:
primary_ds:
url: jdbc:opengauss://127.0.0.1:15432/demo_primary_ds?batchMode=on
username: gaussdb
password: Secretpassword@123
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
replica_ds_0:
url: jdbc:opengauss://127.0.0.1:15432/demo_primary_ds?batchMode=on
username: gaussdb
password: Secretpassword@123
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
#
rules:
- !READWRITE_SPLITTING
dataSources:
readwrite_ds:
type: Static
props:
write-data-source-name: primary_ds
read-data-source-names: replica_ds_0
loadBalancerName: random
loadBalancers:
random:
type: RANDOM
- create sharding view ,if ds_0 have t_order_0 t_order_1 ,but ds_1 only have t_order_0
# proxy create table
CREATE TABLE t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
# connect real db
demo_ds_1=> drop table t_order_1;
#proxy create view
# no errot,BUT demo_ds_1 's t_order_view_1 don't create sucess
sharding_db=> CREATE VIEW t_order_view as select order_id, status from t_order where order_id >= 1000;
CREATE VIEW
# have error,other view deleted
sharding_db=> drop view t_order_view;
ERROR: view "t_order_view_1" does not exist
# the behaiver is same with sharding_view
sharding_db=> drop table t_order;
ERROR: table "t_order_1" does not exist
Example codes for reproduce this issue (such as a github link).
I found this error has been fixed #19525
I found this error has been fixed #19525
@tuichenchuxin thanks for reply
When use commit 3043ec0425c1a8be75edf4fadef59f4f9e789a1b
, execute steps to reproduce the behavior.
I found output error
success.