-
Notifications
You must be signed in to change notification settings - Fork 387
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
JDBC ParameterMetaData - Feature not supported handling #579
Conversation
@wimjongman Shouldn't we reopen this? |
Yes, absolutely. |
I can test if this works (and reduces the flood of log messages) in the next few days. |
Thanks, Henning. |
I havent' found the time to test this yet. |
Did you manage to recruit some new contributors? ;) |
I wanted to confirm the old behavior before testing the effect of the PR. |
@tkrautinger can you please rebase your changes @hvbtup the runtime issue is fixed so this can be tested now. |
With a very simple report based on Thomas query, I can create an issue in the New Preview Prototype, if the parameter value is null. The following items have errors: Table (id = 5512):
With Run / View Report as / HTML (or PDF) I get the following error in the "Problems" view: Failed to prepare the query execution for the data set: dual With a parameter value of 2, there is no error. So I can confirm there is an issue (at least when such a query is called from the All-In-One-Designer). Notes: In the reports we are using in production (with BIRT 4.3.0), we are facing a similar issue, but not quite the same. This behaviour is still the same in the current master. I tested this by replacing the WHERE clause with In other words, with null values for string parameters, there is only an annoying message but otherwise everything is working as it should, whereas in the issue Thomas described here (with an Integer parameter), the report fails. To avoid the annoying messages in the log, we use a I had an Oracle support ticket for a similar issue where they told me that the sequence of JDBC calls which BIRT uses isn't supported (in particular, the steps where getParameterMetaData is called). It even caused totally different SQL statements (made up from the original statement) to be parsed at the DB server side, which I found by tracing the DB session. Luckily, the different statements are only parsed, not executed, otherwise that could be a severe security issue. IMHO this is an issue inside the Oracle JDBC driver, which AFAIK this is still not fixed. This PR might circumvent that issue as well. Next I tested the same report with Thomas' modifications of /org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/ParameterMetaData.java. I could see in the debugger that the new |
This is the report I used for testing - you'll have to adapt the JDBC properties of course @tkrautinger Can you please test again? Your PR does not work for me. |
In some situations, like an "complex" query cannot be parsed by the Oracle JDBC driver, the call of org.eclipse.birt.report.data.oda.jdbc.ParameterMetaData.getParameterType(...) throws an JDBCException. SQL Example: SELECT 1 FROM DUAL WHERE 1 < ? AND SYSDATE > TO_DATE('20200101','YYYYMMDD') The currently implemented MySQL handling (SQLExceptions with state "S1C00") has extened to fit also for Oracle feature not supported exceptions (SQLExceptions with code "17023") and SQLFeatureNotSupportedExceptions.
@hvbtup include for 4.10 or move to 4.11? I want to make a release. |
When I last tested it, it didn't work for me (see above), and didn't receive some explanation from @tkrautinger. |
-1 from me too, so moving to 4.11 |
In some situations, like an "complex" query cannot be parsed by the Oracle JDBC driver, the call of org.eclipse.birt.report.data.oda.jdbc.ParameterMetaData.getParameterType(...) throws an JDBCException.
SQL example:
SELECT 1 FROM DUAL WHERE 1 < ? AND SYSDATE > TO_DATE('20200101','YYYYMMDD')
The currently implemented MySQL handling (SQLExceptions with state "S1C00") has extened to fit also for Oracle feature not supported exceptions (SQLExceptions with code "17023") and SQLFeatureNotSupportedExceptions.
Signed-off-by: Thomas Krautinger