~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2009-04-05 19:53:29 UTC
  • mfrom: (971.3.11 eday-dev)
  • Revision ID: brian@tangent.org-20090405195329-k2vpiwhlri9oaedq
MergeĀ fromĀ Eric.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#define DRIZZLE_LEX 1
17
17
#include <drizzled/server_includes.h>
18
 
#include <libdrizzleclient/libdrizzle.h>
19
 
#include <libdrizzleclient/errmsg.h>
20
18
#include <mysys/hash.h>
21
19
#include <drizzled/logging.h>
22
20
#include <drizzled/db.h>
152
150
void execute_init_command(Session *session, sys_var_str *init_command_var,
153
151
                          pthread_rwlock_t *var_mutex)
154
152
{
155
 
  Vio* save_vio;
156
153
  ulong save_client_capabilities;
157
154
 
158
155
  session->set_proc_info("Execution of init_command");
166
163
  session->client_capabilities|= CLIENT_MULTI_STATEMENTS;
167
164
  /*
168
165
    We don't need return result of execution to client side.
169
 
    To forbid this we should set session->net.vio to 0.
170
166
  */
171
 
  save_vio= session->net.vio;
172
 
  session->net.vio= 0;
 
167
  session->protocol->disable_results();
173
168
  dispatch_command(COM_QUERY, session,
174
169
                   init_command_var->value,
175
170
                   init_command_var->value_length);
176
171
  pthread_rwlock_unlock(var_mutex);
177
172
  session->client_capabilities= save_client_capabilities;
178
 
  session->net.vio= save_vio;
 
173
  session->protocol->enable_results();
179
174
}
180
175
 
181
176
/**
202
197
bool dispatch_command(enum enum_server_command command, Session *session,
203
198
                      char* packet, uint32_t packet_length)
204
199
{
205
 
  NET *net= &session->net;
206
200
  bool error= 0;
207
201
  Query_id &query_id= Query_id::get_query_id();
208
202
 
253
247
    {
254
248
      char *beginning_of_next_stmt= (char*) end_of_stmt;
255
249
 
256
 
      drizzleclient_net_end_statement(session);
 
250
      session->protocol->end_statement();
257
251
      /*
258
252
        Multiple queries exits, execute them individually
259
253
      */
289
283
  }
290
284
  case COM_QUIT:
291
285
    /* We don't calculate statistics for this command */
292
 
    net->error=0;                               // Don't give 'abort' message
 
286
    session->protocol->set_error(0);
293
287
    session->main_da.disable_status();              // Don't send anything back
294
288
    error=true;                                 // End server
295
289
    break;
334
328
    session->mysys_var->abort= 0;
335
329
  }
336
330
 
337
 
  drizzleclient_net_end_statement(session);
 
331
  session->protocol->end_statement();
338
332
 
339
333
  session->set_proc_info("closing tables");
340
334
  /* Free tables */