mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Do not allow an empty string to be inserted into an INTEGER PRIMARY KEY. (CVS 877)
FossilOrigin-Name: 2aba40bea5fc1c4aef8cfd4c790d40808821ca14
This commit is contained in:
@ -13,7 +13,7 @@
|
||||
# This file implements tests for the special processing associated
|
||||
# with INTEGER PRIMARY KEY columns.
|
||||
#
|
||||
# $Id: intpkey.test,v 1.12 2003/01/29 18:46:54 drh Exp $
|
||||
# $Id: intpkey.test,v 1.13 2003/03/07 19:50:08 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -128,12 +128,18 @@ do_test intpkey-1.12 {
|
||||
# Try to insert a non-integer value into the primary key field. This
|
||||
# should result in a data type mismatch.
|
||||
#
|
||||
do_test intpkey-1.13 {
|
||||
do_test intpkey-1.13.1 {
|
||||
set r [catch {execsql {
|
||||
INSERT INTO t1 VALUES('x','y','z');
|
||||
}} msg]
|
||||
lappend r $msg
|
||||
} {1 {datatype mismatch}}
|
||||
do_test intpkey-1.13.2 {
|
||||
set r [catch {execsql {
|
||||
INSERT INTO t1 VALUES('','y','z');
|
||||
}} msg]
|
||||
lappend r $msg
|
||||
} {1 {datatype mismatch}}
|
||||
do_test intpkey-1.14 {
|
||||
set r [catch {execsql {
|
||||
INSERT INTO t1 VALUES(3.4,'y','z');
|
||||
|
Reference in New Issue
Block a user