Merge pull request #3495 from citusdata/fix-information-schema-join

Add test for issue 2717, does not reproduce issue
pull/3494/head
Philip Dubé 2020-02-19 00:33:38 +00:00 committed by GitHub
commit 36bb85e5c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 3 deletions

View File

@ -242,8 +242,25 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT user_id FROM
(2 rows)
SET client_min_messages TO DEFAULT;
-- Test https://github.com/citusdata/citus/issues/2717
create table test_dist (id int, table_name text, column_name text);
select create_distributed_table('test_dist','id');
create_distributed_table
---------------------------------------------------------------------
(1 row)
insert into test_dist values (1, 'test_dist', 'table_name');
with q as (
select icl.* from test_dist td
join information_schema.columns icl on icl.table_name::text = lower(td.table_name) and icl.column_name::text = lower(td.column_name)
) select column_name from q;
column_name
---------------------------------------------------------------------
table_name
(1 row)
\set VERBOSITY terse
DROP SCHEMA subquery_local_tables CASCADE;
NOTICE: drop cascades to 2 other objects
DETAIL: drop cascades to table users_table_local
drop cascades to table events_table_local
NOTICE: drop cascades to 3 other objects
SET search_path TO public;

View File

@ -200,5 +200,15 @@ ORDER BY 1;
SET client_min_messages TO DEFAULT;
-- Test https://github.com/citusdata/citus/issues/2717
create table test_dist (id int, table_name text, column_name text);
select create_distributed_table('test_dist','id');
insert into test_dist values (1, 'test_dist', 'table_name');
with q as (
select icl.* from test_dist td
join information_schema.columns icl on icl.table_name::text = lower(td.table_name) and icl.column_name::text = lower(td.column_name)
) select column_name from q;
\set VERBOSITY terse
DROP SCHEMA subquery_local_tables CASCADE;
SET search_path TO public;