git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 32f7c0a)
Treat timeline IDs as unsigned in replication parser
2013年8月15日 03:18:49 +0000 (23:18 -0400)
2013年8月15日 03:18:49 +0000 (23:18 -0400)
Timeline IDs are unsigned ints everywhere, except the replication parser
treated them as signed ints.


diff --git a/src/backend/replication/repl_gram.y b/src/backend/replication/repl_gram.y
index bce18b84767b08deebf6f161249f9d0d29d71f6e..8c8378045e6ff2eb23af3e3f770186c184270a07 100644 (file)
--- a/src/backend/replication/repl_gram.y
+++ b/src/backend/replication/repl_gram.y
@@ -56,7 +56,7 @@ Node *replication_parse_result;
%union {
char *str;
bool boolval;
- int32 intval;
+ uint32 uintval;
XLogRecPtr recptr;
Node *node;
@@ -66,7 +66,7 @@ Node *replication_parse_result;
/* Non-keyword tokens */
%token <str> SCONST
-%token <intval> ICONST
+%token <uintval> UCONST
%token <recptr> RECPTR
/* Keyword tokens. */
@@ -85,7 +85,7 @@ Node *replication_parse_result;
%type <node> base_backup start_replication identify_system timeline_history
%type <list> base_backup_opt_list
%type <defelt> base_backup_opt
-%type <intval> opt_timeline
+%type <uintval> opt_timeline
%%
firstcmd: command opt_semicolon
@@ -175,12 +175,12 @@ start_replication:
;
opt_timeline:
- K_TIMELINE ICONST
+ K_TIMELINE UCONST
{
if (2ドル <= 0)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- (errmsg("invalid timeline %d", 2ドル))));
+ (errmsg("invalid timeline %u", 2ドル))));
$$ = 2ドル;
}
| /* nothing */ { $$ = 0; }
@@ -190,14 +190,14 @@ opt_timeline:
* TIMELINE_HISTORY %d
*/
timeline_history:
- K_TIMELINE_HISTORY ICONST
+ K_TIMELINE_HISTORY UCONST
{
TimeLineHistoryCmd *cmd;
if (2ドル <= 0)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- (errmsg("invalid timeline %d", 2ドル))));
+ (errmsg("invalid timeline %u", 2ドル))));
cmd = makeNode(TimeLineHistoryCmd);
cmd->timeline = 2ドル;
diff --git a/src/backend/replication/repl_scanner.l b/src/backend/replication/repl_scanner.l
index b4743e6357d0ed044eac28ebd12f9742fb80ca22..3d930f1301216d4150da89eddb01eb55781e1799 100644 (file)
--- a/src/backend/replication/repl_scanner.l
+++ b/src/backend/replication/repl_scanner.l
@@ -83,8 +83,8 @@ TIMELINE_HISTORY { return K_TIMELINE_HISTORY; }
" " ;
{digit}+ {
- yylval.intval = pg_atoi(yytext, sizeof(int32), 0);
- return ICONST;
+ yylval.uintval = strtoul(yytext, NULL, 10);
+ return UCONST;
}
{hexdigit}+\/{hexdigit}+ {
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /