~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/ha_pbxt.cc

  • Committer: patrick crews
  • Date: 2010-09-29 15:15:19 UTC
  • mfrom: (1099.4.188 drizzle)
  • Revision ID: gleebix@gmail.com-20100929151519-6mrmzd1ciw2p9nws
Tags: 2010.09.1802
Update translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2005 PrimeBase Technologies GmbH
 
1
/* Copyright (c) 2005 PrimeBase Technologies GmbH
2
2
 *
3
3
 * Derived from ha_example.h
4
4
 * Copyright (C) 2003 MySQL AB
17
17
 *
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
21
21
 *
22
22
 * 2005-11-10   Paul McCullagh
23
23
 *
47
47
#include <drizzled/data_home.h>
48
48
#include <drizzled/error.h>
49
49
#include <drizzled/table.h>
 
50
#include <drizzled/field/timestamp.h>
50
51
#include <drizzled/session.h>
51
52
 
52
 
#include <string>
53
 
 
54
53
#define my_strdup(a,b) strdup(a)
55
54
 
56
55
using namespace drizzled;
197
196
static char                             *pbxt_data_file_grow_size;
198
197
static char                             *pbxt_row_file_grow_size;
199
198
static char                             *pbxt_record_write_threshold;
 
199
static my_bool                  pbxt_support_xa;
200
200
 
201
201
#ifndef DRIZZLED
202
202
// drizzle complains it's not used
203
 
static my_bool                  pbxt_support_xa;
204
203
static XTXactEnumXARec  pbxt_xa_enum;
205
204
#endif
206
205
 
1481
1480
        return 0;
1482
1481
}
1483
1482
 
1484
 
Cursor *PBXTStorageEngine::create(Table& table)
 
1483
Cursor *PBXTStorageEngine::create(TableShare& table)
1485
1484
{
1486
1485
        return new ha_pbxt(*this, table);
1487
1486
}
2019
2018
 *
2020
2019
 */
2021
2020
 
2022
 
ha_pbxt::ha_pbxt(plugin::StorageEngine &engine_arg, Table &table_arg) : Cursor(engine_arg, table_arg)
 
