MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:monty Date:November 30 2006 1:41am
Subject:bk commit into 5.1 tree (monty:1.2380) BUG#21428
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of monty. When monty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-11-30 03:40:42+02:00, monty@stripped +63 -0
  Fixed compiler warnings (Mostly VC++):
  - Removed not used variables
  - Changed some ulong parameters/variables to ulonglong (possible serious bug)
  - Added casts to get rid of safe assignment from longlong to long (and similar)
  - Added casts to function parameters
  - Fixed signed/unsigned compares
  - Added some constructores to structures
  - Removed some not portable constructs
  
  Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
  (Added new parameter to net_clear() to define when we want the communication buffer to be emptied)

  client/mysql.cc@stripped, 2006-11-30 03:40:26+02:00, monty@stripped +0 -1
    Removed not used variable

  client/mysqldump.c@stripped, 2006-11-30 03:40:26+02:00, monty@stripped +1 -1
    Fixed compiler warning

  client/mysqlslap.c@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +2 -0
    Fixed compiler warning

  client/mysqltest.c@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +4 -4
    Fixed compiler warning

  extra/replace.c@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +4 -2
    Fixed compiler warning

  include/my_global.h@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +2 -2
    Fixed compiler warning

  include/mysql_com.h@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +1 -1
    Changed prototype for net_clear()

  libmysql/libmysql.c@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +1 -1
    Changed prototype for net_clear()

  mysys/base64.c@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +1 -1
    Fixed compiler warning (function definition and prototype didn't match)

  mysys/my_thr_init.c@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +3 -1
    AFter merge fixes

  mysys/my_vle.c@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql-common/client.c@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +3 -4
    Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"

  sql-common/my_time.c@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +9 -9
    Fixed compiler warning

  sql/event_data_objects.cc@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +8 -8
    Fixed compiler warning

  sql/event_scheduler.cc@stripped, 2006-11-30 03:40:27+02:00, monty@stripped +0 -1
    Removed not used variable

  sql/field.cc@stripped, 2006-11-30 03:40:28+02:00, monty@stripped +3 -7
    Removed not used variables
    Fixed compiler warning

  sql/gen_lex_hash.cc@stripped, 2006-11-30 03:40:28+02:00, monty@stripped +3 -2
    Fixed compiler warning

  sql/ha_partition.h@stripped, 2006-11-30 03:40:28+02:00, monty@stripped +3 -3
    Fixed compiler warning

  sql/handler.cc@stripped, 2006-11-30 03:40:28+02:00, monty@stripped +3 -3
    Fixed compiler warning

  sql/item.cc@stripped, 2006-11-30 03:40:28+02:00, monty@stripped +2 -2
    Fixed compiler warning

  sql/item_create.cc@stripped, 2006-11-30 03:40:29+02:00, monty@stripped +3 -2
    Fixed compiler warning

  sql/item_func.cc@stripped, 2006-11-30 03:40:29+02:00, monty@stripped +5 -5
    Fixed compiler warning

  sql/item_strfunc.cc@stripped, 2006-11-30 03:40:29+02:00, monty@stripped +16 -15
    Fixed compiler warning

  sql/item_timefunc.cc@stripped, 2006-11-30 03:40:29+02:00, monty@stripped +0 -1
    Fixed compiler warning

  sql/item_xmlfunc.cc@stripped, 2006-11-30 03:40:29+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql/log.cc@stripped, 2006-11-30 03:40:29+02:00, monty@stripped +0 -1
    Fixed compiler warning

  sql/log_event.cc@stripped, 2006-11-30 03:40:29+02:00, monty@stripped +5 -5
    Fixed compiler warning

  sql/log_event.h@stripped, 2006-11-30 03:40:30+02:00, monty@stripped +2 -0
    Fixed compiler warning

  sql/mysql_priv.h@stripped, 2006-11-30 03:40:30+02:00, monty@stripped +2 -2
    Fixed too short 'select_type'

  sql/net_serv.cc@stripped, 2006-11-30 03:40:30+02:00, monty@stripped +34 -30
    Added argument to net_clear() if we should empty the communication buffer.

  sql/opt_range.cc@stripped, 2006-11-30 03:40:30+02:00, monty@stripped +8 -8
    Fixed compiler warning

  sql/partition_info.cc@stripped, 2006-11-30 03:40:30+02:00, monty@stripped +2 -4
    Fixed compiler warning

  sql/rpl_injector.h@stripped, 2006-11-30 03:40:30+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql/set_var.cc@stripped, 2006-11-30 03:40:30+02:00, monty@stripped +9 -7
    Fixed compiler warning

  sql/slave.cc@stripped, 2006-11-30 03:40:30+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql/sp_head.cc@stripped, 2006-11-30 03:40:30+02:00, monty@stripped +7 -3
    Fixed compiler warning

  sql/sql_base.cc@stripped, 2006-11-30 03:40:31+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql/sql_db.cc@stripped, 2006-11-30 03:40:31+02:00, monty@stripped +0 -1
    Fixed compiler warning

  sql/sql_delete.cc@stripped, 2006-11-30 03:40:31+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql/sql_insert.cc@stripped, 2006-11-30 03:40:31+02:00, monty@stripped +5 -3
    Fixed compiler warning

  sql/sql_lex.h@stripped, 2006-11-30 03:40:31+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql/sql_parse.cc@stripped, 2006-11-30 03:40:31+02:00, monty@stripped +0 -1
    Fixed compiler warning

  sql/sql_partition.cc@stripped, 2006-11-30 03:40:31+02:00, monty@stripped +8 -13
    Fixed compiler warning

  sql/sql_plugin.cc@stripped, 2006-11-30 03:40:31+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql/sql_prepare.cc@stripped, 2006-11-30 03:40:32+02:00, monty@stripped +0 -1
    Fixed compiler warning

  sql/sql_rename.cc@stripped, 2006-11-30 03:40:32+02:00, monty@stripped +2 -2
    Fixed compiler warning

  sql/sql_select.cc@stripped, 2006-11-30 03:40:32+02:00, monty@stripped +2 -5
    Fixed compiler warning

  sql/sql_show.cc@stripped, 2006-11-30 03:40:32+02:00, monty@stripped +2 -9
    Fixed compiler warning

  sql/sql_table.cc@stripped, 2006-11-30 03:40:32+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql/sql_trigger.cc@stripped, 2006-11-30 03:40:32+02:00, monty@stripped +4 -5
    Fixed compiler warning

  sql/sql_union.cc@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +2 -0
    Fixed compiler warning

  sql/sql_update.cc@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +1 -1
    Fixed compiler warning

  sql/sql_view.cc@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +2 -4
    Fixed compiler warning

  sql/sql_yacc.yy@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +4 -7
    Fixed compiler warning

  sql/table.cc@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +1 -2
    Fixed compiler warning

  storage/archive/azio.c@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +2 -2
    Fixed compiler warning

  storage/csv/ha_tina.cc@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +0 -3
    Removed not used code

  storage/myisam/mi_unique.c@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +1 -1
    Fixed compiler warning

  storage/ndb/include/util/OutputStream.hpp@stripped, 2006-11-30 03:40:33+02:00, monty@stripped +2 -0
    Fixed compiler warning

  storage/ndb/include/util/SocketAuthenticator.hpp@stripped, 2006-11-30 03:40:34+02:00, monty@stripped +1 -0
    Fixed compiler warning

  storage/ndb/src/kernel/vm/Pool.hpp@stripped, 2006-11-30 03:40:34+02:00, monty@stripped +1 -0
    Fixed compiler warning

  strings/ctype-simple.c@stripped, 2006-11-30 03:40:34+02:00, monty@stripped +2 -2
    Fixed compiler warning

  strings/my_strchr.c@stripped, 2006-11-30 03:40:34+02:00, monty@stripped +1 -1
    Fixed compiler warning

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	monty
# Host:	narttu.mysql.fi
# Root:	/home/my/mysql-5.1

--- 1.244/client/mysql.cc	2006-11-30 03:41:01 +02:00
+++ 1.245/client/mysql.cc	2006-11-30 03:41:01 +02:00
@@ -3437,7 +3437,6 @@
   {
     char *bufp = buf;
     MYSQL_RES *result;
-    MYSQL_ROW cur;
 
     bufp = strnmov(buf, mysql_get_server_info(mysql), sizeof buf);
 

--- 1.263/client/mysqldump.c	2006-11-30 03:41:01 +02:00
+++ 1.264/client/mysqldump.c	2006-11-30 03:41:01 +02:00
@@ -2149,7 +2149,7 @@
     write_footer(sql_file);
     my_fclose(sql_file, MYF(MY_WME));
   }
-  DBUG_RETURN(num_fields);
+  DBUG_RETURN((uint) num_fields);
 } /* get_table_structure */
 
 

