[Commits] bzr commit into Mariadb 5.2, with Maria 2.0:maria/5.2 branch (monty:2851)

Michael Widenius monty at askmonty.org
Fri Sep 24 01:00:37 EEST 2010


#At lp:maria/5.2 based on revid:monty at askmonty.org-20100923163044-wb960hqs6wco2h3z

 2851 Michael Widenius	2010-09-24
      Change some my_bool in C++ classes and a few functions to bool to detect wrong usage of bool/my_bool.
      Fix some bugs where we stored values other than 0 or 1 in my_bool
      Fixed some compiler warnings
      modified:
        client/mysql.cc
        client/mysqladmin.cc
        client/mysqltest.cc
        extra/libevent/evbuffer.c
        extra/libevent/event.c
        extra/libevent/signal.c
        sql/event_data_objects.h
        sql/event_db_repository.cc
        sql/event_db_repository.h
        sql/event_parse_data.h
        sql/events.cc
        sql/events.h
        sql/field.cc
        sql/field.h
        sql/hash_filo.h
        sql/item.cc
        sql/item.h
        sql/item_cmpfunc.h
        sql/item_func.cc
        sql/item_func.h
        sql/item_subselect.h
        sql/item_sum.cc
        sql/parse_file.h
        sql/rpl_mi.h
        sql/sp_rcontext.h
        sql/sql_analyse.h
        sql/sql_base.cc
        sql/sql_bitmap.h
        sql/sql_cache.cc
        sql/sql_cache.h
        sql/sql_class.h
        sql/sql_insert.cc
        sql/sql_prepare.cc
        sql/table.h
        storage/maria/ma_check.c
        strings/decimal.c

per-file messages:
  client/mysql.cc
    Changed interrupted_query from my_bool to int, as we stored 2 in it.
  client/mysqladmin.cc
    Changed return variable type to same type as function value type
  client/mysqltest.cc
    Changed 'found' to int as we store other values than 0 or 1 into it
    Changed type for parameter of set_reconnect() to match usage.
  extra/libevent/evbuffer.c
    Added __attribute__((unused))
  extra/libevent/event.c
    Added __attribute__((unused))
  extra/libevent/signal.c
    Added __attribute__((unused))
  sql/event_data_objects.h
    my_bool -> bool
  sql/event_db_repository.cc
    my_bool -> bool
  sql/event_db_repository.h
    my_bool -> bool
  sql/event_parse_data.h
    my_bool -> bool
  sql/events.cc
    my_bool -> bool
  sql/events.h
    my_bool -> bool
  sql/field.cc
    my_bool -> bool
  sql/field.h
    my_bool -> bool
  sql/hash_filo.h
    my_bool -> bool
  sql/item.cc
    my_bool -> bool
  sql/item.h
    my_bool -> bool
  sql/item_cmpfunc.h
    my_bool -> bool
    Changed result_for_null_param from my_bool to int as we stored -1 in it.
  sql/item_func.cc
    my_bool -> bool
    Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s)
  sql/item_func.h
    my_bool -> bool
  sql/item_subselect.h
    my_bool -> bool
  sql/item_sum.cc
    Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s)
  sql/parse_file.h
    my_bool -> bool
  sql/rpl_mi.h
    my_bool -> bool
  sql/sp_rcontext.h
    my_bool -> bool
  sql/sql_analyse.h
    my_bool -> bool
  sql/sql_base.cc
    Change some assignments so that we don't initialize bool variables with int's.
  sql/sql_bitmap.h
    my_bool -> bool
  sql/sql_cache.cc
    my_bool -> bool
  sql/sql_cache.h
    my_bool -> bool
  sql/sql_class.h
    my_bool -> bool
  sql/sql_insert.cc
    Change some assignments so that we don't initialize bool variables with int's.
  sql/sql_prepare.cc
    my_bool -> bool
  sql/table.h
    my_bool -> bool
  storage/maria/ma_check.c
    Removed duplicate assignment
  strings/decimal.c
    Fixed wrong variable usage.
    Don't do complex arithmetic on bool when simple works.
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2010-08-24 22:44:50 +0000
+++ b/client/mysql.cc	2010-09-23 22:00:32 +0000
@@ -151,7 +151,7 @@ static my_bool ignore_errors=0,wait_flag
 	       tty_password= 0, opt_nobeep=0, opt_reconnect=1,
 	       default_charset_used= 0, opt_secure_auth= 0,
                default_pager_set= 0, opt_sigint_ignore= 0,
-               show_warnings= 0, executing_query= 0, interrupted_query= 0,
+               show_warnings= 0, executing_query= 0,
                ignore_spaces= 0;
 static my_bool debug_info_flag, debug_check_flag, batch_abort_on_error;
 static my_bool column_types_flag;
@@ -162,6 +162,7 @@ static uint verbose=0,opt_silent=0,opt_m
 static uint my_end_arg;
 static char * opt_mysql_unix_port=0;
 static int connect_flag=CLIENT_INTERACTIVE;
+static int interrupted_query= 0;
 static char *current_host,*current_db,*current_user=0,*opt_password=0,
             *current_prompt=0, *delimiter_str= 0,
             *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
@@ -3982,7 +3983,7 @@ static int
 com_connect(String *buffer, char *line)
 {
   char *tmp, buff[256];
-  bool save_rehash= opt_rehash;
+  my_bool save_rehash= opt_rehash;
   int error;
 
   bzero(buff, sizeof(buff));

=== modified file 'client/mysqladmin.cc'
--- a/client/mysqladmin.cc	2010-08-05 19:56:11 +0000
+++ b/client/mysqladmin.cc	2010-09-23 22:00:32 +0000
@@ -1469,7 +1469,7 @@ static my_bool wait_pidfile(char *pidfil
 			    struct stat *pidfile_status)
 {
   char buff[FN_REFLEN];
-  int error= 1;
+  my_bool error= 1;
   uint count= 0;
   DBUG_ENTER("wait_pidfile");
 

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-08-07 12:27:23 +0000
+++ b/client/mysqltest.cc	2010-09-23 22:00:32 +0000
@@ -4727,11 +4727,11 @@ char *get_string(char **to_ptr, char **f
 }
 
 
-void set_reconnect(MYSQL* mysql, int val)
+void set_reconnect(MYSQL* mysql, my_bool val)
 {
   my_bool reconnect= val;
   DBUG_ENTER("set_reconnect");
-  DBUG_PRINT("info", ("val: %d", val));
+  DBUG_PRINT("info", ("val: %d", (int) val));
 #if MYSQL_VERSION_ID < 50000
   mysql->reconnect= reconnect;
 #else
@@ -8591,15 +8591,15 @@ void free_replace()
 
 
 typedef struct st_replace {
-  my_bool found;
+  int found;
   struct st_replace *next[256];
 } REPLACE;
 
 typedef struct st_replace_found {
-  my_bool found;
-  char *replace_string;
+  int found;
   uint to_offset;
   int from_offset;
+  char *replace_string;
 } REPLACE_STRING;
 
 
@@ -8631,7 +8631,7 @@ void replace_strings_append(REPLACE *rep
     }
 
     /* Found a string that needs to be replaced */
-    DBUG_PRINT("info", ("found: %d, to_offset: %d, from_offset: %d, string: %s",
+    DBUG_PRINT("info", ("found: %d, to_offset: %u, from_offset: %d, string: %s",
                         rep_str->found, rep_str->to_offset,
                         rep_str->from_offset, rep_str->replace_string));
 

=== modified file 'extra/libevent/evbuffer.c'
--- a/extra/libevent/evbuffer.c	2010-04-02 09:20:09 +0000
+++ b/extra/libevent/evbuffer.c	2010-09-23 22:00:32 +0000
@@ -75,7 +75,7 @@ bufferevent_add(struct event *ev, int ti
  */
 
 void
-bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now,
+bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old __attribute__((unused)), size_t now,
     void *arg) {
 	struct bufferevent *bufev = arg;
 	/* 

=== modified file 'extra/libevent/event.c'
--- a/extra/libevent/event.c	2010-04-02 09:20:09 +0000
+++ b/extra/libevent/event.c	2010-09-23 22:00:32 +0000
@@ -394,7 +394,8 @@ event_base_get_method(struct event_base
 }
 
 static void
-event_loopexit_cb(int fd, short what, void *arg)
+event_loopexit_cb(int fd __attribute__((unused)),
+                  short what __attribute__((unused)), void *arg)
 {
 	struct event_base *base = arg;
 	base->event_gotterm = 1;

=== modified file 'extra/libevent/signal.c'
--- a/extra/libevent/signal.c	2010-04-02 09:20:09 +0000
+++ b/extra/libevent/signal.c	2010-09-23 22:00:32 +0000
@@ -69,7 +69,7 @@ static void evsignal_handler(int sig);
 
 /* Callback for when the signal handler write a byte to our signaling socket */
 static void
-evsignal_cb(int fd, short what, void *arg)
+evsignal_cb(int fd, short what __attribute__((unused)), void *arg __attribute__((unused)))
 {
 	static char signals[100];
 #ifdef WIN32

=== modified file 'sql/event_data_objects.h'
--- a/sql/event_data_objects.h	2008-05-09 07:43:02 +0000
+++ b/sql/event_data_objects.h	2010-09-23 22:00:32 +0000
@@ -89,9 +89,9 @@ public:
   my_time_t execute_at;
   my_time_t starts;
   my_time_t ends;
-  my_bool starts_null;
-  my_bool ends_null;
-  my_bool execute_at_null;
+  bool starts_null;
+  bool ends_null;
+  bool execute_at_null;
 
   longlong expression;
   interval_type interval;

=== modified file 'sql/event_db_repository.cc'
--- a/sql/event_db_repository.cc	2010-07-16 22:41:44 +0000
+++ b/sql/event_db_repository.cc	2010-09-23 22:00:32 +0000
@@ -610,7 +610,7 @@ Event_db_repository::open_event_table(TH
 
 bool
 Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
-                                  my_bool create_if_not)
+                                  bool create_if_not)
 {
   int ret= 1;
   TABLE *table= NULL;

=== modified file 'sql/event_db_repository.h'
--- a/sql/event_db_repository.h	2007-08-15 15:08:44 +0000
+++ b/sql/event_db_repository.h	2010-09-23 22:00:32 +0000
@@ -73,7 +73,7 @@ public:
   Event_db_repository(){}
 
   bool
-  create_event(THD *thd, Event_parse_data *parse_data, my_bool create_if_not);
+  create_event(THD *thd, Event_parse_data *parse_data, bool create_if_not);
 
   bool
   update_event(THD *thd, Event_parse_data *parse_data, LEX_STRING *new_dbname,

=== modified file 'sql/event_parse_data.h'
--- a/sql/event_parse_data.h	2008-11-10 20:21:49 +0000
+++ b/sql/event_parse_data.h	2010-09-23 22:00:32 +0000
@@ -70,9 +70,9 @@ public:
   my_time_t starts;
   my_time_t ends;
   my_time_t execute_at;
-  my_bool starts_null;
-  my_bool ends_null;
-  my_bool execute_at_null;
+  bool starts_null;
+  bool ends_null;
+  bool execute_at_null;
 
   sp_name *identifier;
   Item* item_expression;

=== modified file 'sql/events.cc'
--- a/sql/events.cc	2010-07-16 22:41:44 +0000
+++ b/sql/events.cc	2010-09-23 22:00:32 +0000
@@ -917,7 +917,7 @@ Events::fill_schema_events(THD *thd, TAB
 */
 
 bool
-Events::init(my_bool opt_noacl_or_bootstrap)
+Events::init(bool opt_noacl_or_bootstrap)
 {
 
   THD *thd;

=== modified file 'sql/events.h'
--- a/sql/events.h	2007-08-15 15:08:44 +0000
+++ b/sql/events.h	2010-09-23 22:00:32 +0000
@@ -92,7 +92,7 @@ public:
   get_db_repository() { return db_repository; }
 
   static bool
-  init(my_bool opt_noacl);
+  init(bool opt_noacl);
 
   static void
   deinit();

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2010-09-23 16:30:44 +0000
+++ b/sql/field.cc	2010-09-23 22:00:32 +0000
@@ -1284,7 +1284,7 @@ static bool test_if_real(const char *str
   This is used for printing bit_fields as numbers while debugging.
 */
 
-String *Field::val_int_as_str(String *val_buffer, my_bool unsigned_val)
+String *Field::val_int_as_str(String *val_buffer, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_READ;
   CHARSET_INFO *cs= &my_charset_bin;
@@ -6855,7 +6855,7 @@ int Field_string::do_save_field_metadata
 */
 
 int Field_string::pack_cmp(const uchar *a, const uchar *b, uint length,
-                           my_bool insert_or_update)
+                           bool insert_or_update)
 {
   uint a_length, b_length;
   if (length > 255)
@@ -6893,7 +6893,7 @@ int Field_string::pack_cmp(const uchar *
 */
 
 int Field_string::pack_cmp(const uchar *key, uint length,
-                           my_bool insert_or_update)
+                           bool insert_or_update)
 {
   uint row_length, local_key_length;
   uchar *end;
@@ -7372,7 +7372,7 @@ Field_varstring::unpack(uchar *to, const
 
 int Field_varstring::pack_cmp(const uchar *a, const uchar *b,
                               uint key_length_arg,
-                              my_bool insert_or_update)
+                              bool insert_or_update)
 {
   uint a_length, b_length;
   if (key_length_arg > 255)
@@ -7393,7 +7393,7 @@ int Field_varstring::pack_cmp(const ucha
 
 
 int Field_varstring::pack_cmp(const uchar *b, uint key_length_arg,
-                              my_bool insert_or_update)
+                              bool insert_or_update)
 {
   uchar *a= ptr+ length_bytes;
   uint a_length=  length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
@@ -8124,7 +8124,7 @@ const uchar *Field_blob::unpack(uchar *t
 /* Keys for blobs are like keys on varchars */
 
 int Field_blob::pack_cmp(const uchar *a, const uchar *b, uint key_length_arg,
-                         my_bool insert_or_update)
+                         bool insert_or_update)
 {
   uint a_length, b_length;
   if (key_length_arg > 255)
@@ -8145,7 +8145,7 @@ int Field_blob::pack_cmp(const uchar *a,
 
 
 int Field_blob::pack_cmp(const uchar *b, uint key_length_arg,
-                         my_bool insert_or_update)
+                         bool insert_or_update)
 {
   uchar *a;
   uint a_length, b_length;

=== modified file 'sql/field.h'
--- a/sql/field.h	2010-07-17 18:16:16 +0000
+++ b/sql/field.h	2010-09-23 22:00:32 +0000
@@ -64,9 +64,9 @@ private:
   */
   enum_field_types field_type;   /* Real field type*/
   /* Flag indicating  that the field is physically stored in the database */
-  my_bool stored_in_db;
+  bool stored_in_db;
   /* Flag indicating that the field used in a partitioning expression */
-  my_bool in_partitioning_expr;
+  bool in_partitioning_expr;
 
 public:
   /* The expression to compute the value of the virtual column */
@@ -217,7 +217,7 @@ public:
      This trickery is used to decrease a number of malloc calls.
   */
   virtual String *val_str(String*,String *)=0;
-  String *val_int_as_str(String *val_buffer, my_bool unsigned_flag);
+  String *val_int_as_str(String *val_buffer, bool unsigned_flag);
   /*
    str_needs_quotes() returns TRUE if the value returned by val_str() needs
    to be quoted when used in constructing an SQL query.
@@ -516,10 +516,10 @@ public:
   { return max_length;}
 
   virtual int pack_cmp(const uchar *a,const uchar *b, uint key_length_arg,
-                       my_bool insert_or_update)
+                       bool insert_or_update)
   { return cmp(a,b); }
   virtual int pack_cmp(const uchar *b, uint key_length_arg,
-                       my_bool insert_or_update)
+                       bool insert_or_update)
   { return cmp(ptr,b); }
   uint offset(uchar *record)
   {
@@ -785,7 +785,7 @@ public:
 /* base class for float and double and decimal (old one) */
 class Field_real :public Field_num {
 public:
-  my_bool not_fixed;
+  bool not_fixed;
 
   Field_real(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
              uchar null_bit_arg, utype unireg_check_arg,
@@ -1212,7 +1212,7 @@ public:
                 NONE, field_name_arg, dec_arg, 0, 0)
     {}
   Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
-	       uint8 dec_arg, my_bool not_fixed_arg)
+	       uint8 dec_arg, bool not_fixed_arg)
     :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
                 NONE, field_name_arg, dec_arg, 0, 0)
     {not_fixed= not_fixed_arg; }
@@ -1303,7 +1303,7 @@ public:
       Field::set_default();
   }
   /* Get TIMESTAMP field value as seconds since begging of Unix Epoch */
-  inline long get_timestamp(my_bool *null_value)
+  inline long get_timestamp(bool *null_value)
   {
     if ((*null_value= is_null()))
       return 0;
@@ -1590,8 +1590,8 @@ public:
                             const Relay_log_info *rli, uint16 mflags);
   uint row_pack_length() { return (field_length + 1); }
   int pack_cmp(const uchar *a,const uchar *b,uint key_length,
-               my_bool insert_or_update);
-  int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update);
+               bool insert_or_update);
+  int pack_cmp(const uchar *b,uint key_length,bool insert_or_update);
   uint packed_col_length(const uchar *to, uint length);
   uint max_packed_col_length(uint max_length);
   uint size_of() const { return sizeof(*this); }
@@ -1673,8 +1673,8 @@ public:
   const uchar *unpack_key(uchar* to, const uchar *from,
                           uint max_length, bool low_byte_first);
   int pack_cmp(const uchar *a, const uchar *b, uint key_length,
-               my_bool insert_or_update);
-  int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
+               bool insert_or_update);
+  int pack_cmp(const uchar *b, uint key_length,bool insert_or_update);
   int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L);
   int key_cmp(const uchar *,const uchar*);
   int key_cmp(const uchar *str, uint length);
@@ -1859,8 +1859,8 @@ public:
   const uchar *unpack_key(uchar* to, const uchar *from,
                           uint max_length, bool low_byte_first);
   int pack_cmp(const uchar *a, const uchar *b, uint key_length,
-               my_bool insert_or_update);
-  int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
+               bool insert_or_update);
+  int pack_cmp(const uchar *b, uint key_length,bool insert_or_update);
   uint packed_col_length(const uchar *col_ptr, uint length);
   uint max_packed_col_length(uint max_length);
   void free() { value.free(); }
@@ -2222,7 +2222,7 @@ class Copy_field :public Sql_alloc {
 public:
   uchar *from_ptr,*to_ptr;
   uchar *from_null_ptr,*to_null_ptr;
-  my_bool *null_row;
+  bool *null_row;
   uint	from_bit,to_bit;
   uint from_length,to_length;
   Field *from_field,*to_field;

=== modified file 'sql/hash_filo.h'
--- a/sql/hash_filo.h	2007-05-10 09:59:39 +0000
+++ b/sql/hash_filo.h	2010-09-23 22:00:32 +0000
@@ -107,7 +107,7 @@ public:
     return entry;
   }
 
-  my_bool add(hash_filo_element *entry)
+  bool add(hash_filo_element *entry)
   {
     if (cache.records == size)
     {

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2010-08-05 19:56:11 +0000
+++ b/sql/item.cc	2010-09-23 22:00:32 +0000
@@ -424,8 +424,8 @@ Item::Item(THD *thd, Item *item):
   with_sum_func(item->with_sum_func),
   fixed(item->fixed),
   is_autogenerated_name(item->is_autogenerated_name),
-  collation(item->collation),
   with_subselect(item->with_subselect),
+  collation(item->collation),
   cmp_context(item->cmp_context)
 {
   next= thd->free_list;				// Put in free list
@@ -2806,7 +2806,7 @@ bool Item_param::set_from_user_var(THD *
     unsigned_flag= entry->unsigned_flag;
     if (limit_clause_param)
     {
-      my_bool unused;
+      bool unused;
       set_int(entry->val_int(&unused), MY_INT64_NUM_DECIMAL_DIGITS);
       item_type= Item::INT_ITEM;
       DBUG_RETURN(!unsigned_flag && value.integer < 0 ? 1 : 0);

=== modified file 'sql/item.h'
--- a/sql/item.h	2010-08-26 13:20:27 +0000
+++ b/sql/item.h	2010-09-23 22:00:32 +0000
@@ -536,17 +536,17 @@ public:
   uint name_length;                     /* Length of name */
   int8 marker;
   uint8 decimals;
-  my_bool maybe_null;			/* If item may be null */
-  my_bool null_value;			/* if item is null */
-  my_bool unsigned_flag;
-  my_bool with_sum_func;
-  my_bool fixed;                        /* If item fixed with fix_fields */
-  my_bool is_autogenerated_name;        /* indicate was name of this Item
+  bool maybe_null;			/* If item may be null */
+  bool null_value;			/* if item is null */
+  bool unsigned_flag;
+  bool with_sum_func;
+  bool fixed;                           /* If item fixed with fix_fields */
+  bool is_autogenerated_name;           /* indicate was name of this Item
                                            autogenerated or set by user */
-  DTCollation collation;
-  my_bool with_subselect;               /* If this item is a subselect or some
+  bool with_subselect;                  /* If this item is a subselect or some
                                            of its arguments is or contains a
                                            subselect */
+  DTCollation collation;
   Item_result cmp_context;              /* Comparison context */
   // alloc & destruct is done as start of select using sql_alloc
   Item();
@@ -2649,7 +2649,7 @@ class Item_int_with_ref :public Item_int
 {
   Item *ref;
 public:
-  Item_int_with_ref(longlong i, Item *ref_arg, my_bool unsigned_arg) :
+  Item_int_with_ref(longlong i, Item *ref_arg, bool unsigned_arg) :
     Item_int(i), ref(ref_arg)
   {
     unsigned_flag= unsigned_arg;
@@ -2883,7 +2883,7 @@ public:
 class Cached_item :public Sql_alloc
 {
 public:
-  my_bool null_value;
+  bool null_value;
   Cached_item() :null_value(0) {}
   virtual bool cmp(void)=0;
   virtual ~Cached_item(); /*line -e1509 */

=== modified file 'sql/item_cmpfunc.h'
--- a/sql/item_cmpfunc.h	2010-08-05 19:56:11 +0000
+++ b/sql/item_cmpfunc.h	2010-09-23 22:00:32 +0000
@@ -220,7 +220,7 @@ public:
 
 
 class Item_cache;
-#define UNKNOWN ((my_bool)-1)
+#define UNKNOWN (-1)
 
 
 /*
@@ -249,7 +249,7 @@ protected:
       FALSE   - result is FALSE
       TRUE    - result is NULL
   */
-  my_bool result_for_null_param;
+  int result_for_null_param;
 public:
   Item_in_optimizer(Item *a, Item_in_subselect *b):
     Item_bool_func(a, my_reinterpret_cast(Item *)(b)), cache(0),
@@ -657,7 +657,7 @@ struct interval_range
 class Item_func_interval :public Item_int_func
 {
   Item_row *row;
-  my_bool use_decimal_comparison;
+  bool use_decimal_comparison;
   interval_range *intervals;
 public:
   Item_func_interval(Item_row *a)
@@ -865,7 +865,7 @@ public:
   void value_to_item(uint pos, Item *item)
   {
     ((Item_int*) item)->value= ((packed_longlong*) base)[pos].val;
-    ((Item_int*) item)->unsigned_flag= (my_bool)
+    ((Item_int*) item)->unsigned_flag= (bool)
       ((packed_longlong*) base)[pos].unsigned_flag;
   }
   Item_result result_type() { return INT_RESULT; }

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2010-07-21 04:59:47 +0000
+++ b/sql/item_func.cc	2010-09-23 22:00:32 +0000
@@ -3120,11 +3120,15 @@ void Item_udf_func::print(String *str, e
 
 double Item_func_udf_float::val_real()
 {
+  double res;
+  my_bool tmp_null_value;
   DBUG_ASSERT(fixed == 1);
   DBUG_ENTER("Item_func_udf_float::val");
   DBUG_PRINT("info",("result_type: %d  arg_count: %d",
 		     args[0]->result_type(), arg_count));
-  DBUG_RETURN(udf.val(&null_value));
+  res= udf.val(&tmp_null_value);
+  null_value= tmp_null_value;
+  DBUG_RETURN(res);
 }
 
 
@@ -3141,9 +3145,13 @@ String *Item_func_udf_float::val_str(Str
 
 longlong Item_func_udf_int::val_int()
 {
+  longlong res;
+  my_bool tmp_null_value;
   DBUG_ASSERT(fixed == 1);
   DBUG_ENTER("Item_func_udf_int::val_int");
-  DBUG_RETURN(udf.val_int(&null_value));
+  res= udf.val_int(&tmp_null_value);
+  null_value= tmp_null_value;
+  DBUG_RETURN(res);
 }
 
 
@@ -3160,8 +3168,10 @@ String *Item_func_udf_int::val_str(Strin
 
 longlong Item_func_udf_decimal::val_int()
 {
-  my_decimal dec_buf, *dec= udf.val_decimal(&null_value, &dec_buf);
+  my_bool tmp_null_value;
   longlong result;
+  my_decimal dec_buf, *dec= udf.val_decimal(&tmp_null_value, &dec_buf);
+  null_value= tmp_null_value;
   if (null_value)
     return 0;
   my_decimal2int(E_DEC_FATAL_ERROR, dec, unsigned_flag, &result);
@@ -3171,8 +3181,10 @@ longlong Item_func_udf_decimal::val_int(
 
 double Item_func_udf_decimal::val_real()
 {
-  my_decimal dec_buf, *dec= udf.val_decimal(&null_value, &dec_buf);
+  my_bool tmp_null_value;
   double result;
+  my_decimal dec_buf, *dec= udf.val_decimal(&tmp_null_value, &dec_buf);
+  null_value= tmp_null_value;
   if (null_value)
     return 0.0;
   my_decimal2double(E_DEC_FATAL_ERROR, dec, &result);
@@ -3182,18 +3194,24 @@ double Item_func_udf_decimal::val_real()
 
 my_decimal *Item_func_udf_decimal::val_decimal(my_decimal *dec_buf)
 {
+  my_decimal *res;
+  my_bool tmp_null_value;
   DBUG_ASSERT(fixed == 1);
   DBUG_ENTER("Item_func_udf_decimal::val_decimal");
   DBUG_PRINT("info",("result_type: %d  arg_count: %d",
                      args[0]->result_type(), arg_count));
 
-  DBUG_RETURN(udf.val_decimal(&null_value, dec_buf));
+  res= udf.val_decimal(&tmp_null_value, dec_buf);
+  null_value= tmp_null_value;
+  DBUG_RETURN(res);
 }
 
 
 String *Item_func_udf_decimal::val_str(String *str)
 {
-  my_decimal dec_buf, *dec= udf.val_decimal(&null_value, &dec_buf);
+  my_bool tmp_null_value;
+  my_decimal dec_buf, *dec= udf.val_decimal(&tmp_null_value, &dec_buf);
+  null_value= tmp_null_value;
   if (null_value)
     return 0;
   if (str->length() < DECIMAL_MAX_STR_LENGTH)
@@ -3954,7 +3972,7 @@ Item_func_set_user_var::update_hash(void
 
 /** Get the value of a variable as a double. */
 
-double user_var_entry::val_real(my_bool *null_value)
+double user_var_entry::val_real(bool *null_value)
 {
   if ((*null_value= (value == 0)))
     return 0.0;
@@ -3983,7 +4001,7 @@ double user_var_entry::val_real(my_bool
 
 /** Get the value of a variable as an integer. */
 
-longlong user_var_entry::val_int(my_bool *null_value) const
+longlong user_var_entry::val_int(bool *null_value) const
 {
   if ((*null_value= (value == 0)))
     return LL(0);
@@ -4015,7 +4033,7 @@ longlong user_var_entry::val_int(my_bool
 
 /** Get the value of a variable as a string. */
 
-String *user_var_entry::val_str(my_bool *null_value, String *str,
+String *user_var_entry::val_str(bool *null_value, String *str,
 				uint decimals)
 {
   if ((*null_value= (value == 0)))
@@ -4048,7 +4066,7 @@ String *user_var_entry::val_str(my_bool
 
 /** Get the value of a variable as a decimal. */
 
-my_decimal *user_var_entry::val_decimal(my_bool *null_value, my_decimal *val)
+my_decimal *user_var_entry::val_decimal(bool *null_value, my_decimal *val)
 {
   if ((*null_value= (value == 0)))
     return 0;

=== modified file 'sql/item_func.h'
--- a/sql/item_func.h	2010-08-24 22:44:50 +0000
+++ b/sql/item_func.h	2010-09-23 22:00:32 +0000
@@ -1517,7 +1517,7 @@ class Item_func_get_system_var :public I
   longlong cached_llval;
   double cached_dval;
   String cached_strval;
-  my_bool cached_null_value;
+  bool cached_null_value;
   query_id_t used_query_id;
   uchar cache_present;
 

=== modified file 'sql/item_subselect.h'
--- a/sql/item_subselect.h	2010-06-01 19:52:20 +0000
+++ b/sql/item_subselect.h	2010-09-23 22:00:32 +0000
@@ -30,7 +30,7 @@ class Item_bool_func2;
 
 class Item_subselect :public Item_result_field
 {
-  my_bool value_assigned; /* value already assigned to subselect */
+  bool value_assigned; 		/* value already assigned to subselect */
 protected:
   /* thread handler, will be assigned in fix_fields only */
   THD *thd;
@@ -432,9 +432,9 @@ protected:
 
 class subselect_single_select_engine: public subselect_engine
 {
-  my_bool prepared; /* simple subselect is prepared */
-  my_bool optimized; /* simple subselect is optimized */
-  my_bool executed; /* simple subselect is executed */
+  bool prepared; /* simple subselect is prepared */
+  bool optimized; /* simple subselect is optimized */
+  bool executed; /* simple subselect is executed */
   st_select_lex *select_lex; /* corresponding select_lex */
   JOIN * join; /* corresponding JOIN structure */
 public:

=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc	2010-08-23 09:46:25 +0000
+++ b/sql/item_sum.cc	2010-09-23 22:00:32 +0000
@@ -2637,8 +2637,10 @@ void Item_udf_sum::clear()
 
 bool Item_udf_sum::add()
 {
+  my_bool tmp_null_value;
   DBUG_ENTER("Item_udf_sum::add");
-  udf.add(&null_value);
+  udf.add(&tmp_null_value);
+  null_value= tmp_null_value;
   DBUG_RETURN(0);
 }
 
@@ -2674,11 +2676,15 @@ Item *Item_sum_udf_float::copy_or_same(T
 
 double Item_sum_udf_float::val_real()
 {
+  my_bool tmp_null_value;
+  double res;
   DBUG_ASSERT(fixed == 1);
   DBUG_ENTER("Item_sum_udf_float::val");
   DBUG_PRINT("info",("result_type: %d  arg_count: %d",
 		     args[0]->result_type(), arg_count));
-  DBUG_RETURN(udf.val(&null_value));
+  res= udf.val(&tmp_null_value);
+  null_value= tmp_null_value;
+  DBUG_RETURN(res);
 }
 
 
@@ -2714,12 +2720,16 @@ longlong Item_sum_udf_decimal::val_int()
 
 my_decimal *Item_sum_udf_decimal::val_decimal(my_decimal *dec_buf)
 {
+  my_decimal *res;
+  my_bool tmp_null_value;
   DBUG_ASSERT(fixed == 1);
   DBUG_ENTER("Item_func_udf_decimal::val_decimal");
   DBUG_PRINT("info",("result_type: %d  arg_count: %d",
                      args[0]->result_type(), arg_count));
 
-  DBUG_RETURN(udf.val_decimal(&null_value, dec_buf));
+  res= udf.val_decimal(&tmp_null_value, dec_buf);
+  null_value= tmp_null_value;
+  DBUG_RETURN(res);
 }
 
 
@@ -2736,11 +2746,15 @@ Item *Item_sum_udf_int::copy_or_same(THD
 
 longlong Item_sum_udf_int::val_int()
 {
+  my_bool tmp_null_value;
+  longlong res;
   DBUG_ASSERT(fixed == 1);
   DBUG_ENTER("Item_sum_udf_int::val_int");
   DBUG_PRINT("info",("result_type: %d  arg_count: %d",
 		     args[0]->result_type(), arg_count));
-  DBUG_RETURN(udf.val_int(&null_value));
+  res= udf.val_int(&tmp_null_value);
+  null_value= tmp_null_value;
+  DBUG_RETURN(res);
 }
 
 

=== modified file 'sql/parse_file.h'
--- a/sql/parse_file.h	2009-05-15 12:57:51 +0000
+++ b/sql/parse_file.h	2010-09-23 22:00:32 +0000
@@ -89,12 +89,12 @@ class File_parser: public Sql_alloc
 {
   char *buff, *start, *end;
   LEX_STRING file_type;
-  my_bool content_ok;
+  bool content_ok;
 public:
   File_parser() :buff(0), start(0), end(0), content_ok(0)
     { file_type.str= 0; file_type.length= 0; }
 
-  my_bool ok() { return content_ok; }
+  bool ok() { return content_ok; }
   LEX_STRING *type() { return &file_type; }
   my_bool parse(uchar* base, MEM_ROOT *mem_root,
 		struct File_option *parameters, uint required,

=== modified file 'sql/rpl_mi.h'
--- a/sql/rpl_mi.h	2010-05-24 16:43:27 +0000
+++ b/sql/rpl_mi.h	2010-09-23 22:00:32 +0000
@@ -66,10 +66,10 @@ class Master_info : public Slave_reporti
   char host[HOSTNAME_LENGTH+1];
   char user[USERNAME_LENGTH+1];
   char password[MAX_PASSWORD_LENGTH+1];
-  my_bool ssl; // enables use of SSL connection if true
+  bool ssl; // enables use of SSL connection if true
   char ssl_ca[FN_REFLEN], ssl_capath[FN_REFLEN], ssl_cert[FN_REFLEN];
   char ssl_cipher[FN_REFLEN], ssl_key[FN_REFLEN];
-  my_bool ssl_verify_server_cert;
+  bool ssl_verify_server_cert;
 
   my_off_t master_log_pos;
   File fd; // we keep the file open, so we need to remember the file pointer

=== modified file 'sql/sp_rcontext.h'
--- a/sql/sp_rcontext.h	2008-01-23 20:26:41 +0000
+++ b/sql/sp_rcontext.h	2010-09-23 22:00:32 +0000
@@ -281,7 +281,7 @@ public:
   int
   close(THD *thd);
 
-  inline my_bool
+  inline bool
   is_open()
   {
     return test(server_side_cursor);

=== modified file 'sql/sql_analyse.h'
--- a/sql/sql_analyse.h	2008-03-21 15:48:28 +0000
+++ b/sql/sql_analyse.h	2010-09-23 22:00:32 +0000
@@ -71,7 +71,7 @@ class field_info :public Sql_alloc
 protected:
   ulong   treemem, tree_elements, empty, nulls, min_length, max_length;
   uint	  room_in_tree;
-  my_bool found;
+  bool found;
   TREE	  tree;
   Item	  *item;
   analyse *pc;

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2010-08-05 19:56:11 +0000
+++ b/sql/sql_base.cc	2010-09-23 22:00:32 +0000
@@ -2341,7 +2341,8 @@ bool reopen_name_locked_table(THD* thd,
   table->tablenr=thd->current_tablenr++;
   table->used_fields=0;
   table->const_table=0;
-  table->null_row= table->maybe_null= 0;
+  table->null_row= 0;
+  table->maybe_null= 0;
   table->force_index= table->force_index_order= table->force_index_group= 0;
   table->status=STATUS_NO_RECORD;
   DBUG_RETURN(FALSE);
@@ -3007,7 +3008,8 @@ TABLE *open_table(THD *thd, TABLE_LIST *
   table->tablenr=thd->current_tablenr++;
   table->used_fields=0;
   table->const_table=0;
-  table->null_row= table->maybe_null= 0;
+  table->null_row= 0;
+  table->maybe_null= 0;
   table->force_index= table->force_index_order= table->force_index_group= 0;
   table->status=STATUS_NO_RECORD;
   table->insert_values= 0;

=== modified file 'sql/sql_bitmap.h'
--- a/sql/sql_bitmap.h	2010-08-07 12:27:23 +0000
+++ b/sql/sql_bitmap.h	2010-09-23 22:00:32 +0000
@@ -60,13 +60,13 @@ public:
   }
   void subtract(Bitmap& map2) { bitmap_subtract(&map, &map2.map); }
   void merge(Bitmap& map2) { bitmap_union(&map, &map2.map); }
-  my_bool is_set(uint n) const { return bitmap_is_set(&map, n); }
-  my_bool is_prefix(uint n) const { return bitmap_is_prefix(&map, n); }
-  my_bool is_clear_all() const { return bitmap_is_clear_all(&map); }
-  my_bool is_set_all() const { return bitmap_is_set_all(&map); }
-  my_bool is_subset(const Bitmap& map2) const { return bitmap_is_subset(&map, &map2.map); }
-  my_bool is_overlapping(const Bitmap& map2) const { return bitmap_is_overlapping(&map, &map2.map); }
-  my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); }
+  bool is_set(uint n) const { return bitmap_is_set(&map, n); }
+  bool is_prefix(uint n) const { return bitmap_is_prefix(&map, n); }
+  bool is_clear_all() const { return bitmap_is_clear_all(&map); }
+  bool is_set_all() const { return bitmap_is_set_all(&map); }
+  bool is_subset(const Bitmap& map2) const { return bitmap_is_subset(&map, &map2.map); }
+  bool is_overlapping(const Bitmap& map2) const { return bitmap_is_overlapping(&map, &map2.map); }
+  bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); }
   char *print(char *buf) const
   {
     char *s=buf;
@@ -155,13 +155,13 @@ public:
   void intersect_extended(ulonglong map2) { map&= map2; }
   void subtract(Bitmap<64>& map2) { map&= ~map2.map; }
   void merge(Bitmap<64>& map2) { map|= map2.map; }
-  my_bool is_set(uint n) const { return test(map & (((ulonglong)1) << n)); }
-  my_bool is_prefix(uint n) const { return map == (((ulonglong)1) << n)-1; }
-  my_bool is_clear_all() const { return map == (ulonglong)0; }
-  my_bool is_set_all() const { return map == ~(ulonglong)0; }
-  my_bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); }
-  my_bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; }
-  my_bool operator==(const Bitmap<64>& map2) const { return map == map2.map; }
+  bool is_set(uint n) const { return test(map & (((ulonglong)1) << n)); }
+  bool is_prefix(uint n) const { return map == (((ulonglong)1) << n)-1; }
+  bool is_clear_all() const { return map == (ulonglong)0; }
+  bool is_set_all() const { return map == ~(ulonglong)0; }
+  bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); }
+  bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; }
+  bool operator==(const Bitmap<64>& map2) const { return map == map2.map; }
   char *print(char *buf) const { longlong2str(map,buf,16,1); return buf; }
   ulonglong to_ulonglong() const { return map; }
   class Iterator : public Table_map_iterator

=== modified file 'sql/sql_cache.cc'
--- a/sql/sql_cache.cc	2010-01-29 10:42:31 +0000
+++ b/sql/sql_cache.cc	2010-09-23 22:00:32 +0000
@@ -740,7 +740,7 @@ inline void Query_cache_query::lock_writ
   remove it.
 */
 
-my_bool Query_cache_query::try_lock_writing()
+bool Query_cache_query::try_lock_writing()
 {
   DBUG_ENTER("Query_cache_block::try_lock_writing");
   if (rw_trywrlock(&lock)!=0)

=== modified file 'sql/sql_cache.h'
--- a/sql/sql_cache.h	2009-11-20 12:49:06 +0000
+++ b/sql/sql_cache.h	2010-09-23 22:00:32 +0000
@@ -121,7 +121,7 @@ struct Query_cache_block
   block_type type;
   TABLE_COUNTER_TYPE n_tables;			// number of tables in query
 
-  inline my_bool is_free(void) { return type == FREE; }
+  inline bool is_free(void) { return type == FREE; }
   void init(ulong length);
   void destroy();
   inline uint headers_len();
@@ -162,7 +162,7 @@ struct Query_cache_query
   }
   void lock_writing();
   void lock_reading();
-  my_bool try_lock_writing();
+  bool try_lock_writing();
   void unlock_writing();
   void unlock_reading();
 };
@@ -312,7 +312,7 @@ protected:
   
   uint mem_bin_num, mem_bin_steps;		// See at init_cache & find_bin
 
-  my_bool initialized;
+  bool initialized;
 
   /* Exclude/include from cyclic double linked list */
   static void double_linked_list_exclude(Query_cache_block *point,

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2010-08-05 19:56:11 +0000
+++ b/sql/sql_class.h	2010-09-23 22:00:32 +0000
@@ -295,6 +295,9 @@ struct system_variables
     When attempting to access a dynamic variable, if the session version
     is out of date, then the session version is updated and realloced if
     neccessary and bytes copied from global to make up for missing data.
+
+    Note that one should use my_bool instead of bool here, as the variables
+    are used with my_getopt.c
   */
   ulong dynamic_variables_version;
   char* dynamic_variables_ptr;
@@ -1887,7 +1890,7 @@ public:
   bool	     no_warnings_for_error; /* no warnings on call to my_error() */
   /* set during loop of derived table processing */
   bool       derived_tables_processing;
-  my_bool    tablespace_op;	/* This is TRUE in DISCARD/IMPORT TABLESPACE */
+  bool       tablespace_op;	/* This is TRUE in DISCARD/IMPORT TABLESPACE */
 
   sp_rcontext *spcont;		// SP runtime context
   sp_cache   *sp_proc_cache;
@@ -2958,10 +2961,10 @@ class user_var_entry
   Item_result type;
   bool unsigned_flag;
 
-  double val_real(my_bool *null_value);
-  longlong val_int(my_bool *null_value) const;
-  String *val_str(my_bool *null_value, String *str, uint decimals);
-  my_decimal *val_decimal(my_bool *null_value, my_decimal *result);
+  double val_real(bool *null_value);
+  longlong val_int(bool *null_value) const;
+  String *val_str(bool *null_value, String *str, uint decimals);
+  my_decimal *val_decimal(bool *null_value, my_decimal *result);
   DTCollation collation;
 };
 

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2010-08-05 19:56:11 +0000
+++ b/sql/sql_insert.cc	2010-09-23 22:00:32 +0000
@@ -3487,7 +3487,8 @@ static TABLE *create_table_from_items(TH
   tmp_table.s->db_low_byte_first= 
         test(create_info->db_type == myisam_hton ||
              create_info->db_type == heap_hton);
-  tmp_table.null_row=tmp_table.maybe_null=0;
+  tmp_table.null_row= 0;
+  tmp_table.maybe_null= 0;
 
   while ((item=it++))
   {

=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc	2010-08-05 19:56:11 +0000
+++ b/sql/sql_prepare.cc	2010-09-23 22:00:32 +0000
@@ -2185,7 +2185,7 @@ static const char *get_dynamic_sql_strin
                                       lex->prepared_stmt_code.length))
         && entry->value)
     {
-      my_bool is_var_null;
+      bool is_var_null;
       var_value= entry->val_str(&is_var_null, &str, NOT_FIXED_DEC);
       /*
         NULL value of variable checked early as entry->value so here

=== modified file 'sql/table.h'
--- a/sql/table.h	2010-08-05 19:56:11 +0000
+++ b/sql/table.h	2010-09-23 22:00:32 +0000
@@ -793,7 +793,7 @@ struct st_table {
   /* number of select if it is derived table */
   uint          derived_select_number;
   int		current_lock;           /* Type of lock on table */
-  my_bool copy_blobs;			/* copy_blobs when storing */
+  bool copy_blobs;			/* copy_blobs when storing */
 
   /*
     0 or JOIN_TYPE_{LEFT|RIGHT}. Currently this is only compared to 0.
@@ -805,34 +805,34 @@ struct st_table {
     If true, the current table row is considered to have all columns set to 
     NULL, including columns declared as "not null" (see maybe_null).
   */
-  my_bool null_row;
+  bool null_row;
 
   /*
     TODO: Each of the following flags take up 8 bits. They can just as easily
     be put into one single unsigned long and instead of taking up 18
     bytes, it would take up 4.
   */
-  my_bool force_index;
+  bool force_index;
 
   /**
     Flag set when the statement contains FORCE INDEX FOR ORDER BY
     See TABLE_LIST::process_index_hints().
   */
-  my_bool force_index_order;
+  bool force_index_order;
 
   /**
     Flag set when the statement contains FORCE INDEX FOR GROUP BY
     See TABLE_LIST::process_index_hints().
   */
-  my_bool force_index_group;
-  my_bool distinct,const_table,no_rows;
+  bool force_index_group;
+  bool distinct,const_table,no_rows;
 
   /**
      If set, the optimizer has found that row retrieval should access index 
      tree only.
    */
-  my_bool key_read;
-  my_bool no_keyread;
+  bool key_read;
+  bool no_keyread;
   /*
     Placeholder for an open table which prevents other connections
     from taking name-locks on this table. Typically used with
@@ -850,25 +850,25 @@ struct st_table {
     object associated with it (db_stat is always 0), but please do
     not rely on that.
   */
-  my_bool open_placeholder;
-  my_bool locked_by_logger;
-  my_bool no_replicate;
-  my_bool locked_by_name;
-  my_bool fulltext_searched;
-  my_bool no_cache;
+  bool open_placeholder;
+  bool locked_by_logger;
+  bool no_replicate;
+  bool locked_by_name;
+  bool fulltext_searched;
+  bool no_cache;
   /* To signal that the table is associated with a HANDLER statement */
-  my_bool open_by_handler;
+  bool open_by_handler;
   /*
     To indicate that a non-null value of the auto_increment field
     was provided by the user or retrieved from the current record.
     Used only in the MODE_NO_AUTO_VALUE_ON_ZERO mode.
   */
-  my_bool auto_increment_field_not_null;
-  my_bool insert_or_update;             /* Can be used by the handler */
-  my_bool alias_name_used;		/* true if table_name is alias */
-  my_bool get_fields_in_item_tree;      /* Signal to fix_field */
+  bool auto_increment_field_not_null;
+  bool insert_or_update;             /* Can be used by the handler */
+  bool alias_name_used;		/* true if table_name is alias */
+  bool get_fields_in_item_tree;      /* Signal to fix_field */
   /* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */
-  my_bool children_attached;
+  bool children_attached;
 
   REGINFO reginfo;			/* field connections */
   MEM_ROOT mem_root;

=== modified file 'storage/maria/ma_check.c'
--- a/storage/maria/ma_check.c	2010-08-12 16:46:36 +0000
+++ b/storage/maria/ma_check.c	2010-09-23 22:00:32 +0000
@@ -4401,8 +4401,7 @@ int maria_repair_parallel(HA_CHECK *para
         goto err;
       }
     }
-    share->state.state.data_file_length= share->state.state.data_file_length=
-      sort_param->filepos;
+    share->state.state.data_file_length= sort_param->filepos;
     /* Only whole records */
     share->state.version= (ulong) time((time_t*) 0);
     /*

=== modified file 'strings/decimal.c'
--- a/strings/decimal.c	2010-08-02 09:01:24 +0000
+++ b/strings/decimal.c	2010-09-23 22:00:32 +0000
@@ -346,7 +346,7 @@ int decimal2string(decimal_t *from, char
   char *s=to;
   dec1 *buf, *buf0=from->buf, tmp;
 
-  DBUG_ASSERT(*to_len >= 2+from->sign);
+  DBUG_ASSERT(*to_len >= 2+ (int) from->sign);
 
   /* removing leading zeroes */
   buf0= remove_leading_zeroes(from, &intg);
@@ -1801,7 +1801,8 @@ static int do_sub(decimal_t *from1, deci
   int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg),
       frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac);
   int frac0=max(frac1, frac2), error;
-  dec1 *buf1, *buf2, *buf0, *stop1, *stop2, *start1, *start2, carry=0;
+  dec1 *buf1, *buf2, *buf0, *stop1, *stop2, *start1, *start2;
+  my_bool carry=0;
 
   /* let carry:=1 if from2 > from1 */
   start1=buf1=from1->buf; stop1=buf1+intg1;
@@ -1869,7 +1870,7 @@ static int do_sub(decimal_t *from1, deci
     swap_variables(dec1 *,start1, start2);
     swap_variables(int,intg1,intg2);
     swap_variables(int,frac1,frac2);
-    to->sign= 1 - to->sign;
+    to->sign= !to->sign;
   }
 
   FIX_INTG_FRAC_ERROR(to->len, intg1, frac0, error);



More information about the commits mailing list