diff's query should account for table having no columns (#1256)

This commit is contained in:
Vamshi Surabhi 2018-12-21 15:24:22 +05:30 committed by GitHub
parent ea4d2644e8
commit be1d9414f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 2 deletions

View File

@ -58,7 +58,7 @@ fetchTableMeta = do
t.table_schema,
t.table_name,
t.table_oid,
c.columns,
coalesce(c.columns, '[]') as columns,
coalesce(f.constraints, '[]') as constraints
FROM
(SELECT
@ -72,7 +72,7 @@ fetchTableMeta = do
ON
c.relnamespace = n.oid
) t
INNER JOIN
LEFT OUTER JOIN
(SELECT
table_schema,
table_name,

View File

@ -0,0 +1,32 @@
url: /v1/query
status: 200
response:
- {result: null, result_type: CommandOk}
- {message: success}
- {result: null, result_type: CommandOk}
- []
query:
type: bulk
args:
- type: run_sql
args:
sql: |
create table hge_tests.t ();
- type: track_table
args:
schema: hge_tests
name: t
- type: run_sql
args:
sql: |
drop table hge_tests.t;
- type: select
args:
table:
schema: hdb_catalog
name: hdb_table
columns:
- table_name
where:
table_name: t
table_schema: hge_tests

View File

@ -2,6 +2,9 @@ import yaml
from validate import check_query_f
from super_classes import DefaultTestSelectQueries, DefaultTestQueries
class TestDropNoColsTable:
def test_drop_no_cols_table(self, hge_ctx):
check_query_f(hge_ctx, 'queries/v1/ddl/drop_no_cols_table.yaml')
class TestV1General(DefaultTestQueries):