Update of /cvsroot/monetdb/MonetDB/src/gdk
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4902
Modified Files:
gdk_bbp.mx
Log Message:
initialise physical bat name always using its bat id (solves out of bounds
problem)
Index: gdk_bbp.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_bbp.mx,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -d -r1.199 -r1.200
--- gdk_bbp.mx 14 May 2007 07:48:03 -0000 1.199
+++ gdk_bbp.mx 27 May 2007 22:06:29 -0000 1.200
@@ -449,6 +449,17 @@
return s + len;
}
+static INLINE str
+BBPphysicalname(str s, int len, bat i)
+{
+ s[--len] = 0;
+ while (i > 0) {
+ s[--len] = '0' + (i & 7);
+ i >>= 3;
+ }
+ return s + len;
+}
+
static int
recover_dir(int direxists)
{
@@ -990,9 +1001,13 @@
/* Keep the physical location around forever */
if (BBP_physical(i) == NULL) {
+ char name[64], *nme;
+
BBPgetsubdir(dirname, i);
- BBP_physical(i) = (str) GDKmalloc(strlen(dirname) +
strLen(BATgetId(b)) - 4 + 1 + 1 /* EOS + DIR_SEP */);
- GDKfilepath(BBP_physical(i), dirname, BATgetId(b) + 4, NULL);
+ nme = BBPphysicalname(name, 64, i);
+
+ BBP_physical(i) = (str) GDKmalloc(strlen(dirname) + strlen(nme)
+ 1 + 1 /* EOS + DIR_SEP */);
+ GDKfilepath(BBP_physical(i), dirname, nme, NULL);
BATDEBUG THRprintf(GDKout, "#%d = new %s(%s,%s)\n", (int) i,
BATgetId(b), ATOMname(b->htype), ATOMname(b->ttype));
}
@@ -2439,7 +2454,7 @@
/* only cache simple non-saved non-renamed transient bats */
if (m == NULL ||
batcache_minsize == 0 ||
- b->batCopiedtodisk ||
+ b->batCopiedtodisk || (b->batBuns->storage & STORE_MMAP) ||
b->batLview ||
BBPtmpcheck(s) == 0 ||
b->htype > TYPE_str ||
-------------------------------------------------------------------------
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-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins