List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:March 13 2008 6:42pm
Subject:bk commit into 6.0 tree (jas:1.2592)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of jas.  When jas does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-03-13 13:42:20-04:00, jas@rowvwade. +2 -0
  Added function to normalize SQL object names.

  storage/falcon/StorageHandler.cpp@stripped, 2008-03-13 13:42:11-04:00, jas@rowvwade. +35 -0
    Added function to normalize SQL object names.

  storage/falcon/StorageHandler.h@stripped, 2008-03-13 13:42:11-04:00, jas@rowvwade. +2 -1
    Added function to normalize SQL object names.

diff -Nrup a/storage/falcon/StorageHandler.cpp b/storage/falcon/StorageHandler.cpp
--- a/storage/falcon/StorageHandler.cpp	2008-03-03 17:43:49 -05:00
+++ b/storage/falcon/StorageHandler.cpp	2008-03-13 13:42:11 -04:00
@@ -40,6 +40,8 @@
 #define DICTIONARY_PW			"mysql"
 #define FALCON_USER				DEFAULT_TABLESPACE_PATH
 #define FALCON_TEMPORARY		TEMPORARY_PATH
+#define WHITE_SPACE				" \t\n\r"
+#define PUNCTUATION_CHARS		".+-*/%()*<>=!;,?{}[]:~^|"
 
 #define HASH(address,size)				(int)(((UIPTR) address >> 2) % size)
 
@@ -79,11 +81,28 @@ extern Server*	startServer(int port, con
 
 static StorageHandler *storageHandler;
 
+static char charTable[256];
+static int init();
+static int foo = init();
+
 #ifdef _DEBUG
 #undef THIS_FILE
 static const char THIS_FILE[]=__FILE__;
 #endif
 
+int init()
+{
+	const char *p;
+	
+	for (p = WHITE_SPACE; *p;)
+		charTable[*p++] = 1;
+	
+	for (p = PUNCTUATION_CHARS; *p;)
+		charTable[*p++] = 1;
+	
+	return 1;
+}
+
 StorageHandler*	getFalconStorageHandler(int lockSize)
 {
 	if (!storageHandler)
@@ -1114,3 +1133,19 @@ int StorageHandler::recoverGetNextLimbo(
 
 	return 0;
 	}
+
+const char* StorageHandler::normalizeName(const char* name, int bufferSize, char* buffer)
+{
+	char *q = buffer;
+	char *end = buffer + bufferSize - 1;
+	
+	for (const char *p = name; *p && q < end; ++p)
+		if (charTable[*p])
+			return name;
+		else
+			*q++ = UPPER(*p);
+	
+	*q = 0;
+	
+	return buffer;
+}
diff -Nrup a/storage/falcon/StorageHandler.h b/storage/falcon/StorageHandler.h
--- a/storage/falcon/StorageHandler.h	2008-02-25 07:17:53 -05:00
+++ b/storage/falcon/StorageHandler.h	2008-03-13 13:42:11 -04:00
@@ -109,6 +109,8 @@ public:
 	virtual void		setRecordScavengeThreshold(int value);
 	virtual void		setRecordScavengeFloor(int value);
 	virtual	StorageTableShare* preDeleteTable(const char* pathname);
+	virtual void		getFalconVersionInfo(InfoTable* infoTable);
+	virtual const char* normalizeName(const char* name, int bufferSize, char* buffer);
 
 	StorageDatabase*	getStorageDatabase(const char* dbName, const char* path);
 	void				remove(StorageConnection* storageConnection);
@@ -137,7 +139,6 @@ public:
 	Connection			*dictionaryConnection;
 	int					mySqlLockSize;
 	bool				initialized;
-	virtual void getFalconVersionInfo(InfoTable* infoTable);
 };
 
 #endif
Thread
bk commit into 6.0 tree (jas:1.2592)U-ROWVWADEjas13 Mar