Update of /cvsroot/monetdb/sql/src/common
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29428/common
Modified Files:
sql_keyword.mx sql_types.mx
Log Message:
Partially rolling back the casting changes.
There are several places build on the assumption
that searching a keyword involves a re-cast to lowercase.
U sql_types.mx
Index: sql_types.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/common/sql_types.mx,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- sql_types.mx 22 Oct 2008 10:21:15 -0000 1.116
+++ sql_types.mx 22 Oct 2008 10:42:21 -0000 1.117
@@ -992,7 +992,7 @@
a->name = _strdup(name);
a->alias = _strdup(alias);
list_append(aliases, a);
- if (!keyword_exists(a->alias))
+ if (!keyword_exists(a->alias) )
keywords_insert(a->alias, KW_ALIAS);
}
@@ -1033,7 +1033,7 @@
t->radix = radix;
t->eclass = eclass;
t->s = NULL;
- if (!keyword_exists(mkLower(t->sqlname)) )
+ if (!keyword_exists(t->sqlname) )
keywords_insert(t->sqlname, KW_TYPE);
list_append(types, t);
U sql_keyword.mx
Index: sql_keyword.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/common/sql_keyword.mx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- sql_keyword.mx 22 Oct 2008 10:21:15 -0000 1.14
+++ sql_keyword.mx 22 Oct 2008 10:42:21 -0000 1.15
@@ -58,25 +58,13 @@
kw->token = token;
kw->next = keywords[bucket];
keywords[bucket] = kw;
-
-/* insert both lower case and upper case to cope
- with most usage patterns */
-
- kw = NEW(keyword);
- len =0;
- bucket = keyword_key(k = toUpper(k), &len) & HASH_MASK;
- kw->keyword = k;
- kw->len = len;
- kw->token = token;
- kw->next = keywords[bucket];
- keywords[bucket] = kw;
}
keyword *
find_keyword(char *text)
{
int len = 0;
- int bucket = keyword_key(text, &len) & HASH_MASK;
+ int bucket = keyword_key(mkLower(text), &len) & HASH_MASK;
keyword *k = keywords[bucket];
while (k) {
@@ -85,15 +73,6 @@
k = k->next;
}
- /* see if recasting works */
- bucket = keyword_key(mkLower(text), &len) & HASH_MASK;
- k = keywords[bucket];
- while (k) {
- if (len == k->len && strcmp(k->keyword, text) == 0)
- return k;
-
- k = k->next;
- }
return NULL;
}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins