Changeset: bb1ea50f977e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bb1ea50f977e
Added Files:
        monetdb5/modules/mal/batExtensions.h
        sql/backends/monet5/sql_result.c
        sql/backends/monet5/sql_result.h
Removed Files:
        monetdb5/modules/mal/algebraExtensions.c
        monetdb5/modules/mal/algebraExtensions.h
        monetdb5/modules/mal/algebraExtensions.mal
        sql/backends/monet5/sql_result.mx
Modified Files:
        monetdb5/modules/mal/Makefile.ag
        monetdb5/modules/mal/batExtensions.c
        monetdb5/modules/mal/batExtensions.mal
        sql/backends/monet5/Makefile.ag
Branch: default
Log Message:

merge


diffs (truncated from 964 to 300 lines):

diff --git a/monetdb5/modules/mal/Makefile.ag b/monetdb5/modules/mal/Makefile.ag
--- a/monetdb5/modules/mal/Makefile.ag
+++ b/monetdb5/modules/mal/Makefile.ag
@@ -28,7 +28,6 @@ MTSAFE
 lib_mal = {
        NOINST
        SOURCES = \
-               algebraExtensions.c algebraExtensions.h \
                attach.c attach.h \
                batExtensions.c \
                bbp.c bbp.h \
@@ -70,7 +69,7 @@ headers_mal = {
        HEADERS = mal
        DIR = libdir/monetdb5
        SOURCES = language.mal constraints.mal mal_init.mal box.mal bbp.mal \
-               profiler.mal const.mal attach.mal batExtensions.mal 
algebraExtensions.mal \
+               profiler.mal const.mal attach.mal batExtensions.mal \
                inspect.mal manual.mal mal_io.mal pqueue.mal mkey.mal \
                iterator.mal clients.mal \
                factories.mal groupby.mal mdb.mal pcre.mal tablet.mal mat.mal \
@@ -81,6 +80,6 @@ headers_mal = {
                tokenizer.mal zorder.mal sample.mal
 }
 
-EXTRA_DIST = algebraExtensions.mal attach.mal batExtensions.mal iterator.mal 
constraints.mal groupby.mal histogram.mal mal_init.mal manual.mal mkey.mal 
pcre.mal profiler.mal recycle.mal remote.mal sabaoth.mal trader.mal 
transaction.mal txtsim.mal tablet.mal tablet.h sample.mal mal_mapi.mal mat.mal 
tokenizer.mal pqueue.mal
+EXTRA_DIST = attach.mal batExtensions.mal iterator.mal constraints.mal 
groupby.mal histogram.mal mal_init.mal manual.mal mkey.mal pcre.mal 
profiler.mal recycle.mal remote.mal sabaoth.mal trader.mal transaction.mal 
txtsim.mal tablet.mal tablet.h sample.mal mal_mapi.mal mat.mal tokenizer.mal 
pqueue.mal
 
 EXTRA_DIST_DIR = Tests
diff --git a/monetdb5/modules/mal/algebraExtensions.c 
b/monetdb5/modules/mal/algebraExtensions.c
deleted file mode 100644
--- a/monetdb5/modules/mal/algebraExtensions.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * The contents of this file are subject to the MonetDB Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.monetdb.org/Legal/MonetDBLicense
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is the MonetDB Database System.
- *
- * The Initial Developer of the Original Code is CWI.
- * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
- * Copyright August 2008-2012 MonetDB B.V.
- * All Rights Reserved.
- */
-
-/*
- * @f algebraExtensions
- * @v 2.0
- * @a M.L.Kersten, P. Boncz
- * @+ Algebra Extensions
- * The algebra extensions rely
- * on the MAL runtime setting, but logically belong to the kernel/algebra
- * module.
- */
-#include "monetdb_config.h"
-#include "algebraExtensions.h"
-
-str
-ALGprojectCstBody(bat *result, int *bid, ptr *p, int tt){
-       BAT *b, *bn;
-
-       if ((b = BATdescriptor(*bid)) == NULL) {
-               throw(MAL, "bbp.project", INTERNAL_BAT_ACCESS);
-       }
-
-       if (ATOMvarsized(tt)) {
-               if (p == 0 || *(str *) p == 0)
-                       p = (ptr *) str_nil;
-               else
-                       p = *(ptr **) p;
-       }
-       bn = BATconst(b, tt, p);
-       BBPunfix(b->batCacheid);
-       if (bn) {
-               *result = bn->batCacheid;
-               BBPkeepref(bn->batCacheid);
-               return MAL_SUCCEED;
-       }
-       throw(MAL, "bbp.project", INTERNAL_OBJ_CREATE);
-}
-
-str
-ALGprojectCst(Client cntxt,MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
-{
-       int *result = (int *) getArgReference(stk, pci, 0);
-       int *bid = (int *) getArgReference(stk, pci, 1);
-       ptr *p = (ptr *) getArgReference(stk, pci, 2);
-       int tt = getArgType(mb, pci, 2);
-
-       (void) cntxt;
-       return ALGprojectCstBody(result, bid, p, tt);
-}
diff --git a/monetdb5/modules/mal/algebraExtensions.h 
b/monetdb5/modules/mal/algebraExtensions.h
deleted file mode 100644
--- a/monetdb5/modules/mal/algebraExtensions.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * The contents of this file are subject to the MonetDB Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.monetdb.org/Legal/MonetDBLicense
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is the MonetDB Database System.
- *
- * The Initial Developer of the Original Code is CWI.
- * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
- * Copyright August 2008-2012 MonetDB B.V.
- * All Rights Reserved.
- */
-
-/*
- * @+ Implementation section
- * In most cases we pass a BAT identifier, which should be unified
- * with a BAT descriptor. Upon failure we can simply abort the function.
- *
- */
-#ifndef _ALGEBRA_EXTENSIONS_H
-#define _ALGEBRA_EXTENSIONS_H
-#include "mal_client.h"
-#include "mal_interpreter.h"
-#include "bat5.h"
-#include "algebra.h"
-
-#ifdef WIN32
-#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && 
!defined(LIBMONETDB5)
-#define ae_export extern __declspec(dllimport)
-#else
-#define ae_export extern __declspec(dllexport)
-#endif
-#else
-#define ae_export extern
-#endif
-
-ae_export str ALGprojectCst(Client cntxt,MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-ae_export str ALGprojectCstBody(bat *result, int *bid, ptr *p, int tt);
-#endif /* _ALGEBRA_EXTENSIONS_H*/
-
diff --git a/monetdb5/modules/mal/algebraExtensions.mal 
b/monetdb5/modules/mal/algebraExtensions.mal
deleted file mode 100644
--- a/monetdb5/modules/mal/algebraExtensions.mal
+++ /dev/null
@@ -1,25 +0,0 @@
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the "License"); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-
-pattern algebra.project( b:bat[:any_1,:any_3], val:any_2) :bat[:any_1,:any_2]
-address ALGprojectCst
-comment "Fill the tail column with a newly typed constant.";
-pattern algebra.project(b:bat[:any_1,:any_3], val:bat[:any_1,:any_2]) 
:bat[:any_1,:any_2]
-address ALGprojectCst
-comment "Fill the tail column with a constant taken from the aligned BAT.";
-
diff --git a/monetdb5/modules/mal/batExtensions.c 
b/monetdb5/modules/mal/batExtensions.c
--- a/monetdb5/modules/mal/batExtensions.c
+++ b/monetdb5/modules/mal/batExtensions.c
@@ -18,10 +18,8 @@
  */
 
 /*
- * @f batExtensions
- * @v 2.0
- * @a M.L.Kersten
- * @+ BAT Extensions
+ * M.L.Kersten
+ * BAT Algebra Extensions
  * The kernel libraries are unaware of the MAL runtime semantics.
  * This calls for declaring some operations in the MAL module section
  * and register them in the kernel modules explicitly.
@@ -33,48 +31,7 @@
  * Another example concerns the (un)pack operations, which direct
  * access the runtime stack to (push)pull the values needed.
  */
-/*
- * @+ Implementation section
- * In most cases we pass a BAT identifier, which should be unified
- * with a BAT descriptor. Upon failure we can simply abort the function.
- *
- */
-#include "monetdb_config.h"
-#include "mal_client.h"
-#include "mal_interpreter.h"
-#include "bat5.h"
-#include "algebra.h"
-
-#ifdef WIN32
-#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && 
!defined(LIBMONETDB5)
-#define be_export extern __declspec(dllimport)
-#else
-#define be_export extern __declspec(dllexport)
-#endif
-#else
-#define be_export extern
-#endif
-
-be_export str CMDBATsetGarbage(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-be_export str CMDBATflush(int *res, int *bid);
-be_export str CMDBATreduce(int *ret, int *bid);
-be_export str CMDBATclone(Client cntxt, MalBlkPtr m, MalStkPtr s, InstrPtr p);
-be_export str CMDBATnew(Client cntxt, MalBlkPtr m, MalStkPtr s, InstrPtr p);
-be_export str CMDBATnewDerived(Client cntxt, MalBlkPtr m, MalStkPtr s, 
InstrPtr p);
-be_export str CMDBATderivedByName(int *ret, str *nme);
-be_export str CMDBATnewint(Client cntxt, MalBlkPtr m, MalStkPtr s, InstrPtr p);
-be_export str CMDBBPproject(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-be_export str CMDBBPprojectNil(int *ret, int *bid);
-be_export str CMDbatunpack(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-be_export str CMDbatpartition(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-be_export str CMDbatpartition2(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-be_export str CMDbatpack(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-be_export str CMDbatsingleton(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-be_export str CMDsetBase(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-
-be_export str CMDgetHead(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-be_export str CMDgetTail(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-
+#include "batExtensions.h"
 /*
  * @- Operator implementation
  * A BAT designated as garbage can be removed, provided we
@@ -612,3 +569,39 @@ CMDgetTail(Client cntxt, MalBlkPtr mb, M
        BBPunfix(b->batCacheid);
        return MAL_SUCCEED;
 }
+
+str
+ALGprojectCstBody(bat *result, int *bid, ptr *p, int tt){
+       BAT *b, *bn;
+
+       if ((b = BATdescriptor(*bid)) == NULL) {
+               throw(MAL, "bbp.project", INTERNAL_BAT_ACCESS);
+       }
+
+       if (ATOMvarsized(tt)) {
+               if (p == 0 || *(str *) p == 0)
+                       p = (ptr *) str_nil;
+               else
+                       p = *(ptr **) p;
+       }
+       bn = BATconst(b, tt, p);
+       BBPunfix(b->batCacheid);
+       if (bn) {
+               *result = bn->batCacheid;
+               BBPkeepref(bn->batCacheid);
+               return MAL_SUCCEED;
+       }
+       throw(MAL, "bbp.project", INTERNAL_OBJ_CREATE);
+}
+
+str
+ALGprojectCst(Client cntxt,MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
+{
+       int *result = (int *) getArgReference(stk, pci, 0);
+       int *bid = (int *) getArgReference(stk, pci, 1);
+       ptr *p = (ptr *) getArgReference(stk, pci, 2);
+       int tt = getArgType(mb, pci, 2);
+
+       (void) cntxt;
+       return ALGprojectCstBody(result, bid, p, tt);
+}
diff --git a/monetdb5/modules/mal/batExtensions.h 
b/monetdb5/modules/mal/batExtensions.h
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/batExtensions.h
@@ -0,0 +1,62 @@
+/*
+ * The contents of this file are subject to the MonetDB Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.monetdb.org/Legal/MonetDBLicense
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to