[MDEV-7522] CONNECT table for mdb files (with easysoft driver) Created: 2015-01-28 Updated: 2015-02-04 Resolved: 2015-02-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.0.16 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Takuya Aoki (Inactive) | Assignee: | Olivier Bertrand |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS release 6.5 (X86_64) |
||
| Attachments: |
|
| Description |
|
I am testing with Easysoft ODBC-Access Drive to create a CONNECT table linked to a .mdb file. Installing Easysoft ODBC-Access Drive
checking isql
making a CONNECT table
|
| Comments |
| Comment by Elena Stepanova [ 2015-01-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
FederatedX doesn't have the problem, so it doesn't seem to be a caused by table discovery as such – probably a Connect problem, then? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Takuya Aoki (Inactive) [ 2015-02-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Can you tell me if it happens only on ODBC tables or with other CONNECT tables as well? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2015-02-03 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have tested this both on Windows an Linux. On windows
This shows that CONNECT does not do any truncation of column names to 24 characters. On LinuxAfter installing the easySoft stuff, I did the same test and this time, while it was working all right with isbl, the column name have been truncated to 24 characters when using CONNECT. After adding some tracing in the code, I finally found the reason. When defining the table without specifying the columns, MariaDB calls CONNECT's connect_assisted_discovery function that calls the ODBCColumns function that get the columns definition via the ODBC SQLColumns function. When allocating the memory to store the results, it also interrogates the ODBC server to know some of its limitations, for instance:
To know the maximum number of columns in a table and:
to know the size of the buffer to allocate to receive column names. What happen is that on Windows this last function returns 128 but on Linux it returns 24! This is why the column names are truncated. This is not a CONNECT problem but a unixODBC/MSSQL problem that should be transferred to them. The possible workaround:
Indeed, when column are specified, you can use column names longer that that and they are accepted when querying the table! As a matter of fact, this unixODBC/MSSQL bug seems limited to the return of the SQLGetInfo function (called by GetMaxValue) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Takuya Aoki (Inactive) [ 2015-02-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you for your work specifying the reason. |