[MDEV-11150] CONNECT engine table_type=JDBC handling case of rc=-1 Created: 2016-10-26 Updated: 2016-12-15 Resolved: 2016-12-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.1.18 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Robert Dyas | Assignee: | Olivier Bertrand |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
centOS 7 |
||
| Description |
|
It appears certain JDBC drivers will return a row count of -1 when they are uncertain how many rows will be retrieved. CONNECT doesn't seem to like this and generates an error:
Is it possible for CONNECT to just retrieve all available rows under this condition? |
| Comments |
| Comment by Olivier Bertrand [ 2016-11-03 ] | |
|
This did not happen to me yet. Can you elaborate and tell what drivers on what circumstances return this value? | |
| Comment by Robert Dyas [ 2016-11-03 ] | |
|
After having tracked this down with the driver vendor (CData Google Apps driver) it appears that certain drivers that are fronting APIs and not databases cannot do a count. I don't know how many of the many drivers we might try to deploy soon have this limitation. If it is possible and reasonable to do so, could CONNECT look for and trap this exception and then proceed with row count unknown in these cases? | |
| Comment by Olivier Bertrand [ 2016-11-14 ] | |
|
Can you describe when this can occur. Is it when doing a:
Or when executing other queries? (which) Generally speaking, when reporting a bug, try to give all information needed to trace what happen. Just telling a bug occur does not often make possible to fix it. | |
| Comment by Robert Dyas [ 2016-11-14 ] | |
|
I apologize for the lack of info here. It appears that certain JDBC drivers that are build on top of APIs rather than SQL databases may NOT be able to do a simple count
If there is an easy work around for CONNECT to gracefully accept drivers with this limitation, that would be helpful. If not, we just won't be able to use those until the driver vendor provides a fix (sometime in Q2 2017 it appears). | |
| Comment by Olivier Bertrand [ 2016-11-15 ] | |
|
CONNECT does not make the difference between select statements and just send them, after updating the table name, to the JDBC driver by executeQuery. This function normally returns the number of columns of the result set and a negative number means an error.
query. I would rather think that the number of rows could be returned as -1 but in that case there would be no error for CONNECT. | |
| Comment by Robert Dyas [ 2016-11-15 ] | |
|
It looks like rc = -1 so assumed (incorrectly?) that it was row count. This is occurring with the CData driver for Google Apps - available for free 30 day trial download if you want. It might be their driver... just no way of me knowing. | |
| Comment by Robert Dyas [ 2016-12-15 ] | |
|
I think this bug report can be closed for now. | |
| Comment by Olivier Bertrand [ 2016-12-15 ] | |
|
See last Robert Dyas comment. |