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

Ignore the comment in the sql statement for plan cache #38490

Open
Reminiscent opened this issue Oct 17, 2022 · 0 comments
Open

Ignore the comment in the sql statement for plan cache #38490

Reminiscent opened this issue Oct 17, 2022 · 0 comments
Labels
epic/plan-cache sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@Reminiscent
Copy link
Contributor

Enhancement

If there are some comments in the sql statement, it can not use the exist plan cache.

mysql> prepare stmt from 'select * from t';
Query OK, 0 rows affected (0.01 sec)

mysql> execute stmt;
Empty set (0.01 sec)

mysql> execute stmt;
Empty set (0.00 sec)

mysql> select @@last_plan_from_cache;
+------------------------+
| @@last_plan_from_cache |
+------------------------+
|                      1 |
+------------------------+
1 row in set (0.00 sec)

mysql> prepare stmt1 from '/* add a comment */ select * from t';
Query OK, 0 rows affected (0.00 sec)

mysql> execute stmt1;
Empty set (0.00 sec)

mysql> select @@last_plan_from_cache;
+------------------------+
| @@last_plan_from_cache |
+------------------------+
|                      0 |
+------------------------+
1 row in set (0.00 sec)

The final one should use the plan cache.

@Reminiscent Reminiscent added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner epic/plan-cache labels Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/plan-cache sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant