diff --git a/myisam/rt_split.c b/myisam/rt_split.c
index 005e86805bb9393940467890ff83f3afb0c0cd90..31a7d09ab4f396e9656a935471307a08f3295524 100644
--- a/myisam/rt_split.c
+++ b/myisam/rt_split.c
@@ -257,18 +257,17 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
   int n_dim;
   uchar *source_cur, *cur1, *cur2;
   uchar *new_page;
-  int err_code = 0;
-
-  uint nod_flag = mi_test_if_nod(page);
-  uint full_length = key_length + (nod_flag ? nod_flag : 
-                                   info->s->base.rec_reflength);
-
-  int max_keys = (mi_getint(page)-2) / (full_length);
+  int err_code= 0;
+  uint nod_flag= mi_test_if_nod(page);
+  uint full_length= key_length + (nod_flag ? nod_flag : 
+                                  info->s->base.rec_reflength);
+  int max_keys= (mi_getint(page)-2) / (full_length);
 
   n_dim = keyinfo->keysegs / 2;
   
-  if (!(coord_buf= my_alloca(n_dim * 2 * sizeof(double) * (max_keys + 1 + 4) +
-			     sizeof(SplitStruct) * (max_keys + 1))))
+  if (!(coord_buf= (double*) my_alloca(n_dim * 2 * sizeof(double) *
+                                       (max_keys + 1 + 4) +
+                                       sizeof(SplitStruct) * (max_keys + 1))))
     return -1;
 
   task= (SplitStruct *)(coord_buf + n_dim * 2 * (max_keys + 1 + 4));
@@ -311,8 +310,7 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
   cur1 = rt_PAGE_FIRST_KEY(page, nod_flag);
   cur2 = rt_PAGE_FIRST_KEY(new_page, nod_flag);
 
-  n1 = 0;
-  n2 = 0;
+  n1= n2 = 0;
   for (cur = task; cur < stop; ++cur)
   {
     uchar *to;
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index 5b1a33ce68ff30df1a0139a71b0d5e62e0f7100d..c48e70f1d515e99638e90c878027c72fd4476e58 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -230,9 +230,10 @@ Remark:        Disconnect all connections to the database.
 void 
 Ndb::doDisconnect()
 {
-  DBUG_ENTER("Ndb::doDisconnect");
   NdbTransaction* tNdbCon;
   CHECK_STATUS_MACRO_VOID;
+  /* DBUG_ENTER must be after CHECK_STATUS_MACRO_VOID because of 'return' */
+  DBUG_ENTER("Ndb::doDisconnect");
 
   Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes;
   Uint8 *theDBnodes= theImpl->theDBnodes;
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index ae784ae0293ba27eb74d3d2b5c8430dd73d47703..15598e59bb9b45f33eb6ed5cd0c9126cbd515357 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -605,7 +605,11 @@ void field_conv(Field *to,Field *from)
          to->type() != FIELD_TYPE_DATE &&
          to->type() != FIELD_TYPE_DATETIME))
     {						// Identical fields
-      memcpy(to->ptr,from->ptr,to->pack_length());
+#ifdef HAVE_purify
+      /* This may happen if one does 'UPDATE ... SET x=x' */
+      if (to->ptr != from->ptr)
+#endif
+        memcpy(to->ptr,from->ptr,to->pack_length());
       return;
     }
   }
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index a5694189976838c7a959cee9fe67a1cad44c4ad4..85abb09531b24eb3b3565c76a7bf6ab5c459f0ce 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -584,13 +584,8 @@ bool Item_sum_distinct::setup(THD *thd)
 {
   List<create_field> field_list;
   create_field field_def;                              /* field definition */
-
   DBUG_ENTER("Item_sum_distinct::setup");
-
-  /*
-    Setup can be called twice for ROLLUP items. This is a bug.
-    Please add DBUG_ASSERT(tree == 0) here when it's fixed.
-  */
+  DBUG_ASSERT(tree == 0);
 
   /*
     Virtual table and the tree are created anew on each re-execution of
@@ -610,7 +605,7 @@ bool Item_sum_distinct::setup(THD *thd)
                                args[0]->unsigned_flag);
 
   if (! (table= create_virtual_tmp_table(thd, field_list)))
-      return TRUE;
+    return TRUE;
 
   /* XXX: check that the case of CHAR(0) works OK */
   tree_key_length= table->s->reclength - table->s->null_bytes;
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index cded9e2a13e08d33f14aa810706dea2c55871722..ca7bf174abf4cb9ab1bacca47612beec6f6c171e 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -48,7 +48,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
   {
     my_error(ER_VIEW_DELETE_MERGE_VIEW, MYF(0),
 	     table_list->view_db.str, table_list->view_name.str);
-    DBUG_RETURN(-1);
+    DBUG_RETURN(TRUE);
   }
   table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
   thd->proc_info="init";
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ebbf2d175e68f1c3c8f46536a319b4db29bbf85d..0e8f7746f0f5428f81eb2827f3078db43c4745c2 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1270,8 +1270,10 @@ void free_items(Item *item)
 
 void cleanup_items(Item *item)
 {
+  DBUG_ENTER("cleanup_items");  
   for (; item ; item=item->next)
     item->cleanup();
+  DBUG_VOID_RETURN;
 }
 
 int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 9937327641037c7a15d233318fecfcbbedf32b55..71414f8cc76997c7abe59931b767afaaee6cd5a6 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -12655,8 +12655,10 @@ static bool setup_sum_funcs(THD *thd, Item_sum **func_ptr)
   Item_sum *func;
   DBUG_ENTER("setup_sum_funcs");
   while ((func= *(func_ptr++)))
+  {
     if (func->setup(thd))
       DBUG_RETURN(TRUE);
+  }
   DBUG_RETURN(FALSE);
 }
 
@@ -12943,8 +12945,6 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields,
 	*/
 	item= item->copy_or_same(thd);
 	((Item_sum*) item)->make_unique();
-	if (((Item_sum*) item)->setup(thd))
-	  return 1;
 	*(*func)= (Item_sum*) item;
 	(*func)++;
       }
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index 4d7c17e977cba38a45bd0ab01e36c8379591a9c6..935cc2d380df4f0fc9f477671b98638d9e969280 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -135,6 +135,16 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
       to+= res_length;
       continue;
     }
+    else if (*fmt == 'c')                       /* Character parameter */
+    {
+      register int larg;
+      if (to == end)
+        break;
+      larg = va_arg(ap, int);
+      *to++= (char) larg;
+      continue;
+    }
+
     /* We come here on '%%', unknown code or too long parameter */
     if (to == end)
       break;