summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2000-11-06 19:39:13 -0700
committersasha@mysql.sashanet.com <>2000-11-06 19:39:13 -0700
commit2b05ed9d026925ea6dcac9ff16b8efb7ea94f473 (patch)
treef165c573e30544964d89e3a5e99c270fef4686b1
parentfddab55df3f6455c6a91f5c9300d58ef34d3165e (diff)
downloadmariadb-git-2b05ed9d026925ea6dcac9ff16b8efb7ea94f473.tar.gz
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
-rw-r--r--.bzrignore1
-rw-r--r--sql/item_strfunc.cc10
-rw-r--r--sql/item_strfunc.h8
-rw-r--r--sql/mini_client.cc5
-rw-r--r--sql/mini_client.h2
-rw-r--r--sql/mysqlbinlog.cc2
-rw-r--r--sql/slave.cc5
-rw-r--r--sql/sql_repl.cc2
8 files changed, 30 insertions, 5 deletions
diff --git a/.bzrignore b/.bzrignore
index ba1c287dae1..ab03733c7f9 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -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.MYI
repl-tests/test-repl-ts/repl-timestamp.master.reject
+client/.mysqladmin.c.swp
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index c6a5427b444..6b8b3762aa1 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -309,6 +309,16 @@ void Item_func_concat_ws::fix_length_and_dec()
max_length=MAX_BLOB_WIDTH;
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();
}
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 97bc1063db3..1b829b19439 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -69,7 +69,13 @@ public:
~Item_func_concat_ws() { delete separator; }
String *val_str(String *);
void fix_length_and_dec();
- const char *func_name() const { return "concat_ws"; }
+ 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"; }
};
class Item_func_reverse :public Item_str_func
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index 34f5c0a6ccd..3520062e052 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -371,6 +371,11 @@ char * STDCALL mc_mysql_error(MYSQL *mysql)
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)
{
MYSQL tmp_mysql;
diff --git a/sql/mini_client.h b/sql/mini_client.h
index 1103bd379fe..f7d95a1b66e 100644
--- a/sql/mini_client.h
+++ b/sql/mini_client.h
@@ -39,7 +39,9 @@ uint STDCALL
mc_net_safe_read(MYSQL *mysql);
char * STDCALL mc_mysql_error(MYSQL *mysql);
+int STDCALL mc_mysql_errno(MYSQL *mysql);
my_bool STDCALL mc_mysql_reconnect(MYSQL* mysql);
#endif
+
diff --git a/sql/mysqlbinlog.cc b/sql/mysqlbinlog.cc
index 179bc717093..3756d8bf712 100644
--- a/sql/mysqlbinlog.cc
+++ b/sql/mysqlbinlog.cc
@@ -321,7 +321,7 @@ static void dump_local_log_entries(const char* logname)
if(!file)
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()");
if(!position)
diff --git a/sql/slave.cc b/sql/slave.cc
index 99a64da87bd..3474a98a0c7 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -562,8 +562,9 @@ static uint read_event(MYSQL* mysql, MASTER_INFO *mi)
return packet_error;
if (len == packet_error || (int) len < 1)
{
- sql_print_error("Error reading packet from server: %s (%d)",
- mc_mysql_error(mysql), read_errno);
+ sql_print_error("Error reading packet from server: %s (read_errno %d,\
+server_errno=%d)",
+ mc_mysql_error(mysql), read_errno, mc_mysql_errno(mysql));
return packet_error;
}
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index b2c3999f92d..3dc9514476b 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -466,7 +466,7 @@ sweepstakes if you report the bug";
pthread_mutex_unlock(&LOCK_thread_count);
if(log)
(void) my_fclose(log, MYF(MY_WME));
- send_error(&thd->net, 0, errmsg);
+ send_error(&thd->net, my_errno, errmsg);
DBUG_VOID_RETURN;
}