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

Commit54b38d2

Browse files
committed
Fix breakage from recent variable-handling changes.
1 parent4d4953f commit54b38d2

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

‎src/bin/psql/large_obj.c

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000-2002 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.24 2003/03/20 06:43:35 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.25 2003/04/18 23:38:47 tgl Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"large_obj.h"
@@ -45,14 +45,15 @@ handle_transaction(void)
4545
PQnoticeProcessorold_notice_hook;
4646

4747
switch (SwitchVariable(pset.vars,"LO_TRANSACTION",
48-
"nothing",
49-
"commit",
50-
NULL))
48+
"nothing",
49+
"commit",
50+
NULL))
5151
{
52-
case1:
53-
return true;
54-
case2:
55-
commit= true;
52+
case1:/* nothing */
53+
return true;
54+
case2:/* commit */
55+
commit= true;
56+
break;
5657
}
5758

5859
notice[0]='\0';
@@ -94,7 +95,7 @@ do_lo_export(const char *loid_arg, const char *filename_arg)
9495
intstatus;
9596
boolown_transaction;
9697

97-
own_transaction=VariableEquals(pset.vars,"LO_TRANSACTION","nothing");
98+
own_transaction=!VariableEquals(pset.vars,"LO_TRANSACTION","nothing");
9899

99100
if (!pset.db)
100101
{
@@ -159,7 +160,7 @@ do_lo_import(const char *filename_arg, const char *comment_arg)
159160
unsignedinti;
160161
boolown_transaction;
161162

162-
own_transaction=VariableEquals(pset.vars,"LO_TRANSACTION","nothing");
163+
own_transaction=!VariableEquals(pset.vars,"LO_TRANSACTION","nothing");
163164

164165
if (!pset.db)
165166
{
@@ -272,10 +273,9 @@ do_lo_unlink(const char *loid_arg)
272273
intstatus;
273274
Oidloid=atooid(loid_arg);
274275
charbuf[256];
275-
276276
boolown_transaction;
277277

278-
own_transaction=VariableEquals(pset.vars,"LO_TRANSACTION","nothing");
278+
own_transaction=!VariableEquals(pset.vars,"LO_TRANSACTION","nothing");
279279

280280
if (!pset.db)
281281
{
@@ -311,9 +311,10 @@ do_lo_unlink(const char *loid_arg)
311311
/* XXX ought to replace this with some kind of COMMENT command */
312312
if (pset.issuper)
313313
{
314-
sprintf(buf,"DELETE FROM pg_catalog.pg_description WHERE objoid = '%u' "
315-
"AND classoid = 'pg_catalog.pg_largeobject'::regclass",
316-
loid);
314+
snprintf(buf,sizeof(buf),
315+
"DELETE FROM pg_catalog.pg_description WHERE objoid = '%u' "
316+
"AND classoid = 'pg_catalog.pg_largeobject'::regclass",
317+
loid);
317318
if (!(res=PSQLexec(buf, false)))
318319
{
319320
if (own_transaction)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp