diff options
author | Michael Widenius <monty@askmonty.org> | 2010-09-24 01:00:32 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-09-24 01:00:32 +0300 |
commit | bdba1d11c4f3f2b1e2fe391a036ecdb703b8812f (patch) | |
tree | b54e4613c0d8d7838a6b6dddcc7e37d4f988f78b /sql/field.cc | |
parent | 5ce4825b63997f6db76a12b0f764d175734699fb (diff) | |
download | mariadb-git-bdba1d11c4f3f2b1e2fe391a036ecdb703b8812f.tar.gz |
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
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.
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/field.cc b/sql/field.cc index 62c7d31367d..446e88ab0cb 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1284,7 +1284,7 @@ static bool test_if_real(const char *str,int length, CHARSET_INFO *cs) 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(uchar *metadata_ptr) */ 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 *a, const uchar *b, uint length, */ 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 uchar *from, 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 uchar *a, const uchar *b, 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 *to, /* 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, const uchar *b, uint key_length_arg, 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; |