Changeset: 4b93dae5fb21 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4b93dae5fb21
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
monetdb5/modules/atoms/blob.c
monetdb5/modules/atoms/blob.mal
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
Branch: Dec2016
Log Message:
changed blob nequal function into a compare function, now we can
safely order blobs
diffs (127 lines):
diff --git a/clients/Tests/MAL-signatures.stable.out
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -6183,12 +6183,12 @@ Ready.
[ "bbp", "getRefCount", "command bbp.getRefCount(b:bat[:any_1]):int ",
"CMDgetBATrefcnt;", "Utility for debugging MAL interpreter" ]
[ "bbp", "getStatus", "command bbp.getStatus():bat[:str] ",
"CMDbbpStatus;", "Create a BAT with the disk/load status" ]
[ "bbp", "setName", "command bbp.setName(b:bat[:any_1],n:str):str
", "CMDsetName;", "Rename a BAT" ]
+[ "blob", "#cmp", "command blob.#cmp():void ", "BLOBcmp;", ""
]
[ "blob", "#del", "command blob.#del():void ", "BLOBdel;", ""
]
[ "blob", "#fromstr", "command blob.#fromstr():void ",
"BLOBfromstr;", "" ]
[ "blob", "#hash", "command blob.#hash():void ", "BLOBhash;",
"" ]
[ "blob", "#heap", "command blob.#heap():void ", "BLOBheap;",
"" ]
[ "blob", "#length", "command blob.#length():void ", "BLOBlength;",
"" ]
-[ "blob", "#nequal", "command blob.#nequal():void ", "BLOBnequal;",
"" ]
[ "blob", "#null", "command blob.#null():void ", "BLOBnull;",
"" ]
[ "blob", "#put", "command blob.#put():void ", "BLOBput;", ""
]
[ "blob", "#read", "command blob.#read():void ", "BLOBread;",
"" ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -8152,12 +8152,12 @@ Ready.
[ "bbp", "getRefCount", "command bbp.getRefCount(b:bat[:any_1]):int ",
"CMDgetBATrefcnt;", "Utility for debugging MAL interpreter" ]
[ "bbp", "getStatus", "command bbp.getStatus():bat[:str] ",
"CMDbbpStatus;", "Create a BAT with the disk/load status" ]
[ "bbp", "setName", "command bbp.setName(b:bat[:any_1],n:str):str
", "CMDsetName;", "Rename a BAT" ]
+[ "blob", "#cmp", "command blob.#cmp():void ", "BLOBcmp;", ""
]
[ "blob", "#del", "command blob.#del():void ", "BLOBdel;", ""
]
[ "blob", "#fromstr", "command blob.#fromstr():void ",
"BLOBfromstr;", "" ]
[ "blob", "#hash", "command blob.#hash():void ", "BLOBhash;",
"" ]
[ "blob", "#heap", "command blob.#heap():void ", "BLOBheap;",
"" ]
[ "blob", "#length", "command blob.#length():void ", "BLOBlength;",
"" ]
-[ "blob", "#nequal", "command blob.#nequal():void ", "BLOBnequal;",
"" ]
[ "blob", "#null", "command blob.#null():void ", "BLOBnull;",
"" ]
[ "blob", "#put", "command blob.#put():void ", "BLOBput;", ""
]
[ "blob", "#read", "command blob.#read():void ", "BLOBread;",
"" ]
diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c
--- a/monetdb5/modules/atoms/blob.c
+++ b/monetdb5/modules/atoms/blob.c
@@ -39,7 +39,7 @@ mal_export str BLOBprelude(void *ret);
mal_export int BLOBtostr(str *tostr, int *l, blob *pin);
mal_export int BLOBfromstr(char *instr, int *l, blob **val);
-mal_export int BLOBnequal(blob *l, blob *r);
+mal_export int BLOBcmp(blob *l, blob *r);
mal_export BUN BLOBhash(blob *b);
mal_export blob * BLOBnull(void);
mal_export var_t BLOBput(Heap *h, var_t *bun, blob *val);
@@ -94,17 +94,17 @@ blob_put(Heap *h, var_t *bun, blob *val)
}
static int
-blob_nequal(blob *l, blob *r)
+blob_cmp(blob *l, blob *r)
{
size_t len = l->nitems;
if (len != r->nitems)
- return (1);
+ return len - r->nitems;
if (len == ~(size_t) 0)
return (0);
- return memcmp(l->data, r->data, len) != 0;
+ return memcmp(l->data, r->data, len);
}
static void
@@ -447,9 +447,9 @@ fromblob_idx(str *retval, blob *b, int *
* @-
*/
int
-BLOBnequal(blob *l, blob *r)
+BLOBcmp(blob *l, blob *r)
{
- return blob_nequal(l, r);
+ return blob_cmp(l, r);
}
void
diff --git a/monetdb5/modules/atoms/blob.mal b/monetdb5/modules/atoms/blob.mal
--- a/monetdb5/modules/atoms/blob.mal
+++ b/monetdb5/modules/atoms/blob.mal
@@ -10,7 +10,7 @@ atom blob;
command tostr() address BLOBtostr;
command fromstr() address BLOBfromstr;
-command nequal() address BLOBnequal;
+command cmp() address BLOBcmp;
command hash() address BLOBhash;
command null() address BLOBnull;
command read() address BLOBread;
diff --git
a/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
b/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
--- a/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
+++ b/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
@@ -268,12 +268,12 @@ Ready.
% v # name
% blob # type
% 0 # length
+[ NULL ]
+[ ]
[ 00 ]
[ 11 ]
[ 0123456789 ]
[ A0B2C3D4F5 ]
-[ ]
-[ NULL ]
#SELECT v, convert(v, varchar(16)) from T_blob;
% sys.t_blob, sys.L3 # table_name
% v, L3 # name
diff --git
a/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
b/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
---
a/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
+++
b/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
@@ -292,12 +292,12 @@ Ready.
% v # name
% blob # type
% 0 # length
+[ NULL ]
+[ ]
[ 00 ]
[ 11 ]
[ 0123456789 ]
[ A0B2C3D4F5 ]
-[ ]
-[ NULL ]
#SELECT v, convert(v, varchar(16)) from T_blob;
% sys.t_blob, sys.L3 # table_name
% v, L3 # name
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list