| 1 |
# 2025-12-02 |
| 2 |
# |
| 3 |
# The author disclaims copyright to this source code. In place of |
| 4 |
# 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 |
|
| 15 |
set testdir [file dirname $argv0] |
| 16 |
source $testdir/tester.tcl |
| 17 |
set testprefix qrf05 |
| 18 |
|
| 19 |
do_execsql_test 1.0 { |
| 20 |
CREATE TABLE t1(a INT NOT NULL); |
| 21 |
} |
| 22 |
do_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} |
| 27 |
do_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}} |
| 32 |
do_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 |
|
| 37 |
finish_test |