Skip to content

Commit 5e9e075

Browse files
committed
🐛 Remove json_unquote from the ->> JSON operator
As stated in the SQLite docs, https://www.sqlite.org/json1.html#jptr:~:text=The%20SQLite%20version%20of%20json_extract()%20only%20returns%20JSON SQLite json_extract differs from the MySQL one, which means an additionnal json_unquote isn't needed. Because the parser is originally for MySQL, I've modified the yacc file to remove json_unquote
1 parent 3f18fc6 commit 5e9e075

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

other/sqlparser/compile.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# This script compiles the Yacc to sql.go
4+
set -e
5+
cd "$(dirname "$0")"
6+
go run goyacc/goyacc.go -fo sql.go sql.y

other/sqlparser/sql.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

other/sqlparser/sql.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5628,7 +5628,7 @@ function_call_keyword
56285628
}
56295629
| column_name_or_offset JSON_UNQUOTE_EXTRACT_OP text_literal_or_arg
56305630
{
5631-
$$ = &JSONUnquoteExpr{JSONValue: &JSONExtractExpr{JSONDoc: $1, PathList: []Expr{$3}}}
5631+
$$ = &JSONExtractExpr{JSONDoc: $1, PathList: []Expr{$3}}
56325632
}
56335633

56345634
column_names_opt_paren:

0 commit comments

Comments
 (0)