~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/set_option.cc

  • Committer: Monty Taylor
  • Date: 2010-03-25 22:03:21 UTC
  • mto: This revision was merged to the branch mainline in revision 1408.
  • Revision ID: mordred@inaugust.com-20100325220321-bf5vs8tryb4a8ssh
Updated the search for libmemcached.

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
26
26
namespace drizzled
27
27
{
28
28
 
29
 
namespace statement
30
 
{
31
 
SetOption::SetOption(Session *in_session) :
32
 
  Statement(in_session),
33
 
  one_shot_set(false)
34
 
  {
35
 
    getSession()->getLex()->sql_command= SQLCOM_SET_OPTION;
36
 
    init_select(getSession()->getLex());
37
 
    getSession()->getLex()->option_type= OPT_SESSION;
38
 
    getSession()->getLex()->var_list.empty();
39
 
  }
40
 
} // namespace statement
41
 
 
42
29
bool statement::SetOption::execute()
43
30
{
44
 
  TableList *all_tables= getSession()->lex->query_tables;
 
31
  TableList *all_tables= session->lex->query_tables;
 
32
  List<set_var_base> *lex_var_list= &session->lex->var_list;
45
33
 
46
 
  if (getSession()->openTablesLock(all_tables))
 
34
  if (session->openTablesLock(all_tables))
47
35
  {
48
36
    return true;
49
37
  }
50
 
  bool res= sql_set_variables(getSession(), getSession()->lex->var_list);
 
38
  bool res= sql_set_variables(session, lex_var_list);
51
39
  if (res)
52
40
  {
53
41
    /*
55
43
     * Send something semi-generic here since we don't know which
56
44
     * assignment in the list caused the error.
57
45
     */
58
 
    if (! getSession()->is_error())
 
46
    if (! session->is_error())
59
47
    {
60
48
      my_error(ER_WRONG_ARGUMENTS, MYF(0), "SET");
61
49
    }
62
50
  }
63
51
  else
64
52
  {
65
 
    getSession()->my_ok();
 
53
    session->my_ok();
66
54
  }
67
55
 
68
56
  return res;