2021
ha_pbxt::ha_pbxt(plugin::StorageEngine &engine_arg, TableShare &table_arg) : Cursor(engine_arg, table_arg)
2023
2022
{
2024
2023
        pb_share = NULL;
2025
2024
        pb_open_tab = NULL;
2350
2349
                return;
2351
2350
 
2352
2351
        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;
 
2352
        if (table->found_next_number_field && !tab->tab_auto_inc) {
 
2353
                Field           *tmp_fie = table->next_number_field;
 
2354
                THD                     *tmp_thd = table->in_use;
2356
2355
                xtBool          xn_started = FALSE;
2357
2356
                XTThreadPtr     self = pb_open_tab->ot_thread;
2358
2357
 
2380
2379
                }
2381
2380
 
2382
2381
                /* Setup the conditions for the next call! */
2383
 
                getTable()->in_use = current_thd;
2384
 
                getTable()->next_number_field = getTable()->found_next_number_field;
 
2382
                table->in_use = current_thd;
 
2383
                table->next_number_field = table->found_next_number_field;
2385
2384
 
2386
2385
                extra(HA_EXTRA_KEYREAD);
2387
 
                getTable()->mark_columns_used_by_index_no_reset(getTable()->getShare()->next_number_index, *getTable()->read_set);
 
2386
                table->mark_columns_used_by_index_no_reset(TS(table)->next_number_index, table->read_set);
2388
2387
                column_bitmaps_signal();
2389
 
                doStartIndexScan(getTable()->getShare()->next_number_index, 0);
2390
 
                if (!getTable()->getShare()->next_number_key_offset) {
 
2388
                doStartIndexScan(TS(table)->next_number_index, 0);
 
2389
                if (!TS(table)->next_number_key_offset) {
2391
2390
                        // Autoincrement at key-start
2392
 
                        err = index_last(getTable()->getUpdateRecord());
2393
 
                        if (!err && !getTable()->next_number_field->is_null(getTable()->getShare()->rec_buff_length)) {
 
2391
                        err = index_last(table->getUpdateRecord());
 
2392
                        if (!err && !table->next_number_field->is_null(TS(table)->rec_buff_length)) {
2394
2393
                                /* {PRE-INC} */
2395
 
                                nr = (xtWord8) getTable()->next_number_field->val_int_offset(getTable()->getShare()->rec_buff_length);
 
2394
                                nr = (xtWord8) table->next_number_field->val_int_offset(TS(table)->rec_buff_length);
2396
2395
                        }
2397
2396
                }
2398
2397
                else {
2402
2401
                         */
2403
2402
                        xtWord8 val;
2404
2403
 
2405
 
                        err = index_first(getTable()->getUpdateRecord());
 
2404
                        err = index_first(table->getUpdateRecord());
2406
2405
                        while (!err) {
2407
2406
                                /* {PRE-INC} */
2408
 
                                val = (xtWord8) getTable()->next_number_field->val_int_offset(getTable()->getShare()->rec_buff_length);
 
2407
                                val = (xtWord8) table->next_number_field->val_int_offset(TS(table)->rec_buff_length);
2409
2408
                                if (val > nr)
2410
2409
                                        nr = val;
2411
 
                                err = index_next(getTable()->getUpdateRecord());
 
2410
                                err = index_next(table->getUpdateRecord());
2412
2411
                        }
2413
2412
                }
2414
2413
 
2443
2442
                        tab->tab_auto_inc = min_auto_inc-1;
2444
2443
 
2445
2444
                /* Restore the changed values: */
2446
 
                getTable()->next_number_field = tmp_fie;
2447
 
                getTable()->in_use = tmp_thd;
 
2445
                table->next_number_field = tmp_fie;
 
2446
                table->in_use = tmp_thd;
2448
2447
 
2449
2448
                if (xn_started) {
2450
2449
                        XT_PRINT0(self, "xt_xn_commit in init_auto_increment\n");
2479
2478
                nr += increment - ((nr - offset) % increment);
2480
2479
        else
2481
2480
                nr += increment;
2482
 
        if (getTable()->next_number_field->cmp((const unsigned char *)&nr_less_inc, (const unsigned char *)&nr) < 0)
 
2481
        if (table->next_number_field->cmp((const unsigned char *)&nr_less_inc, (const unsigned char *)&nr) < 0)
2483
2482
                tab->tab_auto_inc = (xtWord8) (nr);
2484
2483
        else
2485
2484
                nr = ~0;        /* indicate error to the caller */
2504
2503
        nr_int_val = nr->val_int();
2505
2504
        tab = ot->ot_table;
2506
2505
 
2507
 
        if (nr->cmp_internal((const unsigned char *)&tab->tab_auto_inc) > 0) {
 
2506
        if (nr->cmp((const unsigned char *)&tab->tab_auto_inc) > 0) {
2508
2507
                xt_spinlock_lock(&tab->tab_ainc_lock);
2509
2508
 
2510
 
                if (nr->cmp_internal((const unsigned char *)&tab->tab_auto_inc) > 0) {
2511
 
                  /* {PRE-INC}
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;
2516
 
                   else
2517
 
                 */
2518
 
                  tab->tab_auto_inc = nr_int_val;
2519
 
                }
 
2509
                if (nr->cmp((const unsigned char *)&tab->tab_auto_inc) > 0) {
 
2510
                        /* {PRE-INC}
 
2511
                         * We increment later, so just set the value!
 
2512
                        MX_ULONGLONG_T nr_int_val_plus_one = nr_int_val + 1;
 
2513
                        if (nr->cmp((const unsigned char *)&nr_int_val_plus_one) < 0)
 
2514
                                tab->tab_auto_inc = nr_int_val_plus_one;
 
2515
                        else
 
2516
                         */
 
2517
                        tab->tab_auto_inc = nr_int_val;
 
2518
                }
2520
2519
                xt_spinlock_unlock(&tab->tab_ainc_lock);
2521
2520
        }
2522
2521
 
2609
2608
                        pb_import_row_count++;
2610
2609
        }
2611
2610
 
2612
 
        if (getTable()->next_number_field && buf == getTable()->getInsertRecord()) {
 
2611
        if (table->next_number_field && buf == table->getInsertRecord()) {
2613
2612
                int update_err = update_auto_increment();
2614
2613
                if (update_err) {
2615
2614
                        ha_log_pbxt_thread_error_for_mysql(pb_ignore_dup_key);
2616
2615
                        err = update_err;
2617
2616
                        goto done;
2618
2617
                }
2619
 
                ha_set_auto_increment(pb_open_tab, getTable()->next_number_field);
 
2618
                ha_set_auto_increment(pb_open_tab, table->next_number_field);
2620
2619
        }
2621
2620
 
2622
2621
        if (!xt_tab_new_record(pb_open_tab, (xtWord1 *) buf)) {
2734
2733
         * update t1 set a=2 where a=1;
2735
2734
         * insert into t1 (val) values (1);
2736
2735
         */
2737
 
        if (getTable()->found_next_number_field && new_data == getTable()->getInsertRecord()) {
 
2736
        if (table->found_next_number_field && new_data == table->getInsertRecord()) {
2738
2737
                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);
 
2738
                my_bitmap_map   *old_map;
 
2739
 
 
2740
                old_map = mx_tmp_use_all_columns(table, table->read_set);
 
2741
                nr = table->found_next_number_field->val_int();
 
2742
                ha_set_auto_increment(pb_open_tab, table->found_next_number_field);
 
2743
                mx_tmp_restore_column_map(table, old_map);
2743
2744
        }
2744
2745
 
2745
2746
        if (!xt_tab_update_record(pb_open_tab, (xtWord1 *) old_data, (xtWord1 *) new_data))
3089
3090
        return ha_log_pbxt_thread_error_for_mysql(FALSE);
3090
3091
}
3091
3092
 
3092
 
#ifdef DRIZZLED
3093
 
 
3094
 
static std::string convert_long_to_bit_string(uint64_t bitset, uint64_t bitset_size)
3095
 
{
3096
 
  std::string res; 
3097
 
  while (bitset)
3098
 
  {
3099
 
    res.push_back((bitset & 1) + '0');
3100
 
    bitset>>= 1;
3101
 
  }
3102
 
  if (! res.empty())
3103
 
  {
3104
 
    std::reverse(res.begin(), res.end());
3105
 
  }
3106
 
  else
3107
 
  {
3108
 
    res= "0";
3109
 
  }
3110
 
  std::string final(bitset_size - res.length(), '0');
3111
 
  final.append(res);
3112
 
  return final;
3113
 
}
3114
 
#endif
3115
 
 
3116
3093
int ha_pbxt::doStartIndexScan(uint idx, bool XT_UNUSED(sorted))
3117
3094
{
3118
3095
        XTIndexPtr      ind;
3133
3110
        /* The number of columns required: */
3134
3111
        if (pb_open_tab->ot_is_modify) {
3135
3112
 
3136
 
                pb_open_tab->ot_cols_req = getTable()->read_set->MX_BIT_SIZE();
 
3113
                pb_open_tab->ot_cols_req = table->read_set->MX_BIT_SIZE();
3137
3114
#ifdef XT_PRINT_INDEX_OPT
3138
3115
                ind = (XTIndexPtr) pb_share->sh_dic_keys[idx];
3139
3116
 
3148
3125
        }
3149
3126
        else {
3150
3127
                //pb_open_tab->ot_cols_req = ha_get_max_bit(table->read_set);
3151
 
                pb_open_tab->ot_cols_req = getTable()->read_set->MX_BIT_SIZE();
 
3128
                pb_open_tab->ot_cols_req = table->read_set->MX_BIT_SIZE();
3152
3129
 
3153
3130
                /* Check for index coverage!
3154
3131
                 *
3189
3166
                 * seem to have this problem!
3190
3167
                 */
3191
3168
                ind = (XTIndexPtr) pb_share->sh_dic_keys[idx];
3192
 
#ifdef DRIZZLED
3193
 
        /*
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. 
3199
 
         */
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))
3203
 
#else
3204
 
                if (MX_BIT_IS_SUBSET(getTable()->read_set, ind->mi_col_map))
3205
 
#endif
 
3169
                if (MX_BIT_IS_SUBSET(table->read_set, &ind->mi_col_map))
3206
3170
                        pb_key_read = TRUE;
3207
3171
#ifdef XT_PRINT_INDEX_OPT
3208
3172
                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));
3346
3310
        XT_DISABLED_TRACE(("search tx=%d val=%d err=%d\n", (int) pb_open_tab->ot_thread->st_xact_data->xd_start_xn_id, (int) XT_GET_DISK_4(key), err));
3347
3311
        done:
3348
3312
        if (err)
3349
 
                getTable()->status = STATUS_NOT_FOUND;
 
3313
                table->status = STATUS_NOT_FOUND;
3350
3314
        else {
3351
3315
                pb_open_tab->ot_thread->st_statistics.st_row_select++;
3352
 
                getTable()->status = 0;
 
3316
                table->status = 0;
3353
3317
        }
3354
3318
        return err;
3355
3319
}
3407
3371
#endif
3408
3372
        done:
3409
3373
        if (err)
3410
 
                getTable()->status = STATUS_NOT_FOUND;
 
3374
                table->status = STATUS_NOT_FOUND;
3411
3375
        else {
3412
3376
                pb_open_tab->ot_thread->st_statistics.st_row_select++;
3413
 
                getTable()->status = 0;
 
3377
                table->status = 0;
3414
3378
        }
3415
3379
        XT_RETURN(err);
3416
3380
}
3461
3425
#endif
3462
3426
        done:
3463
3427
        if (err)
3464
 
                getTable()->status = STATUS_NOT_FOUND;
 
3428
                table->status = STATUS_NOT_FOUND;
3465
3429
        else {
3466
3430
                pb_open_tab->ot_thread->st_statistics.st_row_select++;
3467
 
                getTable()->status = 0;
 
3431
                table->status = 0;
3468
3432
        }
3469
3433
        XT_RETURN(err);
3470
3434
}
3499
3463
#endif
3500
3464
        done:
