Changeset: 80772740e9e6 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=80772740e9e6 Modified Files: clients/mapiclient/dump.c sql/backends/monet5/Makefile.ag sql/include/sql_catalog.h sql/scripts/Makefile.ag sql/server/rel_exp.c sql/server/rel_optimizer.c sql/server/rel_psm.c sql/server/rel_schema.c sql/server/rel_select.c sql/server/rel_updates.c sql/storage/bat/bat_storage.c sql/storage/sql_catalog.c sql/storage/store.c Branch: SciQL-2 Log Message:
a banch of compilation errors fixed. many more left to be fixed diffs (truncated from 1337 to 300 lines): diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -1,9 +1,20 @@ /* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.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 * - * Copyright 2008-2015 MonetDB B.V. + * 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-2015 MonetDB B.V. + * All Rights Reserved. */ #include "monetdb_config.h" @@ -535,38 +546,49 @@ dump_column_definition(Mapi mid, stream mnstr_printf(toConsole, "(\n"); if (tid) - snprintf(query, maxquerylen, - "SELECT c.name, " /* 0 */ - "c.type, " /* 1 */ - "c.type_digits, " /* 2 */ - "c.type_scale, " /* 3 */ - "c.\"null\", " /* 4 */ - "c.\"default\", " /* 5 */ - "\"c\".\"number\"," /* 6 */ - "CASE WHEN \"d\".\"column_id\" IS NULL THEN FALSE ELSE TRUE END" - " AS \"isdimension\"," /* 7 */ - "\"d\".\"start\"," /* 8 */ - "\"d\".\"step\"," /* 9 */ - "\"d\".\"stop\" " /* 10 */ - "LEFT JOIN \"sys\".\"_dimensions\" \"d\" " - "ON \"c\".\"id\" = \"d\".\"column_id\" " + snprintf(query, maxquerylen, + "SELECT c.name," /* 0 */ + "c.type," /* 1 */ + "c.type_digits," /* 2 */ + "c.type_scale," /* 3 */ + "c.null," /* 4 */ + "c.default," /* 5 */ + "c.number," /* 6 */ + "CASE WHEN d.column_id IS NULL THEN FALSE ELSE TRUE END" + " AS \"isdimension\"," /* 7 */ + "d.start," /* 8 */ + "d.step," /* 9 */ + "d.stop " /* 10 */ + "FROM sys._columns c " + "LEFT JOIN sys._dimensions d " + "ON c.id = d.column_id " + "WHERE c.table_id = %s " + "ORDER BY number", tid); else snprintf(query, maxquerylen, - "SELECT c.name, " /* 0 */ - "c.type, " /* 1 */ - "c.type_digits, " /* 2 */ - "c.type_scale, " /* 3 */ - "c.\"null\", " /* 4 */ - "c.\"default\", " /* 5 */ - "\"c\".\"number\"," /* 6 */ - "CASE WHEN \"d\".\"column_id\" IS NULL THEN FALSE ELSE TRUE END" - " AS \"isdimension\"," /* 7 */ - "\"d\".\"start\"," /* 8 */ - "\"d\".\"step\"," /* 9 */ - "\"d\".\"stop\" " /* 10 */ - "FROM \"sys\".\"_columns\" \"c\" " - "LEFT JOIN \"sys\".\"_dimensions\" \"d\" " - "ON \"c\".\"id\" = \"d\".\"column_id\", " + "SELECT c.name," /* 0 */ + "c.type," /* 1 */ + "c.type_digits," /* 2 */ + "c.type_scale," /* 3 */ + "c.null," /* 4 */ + "c.default," /* 5 */ + "c.number," /* 6 */ + "CASE WHEN d.column_id IS NULL THEN FALSE ELSE TRUE END" + " AS \"isdimension\"," /* 7 */ + "d.start," /* 8 */ + "d.step," /* 9 */ + "d.stop " /* 10 */ + "FROM sys._columns c " + "LEFT JOIN sys._dimensions d " + "ON c.id = d.column_id, " + "sys._tables t, " + "sys.schemas s " + "WHERE c.table_id = t.id " + "AND '%s' = t.name " + "AND t.schema_id = s.id " + "AND s.name = '%s' " + "ORDER BY number", tname, schema); + if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid)) goto bailout; @@ -796,11 +818,12 @@ describe_table(Mapi mid, char *schema, c query = malloc(maxquerylen); snprintf(query, maxquerylen, - "SELECT \"t\".\"name\", \"t\".\"query\", " - "CASE WHEN \"a\".\"table_id\" IS NULL THEN FALSE ELSE TRUE END AS \"isarray\" " - "FROM \"sys\".\"_tables\" \"t\" LEFT OUTER JOIN \"sys\".\"_arrays\" \"a\" ON \"t\".\"id\" = \"a\".\"table_id\", \"sys\".\"schemas\" \"s\" " - "t.schema_id = s.id AND " - "t.name = '%s'", + "SELECT t.name, t.query, " + "CASE WHEN a.table_id IS NULL THEN FALSE ELSE TRUE END AS \"isarray\" " + "FROM sys._tables t LEFT OUTER JOIN sys._arrays a ON t.id = a.table_id, sys.schemas s " + "WHERE s.name = '%s' AND " + "t.schema_id = s.id AND " + "t.name = '%s'", schema, tname); if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid)) @@ -1386,6 +1409,9 @@ dump_database(Mapi mid, stream *toConsol "p.auth_id = a.id AND " "t.schema_id = s.id AND " "t.system = FALSE AND " + "p.grantor = g.id " + "ORDER BY s.name, t.name, c.name, a.name, g.name, p.grantable"; + /* FIXME: taking into account of the 'rs' system schema, introduced by * the geotiff module only in the sciql branch, is just a quick fix to * avoid the functions and tables created in the 'rs' schema being dumped @@ -1400,7 +1426,7 @@ dump_database(Mapi mid, stream *toConsol "FROM sys.schemas s, " "sys.auths a " "WHERE s.\"authorization\" = a.id AND " - "\"s\".\"name\" NOT IN ('sys', 'tmp', 'rs') " + "s.name NOT IN ('sys', 'tmp', 'rs') " "ORDER BY s.name"; /* alternative, but then need to handle NULL in second column: SELECT "s"."name", "a"."name" 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 @@ -1,8 +1,19 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.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 # -# Copyright 2008-2015 MonetDB B.V. +# 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-2015 MonetDB B.V. +# All Rights Reserved. SUBDIRS = NOT_WIN32?vaults UDF HAVE_SAMTOOLS?bam LSST HAVE_JSONSTORE?rest HAVE_GSL?gsl generator @@ -39,7 +50,7 @@ lib__sql = { sql_optimizer.c sql_optimizer.h \ sql_result.c sql_result.h \ sql_readline.c sql_readline.h \ - sciql.c sciql.h + sciql.c sciql.h \ sql_cast.c sql_cast.h \ sql_cast_impl_down_from_flt.h \ sql_cast_impl_down_from_int.h \ @@ -110,8 +121,7 @@ headers_mal_hge = { headers_autoload = { HEADERS = mal DIR = libdir/monetdb5/autoload - SOURCES = 40_sql.mal \ - 41_sciql.mal + SOURCES = 40_sql.mal 41_sciql.mal } headers_autoload_hge = { @@ -125,6 +135,6 @@ EXTRA_DIST = 40_sql.mal 41_sciql.mal \ 41_sql_hge.mal sql_hge.mal sql_aggr_hge.mal sql_decimal_hge.mal \ sql_aggr_bte.mal sql_aggr_flt.mal sql_aggr_int.mal sql_aggr_lng.mal \ sql_aggr_sht.mal sql_aggr_wrd.mal sql_decimal.mal sql_inspect.mal \ - sql_rank.mal sql.mal + sql_rank.mal sql.mal EXTRA_DIST_DIR = Tests diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h --- a/sql/include/sql_catalog.h +++ b/sql/include/sql_catalog.h @@ -466,7 +466,6 @@ typedef enum table_types { #define isRemote(x) (x->type==tt_remote) #define isReplicaTable(x) (x->type==tt_replica_table) #define isArray(x) (x->type==tt_array) -#define isTableOrArray(x)(x->type==tt_array || x->type==tt_table) #define isFixedArray(a) (a->type == tt_array && a->fixed) #define isFixedDim(d) (d->strt != lng_nil && d->step != lng_nil && d->stop != lng_nil) #define isKindOfTable(x) (isTable(x) || isArray(x) || isMergeTable(x) || isRemote(x) || isReplicaTable(x)) diff --git a/sql/scripts/Makefile.ag b/sql/scripts/Makefile.ag --- a/sql/scripts/Makefile.ag +++ b/sql/scripts/Makefile.ag @@ -1,8 +1,19 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.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 # -# Copyright 2008-2015 MonetDB B.V. +# 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-2015 MonetDB B.V. +# All Rights Reserved. MT_SAFE @@ -18,6 +29,7 @@ headers_sql = { 15_querylog.sql \ 16_tracelog.sql \ 17_temporal.sql \ + 19_cluster.sql \ 20_vacuum.sql \ 21_dependency_functions.sql \ 22_clients.sql \ @@ -25,7 +37,7 @@ headers_sql = { 24_zorder.sql \ 25_debug.sql \ 26_sysmon.sql \ - 29_array.sql.\ + 29_array.sql \ 39_analytics.sql \ 40_json.sql \ 41_jsonstore.sql \ diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -1515,7 +1515,7 @@ exps_alias( sql_allocator *sa, list *exp sql_exp *e = n->data, *ne; assert(exp_name(e)); - ne = exp_column(sa, exp_relname(e), exp_name(e), exp_subtype(e), exp_card(e), has_nil(e), 0); + ne = exp_column(sa, exp_relname(e), exp_name(e), exp_subtype(e), exp_card(e), has_nil(e), 0, NULL); append(nl, ne); } return nl; diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -625,7 +625,7 @@ rel_find_column( sql_allocator *sa, sql_ if (rel->exps && (is_project(rel->op) || is_base(rel->op))) { sql_exp *e = exps_bind_column2(rel->exps, tname, cname); if (e) - return exp_alias(sa, e->rname, exp_name(e), tname, cname, exp_subtype(e), e->card, has_nil(e), is_intern(e)); + return exp_alias(sa, e->rname, exp_name(e), tname, cname, exp_subtype(e), e->card, has_nil(e), is_intern(e), NULL); } if (is_project(rel->op) && rel->l) { return rel_find_column(sa, rel->l, tname, cname); @@ -2056,7 +2056,7 @@ rel_distinct_project2groupby(int *change if (e->card > CARD_ATOM) { /* no need to group by on constants */ if (!exp_name(e)) exp_label(sql->sa, e, ++sql->label); - e = exp_column(sql->sa, exp_relname(e), exp_name(e), exp_subtype(e), exp_card(e), has_nil(e), 0); + e = exp_column(sql->sa, exp_relname(e), exp_name(e), exp_subtype(e), exp_card(e), has_nil(e), 0, NULL); append(gbe, e); } append(exps, e); @@ -3147,7 +3147,7 @@ rel_push_groupby_down(int *changes, mvc if (exp_refers(a, ge)) { sql_exp *sc = jr->exps->t->data; - sql_exp *e = exp_column(sql->sa, exp_relname(sc), exp_name(sc), exp_subtype(sc), sc->card, has_nil(sc), is_intern(sc)); + sql_exp *e = exp_column(sql->sa, exp_relname(sc), exp_name(sc), exp_subtype(sc), sc->card, has_nil(sc), is_intern(sc), NULL); exp_setname(sql->sa, e, exp_relname(a), exp_name(a)); a = e; } @@ -3159,7 +3159,7 @@ rel_push_groupby_down(int *changes, mvc sql_exp *a = m->data; if (exp_match_exp(a, ge) || exp_refers(a, ge)) { _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list