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

Commita5e9e51

Browse files
committed
on my timetravel.c I find a bug: after the
ALTER TABLE mytable drop column last_column_of_table;the timetravel trigger say on UPDATE/DELETE:ERROR: parser: parse error at end of inputHere is the patch for this bugB?jthe Zolt?n
1 parent92e100d commita5e9e51

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎contrib/spi/timetravel.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ timetravel(PG_FUNCTION_ARGS)
309309
void*pplan;
310310
Oid*ctypes;
311311
charsql[8192];
312+
charsepar=' ';
312313

313314
/* allocate ctypes for preparation */
314315
ctypes= (Oid*)palloc(natts*sizeof(Oid));
@@ -321,13 +322,12 @@ timetravel(PG_FUNCTION_ARGS)
321322
{
322323
ctypes[i-1]=SPI_gettypeid(tupdesc,i);
323324
if (!(tupdesc->attrs[i-1]->attisdropped))/* skip dropped columns */
324-
snprintf(sql+strlen(sql),sizeof(sql)-strlen(sql),"$%d%s",
325-
i, (i<natts) ?", " :")");
326-
#if0
327-
snprintf(sql+strlen(sql),sizeof(sql)-strlen(sql),"$%d /* %d */ %s",
328-
i,ctypes[i-1], (i<natts) ?", " :")");
329-
#endif
325+
{
326+
snprintf(sql+strlen(sql),sizeof(sql)-strlen(sql),"%c$%d",separ,i);
327+
separ=',';
328+
}
330329
}
330+
snprintf(sql+strlen(sql),sizeof(sql)-strlen(sql),")");
331331

332332
elog(DEBUG4,"timetravel (%s) update: sql: %s",relname,sql);
333333

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp