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

SHOW CREATE PLACEMENT POLICY uses illegal double quotes #37526

Closed
kolbe opened this issue Aug 31, 2022 · 0 comments · Fixed by #37606
Closed

SHOW CREATE PLACEMENT POLICY uses illegal double quotes #37526

kolbe opened this issue Aug 31, 2022 · 0 comments · Fixed by #37606
Assignees
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.1 severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@kolbe
Copy link
Contributor

kolbe commented Aug 31, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE PLACEMENT POLICY `Test` LEADER_CONSTRAINTS='["+topology.kubernetes.io/region=us-east-1"]' FOLLOWER_CONSTRAINTS='{"+topology.kubernetes.io/region=us-east-2": 1, "+topology.kubernetes.io/region=us-west-2": 1}';

show create placement policy Test;

CREATE PLACEMENT POLICY `Test` LEADER_CONSTRAINTS="["+topology.kubernetes.io/region=us-east-1"]" FOLLOWER_CONSTRAINTS="{"+topology.kubernetes.io/region=us-east-2": 1, "+topology.kubernetes.io/region=us-west-2": 1}";

2. What did you expect to see? (Required)

The output of SHOW CREATE PLACEMENT POLICY should include a syntactically valid placement policy.

3. What did you see instead (Required)

The output of SHOW CREATE PLACEMENT POLICY includes illegal nested double quotes that cannot be parsed.

mysql> CREATE PLACEMENT POLICY `Test` LEADER_CONSTRAINTS='["+topology.kubernetes.io/region=us-east-1"]' FOLLOWER_CONSTRAINTS='{"+topology.kubernetes.io/region=us-east-2": 1, "+topology.kubernetes.io/region=us-west-2": 1}';
Query OK, 0 rows affected (0.97 sec)

mysql> show create placement policy Test\G
*************************** 1. row ***************************
       Policy: Test
Create Policy: CREATE PLACEMENT POLICY `Test` LEADER_CONSTRAINTS="["+topology.kubernetes.io/region=us-east-1"]" FOLLOWER_CONSTRAINTS="{"+topology.kubernetes.io/region=us-east-2": 1, "+topology.kubernetes.io/region=us-west-2": 1}"
1 row in set (0.73 sec)

mysql> CREATE PLACEMENT POLICY `Test` LEADER_CONSTRAINTS="["+topology.kubernetes.io/region=us-east-1"]" FOLLOWER_CONSTRAINTS="{"+topology.kubernetes.io/region=us-east-2": 1, "+topology.kubernetes.io/region=us-west-2": 1}";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 54 near "+topology.kubernetes.io/region=us-east-1"]" FOLLOWER_CONSTRAINTS="{"+topology.kubernetes.io/region=us-east-2": 1, "+topology.kubernetes.io/region=us-west-2": 1}""

4. What is your TiDB version? (Required)

tidb_version(): Release Version: v6.1.0
Edition: Community
Git Commit Hash: 1a89decdb192cbdce6a7b0020d71128bc964d30f
Git Branch: heads/refs/tags/v6.1.0
UTC Build Time: 2022-06-05 05:15:11
GoVersion: go1.18.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.08 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.1 severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants