From dfd4f3508da93f9bdf5b1f28718587f7801bcc20 Mon Sep 17 00:00:00 2001 From: xieguigang Date: Sat, 19 Jun 2021 02:16:50 +0800 Subject: [PATCH] fix of empty projection --- LINQ/LINQ/Interpreter/Query/ProjectionExpression.vb | 8 +++++++- LINQ/test/sqlite.linq | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/LINQ/LINQ/Interpreter/Query/ProjectionExpression.vb b/LINQ/LINQ/Interpreter/Query/ProjectionExpression.vb index e160fb2..2bc5066 100644 --- a/LINQ/LINQ/Interpreter/Query/ProjectionExpression.vb +++ b/LINQ/LINQ/Interpreter/Query/ProjectionExpression.vb @@ -98,7 +98,13 @@ Namespace Interpreter.Query Next If Not skipVal Then - projections.Add(project.Exec(closure)) + If project Is Nothing Then + ' 当SELECT投影操作为空的时候,默认不进行投影操作 + ' 即返回最原始的变量值 + projections.Add(item) + Else + projections.Add(project.Exec(closure)) + End If End If Next diff --git a/LINQ/test/sqlite.linq b/LINQ/test/sqlite.linq index a1a93ae..908faa5 100644 --- a/LINQ/test/sqlite.linq +++ b/LINQ/test/sqlite.linq @@ -3,4 +3,4 @@ imports "Sqlite3" FROM x as table("GenePathways") IN "E:\GCModeller\src\runtime\Darwinism\LINQ\test\xcc.db" WHERE x.pid = 11 -ORDER BY x.gid \ No newline at end of file +ORDER BY gid \ No newline at end of file