#include <set>
#include "my_sqlcommand.h"
#include "sql/table.h"
Go to the source code of this file.
◆ Consumer_type
Target types where the rewritten query will be added.
Query rewrite might vary based on this type.
Enumerator |
---|
TEXTLOG | |
BINLOG | |
STDOUT | |
◆ mysql_rewrite_acl_query()
Provides the default interface to rewrite the ACL query.
If do_ps_instrument, it sets the thd->rewritten_query with a rewritten query.
- Parameters
-
thd | The THD to rewrite for. |
rlb | Buffer to return rewritten query in (if any) if do_ps_instrument is false. |
type | Purpose of rewriting the query Consumer_type::TEXTLOG To rewrite the query either for general, slow query and audit log. Consumer_type::BINLOG To rewrite the query for binlogs. Consumer_type::STDOUT To rewrite the query for standard output. |
params | Wrapper object of parameters in case needed by a SQL rewriter. |
do_ps_instrument | flag to indicate if the query has to be instrumented in the PSI. Default value is true. If instrumented, the previous |
◆ mysql_rewrite_query()
Provides the default interface to rewrite the SQL statements to to obfuscate passwords.
It either sets the thd->rewritten_query with a rewritten query, or clears it if no rewriting took place.
The query aimed to be rewritten in the usual log files (i.e. General, slow query and audit log) uses default value of type which is Consumer_type::TEXTLOG
Side-effects:
- thd->m_rewritten_query will contain a rewritten query, or be cleared if no rewriting took place. LOCK_thd_query will be temporarily acquired to make that change.
- Note
- Keep in mind that these side-effects will only happen when calling this top-level function, but not when calling individual sub-functions directly!
- Parameters
-
thd | The THD to rewrite for. |
type | Purpose of rewriting the query Consumer_type::TEXTLOG To rewrite the query either for general, slow query and audit log. Consumer_type::BINLOG To rewrite the query for binlogs. Consumer_type::STDOUT To rewrite the query for standard output. |
params | Wrapper object of parameters in case needed by a SQL rewriter. |