--- 1.20/extra/replace.c	2006-11-30 03:41:01 +02:00
+++ 1.21/extra/replace.c	2006-11-30 03:41:01 +02:00
@@ -1052,8 +1052,10 @@
 {
   int error;
   FILE *in,*out;
-  char dir_buff[FN_REFLEN], tempname[FN_REFLEN];
-  char link_name[FN_REFLEN], *org_name = name;
+  char dir_buff[FN_REFLEN], tempname[FN_REFLEN],*org_name = name;
+#ifdef HAVE_READLINK  
+  char link_name[FN_REFLEN];
+#endif
   File temp_file;
   DBUG_ENTER("convert_file");
 

--- 1.117/include/mysql_com.h	2006-11-30 03:41:01 +02:00
+++ 1.118/include/mysql_com.h	2006-11-30 03:41:01 +02:00
@@ -340,7 +340,7 @@
 my_bool	my_net_init(NET *net, Vio* vio);
 void	my_net_local_init(NET *net);
 void	net_end(NET *net);
-void	net_clear(NET *net);
+  void	net_clear(NET *net, my_bool clear_buffer);
 my_bool net_realloc(NET *net, unsigned long length);
 my_bool	net_flush(NET *net);
 my_bool	my_net_write(NET *net,const char *packet,unsigned long len);

--- 1.263/libmysql/libmysql.c	2006-11-30 03:41:01 +02:00
+++ 1.264/libmysql/libmysql.c	2006-11-30 03:41:01 +02:00
@@ -2518,7 +2518,7 @@
       DBUG_RETURN(1);
     }
 
-    net_clear(net);				/* Sets net->write_pos */
+    net_clear(net, 1);				/* Sets net->write_pos */
     /* Reserve place for null-marker bytes */
     null_count= (stmt->param_count+7) /8;
     if (my_realloc_str(net, null_count + 1))

--- 1.28/storage/myisam/mi_unique.c	2006-11-30 03:41:01 +02:00
+++ 1.29/storage/myisam/mi_unique.c	2006-11-30 03:41:01 +02:00
@@ -57,7 +57,7 @@
     if (_mi_search_next(info,info->s->keyinfo+def->key, info->lastkey,
 			MI_UNIQUE_HASH_LENGTH, SEARCH_BIGGER,
 			info->s->state.key_root[def->key]) ||
-	bcmp(info->lastkey, key_buff, MI_UNIQUE_HASH_LENGTH))
+	bcmp((char*) info->lastkey, (char*) key_buff, MI_UNIQUE_HASH_LENGTH))
     {
       info->page_changed=1;			/* Can't optimize read next */
       info->lastpos=lastpos;

--- 1.35/mysys/my_thr_init.c	2006-11-30 03:41:01 +02:00
+++ 1.36/mysys/my_thr_init.c	2006-11-30 03:41:01 +02:00
@@ -97,6 +97,8 @@
   pthread_mutex_init(&THR_LOCK_heap,MY_MUTEX_INIT_FAST);
   pthread_mutex_init(&THR_LOCK_net,MY_MUTEX_INIT_FAST);
   pthread_mutex_init(&THR_LOCK_charset,MY_MUTEX_INIT_FAST);
+  pthread_mutex_init(&THR_LOCK_threads,MY_MUTEX_INIT_FAST);
+  pthread_cond_init(&THR_COND_threads, NULL);
 #if defined( __WIN__) || defined(OS2)
   win_pthread_init();
 #endif
@@ -310,7 +312,7 @@
   if (!tmp->name[0])
   {
     long id=my_thread_id();
-    sprintf(name_buff,"T@%lu", id);
+    sprintf(name_buff,"T@%ld", id);
     strmake(tmp->name,name_buff,THREAD_NAME_SIZE);
   }
   return tmp->name;

--- 1.355/sql/field.cc	2006-11-30 03:41:01 +02:00
+++ 1.356/sql/field.cc	2006-11-30 03:41:01 +02:00
@@ -2565,7 +2565,6 @@
 int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  int not_used;				// We can ignore result from str2int
   char *end;
   int error;
 
@@ -2775,7 +2774,6 @@
 int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  int not_used;				// We can ignore result from str2int
   char *end;
   int error;
 
@@ -3062,7 +3060,6 @@
 int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  int not_used;				// We can ignore result from str2int
   char *end;
   int error;
 
@@ -3304,8 +3301,6 @@
 int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  ulong tmp_scan;
-  longlong tmp;
   long store_tmp;
   int error;
   char *end;
@@ -8484,8 +8479,9 @@
 
 void Field_bit::set_default()
 {
-  my_ptrdiff_t const offset= table->s->default_values - table->record[0];
-  uchar bits= get_rec_bits(bit_ptr + offset, bit_ofs, bit_len);
+  my_ptrdiff_t const offset= (my_ptrdiff_t) (table->s->default_values -
+                                             table->record[0]);
+  uchar bits= (uchar) get_rec_bits(bit_ptr + offset, bit_ofs, bit_len);
   set_rec_bits(bits, bit_ptr, bit_ofs, bit_len);
   Field::set_default();
 }

--- 1.70/sql/gen_lex_hash.cc	2006-11-30 03:41:01 +02:00
+++ 1.71/sql/gen_lex_hash.cc	2006-11-30 03:41:01 +02:00
@@ -206,9 +206,10 @@
 
 void insert_sql_functions()
 {
-  size_t i= 0;
+  int i= 0;
   SYMBOL *cur;
-  for (cur= sql_functions; i<array_elements(sql_functions); cur++, i++){
+  for (cur= sql_functions; i < (int) array_elements(sql_functions); cur++, i++)
+  {
     hash_lex_struct *root= 
       get_hash_struct_by_len(&root_by_len,cur->length,&max_len);
     insert_into_hash(root,cur->name,0,-i-1,1);

--- 1.283/sql/handler.cc	2006-11-30 03:41:01 +02:00
+++ 1.284/sql/handler.cc	2006-11-30 03:41:01 +02:00
@@ -2778,7 +2778,7 @@
     >0 : error.  frmblob and frmlen may not be set
 */
 
-typedef struct st_discover_args
+struct st_discover_args
 {
   const char *db;
   const char *name;
@@ -2826,7 +2826,7 @@
   to ask engine if there are any new tables that should be written to disk 
   or any dropped tables that need to be removed from disk
 */
-typedef struct st_find_files_args
+struct st_find_files_args
 {
   const char *db;
   const char *path;
@@ -2877,7 +2877,7 @@
 
  */
 
-typedef struct st_table_exists_in_engine_args
+struct st_table_exists_in_engine_args
 {
   const char *db;
   const char *name;

--- 1.220/sql/item.cc	2006-11-30 03:41:01 +02:00
+++ 1.221/sql/item.cc	2006-11-30 03:41:01 +02:00
@@ -1542,7 +1542,7 @@
 bool agg_item_charsets(DTCollation &coll, const char *fname,
                        Item **args, uint nargs, uint flags, int item_sep)
 {
-  Item **arg, **last, *safe_args[2];
+  Item **arg, *safe_args[2];
 
   LINT_INIT(safe_args[0]);
   LINT_INIT(safe_args[1]);
@@ -5739,7 +5739,7 @@
 }
 
 
-bool Item_trigger_field::set_value(THD *thd, sp_rcontext */*ctx*/, Item **it)
+bool Item_trigger_field::set_value(THD *thd, sp_rcontext * /*ctx*/, Item **it)
 {
   Item *item= sp_prepare_func_item(thd, it);
 

--- 1.67/sql/item_create.cc	2006-11-30 03:41:01 +02:00
+++ 1.68/sql/item_create.cc	2006-11-30 03:41:01 +02:00
@@ -2620,7 +2620,8 @@
   }
 
   thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
-  return new (thd->mem_root) Item_func_benchmark(arg1->val_int(), arg2);
+  return new (thd->mem_root) Item_func_benchmark((ulong) arg1->val_int(),
+                                                 arg2);
 }
 
 
@@ -3242,7 +3243,7 @@
     return NULL;
   }
 
-  return new (thd->mem_root) Item_func_format(arg1, arg2->val_int());
+  return new (thd->mem_root) Item_func_format(arg1, (int) arg2->val_int());
 }
 
 

--- 1.332/sql/item_func.cc	2006-11-30 03:41:01 +02:00
+++ 1.333/sql/item_func.cc	2006-11-30 03:41:01 +02:00
@@ -2350,7 +2350,7 @@
       return 0;
 
     /* start is now sufficiently valid to pass to charpos function */
-    start= a->charpos(start);
+    start= a->charpos((int) start);
 
     if (start + b->length() > a->length())
       return 0;
@@ -2360,7 +2360,8 @@
     return start + 1;
   
   if (!cmp_collation.collation->coll->instr(cmp_collation.collation,
-                                            a->ptr()+start, a->length()-start,
+                                            a->ptr()+start,
+                                            (uint) (a->length()-start),
                                             b->ptr(), b->length(),
                                             &match, 1))
     return 0;
@@ -3835,8 +3836,7 @@
 Item_func_set_user_var::check(bool use_result_field)
 {
   DBUG_ENTER("Item_func_set_user_var::check");
-  if (use_result_field)
-    DBUG_ASSERT(result_field);
+  DBUG_ASSERT(!use_result_field || result_field);
 
   switch (cached_result_type) {
   case REAL_RESULT:
@@ -4280,7 +4280,7 @@
 
 
 bool Item_func_get_user_var::set_value(THD *thd,
-                                       sp_rcontext */*ctx*/, Item **it)
+                                       sp_rcontext * /*ctx*/, Item **it)
 {
   Item_func_set_user_var *suv= new Item_func_set_user_var(get_name(), *it);
   /*

--- 1.297/sql/item_strfunc.cc	2006-11-30 03:41:01 +02:00
+++ 1.298/sql/item_strfunc.cc	2006-11-30 03:41:01 +02:00
@@ -969,8 +969,8 @@
     length= res->length() + 1;
 
   /* start and length are now sufficiently valid to pass to charpos function */
-  start= res->charpos(start);
-  length= res->charpos(length, start);
+   start= res->charpos((int) start);
+   length= res->charpos((int) length, (uint32) start);
 
   /* Re-testing with corrected params */
   if (start > res->length() + 1)
@@ -988,7 +988,7 @@
     goto null;
   }
   res=copy_if_not_alloced(str,res,res->length());
-  res->replace(start,length,*res2);
+  res->replace((uint32) start,(uint32) length,*res2);
   return res;
 null:
   null_value=1;
@@ -1064,7 +1064,7 @@
     return &my_empty_string;
 
   if ((res->length() <= (ulonglong) length) ||
-      (res->length() <= (char_pos= res->charpos(length))))
+      (res->length() <= (char_pos= res->charpos((int) length))))
     return res;
 
   tmp_value.set(*res, 0, char_pos);
@@ -1156,17 +1156,17 @@
     return &my_empty_string;
 
   start= ((start < 0) ? res->numchars() + start : start - 1);
-  start= res->charpos(start);
+  start= res->charpos((int) start);
   if ((start < 0) || ((uint) start + 1 > res->length()))
     return &my_empty_string;
 
-  length= res->charpos(length, start);
+  length= res->charpos((int) length, (uint32) start);
   tmp_length= res->length() - start;
   length= min(length, tmp_length);
 
-  if (!start && res->length() == (ulonglong) length)
+  if (!start && (longlong) res->length() == length)
     return res;
-  tmp_value.set(*res, (ulonglong) start, (ulonglong) length);
+  tmp_value.set(*res, (uint32) start, (uint32) length);
   return &tmp_value;
 }
 
@@ -2214,7 +2214,7 @@
   char *to;
   /* must be longlong to avoid truncation */
   longlong tmp_count= args[1]->val_int();
-  long count= tmp_count;
+  long count= (long) tmp_count;
   String *res= args[0]->val_str(str);
 
   /* Assumes that the maximum length of a String is < INT_MAX32. */
@@ -2316,7 +2316,7 @@
 
   if (count <= (res_char_length= res->numchars()))
   {						// String to pad is big enough
-    res->length(res->charpos(count));		// Shorten result if longer
+    res->length(res->charpos((int) count));	// Shorten result if longer
     return (res);
   }
   pad_char_length= rpad->numchars();
@@ -2333,7 +2333,7 @@
   if (args[2]->null_value || !pad_char_length)
     goto err;
   res_byte_length= res->length();	/* Must be done before alloc_buffer */
-  if (!(res= alloc_buffer(res,str,&tmp_value,byte_count)))
+  if (!(res= alloc_buffer(res,str,&tmp_value, (ulong) byte_count)))
     goto err;
 
   to= (char*) res->ptr()+res_byte_length;
@@ -2347,7 +2347,7 @@
   }
   if (count)
   {
-    pad_byte_length= rpad->charpos(count);
+    pad_byte_length= rpad->charpos((int) count);
     memcpy(to,ptr_pad,(size_t) pad_byte_length);
     to+= pad_byte_length;
   }
@@ -2419,7 +2419,7 @@
 
   if (count <= res_char_length)
   {
-    res->length(res->charpos(count));
+    res->length(res->charpos((int) count));
     return res;
   }
   
@@ -2435,7 +2435,8 @@
     goto err;
   }
 
-  if (args[2]->null_value || !pad_char_length || str->alloc(byte_count))
+  if (args[2]->null_value || !pad_char_length ||
+      str->alloc((uint32) byte_count))
     goto err;
   
   str->length(0);
@@ -2447,7 +2448,7 @@
     count-= pad_char_length;
   }
   if (count > 0)
