~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/set_option.cc

  • Committer: Lee Bieber
  • Date: 2011-01-05 19:01:18 UTC
  • mfrom: (2053.2.3 trunk-bug-696188)
  • Revision ID: kalebral@gmail.com-20110105190118-kiq5sez67rvi4kl7
Merge Andrew - fix bug 696188: error handling for drizzle client stdin replacement problems

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
#include <drizzled/show.h>
23
23
#include <drizzled/session.h>
24
24
#include <drizzled/statement/set_option.h>
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()->getLex()->query_tables;
 
31
  TableList *all_tables= session->lex->query_tables;
45
32
 
46
 
  if (getSession()->openTablesLock(all_tables))
 
33
  if (session->openTablesLock(all_tables))
47
34
  {
48
35
    return true;
49
36
  }
50
 
  bool res= sql_set_variables(getSession(), getSession()->getLex()->var_list);
 
37
  bool res= sql_set_variables(session, session->lex->var_list);
51
38
  if (res)
52
39
  {
53
40
    /*
55
42
     * Send something semi-generic here since we don't know which
56
43
     * assignment in the list caused the error.
57
44
     */
58
 
    if (! getSession()->is_error())
 
45
    if (! session->is_error())
59
46
    {
60
47
      my_error(ER_WRONG_ARGUMENTS, MYF(0), "SET");
61
48
    }
62
49
  }
63
50
  else
64
51
  {
65
 
    getSession()->my_ok();
 
52
    session->my_ok();
66
53
  }
67
54
 
68
55
  return res;