MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndb_local_connection.h
1 /*
2  Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef NDB_LOCAL_CONNECTION_H
19 #define NDB_LOCAL_CONNECTION_H
20 
21 #include <mysql/plugin.h>
22 
23 /*
24  Wrapper class for executing queries against the local
25  MySQL Server without affecting the current THD's
26  settings and status.
27 
28  The functionality is implemented by concatenating SQL
29  queries and executing those using Ed_connection. Should
30  the SQL query fail, the exact error message and all
31  warning that occured can be examined in order to handle
32  the error in a graceful way.
33 
34 */
35 
37 public:
38  Ndb_local_connection(THD* thd);
39 
40  bool truncate_table(const char* db, size_t db_length,
41  const char* table, size_t table_length,
42  bool ignore_no_such_table);
43 
44  bool flush_table(const char* db, size_t db_length,
45  const char* table, size_t table_length);
46 
47  bool delete_rows(const char* db, size_t db_length,
48  const char* table, size_t table_length,
49  bool ignore_no_such_table,
50  ... /* where clause, NULL terminated list of strings */);
51 
52  bool create_sys_table(const char* db, size_t db_length,
53  const char* table, size_t table_length,
54  bool create_if_not_exists,
55  const char* create_definiton,
56  const char* create_options);
57 
58  /* Don't use this function for new implementation, backward compat. only */
59  bool raw_run_query(const char* query, size_t query_length,
60  const int* suppress_errors);
61 
62 private:
63  bool execute_query(MYSQL_LEX_STRING sql_text,
64  const unsigned int* ignore_mysql_errors,
65  const class Suppressor* suppressor = NULL);
66  bool execute_query_iso(MYSQL_LEX_STRING sql_text,
67  const unsigned int* ignore_mysql_errors,
68  const class Suppressor* suppressor = NULL);
69 private:
70  THD* m_thd;
71  bool m_push_warnings;
72 };
73 
74 
75 #endif