Skip to content

[Feature Request]: explain a prepared statement #22765

Closed

Description

@fengttt

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

mysql> prepare stmt from 'select * from t where j % 100 = ? and i = (select max(i) from t where j % 100 = ?)';
mysql> set @a = 1;
Query OK, 0 rows affected (0.00 sec)

mysql> execute stmt using @a, @a;
+---------+---------+---------+
| i       | j       | k       |
+---------+---------+---------+
| 5000000 | 5000001 | 5000002 |
+---------+---------+---------+
1 row in set (0.02 sec)

This is all good, except we cannot explain the prepared statement.

Describe the feature you'd like

We want to be able to run

mysql> explain execute stmt using @A, @A;
ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 26 near " using @A, @A";

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

Additional information

No response

Activity

  1. self-assigned this
    on Nov 4, 2025
  2. added theissue type on Nov 4, 2025
  3. fengttt commented on Nov 6, 2025

    @fengttt
    ContributorAuthor

    Correct syntax,

    explain ANALYZE FORCE execute stmt using @A, @A;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions