Affects: Server-8.0   —   Status: Complete

Remove the PROCEDURE ANALYZE clause.

We propose to add a deprecation warnings in 5.7 maintenance releases, and remove in 8.0. This should leave enough time for users to change their application since it is not a commonly used syntax.

Scope: refactoring initiative.

Reasoning: it was discussed many times that the PROCEDURE ANALYZE syntax is an anachronism and almost unused non-standard syntax extension.

Note: it would be nice to reimplement PROCEDURE ANALYZE functionality with a stored procedure as a replacement for possible PROCEDURE ANALYZE's users (if any).

User Documentation

5.7 (deprecation)

  • NFR-1: No change in the data output: valid PROCEDURE ANALYSE clauses work as before.
  • FR-1: Every valid occurrence of the PROCEDURE ANALYSE clause rises a deprecation warning.

8.0 (removal)

  • NFR-2: ANALYSE is not a non-reserved keyword any more. (Since it was a non-reserved keyword before, there is no visible change in behavior.)
  • FR-2: From now query expressions fail with a syntax error on PROCEDURE ANALYSE clauses instead of printing table statistics.


  • Every reference to the PROCEDURE ANALYSE[(...)] clause (including EXPLAIN) executes as usual but output an extra warning:
 'PROCEDURE ANALYSE' is deprecated and will be removed in a future release.


  • PROCEDURE ANALYZE is not a valid clause (syntax error) in the query specification any more.
  • ANALYSE is not a keyword any more. (Note: the ANALYZE TABLE statements uses a different keyword: ANALYZE.)


5.7 (deprecation)

The parser outputs a deprecation warning with the help of push_deprecated_warn_no_replacement() function on syntactically-valid PROCEDURE ANALYSE clauses, then it executes as before.

8.0 (removal)

Removed files

  • Tests: func_analyse.
  • Sources: sql/sql_analyse.{h,cc}.

Note: sql_analyse.cc had the append_escaped() function definition which was used as an API function is other parts of the server code and storage engines. Since append_espaced() accepts String objects as an input-output parameters, this is logical to convert the function into a part of the String class and sql_string.{h,cc} files.

Changes in the parser

  • Removal of the ANALYSE_SYM token: replaced with the OBSOLETE_TOKEN_271 dummy to save token numbers.
  • query_expression: removal of the PROCEDURE ANALYSE clause.
  • Removal of grammar rules:
    • opt_procedure_analyse_clause,
    • opt_procedure_analyse_params.

Changes in the executor

Dead code removal after changes in the parser.