New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exception when using a boolean parameter with an embedded v2.5 server [DNET683] #636
Comments
Commented by: @cincuranet Are you using 3.0 embedded? |
Modified by: @cincuranetstatus: Open [ 1 ] => In Progress [ 3 ] |
Commented by: livioc (livioc) no, v2.5, in the environment field i cutted the version, sorry this is the pull request the failing test is FbBooleanSupportV2_5Tests.ParametrizedSelectTest(false) |
Modified by: livioc (livioc)environment: .net 4.6.1 application on windows x32 with embedded v.5 => .net 4.6.1 application on windows x32 with embedded v2.5 |
Commented by: @cincuranet In 2.5 it should fail as that version does not support bool column. Why do you think it should be other way? |
Commented by: livioc (livioc) the column type is smallint, the tests are for the conversion boolean to smallint done internally by the firebird provider, i have some queries in my application with boolean parameters that were working with the provider < v5 but now don't (with that exception) |
Commented by: @cincuranet If the datatype is explicit, the provider does not go to database to get the real datatypes and trusts developer. That's why it fails. There wasn't bool column in Firebird before and it was just a "lucky coincidence" it worked. |
Commented by: livioc (livioc) but why with the server process (not embedded) it still works? |
Commented by: @cincuranet Server via wire protocol processes the messages differently. |
Commented by: Hennadii Zabula (zabulus) Jiri, I should disagree. |
Commented by: @cincuranet But that still works, unless you explicitly specify the parameter type. Then it's plain wrong code. And now it shows. BTW that's also why the major version got incremented. |
Commented by: livioc (livioc) jiri can we add a switch for the server version from the connection to keep the old behaviour when it's < 3.0.0.0? i'm using nhibernate (i don't know if also entity framework uses the explicit typed parameter constructor) and it uses it so i can't change the code that generates the exception |
Commented by: @cincuranet You mean checking the server version when sending the data to server? |
Commented by: livioc (livioc) yes to send different isc code for boolean parameters (boolean if >= 3.0.0.0 or smallint) i don't know if it's a complicated thing to implement |
Commented by: @cincuranet Can you post a minimal NHibernate repro? |
Commented by: livioc (livioc) https://github.com/livioc/MixedProjects i did a simple console app for vs2015, with the provider v5.0.5 it fails, downgrading the nuget package to v4.10 it works the embedded server is v2.5.5 for x86 |
Commented by: @cincuranet Looking at it, you can of course change it. Simple mapping: It is expected that you have to change some code if you update major versions of libraries. |
Submitted by: livioc (livioc)
executing a query with an explicit typed boolean parameter will generate this exception
FirebirdSql.Data.FirebirdClient.FbException: Dynamic SQL Error
SQL error code = -804
Incorrect values within SQLDA structure ---> FirebirdSql.Data.Common.IscException: Dynamic SQL Error
SQL error code = -804
Incorrect values within SQLDA structure
at FirebirdSql.Data.Client.Native.FesDatabase.ProcessStatusVector(IntPtr[] statusVector) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Native\FesDatabase.cs:line 365
at FirebirdSql.Data.Client.Native.FesStatement.Execute() in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Native\FesStatement.cs:line 384
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbCommand.cs:line 1221
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbCommand.cs:line 527
note:with expicit typed parameter i mean:
cmd.Parameters.Add("@value", FbDbType.Boolean);
cmd.Parameters[0].Value = true;
note2:i'm sending a pull request to github with a failing test for that
The text was updated successfully, but these errors were encountered: