1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Correctly handle comparing an INTEGER PRIMARY KEY against a floating point

number.  Ticket #377. (CVS 1045)

FossilOrigin-Name: 982aa3356bcc217003cd9e6a829619219c334797
This commit is contained in:
drh
2003-07-06 17:22:25 +00:00
parent 3c8bf55a04
commit 1dd59e0f94
5 changed files with 105 additions and 17 deletions

View File

@ -12,7 +12,7 @@
# focus of this file is testing the magic ROWID column that is
# found on all tables.
#
# $Id: rowid.test,v 1.11 2003/06/01 01:10:33 drh Exp $
# $Id: rowid.test,v 1.12 2003/07/06 17:22:25 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -417,5 +417,59 @@ do_test rowid-8.8 {
}
} {1 1 2 133 3 134}
# ticket #377: Comparison between integer primiary key and floating point
# values.
#
do_test rowid-9.1 {
execsql {
SELECT * FROM t3 WHERE a<123.5
}
} {123}
do_test rowid-9.2 {
execsql {
SELECT * FROM t3 WHERE a<124.5
}
} {123 124}
do_test rowid-9.3 {
execsql {
SELECT * FROM t3 WHERE a>123.5
}
} {124}
do_test rowid-9.4 {
execsql {
SELECT * FROM t3 WHERE a>122.5
}
} {123 124}
do_test rowid-9.5 {
execsql {
SELECT * FROM t3 WHERE a==123.5
}
} {}
do_test rowid-9.6 {
execsql {
SELECT * FROM t3 WHERE a==123.000
}
} {123}
do_test rowid-9.7 {
execsql {
SELECT * FROM t3 WHERE a>100.5 AND a<200.5
}
} {123 124}
do_test rowid-9.8 {
execsql {
SELECT * FROM t3 WHERE a>'xyz';
}
} {}
do_test rowid-9.9 {
execsql {
SELECT * FROM t3 WHERE a<'xyz';
}
} {123 124}
do_test rowid-9.10 {
execsql {
SELECT * FROM t3 WHERE a>=122.9 AND a<=123.1
}
} {123}
finish_test