3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
12 # This file implements tests for sqlite3_vtab_rhs_value() interface.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 set testprefix vtabrhs1
23 load_static_extension db qpvtab
25 # EVIDENCE-OF: R-60223-49197 When the sqlite3_vtab_rhs_value(P,J,V)
26 # interface is invoked from within the xBestIndex method of a virtual
27 # table implementation, with P being a copy of the sqlite3_index_info
28 # object pointer passed into xBestIndex and J being a 0-based index into
29 # P->aConstraint[], then this routine attempts to set *V to the value
30 # of the right-hand operand of that constraint if the right-hand operand
34 SELECT rhs FROM qpvtab
39 SELECT rhs FROM qpvtab
44 SELECT rhs FROM qpvtab
49 SELECT rhs FROM qpvtab
54 SELECT rhs FROM qpvtab
59 # EVIDENCE-OF: R-37799-62852 If the right-hand operand is not known,
60 # then *V is set to a NULL pointer.
63 SELECT typeof(rhs) FROM qpvtab WHERE cn='a' AND a=format('abc');
66 SELECT typeof(rhs) FROM qpvtab WHERE cn='a' AND a=?2
69 # EVIDENCE-OF: R-14553-25174 When xBestIndex returns, the sqlite3_value
70 # object returned by sqlite3_vtab_rhs_value() is automatically
73 # Where this not the case, the following "finish_test" statement would
74 # report a memory leak.