List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:November 11 2008 12:59pm
Subject:bzr commit into mysql-6.0-falcon-team branch (svoj:2905) Bug#36804
View as plain text  
#At file:///home/svoj/devel/bzr-mysql/mysql-6.0-falcon-team-bug36804/

 2905 Sergey Vojtovich	2008-11-11
      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 flag. This flag is 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-11 11:59:29 +0000
@@ -38,6 +38,7 @@ static const int	LogScrub		= 128;
 static const int	LogException	= 256;
 static const int	LogScavenge		= 512;
 static const int	LogXARecovery	= 1024;
+static const int	LogMysql		= 2048;
 
 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-11 11:59:29 +0000
@@ -998,6 +998,8 @@ void StorageHandler::initialize(void)
 
 		try
 			{
+			Log::log(LogMysql, "Falcon: unable to open system data files.");
+			Log::log(LogMysql, "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-11 11:59:29 +0000
@@ -35,6 +35,7 @@
 #include "InfoTable.h"
 #include "Format.h"
 #include "Error.h"
+#include "Log.h"
 
 #ifdef _WIN32
 #define I64FORMAT			"%I64d"
@@ -228,6 +229,7 @@ int StorageInterface::falcon_init(void *
 	//falcon_hton->show_status  = StorageInterface::show_status;
 	falcon_hton->flags = HTON_NO_FLAGS;
 	storageHandler->addNfsLogger(falcon_debug_mask, StorageInterface::logger, NULL);
+	storageHandler->addNfsLogger(LogMysql, StorageInterface::mysqlLogger, NULL);
 
 	if (falcon_debug_server)
 		storageHandler->startNfsServer();
@@ -536,6 +538,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 +1031,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 +2411,12 @@ void StorageInterface::logger(int mask, 
 		}
 }
 
+void StorageInterface::mysqlLogger(int mask, const char* text, void* arg)
+{
+	// TODO: use sql_print_[warning|information|error] basing on mask
+	sql_print_information("%s", text);
+}
+
 int StorageInterface::setIndex(TABLE *table, int indexId)
 {
 	StorageIndexDesc indexDesc;

=== 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-11 11:59:29 +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);

Thread
bzr commit into mysql-6.0-falcon-team branch (svoj:2905) Bug#36804Sergey Vojtovich11 Nov