1
0
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:
drh
2003-03-07 19:50:07 +00:00
parent 2299706c2a
commit 9468c7f489
4 changed files with 20 additions and 13 deletions

View File

@ -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');