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

@ -1233,9 +1233,15 @@ int main(int argc, char **argv)
print_log_n_stderr(false, true, fprerr, fprerr, 0); print_log_n_stderr(false, true, fprerr, fprerr, 0);
if (mysql_errno(NULL) == 2000) if (mysql_errno(NULL) == 2000)
{
if (strncmp(mysql_error(NULL),
"Unknown MySQL error",
strlen("Unknown MySQL error")) != 0)
{ {
fprintf(stderr, fprintf(stderr,
"*\n* Error : %s\n* Hint " "*\n* Error : MySQL Error should "
"be \"Unknown MySQL error\" "
"instead of %s\n* Hint "
":\n* Ensure that you have " ":\n* Ensure that you have "
"MySQL error messages file, errmsg.sys in " "MySQL error messages file, errmsg.sys in "
"\n* %s\n* Ensure that Embedded " "\n* %s\n* Ensure that Embedded "
@ -1245,6 +1251,15 @@ int main(int argc, char **argv)
mysql_error(NULL), mysql_error(NULL),
language_arg); 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(
LOGFILE_ERROR, LOGFILE_ERROR,