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

Commit0e20c48

Browse files
committed
Revert FETCH/MOVE int64 patch. Was using incorrect checks for
fetch/move in scan.l.
1 parentd387a07 commit0e20c48

File tree

10 files changed

+51
-115
lines changed

10 files changed

+51
-115
lines changed

‎src/backend/commands/portalcmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $PostgreSQL: pgsql/src/backend/commands/portalcmds.c,v 1.52 2006/09/02 18:17:17 momjian Exp $
17+
* $PostgreSQL: pgsql/src/backend/commands/portalcmds.c,v 1.53 2006/09/03 03:19:44 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -177,7 +177,7 @@ PerformPortalFetch(FetchStmt *stmt,
177177
char*completionTag)
178178
{
179179
Portalportal;
180-
int64nprocessed;
180+
longnprocessed;
181181

182182
/*
183183
* Disallow empty-string cursor name (conflicts with protocol-level
@@ -210,7 +210,7 @@ PerformPortalFetch(FetchStmt *stmt,
210210

211211
/* Return command status if wanted */
212212
if (completionTag)
213-
snprintf(completionTag,COMPLETION_TAG_BUFSIZE,"%s"INT64_FORMAT,
213+
snprintf(completionTag,COMPLETION_TAG_BUFSIZE,"%s%ld",
214214
stmt->ismove ?"MOVE" :"FETCH",
215215
nprocessed);
216216
}

‎src/backend/executor/spi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.160 2006/09/02 18:17:17 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.161 2006/09/03 03:19:44 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -45,7 +45,7 @@ static int_SPI_pquery(QueryDesc *queryDesc, long tcount);
4545

4646
staticvoid_SPI_error_callback(void*arg);
4747

48-
staticvoid_SPI_cursor_operation(Portalportal,boolforward,int64count,
48+
staticvoid_SPI_cursor_operation(Portalportal,boolforward,longcount,
4949
DestReceiver*dest);
5050

5151
static_SPI_plan*_SPI_copy_plan(_SPI_plan*plan,intlocation);
@@ -980,7 +980,7 @@ SPI_cursor_find(const char *name)
980980
*Fetch rows in a cursor
981981
*/
982982
void
983-
SPI_cursor_fetch(Portalportal,boolforward,int64count)
983+
SPI_cursor_fetch(Portalportal,boolforward,longcount)
984984
{
985985
_SPI_cursor_operation(portal,forward,count,
986986
CreateDestReceiver(DestSPI,NULL));
@@ -994,7 +994,7 @@ SPI_cursor_fetch(Portal portal, bool forward, int64 count)
994994
*Move in a cursor
995995
*/
996996
void
997-
SPI_cursor_move(Portalportal,boolforward,int64count)
997+
SPI_cursor_move(Portalportal,boolforward,longcount)
998998
{
999999
_SPI_cursor_operation(portal,forward,count,None_Receiver);
10001000
}
@@ -1639,10 +1639,10 @@ _SPI_error_callback(void *arg)
16391639
*Do a FETCH or MOVE in a cursor
16401640
*/
16411641
staticvoid
1642-
_SPI_cursor_operation(Portalportal,boolforward,int64count,
1642+
_SPI_cursor_operation(Portalportal,boolforward,longcount,
16431643
DestReceiver*dest)
16441644
{
1645-
int64nfetched;
1645+
longnfetched;
16461646

16471647
/* Check that the portal is valid */
16481648
if (!PortalIsValid(portal))

‎src/backend/parser/gram.y

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.563 2006/09/0300:46:41 momjian Exp $
14+
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.564 2006/09/0303:19:44 momjian Exp $
1515
*
1616
* HISTORY
1717
* AUTHORDATEMAJOR EVENT
@@ -116,7 +116,6 @@ static void doNegateFloat(Value *v);
116116
%union
117117
{
118118
intival;
119-
int64i64val;
120119
charchr;
121120
char*str;
122121
constchar*keyword;
@@ -325,7 +324,6 @@ static void doNegateFloat(Value *v);
325324
%type<boolean>opt_varyingopt_timezone
326325

327326
%type<ival>IconstSignedIconst
328-
%type<i64val>SignedI64const
329327
%type<str>Sconstcomment_text
330328
%type<str>RoleIdopt_granted_byopt_booleanColId_or_Sconst
331329
%type<list>var_listvar_list_or_default
@@ -450,7 +448,6 @@ static void doNegateFloat(Value *v);
450448
/* Special token types, not actually keywords - see the "lex" file*/
451449
%token<str>IDENTFCONSTSCONSTBCONSTXCONSTOp
452450
%token<ival>ICONSTPARAM
453-
%token<i64val>I64CONST
454451

455452
/* precedence: lowest to highest*/
456453
%nonassocSET/* see relation_expr_opt_alias*/
@@ -3359,27 +3356,6 @@ fetch_direction:
33593356
n->howMany =$1;
33603357
$$ = (Node *)n;
33613358
}
3362-
| ABSOLUTE_P SignedI64const
3363-
{
3364-
FetchStmt *n = makeNode(FetchStmt);
3365-
n->direction = FETCH_ABSOLUTE;
3366-
n->howMany =$2;
3367-
$$ = (Node *)n;
3368-
}
3369-
| RELATIVE_P SignedI64const
3370-
{
3371-
FetchStmt *n = makeNode(FetchStmt);
3372-
n->direction = FETCH_RELATIVE;
3373-
n->howMany =$2;
3374-
$$ = (Node *)n;
3375-
}
3376-
| SignedI64const
3377-
{
3378-
FetchStmt *n = makeNode(FetchStmt);
3379-
n->direction = FETCH_FORWARD;
3380-
n->howMany =$1;
3381-
$$ = (Node *)n;
3382-
}
33833359
| ALL
33843360
{
33853361
FetchStmt *n = makeNode(FetchStmt);
@@ -3401,13 +3377,6 @@ fetch_direction:
34013377
n->howMany =$2;
34023378
$$ = (Node *)n;
34033379
}
3404-
| FORWARD SignedI64const
3405-
{
3406-
FetchStmt *n = makeNode(FetchStmt);
3407-
n->direction = FETCH_FORWARD;
3408-
n->howMany =$2;
3409-
$$ = (Node *)n;
3410-
}
34113380
| FORWARD ALL
34123381
{
34133382
FetchStmt *n = makeNode(FetchStmt);
@@ -3429,13 +3398,6 @@ fetch_direction:
34293398
n->howMany =$2;
34303399
$$ = (Node *)n;
34313400
}
3432-
| BACKWARD SignedI64const
3433-
{
3434-
FetchStmt *n = makeNode(FetchStmt);
3435-
n->direction = FETCH_BACKWARD;
3436-
n->howMany =$2;
3437-
$$ = (Node *)n;
3438-
}
34393401
| BACKWARD ALL
34403402
{
34413403
FetchStmt *n = makeNode(FetchStmt);
@@ -8540,9 +8502,6 @@ RoleId:ColId{ $$ = $1; };
85408502
SignedIconst: ICONST{ $$ = $1; }
85418503
|'-' ICONST{ $$ = - $2; }
85428504
;
8543-
SignedI64const: I64CONST{ $$ = $1; }
8544-
|'-' I64CONST{ $$ = - $2; }
8545-
;
85468505

85478506
/*
85488507
* Name classification hierarchy.

‎src/backend/parser/scan.l

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* Portions Copyright (c) 1994, Regents of the University of California
2525
*
2626
* IDENTIFICATION
27-
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.136 2006/09/02 18:17:17 momjian Exp $
27+
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.137 2006/09/03 03:19:44 momjian Exp $
2828
*
2929
*-------------------------------------------------------------------------
3030
*/
@@ -666,22 +666,6 @@ other.
666666
#endif
667667
)
668668
{
669-
/* For Fetch/Move stmt, convert the string into int64 value */
670-
if((strcmp(yylval.keyword,"fetch")==0) || (strcmp(yylval.keyword,"move")==0))
671-
{
672-
int64 int64Val;
673-
errno =0;
674-
675-
int64Val =strtoll(yytext, &endptr,10);
676-
if (*endptr !='\0' || errno == ERANGE)
677-
{
678-
yylval.str =pstrdup(yytext);
679-
return FCONST;
680-
}
681-
yylval.i64val = int64Val;
682-
return I64CONST;
683-
}
684-
685669
/* integer too large, treat it as a float */
686670
yylval.str =pstrdup(yytext);
687671
return FCONST;

‎src/backend/tcop/postgres.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.504 2006/09/02 18:17:17 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.505 2006/09/03 03:19:44 momjian Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1687,7 +1687,7 @@ exec_bind_message(StringInfo input_message)
16871687
* Process an "Execute" message for a portal
16881688
*/
16891689
staticvoid
1690-
exec_execute_message(constchar*portal_name,int64max_rows)
1690+
exec_execute_message(constchar*portal_name,longmax_rows)
16911691
{
16921692
CommandDestdest;
16931693
DestReceiver*receiver;
@@ -3308,13 +3308,13 @@ PostgresMain(int argc, char *argv[], const char *username)
33083308
case'E':/* execute */
33093309
{
33103310
constchar*portal_name;
3311-
int64max_rows;
3311+
intmax_rows;
33123312

33133313
/* Set statement_timestamp() */
33143314
SetCurrentStatementStartTimestamp();
33153315

33163316
portal_name=pq_getmsgstring(&input_message);
3317-
max_rows=pq_getmsgint64(&input_message);
3317+
max_rows=pq_getmsgint(&input_message,4);
33183318
pq_getmsgend(&input_message);
33193319

33203320
exec_execute_message(portal_name,max_rows);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp