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

Commit4951a88

Browse files
committed
copyObject() and equal() now know about all parse-time node types,
including utility statements. Still can't copy or compare executorstate, but at present that doesn't seem to be necessary. This makesit possible to execute most (all?) utility statements in plpgsql.Had to change parsetree representation of CreateTrigStmt so that itcontained only legal Nodes, and not bare string constants.
1 parent66fd8f8 commit4951a88

File tree

6 files changed

+2421
-184
lines changed

6 files changed

+2421
-184
lines changed

‎src/backend/commands/trigger.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.75 2000/08/03 19:19:18 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.76 2000/08/11 23:45:28 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -212,7 +212,7 @@ CreateTrigger(CreateTrigStmt *stmt)
212212

213213
foreach(le,stmt->args)
214214
{
215-
char*ar= (char*)lfirst(le);
215+
char*ar= ((Value*)lfirst(le))->val.str;
216216

217217
len+=strlen(ar)+4;
218218
for (;*ar;ar++)
@@ -222,10 +222,10 @@ CreateTrigger(CreateTrigStmt *stmt)
222222
}
223223
}
224224
args= (char*)palloc(len+1);
225-
args[0]=0;
225+
args[0]='\0';
226226
foreach(le,stmt->args)
227227
{
228-
char*s= (char*)lfirst(le);
228+
char*s= ((Value*)lfirst(le))->val.str;
229229
char*d=args+strlen(args);
230230

231231
while (*s)
@@ -234,8 +234,7 @@ CreateTrigger(CreateTrigStmt *stmt)
234234
*d++='\\';
235235
*d++=*s++;
236236
}
237-
*d=0;
238-
strcat(args,"\\000");
237+
strcpy(d,"\\000");
239238
}
240239
values[Anum_pg_trigger_tgnargs-1]=Int16GetDatum(nargs);
241240
values[Anum_pg_trigger_tgargs-1]=DirectFunctionCall1(byteain,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp