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

Commite0dc7d0

Browse files
committed
Rename several aliases for PLpgSQL_datum.dno to also be called dno.
Hopefully this will forestall future confusion about their roles.Jonah Harris
1 parente33e0c4 commite0dc7d0

File tree

5 files changed

+48
-48
lines changed

5 files changed

+48
-48
lines changed

‎src/pl/plpgsql/src/gram.y

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.115 2008/09/10 01:09:45 tgl Exp $
12+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.116 2008/11/05 00:07:53 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -430,7 +430,7 @@ decl_statement: decl_varname decl_const decl_datatype decl_notnull decl_defval
430430
if ($5 ==NULL)
431431
new->cursor_explicit_argrow = -1;
432432
else
433-
new->cursor_explicit_argrow =$5->rowno;
433+
new->cursor_explicit_argrow =$5->dno;
434434
new->cursor_options = CURSOR_OPT_FAST_PLAN |$2;
435435
}
436436
;
@@ -764,12 +764,12 @@ assign_var: T_SCALAR
764764
|T_ROW
765765
{
766766
check_assignable((PLpgSQL_datum *) yylval.row);
767-
$$ = yylval.row->rowno;
767+
$$ = yylval.row->dno;
768768
}
769769
|T_RECORD
770770
{
771771
check_assignable((PLpgSQL_datum *) yylval.rec);
772-
$$ = yylval.rec->recno;
772+
$$ = yylval.rec->dno;
773773
}
774774
|assign_var'['expr_until_rightbracket
775775
{
@@ -1036,7 +1036,7 @@ for_control:
10361036
new->cmd_type = PLPGSQL_STMT_FORC;
10371037
new->lineno =$1;
10381038

1039-
new->curvar = cursor->varno;
1039+
new->curvar = cursor->dno;
10401040

10411041
/* Should have had a single variable name*/
10421042
plpgsql_error_lineno =$2.lineno;
@@ -1557,7 +1557,7 @@ stmt_open: K_OPEN lno cursor_variable
15571557
new = palloc0(sizeof(PLpgSQL_stmt_open));
15581558
new->cmd_type = PLPGSQL_STMT_OPEN;
15591559
new->lineno =$2;
1560-
new->curvar =$3->varno;
1560+
new->curvar =$3->dno;
15611561
new->cursor_options = CURSOR_OPT_FAST_PLAN;
15621562

15631563
if ($3->cursor_explicit_expr ==NULL)
@@ -1621,7 +1621,7 @@ stmt_fetch: K_FETCH lno opt_fetch_direction cursor_variable K_INTO
16211621
fetch->lineno =$2;
16221622
fetch->rec= rec;
16231623
fetch->row= row;
1624-
fetch->curvar=$4->varno;
1624+
fetch->curvar=$4->dno;
16251625
fetch->is_move=false;
16261626

16271627
$$ = (PLpgSQL_stmt *)fetch;
@@ -1633,7 +1633,7 @@ stmt_move: K_MOVE lno opt_fetch_direction cursor_variable ';'
16331633
PLpgSQL_stmt_fetch *fetch =$3;
16341634

16351635
fetch->lineno =$2;
1636-
fetch->curvar=$4->varno;
1636+
fetch->curvar=$4->dno;
16371637
fetch->is_move=true;
16381638

16391639
$$ = (PLpgSQL_stmt *)fetch;
@@ -1653,7 +1653,7 @@ stmt_close: K_CLOSE lno cursor_variable ';'
16531653
new = palloc(sizeof(PLpgSQL_stmt_close));
16541654
new->cmd_type = PLPGSQL_STMT_CLOSE;
16551655
new->lineno =$2;
1656-
new->curvar =$3->varno;
1656+
new->curvar =$3->dno;
16571657

16581658
$$ = (PLpgSQL_stmt *)new;
16591659
}
@@ -2039,14 +2039,14 @@ read_sql_construct(int until,
20392039

20402040
case T_ROW:
20412041
snprintf(buf,sizeof(buf)," $%d",
2042-
assign_expr_param(yylval.row->rowno,
2042+
assign_expr_param(yylval.row->dno,
20432043
params, &nparams));
20442044
plpgsql_dstring_append(&ds, buf);
20452045
break;
20462046

20472047
case T_RECORD:
20482048
snprintf(buf,sizeof(buf)," $%d",
2049-
assign_expr_param(yylval.rec->recno,
2049+
assign_expr_param(yylval.rec->dno,
20502050
params, &nparams));
20512051
plpgsql_dstring_append(&ds, buf);
20522052
break;
@@ -2190,14 +2190,14 @@ make_execsql_stmt(const char *sqlstart, int lineno)
21902190

21912191
case T_ROW:
21922192
snprintf(buf,sizeof(buf)," $%d",
2193-
assign_expr_param(yylval.row->rowno,
2193+
assign_expr_param(yylval.row->dno,
21942194
params, &nparams));
21952195
plpgsql_dstring_append(&ds, buf);
21962196
break;
21972197

21982198
case T_RECORD:
21992199
snprintf(buf,sizeof(buf)," $%d",
2200-
assign_expr_param(yylval.rec->recno,
2200+
assign_expr_param(yylval.rec->dno,
22012201
params, &nparams));
22022202
plpgsql_dstring_append(&ds, buf);
22032203
break;
@@ -2363,11 +2363,11 @@ make_return_stmt(int lineno)
23632363
break;
23642364

23652365
case T_ROW:
2366-
new->retvarno = yylval.row->rowno;
2366+
new->retvarno = yylval.row->dno;
23672367
break;
23682368

23692369
case T_RECORD:
2370-
new->retvarno = yylval.rec->recno;
2370+
new->retvarno = yylval.rec->dno;
23712371
break;
23722372

23732373
default:
@@ -2416,11 +2416,11 @@ make_return_next_stmt(int lineno)
24162416
switch (yylex())
24172417
{
24182418
case T_ROW:
2419-
new->retvarno = yylval.row->rowno;
2419+
new->retvarno = yylval.row->dno;
24202420
break;
24212421

24222422
case T_RECORD:
2423-
new->retvarno = yylval.rec->recno;
2423+
new->retvarno = yylval.rec->dno;
24242424
break;
24252425

24262426
default:
@@ -2953,7 +2953,7 @@ make_case(int lineno, PLpgSQL_expr *t_expr,
29532953
plpgsql_build_variable("*case*", lineno,
29542954
plpgsql_build_datatype(INT4OID, -1),
29552955
false);
2956-
t_varno = t_var->varno;
2956+
t_varno = t_var->dno;
29572957
new->t_varno = t_varno;
29582958

29592959
foreach(l, case_when_list)

‎src/pl/plpgsql/src/pl_comp.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.131 2008/10/09 16:35:07 tgl Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.132 2008/11/05 00:07:53 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -468,7 +468,7 @@ do_compile(FunctionCallInfo fcinfo,
468468
num_out_args);
469469

470470
plpgsql_adddatum((PLpgSQL_datum*)row);
471-
function->out_param_varno=row->rowno;
471+
function->out_param_varno=row->dno;
472472
}
473473

474474
/*
@@ -580,11 +580,11 @@ do_compile(FunctionCallInfo fcinfo,
580580

581581
/* Add the record for referencing NEW */
582582
rec=plpgsql_build_record("new",0, true);
583-
function->new_varno=rec->recno;
583+
function->new_varno=rec->dno;
584584

585585
/* Add the record for referencing OLD */
586586
rec=plpgsql_build_record("old",0, true);
587-
function->old_varno=rec->recno;
587+
function->old_varno=rec->dno;
588588

589589
/* Add the variable tg_name */
590590
var=plpgsql_build_variable("tg_name",0,
@@ -1445,7 +1445,7 @@ plpgsql_build_variable(const char *refname, int lineno, PLpgSQL_type *dtype,
14451445
plpgsql_adddatum((PLpgSQL_datum*)var);
14461446
if (add2namespace)
14471447
plpgsql_ns_additem(PLPGSQL_NSTYPE_VAR,
1448-
var->varno,
1448+
var->dno,
14491449
refname);
14501450
result= (PLpgSQL_variable*)var;
14511451
break;
@@ -1464,7 +1464,7 @@ plpgsql_build_variable(const char *refname, int lineno, PLpgSQL_type *dtype,
14641464
plpgsql_adddatum((PLpgSQL_datum*)row);
14651465
if (add2namespace)
14661466
plpgsql_ns_additem(PLPGSQL_NSTYPE_ROW,
1467-
row->rowno,
1467+
row->dno,
14681468
refname);
14691469
result= (PLpgSQL_variable*)row;
14701470
break;
@@ -1511,7 +1511,7 @@ plpgsql_build_record(const char *refname, int lineno, bool add2namespace)
15111511
rec->freetup= false;
15121512
plpgsql_adddatum((PLpgSQL_datum*)rec);
15131513
if (add2namespace)
1514-
plpgsql_ns_additem(PLPGSQL_NSTYPE_REC,rec->recno,rec->refname);
1514+
plpgsql_ns_additem(PLPGSQL_NSTYPE_REC,rec->dno,rec->refname);
15151515

15161516
returnrec;
15171517
}

‎src/pl/plpgsql/src/pl_exec.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.223 2008/11/02 01:45:28 tgl Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.224 2008/11/05 00:07:54 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1665,7 +1665,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
16651665
boolfound= false;
16661666
intrc=PLPGSQL_RC_OK;
16671667

1668-
var= (PLpgSQL_var*) (estate->datums[stmt->var->varno]);
1668+
var= (PLpgSQL_var*) (estate->datums[stmt->var->dno]);
16691669

16701670
/*
16711671
* Get the value of the lower bound
@@ -2831,9 +2831,9 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
28312831

28322832
/* Determine if we assign to a record or a row */
28332833
if (stmt->rec!=NULL)
2834-
rec= (PLpgSQL_rec*) (estate->datums[stmt->rec->recno]);
2834+
rec= (PLpgSQL_rec*) (estate->datums[stmt->rec->dno]);
28352835
elseif (stmt->row!=NULL)
2836-
row= (PLpgSQL_row*) (estate->datums[stmt->row->rowno]);
2836+
row= (PLpgSQL_row*) (estate->datums[stmt->row->dno]);
28372837
else
28382838
elog(ERROR,"unsupported target");
28392839

@@ -3009,9 +3009,9 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
30093009

30103010
/* Determine if we assign to a record or a row */
30113011
if (stmt->rec!=NULL)
3012-
rec= (PLpgSQL_rec*) (estate->datums[stmt->rec->recno]);
3012+
rec= (PLpgSQL_rec*) (estate->datums[stmt->rec->dno]);
30133013
elseif (stmt->row!=NULL)
3014-
row= (PLpgSQL_row*) (estate->datums[stmt->row->rowno]);
3014+
row= (PLpgSQL_row*) (estate->datums[stmt->row->dno]);
30153015
else
30163016
elog(ERROR,"unsupported target");
30173017

@@ -3320,9 +3320,9 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
33203320
* ----------
33213321
*/
33223322
if (stmt->rec!=NULL)
3323-
rec= (PLpgSQL_rec*) (estate->datums[stmt->rec->recno]);
3323+
rec= (PLpgSQL_rec*) (estate->datums[stmt->rec->dno]);
33243324
elseif (stmt->row!=NULL)
3325-
row= (PLpgSQL_row*) (estate->datums[stmt->row->rowno]);
3325+
row= (PLpgSQL_row*) (estate->datums[stmt->row->dno]);
33263326
else
33273327
elog(ERROR,"unsupported target");
33283328

@@ -4174,9 +4174,9 @@ exec_for_query(PLpgSQL_execstate *estate, PLpgSQL_stmt_forq *stmt,
41744174
* Determine if we assign to a record or a row
41754175
*/
41764176
if (stmt->rec!=NULL)
4177-
rec= (PLpgSQL_rec*) (estate->datums[stmt->rec->recno]);
4177+
rec= (PLpgSQL_rec*) (estate->datums[stmt->rec->dno]);
41784178
elseif (stmt->row!=NULL)
4179-
row= (PLpgSQL_row*) (estate->datums[stmt->row->rowno]);
4179+
row= (PLpgSQL_row*) (estate->datums[stmt->row->dno]);
41804180
else
41814181
elog(ERROR,"unsupported target");
41824182

‎src/pl/plpgsql/src/pl_funcs.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.73 2008/08/29 13:02:33 petere Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.74 2008/11/05 00:07:54 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -893,12 +893,12 @@ dump_fetch(PLpgSQL_stmt_fetch *stmt)
893893
if (stmt->rec!=NULL)
894894
{
895895
dump_ind();
896-
printf(" target = %d %s\n",stmt->rec->recno,stmt->rec->refname);
896+
printf(" target = %d %s\n",stmt->rec->dno,stmt->rec->refname);
897897
}
898898
if (stmt->row!=NULL)
899899
{
900900
dump_ind();
901-
printf(" target = %d %s\n",stmt->row->rowno,stmt->row->refname);
901+
printf(" target = %d %s\n",stmt->row->dno,stmt->row->refname);
902902
}
903903
dump_indent-=2;
904904
}
@@ -1107,14 +1107,14 @@ dump_execsql(PLpgSQL_stmt_execsql *stmt)
11071107
dump_ind();
11081108
printf(" INTO%s target = %d %s\n",
11091109
stmt->strict ?" STRICT" :"",
1110-
stmt->rec->recno,stmt->rec->refname);
1110+
stmt->rec->dno,stmt->rec->refname);
11111111
}
11121112
if (stmt->row!=NULL)
11131113
{
11141114
dump_ind();
11151115
printf(" INTO%s target = %d %s\n",
11161116
stmt->strict ?" STRICT" :"",
1117-
stmt->row->rowno,stmt->row->refname);
1117+
stmt->row->dno,stmt->row->refname);
11181118
}
11191119
dump_indent-=2;
11201120
}
@@ -1133,14 +1133,14 @@ dump_dynexecute(PLpgSQL_stmt_dynexecute *stmt)
11331133
dump_ind();
11341134
printf(" INTO%s target = %d %s\n",
11351135
stmt->strict ?" STRICT" :"",
1136-
stmt->rec->recno,stmt->rec->refname);
1136+
stmt->rec->dno,stmt->rec->refname);
11371137
}
11381138
if (stmt->row!=NULL)
11391139
{
11401140
dump_ind();
11411141
printf(" INTO%s target = %d %s\n",
11421142
stmt->strict ?" STRICT" :"",
1143-
stmt->row->rowno,stmt->row->refname);
1143+
stmt->row->dno,stmt->row->refname);
11441144
}
11451145
if (stmt->params!=NIL)
11461146
{

‎src/pl/plpgsql/src/plpgsql.h

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/pl/plpgsql/src/plpgsql.h,v 1.104 2008/11/04 21:00:15 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/plpgsql.h,v 1.105 2008/11/0500:07:54 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -191,7 +191,7 @@ typedef struct
191191
typedefstructPLpgSQL_expr
192192
{/* SQL Query to plan and execute*/
193193
intdtype;
194-
intexprno;
194+
intdno;
195195
char*query;
196196
SPIPlanPtrplan;
197197
Oid*plan_argtypes;
@@ -217,7 +217,7 @@ typedef struct PLpgSQL_expr
217217
typedefstruct
218218
{/* Scalar variable */
219219
intdtype;
220-
intvarno;
220+
intdno;
221221
char*refname;
222222
intlineno;
223223

@@ -238,7 +238,7 @@ typedef struct
238238
typedefstruct
239239
{/* Row variable */
240240
intdtype;
241-
introwno;
241+
intdno;
242242
char*refname;
243243
intlineno;
244244

@@ -260,7 +260,7 @@ typedef struct
260260
typedefstruct
261261
{/* Record variable (non-fixed structure) */
262262
intdtype;
263-
intrecno;
263+
intdno;
264264
char*refname;
265265
intlineno;
266266

@@ -274,7 +274,7 @@ typedef struct
274274
typedefstruct
275275
{/* Field in record */
276276
intdtype;
277-
intrfno;
277+
intdno;
278278
char*fieldname;
279279
intrecparentno;/* dno of parent record */
280280
}PLpgSQL_recfield;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp