aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authordrh <>2023-05-01 03:56:48 +0000
committerdrh <>2023-05-01 03:56:48 +0000
commite210c9390321379f9a5c0b7a205e67128ab12192 (patch)
treee98e34a89d6793f2f4ef8f253bce556a81bac1e5 /src/json.c
parent5196d9350556cbd301d7bd89a342a068207a4869 (diff)
downloadsqlite-e210c9390321379f9a5c0b7a205e67128ab12192.tar.gz
sqlite-e210c9390321379f9a5c0b7a205e67128ab12192.zip
Fix abbreviated paths for objects such that they work even if the object
key begins with '$'. FossilOrigin-Name: 1b991c78141a9915ae9350ecb347a758e50d7d25c8a0f4cc098ae10d47c27043
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/json.c b/src/json.c
index 7e112c30d..aae48c291 100644
--- a/src/json.c
+++ b/src/json.c
@@ -2164,7 +2164,7 @@ static void jsonExtractFunc(
zPath = (const char*)sqlite3_value_text(argv[1]);
if( zPath==0 ) return;
if( flags & JSON_ABPATH ){
- if( zPath[0]!='$' ){
+ if( zPath[0]!='$' || (zPath[1]!='.' && zPath[1]!='[' && zPath[1]!=0) ){
/* The -> and ->> operators accept abbreviated PATH arguments. This
** is mostly for compatibility with PostgreSQL, but also for
** convenience.