summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-07-27 16:03:48 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-07-27 16:03:48 -0300
commit0ddefa603a654560dc3e703f3c7ed9242303fee4 (patch)
tree8db4348d69fb83b1adb0677a4b34deeecdff2f9c /libmysqld
parent4fe66512fa6513220f2ae9966a35f89e1bba9f2b (diff)
downloadmariadb-git-0ddefa603a654560dc3e703f3c7ed9242303fee4.tar.gz
Post-merge fix for Bug#43587: Handle failures to execute a statement
during bootstrap on a embedded server.
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index d644c45a66a..ec108bf372e 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -1078,9 +1078,19 @@ net_send_eof(THD *thd, uint server_status, uint total_warn_count)
void net_send_error_packet(THD *thd, uint sql_errno, const char *err)
{
- MYSQL_DATA *data= thd->cur_data ? thd->cur_data : thd->alloc_new_dataset();
- struct embedded_query_result *ei= data->embedded_info;
+ MYSQL_DATA *data= thd->cur_data;
+ struct embedded_query_result *ei;
+
+ if (!thd->mysql) // bootstrap file handling
+ {
+ fprintf(stderr, "ERROR: %d %s\n", sql_errno, err);
+ return;
+ }
+
+ if (!data)
+ data= thd->alloc_new_dataset();
+ ei= data->embedded_info;
ei->last_errno= sql_errno;
strmake(ei->info, err, sizeof(ei->info)-1);
strmov(ei->sqlstate, mysql_errno_to_sqlstate(sql_errno));