-    str->append(pad->ptr(), pad->charpos(count), collation.collation);
+    str->append(pad->ptr(), pad->charpos((int) count), collation.collation);
 
   str->append(*res);
   null_value= 0;

--- 1.142/sql/item_timefunc.cc	2006-11-30 03:41:01 +02:00
+++ 1.143/sql/item_timefunc.cc	2006-11-30 03:41:02 +02:00
@@ -110,7 +110,6 @@
                                     String *str)
 {
   int warning= 0;
-  bool rc;
 
   if (make_datetime(format, ltime, str))
     return 1;

--- 1.244/sql/log.cc	2006-11-30 03:41:02 +02:00
+++ 1.245/sql/log.cc	2006-11-30 03:41:02 +02:00
@@ -2418,7 +2418,6 @@
                          ulong max_size_arg,
                          bool null_created_arg)
 {
-  char buff[FN_REFLEN];
   File file= -1;
   int open_flags = O_CREAT | O_BINARY;
   DBUG_ENTER("MYSQL_BIN_LOG::open");

--- 1.258/sql/log_event.cc	2006-11-30 03:41:02 +02:00
+++ 1.259/sql/log_event.cc	2006-11-30 03:41:02 +02:00
@@ -1162,11 +1162,11 @@
                              bool more)
 {
   const uchar *ptr= (const uchar *)temp_buf;
-  my_off_t size= uint4korr(ptr + EVENT_LEN_OFFSET);
+  uint32 size= uint4korr(ptr + EVENT_LEN_OFFSET);
 
   DBUG_ENTER("Log_event::print_base64");
 
-  size_t const tmp_str_sz= base64_needed_encoded_length(size);
+  size_t const tmp_str_sz= base64_needed_encoded_length((int) size);
   char *const tmp_str= (char *) my_malloc(tmp_str_sz, MYF(MY_WME));
   if (!tmp_str) {
     fprintf(stderr, "\nError: Out of memory. "
@@ -1174,7 +1174,7 @@
     DBUG_VOID_RETURN;
   }
 
-  int const res= base64_encode(ptr, size, tmp_str);
+  int const res= base64_encode(ptr, (size_t) size, tmp_str);
   DBUG_ASSERT(res == 0);
 
   if (my_b_tell(file) == 0)
@@ -5360,7 +5360,7 @@
   }
   else
   {
-    m_table_id= uint6korr(post_start);
+    m_table_id= (ulong) uint6korr(post_start);
     post_start+= RW_FLAGS_OFFSET;
   }
 
@@ -6098,7 +6098,7 @@
   else
   {
     DBUG_ASSERT(post_header_len == TABLE_MAP_HEADER_LEN);
-    m_table_id= uint6korr(post_start);
+    m_table_id= (ulong) uint6korr(post_start);
     post_start+= TM_FLAGS_OFFSET;
   }
 

--- 1.138/sql/log_event.h	2006-11-30 03:41:02 +02:00
+++ 1.139/sql/log_event.h	2006-11-30 03:41:02 +02:00
@@ -884,6 +884,8 @@
 
   bool write(IO_CACHE* file) { return(false); };
   virtual bool write_post_header_for_derived(IO_CACHE* file) { return FALSE; }
+#else
+  Muted_query_log_event() {}
 #endif
 };
 

--- 1.460/sql/mysql_priv.h	2006-11-30 03:41:02 +02:00
+++ 1.461/sql/mysql_priv.h	2006-11-30 03:41:02 +02:00
@@ -893,7 +893,7 @@
 bool mysql_select(THD *thd, Item ***rref_pointer_array,
                   TABLE_LIST *tables, uint wild_num,  List<Item> &list,
                   COND *conds, uint og_num, ORDER *order, ORDER *group,
-                  Item *having, ORDER *proc_param, ulong select_type, 
+                  Item *having, ORDER *proc_param, ulonglong select_type, 
                   select_result *result, SELECT_LEX_UNIT *unit, 
                   SELECT_LEX *select_lex);
 void free_underlaid_joins(THD *thd, SELECT_LEX *select);
