[MDEV-18491] Engine Connect returns an error when we try to fetch data from MSSQL server Created: 2019-02-06  Updated: 2019-02-13  Resolved: 2019-02-13

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.1.37
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Ziad Fawzi Assignee: Olivier Bertrand
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

We have the following installed components on CentOS Linux release 7.5.1804 , x86_64 machine:
1. MariaDB-client-10.1.37 and MariaDB-server-10.1.37-1.el7
2. MariaDB-connect-engine-10.1.37-1.el7
3. unixODBC 2.3.1
4. Microsoft SQL Server ODBC Driver V1.0 for Linux (SQL Server Native Client 11.0), libsqlncli-11.0.so.1790.0



 Description   

We are trying to connect to a remote MSSQL test DB (DSN=ODBC01) & a second MSSQL production DB (DSN=ODBC02) with SSL enabled.

odbc.ini content:

[ODBC01]                                                          
Driver = SQL Server Native Client 11.0
Description = ODBC driver Sample 1
Server = TCP:172.16.203.110,1433
Database = TESTDB
 
[ODBC02]
Driver = SQL Server Native Client 11.0
Description = ODBC driver Sample 2
Server = TCP:10.10.46.143,1433
Database = DB_name

To check connectivity we used unixODBC isql command. Both commands worked fine:

isql ODBC01 -v user1 pw1
isql ODBC02 -v user2 pw2

In mysql we created two tables:

CREATE TABLE tb1 (c1 int) engine=connect table_type=ODBC tabname='table1' CONNECTION='DSN=ODBC01;UID=user1;PWD=pw1;';
CREATE TABLE tb2 (c1 int) engine=connect table_type=ODBC tabname='table2' CONNECTION='DSN=ODBC02;UID=user2;PWD=pw2;';

The first query worked fine,

select count(*) from tb1;

but the second one didn't work:

select count(*) from tb2;
ERROR 1296 (HY000): Got error 122 'Fetching: [Microsoft][SQL Server Native Client 11.0]SSL Provider: [error:80001044:lib(128):func(1):internal error:unexpected error]' from CONNECT

We appreciate your kind support.



 Comments   
Comment by Olivier Bertrand [ 2019-02-06 ]

Here CONNECT is reporting an error occuring in the data source. Difficult to see whether it comes from CONNECT or from the data source. Because the two tables and executed statements are very similar, l don't see how CONNECT could be doing wrong on one call and not on the other.

Could you just run this after having done:

SET connect_xtrace='QUERY';

To see what command CONNECT sends to the data source?

Comment by Ziad Fawzi [ 2019-02-07 ]

Thanks Olivier.

I enabled the trace and ran the following two queries:

select count(*) from tb2;
ERROR 1296 (HY000): Got error 122 'Fetching: [Microsoft][SQL Server Native Client 11.0]SSL Provider: [error:80001044:lib(128):func(1):internal error:unexpected error]' from CONNECT

select * from tb2 where c1=1;

c1 c2
1 9409

1 row in set (1.48 sec)

Here is the log:

Query=SELECT c1, c2 FROM table2
rnd_next CONNECT: Fetching: [Microsoft][SQL Server Native Client 11.0]SSL Provider: [error:80001044:lib(128):func(1):internal error:unexpected error]
Query=SELECT c1, c2 FROM table2 WHERE c1 = 1

P.S I added a second column to table2 just for test.

Comment by Ziad Fawzi [ 2019-02-13 ]

Hi,

I just upgraded my DB to 10.4.2 and the issue is gone.
You may close the ticket please.

Thanks

Generated at Thu Feb 08 08:44:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.