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 # Verify that certain keywords can be used as identifiers.
14 # $Id: keyword1.test,v 1.1 2009/01/29 19:27:47 drh Exp $
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
21 CREATE TABLE t1(a, b);
22 INSERT INTO t1 VALUES(1, 'one');
23 INSERT INTO t1 VALUES(2, 'two');
24 INSERT INTO t1 VALUES(3, 'three');
95 do_test keyword1-$kw.1 {
97 db eval "CREATE TABLE \"$kw\"($kw $kw)"
99 db eval "CREATE TABLE ${kw}($kw $kw)"
101 db eval "INSERT INTO $kw VALUES(99)"
102 db eval "INSERT INTO $kw SELECT a FROM t1"
103 if {[lsearch $exprkw $kw]<0} {
104 db eval "SELECT * FROM $kw ORDER BY $kw ASC"
106 db eval "SELECT * FROM $kw ORDER BY \"$kw\" ASC"
109 do_test keyword1-$kw.2 {
111 db eval "DROP TABLE \"$kw\""
112 db eval "CREATE INDEX \"$kw\" ON t1(a)"
114 db eval "DROP TABLE $kw"
115 db eval "CREATE INDEX $kw ON t1(a)"
117 db eval "SELECT b FROM t1 INDEXED BY $kw WHERE a=2"