@@ -919,7 +919,7 @@
 int prepare_create_field(create_field *sql_field, 
 			 uint *blob_columns, 
 			 int *timestamps, int *timestamps_with_niladic,
-			 uint table_flags);
+			 longlong table_flags);
 bool mysql_create_table(THD *thd,const char *db, const char *table_name,
                         HA_CREATE_INFO *create_info,
                         List<create_field> &fields, List<Key> &keys,

--- 1.98/sql/net_serv.cc	2006-11-30 03:41:02 +02:00
+++ 1.99/sql/net_serv.cc	2006-11-30 03:41:02 +02:00
@@ -266,6 +266,7 @@
   SYNOPSIS
     net_clear()
     net			NET handler
+    clear_buffer	If <> 0, then clear all data from communication buffer
 
   DESCRIPTION
     Read from socket until there is nothing more to read. Discard
@@ -280,48 +281,51 @@
 
 */
 
-void net_clear(NET *net)
+void net_clear(NET *net, my_bool clear_buffer)
 {
   int count, ready;
   DBUG_ENTER("net_clear");
 #if !defined(EMBEDDED_LIBRARY)
-  while((ready= net_data_is_ready(net->vio->sd)) > 0)
+  if (clear_buffer)
   {
-    /* The socket is ready */
-    if ((count= vio_read(net->vio, (char*) (net->buff),
-                         (uint32) net->max_packet)) > 0)
+    while ((ready= net_data_is_ready(net->vio->sd)) > 0)
     {
-      DBUG_PRINT("info",("skipped %d bytes from file: %s",
-                         count, vio_description(net->vio)));
+      /* The socket is ready */
+      if ((count= vio_read(net->vio, (char*) (net->buff),
+                           (uint32) net->max_packet)) > 0)
+      {
+        DBUG_PRINT("info",("skipped %d bytes from file: %s",
+                           count, vio_description(net->vio)));
 #ifdef EXTRA_DEBUG
-      fprintf(stderr,"MySQL: net_clear() skipped %d bytes from file: %s\n",
-              count, vio_description(net->vio));
+        fprintf(stderr,"Error: net_clear() skipped %d bytes from file: %s\n",
+                count, vio_description(net->vio));
 #endif
+      }
+      else
+      {
+        DBUG_PRINT("info",("socket ready but only EOF to read - disconnected"));
+        net->error= 2;
+        break;
+      }
     }
-    else
-    {
-      DBUG_PRINT("info",("socket ready but only EOF to read - disconnected"));
-      net->error= 2;
-      break;
-    }
-  }
 #ifdef NET_DATA_IS_READY_CAN_RETURN_MINUS_ONE
-  /* 'net_data_is_ready' returned "don't know" */
-  if (ready == -1)
-  {
-    /* Read unblocking to clear net */
-    my_bool old_mode;
-    if (!vio_blocking(net->vio, FALSE, &old_mode))
+    /* 'net_data_is_ready' returned "don't know" */
+    if (ready == -1)
     {
-      while ((count= vio_read(net->vio, (char*) (net->buff),
-                              (uint32) net->max_packet)) > 0)
-	DBUG_PRINT("info",("skipped %d bytes from file: %s",
-			   count, vio_description(net->vio)));
-      vio_blocking(net->vio, TRUE, &old_mode);
+      /* Read unblocking to clear net */
+      my_bool old_mode;
+      if (!vio_blocking(net->vio, FALSE, &old_mode))
+      {
+        while ((count= vio_read(net->vio, (char*) (net->buff),
+                                (uint32) net->max_packet)) > 0)
+          DBUG_PRINT("info",("skipped %d bytes from file: %s",
+                             count, vio_description(net->vio)));
+        vio_blocking(net->vio, TRUE, &old_mode);
+      }
     }
+#endif /* NET_DATA_IS_READY_CAN_RETURN_MINUS_ONE */
   }
-#endif
-#endif
+#endif /* EMBEDDED_LIBRARY */
   net->pkt_nr=net->compress_pkt_nr=0;		/* Ready for new command */
   net->write_pos=net->buff;
   DBUG_VOID_RETURN;
@@ -894,7 +898,7 @@
 			(int) net->buff[net->where_b + 3],
 			net->pkt_nr));
 #ifdef EXTRA_DEBUG
-	    fprintf(stderr,"Packets out of order (Found: %d, expected %d)\n",
+	    fprintf(stderr,"Error: Packets out of order (Found: %d, expected %d)\n",
 		    (int) net->buff[net->where_b + 3],
 		    (uint) (uchar) net->pkt_nr);
 #endif

--- 1.248/sql/opt_range.cc	2006-11-30 03:41:02 +02:00
+++ 1.249/sql/opt_range.cc	2006-11-30 03:41:02 +02:00
@@ -540,7 +540,8 @@
 {
 public:
   KEY_PART *key[MAX_KEY]; /* First key parts of keys used in the query */
-  uint baseflag, max_key_part, range_count;
+  longlong baseflag;
+  uint max_key_part, range_count;
 
 
   char min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH],
@@ -1142,7 +1143,6 @@
 {
   handler *save_file= file, *org_file;
   THD *thd;
-  MY_BITMAP *bitmap;
   DBUG_ENTER("QUICK_RANGE_SELECT::init_ror_merged_scan");
 
   in_ror_merged_scan= 1;
@@ -2048,7 +2048,7 @@
 
     /* set up parameter that is passed to all functions */
     param.thd= thd;
-    param.baseflag=head->file->ha_table_flags();
+    param.baseflag= head->file->ha_table_flags();
     param.prev_tables=prev_tables | const_tables;
     param.read_tables=read_tables;
     param.current_table= head->map;
@@ -2101,7 +2101,8 @@
 	key_parts->null_bit=	 key_part_info->null_bit;
         key_parts->image_type =
           (key_info->flags & HA_SPATIAL) ? Field::itMBR : Field::itRAW;
-        key_parts->flag=         key_part_info->key_part_flag;
+        /* Only HA_PART_KEY_SEG is used */
+        key_parts->flag=         (uint8) key_part_info->key_part_flag;
       }
       param.real_keynr[param.keys++]=idx;
     }
@@ -2508,7 +2509,6 @@
 
   prune_param.key= prune_param.range_param.key_parts;
   SEL_TREE *tree;
-  SEL_ARG *arg;
   int res;
 
   tree= get_mm_tree(range_par, pprune_cond);
@@ -3223,12 +3223,12 @@
   {
     key_part->key=          0;
     key_part->part=	    part;
-    key_part->length=       (*field)->pack_length_in_rec();
+    key_part->length=       (uint16) (*field)->pack_length_in_rec();
     /* 
       psergey-todo: check yet again if this is correct for tricky field types,
       e.g. see "Fix a fatal error in decimal key handling" in open_binary_frm()
     */
-    key_part->store_length= (*field)->pack_length();
+    key_part->store_length= (uint16) (*field)->pack_length();
     if ((*field)->real_maybe_null())
       key_part->store_length+= HA_KEY_NULL_LENGTH;
     if ((*field)->type() == FIELD_TYPE_BLOB || 
@@ -7652,7 +7652,7 @@
     key_part->length=  	    key_info->key_part[part].length;
     key_part->store_length= key_info->key_part[part].store_length;
     key_part->null_bit=     key_info->key_part[part].null_bit;
-    key_part->flag=         key_info->key_part[part].key_part_flag;
+    key_part->flag=         (uint8) key_info->key_part[part].key_part_flag;
   }
   if (insert_dynamic(&quick->ranges,(gptr)&range))
     goto err;

--- 1.298/sql/slave.cc	2006-11-30 03:41:02 +02:00
+++ 1.299/sql/slave.cc	2006-11-30 03:41:02 +02:00
@@ -913,7 +913,7 @@
   TABLE_LIST tables;
   int error= 1;
   handler *file;
-  ulong save_options;
+  ulonglong save_options;
   NET *net= &mysql->net;
   DBUG_ENTER("create_table_from_dump");
 

--- 1.363/sql/sql_base.cc	2006-11-30 03:41:02 +02:00
+++ 1.364/sql/sql_base.cc	2006-11-30 03:41:02 +02:00
@@ -1251,7 +1251,7 @@
 
   /* We always quote db,table names though it is slight overkill */
   if (found_user_tables &&
-      !(was_quote_show= (thd->options & OPTION_QUOTE_SHOW_CREATE)))
+      !(was_quote_show= test(thd->options & OPTION_QUOTE_SHOW_CREATE)))
   {
     thd->options |= OPTION_QUOTE_SHOW_CREATE;
   }

--- 1.144/sql/sql_db.cc	2006-11-30 03:41:02 +02:00
+++ 1.145/sql/sql_db.cc	2006-11-30 03:41:03 +02:00
@@ -1302,7 +1302,6 @@
 
 bool mysql_change_db(THD *thd, const char *name, bool no_access_check)
 {
-  int path_length;
   LEX_STRING db_name;
   bool system_db= 0;
 #ifndef NO_EMBEDDED_ACCESS_CHECKS

--- 1.202/sql/sql_delete.cc	2006-11-30 03:41:03 +02:00
+++ 1.203/sql/sql_delete.cc	2006-11-30 03:41:03 +02:00
@@ -975,7 +975,7 @@
 
 trunc_by_del:
   /* Probably InnoDB table */
-  ulong save_options= thd->options;
+  ulonglong save_options= thd->options;
   table_list->lock_type= TL_WRITE;
   thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT);
   ha_enable_transaction(thd, FALSE);

--- 1.234/sql/sql_insert.cc	2006-11-30 03:41:03 +02:00
+++ 1.235/sql/sql_insert.cc	2006-11-30 03:41:03 +02:00
@@ -2042,7 +2042,9 @@
    */
   ha_rollback_stmt(thd);
 
+#ifndef __WIN__
 end:
+#endif
   /*
     di should be unlinked from the thread handler list and have no active
     clients
@@ -2698,7 +2700,7 @@
 
 bool select_insert::send_eof()
 {
-  int error,error2;
+  int error;
   bool const trans_table= table->file->has_transactions();
   ulonglong id;
   DBUG_ENTER("select_insert::send_eof");
@@ -2750,9 +2752,9 @@
    */
   if (trans_table || thd->current_stmt_binlog_row_based)
   {
-    int const error2= ha_autocommit_or_rollback(thd, error);
+    int error2= ha_autocommit_or_rollback(thd, error);
     if (error2 && !error)
-      error=error2;
+      error= error2;
   }
   table->file->ha_release_auto_increment();
 

--- 1.248/sql/sql_lex.h	2006-11-30 03:41:03 +02:00
+++ 1.249/sql/sql_lex.h	2006-11-30 03:41:03 +02:00
@@ -423,7 +423,7 @@
   TABLE *table; /* temporary table using for appending UNION results */
 
   select_result *result;
-  ulong found_rows_for_union;
+  ulonglong found_rows_for_union;
   bool res;
 public:
   bool  prepared, // prepare phase already performed for UNION (unit)

--- 1.601/sql/sql_parse.cc	2006-11-30 03:41:03 +02:00
+++ 1.602/sql/sql_parse.cc	2006-11-30 03:41:03 +02:00
@@ -5196,7 +5196,6 @@
     break;
   }
 
