@@ -844,7 +844,7 @@ TVector<TKiDataQueryBlock> MakeKiDataQueryBlocks(TExprBase node, const TKiExplor
844
844
845
845
} // namespace
846
846
847
- TExprNode::TPtr KiBuildQuery (TExprBase node, TExprContext& ctx, TIntrusivePtr<TKikimrTablesData> tablesData,
847
+ TExprNode::TPtr KiBuildQuery (TExprBase node, TExprContext& ctx, TStringBuf database, TIntrusivePtr<TKikimrTablesData> tablesData,
848
848
TTypeAnnotationContext& types, bool concurrentResults) {
849
849
if (!node.Maybe <TCoCommit>().DataSink ().Maybe <TKiDataSink>()) {
850
850
return node.Ptr ();
@@ -858,14 +858,14 @@ TExprNode::TPtr KiBuildQuery(TExprBase node, TExprContext& ctx, TIntrusivePtr<TK
858
858
VisitExpr (node.Ptr (), [&replaces](const TExprNode::TPtr& input) -> bool {
859
859
if (input->IsCallable (" PgTableContent" )) {
860
860
TPgTableContent content (input);
861
- if (content.Table () == " pg_tables" ) {
861
+ if (content.Table (). StringValue () == " pg_tables" ) {
862
862
replaces[input.Get ()] = nullptr ;
863
863
}
864
864
}
865
865
return true ;
866
866
});
867
867
if (!replaces.empty ()) {
868
- TExprNode::TPtr path = ctx.NewCallable (node.Pos (), " String" , { ctx.NewAtom (node.Pos (), " /Root /.sys/pg_tables" ) });
868
+ TExprNode::TPtr path = ctx.NewCallable (node.Pos (), " String" , { ctx.NewAtom (node.Pos (), TStringBuilder () << " / " << database << " /.sys/pg_tables" ) });
869
869
auto table = ctx.NewList (node.Pos (), {ctx.NewAtom (node.Pos (), " table" ), path});
870
870
auto newKey = ctx.NewCallable (node.Pos (), " Key" , {table});
871
871
0 commit comments