From: Date: November 13 2008 2:27pm Subject: bzr commit into mysql-6.0-falcon-team branch (svoj:2905) Bug#36804 List-Archive: http://lists.mysql.com/commits/58649 X-Bug: 36804 Message-Id: <20081113132735.054DB41CED0@june.myoffice.izhnet.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT #At file:///home/svoj/devel/bzr-mysql/mysql-6.0-falcon-team-bug36804/ 2905 Sergey Vojtovich 2008-11-13 BUG#36804 - Falcon does not detect deleted tablespace files Falcon silently recreates it's system data files if it wasn't able to open them. With this fix Falcon provides some additional information in error log. When starting mysql server with Falcon and we were unable to open Falcon system data files, write a warning to error log. Write an error message to error log when attempting to access a table that doesn't exist in Falcon. modified: storage/falcon/Log.h storage/falcon/StorageHandler.cpp storage/falcon/ha_falcon.cpp storage/falcon/ha_falcon.h per-file messages: storage/falcon/Log.h Added LogMysql* flags. These flags are used to write a message to MySQL error log. storage/falcon/StorageHandler.cpp When starting mysql server with Falcon and we were unable to open Falcon system data files, write a warning to error log. storage/falcon/ha_falcon.cpp Write an error message to error log when attempting to access a table that doesn't exist in Falcon. Added mysqlLogger() method, which is intended to write error message to MySQL error log. storage/falcon/ha_falcon.h Added mysqlLogger() method, which is intended to write error message to MySQL error log. === modified file 'storage/falcon/Log.h' --- a/storage/falcon/Log.h 2007-11-29 22:51:08 +0000 +++ b/storage/falcon/Log.h 2008-11-13 13:27:13 +0000 @@ -38,6 +38,9 @@ static const int LogScrub = 128; static const int LogException = 256; static const int LogScavenge = 512; static const int LogXARecovery = 1024; +static const int LogMysqlInfo = 0x20000000; +static const int LogMysqlWarning = 0x40000000; +static const int LogMysqlError = 0x80000000; typedef void (Listener) (int, const char*, void *arg); === modified file 'storage/falcon/StorageHandler.cpp' --- a/storage/falcon/StorageHandler.cpp 2008-10-31 10:13:58 +0000 +++ b/storage/falcon/StorageHandler.cpp 2008-11-13 13:27:13 +0000 @@ -998,6 +998,8 @@ void StorageHandler::initialize(void) try { + Log::log(LogMysqlInfo, "Falcon: unable to open system data files."); + Log::log(LogMysqlInfo, "Falcon: creating new system data files."); createDatabase(); } catch(SQLException &e2) === modified file 'storage/falcon/ha_falcon.cpp' --- a/storage/falcon/ha_falcon.cpp 2008-11-05 14:51:37 +0000 +++ b/storage/falcon/ha_falcon.cpp 2008-11-13 13:27:13 +0000 @@ -35,6 +35,7 @@ #include "InfoTable.h" #include "Format.h" #include "Error.h" +#include "Log.h" #ifdef _WIN32 #define I64FORMAT "%I64d" @@ -227,7 +228,9 @@ int StorageInterface::falcon_init(void * falcon_hton->fill_is_table = StorageInterface::fill_is_table; //falcon_hton->show_status = StorageInterface::show_status; falcon_hton->flags = HTON_NO_FLAGS; + falcon_debug_mask&= ~(LogMysqlInfo|LogMysqlWarning|LogMysqlError); storageHandler->addNfsLogger(falcon_debug_mask, StorageInterface::logger, NULL); + storageHandler->addNfsLogger(LogMysqlInfo|LogMysqlWarning|LogMysqlError, StorageInterface::mysqlLogger, NULL); if (falcon_debug_server) storageHandler->startNfsServer(); @@ -536,6 +539,10 @@ int StorageInterface::open(const char *n int ret = storageTable->open(); + if (ret == StorageErrorTableNotFound) + sql_print_error("Server is attempting to access a table %s,\n" + "which doesn't exist in Falcon.", name); + if (ret) DBUG_RETURN(error(ret)); @@ -1025,6 +1032,10 @@ int StorageInterface::delete_table(const storageTable->deleteStorageTable(); storageTable = NULL; + if (res == StorageErrorTableNotFound) + sql_print_error("Server is attempting to drop a table %s,\n" + "which doesn't exist in Falcon.", tableName); + // (hk) Fix for Bug#31465 Running Falcon test suite leads // to warnings about temp tables // This fix could affect other DROP TABLE scenarios. @@ -2401,6 +2412,16 @@ void StorageInterface::logger(int mask, } } +void StorageInterface::mysqlLogger(int mask, const char* text, void* arg) +{ + if (mask & LogMysqlError) + sql_print_error("%s", text); + else if (mask & LogMysqlWarning) + sql_print_warning("%s", text); + else if (mask & LogMysqlInfo) + sql_print_information("%s", text); +} + int StorageInterface::setIndex(TABLE *table, int indexId) { StorageIndexDesc indexDesc; @@ -3520,6 +3541,7 @@ void StorageInterface::updateRecordScave void StorageInterface::updateDebugMask(MYSQL_THD thd, struct st_mysql_sys_var* variable, void* var_ptr, const void* save) { falcon_debug_mask = *(uint*) save; + falcon_debug_mask&= ~(LogMysqlInfo|LogMysqlWarning|LogMysqlError); storageHandler->deleteNfsLogger(StorageInterface::logger, NULL); storageHandler->addNfsLogger(falcon_debug_mask, StorageInterface::logger, NULL); } === modified file 'storage/falcon/ha_falcon.h' --- a/storage/falcon/ha_falcon.h 2008-10-22 20:44:09 +0000 +++ b/storage/falcon/ha_falcon.h 2008-11-13 13:27:13 +0000 @@ -150,6 +150,7 @@ public: static void shutdown(handlerton *); static int closeConnection(handlerton *, THD *thd); static void logger(int mask, const char *text, void *arg); + static void mysqlLogger(int mask, const char *text, void *arg); static int panic(handlerton* hton, ha_panic_function flag); //static bool show_status(handlerton* hton, THD* thd, stat_print_fn* print, enum ha_stat_type stat); static int getMySqlError(int storageError);