1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-04 04:42:30 +03:00

MCOL-1885 Fix libmysql error handling

If an error occurs in mysql_real_query() it fell through and tried to
get a result set anyway. This caused the MariaDB error message to be
forgotten and a generic one returned instead.

This fix returns the query error message and also uses the int error
code for generic errors instead of casting it to an unsigned int.
This commit is contained in:
Andrew Hutchings
2018-11-13 17:22:36 +00:00
parent 9cf4f01a54
commit ccca4e1347
2 changed files with 3 additions and 2 deletions

View File

@ -104,6 +104,7 @@ int LibMySQL::run(const char* query)
{
fErrStr = "fatal error runing mysql_real_query() in libmysql_client lib";
ret = -1;
return ret;
}
fRes = mysql_use_result(fCon);
@ -117,7 +118,7 @@ int LibMySQL::run(const char* query)
return ret;
}
void LibMySQL::handleMySqlError(const char* errStr, unsigned int errCode)
void LibMySQL::handleMySqlError(const char* errStr, int errCode)
{
ostringstream oss;