-end:
   thd->proc_info="query end";
 
   /*

--- 1.471/sql/sql_select.cc	2006-11-30 03:41:03 +02:00
+++ 1.472/sql/sql_select.cc	2006-11-30 03:41:03 +02:00
@@ -1991,7 +1991,7 @@
 mysql_select(THD *thd, Item ***rref_pointer_array,
 	     TABLE_LIST *tables, uint wild_num, List<Item> &fields,
 	     COND *conds, uint og_num,  ORDER *order, ORDER *group,
-	     Item *having, ORDER *proc_param, ulong select_options,
+	     Item *having, ORDER *proc_param, ulonglong select_options,
 	     select_result *result, SELECT_LEX_UNIT *unit,
 	     SELECT_LEX *select_lex)
 {
@@ -4206,7 +4206,7 @@
 {
   uint search_depth= join->thd->variables.optimizer_search_depth;
   uint prune_level=  join->thd->variables.optimizer_prune_level;
-  bool straight_join= join->select_options & SELECT_STRAIGHT_JOIN;
+  bool straight_join= test(join->select_options & SELECT_STRAIGHT_JOIN);
   DBUG_ENTER("choose_plan");
 
   join->cur_embedding_map= 0;
@@ -4808,8 +4808,6 @@
 find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
 	  double read_time)
 {
-  ha_rows rec;
-  double tmp;
   THD *thd= join->thd;
   if (!rest_tables)
   {
@@ -7149,7 +7147,6 @@
   Item_equal *item_equal;
   uint members;
   COND_EQUAL cond_equal;
-  COND *new_cond;
   cond_equal.upper_levels= inherited;
 
   if (cond->type() == Item::COND_ITEM)

--- 1.376/sql/sql_show.cc	2006-11-30 03:41:03 +02:00
+++ 1.377/sql/sql_show.cc	2006-11-30 03:41:03 +02:00
@@ -696,7 +696,6 @@
                            HA_CREATE_INFO *create_info)
 {
   Security_context *sctx= thd->security_ctx;
-  int length;
   char buff[2048];
   String buffer(buff, sizeof(buff), system_charset_info);
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -1028,7 +1027,7 @@
                       HA_CREATE_INFO *create_info_arg)
 {
   List<Item> field_list;
-  char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], *end, uname[NAME_LEN*3+1];
+  char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], *end;
   const char *alias;
   String type(tmp, sizeof(tmp), system_charset_info);
   Field **ptr,*field;
@@ -2752,7 +2751,6 @@
   INDEX_FIELD_VALUES idx_field_vals;
   List<char> files;
   char *file_name;
-  uint length;
   bool with_i_schema;
   HA_CREATE_INFO create;
   TABLE *table= tables->table;
@@ -3379,7 +3377,7 @@
     restore_record(table, s->default_values);
     if (!wild || !wild[0] || !wild_compare(sp_name.ptr(), wild, 0))
     {
-      int enum_idx= proc_table->field[5]->val_int();
+      int enum_idx= (int) proc_table->field[5]->val_int();
       table->field[3]->store(sp_name.ptr(), sp_name.length(), cs);
       get_field(thd->mem_root, proc_table->field[3], &tmp_string);
       table->field[0]->store(tmp_string.ptr(), tmp_string.length(), cs);
@@ -3992,7 +3990,6 @@
   char buff[61];
   String tmp_res(buff, sizeof(buff), cs);
   String tmp_str;
-  TIME time;
   TABLE *show_table= tables->table;
   handler *file;
 #ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -4017,7 +4014,6 @@
     List_iterator<partition_element> part_it(part_info->partitions);
     uint part_pos= 0, part_id= 0;
     uint no_parts= part_info->no_parts;
-    handler *part_file;
 
     restore_record(table, s->default_values);
     table->field[1]->store(base_name, strlen(base_name), cs);
@@ -4099,8 +4095,6 @@
 
     while ((part_elem= part_it++))
     {
-
-
       table->field[3]->store(part_elem->partition_name,
                              strlen(part_elem->partition_name), cs);
       table->field[3]->set_notnull();
@@ -5026,7 +5020,6 @@
 
 int fill_schema_files(THD *thd, TABLE_LIST *tables, COND *cond)
 {
-  int i;
   TABLE *table= tables->table;
   DBUG_ENTER("fill_schema_files");
 

--- 1.375/sql/sql_table.cc	2006-11-30 03:41:03 +02:00
+++ 1.376/sql/sql_table.cc	2006-11-30 03:41:03 +02:00
@@ -2011,7 +2011,7 @@
 int prepare_create_field(create_field *sql_field, 
 			 uint *blob_columns, 
 			 int *timestamps, int *timestamps_with_niladic,
-			 uint table_flags)
+			 longlong table_flags)
 {
   DBUG_ENTER("prepare_field");
 

--- 1.213/sql/sql_update.cc	2006-11-30 03:41:03 +02:00
+++ 1.214/sql/sql_update.cc	2006-11-30 03:41:03 +02:00
@@ -118,7 +118,7 @@
 		 enum enum_duplicates handle_duplicates, bool ignore)
 {
   bool		using_limit= limit != HA_POS_ERROR;
-  bool		safe_update= thd->options & OPTION_SAFE_UPDATES;
+  bool		safe_update= test(thd->options & OPTION_SAFE_UPDATES);
   bool		used_key_is_modified, transactional_table, will_batch;
   bool		can_compare_record;
   int           res;

--- 1.516/sql/sql_yacc.yy	2006-11-30 03:41:04 +02:00
+++ 1.517/sql/sql_yacc.yy	2006-11-30 03:41:04 +02:00
@@ -1894,7 +1894,6 @@
             uint num_vars= pctx->context_var_count();
             enum enum_field_types var_type= (enum enum_field_types) $4;
             Item *dflt_value_item= $5;
-            create_field *create_field_op;
             
             if (!dflt_value_item)
             {
@@ -3090,7 +3089,7 @@
           real_ulong_num { $$= $1;}
           | IDENT
           {
-            ulonglong number, test_number;
+            ulonglong number;
             uint text_shift_number= 0;
             longlong prefix_number;
             char *start_ptr= $1.str;
@@ -3599,11 +3598,9 @@
         bit_expr
         {
           Item *part_expr= $1;
-          bool not_corr_func;
           int part_expression_ok= 1;
           LEX *lex= Lex;
           THD *thd= YYTHD;
-          longlong item_value;
           Name_resolution_context *context= &lex->current_select->context;
           TABLE_LIST *save_list= context->table_list;
           const char *save_where= thd->where;
@@ -3744,11 +3741,11 @@
           lex->part_info->default_engine_type= $4;
         }
         | NODEGROUP_SYM opt_equal real_ulong_num
-        { Lex->part_info->curr_part_elem->nodegroup_id= $3; }
+        { Lex->part_info->curr_part_elem->nodegroup_id= (uint16) $3; }
         | MAX_ROWS opt_equal real_ulonglong_num
-        { Lex->part_info->curr_part_elem->part_max_rows= $3; }
+        { Lex->part_info->curr_part_elem->part_max_rows= (ha_rows) $3; }
         | MIN_ROWS opt_equal real_ulonglong_num
-        { Lex->part_info->curr_part_elem->part_min_rows= $3; }
+        { Lex->part_info->curr_part_elem->part_min_rows= (ha_rows) $3; }
         | DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
         { Lex->part_info->curr_part_elem->data_file_name= $4.str; }
         | INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys

--- 1.258/sql/table.cc	2006-11-30 03:41:04 +02:00
+++ 1.259/sql/table.cc	2006-11-30 03:41:04 +02:00
@@ -1031,7 +1031,7 @@
   {
     uint primary_key=(uint) (find_type((char*) primary_key_name,
 				       &share->keynames, 3) - 1);
-    uint ha_option= handler_file->ha_table_flags();
+    longlong ha_option= handler_file->ha_table_flags();
     keyinfo= share->key_info;
     key_part= keyinfo->key_part;
 
@@ -2078,7 +2078,6 @@
   		HA_CREATE_INFO *create_info, uint keys)
 {
   register File file;
-  uint key_length;
   ulong length;
   char fill[IO_SIZE];
   int create_flags= O_RDWR | O_TRUNC;

--- 1.139/sql/sql_union.cc	2006-11-30 03:41:04 +02:00
+++ 1.140/sql/sql_union.cc	2006-11-30 03:41:04 +02:00
@@ -433,7 +433,9 @@
       }
       /* re-enabling indexes for next subselect iteration */
       if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL))
