18
18
* You should have received a copy of the GNU General Public License
19
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
22
* 2005-11-10 Paul McCullagh
643
649
XTThreadPtr self;
645
652
if (!(self = (XTThreadPtr) *thd->getEngineData(pbxt_hton))) {
646
653
*thd->getEngineData(pbxt_hton) = NULL;
655
if ((self = (XTThreadPtr) *thd_ha_data(thd, pbxt_hton))) {
656
*thd_ha_data(thd, pbxt_hton) = NULL;
647
658
xt_free_thread(self);
651
662
xtPublic XTThreadPtr xt_ha_thd_to_self(THD *thd)
653
665
return (XTThreadPtr) *thd->getEngineData(pbxt_hton);
667
return (XTThreadPtr) *thd_ha_data(thd, pbxt_hton);
672
/* The first bit is 1. */
673
static u_int ha_get_max_bit(MX_BITMAP *map)
676
uint32_t cnt = map->numOfBitsInMap();
677
uint32_t max_bit = 0;
679
for (uint32_t i = 0; i < cnt; i++)
680
if (map->isBitSet(i))
685
my_bitmap_map *data_ptr = map->bitmap;
686
my_bitmap_map *end_ptr = map->last_word_ptr;
687
u_int cnt = map->n_bits;
690
for (; end_ptr >= data_ptr; end_ptr--) {
691
if ((b = *end_ptr)) {
694
if (end_ptr == map->getLastWordPtr() && map->getLastWordMask())
695
mask = map->getLastWordMask() >> 1;
698
while (!(b & mask)) {
700
/* Should not happen, but if it does, we hang! */
702
return map->numOfBitsInMap();
707
if (end_ptr == map->getLastWordPtr())
708
cnt = ((cnt-1) / 32) * 32;
657
718
* -----------------------------------------------------------------------
1272
1336
PBXTStorageEngine::~PBXTStorageEngine()
1274
/* We do nothing here, because it is now all done in shutdownPlugin(). */
1278
* The following query from the DBT1 test is VERY slow
1279
* if we do not set HA_READ_ORDER.
1280
* The reason is that it must scan all duplicates, then
1283
* SELECT o_id, o_carrier_id, o_entry_d, o_ol_cnt
1284
* FROM orders FORCE INDEX (o_w_id)
1288
* ORDER BY o_id DESC limit 1;
1291
//#define FLAGS_ARE_READ_DYNAMICALLY
1293
uint32_t PBXTStorageEngine::index_flags(enum ha_key_alg) const
1342
static int pbxt_panic(handlerton *hton, enum ha_panic_function flag)
1295
/* It would be nice if the dynamic version of this function works,
1296
* but it does not. MySQL loads this information when the table is openned,
1297
* and then it is fixed.
1299
* The problem is, I have had to remove the HA_READ_ORDER option although
1300
* it applies to PBXT. PBXT returns entries in index order during an index
1301
* scan in _almost_ all cases.
1303
* A number of cases are demostrated here: [(11)]
1305
* If involves the following conditions:
1306
* - a SELECT FOR UPDATE, UPDATE or DELETE statement
1307
* - an ORDER BY, or join that requires the sort order
1308
* - another transaction which updates the index while it is being
1311
* In this "obscure" case, the index scan may return index
1312
* entries in the wrong order.
1314
#ifdef FLAGS_ARE_READ_DYNAMICALLY
1315
/* If were are in an update (SELECT FOR UPDATE, UPDATE or DELETE), then
1316
* it may be that we return the rows from an index in the wrong
1317
* order! This is due to the fact that update reads wait for transactions
1318
* to commit and this means that index entries may change position during
1321
if (pb_open_tab && pb_open_tab->ot_for_update)
1322
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_KEYREAD_ONLY);
1323
/* If I understand HA_KEYREAD_ONLY then this means I do not
1324
* need to fetch the record associated with an index
1327
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE | HA_KEYREAD_ONLY);
1329
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_KEYREAD_ONLY);
1344
return pbxt_end(hton);
1334
1349
* Kill the PBXT thread associated with the MySQL thread.
1336
1352
int PBXTStorageEngine::close_connection(Session *thd)
1338
1354
PBXTStorageEngine * const hton = this;
1356
static int pbxt_close_connection(handlerton *hton, THD* thd)
1339
1359
XTThreadPtr self;
1341
1361
XT_TRACE_CALL();
1342
1363
if ((self = (XTThreadPtr) *thd->getEngineData(hton))) {
1343
1364
*thd->getEngineData(pbxt_hton) = NULL;
1366
if ((self = (XTThreadPtr) *thd_ha_data(thd, hton))) {
1367
*thd_ha_data(thd, hton) = NULL;
1344
1369
/* Required because freeing the thread could cause
1345
1370
* free of database which could call xt_close_file_ns()!
1419
1448
* pbxt_thr is a pointer the the PBXT thread structure.
1422
1452
int PBXTStorageEngine::commit(Session *thd, bool all)
1424
1454
PBXTStorageEngine * const hton = this;
1456
static int pbxt_commit(handlerton *hton, THD *thd, bool all)
1426
1460
XTThreadPtr self;
1428
1463
if ((self = (XTThreadPtr) *thd->getEngineData(hton))) {
1465
if ((self = (XTThreadPtr) *thd_ha_data(thd, hton))) {
1429
1467
XT_PRINT2(self, "%s pbxt_commit all=%d\n", all ? "END CONN XACT" : "END STAT", all);
1431
1469
if (self->st_xact_data) {
1449
1488
int PBXTStorageEngine::rollback(Session *thd, bool all)
1451
1490
PBXTStorageEngine * const hton = this;
1492
static int pbxt_rollback(handlerton *hton, THD *thd, bool all)
1453
1496
XTThreadPtr self;
1455
if ((self = (XTThreadPtr) *thd->getEngineData(hton))) {
1499
if ((self = (XTThreadPtr) *thd->getEngineData(hton))) {
1501
if ((self = (XTThreadPtr) *thd_ha_data(thd, hton))) {
1456
1503
XT_PRINT2(self, "%s pbxt_rollback all=%d\n", all ? "CONN END XACT" : "STAT END", all);
1458
1505
if (self->st_xact_data) {
2166
* The following query from the DBT1 test is VERY slow
2167
* if we do not set HA_READ_ORDER.
2168
* The reason is that it must scan all duplicates, then
2171
* SELECT o_id, o_carrier_id, o_entry_d, o_ol_cnt
2172
* FROM orders FORCE INDEX (o_w_id)
2176
* ORDER BY o_id DESC limit 1;
2179
#define FLAGS_ARE_READ_DYNAMICALLY
2181
MX_ULONG_T ha_pbxt::index_flags(uint XT_UNUSED(inx), uint XT_UNUSED(part), bool XT_UNUSED(all_parts)) const
2183
/* It would be nice if the dynamic version of this function works,
2184
* but it does not. MySQL loads this information when the table is openned,
2185
* and then it is fixed.
2187
* The problem is, I have had to remove the HA_READ_ORDER option although
2188
* it applies to PBXT. PBXT returns entries in index order during an index
2189
* scan in _almost_ all cases.
2191
* A number of cases are demostrated here: [(11)]
2193
* If involves the following conditions:
2194
* - a SELECT FOR UPDATE, UPDATE or DELETE statement
2195
* - an ORDER BY, or join that requires the sort order
2196
* - another transaction which updates the index while it is being
2199
* In this "obscure" case, the index scan may return index
2200
* entries in the wrong order.
2202
#ifdef FLAGS_ARE_READ_DYNAMICALLY
2203
/* If were are in an update (SELECT FOR UPDATE, UPDATE or DELETE), then
2204
* it may be that we return the rows from an index in the wrong
2205
* order! This is due to the fact that update reads wait for transactions
2206
* to commit and this means that index entries may change position during
2209
if (pb_open_tab && pb_open_tab->ot_for_update)
2210
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_KEYREAD_ONLY);
2211
/* If I understand HA_KEYREAD_ONLY then this means I do not
2212
* need to fetch the record associated with an index
2215
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE | HA_KEYREAD_ONLY);
2217
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_KEYREAD_ONLY);
2121
2221
void ha_pbxt::internal_close(THD *thd, struct XTThread *self)
2123
2223
if (pb_share) {
2168
2268
if (!thd || thd_sql_command(thd) == SQLCOM_FLUSH) // FLUSH TABLES
2169
2269
xt_sync_flush_table(self, ot, thd ? 0 : 4);
2171
/* This change is a result of a problem mentioned by Arjen.
2172
* REPAIR and ALTER lead to the following sequence:
2173
* 1. tab -- copy --> tmp1
2174
* 2. tab -- rename --> tmp2
2175
* 3. tmp1 -- rename --> tab
2178
* PBXT flushes a table before rename.
2179
* In the sequence above results in a table flush in step 3 which can
2180
* take a very long time.
2182
* The problem is, during this time frame we have only temp tables.
2183
* A crash in this state leaves the database in a bad state.
2185
* To reduce the time in this state, the flush needs to be done
2186
* elsewhere. The code below causes the flish to occur after
2189
switch (thd_sql_command(thd)) {
2190
case SQLCOM_RENAME_TABLE:
2191
case SQLCOM_ANALYZE:
2192
case SQLCOM_ALTER_TABLE:
2193
case SQLCOM_CREATE_INDEX:
2194
xt_sync_flush_table(self, ot, thd ? 0 : 4);
2199
2271
freer_(); // xt_db_return_table_to_pool(ot);
2256
2328
xt_tab_load_row_pointers(self, pb_open_tab);
2259
2330
xt_ind_set_index_selectivity(pb_open_tab, self);
2260
#ifdef XT_ROW_COUNT_CORRECTED
2261
/* {CORRECTED-ROW-COUNT} */
2262
pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 - pb_share->sh_table->tab_row_fnum) < 150;
2264
2331
/* {FREE-ROWS-BAD} */
2265
2332
pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 /* - pb_share->sh_table->tab_row_fnum */) < 150;
2269
2335
init_auto_increment(0);
2352
2418
xt_spinlock_lock(&tab->tab_ainc_lock);
2353
if (getTable()->found_next_number_field && !tab->tab_auto_inc) {
2354
Field *tmp_fie = getTable()->next_number_field;
2355
THD *tmp_thd = getTable()->in_use;
2419
if (table->found_next_number_field && !tab->tab_auto_inc) {
2420
Field *tmp_fie = table->next_number_field;
2421
THD *tmp_thd = table->in_use;
2356
2422
xtBool xn_started = FALSE;
2357
2423
XTThreadPtr self = pb_open_tab->ot_thread;
2360
2427
* A table may be opened by a thread with a running
2379
2446
xn_started = TRUE;
2382
2449
/* Setup the conditions for the next call! */
2383
getTable()->in_use = current_thd;
2384
getTable()->next_number_field = getTable()->found_next_number_field;
2450
table->in_use = current_thd;
2451
table->next_number_field = table->found_next_number_field;
2386
2453
extra(HA_EXTRA_KEYREAD);
2387
getTable()->mark_columns_used_by_index_no_reset(getTable()->getShare()->next_number_index, *getTable()->read_set);
2454
table->mark_columns_used_by_index_no_reset(TS(table)->next_number_index, table->read_set);
2388
2455
column_bitmaps_signal();
2389
doStartIndexScan(getTable()->getShare()->next_number_index, 0);
2390
if (!getTable()->getShare()->next_number_key_offset) {
2456
doStartIndexScan(TS(table)->next_number_index, 0);
2457
if (!TS(table)->next_number_key_offset) {
2391
2458
// Autoincrement at key-start
2392
err = index_last(getTable()->getUpdateRecord());
2393
if (!err && !getTable()->next_number_field->is_null(getTable()->getShare()->rec_buff_length)) {
2459
err = index_last(table->getUpdateRecord());
2460
if (!err && !table->next_number_field->is_null(TS(table)->rec_buff_length)) {
2394
2461
/* {PRE-INC} */
2395
nr = (xtWord8) getTable()->next_number_field->val_int_offset(getTable()->getShare()->rec_buff_length);
2462
nr = (xtWord8) table->next_number_field->val_int_offset(TS(table)->rec_buff_length);
2504
2571
nr_int_val = nr->val_int();
2505
2572
tab = ot->ot_table;
2507
if (nr->cmp_internal((const unsigned char *)&tab->tab_auto_inc) > 0) {
2574
if (nr->cmp((const unsigned char *)&tab->tab_auto_inc) > 0) {
2508
2575
xt_spinlock_lock(&tab->tab_ainc_lock);
2510
if (nr->cmp_internal((const unsigned char *)&tab->tab_auto_inc) > 0) {
2512
* We increment later, so just set the value!
2513
MX_ULONGLONG_T nr_int_val_plus_one = nr_int_val + 1;
2514
if (nr->cmp((const unsigned char *)&nr_int_val_plus_one) < 0)
2515
tab->tab_auto_inc = nr_int_val_plus_one;
2518
tab->tab_auto_inc = nr_int_val;
2577
if (nr->cmp((const unsigned char *)&tab->tab_auto_inc) > 0) {
2579
* We increment later, so just set the value!
2580
MX_ULONGLONG_T nr_int_val_plus_one = nr_int_val + 1;
2581
if (nr->cmp((const unsigned char *)&nr_int_val_plus_one) < 0)
2582
tab->tab_auto_inc = nr_int_val_plus_one;
2585
tab->tab_auto_inc = nr_int_val;
2520
2587
xt_spinlock_unlock(&tab->tab_ainc_lock);
2609
2676
pb_import_row_count++;
2612
if (getTable()->next_number_field && buf == getTable()->getInsertRecord()) {
2679
if (table->next_number_field && buf == table->getInsertRecord()) {
2613
2680
int update_err = update_auto_increment();
2614
2681
if (update_err) {
2615
2682
ha_log_pbxt_thread_error_for_mysql(pb_ignore_dup_key);
2616
2683
err = update_err;
2619
ha_set_auto_increment(pb_open_tab, getTable()->next_number_field);
2686
ha_set_auto_increment(pb_open_tab, table->next_number_field);
2622
2689
if (!xt_tab_new_record(pb_open_tab, (xtWord1 *) buf)) {
2698
2765
XT_PRINT1(self, "update_row (%s)\n", pb_share->sh_table_path->ps_path);
2699
2766
XT_DISABLED_TRACE(("UPDATE tx=%d val=%d\n", (int) self->st_xact_data->xd_start_xn_id, (int) XT_GET_DISK_4(&new_data[1])));
2700
2767
//statistic_increment(ha_update_count,&LOCK_status);
2702
2768
/* {START-STAT-HACK} previously position of start statement hack. */
2704
2769
xt_xlog_check_long_writer(self);
2706
2771
/* {UPDATE-STACK} */
2734
2799
* update t1 set a=2 where a=1;
2735
2800
* insert into t1 (val) values (1);
2737
if (getTable()->found_next_number_field && new_data == getTable()->getInsertRecord()) {
2802
if (table->found_next_number_field && new_data == table->getInsertRecord()) {
2738
2803
MX_LONGLONG_T nr;
2739
const boost::dynamic_bitset<>& old_bitmap= getTable()->use_all_columns(*getTable()->read_set);
2740
nr = getTable()->found_next_number_field->val_int();
2741
ha_set_auto_increment(pb_open_tab, getTable()->found_next_number_field);
2742
getTable()->restore_column_map(old_bitmap);
2804
my_bitmap_map *old_map;
2806
old_map = mx_tmp_use_all_columns(table, table->read_set);
2807
nr = table->found_next_number_field->val_int();
2808
ha_set_auto_increment(pb_open_tab, table->found_next_number_field);
2809
mx_tmp_restore_column_map(table, old_map);
2745
2812
if (!xt_tab_update_record(pb_open_tab, (xtWord1 *) old_data, (xtWord1 *) new_data))
3089
3154
return ha_log_pbxt_thread_error_for_mysql(FALSE);
3094
static std::string convert_long_to_bit_string(uint64_t bitset, uint64_t bitset_size)
3099
res.push_back((bitset & 1) + '0');
3104
std::reverse(res.begin(), res.end());
3110
std::string final(bitset_size - res.length(), '0');
3116
3157
int ha_pbxt::doStartIndexScan(uint idx, bool XT_UNUSED(sorted))
3118
3159
XTIndexPtr ind;
3189
3230
* seem to have this problem!
3191
3232
ind = (XTIndexPtr) pb_share->sh_dic_keys[idx];
3194
* Need to do this for drizzle because we use boost's dynamic_bitset
3195
* to represent the bitsets and allocating memory for an object of that
3196
* type does not play well with the memory allocation routines in PBXT.
3197
* For that reason, we just store a uint which represents the bitset
3198
* in the XTIndexPtr structure for PBXT.
3200
std::string bitmap_str= convert_long_to_bit_string(ind->mi_col_map, ind->mi_col_map_size);
3201
MX_BITMAP tmp(bitmap_str);
3202
if (MX_BIT_IS_SUBSET(getTable()->read_set, tmp))
3204
if (MX_BIT_IS_SUBSET(getTable()->read_set, ind->mi_col_map))
3233
if (MX_BIT_IS_SUBSET(table->read_set, &ind->mi_col_map))
3206
3234
pb_key_read = TRUE;
3207
3235
#ifdef XT_PRINT_INDEX_OPT
3208
3236
printf("index_init %s index %d cols req=%d/%d read_bits=%X write_bits=%X index_bits=%X converage=%d\n", pb_open_tab->ot_table->tab_name->ps_path, (int) idx, pb_open_tab->ot_cols_req, table->read_set->MX_BIT_SIZE(), (int) *table->read_set->bitmap, (int) *table->write_set->bitmap, (int) *ind->mi_col_map.bitmap, (int) (MX_BIT_IS_SUBSET(table->read_set, &ind->mi_col_map) != 0));
3646
3674
/* The number of columns required: */
3647
3675
if (pb_open_tab->ot_is_modify) {
3648
pb_open_tab->ot_cols_req = getTable()->read_set->MX_BIT_SIZE();
3676
pb_open_tab->ot_cols_req = table->read_set->MX_BIT_SIZE();
3649
3677
/* {START-STAT-HACK} previously position of start statement hack,
3650
3678
* previous comment to code below: */
3651
3679
/* Start a statement based transaction as soon
3901
3927
* #1 0x0022e1f1 in make_sortkey at filesort.cc:769
3902
3928
* #2 0x0022f1cf in find_all_keys at filesort.cc:619
3903
3929
* #3 0x00230eec in filesort at filesort.cc:243
3904
* #4 0x001b9d89 in update_query at sql_update.cc:415
3930
* #4 0x001b9d89 in mysql_update at sql_update.cc:415
3905
3931
* #5 0x0010db12 in mysql_execute_command at sql_parse.cc:2959
3906
3932
* #6 0x0011480d in mysql_parse at sql_parse.cc:5787
3907
3933
* #7 0x00115afb in dispatch_command at sql_parse.cc:1200
3913
3939
* the actual number of vectors. But it must assume that it has at
3914
3940
* least EXTRA_RECORDS vectors.
3916
#ifdef XT_ROW_COUNT_CORRECTED
3917
if (tab->tab_row_eof_id <= tab->tab_row_fnum ||
3918
(!tab->tab_row_free_id && tab->tab_row_fnum))
3919
xt_tab_check_free_lists(NULL, ot, false, true);
3920
stats.records = (ha_rows) tab->tab_row_eof_id - 1;
3921
if (stats.records >= tab->tab_row_fnum) {
3922
stats.deleted = tab->tab_row_fnum;
3923
stats.records -= stats.deleted;
3930
stats.deleted = /* tab->tab_row_fnum */ 0;
3931
stats.records = (ha_rows) (tab->tab_row_eof_id - 1 /* - stats.deleted */);
3933
stats.data_file_length = xt_rec_id_to_rec_offset(tab, tab->tab_rec_eof_id);
3934
stats.index_file_length = xt_ind_node_to_offset(tab, tab->tab_ind_eof);
3935
stats.delete_length = tab->tab_rec_fnum * ot->ot_rec_size;
3942
stats.deleted = /* ot->ot_table->tab_row_fnum */ 0;
3943
stats.records = (ha_rows) (ot->ot_table->tab_row_eof_id - 1 /* - stats.deleted */);
3944
stats.data_file_length = xt_rec_id_to_rec_offset(ot->ot_table, ot->ot_table->tab_rec_eof_id);
3945
stats.index_file_length = xt_ind_node_to_offset(ot->ot_table, ot->ot_table->tab_ind_eof);
3946
stats.delete_length = ot->ot_table->tab_rec_fnum * ot->ot_rec_size;
3936
3947
//check_time = info.check_time;
3937
3948
stats.mean_rec_length = (ulong) ot->ot_rec_size;
3940
#if 0 // Commented out, I am pretty sure this will blow up on someone since the global share should be treated as being non-mutable
3941
3951
if (flag & HA_STATUS_CONST) {
3942
3952
ha_rows rec_per_key;
3943
3953
XTIndexPtr ind;
4384
4405
XT_RETURN(err);
4409
int ha_pbxt::repair(THD *XT_UNUSED(thd), HA_CHECK_OPT *XT_UNUSED(check_opt))
4411
return(HA_ADMIN_TRY_ALTER);
4415
* This is mapped to "ALTER TABLE tablename TYPE=PBXT", which rebuilds
4416
* the table in MySQL.
4418
int ha_pbxt::optimize(THD *XT_UNUSED(thd), HA_CHECK_OPT *XT_UNUSED(check_opt))
4420
return(HA_ADMIN_TRY_ALTER);
4388
4425
extern int pbxt_mysql_trace_on;
4391
4429
int ha_pbxt::check(THD* thd)
4431
int ha_pbxt::check(THD* thd, HA_CHECK_OPT* XT_UNUSED(check_opt))
4394
4435
XTThreadPtr self;
4553
4594
if (pb_share->sh_recalc_selectivity) {
4554
#ifdef XT_ROW_COUNT_CORRECTED
4555
/* {CORRECTED-ROW-COUNT} */
4556
if ((pb_share->sh_table->tab_row_eof_id - 1 - pb_share->sh_table->tab_row_fnum) >= 200)
4558
4595
/* {FREE-ROWS-BAD} */
4559
if ((pb_share->sh_table->tab_row_eof_id - 1 /* - pb_share->sh_table->tab_row_fnum */) >= 200)
4596
if ((pb_share->sh_table->tab_row_eof_id - 1 /* - pb_share->sh_table->tab_row_fnum */) >= 200) {
4563
4598
pb_share->sh_recalc_selectivity = FALSE;
4564
4599
xt_ind_set_index_selectivity(pb_open_tab, self);
4565
#ifdef XT_ROW_COUNT_CORRECTED
4566
/* {CORRECTED-ROW-COUNT} */
4567
pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 - pb_share->sh_table->tab_row_fnum) < 150;
4569
4600
/* {FREE-ROWS-BAD} */
4570
4601
pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 /* - pb_share->sh_table->tab_row_fnum */) < 150;
5629
5662
StorageEngine::writeDefinitionFromPath(ident, proto);
5631
Session::QueryString query_string(thd->getQueryString());
5632
tab_def = xt_ri_create_table(self, true, (XTPathStrPtr) table_path, const_cast<char *>(query_string->c_str()), myxt_create_table_from_table(self, table_arg.getMutableShare()), &source_dic);
5664
tab_def = xt_ri_create_table(self, true, (XTPathStrPtr) table_path, const_cast<char *>(thd->getQueryString().c_str()), myxt_create_table_from_table(self, table_arg.s), &source_dic);
5633
5665
tab_def->checkForeignKeys(self, proto.type() == message::Table::TEMPORARY);
5635
5667
dic.dic_table = tab_def;
5636
dic.dic_my_table = table_arg.getMutableShare();
5668
dic.dic_my_table = table_arg.s;
5637
5669
dic.dic_tab_flags = source_dic.dic_tab_flags;
5638
5670
//if (create_info.storage_media == HA_SM_MEMORY)
5639
5671
// dic.dic_tab_flags |= XT_TF_MEMORY_TABLE;
5700
5732
if (!self->st_database)
5701
5733
xt_ha_open_database_of_table(self, NULL);
5703
assert(!self->st_xact_data); // Check we're not called twice
5704
if (!xt_xn_begin(self)) {
5705
err = xt_ha_pbxt_thread_error_for_mysql(thd, self, /*pb_ignore_dup_key*/false);
5735
if (!xt_xn_begin(self)) {
5736
err = xt_ha_pbxt_thread_error_for_mysql(thd, self, /*pb_ignore_dup_key*/false);
5723
5755
return xt_ha_pbxt_thread_error_for_mysql(thd, xt_ha_thd_to_self(thd), false);
5726
int PBXTStorageEngine::doCommit(drizzled::Session* thd, bool real_commit)
5758
int PBXTStorageEngine::doCommit(drizzled::Session* thd, bool)
5729
5761
XTThreadPtr self = (XTThreadPtr) *thd->getEngineData(pbxt_hton);
5763
bool real_commit = !session_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
5731
5765
XT_PRINT1(self, "PBXTStorageEngine::doCommit(real_commit = %s)\n", real_commit ? "true" : "false");
5733
5767
if (real_commit && self) {
5741
int PBXTStorageEngine::doRollback(drizzled::Session* thd, bool real_commit)
5775
int PBXTStorageEngine::doRollback(drizzled::Session* thd, bool)
5744
5778
XTThreadPtr self = (XTThreadPtr) *thd->getEngineData(pbxt_hton);
5780
bool real_commit = !session_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
5746
5782
XT_PRINT1(self, "PBXTStorageEngine::doRollback(real_commit = %s)\n", real_commit ? "true" : "false");
5748
5784
if (real_commit && self) {