Rechercher dans le manuel MySQL
5.6.5 The ddl_rewriter Plugin
MySQL 8.0.16 and higher includes a ddl_rewriter
plugin that modifies CREATE TABLE
statements received by the server before it parses and executes
them. The plugin removes ENCRYPTION
,
DATA DIRECTORY
, and INDEX
DIRECTORY
clauses, which may be helpful when restoring
tables from SQL dump files created from databases that are
encrypted or that have their tables stored outside the data
directory. For example, the plugin may enable restoring such dump
files into an unencrypted instance or in an environment where the
paths outside the data directory are not accessible.
Before using the ddl_rewriter
plugin, install
it according to the instructions provided in
Section 5.6.5.1, “Installing or Uninstalling ddl_rewriter”.
ddl_rewriter
examines SQL statements received
by the server prior to parsing, rewriting them according to these
conditions:
ddl_rewriter
considers onlyCREATE TABLE
statements, and only if they are standalone statements that occur at the beginning of an input line or at the beginning of prepared statement text.ddl_rewriter
does not considerCREATE TABLE
statements within stored program definitions. Statements can extend over multiple lines.Within statements considered for rewrite, instances of the following clauses are rewritten and each instance replaced by a single space:
ENCRYPTION
DATA DIRECTORY
(at the table and partition levels)INDEX DIRECTORY
(at the table and partition levels)
Rewriting does not depend on lettercase.
If ddl_rewriter
rewrites a statement, it
generates a warning:
- Query OK, 0 rows affected, 1 warning (0.03 sec)
- *************************** 1. row ***************************
- Level: Note
- Code: 1105
- rewritten to 'CREATE TABLE t (i INT) ' by a query rewrite plugin
If the general query log or binary log is enabled, the server
writes to it statements as they appear after any rewriting by
ddl_rewriter
.
When installed, ddl_rewriter
exposes the
Performance Schema memory/rewriter/ddl_rewriter
instrument for tracking plugin memory use. See
Section 26.12.17.10, “Memory Summary Tables”
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-ddl-rewriter.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.