Ignore the comment in the sql statement for plan cache
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## 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.
Contributor guide
Assessment
This issue has not been assessed yet.