Changeset: 78b95a89fbdc for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=78b95a89fbdc Modified Files: pathfinder/compiler/Makefile.ag pathfinder/compiler/algebra-m5sql/Makefile.ag pathfinder/compiler/algebra-m5sql/lalg2msa.c pathfinder/compiler/algebra-m5sql/msa.c pathfinder/compiler/algebra-m5sql/msaprint.c pathfinder/compiler/algebra/opt/opt_complex.c pathfinder/compiler/algebra/opt/opt_rank.c pathfinder/compiler/algebra/opt/opt_thetajoin.c pathfinder/compiler/compile.c pathfinder/compiler/include/compile.h pathfinder/compiler/main.c pathfinder/runtime/Makefile.ag pathfinder/src/sqlhelpers/xmlshred/encoding.c pathfinder/src/sqlhelpers/xmlshred/guides.c pathfinder/src/sqlhelpers/xmlshred/include/encoding.h pathfinder/src/sqlhelpers/xmlshred/include/guides.h pathfinder/src/sqlhelpers/xmlshred/include/shred_helper.h pathfinder/src/sqlhelpers/xmlshred/main.c Branch: Mar2011 Log Message:
Merge git master into Mar2011 diffs (truncated from 4166 to 300 lines): diff --git a/pathfinder/compiler/Makefile.ag b/pathfinder/compiler/Makefile.ag --- a/pathfinder/compiler/Makefile.ag +++ b/pathfinder/compiler/Makefile.ag @@ -21,7 +21,7 @@ # 2008-2011 Eberhard Karls Universitaet Tuebingen, respectively. All # Rights Reserved. -SUBDIRS = utils schema debug mem parser semantics core algebra mil include sql algebra-m5sql xmlimport +SUBDIRS = utils schema debug mem parser semantics core algebra mil include sql xmlimport EXTRA_DIST_DIR = Tests @@ -78,7 +78,6 @@ mil/libmil \ libcompiler2 \ mem/libmem \ - algebra-m5sql/libmsa \ sql/libsql \ # xmlimport/libxmlimport \ diff --git a/pathfinder/compiler/algebra-m5sql/Makefile.ag b/pathfinder/compiler/algebra-m5sql/Makefile.ag deleted file mode 100644 --- a/pathfinder/compiler/algebra-m5sql/Makefile.ag +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright Notice: -# ----------------- -# -# The contents of this file are subject to the Pathfinder 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://monetdb.cwi.nl/Legal/PathfinderLicense-1.1.html -# -# 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 Pathfinder system. -# -# The Original Code has initially been developed by the Database & -# Information Systems Group at the University of Konstanz, Germany and -# the Database Group at the Technische Universitaet Muenchen, Germany. -# It is now maintained by the Database Systems Group at the Eberhard -# Karls Universitaet Tuebingen, Germany. Portions created by the -# University of Konstanz, the Technische Universitaet Muenchen, and the -# Universitaet Tuebingen are Copyright (C) 2000-2005 University of -# Konstanz, (C) 2005-2008 Technische Universitaet Muenchen, and (C) -# 2008-2011 Eberhard Karls Universitaet Tuebingen, respectively. All -# Rights Reserved. -# -# Fri Oct 27 10:05:33 CEST 2006, Manuel Mayr - -INCLUDES = ../include ../../../common/options ../../../gdk - -# locally disable "-Werror" -#X_CFLAGS = "-pedantic" - -# ignore warning "null dimension: sizeof()" -# with Sun Studio 12 compiler -lalg2msa_CFLAGS = $(SUN_NOERR_CFLAGS) - -lib_msa = { - NOINST - DIR = libdir - SOURCES = \ - lalg2msa.c \ - msa.c \ - msaprint.c -} - -#EXTRA_DIST = diff --git a/pathfinder/compiler/algebra-m5sql/lalg2msa.c b/pathfinder/compiler/algebra-m5sql/lalg2msa.c deleted file mode 100644 --- a/pathfinder/compiler/algebra-m5sql/lalg2msa.c +++ /dev/null @@ -1,1043 +0,0 @@ -/** - * @file - * - * Transforms the logical algebra tree into a tree that represents - * SQL statements. - * - * Copyright Notice: - * ----------------- - * - * The contents of this file are subject to the Pathfinder 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://monetdb.cwi.nl/Legal/PathfinderLicense-1.1.html - * - * 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 Pathfinder system. - * - * The Original Code has initially been developed by the Database & - * Information Systems Group at the University of Konstanz, Germany and - * the Database Group at the Technische Universitaet Muenchen, Germany. - * It is now maintained by the Database Systems Group at the Eberhard - * Karls Universitaet Tuebingen, Germany. Portions created by the - * University of Konstanz, the Technische Universitaet Muenchen, and the - * Universitaet Tuebingen are Copyright (C) 2000-2005 University of - * Konstanz, (C) 2005-2008 Technische Universitaet Muenchen, and (C) - * 2008-2011 Eberhard Karls Universitaet Tuebingen, respectively. All - * Rights Reserved. - * - * $Id$ - */ - -/* always include monetdb_config.h first! */ -#include "monetdb_config.h" -#include "pathfinder.h" - -/** assert() */ -#include <assert.h> -/** fprintf() */ -#include <stdio.h> -/** strcpy, strlen, ... */ -#include <string.h> - -#include "oops.h" /* PFoops() */ -#include "mem.h" -#include "array.h" -#include "string_utils.h" - -#include "lalg2msa.h" - -/* Easily access subtree-parts */ -#include "child_mnemonic.h" - -#include "msa.h" -#include "algebra.h" -#include "alg_dag.h" -#include "ordering.h" - -#include "msa_mnemonic.h" - -/* Auxiliary function that searches for a certain col - in a expression list and returns an expression - representing the found column. If no column was - found, NULL will be returned */ -static PFmsa_expr_t * -find_expr(PFmsa_exprlist_t *expr_list, PFalg_col_t col) -{ - unsigned int i; - - for (i = 0; i < elsize(expr_list); i++) { - PFmsa_expr_t *curr_expr = elat(expr_list, i); - if ((curr_expr->col) == col) - return curr_expr; - } - return NULL; -} - -/* Auxiliary function that constructs an expression list containing - column references of the columns in a schema */ -static PFmsa_exprlist_t * -exprlist_from_schema(PFalg_schema_t schema) -{ - unsigned int i; - PFmsa_exprlist_t *ret = el(schema.count); - - for (i = 0; i < schema.count; i++) { - PFmsa_expr_t *new_expr = PFmsa_expr_column(schema.items[i].name, schema.items[i].type); - eladd(ret) = new_expr; - } - - return ret; -} - -static PFmsa_expr_t * -deep_copy_expr(PFmsa_expr_t *n) -{ - PFmsa_expr_t *ret = PFmalloc (sizeof(PFmsa_expr_t)); - memcpy(ret, n, sizeof(PFmsa_expr_t)); - unsigned int i; - - for (i = 0; i < PFMSA_OP_MAXCHILD && n->child[i]; i++) { - ret->child[i] = deep_copy_expr(n->child[i]); - } - - return ret; -} - -/* Bind a msa operator to a la operator during translation. That is: - Put a selection and projection operator on top of the current - operator to 'materialize' changes in schema and predicates */ -static void -bindop(PFla_op_t *n) -{ - PFmsa_op_t *sel = PFmsa_op_select (OP(n), SEL_LIST(n)); - PFmsa_op_t *prj = PFmsa_op_project (sel, false, PRJ_LIST(n)); - - OP(n) = prj; - PRJ_LIST(n) = exprlist_from_schema (n->schema); - SEL_LIST(n) = el(1); - - return; -} - -/* ----- Translate the logical algebra into M5 SQL algebra ----- */ - -/* Worker that performes translation from la to msa. Note that - not every operator is translated 1-to-1 but so called selection - and projection lists are carried along, which represent changes - in schema (e.g. attaching of a row) or selection predicates. - - The function is bottom-up: We descend to leaf nodes, compute - operators and lists and write them to an annotation field (msa_ann) - in the original la operator */ -static void -alg2msa_worker(PFla_op_t *n) -{ - unsigned int i; - /* declarations need for the translation: msa annotation and its contents */ - PFmsa_ann_t *msa_ann; - PFmsa_op_t *op = NULL; - PFmsa_exprlist_t *prj_list = NULL; - PFmsa_exprlist_t *sel_list = NULL; - - /* traverse child operators recursively */ - for (i = 0; i < PFLA_OP_MAXCHILD && n->child[i]; i++) { - if (!n->child[i]->bit_dag) - alg2msa_worker(n->child[i]); - } - - switch (n->kind) { - - case la_serialize_seq: - { - PFalg_collist_t *collist; - - /* bind node containing la DAG */ - bindop(R(n)); - - /* la_side_effects node will not be bound */ - - /* build list containing the item column */ - collist = PFalg_collist(1); - PFalg_collist_add(collist) = n->sem.ser_seq.item; - - op = PFmsa_op_serialize_rel(OP (R(n)), - OP (L(n)), - col_NULL, - n->sem.ser_seq.pos, - collist); - - /* not necessary to set project nor select list */ - } - break; - - case la_serialize_rel: - - /* FIXME: NOT TESTED YET! */ - - /* bind node with la DAG */ - bindop(R(n)); - - /* la_side_effects node will not be bound */ - - op = PFmsa_op_serialize_rel(OP (R(n)), - OP (L(n)), - n->sem.ser_rel.iter, - n->sem.ser_rel.pos, - n->sem.ser_rel.items); - - /* not necessary to set project nor select list */ - - break; - - case la_side_effects: - - /* build operator and lists */ - op = PFmsa_op_nil_node(); - prj_list = NULL; - sel_list = NULL; - - break; - - case la_lit_tbl: - /* Build literal table operator with the information - of the original la operator. */ - - /* build operator and lists */ - op = PFmsa_op_literal_table(n->schema, n->sem.lit_tbl.count, - n->sem.lit_tbl.tuples); - prj_list = exprlist_from_schema(n->schema); - sel_list = el(1); - - break; - - case la_empty_tbl: - /* Build empty table operator with the schema - of the original la operator. */ - - /* build operator and lists */ _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list