libdb/test/sql/bdb_dupset.test

46 lines
1.1 KiB
Text
Raw Normal View History

2011-09-13 17:44:24 +00:00
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for dealing with with duplicated
# items in set in BDB SQL
#
set testdir [file dirname $argv0]/../../lang/sql/sqlite/test
source $testdir/tester.tcl
reset_db
# Test bdb_dup-1
# 1. Create a table with specified primary key for test
# 2. Insert a record into the table.
# 3. Query the table to check the results
do_test bdb_dupset-1 {
execsql {
CREATE TABLE t1(x integer primary key);
INSERT INTO t1 VALUES(1);
SELECT * FROM t1 WHERE x in (1,1);
}
} {1}
catch {dbr close}
reset_db
# Test bdb_dupset-2
# 1. Create a table without specified primary key for test.
# 2. Insert a record into the table.
# 3. Query the table to check the results
do_test bdb_dupset-2 {
execsql {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(1);
SELECT * FROM t1 WHERE x in (1,1);
}
} {1}
catch {dbr close}
reset_db
finish_test