You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/03/24 02:47:04 UTC
[GitHub] [incubator-shardingsphere] jimmycheng888 opened a new issue #2075:
shardingsphere Configuration master-slave function cannot be used
jimmycheng888 opened a new issue #2075: shardingsphere Configuration master-slave function cannot be used
URL: https://github.com/apache/incubator-shardingsphere/issues/2075
I am using version 3.1.0
i sing shardingsphere ,Configuration is as follows
<!--sharing-jdbc start-->
<dependency>
<groupId>io.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>io.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-namespace</artifactId>
</dependency>
<dependency>
<groupId>io.shardingsphere</groupId>
<artifactId>sharding-transaction-spring-boot-starter</artifactId>
</dependency>
<!--sharing-jdbc end-->
Actual behavior
shardingsphere Configuration master-slave function cannot be used,I hope that the master-slave configuration can support the use of sql functions, otherwise the project changes too much.
error info :
io.shardingsphere.core.parsing.parser.exception.SQLParsingUnsupportedException: Not supported token 'WITH'.
at io.shardingsphere.core.parsing.parser.sql.SQLParserFactory.newInstance(SQLParserFactory.java:100) ~[sharding-core-3.1.0.jar:?]
SQL to execute:
WITH RECURSIVE T (permission_id, permission_name, PARENT_ID, PATH, DEPTH) AS (
SELECT permission_id, permission_name, PARENT_ID, ARRAY[permission_id] AS PATH, 1 AS DEPTH
FROM t_permission
WHERE parent_id =0 and is_enable =1
UNION ALL
SELECT D.permission_id, D.permission_name, D.PARENT_ID, T.PATH || D.permission_id, T.DEPTH + 1 AS DEPTH
FROM t_permission D
JOIN T ON D.PARENT_ID = T.permission_id
)
SELECT permission_id, permission_name, PARENT_ID, PATH, DEPTH FROM T
ORDER BY PATH;
My yml configuration is as follows
sharding:
jdbc:
dataSource:
names: project-master,project-slave-0,project-slave-1
project-master:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: org.postgresql.Driver
jdbcUrl: jdbc:postgresql://my-pgsmaster:5800/project
username: postgres
password: sdfklsndflkal
read-only: false
connection-timeout: 30000
idle-timeout: 30000
max-lifetime: 180000
maximum-pool-size: 60
minimum-idle: 10
auto-commit: true
connection-test-query: SELECT 'x'
project-slave-0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: org.postgresql.Driver
jdbcUrl: jdbc:postgresql://my-pgsmaster:5801/project
username: postgres
password: sdfklsndflkal
read-only: true
connection-timeout: 30000
idle-timeout: 30000
max-lifetime: 180000
maximum-pool-size: 60
minimum-idle: 10
connection-test-query: SELECT 'x'
project-slave-1:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: org.postgresql.Driver
jdbcUrl: jdbc:postgresql://my-pgsmaster:5802/project
username: postgres
password: sdfklsndflkal
read-only: true
connection-timeout: 30000
idle-timeout: 30000
max-lifetime: 180000
maximum-pool-size: 60
minimum-idle: 10
connection-test-query: SELECT 'x'
config:
sharding:
master-slave-rules:
ds_0:
masterDataSourceName: project-master
slaveDataSourceNames: [project-slave-0, project-slave-1]
loadBalanceAlgorithmType: RANDOM
props:
sql.show: true
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services