List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:September 11 2008 11:11am
Subject:bzr push into mysql-6.0-falcon branch (vvaintroub:2815)
View as plain text  
 2815 Vladislav Vaintroub	2008-09-11 [merge]
      merge
removed:
  mysql-test/suite/falcon/r/falcon_select_excerpt.result
  mysql-test/suite/falcon/t/falcon_select_excerpt.test
added:
  mysql-test/suite/falcon/r/falcon_bug_22207-big.result
  mysql-test/suite/falcon/r/falcon_index_datatypes.result
  mysql-test/suite/falcon/r/falcon_online_index.result
  mysql-test/suite/falcon/t/falcon_bug_22207-big.test
  mysql-test/suite/falcon/t/falcon_index_datatypes.test
  mysql-test/suite/falcon/t/falcon_online_index.test
renamed:
  mysql-test/suite/falcon_team/r/falcon_bug_22189.result => mysql-test/suite/falcon/r/falcon_bug_22189.result
  mysql-test/suite/falcon_team/r/falcon_bug_22207.result => mysql-test/suite/falcon/r/falcon_bug_22207.result
  mysql-test/suite/falcon_team/r/falcon_bug_24024.result => mysql-test/suite/falcon/r/falcon_bug_24024.result
  mysql-test/suite/falcon_team/t/falcon_bug_22189.test => mysql-test/suite/falcon/t/falcon_bug_22189.test
  mysql-test/suite/falcon_team/t/falcon_bug_22207.test => mysql-test/suite/falcon/t/falcon_bug_22207.test
  mysql-test/suite/falcon_team/t/falcon_bug_24024.test => mysql-test/suite/falcon/t/falcon_bug_24024.test
modified:
  mysql-test/suite/falcon/r/falcon_bug_22972.result
  mysql-test/suite/falcon/t/disabled.def
  mysql-test/suite/falcon/t/falcon_bug_22972.test
  mysql-test/suite/falcon_team/r/falcon_bug_23945.result
  mysql-test/suite/falcon_team/t/disabled.def
  mysql-test/suite/falcon_team/t/falcon_bug_23945.test
  storage/falcon/Cache.cpp
  storage/falcon/Configuration.cpp
  storage/falcon/DeferredIndex.cpp
  storage/falcon/DeferredIndexWalker.cpp
  storage/falcon/StorageTable.cpp
  storage/falcon/StorageTableShare.cpp
  storage/falcon/StorageTableShare.h
  storage/falcon/Transaction.cpp
  storage/falcon/Transaction.h
  storage/falcon/ha_falcon.cpp
  storage/falcon/ha_falcon.h
  mysql-test/suite/falcon/r/falcon_bug_22189.result
  mysql-test/suite/falcon/r/falcon_bug_22207.result
  mysql-test/suite/falcon/r/falcon_bug_24024.result
  mysql-test/suite/falcon/t/falcon_bug_22189.test
  mysql-test/suite/falcon/t/falcon_bug_22207.test
  mysql-test/suite/falcon/t/falcon_bug_24024.test

