MySQL 8.0.39
Source Code Documentation
ddl_rewriter.cc File Reference
#include <regex>
#include <string>
#include "plugin/ddl_rewriter/ddl_rewriter.h"

Functions

bool query_rewritten (const std::string &query, std::string *rewritten_query)
 Rewrite CREATE TABLE queries. More...
 

Function Documentation

◆ query_rewritten()

bool query_rewritten ( const std::string &  query,
std::string *  rewritten_query 
)

Rewrite CREATE TABLE queries.

Remove ENCRYPTION and DATA|INDEX DIRECTORY clauses. Note that the CREATE keyword is expected to be located at the very beginning of the query string. The function is used by the ddl_rewriter plugin, and is intended used for CREATE TABLE queries generated by SHOW CREATE TABLE, e.g. when restoring output from mysqldump.

Parameters
queryOriginal query.
[out]rewritten_queryRewritten query with clauses removed. If there was no rewrite, rewritten_query will not be modified.
Return values
trueif the query was rewritten