@@ -55,7 +55,7 @@ TString CollectTokens(const TRule_select_stmt& selectStatement) {
55
55
56
56
NSQLTranslation::TTranslationSettings CreateViewTranslationSettings (const NSQLTranslation::TTranslationSettings& base) {
57
57
NSQLTranslation::TTranslationSettings settings;
58
-
58
+
59
59
settings.ClusterMapping = base.ClusterMapping ;
60
60
settings.Mode = NSQLTranslation::ESqlMode::LIMITED_VIEW;
61
61
@@ -1596,16 +1596,6 @@ namespace {
1596
1596
return true ;
1597
1597
}
1598
1598
1599
- bool StoreBool (const TRule_table_setting_value& from, TDeferredAtom& to, TContext& ctx) {
1600
- if (!from.HasAlt_table_setting_value6 ()) {
1601
- return false ;
1602
- }
1603
- // bool_value
1604
- const TString value = to_lower (ctx.Token (from.GetAlt_table_setting_value6 ().GetRule_bool_value1 ().GetToken1 ()));
1605
- to = TDeferredAtom (BuildLiteralBool (ctx.Pos (), FromString<bool >(value)), ctx);
1606
- return true ;
1607
- }
1608
-
1609
1599
bool StoreSplitBoundary (const TRule_literal_value_list& boundary, TVector<TVector<TNodePtr>>& to,
1610
1600
TSqlExpression& expr, TContext& ctx) {
1611
1601
TVector<TNodePtr> boundaryKeys;
@@ -1732,26 +1722,6 @@ namespace {
1732
1722
return true ;
1733
1723
}
1734
1724
1735
- bool StoreViewOptionsEntry (const TIdentifier& id,
1736
- const TRule_table_setting_value& value,
1737
- std::map<TString, TDeferredAtom>& features,
1738
- TContext& ctx) {
1739
- const auto name = to_lower (id.Name );
1740
- const auto publicName = to_upper (name);
1741
-
1742
- if (features.find (name) != features.end ()) {
1743
- ctx.Error (ctx.Pos ()) << publicName << " is a duplicate" ;
1744
- return false ;
1745
- }
1746
-
1747
- if (!StoreBool (value, features[name], ctx)) {
1748
- ctx.Error (ctx.Pos ()) << " Value of " << publicName << " must be a bool" ;
1749
- return false ;
1750
- }
1751
-
1752
- return true ;
1753
- }
1754
-
1755
1725
template <typename TChar>
1756
1726
struct TPatternComponent {
1757
1727
TBasicString<TChar> Prefix;
@@ -4268,7 +4238,7 @@ bool TSqlTranslation::BindParameterClause(const TRule_bind_parameter& node, TDef
4268
4238
}
4269
4239
4270
4240
bool TSqlTranslation::ObjectFeatureValueClause (const TRule_object_feature_value& node, TDeferredAtom& result) {
4271
- // object_feature_value: an_id_or_type | bind_parameter;
4241
+ // object_feature_value: id_or_type | bind_parameter | STRING_VALUE | bool_value ;
4272
4242
switch (node.Alt_case ()) {
4273
4243
case TRule_object_feature_value::kAltObjectFeatureValue1 :
4274
4244
{
@@ -4293,6 +4263,12 @@ bool TSqlTranslation::ObjectFeatureValueClause(const TRule_object_feature_value&
4293
4263
result = TDeferredAtom (Ctx.Pos (), strValue->Content );
4294
4264
break ;
4295
4265
}
4266
+ case TRule_object_feature_value::kAltObjectFeatureValue4 :
4267
+ {
4268
+ TString value = Ctx.Token (node.GetAlt_object_feature_value4 ().GetRule_bool_value1 ().GetToken1 ());
4269
+ result = TDeferredAtom (BuildLiteralBool (Ctx.Pos (), FromString<bool >(value)), Ctx);
4270
+ break ;
4271
+ }
4296
4272
case TRule_object_feature_value::ALT_NOT_SET:
4297
4273
Y_ABORT (" You should change implementation according to grammar changes" );
4298
4274
}
@@ -4480,32 +4456,6 @@ bool TSqlTranslation::ValidateExternalTable(const TCreateTableParameters& params
4480
4456
return true ;
4481
4457
}
4482
4458
4483
- bool TSqlTranslation::ParseViewOptions (std::map<TString, TDeferredAtom>& features,
4484
- const TRule_with_table_settings& options) {
4485
- const auto & firstEntry = options.GetRule_table_settings_entry3 ();
4486
- if (!StoreViewOptionsEntry (IdEx (firstEntry.GetRule_an_id1 (), *this ),
4487
- firstEntry.GetRule_table_setting_value3 (),
4488
- features,
4489
- Ctx)) {
4490
- return false ;
4491
- }
4492
- for (const auto & block : options.GetBlock4 ()) {
4493
- const auto & entry = block.GetRule_table_settings_entry2 ();
4494
- if (!StoreViewOptionsEntry (IdEx (entry.GetRule_an_id1 (), *this ),
4495
- entry.GetRule_table_setting_value3 (),
4496
- features,
4497
- Ctx)) {
4498
- return false ;
4499
- }
4500
- }
4501
- if (const auto securityInvoker = features.find (" security_invoker" );
4502
- securityInvoker == features.end () || securityInvoker->second .Build ()->GetLiteralValue () != " true" ) {
4503
- Ctx.Error (Ctx.Pos ()) << " SECURITY_INVOKER option must be explicitly enabled" ;
4504
- return false ;
4505
- }
4506
- return true ;
4507
- }
4508
-
4509
4459
bool TSqlTranslation::ParseViewQuery (std::map<TString, TDeferredAtom>& features,
4510
4460
const TRule_select_stmt& query) {
4511
4461
const TString queryText = CollectTokens (query);
0 commit comments