File tree 6 files changed +19
-11
lines changed
Filter options
6 files changed +19
-11
lines changed
Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ set escape_string_warning=off;
3
3
set standard_conforming_strings=on;
4
4
CREATE TABLE test_jsquery (v jsonb);
5
5
\copy test_jsquery from 'data/test_jsquery.data'
6
+ select ''::jsquery;
7
+ ERROR: bad jsquery representation
8
+ LINE 1: select ''::jsquery;
9
+ ^
10
+ DETAIL: No symbols read at the end of input
6
11
select 'asd.zzz = 13'::jsquery;
7
12
jsquery
8
13
------------------
Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ set escape_string_warning=off;
3
3
set standard_conforming_strings=on;
4
4
CREATE TABLE test_jsquery (v jsonb);
5
5
\copy test_jsquery from 'data/test_jsquery.data'
6
+ select ''::jsquery;
7
+ ERROR: bad jsquery representation
8
+ LINE 1: select ''::jsquery;
9
+ ^
10
+ DETAIL: No symbols read at the end of input
6
11
select 'asd.zzz = 13'::jsquery;
7
12
jsquery
8
13
------------------
Original file line number Diff line number Diff line change @@ -258,7 +258,9 @@ result:
258
258
*result = $1 ;
259
259
(void ) yynerrs ; /* suppress compiler warning */
260
260
}
261
- | /* EMPTY */ { *result = NULL ; }
261
+ | /* EMPTY */ {
262
+ *result = NULL ;
263
+ yyerror (NULL , " No symbols read" ); }
262
264
;
263
265
264
266
array :
Original file line number Diff line number Diff line change @@ -162,17 +162,12 @@ jsquery_in(PG_FUNCTION_ARGS)
162
162
163
163
appendStringInfoSpaces (& buf , VARHDRSZ );
164
164
165
- if (jsquery != NULL )
166
- {
167
- flattenJsQueryParseItem (& buf , jsquery , false);
168
-
169
- res = (JsQuery * )buf .data ;
170
- SET_VARSIZE (res , buf .len );
165
+ flattenJsQueryParseItem (& buf , jsquery , false);
171
166
172
- PG_RETURN_JSQUERY ( res ) ;
173
- }
167
+ res = ( JsQuery * ) buf . data ;
168
+ SET_VARSIZE ( res , buf . len );
174
169
175
- PG_RETURN_NULL ( );
170
+ PG_RETURN_JSQUERY ( res );
176
171
}
177
172
178
173
static void
Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ yyerror(JsQueryParseItem **result, const char *message)
206
206
(errcode(ERRCODE_SYNTAX_ERROR),
207
207
errmsg(" bad jsquery representation" ),
208
208
/* translator: %s is typically " syntax error" */
209
- errdetail(" %s at end of input" , message)));
209
+ errdetail(" %s at the end of input" , message)));
210
210
}
211
211
else
212
212
{
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ CREATE TABLE test_jsquery (v jsonb);
7
7
8
8
\copy test_jsquery from ' data/test_jsquery.data'
9
9
10
+ select ' ' ::jsquery;
10
11
select ' asd.zzz = 13' ::jsquery;
11
12
select ' asd.zzz < 13' ::jsquery;
12
13
select ' asd(zzz < 13)' ::jsquery;
You can’t perform that action at this time.
0 commit comments