summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-04-02 17:54:57 +0300
committermonty@hundin.mysql.fi <>2002-04-02 17:54:57 +0300
commitd80ebc17d6e89cac37bedb198b073dddade9c61b (patch)
tree0918e7f417ac64ab19af6ea441c12c97e897c1b9 /sql
parent591bda67487d0215f4fd486dcca8ea703c626048 (diff)
downloadmariadb-git-d80ebc17d6e89cac37bedb198b073dddade9c61b.tar.gz
Cleanups
Don't use DBUG library for struct st_my_thread_var to make code less complicated.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc5
-rw-r--r--sql/net_pkg.cc10
-rw-r--r--sql/sql_parse.cc2
3 files changed, 10 insertions, 7 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 0c83698e60a..bb773af1ddf 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -790,8 +790,9 @@ String *Item_func_coalesce::val_str(String *str)
null_value=0;
for (uint i=0 ; i < arg_count ; i++)
{
- if (args[i]->val_str(str) != NULL)
- return args[i]->val_str(str);
+ String *res;
+ if ((res=args[i]->val_str(str)))
+ return res;
}
null_value=1;
return 0;
diff --git a/sql/net_pkg.cc b/sql/net_pkg.cc
index 9e52e4580e6..1ab3e18424f 100644
--- a/sql/net_pkg.cc
+++ b/sql/net_pkg.cc
@@ -108,10 +108,12 @@ net_printf(NET *net, uint errcode, ...)
thd->query_error = 1; // if we are here, something is wrong :-)
query_cache_abort(net); // Safety
va_start(args,errcode);
- // Sasha: this is needed to make net_printf() work with 0 argument for
- // errorcode and use the argument after that as the format string. This
- // is usefull for rare errors that are not worth the hassle to put in
- // errmsg.sys, but at the same time, the message is not fixed text
+ /*
+ The following is needed to make net_printf() work with 0 argument for
+ errorcode and use the argument after that as the format string. This
+ is useful for rare errors that are not worth the hassle to put in
+ errmsg.sys, but at the same time, the message is not fixed text
+ */
format=errcode ? ER(errcode) : va_arg(args,char*);
offset= net->return_errno ? 2 : 0;
text_pos=(char*) net->buff+head_length+offset+1;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 7f4553459f1..dc89888a1a5 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2990,7 +2990,7 @@ bool add_field_to_list(char *field_name, enum_field_types type,
if (new_field->length >= MAX_FIELD_WIDTH ||
(!new_field->length && !(new_field->flags & BLOB_FLAG) &&
- type != FIELD_TYPE_STRING))
+ type != FIELD_TYPE_STRING && type != FIELD_TYPE_VAR_STRING))
{
net_printf(&thd->net,ER_TOO_BIG_FIELDLENGTH,field_name,
MAX_FIELD_WIDTH-1); /* purecov: inspected */