aboutsummaryrefslogtreecommitdiff
path: root/src/func.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-02-19 00:29:11 +0000
committerdrh <drh@noemail.net>2015-02-19 00:29:11 +0000
commit883ad04985496dfeb54135a23066cf9fb0b9a1e3 (patch)
tree7ab7d75fb8a39a0afcbc581a939f8c6f796a4b26 /src/func.c
parent96c707a3c285141f3f5764422bdce7a01aaa319f (diff)
downloadsqlite-883ad04985496dfeb54135a23066cf9fb0b9a1e3.tar.gz
sqlite-883ad04985496dfeb54135a23066cf9fb0b9a1e3.zip
First small steps toward brining trunk and apple-osx closer together.
FossilOrigin-Name: 28284ccc0d7301503f6d2d7bee9093738d52e331
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 ){