aboutsummaryrefslogtreecommitdiff
path: root/src/func.c
diff options
context:
space:
mode:
authormistachkin <mistachkin@noemail.net>2015-02-27 19:40:08 +0000
committermistachkin <mistachkin@noemail.net>2015-02-27 19:40:08 +0000
commit0404e74caa95a4cde7bdba71ad95d6eb8f924c01 (patch)
treec0bcde754c3ce16edbf06bfda8d4f0b058054fb5 /src/func.c
parentbfefa4c27b42b74e6b1685a3c93585fd0fa7d666 (diff)
parent22ec13466cbc6ce4f3cc642e5c23c5d52dcace27 (diff)
downloadsqlite-0404e74caa95a4cde7bdba71ad95d6eb8f924c01.tar.gz
sqlite-0404e74caa95a4cde7bdba71ad95d6eb8f924c01.zip
Merge updates from trunk.
FossilOrigin-Name: acf7684323da4dc3aaf9746bd13b0f56054a17dd
Diffstat (limited to 'src/func.c')
-rw-r--r--src/func.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/func.c b/src/func.c
index a05799341..30990a30f 100644
--- a/src/func.c
+++ b/src/func.c
@@ -291,6 +291,14 @@ static void substrFunc(
}
}
}
+#ifdef SQLITE_SUBSTR_COMPATIBILITY
+ /* If SUBSTR_COMPATIBILITY is defined then substr(X,0,N) work the same as
+ ** as substr(X,1,N) - it returns the first N characters of X. This
+ ** is essentially a back-out of the bug-fix in check-in [5fc125d362df4b8]
+ ** from 2009-02-02 for compatibility of applications that exploited the
+ ** old buggy behavior. */
+ if( p1==0 ) p1 = 1; /* <rdar://problem/6778339> */
+#endif
if( argc==3 ){
p2 = sqlite3_value_int(argv[2]);
if( p2<0 ){