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

When comparing two expressions do not apply affinity to either operand.

Ticket #805. (CVS 1810)

FossilOrigin-Name: 88a4e400f916d7af088b39a9653d6452b3666577
This commit is contained in:
drh
2004-07-19 00:39:45 +00:00
parent 83ca160a33
commit 5f6a87b3dd
8 changed files with 39 additions and 31 deletions

View File

@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc1.test,v 1.28 2004/06/19 00:16:31 drh Exp $
# $Id: misc1.test,v 1.29 2004/07/19 00:39:46 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -346,10 +346,10 @@ do_test misc1-11.2 {
#
do_test misc1-12.1 {
execsql {SELECT '0'=='0.0'}
} {1}
} {0}
do_test misc1-12.2 {
execsql {SELECT '0'==0.0}
} {1}
} {0}
do_test misc1-12.3 {
execsql {SELECT '12345678901234567890'=='12345678901234567891'}
} {0}

View File

@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc4.test,v 1.1 2004/07/18 23:47:53 drh Exp $
# $Id: misc4.test,v 1.2 2004/07/19 00:39:46 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -41,5 +41,6 @@ do_test misc4-1.1 {
SELECT * FROM temp.t2;
}
} {1}
catch {sqlite3_finalize $stmt}
finish_test

View File

@ -10,7 +10,7 @@
#***********************************************************************
# This file runs all tests.
#
# $Id: quick.test,v 1.26 2004/06/29 13:41:21 danielk1977 Exp $
# $Id: quick.test,v 1.27 2004/07/19 00:39:46 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -27,6 +27,7 @@ set EXCLUDE {
misuse.test
format3.test
crash.test
utf16.test
}
if {[sqlite3 -has-codec]} {

View File

@ -12,7 +12,7 @@
# of this file is testing the interaction of manifest types, type affinity
# and comparison expressions.
#
# $Id: types2.test,v 1.3 2004/05/20 12:41:20 drh Exp $
# $Id: types2.test,v 1.4 2004/07/19 00:39:46 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -60,10 +60,13 @@ proc test_bool {testname vars expr res} {
# Compare literals against literals. This should always use a numeric
# comparison.
#
# Changed by ticket #805: Use no affinity for literal comparisons.
#
test_bool types2-1.1 "" {500 = 500.0} 1
test_bool types2-1.2 "" {'500' = 500.0} 1
test_bool types2-1.3 "" {500 = '500.0'} 1
test_bool types2-1.4 "" {'500' = '500.0'} 1
test_bool types2-1.2 "" {'500' = 500.0} 0
test_bool types2-1.3 "" {500 = '500.0'} 0
test_bool types2-1.4 "" {'500' = '500.0'} 0
# Compare literals against a column with TEXT affinity
test_bool types2-1.5 {t1=500} {500 = t1} 1
@ -157,10 +160,11 @@ test_boolset types2-3.3 {o < '20'} {1 2 3 4 5 6 9 10}
test_boolset types2-3.3 {o < '20.0'} {1 2 3 4 5 6 7 9 10}
# Compare literals against literals (always a numeric comparison).
# Change (by ticket #805): No affinity in comparisons
test_bool types2-4.1 "" {500 > 60.0} 1
test_bool types2-4.2 "" {'500' > 60.0} 1
test_bool types2-4.3 "" {500 > '60.0'} 1
test_bool types2-4.4 "" {'500' > '60.0'} 1
test_bool types2-4.3 "" {500 > '60.0'} 0
test_bool types2-4.4 "" {'500' > '60.0'} 0
# Compare literals against a column with TEXT affinity
test_bool types2-4.5 {t1=500.0} {t1 > 500} 1