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

Fix a problem with zeroblob() and CAST(...) expressions that could cause an assert() to fail. (CVS 4041)

FossilOrigin-Name: 03750a2a6b5186689f7db6650c0a889429790b03
This commit is contained in:
danielk1977
2007-05-30 06:19:32 +00:00
parent bcbb04e501
commit 6b28f053fd
4 changed files with 36 additions and 10 deletions

View File

@ -13,7 +13,7 @@
# including the sqlite3_bind_zeroblob(), sqlite3_result_zeroblob(),
# and the built-in zeroblob() SQL function.
#
# $Id: zeroblob.test,v 1.4 2007/05/23 06:31:39 drh Exp $
# $Id: zeroblob.test,v 1.5 2007/05/30 06:19:33 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -127,6 +127,29 @@ do_test zeroblob-4.1 {
SELECT hex(zeroblob(2) || x'61')
}
} {000061}
# Check various CAST(...) operations on zeroblob.
#
do_test zeroblob-5.1 {
execsql {
SELECT CAST (zeroblob(100) AS REAL);
}
} {0.0}
do_test zeroblob-5.2 {
execsql {
SELECT CAST (zeroblob(100) AS INTEGER);
}
} {0}
do_test zeroblob-5.3 {
execsql {
SELECT CAST (zeroblob(100) AS TEXT);
}
} {{}}
do_test zeroblob-5.4 {
execsql {
SELECT CAST(zeroblob(100) AS BLOB);
}
} [execsql {SELECT zeroblob(100)}]
finish_test