From fc59db7626df1dcbab6d7e14a95494dfa9124083 Mon Sep 17 00:00:00 2001 From: Gilson Joanelo Date: Tue, 24 Sep 2024 09:58:51 -0300 Subject: [PATCH 1/7] Add isUnicode parameter to StringLiteralQueryType function --- .../Query/Internal/FbQuerySqlGenerator.cs | 3 ++- .../Storage/Internal/FbSqlGenerationHelper.cs | 8 ++++++-- .../Storage/Internal/IFbSqlGenerationHelper.cs | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs index c8f203bf..64a79623 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs @@ -191,8 +191,9 @@ protected override Expression VisitSqlConstant(SqlConstantExpression sqlConstant base.VisitSqlConstant(sqlConstantExpression); if (shouldExplicitStringLiteralTypes) { + var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping); Sql.Append(" AS "); - Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType(sqlConstantExpression.Value as string)); + Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType(sqlConstantExpression.Value as string, isUnicode)); Sql.Append(")"); } return sqlConstantExpression; diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs index 3aa22fc4..865f52a2 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs @@ -27,11 +27,15 @@ public FbSqlGenerationHelper(RelationalSqlGenerationHelperDependencies dependenc : base(dependencies) { } - public virtual string StringLiteralQueryType(string s) + public virtual string StringLiteralQueryType(string s, bool isUnicode = true) { var length = MinimumStringQueryTypeLength(s); EnsureStringLiteralQueryTypeLength(length); - return $"VARCHAR({length}) CHARACTER SET UTF8"; + if(isUnicode) + { + return $"VARCHAR({length}) CHARACTER SET UTF8"; + } + return $"VARCHAR({length})"; } public virtual string StringParameterQueryType(bool isUnicode) diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs index 149cb2a9..56c4c1f5 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs @@ -22,7 +22,7 @@ namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; public interface IFbSqlGenerationHelper : ISqlGenerationHelper { - string StringLiteralQueryType(string s); + string StringLiteralQueryType(string s, bool isUnicode); string StringParameterQueryType(bool isUnicode); void GenerateBlockParameterName(StringBuilder builder, string name); string AlternativeStatementTerminator { get; } From b2c7eb9de569797a7c8cdfb6a53fcd2a07ac9c7e Mon Sep 17 00:00:00 2001 From: Gilson Joanelo Date: Wed, 25 Sep 2024 20:09:33 -0300 Subject: [PATCH 2/7] Update code to use ternary operator --- .../Storage/Internal/FbSqlGenerationHelper.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs index 865f52a2..8166671d 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs @@ -30,12 +30,8 @@ public FbSqlGenerationHelper(RelationalSqlGenerationHelperDependencies dependenc public virtual string StringLiteralQueryType(string s, bool isUnicode = true) { var length = MinimumStringQueryTypeLength(s); - EnsureStringLiteralQueryTypeLength(length); - if(isUnicode) - { - return $"VARCHAR({length}) CHARACTER SET UTF8"; - } - return $"VARCHAR({length})"; + var charset = isUnicode ? " CHARACTER SET UTF8" : ""; + return $"VARCHAR({length}){charset}"; } public virtual string StringParameterQueryType(bool isUnicode) From 4dd2e5a45aadd6d3dd0c3141e9c3bd08227a1d35 Mon Sep 17 00:00:00 2001 From: Gilson Joanelo Date: Thu, 26 Sep 2024 08:34:21 -0300 Subject: [PATCH 3/7] Change to string.empty --- .../Storage/Internal/FbSqlGenerationHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs index 8166671d..78bbff57 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs @@ -30,7 +30,7 @@ public FbSqlGenerationHelper(RelationalSqlGenerationHelperDependencies dependenc public virtual string StringLiteralQueryType(string s, bool isUnicode = true) { var length = MinimumStringQueryTypeLength(s); - var charset = isUnicode ? " CHARACTER SET UTF8" : ""; + var charset = isUnicode ? " CHARACTER SET UTF8" : string.Empty; return $"VARCHAR({length}){charset}"; } From 776a927e57708da5c2176f327bb680b7418eeb5a Mon Sep 17 00:00:00 2001 From: Gilson Joanelo Date: Mon, 26 May 2025 15:59:24 -0300 Subject: [PATCH 4/7] =?UTF-8?q?Corre=C3=A7=C3=A3o=20do=20erro=20Implementa?= =?UTF-8?q?tion=20limit=20exceeded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correção da falha SQL error code = -204 Implementation limit exceeded block size exceeds implementation restriction --- .../Query/Internal/FbQuerySqlGenerator.cs | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs index 17fb2ff6..9cd84cc2 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs @@ -169,8 +169,18 @@ protected override Expression VisitSqlParameter(SqlParameterExpression sqlParame Sql.Append(" AS "); if (sqlParameterExpression.Type == typeof(string)) { - var isUnicode = FbTypeMappingSource.IsUnicode(sqlParameterExpression.TypeMapping); - Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringParameterQueryType(isUnicode)); + var storeTypeNameBase = sqlParameterExpression.TypeMapping.StoreTypeNameBase; + var size = sqlParameterExpression.TypeMapping.Size; + + if (storeTypeNameBase != null && size != null) + { + Sql.Append($"{storeTypeNameBase}({size})"); + } + else + { + var isUnicode = FbTypeMappingSource.IsUnicode(sqlParameterExpression.TypeMapping); + Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringParameterQueryType(isUnicode)); + } } else { @@ -191,9 +201,19 @@ protected override Expression VisitSqlConstant(SqlConstantExpression sqlConstant base.VisitSqlConstant(sqlConstantExpression); if (shouldExplicitStringLiteralTypes) { - var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping); - Sql.Append(" AS "); - Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType(sqlConstantExpression.Value as string, isUnicode)); + var storeTypeNameBase = sqlConstantExpression.TypeMapping.StoreTypeNameBase; + var size = sqlConstantExpression.TypeMapping.Size; + + if (storeTypeNameBase != null && size != null) + { + Sql.Append($"{storeTypeNameBase}({size})"); + } + else + { + var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping); + Sql.Append(" AS "); + Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType(sqlConstantExpression.Value as string, isUnicode)); + } Sql.Append(")"); } return sqlConstantExpression; From a0525abec13b151b3e80b78724bfc74eaeed46bd Mon Sep 17 00:00:00 2001 From: Gilson Joanelo Date: Mon, 26 May 2025 22:16:59 -0300 Subject: [PATCH 5/7] fix build error --- .../Query/Internal/FbQuerySqlGenerator.cs | 28 ++++++------------- .../Storage/Internal/FbSqlGenerationHelper.cs | 14 ++++++---- .../Internal/IFbSqlGenerationHelper.cs | 4 +-- 3 files changed, 19 insertions(+), 27 deletions(-) diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs index 9cd84cc2..388ed8c1 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs @@ -171,16 +171,9 @@ protected override Expression VisitSqlParameter(SqlParameterExpression sqlParame { var storeTypeNameBase = sqlParameterExpression.TypeMapping.StoreTypeNameBase; var size = sqlParameterExpression.TypeMapping.Size; + var isUnicode = FbTypeMappingSource.IsUnicode(sqlParameterExpression.TypeMapping); - if (storeTypeNameBase != null && size != null) - { - Sql.Append($"{storeTypeNameBase}({size})"); - } - else - { - var isUnicode = FbTypeMappingSource.IsUnicode(sqlParameterExpression.TypeMapping); - Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringParameterQueryType(isUnicode)); - } + Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringParameterQueryType(isUnicode, storeTypeNameBase, size)); } else { @@ -203,17 +196,14 @@ protected override Expression VisitSqlConstant(SqlConstantExpression sqlConstant { var storeTypeNameBase = sqlConstantExpression.TypeMapping.StoreTypeNameBase; var size = sqlConstantExpression.TypeMapping.Size; + var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping); - if (storeTypeNameBase != null && size != null) - { - Sql.Append($"{storeTypeNameBase}({size})"); - } - else - { - var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping); - Sql.Append(" AS "); - Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType(sqlConstantExpression.Value as string, isUnicode)); - } + Sql.Append(" AS "); + Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType( + sqlConstantExpression.Value as string, + isUnicode, + storeTypeNameBase, + size)); Sql.Append(")"); } return sqlConstantExpression; diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs index 78bbff57..4dad21c5 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs @@ -27,17 +27,19 @@ public FbSqlGenerationHelper(RelationalSqlGenerationHelperDependencies dependenc : base(dependencies) { } - public virtual string StringLiteralQueryType(string s, bool isUnicode = true) + public virtual string StringLiteralQueryType(string s, bool isUnicode = true, string? storeTypeNameBase = null, int? size = null) { - var length = MinimumStringQueryTypeLength(s); + var length = size ?? MinimumStringQueryTypeLength(s); var charset = isUnicode ? " CHARACTER SET UTF8" : string.Empty; - return $"VARCHAR({length}){charset}"; + var storeTypeName = storeTypeNameBase ?? "VARCHAR"; + return $"{storeTypeName}({length}){charset}"; } - public virtual string StringParameterQueryType(bool isUnicode) + public virtual string StringParameterQueryType(bool isUnicode, string? storeTypeNameBase = null, int? size = null) { - var size = isUnicode ? FbTypeMappingSource.UnicodeVarcharMaxSize : FbTypeMappingSource.VarcharMaxSize; - return $"VARCHAR({size})"; + var maxSize = size ?? (isUnicode ? FbTypeMappingSource.UnicodeVarcharMaxSize : FbTypeMappingSource.VarcharMaxSize); + var storeTypeName = storeTypeNameBase ?? "VARCHAR"; + return $"{storeTypeName}({size})"; } public virtual void GenerateBlockParameterName(StringBuilder builder, string name) diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs index 56c4c1f5..bbbdab3b 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs @@ -22,8 +22,8 @@ namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; public interface IFbSqlGenerationHelper : ISqlGenerationHelper { - string StringLiteralQueryType(string s, bool isUnicode); - string StringParameterQueryType(bool isUnicode); + string StringLiteralQueryType(string s, bool isUnicode, string? storeTypeNameBase = null, int? size = null); + string StringParameterQueryType(bool isUnicode, string? storeTypeNameBase = null, int? size = null); void GenerateBlockParameterName(StringBuilder builder, string name); string AlternativeStatementTerminator { get; } } From cced2dff50670c121d4b5adeeb69dad428c0a963 Mon Sep 17 00:00:00 2001 From: Gilson Joanelo Date: Tue, 27 May 2025 13:15:27 -0300 Subject: [PATCH 6/7] fix unit test errors --- .../Storage/Internal/FbSqlGenerationHelper.cs | 42 +++++++++++++------ .../Internal/IFbSqlGenerationHelper.cs | 4 +- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs index 4dad21c5..ead4bb4d 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbSqlGenerationHelper.cs @@ -27,19 +27,38 @@ public FbSqlGenerationHelper(RelationalSqlGenerationHelperDependencies dependenc : base(dependencies) { } - public virtual string StringLiteralQueryType(string s, bool isUnicode = true, string? storeTypeNameBase = null, int? size = null) + public virtual string StringLiteralQueryType(string s, bool isUnicode = true, string storeTypeNameBase = "", int size = 0) { - var length = size ?? MinimumStringQueryTypeLength(s); + var maxSize = MinimumStringQueryTypeLength(s); + string typeName; + if (storeTypeNameBase.Equals("BLOB SUB_TYPE TEXT", StringComparison.OrdinalIgnoreCase)) + { + typeName = "VARCHAR"; + } + else + { + typeName = IsEmpty(storeTypeNameBase) ? "VARCHAR" : storeTypeNameBase; + } + var charset = isUnicode ? " CHARACTER SET UTF8" : string.Empty; - var storeTypeName = storeTypeNameBase ?? "VARCHAR"; - return $"{storeTypeName}({length}){charset}"; + return $"{typeName}({maxSize}){charset}"; } - public virtual string StringParameterQueryType(bool isUnicode, string? storeTypeNameBase = null, int? size = null) + public virtual string StringParameterQueryType(bool isUnicode, string storeTypeNameBase = "", int size = 0) { - var maxSize = size ?? (isUnicode ? FbTypeMappingSource.UnicodeVarcharMaxSize : FbTypeMappingSource.VarcharMaxSize); - var storeTypeName = storeTypeNameBase ?? "VARCHAR"; - return $"{storeTypeName}({size})"; + int maxSize; + string typeName; + if (storeTypeNameBase.Equals("BLOB SUB_TYPE TEXT", StringComparison.OrdinalIgnoreCase)) + { + maxSize = (isUnicode ? FbTypeMappingSource.UnicodeVarcharMaxSize : FbTypeMappingSource.VarcharMaxSize); + typeName = "VARCHAR"; + } + else + { + maxSize = size > 0 ? size : (isUnicode ? FbTypeMappingSource.UnicodeVarcharMaxSize : FbTypeMappingSource.VarcharMaxSize); + typeName = IsEmpty(storeTypeNameBase) ? "VARCHAR" : storeTypeNameBase; + } + return $"{typeName}({maxSize})"; } public virtual void GenerateBlockParameterName(StringBuilder builder, string name) @@ -49,7 +68,7 @@ public virtual void GenerateBlockParameterName(StringBuilder builder, string nam public virtual string AlternativeStatementTerminator => "~"; - static int MinimumStringQueryTypeLength(string s) + private int MinimumStringQueryTypeLength(string s) { var length = s?.Length ?? 0; if (length == 0) @@ -57,9 +76,8 @@ static int MinimumStringQueryTypeLength(string s) return length; } - static void EnsureStringLiteralQueryTypeLength(int length) + private bool IsEmpty(string storeTypeNameBase) { - if (length > FbTypeMappingSource.UnicodeVarcharMaxSize) - throw new ArgumentOutOfRangeException(nameof(length)); + return (storeTypeNameBase == null || string.IsNullOrEmpty(storeTypeNameBase) || string.IsNullOrWhiteSpace(storeTypeNameBase)); } } diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs index bbbdab3b..bb6af11c 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs @@ -22,8 +22,8 @@ namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; public interface IFbSqlGenerationHelper : ISqlGenerationHelper { - string StringLiteralQueryType(string s, bool isUnicode, string? storeTypeNameBase = null, int? size = null); - string StringParameterQueryType(bool isUnicode, string? storeTypeNameBase = null, int? size = null); + string StringLiteralQueryType(string s, bool isUnicode, string storeTypeNameBase = "", int size = 0); + string StringParameterQueryType(bool isUnicode, string storeTypeNameBase = "", int size = 0); void GenerateBlockParameterName(StringBuilder builder, string name); string AlternativeStatementTerminator { get; } } From 385d9e44b3380f862658db802f2b4f290279c217 Mon Sep 17 00:00:00 2001 From: Gilson Joanelo Date: Tue, 27 May 2025 13:37:05 -0300 Subject: [PATCH 7/7] fix build errors --- .../Query/Internal/FbQuerySqlGenerator.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs b/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs index 388ed8c1..935656cb 100644 --- a/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs +++ b/src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGenerator.cs @@ -169,10 +169,9 @@ protected override Expression VisitSqlParameter(SqlParameterExpression sqlParame Sql.Append(" AS "); if (sqlParameterExpression.Type == typeof(string)) { - var storeTypeNameBase = sqlParameterExpression.TypeMapping.StoreTypeNameBase; - var size = sqlParameterExpression.TypeMapping.Size; var isUnicode = FbTypeMappingSource.IsUnicode(sqlParameterExpression.TypeMapping); - + var storeTypeNameBase = sqlParameterExpression.TypeMapping.StoreTypeNameBase; + var size = sqlParameterExpression.TypeMapping.Size ?? 0; Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringParameterQueryType(isUnicode, storeTypeNameBase, size)); } else @@ -194,16 +193,12 @@ protected override Expression VisitSqlConstant(SqlConstantExpression sqlConstant base.VisitSqlConstant(sqlConstantExpression); if (shouldExplicitStringLiteralTypes) { - var storeTypeNameBase = sqlConstantExpression.TypeMapping.StoreTypeNameBase; - var size = sqlConstantExpression.TypeMapping.Size; var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping); + var storeTypeNameBase = sqlConstantExpression.TypeMapping.StoreTypeNameBase; + var size = sqlConstantExpression.TypeMapping.Size ?? 0; Sql.Append(" AS "); - Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType( - sqlConstantExpression.Value as string, - isUnicode, - storeTypeNameBase, - size)); + Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType(sqlConstantExpression.Value as string, isUnicode, storeTypeNameBase, size)); Sql.Append(")"); } return sqlConstantExpression;