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
Fix tests errors #449
Fix tests errors #449
Conversation
Maybe you could fix the other places where this syntax is used as well? |
Sure! I'll do that.
|
AmbiguousFunctionParameterTypePrepared tests They had parameter placeholders in the command text when calling a function. Docs say that only the name of the function should be present in the commandtext.
A lot of fixes for command texts with parameter placeholders. DataTypeTests was expecting string in place of NpgsqlInet. FunctionCallInputOutputParameter was not releasing the datareader properly.
b50fb19
to
46b7035
Compare
Hi, @Emill While checking why
It was giving problems in the The problem seems to be the following:
Yes, it seems that for all other columns, proargnames, proallargtypes etc, the value returned for a parameterless function is null, except proargtypes! :) It returns an empty string, and this was giving problems when the oid handler tried to get a number from it:
I thought fixing this problem in the DoDeriveParameter to handle this specific case, but I ended up fixing in the OidHandler itself. From what DoDeriveParameter expect, I think the idea of the GetFieldValue<uint[]> would be to really return an empty array in case of a empty string response. So, this is the change I did to make it work:
What do you think? If you are ok with it, I can create a pull request for it. I also think we should add some tests for those cases where an empty string is returned from the database where an uint[] was expected. Not only for uint[] but for other array types as well. |
When executed alone, VerifyFunctionWithNoParametersWithDeriveParameters was raising error because funcb couldn't be found. Create the function when starting the test.
Ah nice. An empty string should result in an empty array. You can apply that patch of you want, but @roji is currently refactoring a lot of stuff so I'm not sure how long that code will survive anyway... |
Nice catch @franciscojunior. But @Emill is right, it's better not to touch that area of the code - I'm really changing things there right now. The end of that refactor is probably not so far away though. I think the best think is for you to make sure this is checked in a test (which will fail in master for now) and we'll get around to it soon... |
Ahh, ok. I'll let this problem for now, then. I'll keep fixing the errors I find in the tests and will add commits to this PR. Thanks for the feedback, guys! :) |
e1d8c57
to
1f140e5
Compare
There's been lots of refactoring since this PR so I went ahead and removed parentheses in unit tests in a7d9f4a, am closing. Note that a lot of function-related tests still fail, I'll be doing a general cleanup of all that as some point. |
This pull request fixes some errors in the tests.
Please, don't merge it yet. WIP