Bug #35415 | Problem with browsing views under Openoffice | ||
---|---|---|---|
Submitted: | 18 Mar 2008 19:46 | Modified: | 20 Mar 2008 17:57 |
Reporter: | Michal Pokrywka | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S4 (Feature request) |
Version: | 5.1.7 | OS: | Linux (Ubuntu 7.04) |
Assigned to: | CPU Architecture: | Any |
[18 Mar 2008 19:46]
Michal Pokrywka
[18 Mar 2008 19:48]
Michal Pokrywka
ignore sql errors while getting table keys
Attachment: fix-show-keys-perm-denied.diff (text/plain), 847 bytes.
[19 Mar 2008 13:51]
Tonci Grgin
Hi Michal and thanks for your report. Correct me if I'm wrong but it has nothing to do with OO, right? Probably even with c/J... Did you try doing same thing in cl client? Please try and inform me of outcome.
[19 Mar 2008 14:32]
Michal Pokrywka
Of course mysql client works because when you write: "select * from people_list" it only invokes this query and nothing else. On the other hand, Openoffice Base tries to get column types and indexes, leading to sql permission exception when you only try to "select * from people_list". As I said in first message I do not know exactly whose fault is this - I mean: who tries too hard to get all information about view and underlying tables, indexes etc. Connector/J developer could answer this question: Whether failing "checkUpdatability"(or similar - I am no Java/JDBC developer) method is invoked internally by connector/j(that would be connector/j bug) OR Is "checkUpdatability" invoked by connector user (OO in this case) who wants to know about updatability of tables that are source of view, but this user does not noticed that do not have permission to that tables.
[19 Mar 2008 14:38]
Michal Pokrywka
I forgot to add that in case it is Openoffice bug, my workaround is still very useful because it works with OO available now and I think connector/j users do not check for updatability of tables that users have not permission to access
[20 Mar 2008 14:04]
Tonci Grgin
Michal, I do not believe c/J is a place to fix this. It would be much better if you file feature request to OO to add "checkUpdatability" checkbox... Anyway, I'll verify this as S4 (feature request) as see what c/J team leader has to say.
[20 Mar 2008 14:20]
Mark Matthews
It seems OOo is opening the result set in CONCUR_UPDATABLE mode, which requires the JDBC driver to check if the result set really can be updated (a requirement of the JDBC specification). The only way to do that currently with MySQL is for the driver to check whether only one table is referenced, and whether there are any primary keys on said table, and if all primary key components are referenced in the query.
[20 Mar 2008 14:59]
Tonci Grgin
Michal, while we're at it, can you point me on how to use c/J with OO please? It doesn't seem to honor CLASSPATH...
[20 Mar 2008 15:09]
Tonci Grgin
nm, found it. There is no option one can set to avoid this so I say this should be feature request for OO guys.
[20 Mar 2008 15:27]
Tonci Grgin
Heh, when trying JDBC connection with "strictUpdates=false" in the URL (and com.mysql.jdbc.Driver class) OO persists on discovering what's forbidden to it... There are like 5000 lines in my general query log like: 11 Query SHOW FULL TABLES FROM `company` LIKE 'people_list' Finally, when opening view, OO Database dies without any message... Please file feature request with them that will allow better control on statement they open for this purpose.
[20 Mar 2008 17:57]
Michal Pokrywka
From what Mark said (and from tutorial http://java.sun.com/developer/Books/JDBCTutorial/index.html) I think it is perfectly reasonable to open result set in CONCUR_UPDATABLE mode and after statement checking if result set is updatable by calling "getConcurrency()". Personally I find it strange that sql statement succeeds, but checking its updatability fails with access denied... I won't bother OO devs with this problem.
[25 Mar 2008 7:41]
Tonci Grgin
Michal, I can't do much more here but to notify Mark of your last comment.
[25 Mar 2008 10:50]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/44376
[30 Jul 2008 14:53]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/50724