mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- Do not throw an error on empty ODBC CATFUNC (MDEV-5455)
modified: storage/connect/ha_connect.cc storage/connect/odbconn.cpp
This commit is contained in:
@@ -4407,7 +4407,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
|
||||
if (!qrp) {
|
||||
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
|
||||
return HA_ERR_INTERNAL_ERROR;
|
||||
} // endif qrp
|
||||
} // endif !qrp
|
||||
|
||||
if (fnc != FNC_NO || src || ttp == TAB_PIVOT) {
|
||||
// Catalog like table
|
||||
@@ -4429,7 +4429,18 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
|
||||
|
||||
} // endfor crp
|
||||
|
||||
} else // Not a catalog table
|
||||
} else {
|
||||
// Not a catalog table
|
||||
if (!qrp->Nblin) {
|
||||
if (tab)
|
||||
sprintf(g->Message, "Cannot get columns from %s", tab);
|
||||
else
|
||||
strcpy(g->Message, "Fail to retrieve columns");
|
||||
|
||||
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
|
||||
return HA_ERR_INTERNAL_ERROR;
|
||||
} // endif !nblin
|
||||
|
||||
for (i= 0; !rc && i < qrp->Nblin; i++) {
|
||||
typ= len= prec= dec= 0;
|
||||
tm= NOT_NULL_FLAG;
|
||||
@@ -4522,6 +4533,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
|
||||
rc= HA_ERR_OUT_OF_MEM;
|
||||
} // endfor i
|
||||
|
||||
} // endif fnc
|
||||
|
||||
if (!rc)
|
||||
rc= init_table_share(thd, table_s, create_info, &sql);
|
||||
// rc= init_table_share(thd, table_s, create_info, dsn, &sql);
|
||||
|
@@ -2287,6 +2287,7 @@ int ODBConn::GetCatInfo(CATPARM *cap)
|
||||
|
||||
} // endfor i
|
||||
|
||||
#if 0
|
||||
if ((crow = i) && (rc == SQL_NO_DATA || rc == SQL_SUCCESS_WITH_INFO))
|
||||
rc = SQL_SUCCESS;
|
||||
|
||||
@@ -2303,6 +2304,15 @@ int ODBConn::GetCatInfo(CATPARM *cap)
|
||||
|
||||
} else
|
||||
ThrowDBX(rc, fnc, hstmt);
|
||||
#endif // 0
|
||||
|
||||
if (!rc || rc == SQL_NO_DATA || rc == SQL_SUCCESS_WITH_INFO) {
|
||||
if ((rc = SQLFetch(hstmt)) != SQL_NO_DATA_FOUND)
|
||||
qrp->Truncated = true;
|
||||
|
||||
crow = i;
|
||||
} else
|
||||
ThrowDBX(rc, fnc, hstmt);
|
||||
|
||||
irc = (int)crow;
|
||||
} catch(DBX *x) {
|
||||
|
Reference in New Issue
Block a user