Changeset: 41cc8fa13158 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=41cc8fa13158
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        gdk/gdk_search.c
        monetdb5/modules/mal/Tests/inspect05.stable.out.int128
        monetdb5/modules/mal/orderidx.c
        monetdb5/modules/mal/orderidx.h
        monetdb5/modules/mal/orderidx.mal
Branch: leftmart
Log Message:

Reinstate bat.getorderindex so tests orderidx0? can run.


diffs (249 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
@@ -31213,6 +31213,10 @@ command bat.delete(b:bat[:oid,:any_1],sr
 address BKCdelete_bat_bun;
 comment Delete from the first BAT all BUNs with a corresponding BUN         in 
the second.
 
+pattern bat.getorderidx(bv:bat[:oid,:any_1]):bat[:oid,:oid] 
+address OIDXgetorderidx;
+comment Return the order index if it exists
+
 command bat.getName(b:bat[:oid,:any_1]):str 
 address BKCgetBBPname;
 comment Gives back the logical name of a BAT.
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
@@ -40254,6 +40254,10 @@ command bat.delete(b:bat[:oid,:any_1],sr
 address BKCdelete_bat_bun;
 comment Delete from the first BAT all BUNs with a corresponding BUN         in 
the second.
 
+pattern bat.getorderidx(bv:bat[:oid,:any_1]):bat[:oid,:oid] 
+address OIDXgetorderidx;
+comment Return the order index if it exists
+
 command bat.getName(b:bat[:oid,:any_1]):str 
 address BKCgetBBPname;
 comment Gives back the logical name of a BAT.
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -1563,6 +1563,7 @@ str MTIMEunix_epoch(timestamp *ret);
 str OIDXcreate(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str OIDXcreateImplementation(Client cntxt, int tpe, BAT *b, int pieces);
 str OIDXdropImplementation(Client cntxt, BAT *b);
+str OIDXgetorderidx(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str OIDXhasorderidx(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str OIDXmerge(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 void OPTaliasRemap(InstrPtr p, int *alias);
diff --git a/gdk/gdk_search.c b/gdk/gdk_search.c
--- a/gdk/gdk_search.c
+++ b/gdk/gdk_search.c
@@ -1051,11 +1051,11 @@ bailout:
                do {                                                    \
                        __cur = __min;                                  \
                        if (left_child(__cur) < n_ar &&                 \
-                               minhp[left_child(__cur)] < minhp[(__min)]) { \
+                               minhp[left_child(__cur)] < minhp[__min]) { \
                                __min = left_child(__cur);              \
                        }                                               \
                        if (right_child(__cur) < n_ar &&                \
-                               minhp[right_child(__cur)] < minhp[(__min)]) { \
+                               minhp[right_child(__cur)] < minhp[__min]) { \
                                __min = right_child(__cur);             \
                        }                                               \
                        if (__min != __cur) {                           \
diff --git a/monetdb5/modules/mal/Tests/inspect05.stable.out.int128 
b/monetdb5/modules/mal/Tests/inspect05.stable.out.int128
--- a/monetdb5/modules/mal/Tests/inspect05.stable.out.int128
+++ b/monetdb5/modules/mal/Tests/inspect05.stable.out.int128
@@ -47,71 +47,72 @@ end user.main;
 [ 6@0, "delete",       "command",      "bat",  
"(b:bat[:oid,:any_1]):bat[:oid,:any_1] ",       "BKCdelete_all;"  ]
 [ 7@0, "delete",       "command",      "bat",  
"(b:bat[:oid,:any_1],h:oid):bat[:oid,:any_1] ", "BKCdelete;"  ]
 [ 8@0, "densebat",     "command",      "bat",  
"(b:bat[:oid,:any_1],src:bat[:oid,:any_1]):bat[:oid,:any_1] ",  
"BKCdelete_bat_bun;"  ]
-[ 9@0, "getAccess",    "command",      "bat",  "(b:bat[:oid,:any_1]):str ",    
"BKCgetBBPname;"  ]
-[ 10@0,        "getCapacity",  "command",      "bat",  
"(b:bat[:oid,:any_1]):oid ",    "BKCgetSequenceBase;"  ]
-[ 11@0,        "getColumnType",        "command",      "bat",  
"(b:bat[:oid,:any_1]):str ",    "BKCgetAccess;"  ]
-[ 12@0,        "getName",      "command",      "bat",  
"(bid:bat[:oid,:any_1]):str ",  "BKCgetRole;"  ]
-[ 13@0,        "getRole",      "command",      "bat",  
"(b:bat[:oid,:any_1]):str ",    "BKCgetColumnType;"  ]
-[ 14@0,        "getSequenceBase",      "command",      "bat",  
"(b:bat[:oid,:any_1]):lng ",    "BKCgetCapacity;"  ]
-[ 15@0,        "getSize",      "command",      "bat",  
"(b:bat[:oid,:any_1]):lng ",    "BKCgetSize;"  ]
-[ 16@0,        "hasorderidx",  "pattern",      "bat",  
"(bv:bat[:oid,:any_1]):bat[:oid,:oid] ",        "OIDXhasorderidx;"  ]
-[ 17@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:hge]):lng 
",      "CMDBATimprintsize;"  ]
-[ 18@0,        "imprints",     "command",      "bat",  
"(b:bat[:oid,:hge]):void ",     "CMDBATimprints;"  ]
-[ 19@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:dbl]):lng 
",      "CMDBATimprintsize;"  ]
-[ 20@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:flt]):lng 
",      "CMDBATimprintsize;"  ]
-[ 21@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:lng]):lng 
",      "CMDBATimprintsize;"  ]
-[ 22@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:int]):lng 
",      "CMDBATimprintsize;"  ]
-[ 23@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:sht]):lng 
",      "CMDBATimprintsize;"  ]
-[ 24@0,        "imprintsize",  "command",      "bat",  "(b:bat[:oid,:bte]):lng 
",      "CMDBATimprintsize;"  ]
-[ 25@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:dbl]):void ",     "CMDBATimprints;"  ]
-[ 26@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:flt]):void ",     "CMDBATimprints;"  ]
-[ 27@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:lng]):void ",     "CMDBATimprints;"  ]
-[ 28@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:int]):void ",     "CMDBATimprints;"  ]
-[ 29@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:sht]):void ",     "CMDBATimprints;"  ]
-[ 30@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:bte]):void ",     "CMDBATimprints;"  ]
-[ 31@0,        "info", "command",      "bat",  
"(a:bat[:oid,:oid],b:bat[:oid,:oid]):bat[:oid,:oid] ",  "BKCintersectcand;"  ]
-[ 32@0,        "intersectcand",        "command",      "bat",  
"(b1:bat[:oid,:any_1],b2:bat[:oid,:any_2]):bit ",       "BKCisSynced;"  ]
-[ 33@0,        "isPersistent", "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCisPersistent;"  ]
-[ 34@0,        "isSorted",     "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCisTransient;"  ]
-[ 35@0,        "isSortedReverse",      "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCisSortedReverse;"  ]
-[ 36@0,        "isSynced",     "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCisSorted;"  ]
-[ 37@0,        "isTransient",  "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCgetKey;"  ]
-[ 38@0,        "isaKey",       "command",      "bat",  "(b:bat[:oid,:any_1]) 
(X_2:bat[:oid,:str],X_3:bat[:oid,:str]) ",        "BKCinfo;"  ]
-[ 39@0,        "mergecand",    "command",      "bat",  
"(a:bat[:oid,:oid],b:bat[:oid,:oid]):bat[:oid,:oid] ",  "BKCmergecand;"  ]
-[ 40@0,        "mirror",       "command",      "bat",  
"(b:bat[:oid,:any_2]):bat[:oid,:oid] ", "BKCmirror;"  ]
-[ 41@0,        "new",  "command",      "bat",  "(nme:str):bat[:oid,:any_1] ",  
"CMDBATderivedByName;"  ]
-[ 42@0,        "new",  "pattern",      "bat",  
"(b:bat[:oid,:any_1],size:lng):bat[:oid,:any_1] ",      "CMDBATnewDerived;"  ]
-[ 43@0,        "new",  "pattern",      "bat",  
"(b:bat[:oid,:any_1]):bat[:oid,:any_1] ",       "CMDBATnewDerived;"  ]
-[ 44@0,        "new",  "pattern",      "bat",  
"(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1] ", "CMDBATnew_persistent;"  ]
-[ 45@0,        "new",  "pattern",      "bat",  
"(ht:oid,tt:any_1,size:int):bat[:oid,:any_1] ", "CMDBATnew_persistent;"  ]
-[ 46@0,        "new",  "pattern",      "bat",  
"(ht:oid,tt:any_1):bat[:oid,:any_1] ",  "CMDBATnew_persistent;"  ]
-[ 47@0,        "new_persistent",       "pattern",      "bat",  
"(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1] ", "CMDBATnew;"  ]
-[ 48@0,        "new_persistent",       "pattern",      "bat",  
"(ht:oid,tt:any_1,size:int):bat[:oid,:any_1] ", "CMDBATnew;"  ]
-[ 49@0,        "new_persistent",       "pattern",      "bat",  
"(ht:oid,tt:any_1):bat[:oid,:any_1] ",  "CMDBATnew;"  ]
-[ 50@0,        "orderidx",     "pattern",      "bat",  
"(bv:bat[:oid,:any_1],l:bat[:oid,:oid]...):void ",      "OIDXmerge;"  ]
-[ 51@0,        "orderidx",     "pattern",      "bat",  
"(bv:bat[:oid,:any_1],pieces:int):void ",       "OIDXcreate;"  ]
-[ 52@0,        "orderidx",     "pattern",      "bat",  
"(bv:bat[:oid,:any_1]):void ",  "OIDXcreate;"  ]
-[ 53@0,        "partition",    "pattern",      "bat",  
"(b:bat[:oid,:any_1],pieces:int,n:int):bat[:oid,:any_1] ",      
"CMDBATpartition2;"  ]
-[ 54@0,        "partition",    "pattern",      "bat",  
"(b:bat[:oid,:any_1]):bat[:oid,:any_1]... ",    "CMDBATpartition;"  ]
-[ 55@0,        "replace",      "command",      "bat",  
"(b:bat[:oid,:any_1],del:bat[:oid,:oid]):bat[:oid,:oid] ",      
"BKCreuseBATmap;"  ]
-[ 56@0,        "replace",      "command",      "bat",  
"(b:bat[:oid,:any_1],del:bat[:oid,:oid]):bat[:oid,:any_1] ",    "BKCreuseBAT;"  
]
-[ 57@0,        "replace",      "command",      "bat",  
"(b:bat[:oid,:any_1],rid:bat[:oid,:oid],val:bat[:oid,:any_1],force:bit):bat[:oid,:any_1]
 ",     "BKCbat_inplace_force;"  ]
-[ 58@0,        "replace",      "command",      "bat",  
"(b:bat[:oid,:any_1],rid:bat[:oid,:oid],val:bat[:oid,:any_1]):bat[:oid,:any_1] 
",       "BKCbat_inplace;"  ]
-[ 59@0,        "reuse",        "command",      "bat",  
"(b:bat[:oid,:any_1],h:oid,t:any_1,force:bit):bat[:oid,:any_1] ",       
"BKCbun_inplace_force;"  ]
-[ 60@0,        "reuseMap",     "command",      "bat",  
"(b:bat[:oid,:any_1],h:oid,t:any_1):bat[:oid,:any_1] ", "BKCbun_inplace;"  ]
-[ 61@0,        "save", "pattern",      "bat",  "(val:any_1):bat[:oid,:any_1] 
",        "CMDBATsingle;"  ]
-[ 62@0,        "save", "command",      "bat",  "(b:bat[:oid,:any_1]):bit ",    
"BKCsetImprints;"  ]
-[ 63@0,        "setAccess",    "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCsetHash;"  ]
-[ 64@0,        "setColumn",    "command",      "bat",  "(nme:str):bit ",       
"BKCsave;"  ]
-[ 65@0,        "setColumn",    "command",      "bat",  
"(nme:bat[:oid,:any_1]):void ", "BKCsave2;"  ]
-[ 66@0,        "setHash",      "command",      "bat",  
"(b:bat[:oid,:any_1]):void ",   "BKCsetPersistent;"  ]
-[ 67@0,        "setImprints",  "command",      "bat",  
"(b:bat[:oid,:any_1]):void ",   "BKCsetTransient;"  ]
-[ 68@0,        "setKey",       "command",      "bat",  
"(b:bat[:oid,:any_1],h:str,t:str):void ",       "BKCsetColumns;"  ]
-[ 69@0,        "setName",      "command",      "bat",  
"(b:bat[:oid,:any_1],t:str):void ",     "BKCsetColumn;"  ]
-[ 70@0,        "setPersistent",        "command",      "bat",  
"(b:bat[:oid,:any_1],h:str,t:str):void ",       "BKCsetRole;"  ]
-[ 71@0,        "setRole",      "command",      "bat",  
"(b:bat[:oid,:any_1],s:str):void ",     "BKCsetName;"  ]
-[ 72@0,        "setTransient", "command",      "bat",  
"(b:bat[:oid,:any_1],mode:str):bat[:oid,:any_1] ",      "BKCsetAccess;"  ]
-[ 73@0,        "single",       "command",      "bat",  
"(b:bat[:oid,:any_1],mode:bit):bat[:oid,:any_1] ",      "BKCsetkey;"  ]
+[ 9@0, "getAccess",    "pattern",      "bat",  
"(bv:bat[:oid,:any_1]):bat[:oid,:oid] ",        "OIDXgetorderidx;"  ]
+[ 10@0,        "getCapacity",  "command",      "bat",  
"(b:bat[:oid,:any_1]):str ",    "BKCgetBBPname;"  ]
+[ 11@0,        "getColumnType",        "command",      "bat",  
"(b:bat[:oid,:any_1]):oid ",    "BKCgetSequenceBase;"  ]
+[ 12@0,        "getName",      "command",      "bat",  
"(b:bat[:oid,:any_1]):str ",    "BKCgetAccess;"  ]
+[ 13@0,        "getRole",      "command",      "bat",  
"(bid:bat[:oid,:any_1]):str ",  "BKCgetRole;"  ]
+[ 14@0,        "getSequenceBase",      "command",      "bat",  
"(b:bat[:oid,:any_1]):str ",    "BKCgetColumnType;"  ]
+[ 15@0,        "getSize",      "command",      "bat",  
"(b:bat[:oid,:any_1]):lng ",    "BKCgetCapacity;"  ]
+[ 16@0,        "getorderidx",  "command",      "bat",  
"(b:bat[:oid,:any_1]):lng ",    "BKCgetSize;"  ]
+[ 17@0,        "hasorderidx",  "pattern",      "bat",  
"(bv:bat[:oid,:any_1]):bit ",   "OIDXhasorderidx;"  ]
+[ 18@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:hge]):lng 
",      "CMDBATimprintsize;"  ]
+[ 19@0,        "imprints",     "command",      "bat",  
"(b:bat[:oid,:hge]):void ",     "CMDBATimprints;"  ]
+[ 20@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:dbl]):lng 
",      "CMDBATimprintsize;"  ]
+[ 21@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:flt]):lng 
",      "CMDBATimprintsize;"  ]
+[ 22@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:lng]):lng 
",      "CMDBATimprintsize;"  ]
+[ 23@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:int]):lng 
",      "CMDBATimprintsize;"  ]
+[ 24@0,        "imprints",     "command",      "bat",  "(b:bat[:oid,:sht]):lng 
",      "CMDBATimprintsize;"  ]
+[ 25@0,        "imprintsize",  "command",      "bat",  "(b:bat[:oid,:bte]):lng 
",      "CMDBATimprintsize;"  ]
+[ 26@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:dbl]):void ",     "CMDBATimprints;"  ]
+[ 27@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:flt]):void ",     "CMDBATimprints;"  ]
+[ 28@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:lng]):void ",     "CMDBATimprints;"  ]
+[ 29@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:int]):void ",     "CMDBATimprints;"  ]
+[ 30@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:sht]):void ",     "CMDBATimprints;"  ]
+[ 31@0,        "imprintsize",  "command",      "bat",  
"(b:bat[:oid,:bte]):void ",     "CMDBATimprints;"  ]
+[ 32@0,        "info", "command",      "bat",  
"(a:bat[:oid,:oid],b:bat[:oid,:oid]):bat[:oid,:oid] ",  "BKCintersectcand;"  ]
+[ 33@0,        "intersectcand",        "command",      "bat",  
"(b1:bat[:oid,:any_1],b2:bat[:oid,:any_2]):bit ",       "BKCisSynced;"  ]
+[ 34@0,        "isPersistent", "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCisPersistent;"  ]
+[ 35@0,        "isSorted",     "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCisTransient;"  ]
+[ 36@0,        "isSortedReverse",      "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCisSortedReverse;"  ]
+[ 37@0,        "isSynced",     "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCisSorted;"  ]
+[ 38@0,        "isTransient",  "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCgetKey;"  ]
+[ 39@0,        "isaKey",       "command",      "bat",  "(b:bat[:oid,:any_1]) 
(X_2:bat[:oid,:str],X_3:bat[:oid,:str]) ",        "BKCinfo;"  ]
+[ 40@0,        "mergecand",    "command",      "bat",  
"(a:bat[:oid,:oid],b:bat[:oid,:oid]):bat[:oid,:oid] ",  "BKCmergecand;"  ]
+[ 41@0,        "mirror",       "command",      "bat",  
"(b:bat[:oid,:any_2]):bat[:oid,:oid] ", "BKCmirror;"  ]
+[ 42@0,        "new",  "command",      "bat",  "(nme:str):bat[:oid,:any_1] ",  
"CMDBATderivedByName;"  ]
+[ 43@0,        "new",  "pattern",      "bat",  
"(b:bat[:oid,:any_1],size:lng):bat[:oid,:any_1] ",      "CMDBATnewDerived;"  ]
+[ 44@0,        "new",  "pattern",      "bat",  
"(b:bat[:oid,:any_1]):bat[:oid,:any_1] ",       "CMDBATnewDerived;"  ]
+[ 45@0,        "new",  "pattern",      "bat",  
"(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1] ", "CMDBATnew_persistent;"  ]
+[ 46@0,        "new",  "pattern",      "bat",  
"(ht:oid,tt:any_1,size:int):bat[:oid,:any_1] ", "CMDBATnew_persistent;"  ]
+[ 47@0,        "new",  "pattern",      "bat",  
"(ht:oid,tt:any_1):bat[:oid,:any_1] ",  "CMDBATnew_persistent;"  ]
+[ 48@0,        "new_persistent",       "pattern",      "bat",  
"(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1] ", "CMDBATnew;"  ]
+[ 49@0,        "new_persistent",       "pattern",      "bat",  
"(ht:oid,tt:any_1,size:int):bat[:oid,:any_1] ", "CMDBATnew;"  ]
+[ 50@0,        "new_persistent",       "pattern",      "bat",  
"(ht:oid,tt:any_1):bat[:oid,:any_1] ",  "CMDBATnew;"  ]
+[ 51@0,        "orderidx",     "pattern",      "bat",  
"(bv:bat[:oid,:any_1],l:bat[:oid,:oid]...):void ",      "OIDXmerge;"  ]
+[ 52@0,        "orderidx",     "pattern",      "bat",  
"(bv:bat[:oid,:any_1],pieces:int):void ",       "OIDXcreate;"  ]
+[ 53@0,        "orderidx",     "pattern",      "bat",  
"(bv:bat[:oid,:any_1]):void ",  "OIDXcreate;"  ]
+[ 54@0,        "partition",    "pattern",      "bat",  
"(b:bat[:oid,:any_1],pieces:int,n:int):bat[:oid,:any_1] ",      
"CMDBATpartition2;"  ]
+[ 55@0,        "partition",    "pattern",      "bat",  
"(b:bat[:oid,:any_1]):bat[:oid,:any_1]... ",    "CMDBATpartition;"  ]
+[ 56@0,        "replace",      "command",      "bat",  
"(b:bat[:oid,:any_1],del:bat[:oid,:oid]):bat[:oid,:oid] ",      
"BKCreuseBATmap;"  ]
+[ 57@0,        "replace",      "command",      "bat",  
"(b:bat[:oid,:any_1],del:bat[:oid,:oid]):bat[:oid,:any_1] ",    "BKCreuseBAT;"  
]
+[ 58@0,        "replace",      "command",      "bat",  
"(b:bat[:oid,:any_1],rid:bat[:oid,:oid],val:bat[:oid,:any_1],force:bit):bat[:oid,:any_1]
 ",     "BKCbat_inplace_force;"  ]
+[ 59@0,        "replace",      "command",      "bat",  
"(b:bat[:oid,:any_1],rid:bat[:oid,:oid],val:bat[:oid,:any_1]):bat[:oid,:any_1] 
",       "BKCbat_inplace;"  ]
+[ 60@0,        "reuse",        "command",      "bat",  
"(b:bat[:oid,:any_1],h:oid,t:any_1,force:bit):bat[:oid,:any_1] ",       
"BKCbun_inplace_force;"  ]
+[ 61@0,        "reuseMap",     "command",      "bat",  
"(b:bat[:oid,:any_1],h:oid,t:any_1):bat[:oid,:any_1] ", "BKCbun_inplace;"  ]
+[ 62@0,        "save", "pattern",      "bat",  "(val:any_1):bat[:oid,:any_1] 
",        "CMDBATsingle;"  ]
+[ 63@0,        "save", "command",      "bat",  "(b:bat[:oid,:any_1]):bit ",    
"BKCsetImprints;"  ]
+[ 64@0,        "setAccess",    "command",      "bat",  
"(b:bat[:oid,:any_1]):bit ",    "BKCsetHash;"  ]
+[ 65@0,        "setColumn",    "command",      "bat",  "(nme:str):bit ",       
"BKCsave;"  ]
+[ 66@0,        "setColumn",    "command",      "bat",  
"(nme:bat[:oid,:any_1]):void ", "BKCsave2;"  ]
+[ 67@0,        "setHash",      "command",      "bat",  
"(b:bat[:oid,:any_1]):void ",   "BKCsetPersistent;"  ]
+[ 68@0,        "setImprints",  "command",      "bat",  
"(b:bat[:oid,:any_1]):void ",   "BKCsetTransient;"  ]
+[ 69@0,        "setKey",       "command",      "bat",  
"(b:bat[:oid,:any_1],h:str,t:str):void ",       "BKCsetColumns;"  ]
+[ 70@0,        "setName",      "command",      "bat",  
"(b:bat[:oid,:any_1],t:str):void ",     "BKCsetColumn;"  ]
+[ 71@0,        "setPersistent",        "command",      "bat",  
"(b:bat[:oid,:any_1],h:str,t:str):void ",       "BKCsetRole;"  ]
+[ 72@0,        "setRole",      "command",      "bat",  
"(b:bat[:oid,:any_1],s:str):void ",     "BKCsetName;"  ]
+[ 73@0,        "setTransient", "command",      "bat",  
"(b:bat[:oid,:any_1],mode:str):bat[:oid,:any_1] ",      "BKCsetAccess;"  ]
+[ 74@0,        "single",       "command",      "bat",  
"(b:bat[:oid,:any_1],mode:bit):bat[:oid,:any_1] ",      "BKCsetkey;"  ]
 
 # 08:55:30 >  
 # 08:55:30 >  Done.
diff --git a/monetdb5/modules/mal/orderidx.c b/monetdb5/modules/mal/orderidx.c
--- a/monetdb5/modules/mal/orderidx.c
+++ b/monetdb5/modules/mal/orderidx.c
@@ -187,7 +187,6 @@ OIDXhasorderidx(Client cntxt, MalBlkPtr 
        return MAL_SUCCEED;
 }
 
-#if 0
 str
 OIDXgetorderidx(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
@@ -212,7 +211,7 @@ OIDXgetorderidx(Client cntxt, MalBlkPtr 
                BBPunfix(b->batCacheid);
                throw(MAL, "bat.getorderidx", MAL_MALLOC_FAIL);
        }
-       memcpy(Tloc(bn, BUNfirst(bn)), b->torderidx->base, BATcount(b) * 
sizeof(oid));
+       memcpy(Tloc(bn, BUNfirst(bn)), (const oid *) b->torderidx->base + 
ORDERIDXOFF, BATcount(b) * sizeof(oid));
        BATsetcount(bn, BATcount(b));
        BATseqbase(bn, 0);
        bn->tkey = 1;
@@ -224,7 +223,6 @@ OIDXgetorderidx(Client cntxt, MalBlkPtr 
        BBPunfix(b->batCacheid);
        return MAL_SUCCEED;
 }
-#endif
 
 /*
  * Merge the collection of sorted OID BATs into one
diff --git a/monetdb5/modules/mal/orderidx.h b/monetdb5/modules/mal/orderidx.h
--- a/monetdb5/modules/mal/orderidx.h
+++ b/monetdb5/modules/mal/orderidx.h
@@ -31,5 +31,5 @@ orderidx_export str OIDXcreateImplementa
 orderidx_export str OIDXdropImplementation(Client cntxt, BAT *b);
 orderidx_export str OIDXmerge(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 orderidx_export str OIDXhasorderidx(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-/* orderidx_export str OIDXgetorderidx(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr pci); */
+orderidx_export str OIDXgetorderidx(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 #endif /* _OIDX_H */
diff --git a/monetdb5/modules/mal/orderidx.mal 
b/monetdb5/modules/mal/orderidx.mal
--- a/monetdb5/modules/mal/orderidx.mal
+++ b/monetdb5/modules/mal/orderidx.mal
@@ -14,6 +14,10 @@ pattern bat.hasorderidx(bv:bat[:oid,:any
 address OIDXhasorderidx
 comment "Return true if order index exists";
 
+pattern bat.getorderidx(bv:bat[:oid,:any_1]):bat[:oid,:oid]
+address OIDXgetorderidx
+comment "Return the order index if it exists";
+
 function algebra.orderidx(bv:bat[:oid,:any_1], reverse:bit, stable:bit 
):bat[:oid,:oid];
        (v,o):= algebra.subsort(bv,reverse,stable);
        return sortorder:= o;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to