Update of /cvsroot/monetdb/sql/src/storage/bat
In directory sc8-pr-cvs16:/tmp/cvs-serv6789/src/storage/bat

Modified Files:
        bat_store.mx sql_catalog.mx 
Log Message:
small fixes to the external types


Index: bat_store.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bat/bat_store.mx,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- bat_store.mx        17 Apr 2007 12:27:08 -0000      1.129
+++ bat_store.mx        20 Apr 2007 20:37:31 -0000      1.130
@@ -1228,6 +1228,7 @@
        t->radix = *(int *) bun_find(type_radix, lid);
        t->eclass = *(int *) bun_find(type_eclass, lid);
        t->localtype = ATOMindex(t->base.name);
+       t->bits = 0;
        t->s = s;
 
        bat_destroy(type_id);
@@ -3018,6 +3019,8 @@
        t->digits = ot->digits;
        t->scale = ot->scale;
        t->radix = ot->radix;
+       t->eclass = ot->eclass;
+       t->bits = ot->bits;
        t->localtype = ot->localtype;
        t->s = s;
        return t;
@@ -4824,6 +4827,7 @@
        sql_type *t;
        sql_table *systype;
        int localtype = ATOMindex(impl);
+       int eclass = EC_ANY;
 
        if (localtype < 0) 
                return NULL;
@@ -4834,12 +4838,12 @@
        t->digits = digits;
        t->scale = scale;
        t->radix = radix;
-       t->eclass = EC_ANY;
+       t->eclass = eclass;
        t->localtype = localtype;
        t->s = s;
 
        cs_add(&s->types, t, TR_NEW);
-       table_insert(tr, systype, &t->base.id, t->base.name, t->sqlname, 
&t->digits, &t->scale, &t->radix, &t->eclass, &s->base.id);
+       table_insert(tr, systype, &t->base.id, t->base.name, t->sqlname, 
&t->digits, &t->scale, &radix, &eclass, &s->base.id);
 
        t->base.wtime = s->base.wtime = tr->wtime = tr->stime;
        tr->schema_updates ++;

Index: sql_catalog.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bat/sql_catalog.mx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- sql_catalog.mx      17 Apr 2007 10:27:37 -0000      1.19
+++ sql_catalog.mx      20 Apr 2007 20:37:31 -0000      1.20
@@ -210,10 +210,26 @@
 }
 
 node *
+find_sqlname(list *l, char *name)
+{
+       if (l) {
+               node *n;
+
+               for (n = l->h; n; n = n->next) {
+                       sql_type *t = n->data;
+
+                       if (strcmp(t->sqlname, name) == 0)
+                               return n;
+               } 
+       }
+       return NULL;
+}
+
+node *
 find_sql_type_node(sql_schema * s, char *tname, int id)
 {
        if (tname)
-               return cs_find_name(&s->types, tname);
+               return find_sqlname(s->types.set, tname);
        else 
                return cs_find_id(&s->types, id);
 }


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to