Changeset: 6d88c5f2a2d5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d88c5f2a2d5
Added Files:
sql/test/BugTracker-2019/Tests/All
sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.sql
sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.stable.err
sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.stable.out
Modified Files:
monetdb5/mal/mal_import.c
monetdb5/modules/mal/tablet.c
Branch: Apr2019
Log Message:
Merge with Aug2018 branch.
diffs (194 lines):
diff --git a/monetdb5/mal/mal_import.c b/monetdb5/mal/mal_import.c
--- a/monetdb5/mal/mal_import.c
+++ b/monetdb5/mal/mal_import.c
@@ -266,7 +266,7 @@ evalFile(str fname, int listing)
if (fd == 0 || mnstr_errnr(fd) == MNSTR_OPEN_ERROR) {
if (fd)
close_stream(fd);
- throw(MAL,"mal.eval", "WARNING: could not open file\n");
+ throw(MAL,"mal.eval", "WARNING: could not open file '%s'\n",
fname);
}
c= MCinitClient((oid)0, bstream_create(fd, 128 * BLOCK),0);
diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -1224,7 +1224,7 @@ static void
SQLproducer(void *p)
{
READERtask *task = (READERtask *) p;
- int consoleinput = 0;
+ bool consoleinput = false;
int cur = 0; // buffer being filled
bool blocked[MAXBUFFERS] = { false };
bool ateof[MAXBUFFERS] = { false };
@@ -1247,7 +1247,7 @@ SQLproducer(void *p)
*s = 0;
task->cur = cur;
if (task->as->filename == NULL) {
- consoleinput = 1;
+ consoleinput = true;
goto parseSTDIN;
}
for (;;) {
@@ -1316,7 +1316,7 @@ SQLproducer(void *p)
* scan ended (we need to back off some since we could be in
* the middle of the record separator). If this is too
* costly, we have to rethink the matter. */
- if (task->from_stdin && *s == '\n' && task->maxrow == BUN_NONE)
{
+ if (task->from_stdin && *s == '\n' && task->maxrow == BUN_MAX) {
ateof[cur] = true;
goto reportlackofinput;
}
diff --git a/sql/test/BugTracker-2019/Tests/All
b/sql/test/BugTracker-2019/Tests/All
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -0,0 +1,1 @@
+copy-into-from-stdin-empty-line.Bug-67999
diff --git
a/sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.sql
b/sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.sql
new file mode 100644
--- /dev/null
+++
b/sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.sql
@@ -0,0 +1,10 @@
+start transaction;
+
+create table foo (bar int, baz varchar(10));
+copy into foo from stdin delimiters ',', '\n', '''';
+5,'aa5aa'
+0,'aa0aa'
+
+-- empty line above ends input for COPY INTO
+select * from foo;
+rollback;
diff --git
a/sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.stable.err
b/sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.stable.err
new file mode 100644
--- /dev/null
+++
b/sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'copy-into-from-stdin-empty-line.Bug-67999` in directory
'sql/test/BugTracker-2019` itself:
+
+
+# 16:08:07 >
+# 16:08:07 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"mapi_open=true" "--set" "mapi_port=31788" "--set"
"mapi_usock=/var/tmp/mtest-30054/.s.monetdb.31788" "--set" "monet_prompt="
"--forcemito"
"--dbpath=/ufs/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2019"
"--set" "embedded_c=true"
+# 16:08:07 >
+
+# builtin opt gdk_dbpath = /ufs/sjoerd/@Monet-stable/var/monetdb5/dbfarm/demo
+# builtin opt gdk_debug = 0
+# builtin opt gdk_vmtrim = no
+# builtin opt monet_prompt = >
+# builtin opt monet_daemon = no
+# builtin opt mapi_port = 50000
+# builtin opt mapi_open = false
+# builtin opt mapi_autosense = false
+# builtin opt sql_optimizer = default_pipe
+# builtin opt sql_debug = 0
+# cmdline opt gdk_nr_threads = 0
+# cmdline opt mapi_open = true
+# cmdline opt mapi_port = 31788
+# cmdline opt mapi_usock = /var/tmp/mtest-30054/.s.monetdb.31788
+# cmdline opt monet_prompt =
+# cmdline opt gdk_dbpath =
/ufs/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2019
+# cmdline opt embedded_c = true
+# cmdline opt gdk_debug = 553648138
+
+# 16:08:08 >
+# 16:08:08 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-30054" "--port=31788"
+# 16:08:08 >
+
+
+# 16:08:08 >
+# 16:08:08 > "Done."
+# 16:08:08 >
+
diff --git
a/sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.stable.out
b/sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.stable.out
new file mode 100644
--- /dev/null
+++
b/sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-67999.stable.out
@@ -0,0 +1,86 @@
+stdout of test 'copy-into-from-stdin-empty-line.Bug-67999` in directory
'sql/test/BugTracker-2019` itself:
+
+
+# 16:08:07 >
+# 16:08:07 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"mapi_open=true" "--set" "mapi_port=31788" "--set"
"mapi_usock=/var/tmp/mtest-30054/.s.monetdb.31788" "--set" "monet_prompt="
"--forcemito"
"--dbpath=/ufs/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2019"
"--set" "embedded_c=true"
+# 16:08:07 >
+
+# MonetDB 5 server v11.31.14 (hg id: 117117130c82+)
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2019', using 8 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
+# Found 62.694 GiB available main-memory.
+# 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://methuselah.da.cwi.nl:31788/
+# Listening for UNIX domain connection requests on
mapi:monetdb:///var/tmp/mtest-30054/.s.monetdb.31788
+# MonetDB/GIS module loaded
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.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_geom.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: 60_wlcr.sql
+# loading sql script: 72_fits.sql
+# loading sql script: 74_netcdf.sql
+# loading sql script: 75_lidar.sql
+# loading sql script: 75_shp.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: 85_bam.sql
+# loading sql script: 90_generator.sql
+# loading sql script: 90_generator_hge.sql
+# loading sql script: 99_system.sql
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 16:08:08 >
+# 16:08:08 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-30054" "--port=31788"
+# 16:08:08 >
+
+#start transaction;
+#create table foo (bar int, baz varchar(10));
+#copy into foo from stdin delimiters ',', '\n', '''';
+#5,'aa5aa'
+#0,'aa0aa'
+#
+[ 2 ]
+#select * from foo;
+% sys.foo, sys.foo # table_name
+% bar, baz # name
+% int, varchar # type
+% 1, 5 # length
+[ 5, "aa5aa" ]
+[ 0, "aa0aa" ]
+#rollback;
+
+# 16:08:08 >
+# 16:08:08 > "Done."
+# 16:08:08 >
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list