Skip to content

Commit

Permalink
Bugfix: Boolean constants converted to ETRUE and EFALSE instead of TR…
Browse files Browse the repository at this point in the history
…UE and FALSE.

Error output of EdmGen:

EdmGen for Microsoft (R) .NET Framework version 4.5
Copyright (C) Microsoft Corporation. All rights reserved.

Loading database information...
error 6003: Fehler beim Ausführen der Befehlsdefinition. Weitere Informationen finden Sie in der internen Ausnahme.
        FEHLER: 42703: Spalte »etrue« existiert nicht

Generation Complete -- 1 errors, 0 warnings
  • Loading branch information
cody82 committed Jul 4, 2013
1 parent 3ba5213 commit f8a82fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Npgsql/SqlGenerators/VisitedExpression.cs
Expand Up @@ -137,6 +137,8 @@ internal override void WriteSql(StringBuilder sqlText)
sqlText.AppendFormat(ni, "cast({0} as float4)", _value);
break;
case PrimitiveTypeKind.Boolean:
+ sqlText.AppendFormat(ni, "cast({0} as boolean)", ((bool)_value)?"TRUE":"FALSE");

This comment has been minimized.

Copy link
@ringods

ringods Dec 20, 2013

Has this change made it into a NuGet package release? If so, I'm interested in the NuGet package version to replace our own patched version with a clean upstream version.

This comment has been minimized.

Copy link
@kenjiuno

kenjiuno Dec 20, 2013

Contributor

Perhaps no.
I have confirmed by ILSpy for NuGet's Npgsql.dll 2.0.14.2. The fix isn't in 2.0.14.2. ilspy_constantexpression_writesql
Here is the revision graph why is isn't in. ilspy_constantexpression_writesql_revg

Probably it will be included in 2.1.0.0 release.

This comment has been minimized.

Copy link
@ringods

ringods Dec 20, 2013

OK, I requested a release including this fix: #132
Tnx for the swift reply.

break;
case PrimitiveTypeKind.Guid:
case PrimitiveTypeKind.String:
NpgsqlTypesHelper.TryGetNativeTypeInfo(GetDbType(_primitiveType), out typeInfo);
Expand Down Expand Up @@ -1308,4 +1310,4 @@ internal override IEnumerable<ColumnExpression> GetProjectedColumns()
}
}
}
#endif
#endif

0 comments on commit f8a82fa

Please sign in to comment.