Update of /cvsroot/monetdb/sql/src/storage/bat
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13018/src/storage/bat

Modified Files:
        bat_table.mx 
Log Message:
propagated changes of Wednesday Aug 12 2009
from the Aug2009 branch to the development trunk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/08/12 - stmane: src/storage/bat/bat_table.mx,1.39.2.1

In an attampt to ensure portability to, and hence correctness on,
64-bit big-endian machines with 32-bit OIDs,
we make the SQL storage interface implementation a bit "less generic",
but a bit "more MonetDB-specific",
by using type oid instead of type ssize_t
for row indices / row ids ("rid")
that are stored as type oid in BATs.

(For convenience, these changes are wrapped in CVS tags
 "rid-ssize_t" & "rid-oid".)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: bat_table.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bat/bat_table.mx,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- bat_table.mx        28 Jun 2009 17:43:30 -0000      1.39
+++ bat_table.mx        12 Aug 2009 17:41:13 -0000      1.40
@@ -112,13 +112,13 @@
        return delta_full_bat(c->data, isTemp(c), d, s);
 }
 
-static ssize_t
+static oid
 column_find_row(sql_trans *tr, sql_column *c, void *value, ...)
 {
        va_list va;
        BUN q;
        BAT *b = NULL, *s = NULL, *r = NULL, *d = NULL;
-       ssize_t rid = -1;
+       oid rid = oid_nil;
        sql_column *nc;
        void *nv;
        sql_dbat *bat = c->t->data;
@@ -154,7 +154,7 @@
 }
 
 static void *
-column_find_value(sql_trans *tr, sql_column *c, ssize_t rid)
+column_find_value(sql_trans *tr, sql_column *c, oid rid)
 {
        BUN q;
        BAT *b, *d = NULL;
@@ -184,10 +184,9 @@
 }
 
 static int
-column_update_value(sql_trans *tr, sql_column *c, ssize_t rid, void *value)
+column_update_value(sql_trans *tr, sql_column *c, oid rid, void *value)
 {
-       assert(rid != (ssize_t)oid_nil);
-       assert(rid != -1);
+       assert(rid != oid_nil);
 
        store_funcs.update_col(tr, c, value, c->type.type->localtype, rid);
        return 0;
@@ -217,10 +216,9 @@
 }
 
 static int
-table_delete(sql_trans *tr, sql_table *t, ssize_t rid)
+table_delete(sql_trans *tr, sql_table *t, oid rid)
 {
-       assert(rid != (ssize_t)oid_nil);
-       assert(rid != -1);
+       assert(rid != oid_nil);
 
        store_funcs.delete_tab(tr, t, &rid, TYPE_oid);
        return 0;
@@ -346,15 +344,15 @@
 }
 
 
-/* return table rids from result of rids_select, return (-1) when done */
-static ssize_t 
+/* return table rids from result of rids_select, return (oid_nil) when done */
+static oid 
 rids_next(rids *r)
 {
        if (r->cur < BATcount(r->data)) {
                BATiter bi = bat_iterator(r->data);
                return *(oid*)BUNhead(bi, r->cur++);
        }
-       return -1;
+       return oid_nil;
 }
 
 static rids *


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to