1 #ifndef SQL_QUERY_REWRITE_INCLUDED
2 #define SQL_QUERY_REWRITE_INCLUDED
3 
4 /* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
5 
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License, version 2.0,
8    as published by the Free Software Foundation.
9 
10    This program is also distributed with certain software (including
11    but not limited to OpenSSL) that is licensed under separate terms,
12    as designated in a particular file or component or in included license
13    documentation.  The authors of MySQL hereby grant you an additional
14    permission to link the program and your derivative works with the
15    separately licensed software that they have included with MySQL.
16 
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20    GNU General Public License, version 2.0, for more details.
21 
22    You should have received a copy of the GNU General Public License
23    along with this program; if not, write to the Free Software
24    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
25 
26 #include <mysql/plugin_audit.h>
27 
28 /**
29   Calls the query rewrite plugins' respective rewrite functions before parsing
30   the query.
31 
32   @param[in] thd The session sending the query to be rewritten.
33 */
34 void invoke_pre_parse_rewrite_plugins(THD *thd);
35 
36 /**
37   Enables digests in the parser state if any plugin needs it.
38 
39   @param param ps This parser state will have digests enabled if any plugin
40   needs it.
41 
42   @note For the time being, only post-parse query rewrite plugins are able to
43   request digests. If other plugin types need the same, this function needs to
44   be modified.
45 */
46 void enable_digest_if_any_plugin_needs_it(THD *thd, Parser_state *ps);
47 
48 /**
49   Calls query rewrite plugins after parsing the query.
50   @param[in] thd the thread with the query to be rewritten
51 */
52 bool invoke_post_parse_rewrite_plugins(THD *thd, my_bool is_prepared);
53 
54 #endif /* SQL_QUERY_REWRITE_INCLUDED */
55