Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKIP_SQL_REWRITE=true, invalid #31709

Open
13302516724 opened this issue Jun 15, 2024 · 0 comments
Open

SKIP_SQL_REWRITE=true, invalid #31709

13302516724 opened this issue Jun 15, 2024 · 0 comments

Comments

@13302516724
Copy link

The number of shards in the table is 4, using USER-ID as the shard key

Logic SQL:
/* SHARDINGSPHERE_HINT: DISABLE_AUDIT_NAMES=sharding_key_required_auditor, SKIP_SQL_REWRITE=true */
SELECT * FROM T_ACCOUNT WHERE USERNAME=#{username} AND APP_ID = #{appId}

Actual SQL:
SELECT * FROM T_ACCOUNT WHERE USERNAME=#{username} AND APP_ID = #{appId}
UNION ALL
SELECT * FROM T_ACCOUNT WHERE USERNAME=#{username} AND APP_ID = #{appId}
UNION ALL
SELECT * FROM T_ACCOUNT WHERE USERNAME=#{username} AND APP_ID = #{appId}
UNION ALL
SELECT * FROM T_ACCOUNT WHERE USERNAME=#{username} AND APP_ID = #{appId}

How to effectively skip rewriting

expect
SELECT * FROM T_ACCOUNT WHERE USERNAME=#{username} AND APP_ID = #{appId}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant