You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/07 11:52:43 UTC
[GitHub] [shardingsphere] peilinqian opened a new issue, #18939: "Cursor, close, fetch, move" SQL statements are of DQL type. In readwrite-splitting mode, they are not excuted in the slave database
peilinqian opened a new issue, #18939:
URL: https://github.com/apache/shardingsphere/issues/18939
## Bug Report
**For English only**, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
- Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
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?
we find java version: java8, full_version=1.8.0_242
ShardingSphere-5.1.3-SNAPSHOT
Commit ID: dirty-7c67365b394d2e3ac562329b550c135c31ea764d
Commit Message: Avoid overhead of invoking method in Optional.orElse (#18921)
Branch: dev-0707
Build time: 2022-07-07T14:29:43+0800
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
"Cursor, close, fetch, move" SQL statements are of DQL type. In readwrite-splitting mode, they are excuted in the slave database
### Actual behavior
"Cursor, close, fetch, move" SQL statements are of DQL type. In readwrite-splitting mode, they are not excuted in the slave database
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
sql
```
drop table if exists cur_test_01;
create table cur_test_01(c_id int,c_num int,c_name varchar(10),c_city varchar(10),c_add varchar(20));
insert into cur_test_01 values(1,18,'Allen','Beijing','AAAAABAAAAA'),(2,368,'Bob','Shanghai','AAAAACAAAAA'),
(3,59,'Cathy','Shenzhen','AAAAADAAAAA'),(4,96,'David','Suzhou','AAAAAEAAAAA'),
(5,17,'Edrwd','Fenghuang','AAAAAFAAAAA'),(6,253,'Fendi','Changsha','AAAAAGAAAAA');
start transaction;
cursor cursor1 for select * from cur_test_01 order by 1; --slave
fetch from cursor1; --slave
insert into cur_test_01 values(7,18,'Allen','Beijing','AAAAABAAAAA'); --primary
select * from cur_test_01 ; --slave
close cursor1; --slave
end;
```
config
```
dataSources:
write_ds:
url: jdbc:opengauss://xx.xxx.xx.xx:16000/test?serverTimezone=UTC&useSSL=false
username: test
password: Test@123
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
read_ds_0:
url: jdbc:opengauss://xx.xxx.xx.xx:16000/test?serverTimezone=UTC&useSSL=false
username: test
password: Test@123
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
read_ds_1:
url: jdbc:opengauss://xx.xxx.xx.xx:16000/test?serverTimezone=UTC&useSSL=false
username: test
password: Test@123
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
- !READWRITE_SPLITTING
dataSources:
readwrite_ds:
staticStrategy:
writeDataSourceName: write_ds
readDataSourceNames:
- read_ds_0
- read_ds_1
loadBalancerName: random
loadBalancers:
random:
type: FIXED_REPLICA_WEIGHT
props:
read_ds_0: 9
read_ds_1: 1
```
### Example codes for reproduce this issue (such as a github link).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu closed issue #18939: "Cursor, close, fetch, move" SQL statements are of DQL type. In readwrite-splitting mode, they are not excuted in the slave database
Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #18939: "Cursor, close, fetch, move" SQL statements are of DQL type. In readwrite-splitting mode, they are not excuted in the slave database
URL: https://github.com/apache/shardingsphere/issues/18939
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #18939: "Cursor, close, fetch, move" SQL statements are of DQL type. In readwrite-splitting mode, they are not excuted in the slave database
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #18939:
URL: https://github.com/apache/shardingsphere/issues/18939#issuecomment-1177491524
After discussion, at present cursor can only be executed in the primary datasource, and the replica datasource does not support cursor statement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org