Commit ae728729 authored by unknown's avatar unknown

sql/item_strfunc.cc

    fixed coredump in concat_ws
sql/item_strfunc.h
    fixed coredump in concat_ws
sql/mini_client.cc
    added mc_mysql_error()
sql/mini_client.h
    added mc_mysql_errno()
sql/mysqlbinlog.cc
    fixed bug in --postion for local files
sql/slave.cc
    more verbose message on bad net reads
sql/sql_repl.cc
    send errno on error in mysql_binlog_send


sql/item_strfunc.cc:
  fixed coredump in concat_ws
sql/item_strfunc.h:
  fixed coredump in concat_ws
sql/mini_client.cc:
  added mc_mysql_error()
sql/mini_client.h:
  added mc_mysql_errno()
sql/mysqlbinlog.cc:
  fixed bug in --postion for local files
BitKeeper/etc/ignore:
  Added client/.mysqladmin.c.swp to the ignore list
sql/slave.cc:
  more verbose message on bad net reads
sql/sql_repl.cc:
  send errno on error in mysql_binlog_send
parent e07aa795
...@@ -173,3 +173,4 @@ mysql-test/var/lib/test/elt_ck2.frm ...@@ -173,3 +173,4 @@ mysql-test/var/lib/test/elt_ck2.frm
mysql-test/var/lib/test/elt_ck2.MYD mysql-test/var/lib/test/elt_ck2.MYD
mysql-test/var/lib/test/elt_ck2.MYI mysql-test/var/lib/test/elt_ck2.MYI
repl-tests/test-repl-ts/repl-timestamp.master.reject repl-tests/test-repl-ts/repl-timestamp.master.reject
client/.mysqladmin.c.swp
...@@ -309,6 +309,16 @@ void Item_func_concat_ws::fix_length_and_dec() ...@@ -309,6 +309,16 @@ void Item_func_concat_ws::fix_length_and_dec()
max_length=MAX_BLOB_WIDTH; max_length=MAX_BLOB_WIDTH;
maybe_null=1; maybe_null=1;
} }
used_tables_cache|=separator->used_tables();
const_item_cache&=separator->const_item();
}
void Item_func_concat_ws::update_used_tables()
{
Item_func::update_used_tables();
separator->update_used_tables();
used_tables_cache|=separator->used_tables();
const_item_cache&=separator->const_item();
} }
......
...@@ -69,6 +69,12 @@ class Item_func_concat_ws :public Item_str_func ...@@ -69,6 +69,12 @@ class Item_func_concat_ws :public Item_str_func
~Item_func_concat_ws() { delete separator; } ~Item_func_concat_ws() { delete separator; }
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
void update_used_tables();
bool fix_fields(THD *thd,struct st_table_list *tlist)
{
return (separator->fix_fields(thd,tlist)
|| Item_func::fix_fields(thd,tlist));
}
const char *func_name() const { return "concat_ws"; } const char *func_name() const { return "concat_ws"; }
}; };
......
...@@ -371,6 +371,11 @@ char * STDCALL mc_mysql_error(MYSQL *mysql) ...@@ -371,6 +371,11 @@ char * STDCALL mc_mysql_error(MYSQL *mysql)
return (mysql)->net.last_error; return (mysql)->net.last_error;
} }
int STDCALL mc_mysql_errno(MYSQL *mysql)
{
return (mysql)->net.last_errno;
}
my_bool STDCALL mc_mysql_reconnect(MYSQL *mysql) my_bool STDCALL mc_mysql_reconnect(MYSQL *mysql)
{ {
MYSQL tmp_mysql; MYSQL tmp_mysql;
......
...@@ -39,7 +39,9 @@ uint STDCALL ...@@ -39,7 +39,9 @@ uint STDCALL
mc_net_safe_read(MYSQL *mysql); mc_net_safe_read(MYSQL *mysql);
char * STDCALL mc_mysql_error(MYSQL *mysql); char * STDCALL mc_mysql_error(MYSQL *mysql);
int STDCALL mc_mysql_errno(MYSQL *mysql);
my_bool STDCALL mc_mysql_reconnect(MYSQL* mysql); my_bool STDCALL mc_mysql_reconnect(MYSQL* mysql);
#endif #endif
...@@ -321,7 +321,7 @@ static void dump_local_log_entries(const char* logname) ...@@ -321,7 +321,7 @@ static void dump_local_log_entries(const char* logname)
if(!file) if(!file)
die("Could not open log file %s", logname); die("Could not open log file %s", logname);
if(my_fseek(file, position, MY_SEEK_SET, MYF(MY_WME))) if(my_fseek(file, position, MY_SEEK_SET, MYF(MY_WME)) == MY_FILEPOS_ERROR)
die("failed on my_fseek()"); die("failed on my_fseek()");
if(!position) if(!position)
......
...@@ -562,8 +562,9 @@ static uint read_event(MYSQL* mysql, MASTER_INFO *mi) ...@@ -562,8 +562,9 @@ static uint read_event(MYSQL* mysql, MASTER_INFO *mi)
return packet_error; return packet_error;
if (len == packet_error || (int) len < 1) if (len == packet_error || (int) len < 1)
{ {
sql_print_error("Error reading packet from server: %s (%d)", sql_print_error("Error reading packet from server: %s (read_errno %d,\
mc_mysql_error(mysql), read_errno); server_errno=%d)",
mc_mysql_error(mysql), read_errno, mc_mysql_errno(mysql));
return packet_error; return packet_error;
} }
......
...@@ -466,7 +466,7 @@ sweepstakes if you report the bug"; ...@@ -466,7 +466,7 @@ sweepstakes if you report the bug";
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);
if(log) if(log)
(void) my_fclose(log, MYF(MY_WME)); (void) my_fclose(log, MYF(MY_WME));
send_error(&thd->net, 0, errmsg); send_error(&thd->net, my_errno, errmsg);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment