2
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21
#ifndef _MYSQL_SQL_INSERTS_LOADER_H_
22
#define _MYSQL_SQL_INSERTS_LOADER_H_
25
#include "mysql_sql_parser_base.h"
26
#include "grtsqlparser/sql_inserts_loader.h"
29
/** Implements DBMS specifics.
33
class MYSQL_SQL_PARSER_PUBLIC_FUNC Mysql_sql_inserts_loader : protected Mysql_sql_parser_base, public Sql_inserts_loader
36
typedef boost::shared_ptr<Mysql_sql_inserts_loader> Ref;
37
static Ref create(grt::GRT *grt) { return Ref(new Mysql_sql_inserts_loader(grt)); }
38
virtual ~Mysql_sql_inserts_loader() {}
40
Mysql_sql_inserts_loader(grt::GRT *grt);
43
void load(const std::string &sql, const std::string &schema_name);
47
int process_sql_statement(const SqlAstNode *tree);
50
Parse_result process_insert_statement(const SqlAstNode *tree);
53
std::string _schema_name;
55
class Null_state_keeper : Mysql_sql_parser_base::Null_state_keeper
58
Null_state_keeper(Mysql_sql_inserts_loader *sql_parser)
59
: Mysql_sql_parser_base::Null_state_keeper(sql_parser),
60
_sql_parser(sql_parser)
64
_sql_parser->_schema_name= std::string();
67
Mysql_sql_inserts_loader *_sql_parser;
69
friend class Null_state_keeper;
73
#endif // _MYSQL_SQL_INSERTS_LOADER_H_