[MDEV-4555] Can't create table via CONNECT engine (Unsupported table type ODBC) Created: 2013-05-21 Updated: 2013-12-17 Resolved: 2013-09-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Mikhail Gavrilov | Assignee: | Olivier Bertrand |
| Resolution: | Not a Bug | Votes: | 1 |
| Labels: | None | ||
| Environment: |
|
||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Description |
|
Query: create table subscrib engine=CONNECT table_type=ODBC tabname='crm.subscrib' connection='DSN=crm_test' Error Code: 1105
|
| Comments |
| Comment by Elena Stepanova [ 2013-05-21 ] | ||||||||||||||||||||||
|
Hi, It's supposed to be fixed in the current 10.0 tree, if you can build from source, please try it out. You will also need to install unixODBC-dev before compiling. | ||||||||||||||||||||||
| Comment by Will Fong [ 2013-05-22 ] | ||||||||||||||||||||||
|
Hi Elena, Yep, that revision has the fix. Thanks! MariaDB [test]> SELECT VERSION();
----------------
---------------- MariaDB [test]> create table subscrib engine=CONNECT table_type=ODBC tabname='crm.subscrib' connection='DSN=crm_test'; | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-05-22 ] | ||||||||||||||||||||||
|
Could you provide working ha_connect.so? Or I need replace whole server? | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-05-22 ] | ||||||||||||||||||||||
|
And question could this plugin also work with MariaDB 5.5.30? | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-05-22 ] | ||||||||||||||||||||||
|
Which OS do you need ha_connect.so for? No, this plugin does not work with 5.5.30. | ||||||||||||||||||||||
| Comment by Will Fong [ 2013-05-22 ] | ||||||||||||||||||||||
|
Hi Mikhail, To get ha_connect.so, I used the MariaDB-connect-engine package in the RHEL repo. To get the CREATE TABLE to work, I downloaded the source tarball Elena linked to, compiled the new binary, and replaced the packaged mysqld with this new one. Worked like a charm! | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-05-22 ] | ||||||||||||||||||||||
|
There is no a need to update the server itself. mysqld from 10.0.2 should work. | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-05-22 ] | ||||||||||||||||||||||
|
> Which OS do you need ha_connect.so for? | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-05-22 ] | ||||||||||||||||||||||
|
Oops. Sorry. I have CentOS 6.3 only. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-05-22 ] | ||||||||||||||||||||||
|
To clarify one detail: b. As a part of mysqld binary. MariaDB official binaries compile it as ha_connect.so, to avoid So, what to upgrade actually depends on what are you using. | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-05-22 ] | ||||||||||||||||||||||
|
Alexander, | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-05-22 ] | ||||||||||||||||||||||
|
To make sure: you need ha_connect.so to use with the MariaDB official 10.0.2 packages, for CentOS-6.4 (64bit?). Is everything correct? | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-05-22 ] | ||||||||||||||||||||||
|
yes | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-05-22 ] | ||||||||||||||||||||||
|
I sent ha_connect.so (compiled with libxml2 and unixodbc) to your mailbox. | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-05-22 ] | ||||||||||||||||||||||
|
I replaced library, but something still wrong Query: create table subscrib engine=CONNECT table_type=ODBC tabname='crm.subscrib' connection='DSN=crm_test' Error Code: 2013 | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-05-22 ] | ||||||||||||||||||||||
|
Alas, it did not work. Then I can suggest to install everything from the latest sources, | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-06-26 ] | ||||||||||||||||||||||
|
After update to 10.0.3 I have another error:
Query: create table subscrib engine=CONNECT table_type=ODBC tabname='crm.subscrib' connection='DSN=crm_test' Error Code: 1105
what is wrong now?? I try use cache ODBC driver from this location: ftp://ftp.intersystems.com/pub/cache/odbc/2013/cache.2013.1.0.ODBC-lnxsusex64.tar.gz | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-06-26 ] | ||||||||||||||||||||||
|
Also trying: ftp://ftp.intersystems.com/pub/cache/odbc/2013/cache.2013.1.0.ODBC-lnxrhx64.tar.gz and have same result. | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-06-26 ] | ||||||||||||||||||||||
|
my odbc configs | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-06-26 ] | ||||||||||||||||||||||
|
Can you please run this command: isql -vvv crm_test Does it connect? What is its output? Thanks. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-06-26 ] | ||||||||||||||||||||||
|
After some experimenting, I think that the problem is in the file permissions. Note, mysqld is run under the user "mysql" by default. These commands should fix the problem: chmod a+rx /usr/cachesys Helped on my box. Please give feedback. | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-06-26 ] | ||||||||||||||||||||||
But after all chmod operation I have same error message <e>Query: create table subscrib engine=CONNECT table_type=ODBC tabname='crm.subscrib' connection='DSN=crm_test;UID=mobill;PWD=mobill' Error Code: 1105 | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-06-26 ] | ||||||||||||||||||||||
|
[root@crm-dev etc]# su mysql | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-06-27 ] | ||||||||||||||||||||||
|
Can you please try to restart mysqld? | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-06-27 ] | ||||||||||||||||||||||
|
Just tried to switch ODBC trace on. But it did not help much. [ODBC][930][1372327342.367908][SQLConnect.c][1111]Can't open lib '/home/bar/tmp/ No additional information | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-07-03 ] | ||||||||||||||||||||||
|
Any updates? | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-07-04 ] | ||||||||||||||||||||||
|
Sorry, no ideas. The error happens on the ODBC side. | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-07-04 ] | ||||||||||||||||||||||
|
I think they says what problem in MariaDB because isql is worked. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-07-04 ] | ||||||||||||||||||||||
|
It's very hard to guess why this happens. I have no ideas other than tracing mysqld in gdb through the ODBC | ||||||||||||||||||||||
| Comment by Richard Bensley [ 2013-09-23 ] | ||||||||||||||||||||||
|
I am having the same issue with 10.0.4 x64 on CentOS 6.2 2.6.32-220. ODBC Info
I get the following output, but no information in error log or ODBC trace file:
I had this issue in 10.0.3, but restarting the server fixed it. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-09-23 ] | ||||||||||||||||||||||
|
What does "ldd basedir/lib/plugin/ha_connect.so return for you? (where basedir is MariaDB install directory). Which binaries are you using? Did you download them from the MariaDB site, | ||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2013-09-23 ] | ||||||||||||||||||||||
|
If you use MariaDB compiled from source, ODBC and MYSQL table types require the following precompiler definitions: | ||||||||||||||||||||||
| Comment by Richard Bensley [ 2013-09-25 ] | ||||||||||||||||||||||
|
Olivier, I am using the package I downloaded from mariadb.org: mariadb-10.0.4-linux-x86_64.tar.gz Alexandar, the ldd output:
I tried adding execution permission to ha_connect.so, but that didn't do anything. Now going to re-test in 10.0.3. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-09-25 ] | ||||||||||||||||||||||
|
Richard, Please download an RPM package from extract ha_connect.so from it and put it instead of ha_connect.so coming from tar.gz. Btw, why do you prefer binary tar.gz instead of RPM? (just curious) | ||||||||||||||||||||||
| Comment by Richard Bensley [ 2013-09-25 ] | ||||||||||||||||||||||
|
Thanks Alexander, I assume this was just a mistake? That worked perfectly. We have used the tar's for deployment for around 5 years now. We run multiple instances per host, globally. Physical split between databases. This same mechanism works on Solaris and CentOS. This also allows us to run multiple versions of MySQL/MariaDB. RPM's via puppet are being considered in the future. But we are waiting for 10.x to go GA, so we can run a single verison to handle all our needs (GTID, Multi-source replication, CONNECT, handlersocket etc). | ||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2013-09-26 ] | ||||||||||||||||||||||
|
Is just a support option when building the binaries. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-09-30 ] | ||||||||||||||||||||||
|
Richard, the problem is that this binary distribution is built on a very old | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-10-21 ] | ||||||||||||||||||||||
|
Stop what about me. I am not using Ubuntu. | ||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2013-10-22 ] | ||||||||||||||||||||||
|
It can be a problem related to the way the connection string is written. Each data source has its own syntax. In addition, there can be several ways to specify the connection. Sometimes you can specify the driver to use Alternatively, you can specify a pre-defined data source (via DSN=) However, some drivers accept some of the pre-defined All his makes specifying the connection string a non trivial task. | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-11-13 ] | ||||||||||||||||||||||
|
But isql is works!!! Query: create table subscrib engine=CONNECT table_type=ODBC tabname='crm.subscrib' connection='DSN=crm_test' Error Code: 1105 [root@crm-dev ~]# ldd /usr/cachesys/bin/libcacheodbc.so | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-11-19 ] | ||||||||||||||||||||||
|
Mikhail, I just installed Cache and checked it with the Connect engine This what I exactly did:
$ sudo -u mysql isql Samplesunixodbc
---------------------------------------
-----------
-----------
mysql> drop table if exists t1; create table t1 (ID INT, Name VARCHAR(50)) engine=CONNECT table_type=ODBC tabname='sample.person' connection='DSN=Samplesunixodbc'; select * from t1 limit 3; Query OK, 0 rows affected (0.05 sec) -----
-----
----- Everything worked fine. I still think that your problem | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-11-19 ] | ||||||||||||||||||||||
|
Alexander, can you try experiment | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-11-19 ] | ||||||||||||||||||||||
|
1) It does not work without a table definition. I found a bug, fixing it now. 2) I don't know how to create a new cache user with the given UID and Password. mysql> drop table if exists t1; create table t1 engine=CONNECT table_type=ODBC connection='DSN=Samplesunixodbc;UID=crm;Password=crm'; ERROR 1105 (HY000): [unixODBC][Cache ODBC][State : S1000][Native Code 417] which looks like a correct answer. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-11-19 ] | ||||||||||||||||||||||
|
2) I've found how to create a new user. It seems to work fine. Note, the correct connection parameter for password is "PWD=crm", mysql> drop table if exists t1; create table t1 (ID INT, Name VARCHAR(50)) tabname='sample.person' engine=CONNECT table_type=ODBC connection='DSN=Samplesunixodbc2;UID=crm;PWD=crm'; select * from t1 limit 1;
-----
----- | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-11-19 ] | ||||||||||||||||||||||
|
Whitch OS?
I am download ODBC from here ftp://ftp.intersystems.com/pub/cache/odbc/2013/cache.2013.1.0.ODBC-lnxsusex64.tar.gz | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-11-19 ] | ||||||||||||||||||||||
|
$ cat /etc/fedora-release | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-11-19 ] | ||||||||||||||||||||||
|
> Note, the correct connection parameter for password is "PWD=crm", Very strange because isql not work if I use PWD param in odbc.ini My odbc.ini config: [Samplesunixodbc] [root@crm-dev etc]# isql -vvv Samplesunixodbc
--------------------------------------- | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-11-19 ] | ||||||||||||||||||||||
|
For some reasons Cache implements them differently:
| ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-11-19 ] | ||||||||||||||||||||||
|
According to this page it must be "PWD=" on the connection string: | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-11-19 ] | ||||||||||||||||||||||
|
are you use SELinux? Try switch in Enforcing mode I am swith my SELinux to Permissive mode and CONNECT engine begins work. but still not work this construction: Error Code: 1105 | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-11-19 ] | ||||||||||||||||||||||
|
type=AVC msg=audit(1384890085.406:76): avc: denied { execute }for pid=1433 comm="mysqld" path="/usr/cachesys/bin/libcacheodbc.so" dev=dm-0 ino=3279212 scontext=unconfined_u:system_r:mysqld_t:s0 tcontext=unconfined_u:object_r:usr_t:s0 tclass=file
| ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-11-20 ] | ||||||||||||||||||||||
|
We'll fix this problem soon: create table subscrib engine=CONNECT table_type=ODBC tabname='crm.subscrib' connection='DSN=crm_test' In the meanwhile please use explicit table structure definition. | ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-11-20 ] | ||||||||||||||||||||||
|
Thanks! What about SELinux? I think process mysqld must be labeled as isql for works with ODBC drivers. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-11-20 ] | ||||||||||||||||||||||
|
Yes, you should configure your SELinux to allow the user "mysql" and the process "mysqld" | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-11-20 ] | ||||||||||||||||||||||
|
By the way, does this work on your box: sudo -u mysql isql Samplesunixodbc ? I.e. I'm curious what SELinux actually disallows:
| ||||||||||||||||||||||
| Comment by Mikhail Gavrilov [ 2013-11-20 ] | ||||||||||||||||||||||
SELinux not block process by user, SELinux uses file system labeling for block. | ||||||||||||||||||||||
| Comment by Richard Bensley [ 2013-12-16 ] | ||||||||||||||||||||||
|
Binary tar does not include ODBC extensions for CONNECT: rbensley@lndwc-27-236:Downloads$ ldd mariadb-10.0.6-linux-x86_64/bin/mysqld This is the same for the glibc 2.14+ package. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2013-12-17 ] | ||||||||||||||||||||||
|
Richard, The binary for glibc-2.14+ does include ODBC support. |