~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Lee Bieber
  • Date: 2010-12-03 01:16:19 UTC
  • mfrom: (1819.9.81 update-innobase)
  • Revision ID: kalebral@gmail.com-20101203011619-n6v584rijwdet05b
Merge Stewart - update Innobase plugin based on InnoDB 1.1.2

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
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
53
#include <string>
197
198
static char                             *pbxt_data_file_grow_size;
198
199
static char                             *pbxt_row_file_grow_size;
199
200
static char                             *pbxt_record_write_threshold;
 
201
static my_bool                  pbxt_support_xa;
200
202
 
201
203
#ifndef DRIZZLED
202
204
// drizzle complains it's not used
203
 
static my_bool                  pbxt_support_xa;
204
205
static XTXactEnumXARec  pbxt_xa_enum;
205
206
#endif
206
207
 
2504
2505
        nr_int_val = nr->val_int();
2505
2506
        tab = ot->ot_table;
2506
2507
 
2507
 
        if (nr->cmp_internal((const unsigned char *)&tab->tab_auto_inc) > 0) {
 
2508
        if (nr->cmp((const unsigned char *)&tab->tab_auto_inc) > 0) {
2508
2509
                xt_spinlock_lock(&tab->tab_ainc_lock);
2509
2510
 
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
 
                }
 
2511
                if (nr->cmp((const unsigned char *)&tab->tab_auto_inc) > 0) {
 
2512
                        /* {PRE-INC}
 
2513
                         * We increment later, so just set the value!
 
2514
                        MX_ULONGLONG_T nr_int_val_plus_one = nr_int_val + 1;
 
2515
                        if (nr->cmp((const unsigned char *)&nr_int_val_plus_one) < 0)
 
2516
                                tab->tab_auto_inc = nr_int_val_plus_one;
 
2517
                        else
 
2518
                         */
 
2519
                        tab->tab_auto_inc = nr_int_val;
 
2520
                }
2520
2521
                xt_spinlock_unlock(&tab->tab_ainc_lock);
2521
2522
        }
2522
2523
 
3901
3902
                         * #1   0x0022e1f1 in make_sortkey at filesort.cc:769
3902
3903
                         * #2   0x0022f1cf in find_all_keys at filesort.cc:619
3903
3904
                         * #3   0x00230eec in filesort at filesort.cc:243
3904
 
                         * #4   0x001b9d89 in update_query at sql_update.cc:415
 
3905
                         * #4   0x001b9d89 in mysql_update at sql_update.cc:415
3905
3906
                         * #5   0x0010db12 in mysql_execute_command at sql_parse.cc:2959
3906
3907
                         * #6   0x0011480d in mysql_parse at sql_parse.cc:5787
3907
3908
                         * #7   0x00115afb in dispatch_command at sql_parse.cc:1200
4194
4195
 *
4195
4196
 * Called from item_sum.cc by Item_func_group_concat::clear(),
4196
4197
 * Item_sum_count_distinct::clear(), and Item_func_group_concat::clear().
4197
 
 * Called from sql_delete.cc by delete_query().
 
4198
 * Called from sql_delete.cc by mysql_delete().
4198
4199
 * Called from sql_select.cc by JOIN::reinit().
4199
4200
 * Called from sql_union.cc by st_select_lex_unit::exec().
4200
4201
 */
5723
5724
        return xt_ha_pbxt_thread_error_for_mysql(thd, xt_ha_thd_to_self(thd), false);
5724
5725
}
5725
5726
 
5726
 
int PBXTStorageEngine::doCommit(drizzled::Session* thd, bool real_commit)
 
