AryaWu/sqlite
0
1# 2025-12-022#3# The author disclaims copyright to this source code. In place of4# a legal notice, here is a blessing:5#6# May you do good and not evil.7# May you find forgiveness for yourself and forgive others.8# May you share freely, never taking more than you give.9#10#***********************************************************************11#12# Test cases for the Query Result Formatter (QRF)13#14 15set testdir [file dirname $argv0]16source $testdir/tester.tcl17set testprefix qrf0518 19do_execsql_test 1.0 {20 CREATE TABLE t1(a INT NOT NULL);21}22do_test 1.1 {23 set rc [catch {db format -style list \24 {INSERT INTO t1 VALUES(123) RETURNING *}} msg]25 list $rc [string trim $msg]26} {0 123}27do_test 1.2 {28 set rc [catch {db format -style list \29 {INSERT INTO t1 VALUES(NULL) RETURNING *}} msg]30 list $rc [string trim $msg]31} {1 {NOT NULL constraint failed: t1.a}}32do_test 1.3 {33 set rc [catch {db format -version 99 {SELECT * FROM t1}} msg]34 list $rc [string trim $msg]35} {1 {unusable sqlite3_qrf_spec.iVersion (99)}}36 37finish_test38 