~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Jay Pipes
  • Date: 2009-03-16 05:02:26 UTC
  • mto: This revision was merged to the branch mainline in revision 941.
  • Revision ID: jpipes@serialcoder-20090316050226-d0j3pe2wn3wpmndb
Moves end_trans(), begin_trans(), end_active_trans() out of the parser module and adds startTransaction(), endTransaction(), and endActiveTransaction() member methods of Session object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2374
2374
  int result_code= 0;
2375
2375
  const CHARSET_INFO * const cs= system_charset_info;
2376
2376
 
2377
 
  if (end_active_trans(session))
 
2377
  if (! session->endActiveTransaction())
2378
2378
    return(1);
2379
2379
  field_list.push_back(item = new Item_empty_string("Table",
2380
2380
                                                    NAME_CHAR_LEN * 2,
2430
2430
      switch ((*prepare_func)(session, table, check_opt)) {
2431
2431
      case  1:           // error, message written to net
2432
2432
        ha_autocommit_or_rollback(session, 1);
2433
 
        end_trans(session, ROLLBACK);
 
2433
        session->endTransaction(ROLLBACK);
2434
2434
        close_thread_tables(session);
2435
2435
        continue;
2436
2436
      case -1:           // error, message could be written to net
2471
2471
                       table_name);
2472
2472
      protocol->store(buff, length, system_charset_info);
2473
2473
      ha_autocommit_or_rollback(session, 0);
2474
 
      end_trans(session, COMMIT);
 
2474
      session->endTransaction(COMMIT);
2475
2475
      close_thread_tables(session);
2476
2476
      lex->reset_query_tables_list(false);
2477
2477
      table->table=0;                           // For query cache
2710
2710
      }
2711
2711
    }
2712
2712
    ha_autocommit_or_rollback(session, 0);
2713
 
    end_trans(session, COMMIT);
 
2713
    session->endTransaction(COMMIT);
2714
2714
    close_thread_tables(session);
2715
2715
    table->table=0;                             // For query cache
2716
2716
    if (protocol->write())
2722
2722
 
2723
2723
err:
2724
2724
  ha_autocommit_or_rollback(session, 1);
2725
 
  end_trans(session, ROLLBACK);
 
2725
  session->endTransaction(ROLLBACK);
2726
2726
  close_thread_tables(session);                 // Shouldn't be needed
2727
2727
  if (table)
2728
2728
    table->table=0;
3141
3141
 
3142
3142
  /* The ALTER Table is always in its own transaction */
3143
3143
  error = ha_autocommit_or_rollback(session, 0);
3144
 
  if (end_active_trans(session))
 
3144
  if (! session->endActiveTransaction())
3145
3145
    error=1;
3146
3146
  if (error)
3147
3147
    goto err;
4811
4811
    alter_table_manage_keys(table, table->file->indexes_are_disabled(),
4812
4812
                            alter_info->keys_onoff);
4813
4813
    error= ha_autocommit_or_rollback(session, 0);
4814
 
    if (end_active_trans(session))
 
4814
    if (! session->endActiveTransaction())
4815
4815
      error= 1;
4816
4816
  }
4817
4817
  /* We must not ignore bad input! */;
5251
5251
  */
5252
5252
  if (ha_autocommit_or_rollback(session, 0))
5253
5253
    error=1;
5254
 
  if (end_active_trans(session))
 
5254
  if (! session->endActiveTransaction())
5255
5255
    error=1;
5256
5256
 
5257
5257
 err: