~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/change_schema.cc

  • Committer: Monty Taylor
  • Date: 2009-10-06 19:14:39 UTC
  • mfrom: (1130.2.18 plugin-base-class)
  • mto: This revision was merged to the branch mainline in revision 1184.
  • Revision ID: mordred@inaugust.com-20091006191439-fd1vvlp22654l3k3
Merged latest plugin-base-class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "config.h"
 
21
#include <drizzled/server_includes.h>
22
22
#include <drizzled/show.h>
23
23
#include <drizzled/session.h>
24
24
#include <drizzled/statement/change_schema.h>
25
 
#include <drizzled/db.h>
26
 
 
27
 
#include <string>
28
 
 
29
 
using namespace std;
30
25
 
31
26
namespace drizzled
32
27
{
33
28
 
34
29
bool statement::ChangeSchema::execute()
35
30
{
36
 
  Select_Lex *select_lex= &getSession()->lex->select_lex;
 
31
  Select_Lex *select_lex= &session->lex->select_lex;
 
32
  LEX_STRING db_str= { (char *) select_lex->db, strlen(select_lex->db) };
37
33
 
38
 
  identifier::Schema identifier(select_lex->db);
39
 
  if (not change_db(getSession(), identifier))
 
34
  if (! mysql_change_db(session, &db_str, false))
40
35
  {
41
 
    getSession()->my_ok();
 
36
    session->my_ok();
42
37
  }
43
38
 
44
39
  return false;