Skip to content

Commit 0ff332f

Browse files
committed
Use generate_series() to generate dummy data for sqlsmith
1 parent 43c3d15 commit 0ff332f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/pycheck/sqlsmith_fuzzy_test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ def test_fuzzy_pg_crashing(pg: Postgres, cur: Cursor):
77
cur.sql("CREATE DATABASE sqlsmith_test")
88
with pg.cur(dbname="sqlsmith_test") as sqlsmith_cur:
99
sqlsmith_cur.sql("CREATE EXTENSION pg_duckdb")
10-
# create a test table with arbitary data to allow sqlsmith to do more operations
10+
# create test tables with dummy data to allow sqlsmith to do more operations
1111
sqlsmith_cur.sql("CREATE TABLE test_table (id INT, name TEXT)")
12+
sqlsmith_cur.sql("CREATE TABLE test_table2 (id INT, name VARCHAR)")
13+
14+
sqlsmith_cur.sql(
15+
"INSERT INTO test_table (SELECT num, 'name_' || num FROM generate_series(1, 100) as num)"
16+
)
1217
sqlsmith_cur.sql(
13-
"INSERT INTO test_table (id, name) VALUES (1, 'Alice'), (2, 'Bob')"
18+
"INSERT INTO test_table2 (SELECT num, 'name_' || num FROM generate_series(10, 100) as num)"
1419
)
1520

1621
# any crash caused by sqlsmith will be detected from logs on the teardown of pg fixture

0 commit comments

Comments
 (0)