Fixed --order-by broken by namespaces refactoring

Also added a regression test for it.

Bug and patch from Beena Emerson, thany you.
This commit is contained in:
Daniele Varrazzo 2013-04-22 11:16:28 +01:00
parent 109689586e
commit f886e0dba6
3 changed files with 6 additions and 0 deletions

View File

@ -78,3 +78,6 @@ ORDER BY relname;
ERROR: cannot specify --moveidx (-S) without --tablespace (-s)
\! pg_repack --dbname=contrib_regression --no-order --table=testts1 -S
ERROR: cannot specify --moveidx (-S) without --tablespace (-s)
-- not broken with order
\! pg_repack --dbname=contrib_regression -o id --table=testts1 --tablespace pg_default --moveidx
INFO: repacking table "testts1"

View File

@ -617,6 +617,7 @@ repack_one_database(const char *orderby, char *errbuf, size_t errsize)
/* User specified ORDER BY */
appendStringInfoString(&sql, " ORDER BY ");
appendStringInfoString(&sql, orderby);
table.create_table = sql.data;
}
repack_one_table(&table, orderby);

View File

@ -53,3 +53,5 @@ ORDER BY relname;
\! pg_repack --dbname=contrib_regression --no-order --table=testts1 --moveidx
\! pg_repack --dbname=contrib_regression --no-order --table=testts1 -S
-- not broken with order
\! pg_repack --dbname=contrib_regression -o id --table=testts1 --tablespace pg_default --moveidx