~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include <drizzled/sql_base.h>
42
42
#include <drizzled/show.h>
43
43
#include <drizzled/item/cmpfunc.h>
44
 
#include <drizzled/transaction_services.h>
 
44
#include <drizzled/replication_services.h>
45
45
#include <drizzled/check_stack_overrun.h>
46
46
#include <drizzled/lock.h>
47
47
#include <drizzled/listen.h>
49
49
 
50
50
using namespace std;
51
51
 
52
 
extern drizzled::TransactionServices transaction_services;
 
52
extern drizzled::ReplicationServices replication_services;
53
53
 
54
54
/**
55
55
  @defgroup Data_Dictionary Data Dictionary
267
267
        unused_tables= NULL;
268
268
    }
269
269
  }
270
 
 
271
270
  free(table);
272
271
}
273
272
 
780
779
  if (free_share)
781
780
  {
782
781
    table->s->free_table_share();
783
 
    delete table;
 
782
    /* This makes me sad, but we're allocating it via malloc */
 
783
    free(table);
784
784
  }
785
785
}
786
786
 
1435
1435
 
1436
1436
    if (table_list->create)
1437
1437
    {
1438
 
      if (ha_table_exists_in_engine(this, table_list->db,
1439
 
                                    table_list->table_name)
1440
 
          != HA_ERR_TABLE_EXIST)
 
1438
      char path[FN_REFLEN];
 
1439
      size_t length;
 
1440
 
 
1441
      length= build_table_filename(path, sizeof(path),
 
1442
                                   table_list->db, table_list->table_name,
 
1443
                                   false);
 
1444
 
 
1445
      if (StorageEngine::getTableProto(path, NULL) != EEXIST)
1441
1446
      {
1442
1447
        /*
1443
1448
          Table to be created, so we need to create placeholder in table-cache.
1463
1468
    }
1464
1469
 
1465
1470
    /* make a new table */
1466
 
    table= new Table;
 
1471
    table= (Table *)malloc(sizeof(Table));
1467
1472
    if (table == NULL)
1468
1473
    {
1469
1474
      pthread_mutex_unlock(&LOCK_open);
2192
2197
        end= query;
2193
2198
        end+= sprintf(query, "DELETE FROM `%s`.`%s`", share->db.str,
2194
2199
                      share->table_name.str);
2195
 
        transaction_services.rawStatement(session, query, (size_t)(end - query)); 
 
2200
        replication_services.rawStatement(session, query, (size_t)(end - query)); 
2196
2201
        free(query);
2197
2202
      }
2198
2203
      else