Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf26ac6d

Browse files
committed
Merge with jsquery 0.36.
1 parent73b7912 commitf26ac6d

12 files changed

+166
-87
lines changed

‎expected/jsquery.out

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ select 'a in (0,1,2)'::jsquery;
354354
"a" IN (0, 1, 2)
355355
(1 row)
356356

357-
select 'ain (0,null, "null", xxx, "zzz", 2)'::jsquery;
357+
select 'aIN (0,null, "null", xxx, "zzz", 2)'::jsquery;
358358
jsquery
359359
-------------------------------------------
360360
"a" IN (0, null, "null", "xxx", "zzz", 2)
@@ -786,3 +786,33 @@ select '[1,2,3]'::jsonb @@ '#($ = 2)';
786786
t
787787
(1 row)
788788

789+
select '{"a": {"b": 3, "c": "hey"}, "x": [5,6]}'::jsonb @@ '%.b=3';
790+
?column?
791+
----------
792+
t
793+
(1 row)
794+
795+
select '{"a": {"b": 3, "c": "hey"}, "x": [5,6]}'::jsonb @@ 'a.%=3';
796+
?column?
797+
----------
798+
t
799+
(1 row)
800+
801+
select '{"a": {"b": 3, "c": "hey"}, "x": [5,6]}'::jsonb @@ '%.%="hey"';
802+
?column?
803+
----------
804+
t
805+
(1 row)
806+
807+
select '{"a": {"b": 3, "c": "hey"}, "x": [5,6]}'::jsonb @@ '%="hey"';
808+
?column?
809+
----------
810+
f
811+
(1 row)
812+
813+
select '{"a": {"b": 3, "c": "hey"}, "x": [5,6]}'::jsonb @@ '%=[5,6]';
814+
?column?
815+
----------
816+
t
817+
(1 row)
818+

‎jsonb_gin_ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ get_query_path_bloom(PathItem *pathItem, bool *lossy)
179179
val=get_bloom_value(hash);
180180
res |=val;
181181
}
182-
elseif (pathItem->type==iAny)
182+
elseif (pathItem->type==iAny||pathItem->type==iAnyKey)
183183
{
184184
*lossy= true;
185185
}
@@ -783,7 +783,7 @@ get_query_path_hash(PathItem *pathItem, uint32 *hash)
783783
}
784784
else
785785
{
786-
if (pathItem->type==iAny)
786+
if (pathItem->type==iAny||pathItem->type==iAnyKey)
787787
{
788788
return false;
789789
}

‎jsquery.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ struct JsQueryItem {
4949
jqiGreaterOrEqual='}',
5050
jqiContains='@',
5151
jqiContained='^',
52-
jqiOverlap='%',
52+
jqiOverlap='O',
5353
jqiAny='*',
5454
jqiAnyArray='#',
55+
jqiAnyKey='%',
5556
jqiKey='K',
5657
jqiCurrent='$',
5758
jqiIn='I'
@@ -108,7 +109,8 @@ typedef enum
108109
{
109110
iAny=1,
110111
iAnyArray,
111-
iKey
112+
iKey,
113+
iAnyKey
112114
}PathItemType;
113115

114116
typedefstructPathItemPathItem;

‎jsquery_constr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ copyJsQuery(StringInfo buf, char *jqBase, int32 jqPos)
118118
casejqiAny:
119119
casejqiCurrent:
120120
casejqiAnyArray:
121+
casejqiAnyKey:
121122
break;
122123
default:
123124
elog(ERROR,"Unknown JsQueryItem type: %d",type);

‎jsquery_extract.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ recursiveExtract(char *jqBase, int32 jqPos,bool indirect, PathItem *path)
109109
pathItem->type=iAnyArray;
110110
pathItem->parent=path;
111111
returnrecursiveExtract(jqBase,nextPos, true,pathItem);
112+
casejqiAnyKey:
113+
Assert(nextPos!=0);
114+
pathItem= (PathItem*)palloc(sizeof(PathItem));
115+
pathItem->type=iAnyKey;
116+
pathItem->parent=path;
117+
returnrecursiveExtract(jqBase,nextPos, true,pathItem);
112118
casejqiCurrent:
113119
returnrecursiveExtract(jqBase,nextPos,indirect,path);
114120
casejqiEqual:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp