Commit ed5b5cdd authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2563], have a test mode where errors are not printed to the log file when...

[t:2563], have a test mode where errors are not printed to the log file when fileops fails due to DB_LOCK_NOTGRANTED

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@20501 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7758ca14
...@@ -5977,7 +5977,7 @@ int ha_tokudb::delete_table(const char *name) { ...@@ -5977,7 +5977,7 @@ int ha_tokudb::delete_table(const char *name) {
TOKUDB_DBUG_ENTER("ha_tokudb::delete_table"); TOKUDB_DBUG_ENTER("ha_tokudb::delete_table");
int error; int error;
error = delete_or_rename_table(name, NULL, true); error = delete_or_rename_table(name, NULL, true);
if (error == DB_LOCK_NOTGRANTED) { if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) {
sql_print_error("Could not delete table %s because \ sql_print_error("Could not delete table %s because \
another transaction has accessed the table. \ another transaction has accessed the table. \
To drop the table, make sure no transactions touch the table.", name); To drop the table, make sure no transactions touch the table.", name);
...@@ -5999,7 +5999,7 @@ int ha_tokudb::rename_table(const char *from, const char *to) { ...@@ -5999,7 +5999,7 @@ int ha_tokudb::rename_table(const char *from, const char *to) {
TOKUDB_DBUG_ENTER("%s %s %s", __FUNCTION__, from, to); TOKUDB_DBUG_ENTER("%s %s %s", __FUNCTION__, from, to);
int error; int error;
error = delete_or_rename_table(from, to, false); error = delete_or_rename_table(from, to, false);
if (error == DB_LOCK_NOTGRANTED) { if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) {
sql_print_error("Could not rename table from %s to %s because \ sql_print_error("Could not rename table from %s to %s because \
another transaction has accessed the table. \ another transaction has accessed the table. \
To rename the table, make sure no transactions touch the table.", from, to); To rename the table, make sure no transactions touch the table.", from, to);
...@@ -6531,7 +6531,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) { ...@@ -6531,7 +6531,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
commit_txn(txn,0); commit_txn(txn,0);
} }
} }
if (error == DB_LOCK_NOTGRANTED) { if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) {
sql_print_error("Could not add indexes to table %s because \ sql_print_error("Could not add indexes to table %s because \
another transaction has accessed the table. \ another transaction has accessed the table. \
To add indexes, make sure no transactions touch the table.", share->table_name); To add indexes, make sure no transactions touch the table.", share->table_name);
...@@ -6585,7 +6585,7 @@ int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_k ...@@ -6585,7 +6585,7 @@ int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_k
commit_txn(txn,0); commit_txn(txn,0);
} }
} }
if (error == DB_LOCK_NOTGRANTED) { if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) {
sql_print_error("Could not drop indexes from table %s because \ sql_print_error("Could not drop indexes from table %s because \
another transaction has accessed the table. \ another transaction has accessed the table. \
To drop indexes, make sure no transactions touch the table.", share->table_name); To drop indexes, make sure no transactions touch the table.", share->table_name);
...@@ -6841,7 +6841,7 @@ int ha_tokudb::delete_all_rows() { ...@@ -6841,7 +6841,7 @@ int ha_tokudb::delete_all_rows() {
} }
} }
if (error == DB_LOCK_NOTGRANTED) { if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) {
sql_print_error("Could not truncate table %s because \ sql_print_error("Could not truncate table %s because \
another transaction has accessed the table. \ another transaction has accessed the table. \
To truncate the table, make sure no transactions touch the table.", share->table_name); To truncate the table, make sure no transactions touch the table.", share->table_name);
......
...@@ -36,6 +36,7 @@ extern ulong tokudb_debug; ...@@ -36,6 +36,7 @@ extern ulong tokudb_debug;
#define TOKUDB_DEBUG_LOCK 256 #define TOKUDB_DEBUG_LOCK 256
#define TOKUDB_DEBUG_LOCKRETRY 512 #define TOKUDB_DEBUG_LOCKRETRY 512
#define TOKUDB_DEBUG_CHECK_KEY 1024 #define TOKUDB_DEBUG_CHECK_KEY 1024
#define TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS 2048
#define TOKUDB_TRACE(f, ...) \ #define TOKUDB_TRACE(f, ...) \
printf("%d:%s:%d:" f, my_tid(), __FILE__, __LINE__, ##__VA_ARGS__); printf("%d:%s:%d:" f, my_tid(), __FILE__, __LINE__, ##__VA_ARGS__);
......
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