3501
3465
        if (err)
3502
 
                getTable()->status = STATUS_NOT_FOUND;
 
3466
                table->status = STATUS_NOT_FOUND;
3503
3467
        else {
3504
3468
                pb_open_tab->ot_thread->st_statistics.st_row_select++;
3505
 
                getTable()->status = 0;
 
3469
                table->status = 0;
3506
3470
        }
3507
3471
        XT_RETURN(err);
3508
3472
}
3552
3516
#endif
3553
3517
        done:
3554
3518
        if (err)
3555
 
                getTable()->status = STATUS_NOT_FOUND;
 
3519
                table->status = STATUS_NOT_FOUND;
3556
3520
        else {
3557
3521
                pb_open_tab->ot_thread->st_statistics.st_row_select++;
3558
 
                getTable()->status = 0;
 
3522
                table->status = 0;
3559
3523
        }
3560
3524
        XT_RETURN(err);
3561
3525
}
3598
3562
#endif
3599
3563
        done:
3600
3564
        if (err)
3601
 
                getTable()->status = STATUS_NOT_FOUND;
 
3565
                table->status = STATUS_NOT_FOUND;
3602
3566
        else {
3603
3567
                pb_open_tab->ot_thread->st_statistics.st_row_select++;
3604
 
                getTable()->status = 0;
 
3568
                table->status = 0;
3605
3569
        }
