~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libmysql/client.c

  • Committer: Brian Aker
  • Date: 2008-07-02 21:16:23 UTC
  • Revision ID: brian@tangent.org-20080702211623-lix7xclpnm217nov
Remaining major pieces of PS removed

Show diffs side-by-side

added added

removed removed

Lines of Context:
744
744
my_bool
745
745
cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
746
746
                     const uchar *header, ulong header_length,
747
 
                     const uchar *arg, ulong arg_length, my_bool skip_check,
748
 
                     MYSQL_STMT *stmt)
 
747
                     const uchar *arg, ulong arg_length, my_bool skip_check)
749
748
{
750
749
  NET *net= &mysql->net;
751
750
  my_bool result= 1;
752
751
  init_sigpipe_variables
753
 
  my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
 
752
  my_bool stmt_skip= FALSE;
754
753
  DBUG_ENTER("cli_advanced_command");
755
754
 
756
755
  /* Don't give sigpipe errors if the client doesn't want them */
2320
2319
  tmp_mysql.reconnect= 1;
2321
2320
  tmp_mysql.free_me= mysql->free_me;
2322
2321
 
2323
 
  /*
2324
 
    For each stmt in mysql->stmts, move it to tmp_mysql if it is
2325
 
    in state MYSQL_STMT_INIT_DONE, otherwise close it.
2326
 
  */
2327
 
  {
2328
 
    LIST *element= mysql->stmts;
2329
 
    for (; element; element= element->next)
2330
 
    {
2331
 
      MYSQL_STMT *stmt= (MYSQL_STMT *) element->data;
2332
 
      if (stmt->state != MYSQL_STMT_INIT_DONE)
2333
 
      {
2334
 
        stmt->mysql= 0;
2335
 
        stmt->last_errno= CR_SERVER_LOST;
2336
 
        strmov(stmt->last_error, ER(CR_SERVER_LOST));
2337
 
        strmov(stmt->sqlstate, unknown_sqlstate);
2338
 
      }
2339
 
      else
2340
 
      {
2341
 
        tmp_mysql.stmts= list_add(tmp_mysql.stmts, &stmt->list);
2342
 
      }
2343
 
      /* No need to call list_delete for statement here */
2344
 
    }
2345
 
    mysql->stmts= NULL;
2346
 
  }
2347
 
 
2348
2322
  /* Don't free options as these are now used in tmp_mysql */
2349
2323
  bzero((char*) &mysql->options,sizeof(mysql->options));
2350
2324
  mysql->free_me=0;