From c1a8b8daa7f932ace5209ad3704889961a11a9bb Mon Sep 17 00:00:00 2001 From: "stewart@willster.(none)" <> Date: Tue, 17 Oct 2006 00:15:58 +1000 Subject: [PATCH] BUG#20839 Illegal error code: 155 returned downgrading from 5.1.12-> 5.1.11 Post review fix: Magnus suggested making sure that new mysqldump still worked flawlessly with old servers. --- client/mysqldump.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 21d9d78c6de..4008668b4bc 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2877,8 +2877,24 @@ static int dump_tablespaces(char* ts_where) ", ENGINE" " ORDER BY LOGFILE_GROUP_NAME"); - if (mysql_query_with_error_report(mysql, &tableres,sqlbuf)) + if (mysql_query(mysql, sqlbuf) || + !(tableres = mysql_store_result(mysql))) + { + if (mysql_errno(mysql) == ER_BAD_TABLE_ERROR || + mysql_errno(mysql) == ER_BAD_DB_ERROR || + mysql_errno(mysql) == ER_UNKNOWN_TABLE) + { + fprintf(md_result_file, + "\n--\n-- Not dumping tablespaces as no INFORMATION_SCHEMA.FILES" + " table on this server\n--\n"); + check_io(md_result_file); + return 0; + } + + my_printf_error(0, "Error: Couldn't dump tablespaces %s", + MYF(0), mysql_error(mysql)); return 1; + } buf[0]= 0; while ((row= mysql_fetch_row(tableres)))