~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Stewart Smith
  • Date: 2011-02-07 08:29:23 UTC
  • mto: (2154.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2155.
  • Revision ID: stewart@flamingspork.com-20110207082923-li4wy2hne4mnnych
be sure to start a transaction with a startTransaction call on the first statement when autocommit is OFF. The only statements that DO NOT do this are a) DDL and b) SELECT without a table (e.g. SELECT DATABASE() and SHOW STATUS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
488
488
 
489
489
  assert(session->transaction.stmt.hasModifiedNonTransData() == false);
490
490
 
 
491
  if (! (session->server_status & SERVER_STATUS_AUTOCOMMIT)
 
492
      && ! session->inTransaction()
 
493
      && lex->statement->isTransactional())
 
494
  {
 
495
    if (session->startTransaction() == false)
 
496
    {
 
497
      my_error(drizzled::ER_UNKNOWN_ERROR, MYF(0));
 
498
      return true;
 
499
    }
 
500
  }
 
501
 
491
502
  /* now we are ready to execute the statement */
492
503
  res= lex->statement->execute();
493
504
  session->set_proc_info("query end");
516
527
      param->select_limit=
517
528
        new Item_int((uint64_t) session->variables.select_limit);
518
529
  }
 
530
 
 
531
  if (all_tables
 
532
      && ! (session->server_status & SERVER_STATUS_AUTOCOMMIT)
 
533
      && ! session->inTransaction()
 
534
      && ! lex->statement->isShow())
 
535
  {
 
536
    if (session->startTransaction() == false)
 
537
    {
 
538
      my_error(drizzled::ER_UNKNOWN_ERROR, MYF(0));
 
539
      return true;
 
540
    }
 
541
  }
 
542
 
519
543
  if (not (res= session->openTablesLock(all_tables)))
520
544
  {
521
545
    if (lex->describe)