-
Notifications
You must be signed in to change notification settings - Fork 127
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
Bug: RepoDb.SqlServer Enum picking up 2 types when upgraded from 1.1.1 -> 1.1.2 #736
Comments
Yeah, there were PRs in relation to this and we had introduced this logic. So this might had affected this. But is very recommended to not use the Of course, unless otherwise you are not using the model-based operations like |
Hopefully, that would work, but if that recommendation doesn't fix that, then we will investigate this further and revert back to you. Plus, we will also guard this with the Integration Tests. |
Thanks for the quick reply! I will move to that recommendation and report back shortly |
Thanks, i've removed the TypeMap. It then goes back to the default string conversion which i was trying to avoid. But from reading that link - i've now set Converter.EnumDefaultDatabaseType = DbType.Int32 and now it is correctly using ints for the enum. |
It is still a bug as having a forced attribute |
sure - reopening for tracking |
Bug Description
When running a query using an enum in the WHERE clause, if I use 2 enum values, the first uses INT and the second uses the STRING value
Exception Message:
No exception from RepoDb, but the underlying SQL fails as it can't convert the column to 2 different data types
Generated T-SQL example
exec sp_executesql N'SELECT [source_system], [incoming_payload], [Id], [correlation_id], [event_type], [external_ticket_id], [internal_ticket_id], [created_timestamp], [arrival_timestamp], [completion_timestamp], [retries_remaining], [last_retry_timestamp], [Status], [error_description] FROM [incoming_event_queue] WHERE (([Status] = @Status) OR ([Status] = @Status_1)) ;',N'@Status int,@Status_1 nvarchar(4000)',@Status=0,@Status_1=N'awaiting_retry'
Schema and Model:
create table incoming_event_queue(id int, status int)
And also the model that corresponds the schema.
Library Version:
Example: RepoDb v1.12.5 and RepoDb.SqlServer v1.1.2
(note: this worked ok in v1.1.1
The text was updated successfully, but these errors were encountered: