You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include unique constraints metadata in sys.objects view (#3658) (#3660)
This commit rectifies the type check for fetching metadata of both
primary key and unique constraints from sys.key_constraints catalog
inorder to correctly populate sys.objects view.
Task: BABEL-5712
Signed-off-by: Roshan Kanwar <rskanwar@amazon.com>
-- Note: sys.objects not showing unique constraints currently
82
81
select constraint_name, constraint_schema, table_name, constraint_type from information_schema.table_constraints where table_name in ('tbl_pk','tbl_fk') order by constraint_name, constraint_schema;
83
82
select name, schema_name(schema_id) as schname, object_name(parent_object_id),type_desc from sys.objects where type in ('C','F','PK','UQ') and object_name(parent_object_id) in ('tbl_pk','tbl_fk') order by name, schname;
-- Note: sys.objects not showing unique constraints currently
98
97
select constraint_name, constraint_schema, table_name, constraint_type from information_schema.table_constraints order by constraint_name, constraint_schema;
99
98
select name, schema_name(schema_id) as schname, object_name(parent_object_id),type_desc from sys.objects where type in ('C','F','PK','UQ') order by name, schname;
-- Note: sys.objects not showing unique constraints currently
353
353
select constraint_name, constraint_schema, table_name, constraint_type from information_schema.table_constraints order by constraint_name, constraint_schema;
354
354
select name, schema_name(schema_id) as schname, object_name(parent_object_id),type_desc from sys.objects where type in ('C','F','PK','UQ') order by name, schname;
Copy file name to clipboardExpand all lines: test/JDBC/input/ISC-Table_Constraints-vu-verify.mix
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,6 @@ select * from information_schema.table_constraints where table_name in ('tbl_pk'
22
22
go
23
23
24
24
-- verify from sys.objects
25
-
-- Note: sys.objects not showing unique constraints currently
26
25
select constraint_name, constraint_schema, table_name, constraint_type from information_schema.table_constraints where table_name in ('tbl_pk','tbl_fk') order by constraint_name, constraint_schema;
27
26
select name, schema_name(schema_id) as schname, object_name(parent_object_id),type_desc from sys.objects where type in ('C','F','PK','UQ') and object_name(parent_object_id) in ('tbl_pk','tbl_fk') order by name, schname;
Copy file name to clipboardExpand all lines: test/JDBC/input/ISC-Table_Constraints.mix
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,6 @@ select * from information_schema.table_constraints where table_name in ('tbl_pk'
47
47
go
48
48
49
49
-- verify from sys.objects
50
-
-- Note: sys.objects not showing unique constraints currently
51
50
select constraint_name, constraint_schema, table_name, constraint_type from information_schema.table_constraints order by constraint_name, constraint_schema;
52
51
53
52
select name, schema_name(schema_id) as schname, object_name(parent_object_id),type_desc from sys.objects where type in ('C','F','PK','UQ') order by name, schname;
@@ -210,7 +209,6 @@ select * from information_schema.table_constraints where table_name in ('tbl_pk'
210
209
go
211
210
212
211
-- verify from sys.objects
213
-
-- Note: sys.objects not showing unique constraints currently
214
212
select constraint_name, constraint_schema, table_name, constraint_type from information_schema.table_constraints order by constraint_name, constraint_schema;
215
213
216
214
select name, schema_name(schema_id) as schname, object_name(parent_object_id),type_desc from sys.objects where type in ('C','F','PK','UQ') order by name, schname;
0 commit comments