+      {
         DBUG_ASSERT(0);
+      }
     }
     for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
     {

--- 1.29/sql/event_scheduler.cc	2006-11-30 03:41:04 +02:00
+++ 1.30/sql/event_scheduler.cc	2006-11-30 03:41:04 +02:00
@@ -442,7 +442,6 @@
 Event_scheduler::run(THD *thd)
 {
   int res= FALSE;
-  struct timespec abstime;
   Event_job_data *job_data;
   DBUG_ENTER("Event_scheduler::run");
 

--- 1.80/sql/event_data_objects.cc	2006-11-30 03:41:04 +02:00
+++ 1.81/sql/event_data_objects.cc	2006-11-30 03:41:04 +02:00
@@ -1095,7 +1095,7 @@
       DBUG_PRINT("error", ("negative difference"));
       DBUG_ASSERT(0);
     }
-    uint multiplier= seconds_diff / seconds;
+    uint multiplier= (uint) (seconds_diff / seconds);
     /*
       Increase the multiplier is the modulus is not zero to make round up.
       Or if time_now==start then we should not execute the same 
@@ -1128,7 +1128,7 @@
       directly with +1 we will be after the current date but it could be that
       we will be 1 month ahead, so 2 steps are necessary.
     */
-    interval.month= (diff_months / months)*months;
+    interval.month= (ulong) ((diff_months / months)*months);
     /*
       Check if the same month as last_exec (always set - prerequisite)
       An event happens at most once per month so there is no way to
@@ -1141,7 +1141,7 @@
     */
     if (time_now->year == last_exec->year &&
         time_now->month == last_exec->month)
-      interval.month+= months;
+      interval.month+= (ulong) months;
 
     tmp= *start;
     if ((ret= date_add_interval(&tmp, INTERVAL_MONTH, interval)))
@@ -1150,7 +1150,7 @@
     /* If `tmp` is still before time_now just add one more time the interval */
     if (my_time_compare(&tmp, time_now) == -1)
     { 
-      interval.month+= months;
+      interval.month+= (ulong) months;
       tmp= *start;
       if ((ret= date_add_interval(&tmp, INTERVAL_MONTH, interval)))
         goto done;
@@ -1283,7 +1283,7 @@
 
       if (get_next_time(&next_exec, &starts, &time_now,
                         last_executed.year? &last_executed:&starts,
-                        expression, interval))
+                        (int) expression, interval))
         goto err;
 
       /* There was previous execution */
@@ -1321,7 +1321,7 @@
     {
       TIME next_exec;
       if (get_next_time(&next_exec, &starts, &time_now, &last_executed,
-                        expression, interval))
+                        (int) expression, interval))
         goto err;
       execute_at= next_exec;
       DBUG_PRINT("info",("Next[%lu]",
@@ -1356,7 +1356,7 @@
         TIME next_exec;
         if (get_next_time(&next_exec, &starts, &time_now,
                           last_executed.year? &last_executed:&starts,
-                          expression, interval))
+                          (int) expression, interval))
           goto err;
         execute_at= next_exec;
         DBUG_PRINT("info",("Next[%lu]",
@@ -1382,7 +1382,7 @@
         TIME next_exec;
 
         if (get_next_time(&next_exec, &starts, &time_now, &last_executed,
-                          expression, interval))
+                          (int) expression, interval))
           goto err;
 
         if (my_time_compare(&ends, &next_exec) == -1)

--- 1.81/strings/ctype-simple.c	2006-11-30 03:41:04 +02:00
+++ 1.82/strings/ctype-simple.c	2006-11-30 03:41:04 +02:00
@@ -1516,7 +1516,7 @@
       else
       {
         *error= 0;
-        return (ulonglong) (longlong) (long) -ul;
+        return (ulonglong) (longlong) -(long) ul;
       }
     }
     else
@@ -1667,7 +1667,7 @@
         return (ulonglong) LONGLONG_MIN;
       }
       *error= 0;
-      return (ulonglong) -ull;
+      return (ulonglong) -(longlong) ull;
     }
     else
     {

--- 1.21/sql/item_xmlfunc.cc	2006-11-30 03:41:04 +02:00
+++ 1.22/sql/item_xmlfunc.cc	2006-11-30 03:41:04 +02:00
@@ -777,7 +777,7 @@
     ((XPathFilter*)(&nodeset_func->context_cache))->append_element(flt->num,
                                                                    flt->pos,
                                                                    size);
-    int index= args[1]->val_int() - 1;
+    int index= (int) (args[1]->val_int()) - 1;
     if (index >= 0 && (flt->pos == (uint) index || args[1]->is_bool_func()))
       ((XPathFilter*)nodeset)->append_element(flt->num, pos++);
   }

--- 1.114/sql/sql_view.cc	2006-11-30 03:41:04 +02:00
+++ 1.115/sql/sql_view.cc	2006-11-30 03:41:04 +02:00
@@ -197,7 +197,7 @@
     lex->definer= &view->definer;
   }
   if (lex->create_view_algorithm == VIEW_ALGORITHM_UNDEFINED)
-    lex->create_view_algorithm= decoy.algorithm;
+    lex->create_view_algorithm= (uint8) decoy.algorithm;
   if (lex->create_view_suid == VIEW_SUID_DEFAULT)
     lex->create_view_suid= decoy.view_suid ? 
       VIEW_SUID_DEFINER : VIEW_SUID_INVOKER;
@@ -675,7 +675,7 @@
   String str(buff,(uint32) sizeof(buff), system_charset_info);
   char md5[MD5_BUFF_LENGTH];
   bool can_be_merged;
-  char dir_buff[FN_REFLEN], file_buff[FN_REFLEN], path_buff[FN_REFLEN];
+  char dir_buff[FN_REFLEN], path_buff[FN_REFLEN];
   const uchar *endp;
   LEX_STRING dir, file, path;
   DBUG_ENTER("mysql_register_view");
