-
Notifications
You must be signed in to change notification settings - Fork 90
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 postgres symbol tests failure #565
Conversation
679e721
to
2c1b695
Compare
In the commit message, I didn't really understand
What is lacking for Postgres? |
PostgreSQL demands if there is an output parameter:
Essentially - seems that PostgreSQL always returns output parameters as a function return value. I'm not sure if there are alternative ways for retrieving them. What we currently support in DbFit is function/procedure argments of INPUT type only. (E.g. we cannot have a named output parameter which was the trouble with the initial Symbols test). |
Currently there is some trouble with DB2. I don't know what's wrong with it - no obvious mistakes at first glimpse. |
For Postgres could we could retrieve the |
Can we somehow upload (e.g. to the AWS S3 area) the test reports during the builds so we could see that is in
|
Otherwise I can install DB2 again on my vagrant VM and run the tests via the UI. |
I managed to run the UI tests through docker (seems quicker to fire it up compared to Vagrant). But the error message is quite cryptic: |
Could it be the actual call? What is the current schema when you call the proc? |
!|Connect|localhost:50000|DFTEST|DFTEST|DBFIT| |
Can you log into DB2 and check that the proc exists? http://stackoverflow.com/questions/15600755/db2-list-of-stored-procedure-in-a-database |
I'm not sure, perhaps you need to include more clauses (as in the example below) to ensure that it gets created as a SQL, rather C/Java external function?
|
select procname from syscat.procedures where procschema = 'DFTEST'
PROCNAME
------------------
CALCLENGTH
CONCATENATESTRINGS
MAKEUSER
MULTIPLYIO The other function which I used as example (ConcatenateF) is also not there. |
Looks like functions and procedures in DB2 is quite different. I can use the function from sql query but not in a call: db2 => call multiply(2, 3)
call multiply(2, 3)
SQL0440N No authorized routine named "MULTIPLY" of type "PROCEDURE" having
compatible arguments was found. SQLSTATE=42884
db2 => SELECT multiply(3, 2) FROM SYSIBM.SYSDUMMY1
SELECT multiply(3, 2) FROM SYSIBM.SYSDUMMY1
1
-----------
6
1 record(s) selected. |
So it looks like we could just form a different statement text (a query instead of a CALL) and retrieve the return value from the |
It seems too exotic to try calling DB2 functions explicitly (I'm not even sure whether it's possible to extract their metadata with list of parameters). On the other hand PostgreSQL seems to allow calling procedures with output parameters in the standard way (in addition to calling it as function). So I'm rather looking into adding support for that postgres output parameters. Some preparation committed to b8430d5 (perhaps its worth a separate PR). |
Perhaps via JDBC methods rather than DB metadata. |
Maybe using something like:
|
Yes, I got your idea from before. It needs some research to figure out in which order to pass the parameters and how many are they - we may try to deal with DB2 separately. I would vote for PostgreSQL here - as it looks easier to implement and harder to workaround the current gap with it in case of multiple output params. (For DB2 the function may be wrapped in a SQL and tested within |
b8430d5
to
6e37e10
Compare
@MMatten, would you be able to check if that works on the Vagrant test VM for the databases outside Travis build? I touched some stored procs e.g. in Informix which I haven't tested. I managed to add support for PostgreSQL output parameters here (it was possible without passing the list of arguments to getAllProcedure parameters - so I removed that change). With that we get the common symbols test pass throughout all environments. |
@yavornikolov yes, certainly. It will take me a couple of days to get to it though. I'll take a look at the whole PR again too. |
4af084e
to
6de2715
Compare
Unify the Multiply function used in acceptance tests across all environments - rename the old one to MultiplyIO where inout parameter has been used.
Add support for calling PostgreSQL stored procedures with output parameters.
Use string bind variable for CalcLength stored procedure parameter - otherwise environments with strict type check like PostgreSQL could fail.
* Break down getAllParameters into smaller pieces * Extract DatabaseObjectName from Derby to reuse in PostgreSQL * Bump up postgres version to 42.0.0.jre7 (for getSchema support)
e6406e0
to
5182584
Compare
Just rebased on top of master to pick the Informix fix so I hope everything should be OK now. |
OK. I'll rebuild a dev VM and run it all through. |
Looking good so far. I've still got to test with Teradata, Netezza and SQL Server though. |
@javornikolov I'm still having a bit of a nightmare with testing on Windows 10 (it's awful and it's blue screening on me) when trying to build the VM. Will get back to you as soon as. |
Teradata tests are passing. Netezza has been a massive pain to get the emulator running. I've moved on to the 7.2 version. This can run on Linux under VMWare. I need to somehow upload the 7.2 driver though. What's the best way to get this to you? Commit it? Also for Netezza we need the new |
Not a good idea to "pollute" the repo with a large binary jar. If it's hard to get the driver directly from IBM site, any file sharing should be fine (gdrive, dropbox, expirebox,...). You may share some hashsum here to ensure the file has been transferred intact. |
I forgot to mention - for local testing you may just copy jdbc drivers to |
I've just shared the driver file with you. We'll need to rename it and update the grade build. |
Also, it looks like Netezza doesn't support named proc params or output params. |
I think it's PostgreSQL based. It can return a single value (scalar or a (single column) table of values). |
Thank you @MMatten! I've just uploaded the file, sha-1:
|
That hash is correct. 👍 |
Any ideas how to overcome that? |
Perhaps the issue with Netezza stored procs in symbols tests is already in master. If everything else seems OK, maybe we rather merge the current PR (named after postgresql) and take care about Netezza separately. |
Let me test that. |
Yes, it looks like we introduced this breakage in 8d3e2c7. I can't remember which DBMSs we tested this on but at least not Netezza. |
Note that I still should test this PR with SQL Server too I guess. |
All SQL Server tests apart from the know issues in |
Great :-) So I think we can already merge that to master to finally fix the broken Travis build. What do you think, is there anything else which may need to do before merging? |
I think we should merge this one now. 👍 :) |
Nice, I'm merging it... :-) Thanks @MMatten for the thorough testing - it has revealed quite a few things! |
OUT
andINOUT
parametersresolves #557 together with #562