# 2013 September 24
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    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.
#
#***********************************************************************
# The tests in this file were used while developing the SQLite 4 code. 
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix simple4

do_execsql_test 1.0 {
  CREATE TABLE t1(a, b);
  INSERT INTO t1 VALUES(1, 2);
  INSERT INTO t1 VALUES(3, 4);
}

do_execsql_test 1.1 {
  BEGIN;
    INSERT INTO t1 VALUES(5, 6);
    SAVEPOINT one;
      INSERT INTO t1 VALUES(7, 8);
}

do_execsql_test 1.2 { SELECT * FROM t1 }                   {1 2 3 4 5 6 7 8}
do_execsql_test 1.3 { ROLLBACK TO one; SELECT * FROM t1; } {1 2 3 4 5 6}
do_execsql_test 1.4 { ROLLBACK; SELECT * FROM t1; }        {1 2 3 4}

do_execsql_test 2.1 {
  CREATE TABLE t2(a TEXT);
  INSERT INTO t2 VALUES(1);
  INSERT INTO t2 VALUES(1.0);
  SELECT * FROM t2;
} {1 1.0}

do_execsql_test 2.2 {
  DELETE FROM t2;
  INSERT INTO t2 VALUES(0);
  INSERT INTO t2 VALUES(0.0);
  SELECT * FROM t2;
} {0 0.0}

do_execsql_test 2.3 {
  CREATE TABLE t3(a INTEGER);
  INSERT INTO t3 VALUES(1);
  INSERT INTO t3 VALUES(1.0);
  SELECT * FROM t3;
} {1 1}

do_execsql_test 3.1 {
  CREATE TABLE t4(a INTEGER PRIMARY KEY, b);
  INSERT INTO t4 VALUES(1, 'one');
  INSERT INTO t4 VALUES(2, 'two');
  INSERT INTO t4 VALUES(3, 'three');

  CREATE TABLE t5(x INTEGER PRIMARY KEY, y);
  INSERT INTO t5 VALUES(2, 3);

} {1 1}

finish_test

