[MDEV-8090] CONNECT fails to fetch result sets for some tables of MySQL table type Created: 2015-05-02 Updated: 2015-05-05 Resolved: 2015-05-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.0.17 |
| Fix Version/s: | 10.0.18 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Olivier Bertrand |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | connect-engine, verified | ||
| Description |
|
When attempting to query some CONNECT tables with table_type set to mysql, the query returns the error:
For example, let's create some objects:
Now, if we query real_table1, everything works:
However, querying connect_table1 fails:
Querying real_table2 works:
Whereas querying connect_table2 only fails if attempting to calculate COUNT
|
| Comments |
| Comment by Geoff Montee (Inactive) [ 2015-05-02 ] | |||||||||||||||||||||||||
|
According to the general log, CONNECT isn't even querying the underlying table when these are failing. These are the general log entries for the three queries that fail:
Compare these to the one query that succeeded:
| |||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2015-05-02 ] | |||||||||||||||||||||||||
|
I ran this test and got the same errors (except that I had to create the user as @'localhost' instead of @'%'. I don't know why but I had "access denied" errors) I shall investigate the case to find why it fails. Meanwhile, a workaround is to suppress the primary key indexing of the MYSQL tables. | |||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-05-02 ] | |||||||||||||||||||||||||
|
Access denied errors are mostly likely caused by the presence of anonymous users. select user, host from mysql.user and drop users with the empty name. | |||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2015-05-02 ] | |||||||||||||||||||||||||
|
CONNECT was fooled by MariaDB calling the engine via index_read with a NULL key for these queries. I don't know why because these are not indexed queries having no where clause. Notes: Note also that creating a MYSQL table with options and option_list is deprecated and may be not supported in future version. You can do it like this:
Note also that defining indexes is most of the time useless and should be avoided. | |||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2015-05-02 ] | |||||||||||||||||||||||||
|
Thanks for fixing it so quickly, Olivier! | |||||||||||||||||||||||||
| Comment by Stoykov (Inactive) [ 2015-05-05 ] | |||||||||||||||||||||||||
|
I was able to reproduce the case without existing anonymous user. However, removing the primary key at the connect table solves the issue. | |||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-05-05 ] | |||||||||||||||||||||||||
|
The reported problem has nothing to do with anonymous users. |