Changeset: 3670d93bb373 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3670d93bb373
Added Files:
        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.mal
        sql/backends/monet5/Makefile.ag
Branch: default
Log Message:

De-Mx some more files.


diffs (truncated from 765 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
@@ -69,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 \
@@ -80,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.mal 
b/monetdb5/modules/mal/batExtensions.mal
--- a/monetdb5/modules/mal/batExtensions.mal
+++ b/monetdb5/modules/mal/batExtensions.mal
@@ -70,6 +70,7 @@ pattern bat.pack(v:any_1):bat[:oid,:any_
 address CMDbatsingleton
 comment "Create a BAT and store the value";
 
+module algebra;
 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.";
diff --git a/sql/backends/monet5/Makefile.ag b/sql/backends/monet5/Makefile.ag
--- a/sql/backends/monet5/Makefile.ag
+++ b/sql/backends/monet5/Makefile.ag
@@ -41,7 +41,7 @@ lib__sql = {
                sql_scenario.c sql_scenario.h \
                sql_gencode.c sql_gencode.h \
                sql_optimizer.c sql_optimizer.h \
-               sql_result.mx \
+               sql_result.c sql_result.h \
                sql_readline.c sql_readline.h \
                sql_emptyset.c sql_emptyset.h
        LIBS = ../../server/libsqlserver \
diff --git a/sql/backends/monet5/sql_result.mx 
b/sql/backends/monet5/sql_result.c
rename from sql/backends/monet5/sql_result.mx
rename to sql/backends/monet5/sql_result.c
--- a/sql/backends/monet5/sql_result.mx
+++ b/sql/backends/monet5/sql_result.c
@@ -1,58 +1,25 @@
-@/
-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
+/*
+ * 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.
+*/
 
-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 sql_result
-
-@c
 /*
- * @a N.J. Nes
- * @*
+ * author N.J. Nes
  */
-@h
-#ifndef sql_result_H
-#define sql_result_H
-
-#include "mal_client.h"
-#include <stream.h>
-#include <sql_mvc.h>
-#include <sql_catalog.h>
-#include <sql_qc.h>
-#include <sql_parser.h>                /* sql_error */
-
-extern int mvc_export_affrows(mvc *m, stream *s, lng val, str w);
-extern int mvc_export_operation(mvc *m, stream *s, str w);
-extern int mvc_export_value( mvc *m, stream *s, int qtype, str tn, str cn, str 
type, int d, int sc, int eclass, ptr p, int mtype, str w, str ns);
-extern int mvc_export_result(mvc *c, stream *s, int res_id);
-extern int mvc_export_head(mvc *c, stream *s, int res_id, int only_header);
-extern int mvc_export_prepare(mvc *c, stream *s, cq *q, str w);
-extern int mvc_export_chunk(mvc *m, stream *s, int res_id, BUN offset, BUN nr);
-
-extern BAT **mvc_import_table(Client cntxt, mvc *c, bstream *s, char *sname, 
char *tname, char *sep, char *rsep, char *ssep, char *ns, lng nr, lng offset, 
int locked);
-extern int mvc_result_table(mvc *m, int nr_cols, int type, BAT *order);
-
-extern int mvc_result_column(mvc *m, char *tn, char *name, char *typename, int 
digits, int scale, BAT *b);
-extern int mvc_result_value(mvc *m, char *tn, char *name, char *typename, int 
digits, int scale, ptr *p, int mtype);
-
-extern int convert2str( mvc *m, int eclass, int d, int sc, int has_tz, ptr p, 
int mtype, char **buf, int len);
-
-#endif /* sql_result_H */
-@c
 
 #include "monetdb_config.h"
 #include "sql_result.h"
@@ -63,67 +30,62 @@ extern int convert2str( mvc *m, int ecla
 #include <bat/bat_storage.h>
 #include <rel_exp.h>
 
-@= dec_tostr
-       char buf[32];
-       @1 v = *(@1*)a;
-       int scale = (int)(ptrdiff_t)extra, cur = 31, neg = (v<0)?1:0, i, done = 
0;
-       int l;
-
-       if (v == @1_nil) {
-               if (*len < 5){
-                       if (*Buf)
-                               GDKfree(*Buf);
-                       *len = 5;
-                       *Buf = GDKmalloc(*len);
-               }
-               strcpy(*Buf, "NULL");
-               return 4;
-       }
-               
-       if (v<0)
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to