From db4877301dc2a2913c50d9fbc01292bc7965dd90 Mon Sep 17 00:00:00 2001 From: lukeman Date: Fri, 28 Mar 2025 10:32:01 +0800 Subject: [PATCH] =?UTF-8?q?D=E5=BA=93=E5=88=9B=E5=BB=BA=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=88=97=E4=B8=8D=E6=8C=87=E5=AE=9APERSISTED=E6=97=B6=E7=BB=99?= =?UTF-8?q?=E5=87=BA=E7=94=A8=E6=88=B7=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contrib/shark/expected/test_ddl_and_dml.out | 2 ++ contrib/shark/src/backend_parser/gram-tsql-rule.y | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/contrib/shark/expected/test_ddl_and_dml.out b/contrib/shark/expected/test_ddl_and_dml.out index 0fd616c201..7080a14698 100644 --- a/contrib/shark/expected/test_ddl_and_dml.out +++ b/contrib/shark/expected/test_ddl_and_dml.out @@ -10,6 +10,7 @@ CREATE TABLE Products( UnitPrice money, InventoryValue AS (QtyAvailable * UnitPrice) ); +NOTICE: The virtual computed columns (non-persisted) are currently ignored and behave the same as persisted columns. ALTER TABLE Products ADD RetailValue AS (QtyAvailable * UnitPrice * 1.5) PERSISTED; INSERT INTO Products (QtyAvailable, UnitPrice) VALUES (25, 2.00), (10, 1.5); select * from Products; @@ -51,6 +52,7 @@ DROP TABLE IF EXISTS Products; DROP TABLE IF EXISTS Products; NOTICE: table "products" does not exist, skipping CREATE TABLE Products(QtyAvailable smallint, UnitPrice money, InventoryValue AS (QtyAvailable * UnitPrice)); +NOTICE: The virtual computed columns (non-persisted) are currently ignored and behave the same as persisted columns. INSERT INTO Products(QtyAvailable, UnitPrice) VALUES (25, 2.00), (10, 1.5), (25, 2.00), (10, 1.5), (10, 1.5); -- top N select DISTINCT TOP 1 * from Products; diff --git a/contrib/shark/src/backend_parser/gram-tsql-rule.y b/contrib/shark/src/backend_parser/gram-tsql-rule.y index 61f3343307..20ae2c4e5a 100644 --- a/contrib/shark/src/backend_parser/gram-tsql-rule.y +++ b/contrib/shark/src/backend_parser/gram-tsql-rule.y @@ -834,6 +834,10 @@ TSQL_computed_column: errmsg("Working Version Num less than %u does not support computed columns.", COMPUTED_COLUMNS_VERSION_NUMBER))); } + + ereport(NOTICE, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("The virtual computed columns (non-persisted) are currently ignored and behave the same as persisted columns."))); Constraint *n = makeNode(Constraint); -- Gitee