@@ -1341,7 +1341,6 @@
 {
   char path[FN_REFLEN];
   TABLE_LIST *view;
-  frm_type_enum type;
   String non_existant_views;
   char *wrong_object_db= NULL, *wrong_object_name= NULL;
   bool error= FALSE;
@@ -1509,7 +1508,6 @@
   TABLE *table;
   Field_translator *trans, *end_of_trans;
   KEY *key_info, *key_info_end;
-  uint i;
   DBUG_ENTER("check_key_in_view");
 
   /*

--- 1.69/storage/csv/ha_tina.cc	2006-11-30 03:41:04 +02:00
+++ 1.70/storage/csv/ha_tina.cc	2006-11-30 03:41:04 +02:00
@@ -267,9 +267,6 @@
 
   return share;
 
-error2:
-  thr_lock_delete(&share->lock);
-  pthread_mutex_destroy(&share->mutex);
 error:
   pthread_mutex_unlock(&tina_mutex);
   my_free((gptr) share, MYF(0));

--- 1.9/storage/archive/azio.c	2006-11-30 03:41:04 +02:00
+++ 1.10/storage/archive/azio.c	2006-11-30 03:41:04 +02:00
@@ -503,7 +503,7 @@
   if (!s->transparent) (void)inflateReset(&s->stream);
   s->in = 0;
   s->out = 0;
-  return my_seek(s->file, (int)s->start, MY_SEEK_SET, MYF(0));
+  return my_seek(s->file, (int)s->start, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR;
 }
 
 /* ===========================================================================
@@ -568,7 +568,7 @@
   /* For a negative seek, rewind and use positive seek */
   if (offset >= s->out) {
     offset -= s->out;
-  } else if (azrewind(s) < 0) {
+  } else if (azrewind(s)) {
     return -1L;
   }
   /* offset is now the number of bytes to skip. */

--- 1.77/sql/sql_trigger.cc	2006-11-30 03:41:04 +02:00
+++ 1.78/sql/sql_trigger.cc	2006-11-30 03:41:04 +02:00
@@ -330,7 +330,7 @@
   TABLE *table= tables->table;
   char file_buff[FN_REFLEN], trigname_buff[FN_REFLEN];
   LEX_STRING file, trigname_file;
-  LEX_STRING *trg_def, *name;
+  LEX_STRING *trg_def;
   LEX_STRING definer_user;
   LEX_STRING definer_host;
   ulonglong *trg_sql_mode;
@@ -845,7 +845,7 @@
         DBUG_RETURN(1);
 
       List_iterator_fast<LEX_STRING> it(triggers->definitions_list);
-      LEX_STRING *trg_create_str, *trg_name_str;
+      LEX_STRING *trg_create_str;
       ulonglong *trg_sql_mode;
 
       if (triggers->definition_modes_list.is_empty() &&
@@ -962,7 +962,7 @@
           goto err_with_lex_cleanup;
         }
 
-        lex.sphead->set_info(0, 0, &lex.sp_chistics, *trg_sql_mode);
+        lex.sphead->set_info(0, 0, &lex.sp_chistics, (ulong) *trg_sql_mode);
 
         triggers->bodies[lex.trg_chistics.event]
                              [lex.trg_chistics.action_time]= lex.sphead;
@@ -1283,7 +1283,6 @@
 {
   char path_buff[FN_REFLEN];
   LEX_STRING *def, *on_table_name, new_def;
-  ulonglong *sql_mode;
   ulong save_sql_mode= thd->variables.sql_mode;
   List_iterator_fast<LEX_STRING> it_def(definitions_list);
   List_iterator_fast<LEX_STRING> it_on_table_name(on_table_names_list);
@@ -1297,7 +1296,7 @@
   while ((def= it_def++))
   {
     on_table_name= it_on_table_name++;
-    thd->variables.sql_mode= *(it_mode++);
+    thd->variables.sql_mode= (ulong) *(it_mode++);
 
     /* Construct CREATE TRIGGER statement with new table name. */
     buff.length(0);

--- 1.118/sql-common/client.c	2006-11-30 03:41:04 +02:00
+++ 1.119/sql-common/client.c	2006-11-30 03:41:04 +02:00
@@ -687,8 +687,7 @@
     the previous command was a shutdown command, we may have the
     response for the COM_QUIT already in the communication buffer
   */
-  if (command != COM_QUIT)
-    net_clear(&mysql->net);			/* Clear receive buffer */
+  net_clear(&mysql->net, (command != COM_QUIT));
 
   if (net_write_command(net,(uchar) command, header, header_length,
 			arg, arg_length))
@@ -1218,7 +1217,7 @@
     {
       uchar *pos;
       /* fields count may be wrong */
-      DBUG_ASSERT ((field - result) < fields);
+      DBUG_ASSERT((uint) (field - result) < fields);
       cli_fetch_lengths(&lengths[0], row->data, default_value ? 8 : 7);
       field->catalog  = strdup_root(alloc,(char*) row->data[0]);
       field->db       = strdup_root(alloc,(char*) row->data[1]);
@@ -2503,7 +2502,7 @@
   mysql_close(mysql);
   *mysql=tmp_mysql;
   mysql_fix_pointers(mysql, &tmp_mysql); /* adjust connection pointers */
-  net_clear(&mysql->net);
+  net_clear(&mysql->net, 1);
   mysql->affected_rows= ~(my_ulonglong) 0;
   DBUG_RETURN(0);
 }

--- 1.9/storage/ndb/src/kernel/vm/Pool.hpp	2006-11-30 03:41:04 +02:00
+++ 1.10/storage/ndb/src/kernel/vm/Pool.hpp	2006-11-30 03:41:04 +02:00
@@ -65,6 +65,7 @@
 
 struct Pool_context
 {
+  Pool_context() {}
   class SimulatedBlock* m_block;
 
   /**

--- 1.33/sql-common/my_time.c	2006-11-30 03:41:04 +02:00
+++ 1.34/sql-common/my_time.c	2006-11-30 03:41:04 +02:00
@@ -429,7 +429,7 @@
     goto err;
   }
 
-  if ((my_bool)check_date(l_time, not_zero_date, flags, was_cut))
+  if (check_date(l_time, not_zero_date != 0, flags, was_cut))
     goto err;
 
   l_time->time_type= (number_of_fields <= 3 ?
@@ -530,15 +530,15 @@
   if ((uint) (end-str) > 1 && str != end_of_days &&
       my_isdigit(&my_charset_latin1, *str))
   {                                             /* Found days part */
-    date[0]= value;
+    date[0]= (ulong) value;
     state= 1;                                   /* Assume next is hours */
     found_days= 1;
   }
   else if ((end-str) > 1 &&  *str == time_separator &&
            my_isdigit(&my_charset_latin1, str[1]))
   {
-    date[0]=0;                                  /* Assume we found hours */
-    date[1]=value;
+    date[0]= 0;                                 /* Assume we found hours */
+    date[1]= (ulong) value;
     state=2;
     found_hours=1;
     str++;                                      /* skip ':' */
@@ -547,9 +547,9 @@
   {
     /* String given as one number; assume HHMMSS format */
     date[0]= 0;
-    date[1]= value/10000;
-    date[2]= value/100 % 100;
-    date[3]= value % 100;
+    date[1]= ((ulong) value)/10000;
+    date[2]= ((ulong) value)/100 % 100;
+    date[3]= ((ulong) value) % 100;
     state=4;
     goto fractional;
   }
@@ -559,7 +559,7 @@
   {
     for (value=0; str != end && my_isdigit(&my_charset_latin1,*str) ; str++)
       value=value*10L + (long) (*str - '0');
-    date[state++]=value;
+    date[state++]= (ulong) value;
     if (state == 4 || (end-str) < 2 || *str != time_separator ||
         !my_isdigit(&my_charset_latin1,str[1]))
       break;
@@ -594,7 +594,7 @@
       value*= (long) log_10_int[field_length];
     else if (field_length < 0)
       *warning|= MYSQL_TIME_WARN_TRUNCATED;
-    date[4]=value;
+    date[4]= (ulong) value;
   }
   else
     date[4]=0;

--- 1.1/mysys/my_vle.c	2006-11-30 03:41:04 +02:00
+++ 1.2/mysys/my_vle.c	2006-11-30 03:41:04 +02:00
@@ -52,7 +52,7 @@
 
   do
   {
-    *ptr++= (n & 0x7F);
+    *ptr++= (byte) (n & 0x7F);
     n>>= 7;
   }
   while (n > 0);

--- 1.6/storage/ndb/include/util/OutputStream.hpp	2006-11-30 03:41:04 +02:00
+++ 1.7/storage/ndb/include/util/OutputStream.hpp	2006-11-30 03:41:04 +02:00
@@ -25,6 +25,7 @@
  */
 class OutputStream {
 public:
+  OutputStream() {}
   virtual ~OutputStream() {}
   virtual int print(const char * fmt, ...) = 0;
   virtual int println(const char * fmt, ...) = 0;
@@ -64,6 +65,7 @@
 
 class NullOutputStream : public OutputStream {
 public:
+  NullOutputStream() {}
   virtual ~NullOutputStream() {}
   int print(const char * /* unused */, ...) { return 1;}
   int println(const char * /* unused */, ...) { return 1;}

--- 1.14/mysys/base64.c	2006-11-30 03:41:04 +02:00
+++ 1.15/mysys/base64.c	2006-11-30 03:41:04 +02:00
@@ -153,7 +153,7 @@
     Number of bytes written at 'dst' or -1 in case of failure
 */
 int
-base64_decode(const char *const src_base, size_t const len,
+base64_decode(const char *src_base, size_t len,
               void *dst, const char **end_ptr)
 {
   char b[3];

--- 1.39/sql/sql_rename.cc	2006-11-30 03:41:04 +02:00
+++ 1.40/sql/sql_rename.cc	2006-11-30 03:41:04 +02:00
@@ -35,7 +35,7 @@
 bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
 {
   bool error= 1;
-  TABLE_LIST *ren_table= 0, *new_table;
+  TABLE_LIST *ren_table= 0;
   int to_table;
   char *rename_log_table[2]= {NULL, NULL};
   int disable_logs= 0;
@@ -353,7 +353,7 @@
 static TABLE_LIST *
 rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
 {
-  TABLE_LIST *ren_table,*new_table, *tmp_table;
+  TABLE_LIST *ren_table,*new_table;
 
   DBUG_ENTER("rename_tables");
 

--- 1.150/include/my_global.h	2006-11-30 03:41:04 +02:00
+++ 1.151/include/my_global.h	2006-11-30 03:41:04 +02:00
@@ -1136,8 +1136,8 @@
 #define set_timespec_nsec(ABSTIME,NSEC) \
 {\
   ulonglong now= my_getsystime() + (NSEC/100); \
-  (ABSTIME).tv_sec=  (now / ULL(10000000)); \
-  (ABSTIME).tv_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100));    \
+  (ABSTIME).tv_sec=  (time_t) (now / ULL(10000000));                  \
+  (ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
 }
 #endif /* !set_timespec_nsec */
 #endif /* HAVE_TIMESPEC_TS_SEC */

--- 1.202/sql/set_var.cc	2006-11-30 03:41:04 +02:00
+++ 1.203/sql/set_var.cc	2006-11-30 03:41:04 +02:00
@@ -3057,7 +3057,7 @@
 {
   /* The test is negative as the flag we use is NOT autocommit */
 
-  ulong org_options=thd->options;
+  ulonglong org_options= thd->options;
 
   if (var->save_result.ulong_value != 0)
     thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag;
@@ -3069,15 +3069,16 @@
     if ((org_options & OPTION_NOT_AUTOCOMMIT))
     {
       /* We changed to auto_commit mode */
-      thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE |
-                               OPTION_KEEP_LOG);
+      thd->options&= ~(ulonglong) (OPTION_BEGIN |
+                                   OPTION_STATUS_NO_TRANS_UPDATE |
+                                   OPTION_KEEP_LOG);
       thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
       if (ha_commit(thd))
 	return 1;
     }
     else
     {
-      thd->options&= ~(ulong) (OPTION_STATUS_NO_TRANS_UPDATE);
+      thd->options&= ~(ulonglong) (OPTION_STATUS_NO_TRANS_UPDATE);
       thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT;
     }
   }
@@ -3639,7 +3640,8 @@
     pointer to string with sql_mode representation
 */
 
-byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd, ulong val,
+byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd,
+                                                         ulong val,
                                                          ulong *len)
 {
   char buff[256];
@@ -3667,8 +3669,8 @@
 byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type,
 				      LEX_STRING *base)
 {
-  ulong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
-              thd->variables.*offset);
+  ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
+                  thd->variables.*offset);
   ulong length_unused;
   return symbolic_mode_representation(thd, val, &length_unused);
 }

--- 1.37/sql/sql_plugin.cc	2006-11-30 03:41:04 +02:00
+++ 1.38/sql/sql_plugin.cc	2006-11-30 03:41:04 +02:00
@@ -727,7 +727,7 @@
   TABLE_LIST tables;
   TABLE *table;
   READ_RECORD read_record_info;
-  int error, i;
+  int error;
   MEM_ROOT mem;
   THD *new_thd;
   DBUG_ENTER("plugin_load");

--- 1.1/strings/my_strchr.c	2006-11-30 03:41:04 +02:00
+++ 1.2/strings/my_strchr.c	2006-11-30 03:41:04 +02:00
@@ -28,7 +28,7 @@
 
 
 byte *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
-                       char c)
+                pchar c)
 {
   uint mbl;
   while (str < end)

--- 1.30/sql/ha_partition.h	2006-11-30 03:41:04 +02:00
+++ 1.31/sql/ha_partition.h	2006-11-30 03:41:04 +02:00
@@ -76,12 +76,12 @@
     for this since the MySQL Server sometimes allocating the handler object
     without freeing them.
   */
-  u_long m_table_flags;
-  u_long m_low_byte_first;
+  longlong m_table_flags;
+  ulong m_low_byte_first;
 
   uint m_reorged_parts;                  // Number of reorganised parts
   uint m_tot_parts;                      // Total number of partitions;
-  uint m_no_locks;                        // For engines like ha_blackhole, which needs no locks
+  uint m_no_locks;                       // For engines like ha_blackhole, which needs no locks
   uint m_last_part;                      // Last file that we update,write
   int m_lock_type;                       // Remembers type of last
                                          // external_lock

--- 1.95/sql/sql_partition.cc	2006-11-30 03:41:04 +02:00
+++ 1.96/sql/sql_partition.cc	2006-11-30 03:41:04 +02:00
@@ -886,7 +886,6 @@
 bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
                           bool is_sub_part, bool is_field_to_be_setup)
 {
-  MEM_ROOT new_mem_root;
   partition_info *part_info= table->part_info;
   uint dir_length, home_dir_length;
   bool result= TRUE;
@@ -2002,7 +2001,7 @@
                                 bool use_sql_alloc,
                                 bool show_partition_options)
 {
-  uint i,j, tot_no_parts, no_subparts, no_parts;
+  uint i,j, tot_no_parts, no_subparts;
   partition_element *part_elem;
   partition_element *save_part_elem= NULL;
   ulonglong buffer_length;
@@ -2302,10 +2301,13 @@
                                Item *part_expr,
                                longlong *func_value)
 {
+  longlong int_hash_id;
   DBUG_ENTER("get_part_id_hash");
+
   *func_value= part_val_int(part_expr);
-  longlong int_hash_id= *func_value % no_parts;
-  DBUG_RETURN(int_hash_id < 0 ? -int_hash_id : int_hash_id);
+  int_hash_id= *func_value % no_parts;
+
+  DBUG_RETURN(int_hash_id < 0 ? (uint32) -int_hash_id : (uint32) int_hash_id);
 }
 
 
@@ -2358,7 +2360,7 @@
 {
   DBUG_ENTER("get_part_id_key");
   *func_value= calculate_key_value(field_array);
-  DBUG_RETURN(*func_value % no_parts);
+  DBUG_RETURN((uint32) (*func_value % no_parts));
 }
 
 
@@ -3936,7 +3938,7 @@
                 (ulong) (copied + deleted),
                 (ulong) deleted,
                 (ulong) 0);
-    send_ok(thd,copied+deleted,0L,tmp_name);
+    send_ok(thd, (ha_rows) (copied+deleted),0L,tmp_name);
     DBUG_RETURN(FALSE);
   }
   table->file->print_error(error, MYF(0));
@@ -4024,7 +4026,6 @@
   handlerton *engine_type= create_info->db_type;
   handlerton *old_engine_type= engine_type;
   uint i= 0;
-  handler *file;
   uint no_parts= part_info->partitions.elements;
   DBUG_ENTER("check_native_partitioned");
 
@@ -5476,7 +5477,6 @@
 
 static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
 {
-  DDL_LOG_ENTRY ddl_log_entry;
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
   DDL_LOG_MEMORY_ENTRY *exec_log_entry= NULL;
@@ -5521,7 +5521,6 @@
 
 static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
 {
-  DDL_LOG_ENTRY ddl_log_entry;
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
   DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
@@ -5574,7 +5573,6 @@
 
 static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
 {
-  DDL_LOG_ENTRY ddl_log_entry;
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
   DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
@@ -5688,7 +5686,6 @@
 
 static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
 {
-  DDL_LOG_ENTRY ddl_log_entry;
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
   DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
@@ -5746,7 +5743,6 @@
 {
   partition_info *part_info= lpt->part_info;
   uint count_loop= 0;
-  bool not_success;
   DDL_LOG_MEMORY_ENTRY *log_entry= part_info->exec_log_entry;
   DBUG_ENTER("write_log_completed");
 
@@ -7055,7 +7051,6 @@
 
 static uint32 get_next_subpartition_via_walking(PARTITION_ITERATOR *part_iter)
 {
-  uint32 part_id;
   Field *field= part_iter->part_info->subpart_field_array[0];
   if (part_iter->field_vals.cur == part_iter->field_vals.end)
   {

--- 1.250/client/mysqltest.c	2006-11-30 03:41:04 +02:00
+++ 1.251/client/mysqltest.c	2006-11-30 03:41:04 +02:00
@@ -3460,10 +3460,10 @@
 	DBUG_RETURN(0);
       }
       else if ((c == '{' &&
-                (!my_strnncoll_simple(charset_info, "while", 5,
-                                      buf, min(5, p - buf), 0) ||
-                 !my_strnncoll_simple(charset_info, "if", 2,
-                                      buf, min(2, p - buf), 0))))
+                (!my_strnncoll_simple(charset_info, (const uchar*) "while", 5,
+                                      (uchar*) buf, min(5, p - buf), 0) ||
+                 !my_strnncoll_simple(charset_info, (const uchar*) "if", 2,
+                                      (uchar*) buf, min(2, p - buf), 0))))
       {
         /* Only if and while commands can be terminated by { */
         *p++= c;

--- 1.38/client/mysqlslap.c	2006-11-30 03:41:04 +02:00
+++ 1.39/client/mysqlslap.c	2006-11-30 03:41:04 +02:00
@@ -979,7 +979,9 @@
 static int
 run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
 {
+#ifndef __WIN__
   uint x;
+#endif
   File lock_file;
   struct timeval start_time, end_time;
   thread_context con;

--- 1.243/sql/sp_head.cc	2006-11-30 03:41:04 +02:00
+++ 1.244/sql/sp_head.cc	2006-11-30 03:41:04 +02:00
@@ -456,10 +456,14 @@
 sp_head::sp_head()
   :Query_arena(&main_mem_root, INITIALIZED_FOR_SP),
    m_flags(0), m_recursion_level(0), m_next_cached_sp(0),
-   m_first_instance(this), m_first_free_instance(this), m_last_cached_sp(this),
    m_cont_level(0)
 {
   const LEX_STRING str_reset= { NULL, 0 };
+
+  m_first_instance= this;
+  m_first_free_instance= this;
+  m_last_cached_sp= this;
+
   m_return_field_def.charset = NULL;
   /*
     FIXME: the only use case when name is NULL is events, and it should
@@ -1675,7 +1679,7 @@
         Item_null *null_item= new Item_null();
 
         if (!null_item ||
-            nctx->set_variable(thd, i, (struct Item **)&null_item))
+            nctx->set_variable(thd, i, (Item **)&null_item))
         {
           err_status= TRUE;
           break;
@@ -2853,7 +2857,7 @@
 sp_instr_freturn::print(String *str)
 {
   /* freturn type expr... */
-  if (str->reserve(UINT_MAX+8+32)) // Add some for the expr. too
+  if (str->reserve(1024+8+32)) // Add some for the expr. too
     return;
   str->qs_append(STRING_WITH_LEN("freturn "));
   str->qs_append((uint)m_type);

--- 1.31/sql/partition_info.cc	2006-11-30 03:41:04 +02:00
+++ 1.32/sql/partition_info.cc	2006-11-30 03:41:04 +02:00
@@ -248,7 +248,6 @@
                                                   HA_CREATE_INFO *info)
 {
   uint i, j;
-  char *default_name, *name_ptr;
   bool result= TRUE;
   partition_element *part_elem;
   List_iterator<partition_element> part_it(partitions);
@@ -664,7 +663,8 @@
     qsort((void*)list_array, no_list_values, sizeof(LIST_PART_ENTRY), 
           &list_part_cmp);
  
-    i= prev_value= 0; //prev_value initialised to quiet compiler
+    i= 0;
+    LINT_INIT(prev_value);
     do
     {
       DBUG_ASSERT(i < no_list_values);
@@ -956,7 +956,6 @@
     while ((field= *(ptr++)))
     {
       unsigned j= 0;
-      Field *part_field;
       CHARSET_INFO *cs;
       char *field_buf;
       LINT_INIT(field_buf);
@@ -985,7 +984,6 @@
   }
   if (tot_fields)
   {
-    Field *part_field, *subpart_field;
     uint j,k,l;
 
     size= tot_fields*sizeof(char**);

--- 1.3/storage/ndb/include/util/SocketAuthenticator.hpp	2006-11-30 03:41:04 +02:00
+++ 1.4/storage/ndb/include/util/SocketAuthenticator.hpp	2006-11-30 03:41:04 +02:00
@@ -20,6 +20,7 @@
 class SocketAuthenticator
 {
 public:
+  SocketAuthenticator() {}
   virtual ~SocketAuthenticator() {};
   virtual bool client_authenticate(int sockfd) = 0;
   virtual bool server_authenticate(int sockfd) = 0;

--- 1.5/sql/rpl_injector.h	2006-11-30 03:41:04 +02:00
+++ 1.6/sql/rpl_injector.h	2006-11-30 03:41:04 +02:00
@@ -27,7 +27,7 @@
 /* Forward declarations */
 class handler;
 class MYSQL_BIN_LOG;
-class st_table;
+struct st_table;
 
 typedef st_table TABLE;
 

--- 1.184/sql/sql_prepare.cc	2006-11-30 03:41:04 +02:00
+++ 1.185/sql/sql_prepare.cc	2006-11-30 03:41:04 +02:00
@@ -2920,7 +2920,6 @@
 {
   Statement stmt_backup;
   Query_arena *old_stmt_arena;
-  Item *old_free_list;
   bool error= TRUE;
 
   statistic_increment(thd->status_var.com_stmt_execute, &LOCK_status);
Thread
bk commit into 5.1 tree (monty:1.2380) BUG#21428monty30 Nov