提交 10d13f54 编写于 作者: H Heikki Linnakangas

Fix checks for non-existent or duplicated columns in COLUMN ENCODING.

These checks are supposed to run on the original user-supplied clauses,
not the clauses derived from the user-supplied values and defaults. The
derived clauses always pass the checks.

Fixes https://github.com/greenplum-db/gpdb/issues/10115Reviewed-by: NAshwin Agrawal <aagrawal@pivotal.io>
上级 391b78eb
......@@ -4550,6 +4550,8 @@ transformAttributeEncoding(List *stenc, CreateStmt *stmt, List *columns)
if (stenc && !can_enc)
UNSUPPORTED_ORIENTATION_ERROR();
validateColumnStorageEncodingClauses(stenc, columns);
/* get the default clause, if there is one. */
foreach(lc, stenc)
{
......@@ -4658,8 +4660,6 @@ transformAttributeEncoding(List *stenc, CreateStmt *stmt, List *columns)
newenc = NULL;
}
validateColumnStorageEncodingClauses(newenc, columns);
return newenc;
}
......
......@@ -479,6 +479,17 @@ ERROR: compresslevel=19 is out of range for zlib (should be in the range 1 to 9
create table t1 (i int encoding (compresstype=zlib, ahhhh=boooooo))
with (appendonly=true, orientation=column);
ERROR: unrecognized parameter "ahhhh"
-- Invalid column references in COLUMN ENCODING clause
create table t1 (i text,
column non_existent encoding (compresstype=zlib))
with (appendonly=true, orientation=column);
ERROR: column "non_existent" does not exist
-- Conflicting column references for the same column
create table t1 (dupe text,
column dupe encoding (compresstype=zlib),
column dupe encoding (compresstype=zlib))
with (appendonly=true, orientation=column);
ERROR: column "dupe" referenced in more than one COLUMN ENCODING clause
-- Inheritance: check that we don't support inheritance on tables using
-- column compression
create table ccddlparent (i int encoding (compresstype=zlib))
......
......@@ -180,6 +180,17 @@ with (appendonly=true, orientation=column);
create table t1 (i int encoding (compresstype=zlib, ahhhh=boooooo))
with (appendonly=true, orientation=column);
-- Invalid column references in COLUMN ENCODING clause
create table t1 (i text,
column non_existent encoding (compresstype=zlib))
with (appendonly=true, orientation=column);
-- Conflicting column references for the same column
create table t1 (dupe text,
column dupe encoding (compresstype=zlib),
column dupe encoding (compresstype=zlib))
with (appendonly=true, orientation=column);
-- Inheritance: check that we don't support inheritance on tables using
-- column compression
create table ccddlparent (i int encoding (compresstype=zlib))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册