3606
3570
        XT_RETURN(err);
3607
3571
}
3645
3609
 
3646
3610
        /* The number of columns required: */
3647
3611
        if (pb_open_tab->ot_is_modify) {
3648
 
                pb_open_tab->ot_cols_req = getTable()->read_set->MX_BIT_SIZE();
 
3612
                pb_open_tab->ot_cols_req = table->read_set->MX_BIT_SIZE();
3649
3613
                /* {START-STAT-HACK} previously position of start statement hack,
3650
3614
                 * previous comment to code below: */
3651
3615
                /* Start a statement based transaction as soon
3655
3619
        }
3656
3620
        else {
3657
3621
                //pb_open_tab->ot_cols_req = ha_get_max_bit(table->read_set);
3658
 
                pb_open_tab->ot_cols_req = getTable()->read_set->MX_BIT_SIZE();
 
3622
                pb_open_tab->ot_cols_req = table->read_set->MX_BIT_SIZE();
3659
3623
 
3660
3624
                /*
3661
3625
                 * in case of queries like SELECT COUNT(*) FROM t
3725
3689
                err = HA_ERR_END_OF_FILE;
3726
3690
 
3727
3691
        if (err)
3728
 
                getTable()->status = STATUS_NOT_FOUND;
 
3692
                table->status = STATUS_NOT_FOUND;
3729
3693
        else {
3730
3694
                pb_open_tab->ot_thread->st_statistics.st_row_select++;
3731
 
                getTable()->status = 0;
 
3695
                table->status = 0;
3732
3696
        }
3733
3697
        XT_RETURN(err);
3734
3698
}
3800
3764
        }               
3801
3765
 
3802
3766
        if (err)
3803
 
                getTable()->status = STATUS_NOT_FOUND;
 
3767
                table->status = STATUS_NOT_FOUND;
3804
3768
        else {
3805
3769
                pb_open_tab->ot_thread->st_statistics.st_row_select++;
3806
 
                getTable()->status = 0;
 
3770
                table->status = 0;
3807
3771
        }
3808
3772
        XT_RETURN(err);
3809
3773
}
3901
3865
                         * #1   0x0022e1f1 in make_sortkey at filesort.cc:769
3902
3866
                         * #2   0x0022f1cf in find_all_keys at filesort.cc:619
3903
3867
                         * #3   0x00230eec in filesort at filesort.cc:243
3904
 
                         * #4   0x001b9d89 in update_query at sql_update.cc:415
 
3868
                         * #4   0x001b9d89 in mysql_update at sql_update.cc:415
3905
3869
                         * #5   0x0010db12 in mysql_execute_command at sql_parse.cc:2959
3906
3870
                         * #6   0x0011480d in mysql_parse at sql_parse.cc:5787
3907
3871
                         * #7   0x00115afb in dispatch_command at sql_parse.cc:1200
4194
4158
 *
4195
4159
 * Called from item_sum.cc by Item_func_group_concat::clear(),
4196
4160
 * Item_sum_count_distinct::clear(), and Item_func_group_concat::clear().
4197
 
 * Called from sql_delete.cc by delete_query().
 
4161
 * Called from sql_delete.cc by mysql_delete().
4198
4162
 * Called from sql_select.cc by JOIN::reinit().
4199
4163
 * Called from sql_union.cc by st_select_lex_unit::exec().
4200
4164
 */
4347
4311
        else
4348
4312
                my_xn_id = db->db_xn_to_clean_id;
4349
4313
 
4350
 
        while ((!db->db_sw_idle || xt_xn_is_before(db->db_xn_to_clean_id, my_xn_id)) && not (thd->getKilled())) {
 
4314
        while ((!db->db_sw_idle || xt_xn_is_before(db->db_xn_to_clean_id, my_xn_id)) && !thd_killed(thd)) {
4351
4315
                xt_busy_wait();
4352
4316
 
4353
4317
                /*
5611
5575
        try_(a) {
5612
5576
                xt_ha_open_database_of_table(self, (XTPathStrPtr) table_path);
5613
5577
 
5614
 
                for (uint i=0; i<table_arg.getShare()->keys; i++) {
 
5578
                for (uint i=0; i<table_arg.s->keys; i++) {
5615
5579
                        if (table_arg.key_info[i].key_length > XT_INDEX_MAX_KEY_SIZE)
5616
5580
                                xt_throw_sulxterr(XT_CONTEXT, XT_ERR_KEY_TOO_LARGE, table_arg.key_info[i].name, (u_long) XT_INDEX_MAX_KEY_SIZE);
5617
5581
                }
5628
5592
 
5629
5593
                StorageEngine::writeDefinitionFromPath(ident, proto);
5630
5594
 
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);
 
5595
                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
5596
                tab_def->checkForeignKeys(self, proto.type() == message::Table::TEMPORARY);
5634
5597
 
5635
5598
                dic.dic_table = tab_def;
5636
 
                dic.dic_my_table = table_arg.getMutableShare();
 
5599
                dic.dic_my_table = table_arg.s;
5637
5600
                dic.dic_tab_flags = source_dic.dic_tab_flags;
5638
5601
                //if (create_info.storage_media == HA_SM_MEMORY)
5639
5602
                //      dic.dic_tab_flags |= XT_TF_MEMORY_TABLE;
5700
5663
        if (!self->st_database)
5701
5664
                xt_ha_open_database_of_table(self, NULL);
5702
5665
 
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);
 
5666
        /* startTransaction() calls registerResourceForTransaction() calls engine->startTransaction(), and then
 
5667
         * startTransaction() calls doStartTransaction()
 
5668
         * Which leads to this function being called twice!?
 
5669
         * So added the self->st_xact_data test below.
 
5670
         */
 
5671
        if (!self->st_xact_data) {
 
5672
                if (!xt_xn_begin(self)) {
 
5673
                        err = xt_ha_pbxt_thread_error_for_mysql(thd, self, /*pb_ignore_dup_key*/false);
 
5674
                        //pb_ex_in_use = 0;
 
5675
                }
5706
5676
        }
5707
5677
 
5708
5678
        return err;
5723
5693
        return xt_ha_pbxt_thread_error_for_mysql(thd, xt_ha_thd_to_self(thd), false);
5724
5694
}
5725
5695
 
5726
 
int PBXTStorageEngine::doCommit(drizzled::Session* thd, bool real_commit)
 
5696
int PBXTStorageEngine::doCommit(drizzled::Session* thd, bool)
5727
5697
{
5728
5698
        int err = 0;
5729
5699
        XTThreadPtr self = (XTThreadPtr) *thd->getEngineData(pbxt_hton);
5730
5700
 
 
5701
        bool real_commit = !session_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
 
5702
        
5731
5703
        XT_PRINT1(self, "PBXTStorageEngine::doCommit(real_commit = %s)\n", real_commit ? "true" : "false");
5732
5704
 
5733
5705
        if (real_commit && self) {
5738
5710
        return err;
5739
5711
}
5740
5712
 
5741
 
int PBXTStorageEngine::doRollback(drizzled::Session* thd, bool real_commit)
 
5713
int PBXTStorageEngine::doRollback(drizzled::Session* thd, bool)
5742
5714
{
5743
5715
        int err = 0;
5744
5716
        XTThreadPtr self = (XTThreadPtr) *thd->getEngineData(pbxt_hton);
5745
5717
 
 
5718
        bool real_commit = !session_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
 
5719
 
5746
5720
        XT_PRINT1(self, "PBXTStorageEngine::doRollback(real_commit = %s)\n", real_commit ? "true" : "false");
5747
5721
 
5748
5722
        if (real_commit && self) {
6016
5990
}
6017
5991
#endif // DRI_IS
6018
5992
 
6019
 
#ifndef DRIZZLED
6020
5993
struct st_mysql_sys_var
6021
5994
{
6022
5995
        MYSQL_PLUGIN_VAR_HEADER;
6031
6004
#define USE_CONST_SAVE
6032
6005
#endif
6033
6006
#endif
6034
 
#endif
6035
6007
 
6036
6008
#ifdef DRIZZLED
6037
6009
#define st_mysql_sys_var drizzled::drizzle_sys_var
6038
6010
#endif
6039
6011
 
6040
 
#ifndef DRIZZLED
6041
6012
#ifdef USE_CONST_SAVE
6042
6013
static void pbxt_record_cache_size_func(THD *XT_UNUSED(thd), struct st_mysql_sys_var *var, void *tgt, const void *save)
6043
6014
#else
6063
6034
#endif
6064
6035
}
6065
6036
 
 
6037
#ifndef DRIZZLED
6066
6038
struct st_mysql_storage_engine pbxt_storage_engine = {
6067
6039
        MYSQL_HANDLERTON_INTERFACE_VERSION
6068
6040
};
6069
6041
static st_mysql_information_schema pbxt_statitics = {
6070
6042
        MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
6071
6043
};
 
6044
#endif
6072
6045
 
6073
6046
#if MYSQL_VERSION_ID >= 50118
6074
6047
static MYSQL_SYSVAR_STR(index_cache_size, pbxt_index_cache_size,
6201
6174
  NULL
6202
6175
};
6203
6176
#endif
6204
 
#endif
6205
6177
 
6206
6178
#ifdef DRIZZLED
6207
6179
DRIZZLE_DECLARE_PLUGIN
6213
6185
        "High performance, multi-versioning transactional engine",
6214
6186
        PLUGIN_LICENSE_GPL,
6215
6187
        pbxt_init, /* Plugin Init */
6216
 
        NULL,          /* depends */
 
6188
        pbxt_system_variables,          /* system variables                */
6217
6189
        NULL                                            /* config options                  */
6218
6190
}
6219
6191
DRIZZLE_DECLARE_PLUGIN_END;
6231
6203
        0x0001 /* 0.1 */,
6232
6204
        NULL,                       /* status variables                */
6233
6205
#if MYSQL_VERSION_ID >= 50118
6234
 
        pbxt_system_variables,          /* depends */
 
6206
        pbxt_system_variables,          /* system variables                */
6235
6207
#else
6236
6208
        NULL,
6237
6209
#endif
6247
6219
        pbxt_exit_statistics,                                           /* plugin deinit */
6248
6220
        0x0005,
6249
6221
        NULL,                                                                           /* status variables */
6250
 
        NULL,                                                                           /* depends */
 
6222
        NULL,                                                                           /* system variables */
6251
6223
        NULL                                                                            /* config options */
6252
6224
}
6253
6225
mysql_declare_plugin_end;