[ODBC-30] SQLDriverConnect failed with DSN.Server = remote Host IP, mariadb odbc still try localhost unix socket. Created: 2016-02-01  Updated: 2016-03-07  Resolved: 2016-03-07

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: None
Affects Version/s: 1.0.5
Fix Version/s: 1.0.6

Type: Bug Priority: Major
Reporter: xiao yuanli Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 1
Labels: None


 Description   

i use 2.0.9 beta version not 1.0.5 on ubuntu 14.04 x86_64

395 void db_connect(DB *dbodbc) {
(gdb)
462 V_OD_erg = SQLDriverConnect(dbodbc->V_OD_hdbc,NULL,ConnStr,SQL_NTS,ConnStrOut,sizeof(ConnStrOut), &ConnStrOutLen,SQL_DRIVER_NOPROMPT);
(gdb)
464 if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
(gdb) p ConnStr
$1 = "DSN=cacti;Server=9.111.251.117;UID=cacti;PWD=admin;Database=cacti;Port=3306;Sokcet='';OPTION=4196352\000\000\000\000\265\350\377\377\377\177\000\000\000\000\000\000\000\000\000\000`\033\234\000\000\000\000\000Daemon_User www-data\n\000acti/log/cacti.log\n\000", '-' <repeats 30 times>...
(gdb) n
462 V_OD_erg = SQLDriverConnect(dbodbc->V_OD_hdbc,NULL,ConnStr,SQL_NTS,ConnStrOut,sizeof(ConnStrOut), &ConnStrOutLen,SQL_DRIVER_NOPROMPT);
(gdb)
464 if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
(gdb)
466 V_OD_erg2=SQLGetDiagRec(SQL_HANDLE_DBC, dbodbc->V_OD_hdbc,1, V_OD_stat, &V_OD_err,V_OD_msg,SMALL_BUFSIZE,&V_OD_mlen);
(gdb)
467 printf("ODBC: Connection Failed:%d %d %s %d %s\n",V_OD_erg2,V_OD_erg,V_OD_stat,V_OD_err,V_OD_msg);
(gdb)
ODBC: Connection Failed:0 -1 S1000 2002 [unixODBC][ma-2.0.9]Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)



 Comments   
Comment by xiao yuanli [ 2016-02-02 ]

Not a bug, remove Socket from the odbc.ini file it is OK.
Please close it.

Comment by Lawrin Novitsky [ 2016-02-02 ]

No, I will leave it in place. It's still a bug. Connection string parameters should take precedence over DSN values. It's not obvious whether giving tcp/ip connection credentials like SERVER should override SOCKET from DSN. But I would say that if SERVER is not 'localhost' connector should use TCP/IP. And at least we have to verify, that giving TCPIP=1 in connection string helps.
Thank you for you report, and may I ask you one more time for another one - for the problem we talked about on IRC? I would like to have trace or the dump for the crash. Thank you in advance.

Comment by Lawrin Novitsky [ 2016-03-07 ]

Fix pushed in revision 7345

Generated at Thu Feb 08 03:25:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.