bobbyz007 opened a new issue, #31448:
URL: https://github.com/apache/shardingsphere/issues/31448
## Question
shardingsphere: 5.5.0
config.yaml:
```
rules:
- !SINGLE
tables:
- "*.*"
- !SHADOW
dataSources:
shadowDataSource:
productionDataSourceName: ds
shadowDataSourceName: ds_shadow
tables:
t_user:
dataSourceNames:
- shadowDataSource
shadowAlgorithmNames:
- user_id_insert_match_algorithm
- user_id_delete_match_algorithm
- user_id_select_match_algorithm
- sql_hint_algorithm
shadowAlgorithms:
user_id_insert_match_algorithm:
type: REGEX_MATCH
props:
operation: insert
column: user_type
regex: "[1]"
user_id_delete_match_algorithm:
type: REGEX_MATCH
props:
operation: delete
column: user_type
regex: "[1]"
user_id_select_match_algorithm:
type: REGEX_MATCH
props:
operation: select
column: user_type
regex: "[1]"
sql_hint_algorithm:
type: SQL_HINT
props:
shadow: true
foo: bar
#打印sql
props:
sql-show: true
```
the sql printed in console as follows, records by rule do not come into
shadow db:
```
2024-05-30T16:29:26.851+08:00 INFO 17544 --- [nio-8088-exec-9]
ShardingSphere-SQL : Logic SQL: insert into t_user
(user_id, user_type, username, pwd)
values
(?, ?, ?,
?)
,
(?, ?, ?,
?)
,
(?, ?, ?,
?)
,
(?, ?, ?,
?)
,
(?, ?, ?,
?)
2024-05-30T16:29:26.852+08:00 INFO 17544 --- [nio-8088-exec-9]
ShardingSphere-SQL : Actual SQL: ds ::: insert into
t_user (user_id, user_type, username, pwd)
values
(?, ?, ?,
?)
,
(?, ?, ?,
?)
,
(?, ?, ?,
?)
,
(?, ?, ?,
?)
,
(?, ?, ?,
?) ::: [0, 0, test2, 123456, 0, 1, test3, 123456, 0, 0, test4, 123456,
0, 1, test5, 123456, 0, 0, test6, 123456]
```
--
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:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]