~drizzle-developers/drizzle/elliott-release

« back to all changes in this revision

Viewing changes to drizzled/statement/set_option.cc

  • Committer: Patrick Crews
  • Date: 2011-02-01 20:33:06 UTC
  • mfrom: (1845.2.288 drizzle)
  • Revision ID: gleebix@gmail.com-20110201203306-mwq2rk0it81tlwxh
Merged Trunk

Show diffs side-by-side

added added

removed removed

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