-
Notifications
You must be signed in to change notification settings - Fork 893
Open
Description
问题描述及重现代码:
// c# code
public enum CliState
{
None = 0,
Del = 1024
}
public class MCliFile
{
[Column(IsPrimary = true, StringLength = 16)]
public string efNo { get; set; }
public short efState { get; set; }
[Column(StringLength = 20)]
public string efName { get; set; }
}
string sql = fsql.Select<MCliFile>().Where(c => (int)(c.cfState & (int)CliState.Del) == (int)CliState.Del).ToSql();
// 此时生成的 sql 语言为:
// SELECT a."cfNo", a."cfState", a."cfName" FROM "client_file" a WHERE ((a."cfState" & 1024) = 1024)
// 但是 Firebird 是不支持 &、|、^、~ 这几个 常用的 运算符的,这玩意要用 BIN_AND、BIN_OR、BIN_XOR、BIN_NOT
// 就边最最基本的 移位 <<、>> 都得用 BIN_SHL、BIN_SHR 来写
// 相对的 Bitwise Functions 请参见
// https://www.firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref50/fblangref50-functions-bitwise.html数据库版本
我用的 Firebird 的5.0.3,但我看手册 Firebird 全系列 应该都有这个问题
安装的Nuget包
FreeSql 所有的包(包括最新的 3.5.303)都有这个问题
.net framework/. net core? 及具体版本
Metadata
Metadata
Assignees
Labels
No labels