aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivanmorozov <ivanmorozov@yandex-team.com>2022-11-23 16:23:43 +0300
committerivanmorozov <ivanmorozov@yandex-team.com>2022-11-23 16:23:43 +0300
commitb59871c639b7b97ebe658e1d25bca1a4c0534555 (patch)
treec1756d81ca086584d51f1f81d0bf9ac83ddc1f6b
parent742ef5b7c36c67b958b5eac7ddfd019ddae39ec1 (diff)
downloadydb-b59871c639b7b97ebe658e1d25bca1a4c0534555.tar.gz
add formatter test
-rw-r--r--ydb/library/yql/sql/v1/format/sql_format.cpp1
-rw-r--r--ydb/library/yql/sql/v1/format/sql_format_ut.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/ydb/library/yql/sql/v1/format/sql_format.cpp b/ydb/library/yql/sql/v1/format/sql_format.cpp
index 4cddca2138d..82c14cafabb 100644
--- a/ydb/library/yql/sql/v1/format/sql_format.cpp
+++ b/ydb/library/yql/sql/v1/format/sql_format.cpp
@@ -1722,6 +1722,7 @@ TStaticData::TStaticData()
{TRule_identifier::GetDescriptor(), EScope::Identifier},
{TRule_id_table_or_type::GetDescriptor(), EScope::Identifier},
{TRule_bind_parameter::GetDescriptor(), EScope::Identifier},
+ {TRule_an_id_as_compat::GetDescriptor(), EScope::Identifier},
})
, VisitDispatch({
{TToken::GetDescriptor(), MakeFunctor(&TVisitor::VisitToken)},
diff --git a/ydb/library/yql/sql/v1/format/sql_format_ut.cpp b/ydb/library/yql/sql/v1/format/sql_format_ut.cpp
index c78b444af9c..d2c7b9bf61a 100644
--- a/ydb/library/yql/sql/v1/format/sql_format_ut.cpp
+++ b/ydb/library/yql/sql/v1/format/sql_format_ut.cpp
@@ -266,6 +266,16 @@ Y_UNIT_TEST_SUITE(CheckSqlFormatter) {
setup.Run(cases);
}
+ Y_UNIT_TEST(TypeSelection) {
+ TCases cases = {
+ {"Select tYpe.* frOm Table tYpe",
+ "SELECT\n\ttYpe.*\nFROM Table\n\ttYpe;\n"}
+ };
+
+ TSetup setup;
+ setup.Run(cases);
+ }
+
Y_UNIT_TEST(AlterTable) {
TCases cases = {
{"alter table user add user int32",