Changeset: 2ec5b40f8549 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2ec5b40f8549 Added Files: sql/test/miscellaneous/Tests/deallocate.sql sql/test/miscellaneous/Tests/deallocate.stable.err sql/test/miscellaneous/Tests/deallocate.stable.out Modified Files: clients/mapiclient/mclient.c Branch: default Log Message:
Fixed mclient TESTformatter cases and test approval diffs (202 lines): diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -2455,12 +2455,14 @@ doFile(Mapi mid, stream *fp, bool useins /* a bit of a hack for prepare/exec/dealloc * tests: replace "exec[ute] **" with the * ID of the last prepared statement */ - if (mode == SQL && - formatter == TESTformatter && - (strncasecmp(line, "exec **", 7) == 0 || - strncasecmp(line, "execute **", 10) == 0)) { - line[5] = prepno < 10 ? ' ' : prepno / 10 + '0'; - line[6] = prepno % 10 + '0'; + if (mode == SQL && formatter == TESTformatter) { + if (strncasecmp(line, "exec **", 7) == 0) { + line[5] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[6] = prepno % 10 + '0'; + } else if (strncasecmp(line, "execute **", 10) == 0) { + line[8] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[9] = prepno % 10 + '0'; + } } if (strncasecmp(line, "exit\n", 5) == 0) { goto bailout; @@ -2471,12 +2473,14 @@ doFile(Mapi mid, stream *fp, bool useins /* a bit of a hack for prepare/exec/dealloc * tests: replace "dealloc[ate] **" with the * ID of the last prepared statement */ - if (mode == SQL && - formatter == TESTformatter && - (strncasecmp(line, "dealloc **", 10) == 0 || - strncasecmp(line, "deallocate **", 13) == 0)) { - line[5] = prepno < 10 ? ' ' : prepno / 10 + '0'; - line[6] = prepno % 10 + '0'; + if (mode == SQL && formatter == TESTformatter) { + if (strncasecmp(line, "dealloc **", 10) == 0) { + line[8] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[9] = prepno % 10 + '0'; + } else if (strncasecmp(line, "deallocate **", 13) == 0) { + line[11] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[12] = prepno % 10 + '0'; + } } break; case 'q': diff --git a/sql/test/miscellaneous/Tests/deallocate.sql b/sql/test/miscellaneous/Tests/deallocate.sql new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/deallocate.sql @@ -0,0 +1,10 @@ +prepare select "system" or ? from _tables WHERE false; + +EXEC **(false); +dealloc **; +exec **(false); --error, the last prepared statement, no longer exists; + +prepare select "system" or ? from _tables WHERE false; +execute **(false); +DEALLOCATE prepare all; +EXECUTE **(false); --error, the last prepared statement, no longer exists; diff --git a/sql/test/miscellaneous/Tests/deallocate.stable.err b/sql/test/miscellaneous/Tests/deallocate.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/deallocate.stable.err @@ -0,0 +1,41 @@ +stderr of test 'deallocate` in directory 'sql/test/miscellaneous` itself: + + +# 13:56:29 > +# 13:56:29 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=35105" "--set" "mapi_usock=/var/tmp/mtest-170269/.s.monetdb.35105" "--forcemito" "--dbpath=/home/ferreira/repositories/MonetDB-default/BUILD/var/MonetDB/mTests_sql_test_miscellaneous" "--set" "embedded_c=true" +# 13:56:29 > + +# builtin opt gdk_dbpath = /home/ferreira/repositories/MonetDB-default/BUILD/var/monetdb5/dbfarm/demo +# builtin opt mapi_port = 50000 +# builtin opt mapi_open = false +# builtin opt mapi_ipv6 = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# builtin opt raw_strings = false +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 35105 +# cmdline opt mapi_usock = /var/tmp/mtest-170269/.s.monetdb.35105 +# cmdline opt gdk_dbpath = /home/ferreira/repositories/MonetDB-default/BUILD/var/MonetDB/mTests_sql_test_miscellaneous +# cmdline opt embedded_c = true +#client2:!ERROR:SQLException:EXEC:07003!No prepared statement with id: 3 +#client2:!ERROR:SQLException:EXEC:07003!No prepared statement with id: 5 + +# 13:56:29 > +# 13:56:29 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-170269" "--port=35105" +# 13:56:29 > + +MAPI = (monetdb) /var/tmp/mtest-170269/.s.monetdb.35105 +QUERY = exec 3(false); --error, the last prepared statement, no longer exists; +ERROR = !No prepared statement with id: 3 +CODE = 07003 +MAPI = (monetdb) /var/tmp/mtest-170269/.s.monetdb.35105 +QUERY = EXECUTE 5(false); --error, the last prepared statement, no longer exists; +ERROR = !No prepared statement with id: 5 +CODE = 07003 + +# 13:56:29 > +# 13:56:29 > "Done." +# 13:56:29 > + diff --git a/sql/test/miscellaneous/Tests/deallocate.stable.out b/sql/test/miscellaneous/Tests/deallocate.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/deallocate.stable.out @@ -0,0 +1,91 @@ +stdout of test 'deallocate` in directory 'sql/test/miscellaneous` itself: + + +# 13:56:29 > +# 13:56:29 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=35105" "--set" "mapi_usock=/var/tmp/mtest-170269/.s.monetdb.35105" "--forcemito" "--dbpath=/home/ferreira/repositories/MonetDB-default/BUILD/var/MonetDB/mTests_sql_test_miscellaneous" "--set" "embedded_c=true" +# 13:56:29 > + +# MonetDB 5 server v11.36.0 (hg id: 680b94cb09ab) +# This is an unreleased version +# Serving database 'mTests_sql_test_miscellaneous', using 8 threads +# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers +# Found 15.504 GiB available main-memory of which we use 12.635 GiB +# Copyright (c) 1993 - July 2008 CWI. +# Copyright (c) August 2008 - 2019 MonetDB B.V., all rights reserved +# Visit https://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://localhost.localdomain:35105/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-170269/.s.monetdb.35105 +# SQL catalog created, loading sql scripts once +# loading sql script: 09_like.sql +# loading sql script: 10_math.sql +# loading sql script: 12_url.sql +# loading sql script: 13_date.sql +# loading sql script: 14_inet.sql +# loading sql script: 15_querylog.sql +# loading sql script: 16_tracelog.sql +# loading sql script: 17_temporal.sql +# loading sql script: 18_index.sql +# loading sql script: 20_vacuum.sql +# loading sql script: 21_dependency_views.sql +# loading sql script: 22_clients.sql +# loading sql script: 23_skyserver.sql +# loading sql script: 25_debug.sql +# loading sql script: 26_sysmon.sql +# loading sql script: 27_rejects.sql +# loading sql script: 39_analytics.sql +# loading sql script: 39_analytics_hge.sql +# loading sql script: 40_json.sql +# loading sql script: 40_json_hge.sql +# loading sql script: 41_md5sum.sql +# loading sql script: 45_uuid.sql +# loading sql script: 46_profiler.sql +# loading sql script: 51_sys_schema_extension.sql +# loading sql script: 58_hot_snapshot.sql +# loading sql script: 60_wlcr.sql +# loading sql script: 61_wlcr.sql +# loading sql script: 75_storagemodel.sql +# loading sql script: 80_statistics.sql +# loading sql script: 80_udf.sql +# loading sql script: 80_udf_hge.sql +# loading sql script: 90_generator.sql +# loading sql script: 90_generator_hge.sql +# loading sql script: 99_system.sql +# MonetDB/SQL module loaded + +# 13:56:29 > +# 13:56:29 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-170269" "--port=35105" +# 13:56:29 > + +#prepare select "system" or ? from _tables WHERE false; +#prepare select "system" or ? from _tables WHERE false; +% .prepare, .prepare, .prepare, .prepare, .prepare, .prepare # table_name +% type, digits, scale, schema, table, column # name +% varchar, int, int, str, str, str # type +% 7, 1, 1, 0, 2, 2 # length +[ "boolean", 1, 0, "", "%1", "%1" ] +[ "boolean", 1, 0, NULL, NULL, NULL ] +#EXEC 3(false); +% sys. # table_name +% %1 # name +% boolean # type +% 5 # length +#dealloc 3; +#prepare select "system" or ? from _tables WHERE false; +#prepare select "system" or ? from _tables WHERE false; +% .prepare, .prepare, .prepare, .prepare, .prepare, .prepare # table_name +% type, digits, scale, schema, table, column # name +% varchar, int, int, str, str, str # type +% 7, 1, 1, 0, 2, 2 # length +[ "boolean", 1, 0, "", "%1", "%1" ] +[ "boolean", 1, 0, NULL, NULL, NULL ] +#execute 5(false); +% sys. # table_name +% %1 # name +% boolean # type +% 5 # length +#DEALLOCATE prepare all; + +# 13:56:29 > +# 13:56:29 > "Done." +# 13:56:29 > + _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list