From b899aea07991108e3bfa45808e41eb5a7af604ca Mon Sep 17 00:00:00 2001 From: Alexander Timin Date: Mon, 19 Aug 2024 13:57:37 +0100 Subject: [PATCH] Fix table viewer -> debug track flow Bug: b/360404082 Change-Id: I6aea2f2d06ce0bf6d6c870b41d9d82859d1ee808 --- ui/src/frontend/sql_table_tab.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/src/frontend/sql_table_tab.ts b/ui/src/frontend/sql_table_tab.ts index 325c95c737..85c9d30882 100644 --- a/ui/src/frontend/sql_table_tab.ts +++ b/ui/src/frontend/sql_table_tab.ts @@ -84,6 +84,9 @@ export class SqlTableTab extends BottomTab { }), ]; const {selectStatement, columns} = this.state.getCurrentRequest(); + const debugTrackColumns = Object.values(columns).filter( + (c) => !c.startsWith('__'), + ); const addDebugTrack = m( Popup, { @@ -92,8 +95,8 @@ export class SqlTableTab extends BottomTab { }, m(AddDebugTrackMenu, { dataSource: { - sqlSource: selectStatement, - columns: Object.values(columns).filter((c) => !c.startsWith('__')), + sqlSource: `SELECT ${debugTrackColumns.join(', ')} FROM (${selectStatement})`, + columns: debugTrackColumns, }, engine: this.engine, }),