Changeset: 9c7b4eafa9a9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9c7b4eafa9a9
Modified Files:
gdk/gdk_bat.c
gdk/gdk_string.c
Branch: ustr
Log Message:
Only allow persistent bats to become ustr bats.
diffs (30 lines):
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -807,7 +807,10 @@ COLcopy2(BAT *b, int tt, bool writable,
if (bn == NULL) {
goto bunins_failed;
}
- if (b->ustr && mayshare && BATconvert2ustr(bn) != GDK_SUCCEED) {
+ if (b->ustr &&
+ mayshare &&
+ role == PERSISTENT &&
+ BATconvert2ustr(bn) != GDK_SUCCEED) {
goto bunins_failed;
}
if (bn->tvheap != NULL && bn->tvheap->base == NULL && !mayshare) {
diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -308,6 +308,11 @@ BATconvert2ustr(BAT *b)
GDKerror("BAT must be empty to convert to ustr\n");
return GDK_FAIL;
}
+ if (b->batRole != PERSISTENT) {
+ MT_lock_unset(&b->theaplock);
+ GDKerror("BAT must be in persistent farm to convert to ustr\n");
+ return GDK_FAIL;
+ }
MT_lock_set(&ustrlock);
if (ustrbat == NULL && ustrCreate() != GDK_SUCCEED) {
MT_lock_unset(&ustrlock);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]