Commit 6a79c691 authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

close[t:3938] the information schema now protects itself from a failed tokudb_init_func()

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@35224 c7de825b-a66e-492c-adef-691d508d4ae1
parent ceb92814
...@@ -249,6 +249,9 @@ extern "C" { ...@@ -249,6 +249,9 @@ extern "C" {
} }
#endif #endif
// let's us track if the tokudb_init_func failed
static int tokudb_init_func_failed = 0;
static int tokudb_init_func(void *p) { static int tokudb_init_func(void *p) {
TOKUDB_DBUG_ENTER("tokudb_init_func"); TOKUDB_DBUG_ENTER("tokudb_init_func");
int r; int r;
...@@ -480,6 +483,8 @@ error: ...@@ -480,6 +483,8 @@ error:
assert(rr==0); assert(rr==0);
db_env = 0; db_env = 0;
} }
// we failed, let's not forget that.
tokudb_init_func_failed = 1;
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
...@@ -1616,12 +1621,18 @@ static ST_FIELD_INFO tokudb_user_data_field_info[] = { ...@@ -1616,12 +1621,18 @@ static ST_FIELD_INFO tokudb_user_data_field_info[] = {
}; };
static int tokudb_user_data_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { static int tokudb_user_data_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) {
TABLE *table = tables->table; int error;
uint64_t data_size; uint64_t data_size;
int error = tokudb_get_user_data_size(thd, false, &data_size); TABLE *table = tables->table;
if (error == 0) { if (tokudb_init_func_failed) {
table->field[0]->store(data_size, false); my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "TokuDB");
error = schema_table_store_record(thd, table); error = -1;
} else {
error = tokudb_get_user_data_size(thd, false, &data_size);
if (error == 0) {
table->field[0]->store(data_size, false);
error = schema_table_store_record(thd, table);
}
} }
return error; return error;
} }
...@@ -1645,12 +1656,18 @@ static ST_FIELD_INFO tokudb_user_data_exact_field_info[] = { ...@@ -1645,12 +1656,18 @@ static ST_FIELD_INFO tokudb_user_data_exact_field_info[] = {
}; };
static int tokudb_user_data_exact_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { static int tokudb_user_data_exact_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) {
TABLE *table = tables->table; int error;
uint64_t data_size; uint64_t data_size;
int error = tokudb_get_user_data_size(thd, true, &data_size); TABLE *table = tables->table;
if (error == 0) { if (tokudb_init_func_failed) {
table->field[0]->store(data_size, false); my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "TokuDB");
error = schema_table_store_record(thd, table); error = -1;
} else {
error = tokudb_get_user_data_size(thd, true, &data_size);
if (error == 0) {
table->field[0]->store(data_size, false);
error = schema_table_store_record(thd, table);
}
} }
return error; return error;
} }
......
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