File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
extensions/ql-vscode/src/variant-analysis Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Logger } from "../common";
33import { transformBqrsResultSet } from "../pure/bqrs-cli-types" ;
44import { AnalysisRawResults } from "./shared/analysis-result" ;
55import { MAX_RAW_RESULTS } from "./shared/result-limits" ;
6+ import { SELECT_TABLE_NAME } from "../pure/interface-types" ;
67
78export async function extractRawResults (
89 cliServer : CodeQLCliServer ,
@@ -19,11 +20,15 @@ export async function extractRawResults(
1920 }
2021 if ( resultSets . length > 1 ) {
2122 void logger . log (
22- "Multiple result sets found in results file. Only the first one will be used." ,
23+ "Multiple result sets found in results file. Only one will be used." ,
2324 ) ;
2425 }
2526
26- const schema = resultSets [ 0 ] ;
27+ // Always prefer #select over any other result set. #select is usually the result the user
28+ // wants to see since it contains the outer #select.
29+ const schema =
30+ resultSets . find ( ( resultSet ) => resultSet . name === SELECT_TABLE_NAME ) ??
31+ resultSets [ 0 ] ;
2732
2833 const chunk = await cliServer . bqrsDecode ( filePath , schema . name , {
2934 pageSize : MAX_RAW_RESULTS ,
You can’t perform that action at this time.
0 commit comments