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

Commit229fb58

Browse files
committed
Treat timeline IDs as unsigned in replication parser
Timeline IDs are unsigned ints everywhere, except the replication parsertreated them as signed ints.
1 parent32f7c0a commit229fb58

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

‎src/backend/replication/repl_gram.y

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Node *replication_parse_result;
5656
%union {
5757
char*str;
5858
boolboolval;
59-
int32intval;
59+
uint32uintval;
6060

6161
XLogRecPtrrecptr;
6262
Node*node;
@@ -66,7 +66,7 @@ Node *replication_parse_result;
6666

6767
/* Non-keyword tokens*/
6868
%token<str>SCONST
69-
%token<intval>ICONST
69+
%token<uintval>UCONST
7070
%token<recptr>RECPTR
7171

7272
/* Keyword tokens.*/
@@ -85,7 +85,7 @@ Node *replication_parse_result;
8585
%type<node>base_backupstart_replicationidentify_systemtimeline_history
8686
%type<list>base_backup_opt_list
8787
%type<defelt>base_backup_opt
88-
%type<intval>opt_timeline
88+
%type<uintval>opt_timeline
8989
%%
9090

9191
firstcmd:commandopt_semicolon
@@ -175,12 +175,12 @@ start_replication:
175175
;
176176

177177
opt_timeline:
178-
K_TIMELINEICONST
178+
K_TIMELINEUCONST
179179
{
180180
if ($2 <=0)
181181
ereport(ERROR,
182182
(errcode(ERRCODE_SYNTAX_ERROR),
183-
(errmsg("invalid timeline %d", $2))));
183+
(errmsg("invalid timeline %u", $2))));
184184
$$ =$2;
185185
}
186186
|/* nothing*/{$$ =0; }
@@ -190,14 +190,14 @@ opt_timeline:
190190
* TIMELINE_HISTORY %d
191191
*/
192192
timeline_history:
193-
K_TIMELINE_HISTORYICONST
193+
K_TIMELINE_HISTORYUCONST
194194
{
195195
TimeLineHistoryCmd *cmd;
196196

197197
if ($2 <=0)
198198
ereport(ERROR,
199199
(errcode(ERRCODE_SYNTAX_ERROR),
200-
(errmsg("invalid timeline %d", $2))));
200+
(errmsg("invalid timeline %u", $2))));
201201

202202
cmd = makeNode(TimeLineHistoryCmd);
203203
cmd->timeline =$2;

‎src/backend/replication/repl_scanner.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ TIMELINE_HISTORY{ return K_TIMELINE_HISTORY; }
8383
"";
8484

8585
{digit}+{
86-
yylval.intval =pg_atoi(yytext,sizeof(int32),0);
87-
returnICONST;
86+
yylval.uintval =strtoul(yytext,NULL,10);
87+
returnUCONST;
8888
}
8989

9090
{hexdigit}+\/{hexdigit}+{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp