File: bdb_dupset.test

package info (click to toggle)
db5.3 5.3.28%2Bdfsg2-9
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 158,620 kB
  • sloc: ansic: 448,573; java: 111,824; tcl: 80,544; sh: 44,264; cs: 33,697; cpp: 21,600; perl: 14,557; xml: 10,799; makefile: 4,028; javascript: 1,998; yacc: 1,003; awk: 965; sql: 801; erlang: 342; python: 216; php: 24; asm: 14
file content (45 lines) | stat: -rw-r--r-- 1,114 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
#    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