Commit 6a1ca502 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#4623 fix show create table for TokuDB, and get the mysql engines tests working refs[t:4623]

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@40967 c7de825b-a66e-492c-adef-691d508d4ae1
parent 24eb1a0a
...@@ -241,7 +241,14 @@ static int free_share(TOKUDB_SHARE * share, bool mutex_is_locked) { ...@@ -241,7 +241,14 @@ static int free_share(TOKUDB_SHARE * share, bool mutex_is_locked) {
goto cleanup; \ goto cleanup; \
} }
const char *ha_tokudb::table_type() const {
extern const char * const tokudb_hton_name;
return tokudb_hton_name;
}
const char *ha_tokudb::index_type(uint inx) {
return "BTREE";
}
/* /*
* returns NULL terminated file extension string * returns NULL terminated file extension string
...@@ -1249,6 +1256,9 @@ ha_tokudb::ha_tokudb(handlerton * hton, TABLE_SHARE * table_arg):handler(hton, t ...@@ -1249,6 +1256,9 @@ ha_tokudb::ha_tokudb(handlerton * hton, TABLE_SHARE * table_arg):handler(hton, t
prelocked_right_range_size = 0; prelocked_right_range_size = 0;
} }
ha_tokudb::~ha_tokudb() {
}
// //
// states if table has an auto increment column, if so, sets index where auto inc column is to index // states if table has an auto increment column, if so, sets index where auto inc column is to index
// Parameters: // Parameters:
...@@ -3743,6 +3753,8 @@ int ha_tokudb::insert_rows_to_dictionaries_mult(DBT* pk_key, DBT* pk_val, DB_TXN ...@@ -3743,6 +3753,8 @@ int ha_tokudb::insert_rows_to_dictionaries_mult(DBT* pk_key, DBT* pk_val, DB_TXN
return error; return error;
} }
volatile int ha_tokudb_write_row_wait = 0; // debug
// //
// Stores a row in the table, called when handling an INSERT query // Stores a row in the table, called when handling an INSERT query
// Parameters: // Parameters:
...@@ -3753,6 +3765,9 @@ int ha_tokudb::insert_rows_to_dictionaries_mult(DBT* pk_key, DBT* pk_val, DB_TXN ...@@ -3753,6 +3765,9 @@ int ha_tokudb::insert_rows_to_dictionaries_mult(DBT* pk_key, DBT* pk_val, DB_TXN
// //
int ha_tokudb::write_row(uchar * record) { int ha_tokudb::write_row(uchar * record) {
TOKUDB_DBUG_ENTER("ha_tokudb::write_row"); TOKUDB_DBUG_ENTER("ha_tokudb::write_row");
while (ha_tokudb_write_row_wait) sleep(1); // debug
DBT row, prim_key; DBT row, prim_key;
int error; int error;
THD *thd = ha_thd(); THD *thd = ha_thd();
...@@ -4296,6 +4311,8 @@ void ha_tokudb::invalidate_bulk_fetch() { ...@@ -4296,6 +4311,8 @@ void ha_tokudb::invalidate_bulk_fetch() {
curr_range_query_buff_offset = 0; curr_range_query_buff_offset = 0;
} }
volatile int ha_tokudb_index_init_wait = 0; // debug
// //
// Initializes local cursor on DB with index keynr // Initializes local cursor on DB with index keynr
// Parameters: // Parameters:
...@@ -4307,6 +4324,9 @@ void ha_tokudb::invalidate_bulk_fetch() { ...@@ -4307,6 +4324,9 @@ void ha_tokudb::invalidate_bulk_fetch() {
// //
int ha_tokudb::index_init(uint keynr, bool sorted) { int ha_tokudb::index_init(uint keynr, bool sorted) {
TOKUDB_DBUG_ENTER("ha_tokudb::index_init %p %d", this, keynr); TOKUDB_DBUG_ENTER("ha_tokudb::index_init %p %d", this, keynr);
while (ha_tokudb_index_init_wait) sleep(1); // debug
int error; int error;
THD* thd = ha_thd(); THD* thd = ha_thd();
DBUG_PRINT("enter", ("table: '%s' key: %d", table_share->table_name.str, keynr)); DBUG_PRINT("enter", ("table: '%s' key: %d", table_share->table_name.str, keynr));
...@@ -7535,12 +7555,17 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) { ...@@ -7535,12 +7555,17 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
TOKUDB_DBUG_RETURN(error); TOKUDB_DBUG_RETURN(error);
} }
volatile int ha_tokudb_drop_indexes_wait = 0; // debug
// //
// Internal function called by ha_tokudb::prepare_drop_index and ha_tokudb::alter_table_phase2 // Internal function called by ha_tokudb::prepare_drop_index and ha_tokudb::alter_table_phase2
// With a transaction, drops dictionaries associated with indexes in key_num // With a transaction, drops dictionaries associated with indexes in key_num
// //
int ha_tokudb::drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, DB_TXN* txn) { int ha_tokudb::drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, DB_TXN* txn) {
TOKUDB_DBUG_ENTER("ha_tokudb::drop_indexes"); TOKUDB_DBUG_ENTER("ha_tokudb::drop_indexes");
while (ha_tokudb_drop_indexes_wait) sleep(1); // debug
int error = 0; int error = 0;
for (uint i = 0; i < num_of_keys; i++) { for (uint i = 0; i < num_of_keys; i++) {
...@@ -7595,6 +7620,9 @@ void ha_tokudb::restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_o ...@@ -7595,6 +7620,9 @@ void ha_tokudb::restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_o
} }
} }
} }
volatile int ha_tokudb_prepare_drop_index_wait = 0; //debug
// //
// Prepares to drop indexes to the table. For each value, i, in the array key_num, // Prepares to drop indexes to the table. For each value, i, in the array key_num,
// table->key_info[i] is a key that is to be dropped. // table->key_info[i] is a key that is to be dropped.
...@@ -7614,6 +7642,9 @@ void ha_tokudb::restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_o ...@@ -7614,6 +7642,9 @@ void ha_tokudb::restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_o
// //
int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_keys) { int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_keys) {
TOKUDB_DBUG_ENTER("ha_tokudb::prepare_drop_index"); TOKUDB_DBUG_ENTER("ha_tokudb::prepare_drop_index");
while (ha_tokudb_prepare_drop_index_wait) sleep(1); // debug
int error; int error;
DB_TXN* txn = NULL; DB_TXN* txn = NULL;
...@@ -7636,6 +7667,7 @@ int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_k ...@@ -7636,6 +7667,7 @@ int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_k
TOKUDB_DBUG_RETURN(error); TOKUDB_DBUG_RETURN(error);
} }
volatile int ha_tokudb_final_drop_index_wait = 0; // debug
// ***********NOTE******************* // ***********NOTE*******************
// Although prepare_drop_index is supposed to just get the DB's ready for removal, // Although prepare_drop_index is supposed to just get the DB's ready for removal,
...@@ -7646,6 +7678,7 @@ int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_k ...@@ -7646,6 +7678,7 @@ int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_k
// this function just return // this function just return
int ha_tokudb::final_drop_index(TABLE *table_arg) { int ha_tokudb::final_drop_index(TABLE *table_arg) {
TOKUDB_DBUG_ENTER("ha_tokudb::final_drop_index"); TOKUDB_DBUG_ENTER("ha_tokudb::final_drop_index");
while (ha_tokudb_final_drop_index_wait) sleep(1); // debug
TOKUDB_DBUG_RETURN(0); TOKUDB_DBUG_RETURN(0);
} }
...@@ -9752,11 +9785,12 @@ volatile int ha_tokudb_check_wait = 0; // debug ...@@ -9752,11 +9785,12 @@ volatile int ha_tokudb_check_wait = 0; // debug
int int
ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) { ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) {
TOKUDB_DBUG_ENTER("check"); TOKUDB_DBUG_ENTER("check");
const char *old_proc_info = thd->proc_info;
thd_proc_info(thd, "tokudb::check");
while (ha_tokudb_check_wait) sleep(1); // debug while (ha_tokudb_check_wait) sleep(1); // debug
const char *old_proc_info = thd->proc_info;
thd_proc_info(thd, "tokudb::check");
int result = HA_ADMIN_OK; int result = HA_ADMIN_OK;
int r; int r;
......
...@@ -417,14 +417,10 @@ class ha_tokudb : public handler { ...@@ -417,14 +417,10 @@ class ha_tokudb : public handler {
public: public:
ha_tokudb(handlerton * hton, TABLE_SHARE * table_arg); ha_tokudb(handlerton * hton, TABLE_SHARE * table_arg);
~ha_tokudb() { ~ha_tokudb();
}
const char *table_type() const { const char *table_type() const;
return "TOKUDB"; const char *index_type(uint inx);
}
const char *index_type(uint inx) {
return "BTREE";
}
const char **bas_ext() const; const char **bas_ext() const;
// //
......
...@@ -239,8 +239,7 @@ static char *tokudb_log_dir; ...@@ -239,8 +239,7 @@ static char *tokudb_log_dir;
// static long tokudb_lock_scan_time = 0; // static long tokudb_lock_scan_time = 0;
// static ulong tokudb_region_size = 0; // static ulong tokudb_region_size = 0;
// static ulong tokudb_cache_parts = 1; // static ulong tokudb_cache_parts = 1;
static const char tokudb_hton_name[] = "TokuDB"; const char *tokudb_hton_name = "TokuDB";
static const int tokudb_hton_name_length = sizeof(tokudb_hton_name) - 1;
static u_int32_t tokudb_checkpointing_period; static u_int32_t tokudb_checkpointing_period;
u_int32_t tokudb_write_status_frequency; u_int32_t tokudb_write_status_frequency;
u_int32_t tokudb_read_status_frequency; u_int32_t tokudb_read_status_frequency;
...@@ -1127,7 +1126,7 @@ format_time(u_int64_t time64, char *buf) { ...@@ -1127,7 +1126,7 @@ format_time(u_int64_t time64, char *buf) {
#define STATPRINT(legend, val) stat_print(thd, \ #define STATPRINT(legend, val) stat_print(thd, \
tokudb_hton_name, \ tokudb_hton_name, \
tokudb_hton_name_length, \ strlen(tokudb_hton_name), \
legend, \ legend, \
strlen(legend), \ strlen(legend), \
val, \ val, \
...@@ -1565,7 +1564,7 @@ mysql_declare_plugin(tokudb) ...@@ -1565,7 +1564,7 @@ mysql_declare_plugin(tokudb)
{ {
MYSQL_STORAGE_ENGINE_PLUGIN, MYSQL_STORAGE_ENGINE_PLUGIN,
&tokudb_storage_engine, &tokudb_storage_engine,
"TokuDB", tokudb_hton_name,
"Tokutek Inc", "Tokutek Inc",
"Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology",
PLUGIN_LICENSE_GPL, PLUGIN_LICENSE_GPL,
...@@ -1612,7 +1611,7 @@ maria_declare_plugin(tokudb) ...@@ -1612,7 +1611,7 @@ maria_declare_plugin(tokudb)
{ {
MYSQL_STORAGE_ENGINE_PLUGIN, MYSQL_STORAGE_ENGINE_PLUGIN,
&tokudb_storage_engine, &tokudb_storage_engine,
"TokuDB", tokudb_hton_name,
"Tokutek Inc", "Tokutek Inc",
"Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology",
PLUGIN_LICENSE_GPL, PLUGIN_LICENSE_GPL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment