--- a/test/database.c Wed Jan 21 17:46:10 2026 +0100 +++ b/test/database.c Wed Jan 21 17:59:45 2026 +0100 @@ -246,6 +246,25 @@ } } +CX_TEST(testSqlExecParam) { + CX_TEST_DO { + CX_TEST_ASSERT(dbuSqlExec(conn, "PRAGMA foreign_keys = ON;") == 0); + CX_TEST_ASSERT(dbuSqlExec(conn, + "create table ExecTest3( " + "test1_id integer primary key autoincrement, " + "value int);") == 0); + CX_TEST_ASSERT(dbuSqlExec(conn, + "create table ExecTest4( " + "test2_id integer primary key autoincrement, " + "exectest1_id int references ExecTest3(test1_id), " + "value int);") == 0); + CX_TEST_ASSERT(dbuSqlExec(conn, "insert into ExecTest3(value) values (123);") == 0); + + // fail test + CX_TEST_ASSERT(dbuSqlExec(conn, "insert into ExecTest4(exectest1_id, value) values (-999, 123);") != 0); + } +} + CX_TEST(testSingleTableQuery) { CxMempool *mp = cxMempoolCreateSimple(64);