aboutsummaryrefslogtreecommitdiff
path: root/test/substr.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-11-23 14:50:43 +0000
committerdrh <drh@noemail.net>2020-11-23 14:50:43 +0000
commit1335ec7df76cc45f080bfdcfadcf06cf8a9a4b9f (patch)
tree5c21d9a6c1bf3ccd061931daad8d44eaa85bf2d4 /test/substr.test
parent6a5e21149ba232b2eb01641dcac306c3fc693005 (diff)
downloadsqlite-1335ec7df76cc45f080bfdcfadcf06cf8a9a4b9f.tar.gz
sqlite-1335ec7df76cc45f080bfdcfadcf06cf8a9a4b9f.zip
Allow "substring()" as an alias for "substr()" for compatibility with other
SQL engines. FossilOrigin-Name: aa2ee5754c9f8378c4d490ca756a6415042904477727f0d86e9c0190b5e8b275
Diffstat (limited to 'test/substr.test')
-rw-r--r--test/substr.test9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/substr.test b/test/substr.test
index bcd0588d2..16ce08052 100644
--- a/test/substr.test
+++ b/test/substr.test
@@ -11,7 +11,6 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the built-in SUBSTR() functions.
#
-# $Id: substr.test,v 1.7 2009/02/03 13:10:54 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -39,7 +38,7 @@ proc substr-test {id string i1 i2 result} {
set qstr '[string map {' ''} $string]'
do_test substr-$id.2 [subst {
execsql {
- SELECT substr($qstr, $i1, $i2)
+ SELECT substring($qstr, $i1, $i2)
}
}] [list $result]
}
@@ -55,7 +54,7 @@ proc subblob-test {id hex i1 i2 hexresult} {
}] [list $hexresult]
do_test substr-$id.2 [subst {
execsql {
- SELECT hex(substr(x'$hex', $i1, $i2))
+ SELECT hex(substring(x'$hex', $i1, $i2))
}
}] [list $hexresult]
}
@@ -93,7 +92,7 @@ do_test substr-1.92 {
db eval {SELECT ifnull(substr('abcdefg',NULL,1),'nil')}
} nil
do_test substr-1.93 {
- db eval {SELECT ifnull(substr('abcdefg',NULL),'nil')}
+ db eval {SELECT ifnull(substring('abcdefg',NULL),'nil')}
} nil
do_test substr-1.94 {
db eval {SELECT ifnull(substr('abcdefg',1,NULL),'nil')}
@@ -149,7 +148,7 @@ proc substr-2-test {id string idx result} {
set qstr '[string map {' ''} $string]'
do_test substr-$id.2 [subst {
execsql {
- SELECT substr($qstr, $idx)
+ SELECT substring($qstr, $idx)
}
}] [list $result]
}