shardingsphere
shardingsphere copied to clipboard
sharding-proxy got different shard result when we use : algorithmExpression: consumer_${id_card.substring(12)}
vsersion : 3.1.0
when we use the sharding-proxy,we specified algorithmExpression like this:
algorithmExpression: consumer_${id_card.substring(12)} , the test of id_card -> 1547717441768 .
then we had the following tests:
Logic SQL: insert into consumer(id_card) values('1547717441768')
#Expected
ShardingSphere-SQL - Actual SQL: ds_0 ::: insert into consumer_8(id_card) values('1547717441768')
Logic SQL: select * from consumer WHERE id_card ='1547717441768'
#Not what we expected
Actual SQL: ds_0 ::: select * from consumer_68' WHERE id_card ='1547717441768'
Did you forget to handle the quotes at the head and tail?
thanks, String value need trip start quote and end quote, just fix it