Changeset: b0b0a5cfd24f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b0b0a5cfd24f Modified Files: NT/makelibdef.py NT/mkodbcwxs.py NT/mksqlwxs.py NT/winconfig.py buildtools/autogen/autogen.py buildtools/autogen/autogen/am.py buildtools/autogen/autogen/codegen.py buildtools/autogen/autogen/msc.py buildtools/conf/fixlicense.py clients/examples/python/basics.py clients/examples/python/sqlsample.py clients/mapiclient/dotfile.py monetdb5/tools/Tests/mserver5-ipv6.py sql/backends/monet5/Tests/dbextra_lock_test.py sql/backends/monet5/Tests/shutdown.py sql/benchmarks/hist-uva/ground/create.py sql/benchmarks/ssbm/Tests/explain.SQL.py sql/benchmarks/ssbm/Tests/load.SQL.py sql/benchmarks/ssbm/Tests/plan.SQL.py sql/benchmarks/tpch/LOCKED/Tests/load.SQL.py sql/benchmarks/tpch/Tests/explain.SQL.py sql/benchmarks/tpch/Tests/load.SQL.py sql/benchmarks/tpch/Tests/plan.SQL.py sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.SQL.py sql/test/BugTracker-2008/Tests/insert-null-byte.SF-2233581.SQL.py sql/test/BugTracker-2009/Tests/create_on_ro_db_crash.SF-2830238.SQL.py sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908.SQL.py sql/test/BugTracker-2009/Tests/lost_update.SF-2790020.SQL.py sql/test/BugTracker-2009/Tests/parallel_bulk-load.SF-2771052.unpack_csv.py sql/test/BugTracker-2009/Tests/set_history_and_drop_table.SF-2607045.SQL.py sql/test/BugTracker-2010/Tests/new-readonly-db.Bug-2695.SQL.py sql/test/BugTracker-2010/Tests/operation-successful.Bug-2589.SQL.py sql/test/BugTracker-2011/Tests/interrupted-initialization.Bug-2875.SQL.py sql/test/BugTracker-2011/Tests/many-connects-cache.Bug-2904.SQL.py sql/test/BugTracker-2011/Tests/python-connections-Bug.2901.SQL.py sql/test/BugTracker-2011/Tests/user_create_temp_table.Bug-2916.SQL.py sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.SQL.py sql/test/BugTracker-2012/Tests/day-of-month-localization.Bug-2962.SQL.py sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.SQL.py sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.stable.err sql/test/BugTracker-2013/Tests/corrupt-after-restart.Bug-3282.SQL.py sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py sql/test/BugTracker-2013/Tests/psm_functions_and_accessrights.Bug-3300.SQL.py sql/test/BugTracker-2014/Tests/acidity-fail.Bug-3635.py sql/test/BugTracker-2014/Tests/copy-into.Bug-3481.SQL.py sql/test/BugTracker-2014/Tests/python-microseconds.Bug-3439.SQL.py sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.SQL.py sql/test/BugTracker-2015/Tests/concurrent-queries.Bug-3848.SQL.py sql/test/BugTracker-2015/Tests/local-remotetable-crash.Bug-3754.SQL.py sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py sql/test/BugTracker-2017/Tests/shutdown.Bug-6182.SQL.py sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.SQL.py sql/test/BugTracker-2018/Tests/grant-role-not-idempotent.Bug-6660.SQL.py sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.py sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.py sql/test/BugTracker-2018/Tests/remote-table-where-not-equal.Bug-6621.py sql/test/BugTracker-2019/Tests/alter_table_drop_column.Bug-6749.py sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.py sql/test/BugTracker-2019/Tests/msqldump-mapi-cache.Bug-6777.py sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.py sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py sql/test/BugTracker-2020/Tests/alter-table-add-column.Bug-6816.py sql/test/BugTracker-2020/Tests/functions-not-persist.Bug-6819.SQL.py sql/test/BugTracker/Tests/auto_commit.SF-1724151.SQL.py sql/test/BugTracker/Tests/connect_crash.SF-1436626.SQL.py sql/test/BugTracker/Tests/local_temp_table.SF-1865953.SQL.py sql/test/BugTracker/Tests/mdb_starts_with_sql_debug_64.SF-1999354.SQL.py sql/test/BugTracker/Tests/python_escape.SF-1916844.SQL.py sql/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.SQL.py sql/test/BugTracker/Tests/set_sql_debug_64__breaking_the_DB.SF-1906287.SQL.py sql/test/Dependencies/Tests/Dependencies.SQL.py sql/test/Dump/Tests/dump-again.SQL.py sql/test/Dump/Tests/dump.SQL.py sql/test/Dump/Tests/reload-again.SQL.py sql/test/Dump/Tests/reload.SQL.py sql/test/Skyserver/Tests/Skyserver.SQL.py sql/test/Skyserver/Tests/Skyserver_v6.SQL.py sql/test/Tests/comment-auth.SQL.py sql/test/Tests/comment-dump.SQL.py sql/test/Tests/hot-snapshot.py sql/test/Tests/like_tests.SQL.py sql/test/Tests/null-byte-hang.SQL.py sql/test/Tests/zones2.SQL.py sql/test/Triggers/Tests/trigger_owner.SQL.py sql/test/UserDump/Tests/create.SQL.py sql/test/Users/Tests/changePasswordUser.SQL.py sql/test/Users/Tests/changeSchemaUser.SQL.py sql/test/Users/Tests/columnRights.SQL.py sql/test/Users/Tests/copyinto.SQL.py sql/test/Users/Tests/dropManyUsers.Bug-3764.SQL.py sql/test/Users/Tests/grantAndRevokeUserLoggedIN.Bug-3476.SQL.py sql/test/Users/Tests/grantMonetdb.SQL.py sql/test/Users/Tests/grantMonetdbToRegularUser.Bug-3771.SQL.py sql/test/Users/Tests/grantMonetdbToSchemaOwner.Bug-3771.SQL.py sql/test/Users/Tests/grantPrivilegesNonDefaultRole.Bug-3365.SQL.py sql/test/Users/Tests/grantRevokeAndGrantAgain.Bug-3765.SQL.py sql/test/Users/Tests/grantRole.Bug-3772.SQL.py sql/test/Users/Tests/renameUser.SQL.py sql/test/Users/Tests/role.SQL.py sql/test/Users/Tests/role1.SQL.py sql/test/Users/Tests/role2.SQL.py sql/test/Users/Tests/schemaRights.SQL.py sql/test/Users/Tests/table.SQL.py sql/test/Users/Tests/test_privs2_p1.SQL.py sql/test/Users/Tests/test_privs2_p2.SQL.py sql/test/Users/Tests/test_privs_p1.SQL.py sql/test/Users/Tests/test_privs_p2.SQL.py sql/test/Users/Tests/unknown_user.SQL.py sql/test/Users/Tests/withGrantOption.SQL.py sql/test/VOC/Tests/VOC.SQL.py sql/test/Views/Tests/Views.SQL.py sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py sql/test/concurrent/Tests/simple_select.SQL.py sql/test/emptydb-upgrade-chain-hge/Tests/package.py sql/test/emptydb-upgrade-chain/Tests/package.py sql/test/emptydb/Tests/check.SQL.py sql/test/emptydb/Tests/package-hge.py sql/test/emptydb/Tests/package.py sql/test/malloc_fail/Tests/mallocs.SQL.py sql/test/mapi/Tests/python_dec38.py sql/test/mapi/Tests/python_int128.py sql/test/mapi/Tests/utf8test.SQL.py sql/test/merge-partitions/Tests/mergepart23.SQL.py sql/test/merge-partitions/Tests/mergepart29.SQL.py sql/test/miscellaneous/Tests/pk_fk_stress.SQL.py sql/test/miscellaneous/Tests/table_udf_missing_var.py sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-view.py sql/test/remote/Tests/creds.SQL.py sql/test/remote/Tests/different_user.SQL.py sql/test/remote/Tests/invalid_creds.SQL.py sql/test/remote/Tests/ssbm.SQL.py sql/test/rename/Tests/rename00.SQL.py sql/test/rename/Tests/rename11.py sql/test/scripts/Tests/alastair_udf_mergetable_bug.py sql/test/scripts/Tests/copy-from-lz4.py sql/test/testdb-reload/Tests/reload.py sql/test/testdb-upgrade-chain-hge/Tests/package.py sql/test/testdb-upgrade-chain/Tests/package.py sql/test/testdb-upgrade/Tests/upgrade.SQL.py sql/test/testdb/Tests/package-hge.py sql/test/testdb/Tests/package.py sql/test/wlcr/Tests/wlc01.py sql/test/wlcr/Tests/wlc100.py sql/test/wlcr/Tests/wlc20.py sql/test/wlcr/Tests/wlc21.py sql/test/wlcr/Tests/wlc30.py sql/test/wlcr/Tests/wlc40.py sql/test/wlcr/Tests/wlc50.py sql/test/wlcr/Tests/wlc70.py sql/test/wlcr/Tests/wlc80.py sql/test/wlcr/Tests/wlcr00.py sql/test/wlcr/Tests/wlr01.py sql/test/wlcr/Tests/wlr10.py sql/test/wlcr/Tests/wlr100.py sql/test/wlcr/Tests/wlr110.py sql/test/wlcr/Tests/wlr20.py sql/test/wlcr/Tests/wlr30.py sql/test/wlcr/Tests/wlr35.py sql/test/wlcr/Tests/wlr40.py sql/test/wlcr/Tests/wlr50.py sql/test/wlcr/Tests/wlr70.py sql/test/wlcr/Tests/wlr80.py testing/Mfilter.py testing/cmptests.py testing/malcheck.py testing/process.py tools/merovingian/client/Tests/monetdb_status.py Branch: default Log Message:
Merge with Jun2020 branch. diffs (truncated from 7572 to 300 lines): diff --git a/NT/makelibdef.py b/NT/makelibdef.py --- a/NT/makelibdef.py +++ b/NT/makelibdef.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import fileinput, re p = re.compile('^\s*\d+\s+[0-9A-F]+\s+[0-9A-F]+\s+(\w+)') print('LIBRARY R') diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py --- a/NT/mkodbcwxs.py +++ b/NT/mkodbcwxs.py @@ -1,5 +1,3 @@ -from __future__ import print_function - # python mkodbcwxs.py VERSION makedefs.txt PREFIX > PREFIX/MonetDB-ODBC-Installer.wxs # "c:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe" -nologo -arch x64/x86 PREFIX/MonetDB-ODBC-Installer.wxs # "c:\Program Files (x86)\WiX Toolset v3.10\bin\light.exe" -nologo -sice:ICE03 -sice:ICE60 -sice:ICE82 -ext WixUIExtension PREFIX/MonetDB-ODBC-Installer.wixobj diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py --- a/NT/mksqlwxs.py +++ b/NT/mksqlwxs.py @@ -1,5 +1,3 @@ -from __future__ import print_function - # python mksqlwxs.py VERSION makedefs.txt PREFIX > PREFIX/MonetDB5-SQL-Installer.wxs # "c:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe" -nologo -arch x64/x86 PREFIX/MonetDB5-SQL-Installer.wxs # "c:\Program Files (x86)\WiX Toolset v3.10\bin\light.exe" -nologo -sice:ICE03 -sice:ICE60 -sice:ICE82 -ext WixUIExtension PREFIX/MonetDB5-SQL-Installer.wixobj diff --git a/NT/winconfig.py b/NT/winconfig.py --- a/NT/winconfig.py +++ b/NT/winconfig.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # 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 diff --git a/buildtools/autogen/autogen.py b/buildtools/autogen/autogen.py --- a/buildtools/autogen/autogen.py +++ b/buildtools/autogen/autogen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # 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 @@ -6,8 +6,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. -from __future__ import print_function - # # autogen scans the makefile.ag # and generates both the makefile.am and makefile.msc diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py --- a/buildtools/autogen/autogen/am.py +++ b/buildtools/autogen/autogen/am.py @@ -4,8 +4,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. -from __future__ import print_function - import os import posixpath import sys diff --git a/buildtools/autogen/autogen/codegen.py b/buildtools/autogen/autogen/codegen.py --- a/buildtools/autogen/autogen/codegen.py +++ b/buildtools/autogen/autogen/codegen.py @@ -4,8 +4,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. -from __future__ import print_function - import string import re import fileinput diff --git a/buildtools/autogen/autogen/msc.py b/buildtools/autogen/autogen/msc.py --- a/buildtools/autogen/autogen/msc.py +++ b/buildtools/autogen/autogen/msc.py @@ -4,8 +4,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. -from __future__ import print_function - import string import os import re diff --git a/buildtools/conf/fixlicense.py b/buildtools/conf/fixlicense.py --- a/buildtools/conf/fixlicense.py +++ b/buildtools/conf/fixlicense.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # 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 @@ -6,8 +6,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. -from __future__ import print_function - import os, sys, getopt, stat usage = '''\ diff --git a/clients/examples/python/basics.py b/clients/examples/python/basics.py --- a/clients/examples/python/basics.py +++ b/clients/examples/python/basics.py @@ -4,8 +4,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. -from __future__ import print_function - import logging #configure the logger, so we can see what is happening diff --git a/clients/examples/python/sqlsample.py b/clients/examples/python/sqlsample.py --- a/clients/examples/python/sqlsample.py +++ b/clients/examples/python/sqlsample.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # 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 @@ -6,8 +6,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. -from __future__ import print_function - import pymonetdb import sys diff --git a/clients/mapiclient/dotfile.py b/clients/mapiclient/dotfile.py --- a/clients/mapiclient/dotfile.py +++ b/clients/mapiclient/dotfile.py @@ -4,8 +4,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. -from __future__ import print_function - ''' The output of the Stethoscope can be saved in JSON format using the -j flag. This program converts such a Stethoscope output file into a .dot file diff --git a/monetdb5/tools/Tests/mserver5-ipv6.py b/monetdb5/tools/Tests/mserver5-ipv6.py --- a/monetdb5/tools/Tests/mserver5-ipv6.py +++ b/monetdb5/tools/Tests/mserver5-ipv6.py @@ -4,11 +4,12 @@ try: except ImportError: import process -server = None -try: - server = process.server(stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE, ipv6=True) - client = process.client('sql', host='::1', server=server, stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE) - cout, cerr = client.communicate(''' +with process.server(stdin=process.PIPE, stdout=process.PIPE, + stderr=process.PIPE, ipv6=True) as server: + with process.client('sql', host='::1', server=server, + stdin=process.PIPE, stdout=process.PIPE, + stderr=process.PIPE) as client: + cout, cerr = client.communicate(''' start transaction; create table "things" ("col1" int); insert into "things" values (1); select "col1" from "things"; @@ -16,12 +17,8 @@ rollback; ''') sout, serr = server.communicate() - server = None sys.stdout.write(sout) sys.stderr.write(serr) sys.stdout.write(cout) sys.stderr.write(cerr) -finally: - if server is not None: - server.terminate() diff --git a/sql/backends/monet5/Tests/dbextra_lock_test.py b/sql/backends/monet5/Tests/dbextra_lock_test.py --- a/sql/backends/monet5/Tests/dbextra_lock_test.py +++ b/sql/backends/monet5/Tests/dbextra_lock_test.py @@ -8,22 +8,14 @@ import os p = os.path.join(os.getenv('GDK_DBFARM'), 'transient_dir') -s1 = s2 = None -try: - s1 = process.server(stdin = process.PIPE, stdout = process.PIPE, - stderr = process.PIPE, dbextra=p) - s2 = process.server(stdin = process.PIPE, stdout = process.PIPE, - stderr = process.PIPE, dbextra=p) +with process.server(stdin=process.PIPE, stdout=process.PIPE, + stderr=process.PIPE, dbextra=p) as s1: + with process.server(stdin=process.PIPE, stdout=process.PIPE, + stderr=process.PIPE, dbextra=p) as s2: + out, err = s1.communicate() + sys.stdout.write(out) + sys.stderr.write(err) - out, err = s1.communicate() - sys.stdout.write(out) - sys.stderr.write(err) - - out, err = s2.communicate() - sys.stdout.write(out) - sys.stderr.write(err) -finally: - if s1 is not None: - s1.terminate() - if s2 is not None: - s2.terminate() + out, err = s2.communicate() + sys.stdout.write(out) + sys.stderr.write(err) diff --git a/sql/backends/monet5/Tests/shutdown.py b/sql/backends/monet5/Tests/shutdown.py --- a/sql/backends/monet5/Tests/shutdown.py +++ b/sql/backends/monet5/Tests/shutdown.py @@ -7,9 +7,10 @@ if databasedir == None: exit() databasedir = os.path.join(databasedir, 'SHUTDOWN_DATABASE') -if os.name == 'nt': - os.system('shutdowntest.exe "%s"' % databasedir) -else: - os.system('Mlog -x shutdowntest "%s"' % databasedir) - -shutil.rmtree(databasedir) +try: + if os.name == 'nt': + os.system('shutdowntest.exe "%s"' % databasedir) + else: + os.system('Mlog -x shutdowntest "%s"' % databasedir) +finally: + shutil.rmtree(databasedir) diff --git a/sql/benchmarks/hist-uva/ground/create.py b/sql/benchmarks/hist-uva/ground/create.py --- a/sql/benchmarks/hist-uva/ground/create.py +++ b/sql/benchmarks/hist-uva/ground/create.py @@ -1,5 +1,3 @@ -from __future__ import print_function - print('create table histogram256_tab (') for i in range(1,256): print('\tBIN%d NUMBER NOT NULL,' % i) diff --git a/sql/benchmarks/ssbm/Tests/explain.SQL.py b/sql/benchmarks/ssbm/Tests/explain.SQL.py --- a/sql/benchmarks/ssbm/Tests/explain.SQL.py +++ b/sql/benchmarks/ssbm/Tests/explain.SQL.py @@ -6,11 +6,11 @@ except ImportError: TSTSRCDIR = os.environ['TSTSRCDIR'] -c = process.client('sql', stdin = process.PIPE, stdout = process.PIPE, stderr = process.PIPE) -c.stdin.write("set optimizer = 'sequential_pipe';\n") -c.stdin.write('explain\n') -for ln in open(os.path.join(TSTSRCDIR,"%s.sql" % os.environ['TST'][0:2])): - c.stdin.write(ln) -out, err = c.communicate() -sys.stdout.write(out) -sys.stderr.write(err) +with process.client('sql', stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE) as c: + c.stdin.write("set optimizer = 'sequential_pipe';\n") + c.stdin.write('explain\n') + for ln in open(os.path.join(TSTSRCDIR,"%s.sql" % os.environ['TST'][0:2])): + c.stdin.write(ln) + out, err = c.communicate() + sys.stdout.write(out) + sys.stderr.write(err) diff --git a/sql/benchmarks/ssbm/Tests/load.SQL.py b/sql/benchmarks/ssbm/Tests/load.SQL.py --- a/sql/benchmarks/ssbm/Tests/load.SQL.py +++ b/sql/benchmarks/ssbm/Tests/load.SQL.py @@ -7,14 +7,14 @@ except ImportError: TSTSRCDIR = os.environ['TSTSRCDIR'] DATADIR = (os.path.join(TSTSRCDIR,"SF-0.01") + os.sep).replace('\\', r'\\') -c = process.client('sql', stdin = process.PIPE, stdout = process.PIPE, stderr = process.PIPE) -for ln in open(os.path.join(TSTSRCDIR,"load-sf-0.01.sql")): - c.stdin.write(ln.replace('PWD/', DATADIR)) -out, err = c.communicate() -sys.stdout.write(out) -sys.stderr.write(err) +with process.client('sql', stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE) as c: + for ln in open(os.path.join(TSTSRCDIR,"load-sf-0.01.sql")): + c.stdin.write(ln.replace('PWD/', DATADIR)) + out, err = c.communicate() + sys.stdout.write(out) + sys.stderr.write(err) -c = process.client('sql', stdin = open(os.path.join(TSTSRCDIR,"check1.sql")), stdout = process.PIPE, stderr = process.PIPE) -out, err = c.communicate() -sys.stdout.write(out) -sys.stderr.write(err) +with process.client('sql', stdin=open(os.path.join(TSTSRCDIR,"check1.sql")), stdout=process.PIPE, stderr=process.PIPE) as c: + out, err = c.communicate() + sys.stdout.write(out) + sys.stderr.write(err) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list