summaryrefslogtreecommitdiff
path: root/sql/rpl_handler.cc
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2010-11-04 13:29:16 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2010-11-04 13:29:16 +0800
commit6429e7d36b7c608392fb5e94f14b092addde3eda (patch)
tree52ef11cfebdcfcecdfb6c5390ba471fcd9938a0c /sql/rpl_handler.cc
parent1af545aa84eac66ee11673c6c45da4417fea6936 (diff)
downloadmariadb-git-6429e7d36b7c608392fb5e94f14b092addde3eda.tar.gz
BUG#47027 delegates_init() failure is not user friendly (usability issue)
Function delegetas_init() did not report proper error messages when there are failures, which made it hard to know where the problem occurred. Fixed the problem by adding specific error message for every possible place that can fail. And since these failures are supposed to never happen, ask the user to report a bug if they happened.
Diffstat (limited to 'sql/rpl_handler.cc')
-rw-r--r--sql/rpl_handler.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc
index 5f16544d855..4355942e47f 100644
--- a/sql/rpl_handler.cc
+++ b/sql/rpl_handler.cc
@@ -105,12 +105,20 @@ int delegates_init()
transaction_delegate= new (place_trans_mem) Trans_delegate;
if (!transaction_delegate->is_inited())
+ {
+ sql_print_error("Initialization of transaction delegates failed. "
+ "Please report a bug.");
return 1;
+ }
binlog_storage_delegate= new (place_storage_mem) Binlog_storage_delegate;
if (!binlog_storage_delegate->is_inited())
+ {
+ sql_print_error("Initialization binlog storage delegates failed. "
+ "Please report a bug.");
return 1;
+ }
#ifdef HAVE_REPLICATION
void *place_transmit_mem= transmit_mem.data;
@@ -119,16 +127,29 @@ int delegates_init()
binlog_transmit_delegate= new (place_transmit_mem) Binlog_transmit_delegate;
if (!binlog_transmit_delegate->is_inited())
+ {
+ sql_print_error("Initialization of binlog transmit delegates failed. "
+ "Please report a bug.");
return 1;
+ }
binlog_relay_io_delegate= new (place_relay_io_mem) Binlog_relay_IO_delegate;
if (!binlog_relay_io_delegate->is_inited())
+ {
+ sql_print_error("Initialization binlog relay IO delegates failed. "
+ "Please report a bug.");
return 1;
+ }
#endif
if (pthread_key_create(&RPL_TRANS_BINLOG_INFO, NULL))
+ {
+ sql_print_error("Error while creating pthread specific data key for replication. "
+ "Please report a bug.");
return 1;
+ }
+
return 0;
}