mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
diff's query should account for table having no columns (#1256)
This commit is contained in:
parent
ea4d2644e8
commit
be1d9414f8
@ -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,
|
||||
|
32
server/tests-py/queries/v1/ddl/drop_no_cols_table.yaml
Normal file
32
server/tests-py/queries/v1/ddl/drop_no_cols_table.yaml
Normal 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
|
@ -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):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user