[prev in list] [next in list] [prev in thread] [next in thread] 

List:       monetdb-sql-checkins
Subject:    [Monetdb-sql-checkins] sql/src/storage/restrict restrict_table.mx, ,
From:       Stefan Manegold <stmane () users ! sourceforge ! net>
Date:       2009-08-12 17:41:36
Message-ID: E1MbHpQ-0003TA-8l () 23jxhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

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

Modified Files:
	restrict_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/restrict/restrict_table.mx,1.4.6.2

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: restrict_table.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/restrict/restrict_table.mx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- restrict_table.mx	5 Aug 2009 08:52:11 -0000	1.5
+++ restrict_table.mx	12 Aug 2009 17:41:34 -0000	1.6
@@ -57,13 +57,13 @@
 	return b;
 }
 
-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_bat *bat = c->t->data;
@@ -99,7 +99,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;
@@ -129,10 +129,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;
@@ -162,10 +161,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;
@@ -244,15 +242,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
Monetdb-sql-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic