Added more information to error message in case where mysql_error provides wrong error message.

This commit is contained in:
vraatikka
2013-12-09 13:35:45 +02:00
parent 1c55a4cee7
commit 10eafd61bc

View File

@ -1234,16 +1234,31 @@ int main(int argc, char **argv)
if (mysql_errno(NULL) == 2000) if (mysql_errno(NULL) == 2000)
{ {
fprintf(stderr, if (strncmp(mysql_error(NULL),
"*\n* Error : %s\n* Hint " "Unknown MySQL error",
":\n* Ensure that you have " strlen("Unknown MySQL error")) != 0)
"MySQL error messages file, errmsg.sys in " {
"\n* %s\n* Ensure that Embedded " fprintf(stderr,
"Server Library version matches " "*\n* Error : MySQL Error should "
"exactly with that of the errmsg.sys " "be \"Unknown MySQL error\" "
"file.\n*\n", "instead of %s\n* Hint "
mysql_error(NULL), ":\n* Ensure that you have "
language_arg); "MySQL error messages file, errmsg.sys in "
"\n* %s\n* Ensure that Embedded "
"Server Library version matches "
"exactly with that of the errmsg.sys "
"file.\n*\n",
mysql_error(NULL),
language_arg);
}
else
{
fprintf(stderr,
"*\n* Error : MySQL Error %d, %s"
"\n*\n",
mysql_errno(NULL),
mysql_error(NULL));
}
} }
} }
skygw_log_write_flush( skygw_log_write_flush(