提交 073a7cfb 编写于 作者: H Heikki Linnakangas

Fix pgbench.

It was left broken by the 9.2 merge. Need to use getopt_long() now, as in
upstream, and we were passing wrong variable to snprintf(). Both of these
were causing compiler warnings, and the latter was causing a segfault.

We don't seem to have any tests for pgbench. I think we'll get some from
upstream later on, and pgbench isn't super-critical anyway, so I didn't
address that at this moment.
上级 891839df
......@@ -1341,11 +1341,11 @@ init(void)
if (ddl->declare_fillfactor)
snprintf(opts + strlen(opts), 256 - strlen(opts),
" with (fillfactor=%d, %s) DISTRIBUTED BY (%s)",
fillfactor, storage_clause, ddl->declare_fillfactor);
fillfactor, storage_clause, ddl->distributed_col);
else
snprintf(opts + strlen(opts), 256 - strlen(opts),
" with (%s) DISTRIBUTED BY (%s)",
storage_clause, ddl->declare_fillfactor);
storage_clause, ddl->distributed_col);
if (tablespace != NULL)
{
char *escape_tablespace;
......@@ -1940,7 +1940,7 @@ main(int argc, char **argv)
state = (CState *) xmalloc(sizeof(CState));
memset(state, 0, sizeof(CState));
while ((c = getopt(argc, argv, "ih:nvp:dSNc:Crs:t:T:U:lf:D:F:M:j:x:q")) != -1)
while ((c = getopt_long(argc, argv, "ih:nvp:dSNc:Crs:t:T:U:lf:D:F:M:j:x:q", long_options, &optindex)) != -1)
{
switch (c)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册