Changeset: 4bbc0c6ff06d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4bbc0c6ff06d
Modified Files:
clients/examples/C/bincopydata.c
sql/test/bincopy/Tests/bincopy_support.py
Branch: copyfaster
Log Message:
Make bincopy string data more repetitive so we can test backref encoding
diffs (54 lines):
diff --git a/clients/examples/C/bincopydata.c b/clients/examples/C/bincopydata.c
--- a/clients/examples/C/bincopydata.c
+++ b/clients/examples/C/bincopydata.c
@@ -164,7 +164,8 @@ gen_strings(FILE *f, bool byteswap, long
(void)arg;
(void)byteswap;
for (long i = 0; i < nrecs; i++) {
- fprintf(f, "int%ld", i);
+ long ii = i % 987;
+ fprintf(f, "int%ld", ii);
fputc(0, f);
}
}
@@ -177,7 +178,8 @@ gen_large_strings(FILE *f, bool byteswap
char *buf = malloc(n);
memset(buf, 'a', n);
for (long i = 0; i < nrecs; i++) {
- fprintf(f, "int%06ld", i);
+ long ii = i % 987;
+ fprintf(f, "int%06ld", ii);
if (i % 10000 == 0)
fwrite(buf, n, 1, f);
fputc(0, f);
@@ -209,7 +211,8 @@ gen_newline_strings(FILE *f, bool bytesw
(void)arg;
(void)byteswap;
for (long i = 0; i < nrecs; i++) {
- fprintf(f, "RN\r\nR\r%ld", i);
+ long ii = i % 987;
+ fprintf(f, "RN\r\nR\r%ld", ii);
fputc(0, f);
}
}
diff --git a/sql/test/bincopy/Tests/bincopy_support.py
b/sql/test/bincopy/Tests/bincopy_support.py
--- a/sql/test/bincopy/Tests/bincopy_support.py
+++ b/sql/test/bincopy/Tests/bincopy_support.py
@@ -148,7 +148,7 @@ STRINGS = ("""
CREATE TABLE foo(id INT NOT NULL, s VARCHAR(20));
COPY BINARY INTO foo(id, s) FROM @ints@, @strings@ @ON@;
COPY SELECT id, s FROM foo INTO BINARY @>ints@, @>strings@ @ON@;
-SELECT COUNT(id) FROM foo WHERE s = ('int' || id);
+SELECT COUNT(id) FROM foo WHERE s = ('int' || id % 987);
""", [f"{NRECS}"])
NULL_INTS = ("""
@@ -179,7 +179,7 @@ COPY BINARY INTO foo(id, s) FROM @ints@,
NEWLINE_STRINGS = (r"""
CREATE TABLE foo(id INT NOT NULL, s TEXT);
COPY BINARY INTO foo(id, s) FROM @ints@, @newline_strings@ @ON@;
-SELECT COUNT(id) FROM foo WHERE s = (E'RN\r\nR\r' || id);
+SELECT COUNT(id) FROM foo WHERE s = (E'RN\r\nR\r' || id % 987);
""", [f"{NRECS}"])
NULL_STRINGS = ("""
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]