aboutsummaryrefslogtreecommitdiff
path: root/src/func.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-02-21 15:13:50 +0000
committerdrh <drh@noemail.net>2015-02-21 15:13:50 +0000
commit878acb32efa879e0b680cce08f63e65f89fa4f77 (patch)
tree84f334c6f75c248e10f9a92c17e3dae631f2c597 /src/func.c
parent1ee4a2dd88663517c8dd980926af9e76f37c88fb (diff)
parent2da47d38691b74a6cfa2ce2e5bdce3bb7d8fc186 (diff)
downloadsqlite-878acb32efa879e0b680cce08f63e65f89fa4f77.tar.gz
sqlite-878acb32efa879e0b680cce08f63e65f89fa4f77.zip
Merge all recent trunk changes into the sessions branch.
FossilOrigin-Name: f36bb5fa5c5e3430808fe35d58f45559a216d341
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 ){