~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/client/concurrent.h

  • Committer: Andrew Hutchings
  • Date: 2011-06-09 12:08:38 UTC
  • mfrom: (2327 drizzle)
  • mto: This revision was merged to the branch mainline in revision 2330.
  • Revision ID: andrew@linuxjedi.co.uk-20110609120838-swp43bu4e8wnh7ss
Merge turnk into branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
5
 *  Copyright (C) 2011 Vijay Samuel, vjsamuel1990@gmail.com
5
6
 *
6
7
 *  This program is free software; you can redistribute it and/or modify
7
8
 *  it under the terms of the GNU General Public License as published by
20
21
#pragma once
21
22
 
22
23
#include <drizzled/plugin/client.h>
 
24
#include <drizzled/execute/context.h>
 
25
#include <drizzled/execute/parser.h>
23
26
#include <drizzled/util/string.h>
24
 
#include <boost/tokenizer.hpp>
25
27
#include <vector>
26
28
#include <queue>
27
29
#include <string>
 
30
#include <cstdio>
 
31
 
 
32
using namespace std;
28
33
 
29
34
namespace drizzled {
30
35
namespace plugin {
105
110
 
106
111
  void pushSQL(const std::string &arg)
107
112
  {
108
 
    typedef boost::tokenizer<boost::escaped_list_separator<char> > Tokenizer;
109
 
    Tokenizer tok(arg, boost::escaped_list_separator<char>("\\", ";", "\""));
 
113
    ::drizzled::error_t err_msg;
 
114
    ::drizzled::execute::Context *context= new ::drizzled::execute::Context(arg.c_str(), arg.length(), err_msg);
 
115
    std::vector<std::string> parsed_tokens= context->start();
110
116
 
111
117
    {
112
118
      drizzled::util::String byte;
114
120
      byte.append(drizzle_literal_parameter("START TRANSACTION")); // +1 for the COM_QUERY, provided by null count from sizeof()
115
121
      to_execute.push(byte);
116
122
    }
117
 
 
118
 
    for (Tokenizer::iterator iter= tok.begin(); iter != tok.end(); ++iter)
 
123
    
 
124
    for (vector<string>::iterator iter= parsed_tokens.begin(); iter != parsed_tokens.end(); ++iter)
119
125
    {
120
126
      drizzled::util::String byte;
121
127
      byte.assign(1, char(COM_QUERY)); // Insert our COM_QUERY