drh | d673cdd | 2013-11-21 21:23:31 +0000 | [diff] [blame] | 1 | # 2013-11-21 |
| 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 | # Verify that constant string expressions that get factored into initializing |
| 13 | # code are not reused between function parameters and other values in the |
| 14 | # VDBE program, as the function might have changed the encoding. |
| 15 | # |
| 16 | set testdir [file dirname $argv0] |
| 17 | source $testdir/tester.tcl |
| 18 | |
| 19 | do_execsql_test func5-1.1 { |
| 20 | PRAGMA encoding=UTF16le; |
| 21 | CREATE TABLE t1(x,a,b,c); |
| 22 | INSERT INTO t1 VALUES(1,'ab','cd',1); |
| 23 | INSERT INTO t1 VALUES(2,'gh','ef',5); |
| 24 | INSERT INTO t1 VALUES(3,'pqr','fuzzy',99); |
| 25 | INSERT INTO t1 VALUES(4,'abcdefg','xy',22); |
| 26 | INSERT INTO t1 VALUES(5,'shoe','mayer',2953); |
| 27 | SELECT x FROM t1 WHERE c=instr('abcdefg',b) OR a='abcdefg' ORDER BY +x; |
| 28 | } {2 4} |
| 29 | do_execsql_test func5-1.2 { |
| 30 | SELECT x FROM t1 WHERE a='abcdefg' OR c=instr('abcdefg',b) ORDER BY +x; |
| 31 | } {2 4} |
| 32 | |
| 33 | finish_test |