Changeset: 939324b355a4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/939324b355a4
Added Files:
        
sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.csv.gz
        
sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.test.in
Removed Files:
        sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.test
Branch: default
Log Message:

Create improved COPY OFFSET test  (#8093)


diffs (153 lines):

diff --git 
a/sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.csv.gz 
b/sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.csv.gz
new file mode 100644
index 
0000000000000000000000000000000000000000..d0076bd21f8d9bd8bec14fe1cc5d8fe69afe2900
GIT binary patch
literal 823
zc$|~(=HNIqk1v~vxkN9yxQyZLg@ud^3IazA&YPHDy?y)s!bZW4j+Hr+rk>v7&&)8A
j!9TOL`~&TV0R;yVqvQwL4Fd`uBumeEntg$RfrkMA|6Urd

diff --git 
a/sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.test 
b/sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.test
deleted file mode 100644
--- a/sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.test
+++ /dev/null
@@ -1,37 +0,0 @@
-statement ok
-CALL sys.clearrejects();
-
-statement ok
-DROP TABLE IF EXISTS t; CREATE TABLE t(i INT);
-
-statement ok
-COPY 3 RECORDS INTO t FROM STDIN BEST EFFORT;
-<COPY_INTO_DATA>
-10
-20
-not_an_integer
-
-# the error is at row three of the input
-query I
-SELECT rowid FROM sys.rejects;
-----
-3
-
-statement ok
-CALL sys.clearrejects();
-
-# now skip the a row
-statement ok
-COPY 1 OFFSET 3 RECORDS INTO t FROM STDIN BEST EFFORT;
-<COPY_INTO_DATA>
-10
-20
-not_an_integer
-
-
-# the error should still be at row 3
-query I
-SELECT rowid FROM sys.rejects;
-----
-3
-
diff --git 
a/sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.test.in 
b/sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.test.in
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/8093-best-effort-offset-row-numbers.test.in
@@ -0,0 +1,98 @@
+# Test whether the rowid in the rejects table is affected by
+# the OFFSET clause of the COPY command.
+
+# file 8093-best-effort-offset-row-numbers.csv.gz
+# contains 196608 rows. Almost all rows are '000', but
+# rows 6, 65536+6=65542 and 2*65536+6=131078 are 'foo'.
+# Those will be rejected when loading into an INT column.
+#
+# The sizes have been chosen such that each error occurs on the
+# 6th line of a 256KiB block of the file. This means that
+# each error will be parsed by another pipeline worker so
+# we can verify that the workers coordinate the line numbers
+# correctly.
+
+statement ok
+DROP TABLE IF EXISTS t; CREATE TABLE t(i INT);
+
+statement ok
+CALL sys.clearrejects();
+
+
+
+# First copy the data without an offset, verify the locations of the errors
+
+statement ok
+COPY INTO t FROM '8093-best-effort-offset-row-numbers.csv.gz' ON CLIENT BEST 
EFFORT;
+
+query II
+SELECT rowid, rowid % 65536 FROM sys.rejects;
+----
+6
+6
+65542
+6
+131078
+6
+
+
+
+# From here on we try it with an OFFSET.
+# First, ON CLIENT
+
+statement ok
+CALL sys.clearrejects();
+
+statement ok
+COPY OFFSET 3 INTO t FROM '8093-best-effort-offset-row-numbers.csv.gz' ON 
CLIENT BEST EFFORT;
+
+query II
+SELECT rowid, rowid % 65536 FROM sys.rejects;
+----
+6
+6
+65542
+6
+131078
+6
+
+
+
+
+# Then, ON SERVER
+
+statement ok
+CALL sys.clearrejects();
+
+statement ok
+COPY OFFSET 3 INTO t FROM 
r'$TSTSRCDIR/8093-best-effort-offset-row-numbers.csv.gz' ON SERVER BEST EFFORT;
+
+query II
+SELECT rowid, rowid % 65536 FROM sys.rejects;
+----
+6
+6
+65542
+6
+131078
+6
+
+
+
+# Finally, we test FROM STDIN, with a smaller input size
+
+statement ok
+CALL sys.clearrejects();
+
+statement ok
+COPY 1 OFFSET 3 RECORDS INTO t FROM STDIN BEST EFFORT;
+<COPY_INTO_DATA>
+1
+2
+not_an_integer
+
+query I
+SELECT rowid FROM sys.rejects;
+----
+3
+
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to