Skip to content

gbase8s查询条件转换问题 #2169

@AlanYoung2020

Description

@AlanYoung2020

问题描述及重现代码:

下列查询中查询条件被翻译为NULL IS NOT NULL AND ((a.id) in NULL)),将生成的sql语句取出来放到dbeaver中去执行也会报错:SQL 错误 [IX000]: IN 表达式右边必须是 COLLECTION 类型。

[Table(Name = "Shift")]
public class Shift
{
    /// <summary>
    /// 自增主键
    /// </summary>
    [Column(IsPrimary = true, IsIdentity = true, CanUpdate = false, Position = 1)]
    public int Id { get; set; }
}

int[]? currentIds = null;
var list = _freeSql.select<Shift>().Where(a => currentIds != null && currentIds.Contains(a.Id)).ToList();

数据库版本

gbase8s

安装的Nuget包

FreeSql 3.5.213
FreeSql.Provider.GBase 3.5.213

.net framework/. net core? 及具体版本

.net 8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions