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

[PGPRO-9047] Fixed parsing empty string into NULL#50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sokolcati merged 1 commit intomasterfromPGPRO-9047
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletionsexpected/jsquery.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,11 @@ set escape_string_warning=off;
set standard_conforming_strings=on;
CREATE TABLE test_jsquery (v jsonb);
\copy test_jsquery from 'data/test_jsquery.data'
select ''::jsquery;
ERROR: bad jsquery representation
LINE 1: select ''::jsquery;
^
DETAIL: No symbols read at the end of input
select 'asd.zzz = 13'::jsquery;
jsquery
------------------
Expand Down
5 changes: 5 additions & 0 deletionsexpected/jsquery_1.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,11 @@ set escape_string_warning=off;
set standard_conforming_strings=on;
CREATE TABLE test_jsquery (v jsonb);
\copy test_jsquery from 'data/test_jsquery.data'
select ''::jsquery;
ERROR: bad jsquery representation
LINE 1: select ''::jsquery;
^
DETAIL: No symbols read at the end of input
select 'asd.zzz = 13'::jsquery;
jsquery
------------------
Expand Down
4 changes: 3 additions & 1 deletionjsquery_gram.y
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -258,7 +258,9 @@ result:
*result = $1;
(void) yynerrs;/* suppress compiler warning */
}
| /* EMPTY */{ *result = NULL; }
| /* EMPTY */{
*result = NULL;
yyerror(NULL, "No symbols read"); }
;

array:
Expand Down
13 changes: 4 additions & 9 deletionsjsquery_io.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -162,17 +162,12 @@ jsquery_in(PG_FUNCTION_ARGS)

appendStringInfoSpaces(&buf, VARHDRSZ);

if (jsquery != NULL)
{
flattenJsQueryParseItem(&buf, jsquery, false);

res = (JsQuery*)buf.data;
SET_VARSIZE(res, buf.len);
flattenJsQueryParseItem(&buf, jsquery, false);

PG_RETURN_JSQUERY(res);
}
res = (JsQuery*)buf.data;
SET_VARSIZE(res, buf.len);

PG_RETURN_NULL();
PG_RETURN_JSQUERY(res);
}

static void
Expand Down
2 changes: 1 addition & 1 deletionjsquery_scan.l
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -206,7 +206,7 @@ yyerror(JsQueryParseItem **result, const char *message)
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("bad jsquery representation"),
/* translator: %s is typically "syntax error" */
errdetail("%s at end of input", message)));
errdetail("%s attheend of input", message)));
}
else
{
Expand Down
1 change: 1 addition & 0 deletionssql/jsquery.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ CREATE TABLE test_jsquery (v jsonb);

\copy test_jsquery from 'data/test_jsquery.data'

select ''::jsquery;
select 'asd.zzz = 13'::jsquery;
select 'asd.zzz < 13'::jsquery;
select 'asd(zzz < 13)'::jsquery;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp