#ifndef _MYSQL_SQL_SEMANTIC_CHECK_H_
#define _MYSQL_SQL_SEMANTIC_CHECK_H_


#include "mysql_sql_syntax_check.h"
#include "grtsqlparser/sql_semantic_check.h"


/** Implements DBMS specifics.
 * 
 * @ingroup sqlparser
 */
class MYSQL_SQL_PARSER_PUBLIC_FUNC Mysql_sql_semantic_check
  : virtual protected Mysql_sql_syntax_check, virtual public Sql_semantic_check
{
public:
  Mysql_sql_semantic_check(grt::GRT *grt);

protected:
  virtual Parse_result check_sql(const MyxSQLTreeItem *tree);
  virtual Parse_result check_trigger(const MyxSQLTreeItem *tree, const MyxSQLTreeItem *trigger_tail);
  virtual Parse_result check_view(const MyxSQLTreeItem *tree, const MyxSQLTreeItem *view_tail);
  virtual Parse_result check_routine(const MyxSQLTreeItem *tree, const MyxSQLTreeItem *routine_tail);

  class Null_state_keeper : Mysql_sql_syntax_check::Null_state_keeper
  {
  public:
    Null_state_keeper(Mysql_sql_semantic_check *sql_parser)
      : Mysql_sql_syntax_check::Null_state_keeper(sql_parser), _sql_parser(sql_parser) {}
    ~Null_state_keeper();
  private:
    Mysql_sql_semantic_check *_sql_parser;
  };
};


#endif // _MYSQL_SQL_SEMANTIC_CHECK_H_
