From f7722271ebb48ce5da417bd5ea1ae00e0eb5d69f Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Fri, 6 Jan 2023 23:59:35 +0300 Subject: [PATCH] test: add additional tests for create table statement --- test/corpus/create/table.txt | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/test/corpus/create/table.txt b/test/corpus/create/table.txt index a1b36a2..ecba859 100644 --- a/test/corpus/create/table.txt +++ b/test/corpus/create/table.txt @@ -36,3 +36,77 @@ create table public.foo (); ) ) ) + +================================================================================ +Create an empty temporary table +================================================================================ +create temporary table foo (); +create temp table foo (); +-------------------------------------------------------------------------------- + +(source_file + (statement + (create_table + (keyword_create) + (keyword_temporary) + (keyword_table) + (table_reference + name: (identifier) + ) + (column_definitions) + ) + ) + (statement + (create_table + (keyword_create) + (keyword_temporary) + (keyword_table) + (table_reference + name: (identifier) + ) + (column_definitions) + ) + ) +) + +================================================================================ +Create an empty unlogged table +================================================================================ +create unlogged table foo (); +-------------------------------------------------------------------------------- + +(source_file + (statement + (create_table + (keyword_create) + (keyword_unlogged) + (keyword_table) + (table_reference + name: (identifier) + ) + (column_definitions) + ) + ) +) + +================================================================================ +Create an empty table if not exists +================================================================================ +create table if not exists foo (); +-------------------------------------------------------------------------------- + +(source_file + (statement + (create_table + (keyword_create) + (keyword_table) + (keyword_if) + (keyword_not) + (keyword_exists) + (table_reference + name: (identifier) + ) + (column_definitions) + ) + ) +)