Update of /cvsroot/monetdb/sql/src/server
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13960/src/server

Modified Files:
        rel_select.mx sql_select.mx sql_semantic.mx 
Log Message:
Added toUpper and avoided name clash. Added all upper case versions
to the symbol table. This accomodates most use cases, if we fail
to find then we re-cast. Savings around 1% on micro-test of Fabian.


U rel_select.mx
Index: rel_select.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/rel_select.mx,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- rel_select.mx       10 Oct 2008 08:59:45 -0000      1.88
+++ rel_select.mx       22 Oct 2008 07:10:12 -0000      1.89
@@ -2879,12 +2879,12 @@
                return NULL;
 
        if (f == sql_where && !groupby) 
-               return sql_error(sql, 02, "%s: not allowed in WHERE clause", 
toUpper(alloca(strlen(aggrstr) + 1), aggrstr));
+               return sql_error(sql, 02, "%s: not allowed in WHERE clause", 
toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr));
        
        if (!l->h->next->next->data.sym) {      /* count(*) case */
 
                if (strcmp(aggrstr, "count") != 0) {
-                       return sql_error(sql, 02, "%s: unable to perform 
'%s(*)'", toUpper(alloca(strlen(aggrstr) + 1), aggrstr), aggrstr);
+                       return sql_error(sql, 02, "%s: unable to perform 
'%s(*)'", toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr), aggrstr);
                }
                a = sql_bind_aggr(sql->session->schema, aggrstr, NULL);
                /* add aggr expression to the groupby, and return a 
@@ -2923,7 +2923,7 @@
                char *type = exp_subtype(e)->type->sqlname;
 
                exp_destroy(e);
-               return sql_error(sql, 02, "%s: no such operator '%s(%s)'", 
toUpper(alloca(strlen(aggrstr) + 1), aggrstr), aggrstr, type);
+               return sql_error(sql, 02, "%s: no such operator '%s(%s)'", 
toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr), aggrstr, type);
        }
 }
 
@@ -3355,7 +3355,7 @@
        }
 
        if (f == sql_where) 
-               return sql_error(sql, 02, "%s: not allowed in WHERE clause", 
toUpper(alloca(strlen(aggrstr) + 1), aggrstr));
+               return sql_error(sql, 02, "%s: not allowed in WHERE clause", 
toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr));
 
        /* window operations are only allowed in the projection */
        if (r->op != op_project)

U sql_semantic.mx
Index: sql_semantic.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/sql_semantic.mx,v
retrieving revision 1.188
retrieving revision 1.189
diff -u -d -r1.188 -r1.189
--- sql_semantic.mx     10 Oct 2008 09:00:58 -0000      1.188
+++ sql_semantic.mx     22 Oct 2008 07:10:12 -0000      1.189
@@ -109,7 +109,7 @@
 extern char *symbol2string(mvc *sql, symbol *s);
 extern char *dlist2string(mvc *sql, dlist *s);
 
-extern char * toUpper(char *dest, const char *src); 
+extern char * toUpperCopy(char *dest, const char *src); 
 
 #endif /*_SQL_SEMANTIC_H_*/
 
@@ -952,7 +952,7 @@
        return NULL;
 }
 
-char * toUpper(char *dest, const char *src) 
+char * toUpperCopy(char *dest, const char *src) 
 {
        int i, len;
 

U sql_select.mx
Index: sql_select.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/sql_select.mx,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -d -r1.248 -r1.249
--- sql_select.mx       21 Oct 2008 12:48:16 -0000      1.248
+++ sql_select.mx       22 Oct 2008 07:10:12 -0000      1.249
@@ -1166,13 +1166,13 @@
 
        assert(l->h->next->type == type_int);
        if (f == sql_where) 
-               return sql_error(sql, 02, "%s: not allowed in WHERE clause", 
toUpper(alloca(strlen(aggrstr) + 1), aggrstr));
+               return sql_error(sql, 02, "%s: not allowed in WHERE clause", 
toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr));
        
        if (!l->h->next->next->data.sym) {      /* count(*) case */
                cvar *cv;
 
                if (strcmp(aggrstr, "count") != 0) {
-                       return sql_error(sql, 02, "%s: unable to perform 
'%s(*)'", toUpper(alloca(strlen(aggrstr) + 1), aggrstr), aggrstr);
+                       return sql_error(sql, 02, "%s: unable to perform 
'%s(*)'", toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr), aggrstr);
                }
                if (grp) {
                        a = sql_bind_aggr(schema, aggrstr, NULL);
@@ -1184,7 +1184,7 @@
 
                        assert(foundsubset);
                        if (!foundsubset) {
-                               return sql_error(sql, 02, "%s: no subset for 
column '%s'", toUpper(alloca(strlen(aggrstr) + 1), aggrstr), cv->cname);
+                               return sql_error(sql, 02, "%s: no subset for 
column '%s'", toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr), cv->cname);
                        }
                        s = foundsubset;
                        if (s && distinct) {
@@ -1245,7 +1245,7 @@
                char *type = tail_type(s)->type->sqlname;
 
                stmt_destroy(s);
-               return sql_error(sql, 02, "%s: no such operator '%s(%s)'", 
toUpper(alloca(strlen(aggrstr) + 1), aggrstr), aggrstr, type);
+               return sql_error(sql, 02, "%s: no such operator '%s(%s)'", 
toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr), aggrstr, type);
        }
 }
 
@@ -1532,7 +1532,7 @@
                return sql_error(sql, 02, "OVER: not supported in combination 
with GROUP BY");
 
        if (f == sql_where) 
-               return sql_error(sql, 02, "%s: not allowed in WHERE clause", 
toUpper(alloca(strlen(aggrstr) + 1), aggrstr));
+               return sql_error(sql, 02, "%s: not allowed in WHERE clause", 
toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr));
 
        /* Partition By */
        if (window_specification->h->data.sym) {


-------------------------------------------------------------------------
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

Reply via email to