The replace() function should return NULL if the second argument is an

empty string.  Ticket #2324. (CVS 3877)

FossilOrigin-Name: e6a0c90dd9b4f7efe2153dd0c899b6e3d9846bd8
This commit is contained in:
drh
2007-04-27 01:18:02 +00:00
parent dddbcdcc68
commit 709cff33dc
4 changed files with 18 additions and 12 deletions
+7 -1
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing built-in functions.
#
# $Id: func.test,v 1.60 2007/04/10 13:51:19 drh Exp $
# $Id: func.test,v 1.61 2007/04/27 01:18:03 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -328,6 +328,12 @@ do_test func-9.10 {
do_test func-9.11 {
execsql {SELECT hex(replace('abcdefg','ef','12'))}
} {61626364313267}
do_test func-9.12 {
execsql {SELECT hex(replace('abcdefg','','12'))}
} {{}}
do_test func-9.13 {
execsql {SELECT hex(replace('aabcdefg','a','aaa'))}
} {616161616161626364656667}
# Use the "sqlite_register_test_function" TCL command which is part of
# the text fixture in order to verify correct operation of some of