-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
statements_summary query_sample_text shows prepared statement form #16653
Comments
I looked into how MySQL handles this, and was a little dissapointed to discover that it does not. See: https://bugs.mysql.com/bug.php?id=80173 Here is some sample code to reproduce. TiDB will return the statement sample text with a placeholder vs. MySQL that will not even return the statement.
In TiDB:
|
Summarizing this issue: TiDB will record the statement, but only in prepared statement form versus MySQL which will not record the statement. TiDB is not strictly compatible with MySQL's performance schema, so it is possible that this could be fixed to be the actual statement. But given the MySQL behavior, it is a lower priority issue. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
I ran tpcc against master, and then observed the workload in
information_schema.statements_summary
.2. What did you expect to see?
I was really hoping to see
query_sample_text
so that I could take the query and run it through explain. Instead it showed only the prepared statement form - which is non-explainable.3. What did you see instead?
See the
?
for values underquery_sample_text
. In MySQL the query sample shows something that is directly explainable. The digest_text shows the prepared statement form.4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)The text was updated successfully, but these errors were encountered: