[MDEV-26634] Feature request: add STATEMENT_DIGEST_TEXT Created: 2021-09-17 Updated: 2023-05-01 Resolved: 2023-05-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser, Performance Schema |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Roel Van de Paar | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 2 |
| Labels: | affects-tests, beginner-friendly | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
STATEMENT_DIGEST_TEXT is a very handy function in MySQL 8 which can be used programmatically and quickly check thousands of SQL statements for validity, without actually executing them, and returning an error on CLI-only statements:
The same function does not exist in MariaDB:
So whilst the MySQL 8 function can be used to check SQL statements for validity (via yes/no error), MariaDB specific syntax will not be recognized and thus using MySQL 8 for SQL verification is not very helpful. Implementing the same would help for testing. |
| Comments |
| Comment by Sergei Golubchik [ 2022-02-21 ] | |||||||
|
Roel, can you use PREPARE instead?
| |||||||
| Comment by Roel Van de Paar [ 2022-03-03 ] | |||||||
|
serg Fantastic, thank you very much. This seems to work better, and easier. | |||||||
| Comment by Roel Van de Paar [ 2022-03-03 ] | |||||||
|
Perhaps, when/if we implement this feature, this is also an easy way to work it into the code, by using a temporary prepare statement? | |||||||
| Comment by Roel Van de Paar [ 2022-03-03 ] | |||||||
|
Notes to self
And test_pquery (~/start) was updated to log errors. One issue is that PREPARE will still crash on single-line crashing queries like the one in Next; writing scripting to automate the lot & restart instance when crashes are observed (line-by-line execution and immediate classification into buckets). | |||||||
| Comment by Daniel Black [ 2022-12-06 ] | |||||||
|
maxscale has the feature if its portable. | |||||||
| Comment by Weijun Huang [ 2023-04-10 ] | |||||||
|
Does this still need to be completed? If so, I want to work on it. | |||||||
| Comment by Daniel Black [ 2023-04-11 ] | |||||||
|
Also has some good application in assisting tooling to normalize like queries with different constants. So sure Weijun Huang, love to see an implementation. | |||||||
| Comment by Roel Van de Paar [ 2023-04-24 ] | |||||||
|
Thank you Weijun Huang, I too am looking forward to your work. |