!2399 针对default属性,补齐pg_get_tabledef()显示结果的漏洞

Merge pull request !2399 from 吕辉/pg_get_tabledef
This commit is contained in:
opengauss-bot
2022-11-26 06:41:59 +00:00
committed by Gitee
2 changed files with 2 additions and 2 deletions

View File

@ -1641,7 +1641,7 @@ static int get_table_attribute(
find_nextval_seqoid_walker(adexpr, &tableinfo->autoinc_seqoid);
tableinfo->autoinc_attnum = attrdef->adnum;
appendStringInfo(buf, " %s", adsrc);
} else {
} else if (pg_strcasecmp(adsrc, "") != 0) {
appendStringInfo(buf, " DEFAULT %s", adsrc);
}
if (isOnUpdate) {

View File

@ -788,7 +788,7 @@ select * from pg_get_tabledef('test');
CREATE TABLE test ( +
a integer, +
b timestamp without time zone DEFAULT now() ON UPDATE CURRENT_TIMESTAMP,+
c timestamp with time zone DEFAULT ON UPDATE CURRENT_TIMESTAMP(5) +
c timestamp with time zone ON UPDATE CURRENT_TIMESTAMP(5) +
) +
WITH (orientation=row, compression=no);
(1 row)