From 0ae5cb7dba50d84ac3af176b65e48321a09e1a43 Mon Sep 17 00:00:00 2001 From: MiguelNovelo Date: Tue, 2 Mar 2021 11:38:21 -0600 Subject: [PATCH] sql: fixing information_schema.columns.is_identity Previously, information_schema.columns.is_identity was set to null This was inadequate because is incorrect value To address this, this patch sets column to NO as identity columns are not yet supported Release justification: bug fixes and low-risk updates to new functionality Release note (sql change): fixed information_schema.columns.is_identity to display the correct value Fixes #61011 --- pkg/sql/information_schema.go | 15 ++++++++------- .../testdata/logic_test/information_schema | 10 ++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/pkg/sql/information_schema.go b/pkg/sql/information_schema.go index a07dd00fb851..48210bb62bf9 100755 --- a/pkg/sql/information_schema.go +++ b/pkg/sql/information_schema.go @@ -497,13 +497,14 @@ https://www.postgresql.org/docs/9.5/infoschema-columns.html`, dbNameStr, // udt_catalog udtSchema, // udt_schema tree.NewDString(column.GetType().PGName()), // udt_name - tree.DNull, // scope_catalog - tree.DNull, // scope_schema - tree.DNull, // scope_name - tree.DNull, // maximum_cardinality - tree.DNull, // dtd_identifier - tree.DNull, // is_self_referencing - tree.DNull, // is_identity + tree.DNull, // scope_catalog + tree.DNull, // scope_schema + tree.DNull, // scope_name + tree.DNull, // maximum_cardinality + tree.DNull, // dtd_identifier + tree.DNull, // is_self_referencing + //TODO: Need to update when supporting identiy columns (Issue #48532) + noString, // is_identity tree.DNull, // identity_generation tree.DNull, // identity_start tree.DNull, // identity_increment diff --git a/pkg/sql/logictest/testdata/logic_test/information_schema b/pkg/sql/logictest/testdata/logic_test/information_schema index 0256aaa4b9d2..41f00ba80ece 100755 --- a/pkg/sql/logictest/testdata/logic_test/information_schema +++ b/pkg/sql/logictest/testdata/logic_test/information_schema @@ -4301,3 +4301,13 @@ udt_schema udt_name sh d public e pg_catalog int8 + +# Testing information_schema.columns.is_identity which for now is False for every column +statement ok +SET DATABASE = ""; + +query T colnames +SELECT distinct is_identity FROM information_schema.columns +---- +is_identity +NO