File: csv_duck_fuzz.test

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (31 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# name: test/sql/copy/csv/csv_duck_fuzz.test
# description: Issues found from DuckFuzz regarding the CSV Reader
# group: [csv]

statement ok
PRAGMA enable_verification

# The important thing here is that we don't crash, some parameters accept null values (i.e., delimiter),
# and others will have different error messages, not making it possible to use a regex to test errors.

foreach parameter sep delim quote new_line escape nullstr columns auto_type_candidates header auto_detect sample_size all_varchar dateformat timestampformat normalize_names compression skip max_line_size maximum_line_size ignore_errors store_rejects rejects_table rejects_scan rejects_limit force_not_null buffer_size decimal_separator parallel null_padding allow_quoted_nulls column_types dtypes types names column_names comment encoding strict_mode

statement maybe
SELECT NULL FROM sniff_csv('{DATA_DIR}/csv/14512.csv', ${parameter} := NULL)
----

statement maybe
SELECT NULL FROM read_csv('{DATA_DIR}/csv/14512.csv', ${parameter} := NULL)
----

endloop

statement error
SELECT NULL FROM sniff_csv(NULL)
----
sniff_csv cannot take NULL as a file path parameter

statement error
SELECT NULL FROM read_csv(NULL)
----
read_csv cannot take NULL list as parameter