MonetDB: default - better error message on assertDataMatch

2020-12-22 Thread svetlin
Changeset: 75bd05c248ff for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=75bd05c248ff
Modified Files:
testing/sqltest.py
Branch: default
Log Message:

better error message on assertDataMatch


diffs (39 lines):

diff --git a/testing/sqltest.py b/testing/sqltest.py
--- a/testing/sqltest.py
+++ b/testing/sqltest.py
@@ -33,6 +33,17 @@ def sequence_match(left=[], right=[], in
 return False
 return True
 
+def get_index_mismatch(left=[], right=[]):
+ll = len(left)
+rl = len(right)
+index = None
+for i in range(min(ll, rl)):
+if not equals(left[i], right[i]):
+index = i
+break
+return index
+
+
 def piped_representation(data=[]):
 def mapfn(next):
 if type(next) is tuple:
@@ -293,8 +304,15 @@ class TestCaseResult(object):
 if first == v:
 index = i
 break
-if not sequence_match(data, self.data, index):
-msg = '{}\nexpected to match query result starting at index={}, 
but it didn\'t'.format(piped_representation(data), index or 0)
+index = index or 0
+# align sequences
+idx_mis = get_index_mismatch(data, self.data[index:])
+if idx_mis is not None:
+exp_v = data[idx_mis]
+exp_t = type(exp_v)
+res_v = self.data[idx_mis]
+res_t = type(res_v)
+msg = 'expected to match query result at index {} but it didn\'t 
as {} not equals {}'.format(idx_mis, repr(exp_v), repr(res_v))
 self.fail(msg, data=self.data)
 return self
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: unlock - use correct (new) signature for create_user fu...

2020-12-22 Thread Niels Nes
Changeset: 3786f4d80b62 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3786f4d80b62
Modified Files:
sql/backends/monet5/sql.c
sql/storage/bat/bat_storage.c
Branch: unlock
Log Message:

use correct (new) signature for create_user function


diffs (28 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -6049,10 +6049,10 @@ static mel_func sql_init_funcs[] = {
  pattern("sqlcatalog", "revoke", SQLrevoke, false, "Catalog operation revoke", 
args(0,7, 
arg("sname",str),arg("tbl",str),arg("grantee",str),arg("privs",int),arg("cname",str),arg("grant",int),arg("grantor",int))),
  pattern("sqlcatalog", "grant_function", SQLgrant_function, false, "Catalog 
operation grant_function", args(0,6, 
arg("sname",str),arg("fcnid",int),arg("grantee",str),arg("privs",int),arg("grant",int),arg("grantor",int))),
  pattern("sqlcatalog", "revoke_function", SQLrevoke_function, false, "Catalog 
operation revoke_function", args(0,6, 
arg("sname",str),arg("fcnid",int),arg("grantee",str),arg("privs",int),arg("grant",int),arg("grantor",int))),
- pattern("sqlcatalog", "create_user", SQLcreate_user, false, "Catalog 
operation create_user", args(0,5, 
arg("sname",str),arg("passwrd",str),arg("enc",int),arg("schema",str),arg("fullname",str))),
+ pattern("sqlcatalog", "create_user", SQLcreate_user, false, "Catalog 
operation create_user", args(0,6, 
arg("sname",str),arg("passwrd",str),arg("enc",int),arg("schema",str),arg("schemapath",str),arg("fullname",str))),
  pattern("sqlcatalog", "drop_user", SQLdrop_user, false, "Catalog operation 
drop_user", args(0,2, arg("sname",str),arg("action",int))),
  pattern("sqlcatalog", "drop_user", SQLdrop_user, false, "Catalog operation 
drop_user", args(0,3, arg("sname",str),arg("auth",str),arg("action",int))),
- pattern("sqlcatalog", "alter_user", SQLalter_user, false, "Catalog operation 
alter_user", args(0,5, 
arg("sname",str),arg("passwrd",str),arg("enc",int),arg("schema",str),arg("oldpasswrd",str))),
+ pattern("sqlcatalog", "alter_user", SQLalter_user, false, "Catalog operation 
alter_user", args(0,6, 
arg("sname",str),arg("passwrd",str),arg("enc",int),arg("schema",str),arg("schemapath",str),arg("oldpasswrd",str))),
  pattern("sqlcatalog", "rename_user", SQLrename_user, false, "Catalog 
operation rename_user", args(0,3, 
arg("sname",str),arg("newnme",str),arg("action",int))),
  pattern("sqlcatalog", "create_role", SQLcreate_role, false, "Catalog 
operation create_role", args(0,3, 
arg("sname",str),arg("role",str),arg("grator",int))),
  pattern("sqlcatalog", "drop_role", SQLdrop_role, false, "Catalog operation 
drop_role", args(0,3, arg("auth",str),arg("role",str),arg("action",int))),
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -2259,7 +2259,7 @@ rollback_table(sql_trans *tr, sql_table 
 {
(void)tr;
(void)t;
-   fprintf(stderr, "rollback %s.%s\n", t->s->base.name, t->base.name);
+// fprintf(stderr, "rollback %s.%s\n", t->s->base.name, t->base.name);
return 0;
 }
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: unlock - merging fun...

2020-12-22 Thread Niels Nes
Changeset: 3a4e73660dd1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3a4e73660dd1
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/sql_upgrades.c
sql/common/sql_backend.c
sql/common/sql_backend.h
sql/common/sql_types.c
sql/include/sql_catalog.h
sql/server/rel_optimizer.c
sql/server/rel_updates.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
sql/server/sql_parser.y
sql/server/sql_scan.c

sql/test/BugTracker-2012/Tests/incorrect_cast_from_double_to_int.Bug-2579.stable.err

sql/test/BugTracker-2012/Tests/incorrect_cast_from_double_to_int.Bug-2579.stable.out

sql/test/BugTracker-2012/Tests/name_resolution_in_proc.Bug-3074.stable.err

sql/test/BugTracker-2012/Tests/table_returning_func_returns_too_many_columns.Bug-3077.stable.err
sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.stable.err
sql/test/analytics/Tests/analytics14.stable.err
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/pg_regress/Tests/alter_table.stable.err
sql/test/pg_regress/Tests/inet.stable.err
sql/test/subquery/Tests/correlated.stable.err
sql/test/subquery/Tests/correlated.stable.out
tools/monetdbe/monetdbe.c
Branch: unlock
Log Message:

merging fun...


diffs (truncated from 14601 to 300 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
@@ -9562,7 +9562,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","alter_seq","pattern sqlcatalog.alter_seq(X_1:str, 
X_2:str, X_3:ptr, X_4:lng):void ",   "SQLalter_seq;",""  ]
 [ "sqlcatalog","alter_set_table",  "pattern 
sqlcatalog.alter_set_table(X_1:str, X_2:str, X_3:int):void ",  
"SQLalter_set_table;",  ""  ]
 [ "sqlcatalog","alter_table",  "pattern 
sqlcatalog.alter_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ", 
"SQLalter_table;",  ""  ]
-[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str):void ", "SQLalter_user;",   ""  
]
+[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str, X_6:str):void ","SQLalter_user;",   
""  ]
 [ "sqlcatalog","comment_on",   "pattern sqlcatalog.comment_on(X_1:int, 
X_2:str):void ","SQLcomment_on;",   ""  ]
 [ "sqlcatalog","create_function",  "pattern 
sqlcatalog.create_function(X_1:str, X_2:str, X_3:ptr):void ",  
"SQLcreate_function;",  ""  ]
 [ "sqlcatalog","create_role",  "pattern 
sqlcatalog.create_role(X_1:str, X_2:str, X_3:int):void ",  
"SQLcreate_role;",  ""  ]
@@ -9571,7 +9571,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","create_table", "pattern 
sqlcatalog.create_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ",
"SQLcreate_table;", ""  ]
 [ "sqlcatalog","create_trigger",   "pattern 
sqlcatalog.create_trigger(X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int, 
X_7:str, X_8:str, X_9:str, X_10:str):void ",   "SQLcreate_trigger;",   ""  ]
 [ "sqlcatalog","create_type",  "pattern 
sqlcatalog.create_type(X_1:str, X_2:str, X_3:str):void ",  
"SQLcreate_type;",  ""  ]
-[ "sqlcatalog","create_user",  "pattern 
sqlcatalog.create_user(X_1:str, X_2:str, X_3:int, X_4:str, X_5:str):void ",
"SQLcreate_user;",  ""  ]
+[ "sqlcatalog","create_user",  "pattern 
sqlcatalog.create_user(X_1:str, X_2:str, X_3:int, X_4:str, X_5:str, 
X_6:str):void ",   "SQLcreate_user;",  ""  ]
 [ "sqlcatalog","create_view",  "pattern 
sqlcatalog.create_view(X_1:str, X_2:str, X_3:ptr, X_4:int):void ", 
"SQLcreate_view;",  ""  ]
 [ "sqlcatalog","drop_constraint",  "pattern 
sqlcatalog.drop_constraint(X_1:str, X_2:str, X_3:int, X_4:int):void ", 
"SQLdrop_constraint;",  ""  ]
 [ "sqlcatalog","drop_function","pattern 
sqlcatalog.drop_function(X_1:str, X_2:str, X_3:int, X_4:int, X_5:int):void ",  
"SQLdrop_function;",""  ]
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
@@ -12889,7 +12889,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","alter_seq","pattern 

MonetDB: copybinary - Merge branch 'default' into 'copybinary'

2020-12-22 Thread Joeri van Ruth
Changeset: 959ede3e0e32 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=959ede3e0e32
Removed Files:
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.test
Modified Files:
clients/mapiclient/mhelp.c
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
sql/backends/monet5/CMakeLists.txt
sql/backends/monet5/sql.c
sql/server/rel_updates.c
sql/server/sql_parser.y
sql/server/sql_scan.c
sql/storage/store.c
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.test
sql/test/Tests/All
sql/test/Tests/sessioncontrol.sql
sql/test/Tests/sessioncontrol.test
sql/test/mapi/Tests/sql_int128.stable.out.int128
sql/test/mapi/Tests/sql_int128.test
sql/test/mergetables/Tests/mergequery.stable.out
sql/test/miscellaneous/Tests/groupby_prepare.SQL.py
sql/test/miscellaneous/Tests/simple_plans.stable.out
Branch: copybinary
Log Message:

Merge branch 'default' into 'copybinary'


diffs (truncated from 78094 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -672,30 +672,9 @@ program that uses MonetDB as an embeddab
 %{_includedir}/monetdb/monetdbe.h
 %{_libdir}/pkgconfig/monetdbe.pc
 
-%package testing
-Summary: MonetDB - Monet Database Management System
-Group: Applications/Databases
-
-%description testing
-MonetDB is a database management system that is developed from a
-main-memory perspective with use of a fully decomposed storage model,
-automatic index management, extensibility of data types and search
-accelerators.  It also has an SQL front end.
-
-This package contains the programs and files needed for testing the
-MonetDB packages.  You probably don't need this, unless you are a
-developer.  If you do want to test, install %{name}-testing-python.
-
-%files testing
-%license COPYING
-%defattr(-,root,root)
-%{_bindir}/Mdiff
-%{_bindir}/Mlog
-
 %package testing-python
 Summary: MonetDB - Monet Database Management System
 Group: Applications/Databases
-Requires: %{name}-testing = %{version}-%{release}
 Requires: %{name}-client-tests = %{version}-%{release}
 Requires: /usr/bin/python3
 BuildArch: noarch
@@ -2719,7 +2698,7 @@ sed -i 's|/var/run|/run|' \
   are equal to 1.1.  (The old code returned 33554432 instead of 1.1e8.)
 
 * Sun Nov  5 2017 Sjoerd Mullender  - 11.27.9-20171105
-- BZ#6460 - selinux doen't allow mmap
+- BZ#6460: selinux doen't allow mmap
 
 * Mon Oct 23 2017 Sjoerd Mullender  - 11.27.9-20171023
 - Rebuilt.
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
@@ -9513,7 +9513,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","alter_seq","pattern sqlcatalog.alter_seq(X_1:str, 
X_2:str, X_3:ptr, X_4:lng):void ",   "SQLalter_seq;",""  ]
 [ "sqlcatalog","alter_set_table",  "pattern 
sqlcatalog.alter_set_table(X_1:str, X_2:str, X_3:int):void ",  
"SQLalter_set_table;",  ""  ]
 [ "sqlcatalog","alter_table",  "pattern 
sqlcatalog.alter_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ", 
"SQLalter_table;",  ""  ]
-[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str):void ", "SQLalter_user;",   ""  
]
+[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str, X_6:str):void ","SQLalter_user;",   
""  ]
 [ "sqlcatalog","comment_on",   "pattern sqlcatalog.comment_on(X_1:int, 
X_2:str):void ","SQLcomment_on;",   ""  ]
 [ "sqlcatalog","create_function",  "pattern 
sqlcatalog.create_function(X_1:str, X_2:str, X_3:ptr):void ",  
"SQLcreate_function;",  ""  ]
 [ "sqlcatalog","create_role",  "pattern 
sqlcatalog.create_role(X_1:str, X_2:str, X_3:int):void ",  
"SQLcreate_role;",  ""  ]
@@ -9522,7 +9522,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","create_table", "pattern 
sqlcatalog.create_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ",
"SQLcreate_table;", ""  ]
 [ "sqlcatalog","create_trigger",   "pattern 
sqlcatalog.create_trigger(X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int, 
X_7:str, X_8:str, X_9:str, X_10:str):void ",   "SQLcreate_trigger;",   ""  ]
 [ "sqlcatalog","create_type",  "pattern 
sqlcatalog.create_type(X_1:str, X_2:str, X_3:str):void ",  
"SQLcreate_type;",  ""  ]
-[ "sqlcatalog","create_user",  "pattern 
sqlcatalog.create_user(X_1:str, X_2:str, X_3:int, X_4:str, X_5:str):void ",
"SQLcreate_user;",  ""  ]
+[ "sqlcatalog","create_user",  "pattern 
sqlcatalog.create_user(X_1:str, X_2:str, X_3:int, X_4:str, X_5:str, 
X_6:str):void ",   

MonetDB: default - removed old windowsbuild doc

2020-12-22 Thread Niels Nes
Changeset: 5e5a4c0a7cb9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5e5a4c0a7cb9
Removed Files:
documentation/source/windowsbuild.rst
Modified Files:
documentation/source/developers_handbook.rst
Branch: default
Log Message:

removed old windowsbuild doc


diffs (138 lines):

diff --git a/documentation/source/developers_handbook.rst 
b/documentation/source/developers_handbook.rst
--- a/documentation/source/developers_handbook.rst
+++ b/documentation/source/developers_handbook.rst
@@ -70,7 +70,7 @@ directory where they reside::
 
 
 Adding sqllogic test
--
+
 
 See ``_ for detail 
information 
 on how to structure sqllogic test if you desire to make one by hand. We have 
extended the 
diff --git a/documentation/source/windowsbuild.rst 
b/documentation/source/windowsbuild.rst
deleted file mode 100644
--- a/documentation/source/windowsbuild.rst
+++ /dev/null
@@ -1,121 +0,0 @@
-.. 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/.
-..
-.. Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V.
-
-.. This document is written in reStructuredText (see
-   http://docutils.sourceforge.net/ for more information).
-   Use ``rst2html.py`` to convert this file to HTML.
-
-Building MonetDB On Windows
-+++
-
-In this document we describe how to build the MonetDB suite of
-programs on Windows using the sources from `our source repository`__.
-This document is mainly targeted at building on Windows on a 32-bit
-architecture, but there are notes throughout about building on Windows
-on a 64-bit architecture which is indicated with Windows64.  We have
-successfully built on Windows XP, Windows Server, and Windows 7.
-
-.. _MonetDB: https://dev.monetdb.org/hg/MonetDB/
-
-__ MonetDB_
-
-Introduction
-
-
-The MonetDB suite of programs consists of a number of components which
-we will describe briefly here.  The section names are the names of the
-top-level folders in the Mercurial clone.
-
-Note that in branches up to and including Oct2010 the build process
-was different.  This document describes the build process for the
-branch this document is part of.  Use the command ``hg branch`` to
-find out the name of the branch.
-
-buildtools
---
-
-The buildtools component contains tools that are used to build the
-other components.  This component is required, but not all parts of
-this component are required for all configurations.
-
-common
---
-
-Also known as the MonetDB Common component contains some generally
-useful libraries.  This component is required.
-
-gdk

-
-Also known as the Goblin Database Kernel contains the database kernel,
-i.e. the heart of MonetDB.  This component is required.
-
-clients

-
-Also known as the MonetDB Client component contains a library which
-forms the basis for communicating with the MonetDB server components,
-and some interface programs that use this library to communicate with
-the server.  This component is required.
-
-monetdb5
-
-
-The MonetDB5 Server component is the database server.  It uses MAL
-(the MonetDB Algebra Language) as programming interface.  This
-component is required.
-
-sql

-
-Also known as MonetDB SQL, this component provides an SQL frontend to
-MonetDB5.  This component is required if you need SQL support.
-
-tools
--
-
-The tools component contains two parts.  The mserver part is the
-actual database server binary and is required.  The merovingian part
-is not used on Windows.
-
-geom
-
-
-The geom component provides a module for the MonetDB SQL frontend.
-This component is optional.
-
-testing

-
-The testing component contains some files and programs we use for
-testing the MonetDB suite.  This component is optional.
-
-Prerequisites
-=
-
-In order to compile the MonetDB suite of programs, several other
-programs and libraries need to be installed.  Some further programs
-and libraries can be optionally installed to enable optional features.
-The required programs and libraries are listed in this section, the
-following section lists the optional programs and libraries.
-
-Chocolatey
---
-
-Although Chocolatey_ is not a prerequisite per se, it makes
-installing and maintaining some of the other prerequisites a lot
-easier.  Therefore we recommend installing chocolatey.  Instructions
-are on their website__.
-
-We have installed the following programs using Chocolatey_::
-
-  choco install ActivePerl ant cmake ruby
-  choco install python3 python3-x86_32
-
-.. _Chocolatey: https://chocolatey.org/
-
-__ Chocolatey_
-
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: copybinary - Merge branch 'default' into 'copybinary'

2020-12-22 Thread Joeri van Ruth
Changeset: 9ea371885ee9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9ea371885ee9
Removed Files:
sql/test/mapi/Tests/sql_int128.stable.out.int128.single
Modified Files:
clients/Tests/exports.stable.out
common/stream/Tests/read_iconv.py
common/stream/Tests/urlstream.py
common/stream/Tests/write_iconv.py
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.test
sql/backends/monet5/CMakeLists.txt
sql/test/BugTracker-2009/Tests/reorder.SF-2770608.test
sql/test/BugTracker-2012/Tests/All
sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.SQL.py
sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.err
sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out
sql/test/BugTracker-2012/Tests/day-of-month-localization.Bug-2962.SQL.py

sql/test/BugTracker-2012/Tests/day-of-month-localization.Bug-2962.stable.err

sql/test/BugTracker-2012/Tests/day-of-month-localization.Bug-2962.stable.out

sql/test/BugTracker-2012/Tests/large-number-operation-strange-results.Bug-2929.stable.err

sql/test/BugTracker-2012/Tests/large-number-operation-strange-results.Bug-2929.stable.out

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql

sql/test/BugTracker-2012/Tests/strange_escaping_in_csv.Bug-2133.stable.err

sql/test/BugTracker-2012/Tests/strange_escaping_in_csv.Bug-2133.stable.out
sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.stable.err
sql/test/BugTracker-2016/Tests/decimal_vs_integer.Bug-3941.stable.out

sql/test/BugTracker-2019/Tests/duplicates-not-eliminated-long-CASE-stmt.Bug-6697.stable.out
sql/test/BugTracker-2019/Tests/str_to_time.Bug-6791.stable.out
sql/test/BugTracker-2020/Tests/values-like-join.Bug-6954.stable.out
sql/test/BugTracker/Tests/drop_schema_crash.SF-1504794.sql
sql/test/Dependencies/Tests/dependency_DBobjects.sql
sql/test/Dependencies/Tests/dependency_functions.sql
sql/test/Dependencies/Tests/dependency_owner_schema_1.sql
sql/test/Dependencies/Tests/dependency_owner_schema_2.sql
sql/test/Dependencies/Tests/dependency_owner_schema_3.sql
sql/test/Tests/All
sql/test/Tests/null-byte-hang.sql
sql/test/Tests/setoptimizer.test
sql/test/astro/Tests/SingleServer
sql/test/mapi/Tests/sql_int128.test
sql/test/prepare/Tests/SingleServer
sql/test/prepare/Tests/bind_with_cast.SF-1720934.sql
sql/test/prepare/Tests/bind_with_cast.SF-1720934.stable.err
sql/test/prepare/Tests/bind_with_cast.SF-1720934.stable.out
sql/test/prepare/Tests/crash_with_prepare_statement.Bug-2549.sql
sql/test/prepare/Tests/crash_with_prepare_statement.Bug-2549.stable.err
sql/test/prepare/Tests/crash_with_prepare_statement.Bug-2549.stable.out
sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.sql
sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.stable.err
sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.stable.out
sql/test/prepare/Tests/decimal_prepare.SF-1655818.sql
sql/test/prepare/Tests/decimal_prepare.SF-1655818.stable.err
sql/test/prepare/Tests/decimal_prepare.SF-1655818.stable.out
sql/test/prepare/Tests/large_prepare.SF-1363729.stable.err
sql/test/prepare/Tests/large_prepare.SF-1363729.stable.out
sql/test/prepare/Tests/large_prepare_2.SF-1363729.stable.err
sql/test/prepare/Tests/large_prepare_2.SF-1363729.stable.out
sql/test/prepare/Tests/limit_in_prepare.Bug-2552.sql
sql/test/prepare/Tests/limit_in_prepare.Bug-2552.stable.err
sql/test/prepare/Tests/limit_in_prepare.Bug-2552.stable.out
sql/test/prepare/Tests/prepare-types.Bug-6724.sql
sql/test/prepare/Tests/prepare-types.Bug-6724.stable.err
sql/test/prepare/Tests/prepare-types.Bug-6724.stable.out

sql/test/prepare/Tests/prepare-where.SF-1238867.1238959.1238965.1240124.sql

sql/test/prepare/Tests/prepare-where.SF-1238867.1238959.1238965.1240124.stable.err

sql/test/prepare/Tests/prepare-where.SF-1238867.1238959.1238965.1240124.stable.out
sql/test/prepare/Tests/prepare_commit_execute.SF-2606020.sql
sql/test/prepare/Tests/prepare_commit_execute.SF-2606020.stable.err
sql/test/prepare/Tests/prepare_commit_execute.SF-2606020.stable.out
sql/test/prepare/Tests/prepare_decimal_bug.SF-2831994.sql
sql/test/prepare/Tests/prepare_decimal_bug.SF-2831994.stable.err
sql/test/prepare/Tests/prepare_decimal_bug.SF-2831994.stable.out
sql/test/prepare/Tests/prepare_decimal_float.SF-1675795.sql
sql/test/prepare/Tests/prepare_decimal_float.SF-1675795.stable.err
sql/test/prepare/Tests/prepare_decimal_float.SF-1675795.stable.out

MonetDB: default - More tests for GRANT SELECT on

2020-12-22 Thread Ying Zhang
Changeset: 742f57b29196 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=742f57b29196
Added Files:
sql/test/Users/Tests/view_privs_chain.SQL.py
Modified Files:
sql/test/Users/Tests/All
Branch: default
Log Message:

More tests for GRANT SELECT on 

When we have a chain of views, e.g. v2 -> v1 -> tbl, and
 we only grant select on v2 to a user, then
 the user should be table to select from v2
 but not from v1 and tbl


diffs (163 lines):

diff --git a/sql/test/Users/Tests/All b/sql/test/Users/Tests/All
--- a/sql/test/Users/Tests/All
+++ b/sql/test/Users/Tests/All
@@ -12,6 +12,7 @@ schemaRights
 table_privs
 table
 view_privs
+view_privs_chain
 unknown_user
 userCallFunction
 withGrantOption
diff --git a/sql/test/Users/Tests/view_privs_chain.SQL.py 
b/sql/test/Users/Tests/view_privs_chain.SQL.py
new file mode 100644
--- /dev/null
+++ b/sql/test/Users/Tests/view_privs_chain.SQL.py
@@ -0,0 +1,147 @@
+###
+# Check indirect VIEW privilege:
+#   check that GRANT SELECT on  works correctly in assigning various
+#   chains of views and tables to different users
+###
+from MonetDBtesting.sqltest import SQLTestCase
+from decimal import Decimal
+
+with SQLTestCase() as mdb:
+mdb.connect(username="monetdb", password="monetdb")
+
+# create two users in my_schema
+mdb.execute("CREATE ROLE my_role;").assertSucceeded()
+mdb.execute("CREATE SCHEMA my_schema AUTHORIZATION 
my_role;").assertSucceeded()
+mdb.execute("CREATE USER usr1 WITH PASSWORD 'p1' NAME 'usr1' SCHEMA 
my_schema;").assertSucceeded()
+mdb.execute("CREATE USER usr2 WITH PASSWORD 'p2' NAME 'usr2' SCHEMA 
my_schema;").assertSucceeded()
+mdb.execute("GRANT my_role to usr1;").assertSucceeded()
+mdb.execute("GRANT my_role to usr2;").assertSucceeded()
+
+# create tables and views in another schema
+mdb.execute("CREATE SCHEMA your_schema;").assertSucceeded()
+mdb.execute("SET SCHEMA your_schema;").assertSucceeded()
+mdb.execute("CREATE TABLE person (name VARCHAR(10), birthday DATE, ssn 
CHAR(9));").assertSucceeded()
+mdb.execute("INSERT INTO person VALUES ('alice', '1980-01-01', 
'A'), ('bob', '1970-01-01', '0');").assertRowCount(2)
+mdb.execute("CREATE TABLE employee (name VARCHAR(10), salary 
DECIMAL(10,2));").assertSucceeded()
+mdb.execute("INSERT INTO employee VALUES ('alice', 888.42), ('bob', 
444.42);").assertRowCount(2)
+
+# v1 = join(table, table)
+mdb.execute("""
+CREATE VIEW v1 AS SELECT
+  p.name,
+  EXTRACT(YEAR FROM birthday) as yr,
+  ''||substring(ssn,9,9) as ssn,
+  ifthenelse((salary > 500), 'high', 'low') as salary
+FROM person p, employee e
+WHERE p.name = e.name;
+""").assertSucceeded()
+mdb.execute("SELECT * FROM v1;").assertSucceeded()\
+.assertDataResultMatch([('alice', 1980, 'A', 'high'), ('bob', 
1970, '0', 'low')])
+
+# v2 = join(table, view)
+mdb.execute("""
+CREATE VIEW v2 AS SELECT v1.name, v1.ssn, e.salary
+FROM v1, employee e
+WHERE v1.name = e.name;
+""").assertSucceeded()
+mdb.execute("SELECT * FROM v2;").assertSucceeded()\
+.assertDataResultMatch([('alice', 'A', Decimal('888.42')), 
('bob', '0', Decimal('444.42'))])
+
+# v3 = join(view, view)
+mdb.execute("""
+CREATE VIEW v3 AS SELECT v1.name, v1.yr, v2.salary
+FROM v1, v2
+WHERE v1.name = v2.name;
+""").assertSucceeded()
+mdb.execute("SELECT * FROM v3;").assertSucceeded()\
+.assertDataResultMatch([('alice', 1980, Decimal('888.42')), ('bob', 
1970, Decimal('444.42'))])
+
+# v4 = project(view)
+mdb.execute("""
+CREATE VIEW v4 AS SELECT yr,
+  ifthenelse((salary > 500), 'high', 'low') as salary
+FROM v3
+""").assertSucceeded()
+mdb.execute("SELECT * FROM v4;").assertSucceeded()\
+.assertDataResultMatch([(1980, 'high'), (1970, 'low')])
+mdb.execute("SET SCHEMA sys;").assertSucceeded()
+
+# usr1 has no access to the tables and gets access to views top-down
+with SQLTestCase() as tc:
+tc.connect(username="usr1", password="p1")
+
+mdb.execute("GRANT SELECT on your_schema.v4 to 
usr1;").assertSucceeded()
+tc.execute("SELECT * FROM your_schema.v4;").assertSucceeded()\
+.assertDataResultMatch([(1980, 'high'), (1970, 'low')])
+tc.execute("SELECT * FROM your_schema.v3;")\
+.assertFailed(err_code="42000", err_message="SELECT: access denied 
for usr1 to view 'your_schema.v3'")
+tc.execute("SELECT * FROM your_schema.v2;")\
+.assertFailed(err_code="42000", err_message="SELECT: access denied 
for usr1 to view 'your_schema.v2'")
+tc.execute("SELECT * FROM your_schema.v1;")\
+.assertFailed(err_code="42000", err_message="SELECT: access denied 
for usr1 to view 'your_schema.v1'")
+
+mdb.execute("GRANT SELECT on 

MonetDB: default - Extended the VIEW access tests to check that ...

2020-12-22 Thread Ying Zhang
Changeset: 85ea3faf5d24 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=85ea3faf5d24
Modified Files:
sql/test/Users/Tests/view_privs.SQL.py
Branch: default
Log Message:

Extended the VIEW access tests to check that GRANT SELECT on  also works
properly on individual columns of a view


diffs (52 lines):

diff --git a/sql/test/Users/Tests/view_privs.SQL.py 
b/sql/test/Users/Tests/view_privs.SQL.py
--- a/sql/test/Users/Tests/view_privs.SQL.py
+++ b/sql/test/Users/Tests/view_privs.SQL.py
@@ -1,6 +1,7 @@
 ###
 # Check indirect VIEW privilege:
 #   A user with only(!) SELECT privilege on VIEWs of tables can use the VIEWs.
+#   A user can view the columns of a VIEW to which it has been granted access.
 # Check that if a user has CREATE VIEW privilege in one schema (i.e. is an
 #   schema owner) but not in another schema, then the user can CREATE VIEWs
 #   on tables in this schema but not in the other schema.
@@ -27,7 +28,6 @@ with SQLTestCase() as mdb:
 mdb.execute("SELECT * FROM 
your_view;").assertSucceeded().assertDataResultMatch([('alice', 1980, 
'A'), ('bob', 1970, '0')])
 # grant indirect view right to my_user
 mdb.execute("GRANT SELECT on your_view to my_user;").assertSucceeded()
-mdb.execute("SET SCHEMA sys;").assertSucceeded()
 
 
 with SQLTestCase() as tc:
@@ -47,11 +47,28 @@ with SQLTestCase() as mdb:
 # my_user cannot create VIEWs on your_table
 tc.execute("CREATE VIEW your_view AS SELECT * FROM 
your_schema.your_table;").assertFailed(err_code="42000", err_message="SELECT: 
access denied for my_user to table 'your_schema.your_table'")
 
+# Check that we can revoke select from a whole view, but regrant select
+#   on some columns of the view
+mdb.execute("REVOKE SELECT on your_view FROM 
my_user;").assertSucceeded()
+tc.execute("SELECT * FROM your_schema.your_view;")\
+.assertFailed(err_code="42000", err_message="SELECT: access denied 
for my_user to view 'your_schema.your_view'")
+mdb.execute("GRANT SELECT (name) on your_view to 
my_user;").assertSucceeded()
+tc.execute("SELECT name FROM 
your_schema.your_view;").assertSucceeded()\
+.assertDataResultMatch([('alice',), ('bob',)])
+tc.execute("SELECT * FROM your_schema.your_view;").assertSucceeded()\
+.assertDataResultMatch([('alice',), ('bob',)])
+mdb.execute("GRANT SELECT (ssn) on your_view to 
my_user;").assertSucceeded()
+tc.execute("SELECT name, ssn FROM 
your_schema.your_view;").assertSucceeded()\
+.assertDataResultMatch([('alice', 'A'), ('bob', 
'0')])
+tc.execute("SELECT * FROM your_schema.your_view;").assertSucceeded()\
+.assertDataResultMatch([('alice', 'A'), ('bob', 
'0')])
+tc.execute("SELECT yr FROM your_schema.your_view;")\
+.assertFailed(err_code="42000", err_message="SELECT: identifier 
'yr' unknown")
+
 # clean up
-mdb.execute("DROP VIEW your_schema.your_view;").assertSucceeded()
-mdb.execute("DROP TABLE your_schema.your_table;").assertSucceeded()
+mdb.execute("SET SCHEMA sys;").assertSucceeded()
 mdb.execute("DROP USER my_user;").assertSucceeded()
 mdb.execute("DROP ROLE my_role;").assertSucceeded()
-mdb.execute("DROP SCHEMA my_schema;").assertSucceeded()
-mdb.execute("DROP SCHEMA your_schema;").assertSucceeded()
+mdb.execute("DROP SCHEMA my_schema CASCADE;").assertSucceeded()
+mdb.execute("DROP SCHEMA your_schema CASCADE;").assertSucceeded()
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Fix upgrade by changing how sys.users is crea...

2020-12-22 Thread Sjoerd Mullender
Changeset: 6ea6c0320833 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6ea6c0320833
Modified Files:
sql/backends/monet5/sql_user.c
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:

Fix upgrade by changing how sys.users is created in a clean database.


diffs (93 lines):

diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c
--- a/sql/backends/monet5/sql_user.c
+++ b/sql/backends/monet5/sql_user.c
@@ -286,11 +286,11 @@ monet5_create_privileges(ptr _mvc, sql_s
mvc_create_func(m, NULL, s, "db_users", ops, res, F_UNION, 
FUNC_LANG_SQL, "sql", "db_users", "CREATE FUNCTION db_users () RETURNS TABLE( 
name varchar(2048)) EXTERNAL NAME sql.db_users;", FALSE, FALSE, TRUE);
 
t = mvc_init_create_view(m, s, "users",
-   "SELECT u.\"name\" AS \"name\", "
+   "create view sys.users as select u.\"name\" as 
\"name\", "
"ui.\"fullname\", ui.\"default_schema\", "
-   "ui.\"schema_path\" FROM db_users() AS u "
-   "LEFT JOIN \"sys\".\"db_user_info\" AS ui "
-   "ON u.\"name\" = ui.\"name\";");
+   "ui.\"schema_path\" from db_users() as u "
+   "left join \"sys\".\"db_user_info\" as ui "
+   "on u.\"name\" = ui.\"name\";");
if (!t) {
TRC_CRITICAL(SQL_TRANS, "Failed to create 'users' view\n");
return ;
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out 
b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
--- a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
@@ -3798,7 +3798,6 @@ CREATE VIEW sys.users AS
 SELECT u."name" AS "name", ui."fullname", ui."default_schema", ui."schema_path"
  FROM db_users() AS u
  LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name";
-GRANT SELECT ON sys.users TO PUBLIC;
 CREATE VIEW sys.dependency_schemas_on_users AS
  SELECT s.id AS schema_id, s.name AS schema_name, u.name AS user_name, CAST(6 
AS smallint) AS depend_type
  FROM sys.users AS u, sys.schemas AS s
diff --git a/sql/test/emptydb/Tests/check.stable.out 
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -959,7 +959,7 @@ SELECT "id", "name", "schema_id", "query
 create view sys."tablestorage" as select "schema", "table", max("count") as 
"rowcount", count(*) as "storages", sum(columnsize) as columnsize, 
sum(heapsize) as heapsize, sum(hashes) as hashsize, sum("imprints") as 
imprintsize, sum(orderidx) as orderidxsize from sys."storage" group by 
"schema", "table" order by "schema", "table";
 create view sys.tablestoragemodel as select "schema", "table", max("count") as 
"rowcount", count(*) as "storages", sum(sys.columnsize("type", "count")) as 
columnsize, sum(sys.heapsize("type", "count", "distinct", "atomwidth")) as 
heapsize, sum(sys.hashsize("reference", "count")) as hashsize, sum(case when 
isacolumn then sys.imprintsize("type", "count") else 0 end) as imprintsize, 
sum(case when (isacolumn and not sorted) then cast(8 * "count" as bigint) else 
0 end) as orderidxsize from sys.storagemodelinput group by "schema", "table" 
order by "schema", "table";
 create view sys.tracelog as select * from sys.tracelog();
-SELECT u."name" AS "name", ui."fullname", ui."default_schema", 
ui."schema_path" FROM db_users() AS u LEFT JOIN "sys"."db_user_info" AS ui ON 
u."name" = ui."name";
+create view sys.users as select u."name" as "name", ui."fullname", 
ui."default_schema", ui."schema_path" from db_users() as u left join 
"sys"."db_user_info" as ui on u."name" = ui."name";
 create view sys.var_values (var_name, value) as select 'current_role', 
current_role union all select 'current_schema', current_schema union all select 
'current_timezone', current_timezone union all select 'current_user', 
current_user union all select 'debug', debug union all select 'last_id', 
last_id union all select 'optimizer', optimizer union all select 'pi', pi() 
union all select 'rowcnt', rowcnt;
 create function "abbrev" (p inet) returns clob external name inet."abbrev";
 create function alpha(pdec double, pradius double) returns double external 
name sql.alpha;
@@ -1550,7 +1550,7 @@ drop function pcre_replace(string, strin
 [ "sys._tables",   "sys",  "triggers", NULL,   "TABLE",true,   
"COMMIT",   "WRITABLE"  ]
 [ "sys._tables",   "sys",  "types",NULL,   "TABLE",true,   
"COMMIT",   "WRITABLE"  ]
 [ "sys._tables",   "sys",  "user_role",NULL,   "TABLE",true,   
"COMMIT",   "WRITABLE"  ]
-[ 

MonetDB: default - Don't grant users view to the public

2020-12-22 Thread Pedro Ferreira
Changeset: 9f2c097ce4f2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9f2c097ce4f2
Modified Files:
sql/backends/monet5/sql_upgrades.c
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Don't grant users view to the public


diffs (209 lines):

diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -2780,7 +2780,6 @@ sql_update_default(Client c, mvc *sql, c
"SELECT u.\"name\" AS \"name\", 
ui.\"fullname\", ui.\"default_schema\", ui.\"schema_path\"\n"
" FROM db_users() AS u\n"
" LEFT JOIN \"sys\".\"db_user_info\" AS 
ui ON u.\"name\" = ui.\"name\";\n"
-   "GRANT SELECT ON sys.users TO PUBLIC;\n"
"CREATE VIEW 
sys.dependency_schemas_on_users AS\n"
" SELECT s.id AS schema_id, s.name AS 
schema_name, u.name AS user_name, CAST(6 AS smallint) AS depend_type\n"
" FROM sys.users AS u, sys.schemas AS 
s\n"
diff --git a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -4393,7 +4393,6 @@ CREATE VIEW sys.users AS
 SELECT u."name" AS "name", ui."fullname", ui."default_schema", ui."schema_path"
  FROM db_users() AS u
  LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name";
-GRANT SELECT ON sys.users TO PUBLIC;
 CREATE VIEW sys.dependency_schemas_on_users AS
  SELECT s.id AS schema_id, s.name AS schema_name, u.name AS user_name, CAST(6 
AS smallint) AS depend_type
  FROM sys.users AS u, sys.schemas AS s
diff --git 
a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
@@ -4393,7 +4393,6 @@ CREATE VIEW sys.users AS
 SELECT u."name" AS "name", ui."fullname", ui."default_schema", ui."schema_path"
  FROM db_users() AS u
  LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name";
-GRANT SELECT ON sys.users TO PUBLIC;
 CREATE VIEW sys.dependency_schemas_on_users AS
  SELECT s.id AS schema_id, s.name AS schema_name, u.name AS user_name, CAST(6 
AS smallint) AS depend_type
  FROM sys.users AS u, sys.schemas AS s
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
@@ -3798,7 +3798,6 @@ CREATE VIEW sys.users AS
 SELECT u."name" AS "name", ui."fullname", ui."default_schema", ui."schema_path"
  FROM db_users() AS u
  LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name";
-GRANT SELECT ON sys.users TO PUBLIC;
 CREATE VIEW sys.dependency_schemas_on_users AS
  SELECT s.id AS schema_id, s.name AS schema_name, u.name AS user_name, CAST(6 
AS smallint) AS depend_type
  FROM sys.users AS u, sys.schemas AS s
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
@@ -3798,7 +3798,6 @@ CREATE VIEW sys.users AS
 SELECT 

MonetDB: default - Use the same varchar sizes in the sys.users v...

2020-12-22 Thread Sjoerd Mullender
Changeset: 28d146874c0a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=28d146874c0a
Modified Files:
sql/backends/monet5/sql_user.c
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:

Use the same varchar sizes in the sys.users view as in the base tables.


diffs (56 lines):

diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c
--- a/sql/backends/monet5/sql_user.c
+++ b/sql/backends/monet5/sql_user.c
@@ -296,8 +296,8 @@ monet5_create_privileges(ptr _mvc, sql_s
return ;
}
 
-   mvc_create_column_(m, t, "name", "varchar", 1024);
-   mvc_create_column_(m, t, "fullname", "varchar", 2024);
+   mvc_create_column_(m, t, "name", "varchar", 2048);
+   mvc_create_column_(m, t, "fullname", "varchar", 2048);
mvc_create_column_(m, t, "default_schema", "int", 9);
mvc_create_column_(m, t, "schema_path", "clob", 0);
 
diff --git a/sql/test/emptydb/Tests/check.stable.out 
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -2144,8 +2144,8 @@ drop function pcre_replace(string, strin
 [ "sys._columns",  "types","schema_id","int",  32, 0,  
NULL,   true,   7,  NULL]
 [ "sys._columns",  "user_role","login_id", "int",  32, 0,  
NULL,   true,   0,  NULL]
 [ "sys._columns",  "user_role","role_id",  "int",  32, 0,  
NULL,   true,   1,  NULL]
-[ "sys._columns",  "users","name", "varchar",  1024,   0,  
NULL,   true,   0,  NULL]
-[ "sys._columns",  "users","fullname", "varchar",  2024,   
0,  NULL,   true,   1,  NULL]
+[ "sys._columns",  "users","name", "varchar",  2048,   0,  
NULL,   true,   0,  NULL]
+[ "sys._columns",  "users","fullname", "varchar",  2048,   
0,  NULL,   true,   1,  NULL]
 [ "sys._columns",  "users","default_schema",   "int",  9,  
0,  NULL,   true,   2,  NULL]
 [ "sys._columns",  "users","schema_path",  "clob", 0,  0,  
NULL,   true,   3,  NULL]
 [ "sys._columns",  "value_partitions", "table_id", "int",  32, 
0,  NULL,   true,   0,  NULL]
diff --git a/sql/test/emptydb/Tests/check.stable.out.32bit 
b/sql/test/emptydb/Tests/check.stable.out.32bit
--- a/sql/test/emptydb/Tests/check.stable.out.32bit
+++ b/sql/test/emptydb/Tests/check.stable.out.32bit
@@ -2144,8 +2144,8 @@ drop function pcre_replace(string, strin
 [ "sys._columns",  "types","schema_id","int",  32, 0,  
NULL,   true,   7,  NULL]
 [ "sys._columns",  "user_role","login_id", "int",  32, 0,  
NULL,   true,   0,  NULL]
 [ "sys._columns",  "user_role","role_id",  "int",  32, 0,  
NULL,   true,   1,  NULL]
-[ "sys._columns",  "users","name", "varchar",  1024,   0,  
NULL,   true,   0,  NULL]
-[ "sys._columns",  "users","fullname", "varchar",  2024,   
0,  NULL,   true,   1,  NULL]
+[ "sys._columns",  "users","name", "varchar",  2048,   0,  
NULL,   true,   0,  NULL]
+[ "sys._columns",  "users","fullname", "varchar",  2048,   
0,  NULL,   true,   1,  NULL]
 [ "sys._columns",  "users","default_schema",   "int",  9,  
0,  NULL,   true,   2,  NULL]
 [ "sys._columns",  "users","schema_path",  "clob", 0,  0,  
NULL,   true,   3,  NULL]
 [ "sys._columns",  "value_partitions", "table_id", "int",  32, 
0,  NULL,   true,   0,  NULL]
diff --git a/sql/test/emptydb/Tests/check.stable.out.int128 
b/sql/test/emptydb/Tests/check.stable.out.int128
--- a/sql/test/emptydb/Tests/check.stable.out.int128
+++ b/sql/test/emptydb/Tests/check.stable.out.int128
@@ -2165,8 +2165,8 @@ drop function pcre_replace(string, strin
 [ "sys._columns",  "types","schema_id","int",  32, 0,  
NULL,   true,   7,  NULL]
 [ "sys._columns",  "user_role","login_id", "int",  32, 0,  
NULL,   true,   0,  NULL]
 [ "sys._columns",  "user_role","role_id",  "int",  32, 0,  
NULL,   true,   1,  NULL]
-[ "sys._columns",  "users","name", "varchar",  1024,   0,  
NULL,   true,   0,  NULL]
-[ "sys._columns",  "users","fullname", "varchar",  2024,   
0,  NULL,   true,   1,  NULL]
+[ "sys._columns",  "users","name", "varchar",  2048,   0,  
NULL,   true,   0,  NULL]
+[ "sys._columns",  "users","fullname", "varchar",  

MonetDB: default - Exit with non-zero error status if there was ...

2020-12-22 Thread Sjoerd Mullender
Changeset: 78841fbb0397 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=78841fbb0397
Modified Files:
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.py
sql/test/emptydb-upgrade-chain/Tests/upgrade.py
sql/test/emptydb-upgrade-hge/Tests/upgrade.py
sql/test/emptydb-upgrade/Tests/upgrade.py
sql/test/emptydb/Tests/check.SQL.py
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.py
sql/test/testdb-upgrade-chain/Tests/upgrade.py
sql/test/testdb-upgrade-hge/Tests/upgrade.py
sql/test/testdb-upgrade/Tests/upgrade.py
Branch: default
Log Message:

Exit with non-zero error status if there was an error.


diffs (227 lines):

diff --git a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.py 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.py
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.py
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.py
@@ -13,6 +13,8 @@ import sys
 import os
 import zipfile
 
+xit = 0
+
 # find zipped database
 dbfarm = os.environ['GDK_DBFARM']
 db = os.path.join(dbfarm, os.environ['TSTDB'])
@@ -71,7 +73,11 @@ if len(sys.argv) == 2 and sys.argv[1] ==
 import difflib
 for line in difflib.unified_diff(stable, srvout, fromfile='test', 
tofile=f):
 sys.stderr.write(line)
+xit = 1
 if len(cltout) != 2 or cltout[0] != 'START TRANSACTION;' or cltout[1] != 
'COMMIT;':
 sys.stderr.writelines(cltout)
+xit = 1
 else:
 sys.stdout.writelines(srvout)
+
+sys.exit(xit)
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.py 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.py
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.py
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.py
@@ -13,6 +13,8 @@ import sys
 import os
 import zipfile
 
+xit = 0
+
 # find zipped database
 dbfarm = os.environ['GDK_DBFARM']
 db = os.path.join(dbfarm, os.environ['TSTDB'])
@@ -71,7 +73,11 @@ if len(sys.argv) == 2 and sys.argv[1] ==
 import difflib
 for line in difflib.unified_diff(stable, srvout, fromfile='test', 
tofile=f):
 sys.stderr.write(line)
+xit = 1
 if len(cltout) != 2 or cltout[0] != 'START TRANSACTION;' or cltout[1] != 
'COMMIT;':
 sys.stderr.writelines(cltout)
+xit = 1
 else:
 sys.stdout.writelines(srvout)
+
+sys.exit(xit)
diff --git a/sql/test/emptydb-upgrade-hge/Tests/upgrade.py 
b/sql/test/emptydb-upgrade-hge/Tests/upgrade.py
--- a/sql/test/emptydb-upgrade-hge/Tests/upgrade.py
+++ b/sql/test/emptydb-upgrade-hge/Tests/upgrade.py
@@ -13,6 +13,8 @@ import sys
 import os
 import zipfile
 
+xit = 0
+
 # find zipped database
 dbfarm = os.environ['GDK_DBFARM']
 db = os.path.join(dbfarm, os.environ['TSTDB'])
@@ -71,7 +73,11 @@ if len(sys.argv) == 2 and sys.argv[1] ==
 import difflib
 for line in difflib.unified_diff(stable, srvout, fromfile='test', 
tofile=f):
 sys.stderr.write(line)
+xit = 1
 if len(cltout) != 2 or cltout[0] != 'START TRANSACTION;' or cltout[1] != 
'COMMIT;':
 sys.stderr.writelines(cltout)
+xit = 1
 else:
 sys.stdout.writelines(srvout)
+
+sys.exit(xit)
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.py 
b/sql/test/emptydb-upgrade/Tests/upgrade.py
--- a/sql/test/emptydb-upgrade/Tests/upgrade.py
+++ b/sql/test/emptydb-upgrade/Tests/upgrade.py
@@ -13,6 +13,8 @@ import sys
 import os
 import zipfile
 
+xit = 0
+
 # find zipped database
 dbfarm = os.environ['GDK_DBFARM']
 db = os.path.join(dbfarm, os.environ['TSTDB'])
@@ -71,7 +73,11 @@ if len(sys.argv) == 2 and sys.argv[1] ==
 import difflib
 for line in difflib.unified_diff(stable, srvout, fromfile='test', 
tofile=f):
 sys.stderr.write(line)
+xit = 1
 if len(cltout) != 2 or cltout[0] != 'START TRANSACTION;' or cltout[1] != 
'COMMIT;':
 sys.stderr.writelines(cltout)
+xit = 1
 else:
 sys.stdout.writelines(srvout)
+
+sys.exit(xit)
diff --git a/sql/test/emptydb/Tests/check.SQL.py 
b/sql/test/emptydb/Tests/check.SQL.py
--- a/sql/test/emptydb/Tests/check.SQL.py
+++ b/sql/test/emptydb/Tests/check.SQL.py
@@ -4,6 +4,7 @@ try:
 except ImportError:
 import process
 
+xit = 0
 output = []
 
 with process.client('sql', format='csv', echo=False,
@@ -28,6 +29,8 @@ with process.client('sql', format='csv',
 
 output.append(out)
 sys.stderr.write(err)
+if err:
+xit = 1
 
 with process.client('sql', interactive=True,
  stdin=process.PIPE, stdout=process.PIPE, 
stderr=process.PIPE) as clt:
@@ -59,6 +62,8 @@ with process.client('sql', interactive=T
 
 output.append(out)
 sys.stderr.write(err)
+if err:
+xit = 1
 
 # add queries to dump the system tables, but avoid dumping IDs since
 # they are too volatile, and if it makes sense, dump an identifier
@@ -185,6 +190,8 @@ with process.client('sql', interactive=T
 
 output.append(out)
 sys.stderr.write(err)
+if err:
+xit = 1
 
 if len(sys.argv) == 2 and 

MonetDB: copybinary - Merge tag 'predefault' into branches/copyb...

2020-12-22 Thread Joeri van Ruth
Changeset: 3cf104081410 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3cf104081410
Modified Files:
clients/mapiclient/mhelp.c
sql/scripts/51_sys_schema_extension.sql
sql/server/rel_updates.c
sql/storage/bat/bat_storage.c
sql/storage/store.c
Branch: copybinary
Log Message:

Merge tag 'predefault' into branches/copybinary


diffs (truncated from 4739 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -786,11 +786,6 @@ fi
 %setup -q
 
 %build
-%if (0%{?fedora} >= 33)
-# on Fedora 33 we get a crash of the compiler when using -flto, so disable it
-CFLAGS="${CFLAGS:-%optflags} -fno-lto"
-export CFLAGS
-%endif
 %cmake3 \
-DRELEASE_VERSION=ON \
-DASSERT=OFF \
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
@@ -6638,6 +6638,7 @@ stdout of test 'MAL-signatures` in direc
 [ "batstr","unicodeAt","pattern batstr.unicodeAt(X_1:str, 
X_2:bat[:int], X_3:bat[:oid]):bat[:int] ",   "STRbatWChrAt_strcst;", ""  ]
 [ "batstr","unicodeAt","pattern batstr.unicodeAt(X_1:bat[:str], 
X_2:int):bat[:int] ",  "STRbatWChrAtcst;", ""  ]
 [ "batstr","unicodeAt","pattern batstr.unicodeAt(X_1:bat[:str], 
X_2:int, X_3:bat[:oid]):bat[:int] ",   "STRbatWChrAtcst;", ""  ]
+[ "battxtsim", "similarity",   "command battxtsim.similarity(X_1:bat[:str], 
X_2:bat[:str]):bat[:dbl] ","fstrcmp0_impl_bulk;",  ""  ]
 [ "batudf","fuse", "command batudf.fuse(X_1:bat[:bte], 
X_2:bat[:bte]):bat[:sht] ", "UDFBATfuse;",  ""  ]
 [ "batudf","fuse", "command batudf.fuse(X_1:bat[:int], 
X_2:bat[:int]):bat[:lng] ", "UDFBATfuse;",  ""  ]
 [ "batudf","fuse", "command batudf.fuse(X_1:bat[:sht], 
X_2:bat[:sht]):bat[:int] ", "UDFBATfuse;",  ""  ]
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
@@ -9197,6 +9197,7 @@ stdout of test 'MAL-signatures` in direc
 [ "batstr","unicodeAt","pattern batstr.unicodeAt(X_1:str, 
X_2:bat[:int], X_3:bat[:oid]):bat[:int] ",   "STRbatWChrAt_strcst;", ""  ]
 [ "batstr","unicodeAt","pattern batstr.unicodeAt(X_1:bat[:str], 
X_2:int):bat[:int] ",  "STRbatWChrAtcst;", ""  ]
 [ "batstr","unicodeAt","pattern batstr.unicodeAt(X_1:bat[:str], 
X_2:int, X_3:bat[:oid]):bat[:int] ",   "STRbatWChrAtcst;", ""  ]
+[ "battxtsim", "similarity",   "command battxtsim.similarity(X_1:bat[:str], 
X_2:bat[:str]):bat[:dbl] ","fstrcmp0_impl_bulk;",  ""  ]
 [ "batudf","fuse", "command batudf.fuse(X_1:bat[:bte], 
X_2:bat[:bte]):bat[:sht] ", "UDFBATfuse;",  ""  ]
 [ "batudf","fuse", "command batudf.fuse(X_1:bat[:int], 
X_2:bat[:int]):bat[:lng] ", "UDFBATfuse;",  ""  ]
 [ "batudf","fuse", "command batudf.fuse(X_1:bat[:lng], 
X_2:bat[:lng]):bat[:hge] ", "UDFBATfuse;",  ""  ]
diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -217,7 +217,7 @@ SQLhelp sqlhelp1[] = {
 "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/Tables"},
{"CREATE TRIGGER",
 "Define a triggered action for a table data update event",
-"CREATE [ OR REPLACE ] TRIGGER qname { BEFORE | AFTER }\n"
+"CREATE [ OR REPLACE ] TRIGGER ident { BEFORE | AFTER }\n"
 " { INSERT | DELETE | TRUNCATE | UPDATE [ OF ident_list ] }\n"
 " ON qname [ REFERENCING trigger_reference [...] ] triggered_action",
 "qname,ident_list,trigger_reference,triggered_action",
diff --git a/clients/mapilib/.editorconfig b/clients/mapilib/.editorconfig
new file mode 100644
--- /dev/null
+++ b/clients/mapilib/.editorconfig
@@ -0,0 +1,3 @@
+[*.{c,h}]
+tab_width = 8
+max_line_length = 72
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -1524,8 +1524,7 @@ close_result(MapiHdl hdl)
   (hdl->npending_close > 0 && hdl->pending_close != NULL));
if (mid->active &&
(mid->active->active != result ||
-result->cache.tuplecount < result->row_count))
-   {
+result->cache.tuplecount < result->row_count)) {
/* results for which we got all tuples at the initial
 * response, need not to be closed as the server already
 * did that immediately */
@@ -1689,9 +1688,9 @@ mapi_next_result(MapiHdl hdl)
return MERROR;
if (hdl->result &&
(hdl->result->querytype == -1 ||
-/* basically 

MonetDB: default - Approve upgrade.

2020-12-22 Thread Sjoerd Mullender
Changeset: 7b4c6037b13f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b4c6037b13f
Modified Files:
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Approve upgrade.


diffs (truncated from 656 to 300 lines):

diff --git a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -4385,6 +4385,22 @@ BEGIN
 WHERE f.name=functionName AND s.name = schemaName;
 END;
 update sys.functions set system = true where system <> true and schema_id = 
(select id from sys.schemas where name = 'sys') and ((name = 'describe_type' 
and type = 1) or (name in ('describe_table', 'describe_columns', 
'describe_function') and type = 5));
+DROP VIEW sys.dependency_schemas_on_users;
+DROP VIEW sys.users;
+ALTER TABLE sys.db_user_info ADD COLUMN schema_path CLOB;
+UPDATE sys.db_user_info SET schema_path = '"sys"';
+CREATE VIEW sys.users AS
+SELECT u."name" AS "name", ui."fullname", ui."default_schema", ui."schema_path"
+ FROM db_users() AS u
+ LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name";
+GRANT SELECT ON sys.users TO PUBLIC;
+CREATE VIEW sys.dependency_schemas_on_users AS
+ SELECT s.id AS schema_id, s.name AS schema_name, u.name AS user_name, CAST(6 
AS smallint) AS depend_type
+ FROM sys.users AS u, sys.schemas AS s
+ WHERE u.default_schema = s.id
+ ORDER BY s.name, u.name;
+GRANT SELECT ON sys.dependency_schemas_on_users TO PUBLIC;
+update sys._tables set system = true where system <> true and name in 
('users','dependency_schemas_on_users') and schema_id = (select id from 
sys.schemas where name = 'sys') and type = 1;
 commit;
 set schema "sys";
 
diff --git 
a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
@@ -4385,6 +4385,22 @@ BEGIN
 WHERE f.name=functionName AND s.name = schemaName;
 END;
 update sys.functions set system = true where system <> true and schema_id = 
(select id from sys.schemas where name = 'sys') and ((name = 'describe_type' 
and type = 1) or (name in ('describe_table', 'describe_columns', 
'describe_function') and type = 5));
+DROP VIEW sys.dependency_schemas_on_users;
+DROP VIEW sys.users;
+ALTER TABLE sys.db_user_info ADD COLUMN schema_path CLOB;
+UPDATE sys.db_user_info SET schema_path = '"sys"';
+CREATE VIEW sys.users AS
+SELECT u."name" AS "name", ui."fullname", ui."default_schema", ui."schema_path"
+ FROM db_users() AS u
+ LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name";
+GRANT SELECT ON sys.users TO PUBLIC;
+CREATE VIEW sys.dependency_schemas_on_users AS
+ SELECT s.id AS schema_id, s.name AS schema_name, u.name AS user_name, CAST(6 
AS smallint) AS depend_type
+ FROM sys.users AS u, sys.schemas AS s
+ WHERE u.default_schema = s.id
+ ORDER BY s.name, u.name;
+GRANT SELECT ON sys.dependency_schemas_on_users TO PUBLIC;
+update sys._tables set system = true where system <> true and name in 
('users','dependency_schemas_on_users') and schema_id = (select id from 
sys.schemas where name = 'sys') and type = 1;
 commit;
 set schema "sys";
 
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out

MonetDB: properties - Merged with default

2020-12-22 Thread Pedro Ferreira
Changeset: f4ede1bbb888 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f4ede1bbb888
Modified Files:
gdk/gdk_private.h
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/sql_upgrades.c
sql/server/rel_dump.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimizer.c
sql/server/rel_prop.c
sql/server/rel_psm.c
sql/server/rel_rel.c
sql/server/rel_rel.h
sql/server/rel_schema.c
sql/server/rel_select.c
sql/server/rel_statistics.c
sql/server/rel_updates.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
tools/monetdbe/monetdbe.c
Branch: properties
Log Message:

Merged with default


diffs (truncated from 54439 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -2698,7 +2698,7 @@ sed -i 's|/var/run|/run|' \
   are equal to 1.1.  (The old code returned 33554432 instead of 1.1e8.)
 
 * Sun Nov  5 2017 Sjoerd Mullender  - 11.27.9-20171105
-- BZ#6460 - selinux doen't allow mmap
+- BZ#6460: selinux doen't allow mmap
 
 * Mon Oct 23 2017 Sjoerd Mullender  - 11.27.9-20171023
 - Rebuilt.
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
@@ -9513,7 +9513,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","alter_seq","pattern sqlcatalog.alter_seq(X_1:str, 
X_2:str, X_3:ptr, X_4:lng):void ",   "SQLalter_seq;",""  ]
 [ "sqlcatalog","alter_set_table",  "pattern 
sqlcatalog.alter_set_table(X_1:str, X_2:str, X_3:int):void ",  
"SQLalter_set_table;",  ""  ]
 [ "sqlcatalog","alter_table",  "pattern 
sqlcatalog.alter_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ", 
"SQLalter_table;",  ""  ]
-[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str):void ", "SQLalter_user;",   ""  
]
+[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str, X_6:str):void ","SQLalter_user;",   
""  ]
 [ "sqlcatalog","comment_on",   "pattern sqlcatalog.comment_on(X_1:int, 
X_2:str):void ","SQLcomment_on;",   ""  ]
 [ "sqlcatalog","create_function",  "pattern 
sqlcatalog.create_function(X_1:str, X_2:str, X_3:ptr):void ",  
"SQLcreate_function;",  ""  ]
 [ "sqlcatalog","create_role",  "pattern 
sqlcatalog.create_role(X_1:str, X_2:str, X_3:int):void ",  
"SQLcreate_role;",  ""  ]
@@ -9522,7 +9522,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","create_table", "pattern 
sqlcatalog.create_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ",
"SQLcreate_table;", ""  ]
 [ "sqlcatalog","create_trigger",   "pattern 
sqlcatalog.create_trigger(X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int, 
X_7:str, X_8:str, X_9:str, X_10:str):void ",   "SQLcreate_trigger;",   ""  ]
 [ "sqlcatalog","create_type",  "pattern 
sqlcatalog.create_type(X_1:str, X_2:str, X_3:str):void ",  
"SQLcreate_type;",  ""  ]
-[ "sqlcatalog","create_user",  "pattern 
sqlcatalog.create_user(X_1:str, X_2:str, X_3:int, X_4:str, X_5:str):void ",
"SQLcreate_user;",  ""  ]
+[ "sqlcatalog","create_user",  "pattern 
sqlcatalog.create_user(X_1:str, X_2:str, X_3:int, X_4:str, X_5:str, 
X_6:str):void ",   "SQLcreate_user;",  ""  ]
 [ "sqlcatalog","create_view",  "pattern 
sqlcatalog.create_view(X_1:str, X_2:str, X_3:ptr, X_4:int):void ", 
"SQLcreate_view;",  ""  ]
 [ "sqlcatalog","drop_constraint",  "pattern 
sqlcatalog.drop_constraint(X_1:str, X_2:str, X_3:int, X_4:int):void ", 
"SQLdrop_constraint;",  ""  ]
 [ "sqlcatalog","drop_function","pattern 
sqlcatalog.drop_function(X_1:str, X_2:str, X_3:int, X_4:int, X_5:int):void ",  
"SQLdrop_function;",""  ]
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
@@ -12836,7 +12836,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","alter_seq","pattern sqlcatalog.alter_seq(X_1:str, 
X_2:str, X_3:ptr, X_4:lng):void ",   "SQLalter_seq;",""  ]
 [ "sqlcatalog","alter_set_table",  "pattern 
sqlcatalog.alter_set_table(X_1:str, X_2:str, X_3:int):void ",  
"SQLalter_set_table;",  ""  ]
 [ "sqlcatalog","alter_table",  "pattern 
sqlcatalog.alter_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ", 
"SQLalter_table;",  ""  ]
-[ "sqlcatalog", 

MonetDB: indirect-privs - Closing indirect-privs once merged int...

2020-12-22 Thread Pedro Ferreira
Changeset: b259f66152be for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b259f66152be
Branch: indirect-privs
Log Message:

Closing indirect-privs once merged into default

___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged indirect-privs into default

2020-12-22 Thread Pedro Ferreira
Changeset: e2fec4e3eefa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e2fec4e3eefa
Branch: default
Log Message:

Merged indirect-privs into default


diffs (truncated from 13366 to 300 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
@@ -9513,7 +9513,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","alter_seq","pattern sqlcatalog.alter_seq(X_1:str, 
X_2:str, X_3:ptr, X_4:lng):void ",   "SQLalter_seq;",""  ]
 [ "sqlcatalog","alter_set_table",  "pattern 
sqlcatalog.alter_set_table(X_1:str, X_2:str, X_3:int):void ",  
"SQLalter_set_table;",  ""  ]
 [ "sqlcatalog","alter_table",  "pattern 
sqlcatalog.alter_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ", 
"SQLalter_table;",  ""  ]
-[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str):void ", "SQLalter_user;",   ""  
]
+[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str, X_6:str):void ","SQLalter_user;",   
""  ]
 [ "sqlcatalog","comment_on",   "pattern sqlcatalog.comment_on(X_1:int, 
X_2:str):void ","SQLcomment_on;",   ""  ]
 [ "sqlcatalog","create_function",  "pattern 
sqlcatalog.create_function(X_1:str, X_2:str, X_3:ptr):void ",  
"SQLcreate_function;",  ""  ]
 [ "sqlcatalog","create_role",  "pattern 
sqlcatalog.create_role(X_1:str, X_2:str, X_3:int):void ",  
"SQLcreate_role;",  ""  ]
@@ -9522,7 +9522,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","create_table", "pattern 
sqlcatalog.create_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ",
"SQLcreate_table;", ""  ]
 [ "sqlcatalog","create_trigger",   "pattern 
sqlcatalog.create_trigger(X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int, 
X_7:str, X_8:str, X_9:str, X_10:str):void ",   "SQLcreate_trigger;",   ""  ]
 [ "sqlcatalog","create_type",  "pattern 
sqlcatalog.create_type(X_1:str, X_2:str, X_3:str):void ",  
"SQLcreate_type;",  ""  ]
-[ "sqlcatalog","create_user",  "pattern 
sqlcatalog.create_user(X_1:str, X_2:str, X_3:int, X_4:str, X_5:str):void ",
"SQLcreate_user;",  ""  ]
+[ "sqlcatalog","create_user",  "pattern 
sqlcatalog.create_user(X_1:str, X_2:str, X_3:int, X_4:str, X_5:str, 
X_6:str):void ",   "SQLcreate_user;",  ""  ]
 [ "sqlcatalog","create_view",  "pattern 
sqlcatalog.create_view(X_1:str, X_2:str, X_3:ptr, X_4:int):void ", 
"SQLcreate_view;",  ""  ]
 [ "sqlcatalog","drop_constraint",  "pattern 
sqlcatalog.drop_constraint(X_1:str, X_2:str, X_3:int, X_4:int):void ", 
"SQLdrop_constraint;",  ""  ]
 [ "sqlcatalog","drop_function","pattern 
sqlcatalog.drop_function(X_1:str, X_2:str, X_3:int, X_4:int, X_5:int):void ",  
"SQLdrop_function;",""  ]
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
@@ -12836,7 +12836,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","alter_seq","pattern sqlcatalog.alter_seq(X_1:str, 
X_2:str, X_3:ptr, X_4:lng):void ",   "SQLalter_seq;",""  ]
 [ "sqlcatalog","alter_set_table",  "pattern 
sqlcatalog.alter_set_table(X_1:str, X_2:str, X_3:int):void ",  
"SQLalter_set_table;",  ""  ]
 [ "sqlcatalog","alter_table",  "pattern 
sqlcatalog.alter_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ", 
"SQLalter_table;",  ""  ]
-[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str):void ", "SQLalter_user;",   ""  
]
+[ "sqlcatalog","alter_user",   "pattern sqlcatalog.alter_user(X_1:str, 
X_2:str, X_3:int, X_4:str, X_5:str, X_6:str):void ","SQLalter_user;",   
""  ]
 [ "sqlcatalog","comment_on",   "pattern sqlcatalog.comment_on(X_1:int, 
X_2:str):void ","SQLcomment_on;",   ""  ]
 [ "sqlcatalog","create_function",  "pattern 
sqlcatalog.create_function(X_1:str, X_2:str, X_3:ptr):void ",  
"SQLcreate_function;",  ""  ]
 [ "sqlcatalog","create_role",  "pattern 
sqlcatalog.create_role(X_1:str, X_2:str, X_3:int):void ",  
"SQLcreate_role;",  ""  ]
@@ -12845,7 +12845,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog","create_table", "pattern 
sqlcatalog.create_table(X_1:str, X_2:str, X_3:ptr, X_4:int):void ",
"SQLcreate_table;", ""  ]
 [ "sqlcatalog","create_trigger",   "pattern 
sqlcatalog.create_trigger(X_1:str, X_2:str, X_3:str, X_4:int, 

MonetDB: indirect-privs - Merged with default

2020-12-22 Thread Pedro Ferreira
Changeset: 94068363dd5b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=94068363dd5b
Modified Files:
sql/backends/monet5/sql_user.c
sql/test/Users/Tests/All
sql/test/Users/Tests/userCallFunction.SQL.py
Branch: indirect-privs
Log Message:

Merged with default


diffs (truncated from 1050 to 300 lines):

diff --git a/documentation/source/developers_handbook.rst 
b/documentation/source/developers_handbook.rst
--- a/documentation/source/developers_handbook.rst
+++ b/documentation/source/developers_handbook.rst
@@ -69,20 +69,35 @@ directory where they reside::
   [$src_root/sql/test/json/Tests]$ Mtest.py .
 
 
-Adding a new test
+Adding sqllogic test
 -
 
-Summarizing the above discussion, to add a new test, you need to write the test
-itself, create the stable output and error files, and finally add the test to 
the
-``All`` index. This will make ensure that the test will be picked up by
-``Mtest.py`` as part of its group.
+See ``_ for detail 
information 
+on how to structure sqllogic test if you desire to make one by hand. We have 
extended the 
+sqllogic protocol a bit further::
+
+skipif 
+onlyif 
 
-To create the correct stable output you can use the ``Mapprove.py`` utility.
-First create empty ``.stable.{out,err}`` files and run the test using
-``Mtest.py``. Check the output and if it is correct, run ``Mapprove.py`` with
-the same arguments. This will add the correct contents to the
-``.stable.{out,err}`` files. Commit the changes to the VCS and the test can now
-be used by other developers and the nightly testing infrastructure.
+statement (ok|ok rowcount|error) [arg]
+query (I|T|R)+ (nosort|rowsort|valuesort|python)? [arg]
+  I: integer; T: text (string); R: real (decimal)
+  nosort: do not sort
+  rowsort: sort rows
+  valuesort: sort individual values
+  python some.python.function: run data through function (MonetDB 
extension)
+hash-threshold number
+halt
+
+Alternatively ``.sql`` scripts can be converted to sqllogic tests (.test) with 
``Mconvert.py``.
+For example::
+
+$Mconvert.py  --auto /Tests .sql
+
+All new tests need to be placed in the appropriate test folder and their name 
respectively in the
+index ``All`` file.
 
 Python tests API
 
+
+See many of the examples in ``sql/test/Users/Tests``.
diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c
--- a/sql/backends/monet5/sql_user.c
+++ b/sql/backends/monet5/sql_user.c
@@ -35,7 +35,10 @@ monet5_drop_user(ptr _mvc, str user)
str err;
Client c = MCgetClient(m->clientid);
 
+   int grant_user = c->user;
+   c->user = MAL_ADMIN;
err = AUTHremoveUser(c, user);
+   c->user = grant_user;
if (err !=MAL_SUCCEED) {
(void) sql_error(m, 02, "DROP USER: %s", 
getExceptionMessage(err));
_DELETE(err);
@@ -161,7 +164,10 @@ monet5_create_user(ptr _mvc, str user, s
pwd = passwd;
}
/* add the user to the M5 authorisation administration */
+   int grant_user = c->user;
+   c->user = MAL_ADMIN;
ret = AUTHaddUser(, c, user, pwd);
+   c->user = grant_user;
if (!enc)
free(pwd);
if (ret != MAL_SUCCEED)
diff --git a/sql/jdbc/tests/Tests/All b/sql/jdbc/tests/Tests/All
--- a/sql/jdbc/tests/Tests/All
+++ b/sql/jdbc/tests/Tests/All
@@ -1,39 +1,10 @@
 HAVE_JDBCTESTS?JDBC_API_Tester
 HAVE_JDBCTESTS?SQLcopyinto
-HAVE_JDBCTESTS?Test_Cautocommit
-HAVE_JDBCTESTS?Test_CisValid
-HAVE_JDBCTESTS?Test_Clargequery
-HAVE_JDBCTESTS?Test_Cmanycon
-HAVE_JDBCTESTS?Test_Creplysize
-HAVE_JDBCTESTS?Test_Csavepoints
 #HAVE_JDBCTESTS?Test_Csendthread  # unfortunately has runtime-dependant output
-HAVE_JDBCTESTS?Test_Ctransaction
-HAVE_JDBCTESTS?Test_Dobjects
-HAVE_JDBCTESTS?Test_FetchSize
 HAVE_JDBCTESTS_HGE?Test_Int128
 HAVE_JDBCCLIENT_JAR?Test_JdbcClient
 HAVE_JDBCCLIENT_JAR?bogus-auto-generated-keys
-HAVE_JDBCTESTS?Test_PSgeneratedkeys
-HAVE_JDBCTESTS?Test_PSgetObject
-HAVE_JDBCTESTS?Test_PSlargebatchval
-HAVE_JDBCTESTS?Test_PSlargeresponse
 #HAVE_JDBCTESTS?Test_PSlargeamount # scalabity test which is disabled by 
default (it takes a long time to run and does not need to be run everytime, 
only before a new release)
-HAVE_JDBCTESTS?Test_PSmanycon
-HAVE_JDBCTESTS?Test_PSmetadata
-HAVE_JDBCTESTS?Test_PSsomeamount
-HAVE_JDBCTESTS?Test_PSsqldata
-HAVE_JDBCTESTS?Test_PStimedate
-HAVE_JDBCTESTS?Test_PStimezone
-HAVE_JDBCTESTS?Test_PStypes
-HAVE_JDBCTESTS?Test_CallableStmt
-HAVE_JDBCTESTS?Test_Rbooleans
-HAVE_JDBCTESTS?Test_Rmetadata
-HAVE_JDBCTESTS?Test_Rpositioning
-HAVE_JDBCTESTS?Test_Rsqldata
-HAVE_JDBCTESTS?Test_Rtimedate
-HAVE_JDBCTESTS?Test_Sbatching
-HAVE_JDBCTESTS?Test_Smoreresults
-HAVE_JDBCTESTS?Test_Wrapper
 HAVE_JDBCTESTS?BugConcurrent_clients_SF_1504657
 HAVE_JDBCTESTS?BugConcurrent_sequences