Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv22856/src/backends/monet5
Modified Files:
Tag: Aug2009
sql.mx sql_user.mx
Log Message:
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: sql_user.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_user.mx,v
retrieving revision 1.48
retrieving revision 1.48.2.1
diff -u -d -r1.48 -r1.48.2.1
--- sql_user.mx 22 May 2009 11:52:08 -0000 1.48
+++ sql_user.mx 12 Aug 2009 11:25:34 -0000 1.48.2.1
@@ -46,14 +46,14 @@
sql_find_auth_schema(mvc *m, str auth)
{
int res = -1;
- ssize_t rid;
+ oid rid;
sql_schema *sys = find_sql_schema(m->session->tr, "sys");
sql_table *users = find_sql_table(sys, "db_user_info");
sql_column *users_name = find_sql_column(users, "name");
rid = table_funcs.column_find_row(m->session->tr, users_name, auth,
NULL);
- if (rid >= 0) {
+ if (rid != oid_nil) {
sql_column *users_schema = find_sql_column(users,
"default_schema");
int *p = (int *) table_funcs.column_find_value(m->session->tr,
users_schema, rid);
@@ -70,7 +70,7 @@
monet5_drop_user(ptr _mvc, str user)
{
mvc *m = (mvc *)_mvc;
- ssize_t rid;
+ oid rid;
sql_schema *sys;
sql_table *users;
sql_column *users_name;
@@ -88,7 +88,7 @@
users_name = find_sql_column(users, "name");
rid = table_funcs.column_find_row(m->session->tr, users_name, user,
NULL);
- if (rid >= 0)
+ if (rid != oid_nil)
table_funcs.table_delete(m->session->tr, users, rid);
/* FIXME: We have to ignore this inconsistency here, because the
* user was already removed from the system authorisation. Once
@@ -262,14 +262,14 @@
monet5_schema_has_user(ptr _mvc, sql_schema *s)
{
mvc *m = (mvc *)_mvc;
- ssize_t rid;
+ oid rid;
sql_schema *sys = find_sql_schema(m->session->tr, "sys");
sql_table *users = find_sql_table(sys, "db_user_info");
sql_column *users_schema = find_sql_column(users, "default_schema");
sqlid schema_id = s->base.id;
rid = table_funcs.column_find_row(m->session->tr, users_schema,
&schema_id, NULL);
- if (rid < 0)
+ if (rid == oid_nil)
return FALSE;
return TRUE;
}
@@ -336,7 +336,7 @@
}
if (schema_id) {
- ssize_t rid;
+ oid rid;
sql_schema *sys = find_sql_schema(m->session->tr, "sys");
sql_table *info = find_sql_table(sys, "db_user_info");
sql_column *users_name = find_sql_column(info, "name");
@@ -344,7 +344,7 @@
/* FIXME: we don't really check against the backend here */
rid = table_funcs.column_find_row(m->session->tr, users_name,
user, NULL);
- if (rid < 0)
+ if (rid == oid_nil)
return FALSE;
table_funcs.column_update_value(m->session->tr, users_schema,
rid, &schema_id);
@@ -392,7 +392,7 @@
str
monet5_user_get_def_schema(mvc *m, oid user)
{
- ssize_t rid;
+ oid rid;
sqlid schema_id;
sql_schema *sys = NULL;
sql_table *user_info = NULL;
@@ -425,7 +425,7 @@
users_name = find_sql_column(user_info, "name");
users_schema = find_sql_column(user_info, "default_schema");
- if ((rid = table_funcs.column_find_row(m->session->tr, users_name,
username, NULL)) >= 0)
+ if ((rid = table_funcs.column_find_row(m->session->tr, users_name,
username, NULL)) != oid_nil)
p = table_funcs.column_find_value(m->session->tr, users_schema,
rid);
assert(p);
@@ -438,12 +438,12 @@
auths = find_sql_table(sys, "auths");
auths_name = find_sql_column(auths, "name");
- if ((rid = table_funcs.column_find_row(m->session->tr, schemas_id,
&schema_id, NULL)) >= 0)
+ if ((rid = table_funcs.column_find_row(m->session->tr, schemas_id,
&schema_id, NULL)) != oid_nil)
schema = table_funcs.column_find_value(m->session->tr,
schemas_name, rid);
/* only set schema if user is found */
rid = table_funcs.column_find_row(m->session->tr, auths_name, username,
NULL);
- if (rid >= 0) {
+ if (rid != oid_nil) {
sql_column *auths_id = find_sql_column(auths, "id");
int id;
p = table_funcs.column_find_value(m->session->tr, auths_id,
rid);
Index: sql.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql.mx,v
retrieving revision 1.347
retrieving revision 1.347.2.1
diff -u -d -r1.347 -r1.347.2.1
--- sql.mx 25 Jul 2009 22:08:37 -0000 1.347
+++ sql.mx 12 Aug 2009 11:25:34 -0000 1.347.2.1
@@ -4186,7 +4186,7 @@
char buff[24];
mvc *m = NULL;
int id = 0;
- ssize_t rid = -1;
+ oid rid = oid_nil;
str msg = getContext(cntxt, mb, &m, NULL);
if (msg)
@@ -4198,7 +4198,7 @@
gid = mvc_bind_column(m, g_tbl, "gid");
rid = table_funcs.column_find_row(m->session->tr, gname, *name, NULL);
- if (rid != -1) {
+ if (rid != oid_nil) {
throw(SQL,"sql.rdfShred","graph name allready exists in
rdf.graph");
}
id = (int) store_funcs.count_col(gname);
------------------------------------------------------------------------------
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