5727
int PBXTStorageEngine::doCommit(drizzled::Session* thd, bool)
5727
5728
{
5728
5729
        int err = 0;
5729
5730
        XTThreadPtr self = (XTThreadPtr) *thd->getEngineData(pbxt_hton);
5730
5731
 
 
5732
        bool real_commit = !session_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
 
5733
        
5731
5734
        XT_PRINT1(self, "PBXTStorageEngine::doCommit(real_commit = %s)\n", real_commit ? "true" : "false");
5732
5735
 
5733
5736
        if (real_commit && self) {
5738
5741
        return err;
5739
5742
}
5740
5743
 
5741
 
int PBXTStorageEngine::doRollback(drizzled::Session* thd, bool real_commit)
 
5744
int PBXTStorageEngine::doRollback(drizzled::Session* thd, bool)
5742
5745
{
5743
5746
        int err = 0;
5744
5747
        XTThreadPtr self = (XTThreadPtr) *thd->getEngineData(pbxt_hton);
5745
5748
 
 
5749
        bool real_commit = !session_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
 
5750
 
5746
5751
        XT_PRINT1(self, "PBXTStorageEngine::doRollback(real_commit = %s)\n", real_commit ? "true" : "false");
5747
5752
 
5748
5753
        if (real_commit && self) {
6016
6021
}
6017
6022
#endif // DRI_IS
6018
6023
 
6019
 
#ifndef DRIZZLED
6020
6024
struct st_mysql_sys_var
6021
6025
{
6022
6026
        MYSQL_PLUGIN_VAR_HEADER;
6031
6035
#define USE_CONST_SAVE
6032
6036
#endif
6033
6037
#endif
6034
 
#endif
6035
6038
 
6036
6039
#ifdef DRIZZLED
6037
6040
#define st_mysql_sys_var drizzled::drizzle_sys_var
6038
6041
#endif
6039
6042
 
6040
 
#ifndef DRIZZLED
6041
6043
#ifdef USE_CONST_SAVE
6042
6044
static void pbxt_record_cache_size_func(THD *XT_UNUSED(thd), struct st_mysql_sys_var *var, void *tgt, const void *save)
6043
6045
#else
6063
6065
#endif
6064
6066
}
6065
6067
 
 
6068
#ifndef DRIZZLED
6066
6069
struct st_mysql_storage_engine pbxt_storage_engine = {
6067
6070
        MYSQL_HANDLERTON_INTERFACE_VERSION
6068
6071
};
6069
6072
static st_mysql_information_schema pbxt_statitics = {
6070
6073
        MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
6071
6074
};
 
6075
#endif
6072
6076
 
6073
6077
#if MYSQL_VERSION_ID >= 50118
6074
6078
static MYSQL_SYSVAR_STR(index_cache_size, pbxt_index_cache_size,
6201
6205
  NULL
6202
6206
};
6203
6207
#endif
6204
 
#endif
6205
6208
 
6206
6209
#ifdef DRIZZLED
6207
6210
DRIZZLE_DECLARE_PLUGIN
6213
6216
        "High performance, multi-versioning transactional engine",
6214
6217
        PLUGIN_LICENSE_GPL,
6215
6218
        pbxt_init, /* Plugin Init */
6216
 
        NULL,          /* depends */
 
6219
        pbxt_system_variables,          /* system variables                */
6217
6220
        NULL                                            /* config options                  */
6218
6221
}
6219
6222
DRIZZLE_DECLARE_PLUGIN_END;
6231
6234
        0x0001 /* 0.1 */,
6232
6235
        NULL,                       /* status variables                */
6233
6236
#if MYSQL_VERSION_ID >= 50118
6234
 
        pbxt_system_variables,          /* depends */
 
6237
        pbxt_system_variables,          /* system variables                */
6235
6238
#else
6236
6239
        NULL,
6237
6240
#endif
6247
6250
        pbxt_exit_statistics,                                           /* plugin deinit */
6248
6251
        0x0005,
6249
6252
        NULL,                                                                           /* status variables */
6250
 
        NULL,                                                                           /* depends */
 
6253
        NULL,                                                                           /* system variables */
6251
6254
        NULL                                                                            /* config options */
6252
6255
}
6253
6256
mysql_declare_plugin_end;