=== modified file 'storage/falcon/Configuration.cpp'
--- a/storage/falcon/Configuration.cpp	2008-09-09 23:15:17 +0000
+++ b/storage/falcon/Configuration.cpp	2008-09-11 11:10:22 +0000
@@ -129,33 +129,16 @@ Configuration::Configuration(const char 
 		
 	if (falcon_serial_log_dir)
 		{
-		char fullLogPath[PATH_MAX];
-		const char *baseName;
-	
-		// Fully qualify the serial log path using a dummy file name
-		
-		JString tempLogDir(falcon_serial_log_dir);
-		tempLogDir += "/test.fl1";
-		IO io;
-		io.expandFileName(tempLogDir, sizeof(fullLogPath), fullLogPath, &baseName);
+		char fullPath[PATH_MAX];
+		IO::expandFileName(falcon_serial_log_dir, sizeof(fullPath),
+			fullPath, NULL);
+		serialLogDir = fullPath;
 
-		// Set the path, remove the file name
-		
-		serialLogDir = JString(fullLogPath, (int)(baseName - fullLogPath));
-	
-		// Verify that the directory exists
-		
-		if (!io.isDirectory(serialLogDir.getString()))
-			{
-			fprintf(stderr, 
-					"Falcon: The specified serial log directory, \"%s\", "
-					"does not exist.\n"
-					"Falcon: The serial log directory must be created by "
-					"the user before initializing Falcon.\n", 
-					falcon_serial_log_dir
-				);
-			throw SQLEXCEPTION (FILE_ACCESS_ERROR, "Invalid serial log directory path \"%s\"", falcon_serial_log_dir);
-			}
+		// Append path separator, if missing
+		size_t len = strlen(fullPath);
+
+		if (len && (fullPath[len - 1] != SEPARATOR))
+			serialLogDir += SEPARATOR;
 		}
 #else
 	recordMemoryMax				= getMemorySize(RECORD_MEMORY_UPPER);

=== modified file 'storage/falcon/Database.cpp'
--- a/storage/falcon/Database.cpp	2008-09-05 16:26:12 +0000
+++ b/storage/falcon/Database.cpp	2008-09-11 10:56:00 +0000
@@ -691,7 +691,20 @@ void Database::createDatabase(const char
 
 void Database::openDatabase(const char * filename)
 {
-	cache = dbb->open (filename, configuration->pageCacheSize, 0);
+	try 
+		{
+		cache = dbb->open (filename, configuration->pageCacheSize, 0);
+		}
+	catch(SQLException& e)
+		{
+		// Master cannot be opened - throw OPEN_MASTER error to initiate
+		// create database. Don't do it if file exists, but there is a problem
+		// with permissions and/or locking.
+		if(e.getSqlcode() != FILE_ACCESS_ERROR)
+			throw SQLError(OPEN_MASTER_ERROR, e.getText());
+		else
+			throw;
+		}
 	start();
 
 	if (   dbb->logRoot.IsEmpty()

=== modified file 'storage/falcon/IO.cpp'
--- a/storage/falcon/IO.cpp	2008-09-06 05:14:38 +0000
+++ b/storage/falcon/IO.cpp	2008-09-11 10:56:00 +0000
@@ -517,43 +517,6 @@ bool IO::doesFileExist(const char *fileN
 	return fileStat(fileName, &stats, &errnum) == 0;
 }
 
-bool IO::isDirectory(const char *path)
-{
-	struct stat buf;
-	char tmpPath[PATH_MAX+1];
-
-#ifdef _WIN32	
-	strncpy(tmpPath, path, MIN(PATH_MAX, (int)strlen(path)+1));
-	tmpPath[PATH_MAX] = '\0';
-	char *last = tmpPath + strlen(tmpPath) - 1;
-	
-	// Win32 stat() fails for paths with a terminating backslash
-	// If this is a non-empty string, then zap the trailing backslash
-	
-	if (last > tmpPath)
-		{
-		if (*last == '\\')
-			*last = '\0';
-		
-		if (!stat(tmpPath, &buf))
-			return ((buf.st_mode & S_IFDIR) != 0);
-		}
-		
-	return false;
-#else
-	const char *resolvedPath;
-	resolvedPath = realpath (path, tmpPath);
-
-	if (!resolvedPath)
-		return false;
-
-	if (stat(resolvedPath, &buf))
-		return false;
-		
-	return S_ISDIR (buf.st_mode);
-#endif
-}
-
 int IO::fileStat(const char *fileName, struct stat *fileStats, int *errnum)
 {
 	struct stat stats;

=== modified file 'storage/falcon/IOx.h'
--- a/storage/falcon/IOx.h	2008-09-05 22:36:19 +0000
+++ b/storage/falcon/IOx.h	2008-09-11 10:56:00 +0000
@@ -55,7 +55,6 @@ public:
 	int		read(int length, UCHAR *buffer);
 	void	write(uint32 length, const UCHAR *data);
 	static bool	doesFileExist(const char *fileName);
-	static bool isDirectory(const char *path);
 	static int	fileStat(const char *fileName, struct stat *stats = NULL, int *errnum = NULL);
 	void	declareFatalError();
 	void	seek (int pageNumber);

=== modified file 'storage/falcon/SQLException.h'
--- a/storage/falcon/SQLException.h	2008-09-04 10:49:57 +0000
+++ b/storage/falcon/SQLException.h	2008-09-11 10:56:00 +0000
@@ -70,7 +70,8 @@ enum SqlCode {
 	DEVICE_FULL					= -36,
 	FILE_ACCESS_ERROR			= -37,
 	TABLESPACE_DATAFILE_EXIST_ERROR	= -38,
-	RECOVERY_ERROR				= -39
+	RECOVERY_ERROR				= -39,
+	OPEN_MASTER_ERROR		= -40
 	};
 
 class DllExport SQLException {

=== modified file 'storage/falcon/StorageHandler.cpp'
--- a/storage/falcon/StorageHandler.cpp	2008-09-05 22:36:19 +0000
+++ b/storage/falcon/StorageHandler.cpp	2008-09-11 10:56:00 +0000
@@ -1003,8 +1003,7 @@ void StorageHandler::initialize(void)
 
 		// If got one of following errors, just rethrow. No point in 
 		// trying to create database.
-		if (err == OUT_OF_MEMORY_ERROR || err == FILE_ACCESS_ERROR ||
-			err == VERSION_ERROR || err == RECOVERY_ERROR)
+		if (err != OPEN_MASTER_ERROR)
 			throw;
 
 		try

Thread
bzr push into mysql-6.0-falcon branch (vvaintroub:2815) Vladislav Vaintroub11 Sep