Fix small bug for build without HAVE_SYMLINK

Started by YUriy Zhuravlevover 10 years ago2 messages
#1YUriy Zhuravlev
u.zhuravlev@postgrespro.ru
1 attachment(s)

Hello hackers.

During my work on CMake I stumbled upon this simple bug. I think this is
important for mingw users.
The function is trying to return a variable that has not been announced.

Patch in attach. Probably relevant for stable releases.

Thanks!
--
YUriy Zhuravlev
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachments:

have_symlink_bugfix_v1.patchtext/x-patch; charset=UTF-8; name=have_symlink_bugfix_v1.patchDownload
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index ff0d904..eba9c6a 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -383,13 +383,15 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
 
 	/* We keep the lock on pg_tablespace until commit */
 	heap_close(rel, NoLock);
+
+	return tablespaceoid;
 #else							/* !HAVE_SYMLINK */
 	ereport(ERROR,
 			(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
 			 errmsg("tablespaces are not supported on this platform")));
-#endif   /* HAVE_SYMLINK */
 
-	return tablespaceoid;
+	return InvalidOid;
+#endif   /* HAVE_SYMLINK */
 }
 
 /*
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: YUriy Zhuravlev (#1)
Re: Fix small bug for build without HAVE_SYMLINK

YUriy Zhuravlev <u.zhuravlev@postgrespro.ru> writes:

During my work on CMake I stumbled upon this simple bug. I think this is
important for mingw users.
The function is trying to return a variable that has not been announced.

Patch in attach. Probably relevant for stable releases.

Will commit, thanks!

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers