[MDEV-24493] CONNECT sometimes returns wrong column's data for the ODBC table created based on Oracle view Created: 2020-12-27 Updated: 2022-01-25 Resolved: 2021-10-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.3.23, 10.3.27 |
| Fix Version/s: | 10.2.41, 10.3.32, 10.4.22, 10.5.13, 10.6.5, 10.7.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Valerii Kravchuk | Assignee: | Olivier Bertrand |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS 7 |
||
| Description |
|
This is a bit tricky. We need Oracle server, let's say 18 XE, and MariaDB 10.3.x with CONNECT engine. It is easy to get these in Docker:
I've used official Docker image for centos7 and image created based on this Oracle's GitHub project:
After that create database as follows:
Now install these packages (I skip the details of setting up MariaDB repo etc) in clean centos7 image and update it:
The files to add/configure are these:
assuming that 172.17.0.2 is your Oracle 18 XE container IP. Now from centos7 we can connect with SQL*Plus and create these:
Column types and data in the t table are clear, and the view created as presented above, it converts date column into a string in some custom format. Now at MariaDB side:
So, while SELECT * works as expected, depending on the explicit list of columns in SELECT clause we see c2 with data either from correct or from some other column. The data are not random, nor corrupted, they just come from some other column it seems. This is a bug. |
| Comments |
| Comment by Olivier Bertrand [ 2021-10-13 ] | ||||
|
A bug indeed not fixed yet.
No bug with this one. | ||||
| Comment by Olivier Bertrand [ 2021-10-15 ] | ||||
|
Fixed. However, when the columns are manually defined, for instance to change the data type or column name, they must be defined in the same order they appear in the SRCDEF option. | ||||
| Comment by Olivier Bertrand [ 2021-10-15 ] | ||||
|
BTW this was not related to Oracle an views. It was a CONNECT ODBC bug happening with SRCDEF option that would happen with any such queries whatever the server or the remote table is. |