summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com/narttu.mysql.fi>2006-11-30 18:25:05 +0200
committerunknown <monty@mysql.com/narttu.mysql.fi>2006-11-30 18:25:05 +0200
commit7191e775394db0392b78b07e2662c766eeace59c (patch)
tree66e16346c4fdfa20f915fdf53ea1f9419c07331c /sql/field.cc
parent42fd48da99b2ba2641697ebb567af555fb270e9e (diff)
downloadmariadb-git-7191e775394db0392b78b07e2662c766eeace59c.tar.gz
Fixed portability issue in my_thr_init.c (was added in my last push)
Fixed compiler warnings (detected by VC++): - Removed not used variables - Added casts - Fixed wrong assignments to bool - Fixed wrong calls with bool arguments - Added missing argument to store(longlong), which caused wrong store method to be called. client/mysqldump.c: Removed compiler warning heap/hp_clear.c: Removed compiler warning include/my_global.h: Removed compiler warning include/my_tree.h: Changed memory limits from int to ulong (Allowed me to get rid of some compiler warnings) myisam/mi_create.c: Removed compiler warning myisam/myisampack.c: Removed compiler warning mysys/base64.c: Removed compiler warning mysys/my_thr_init.c: Fixed portability issue (detected on windows) Added DBUG_ASSERT to detect if we call my_thread_end() too many times Don't wait if THR_thread_count == -1 (error condition) mysys/tree.c: Removed compiler warning sql/field.cc: Removed compiler warning Fixed wrong parameter to check_date() Added missing argument to store(longlong) sql/ha_archive.cc: Removed compiler warning sql/ha_federated.cc: Removed compiler warning sql/ha_innodb.cc: Removed not used variable sql/handler.cc: Removed not used variable Fixed wrong if (we didn't detect if rollback or commit failed). Not critical as value is not yet used sql/item.cc: Removed compiler warning sql/item_func.cc: Removed compiler warning sql/item_strfunc.cc: Removed compiler warning sql/item_timefunc.cc: Removed compiler warning sql/log.cc: Removed compiler warning sql/mysql_priv.h: Removed compiler warning sql/opt_range.cc: Removed compiler warning sql/password.c: Removed compiler warning sql/set_var.cc: Removed compiler warning sql/slave.cc: Removed compiler warning sql/sp.cc: Removed compiler warning sql/sp_cache.cc: Removed compiler warning sql/sp_head.cc: Removed compiler warning Adjusted argument to reserve() to not use up too much memory that we are probably not going to need sql/sql_acl.cc: Added missing argument to store(longlong) sql/sql_base.cc: Removed compiler warning sql/sql_db.cc: Removed compiler warning sql/sql_delete.cc: Removed compiler warning sql/sql_handler.cc: Removed not used variable sql/sql_lex.h: Removed not used variable sql/sql_prepare.cc: Removed not used variable sql/sql_rename.cc: Removed not used variable sql/sql_select.cc: Fixed that select_options are not 'cut' Removed some not used variables Removed compiler warnings by adding cast sql/sql_show.cc: Removed not used variables Added missing argument to store(longlong) Removed compiler warnings sql/sql_trigger.cc: Removed not used variables Added cast to remove compiler warnings sql/sql_update.cc: Fixed wrong set of bool variable sql/sql_view.cc: Removed not used variables Added cast to get rid of compiler warnings sql-common/client.c: Fixed compiler warning sql-common/my_time.c: Fixed wrong argument to check_date() Added casts to get rid of compiler warnings sql/sql_yacc.yy: Removed not used variable sql/uniques.cc: Changes memory size from uint to ulong Added casts to get rid of compiler warnings strings/ctype-simple.c: Fixed cast to get rid of compiler warnings
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 1cfd0843179..e0b97e80ed4 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -4813,7 +4813,7 @@ int Field_time::store_time(TIME *ltime, timestamp_type type)
(ltime->minute * 100 + ltime->second);
if (ltime->neg)
tmp= -tmp;
- return Field_time::store((longlong) tmp);
+ return Field_time::store((longlong) tmp, FALSE);
}
@@ -5409,11 +5409,11 @@ int Field_newdate::store_time(TIME *ltime,timestamp_type type)
if (type == MYSQL_TIMESTAMP_DATE || type == MYSQL_TIMESTAMP_DATETIME)
{
tmp=ltime->year*16*32+ltime->month*32+ltime->day;
- if ((my_bool)check_date(ltime, tmp,
- (TIME_FUZZY_DATE |
- (current_thd->variables.sql_mode &
- (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
- MODE_INVALID_DATES))), &error))
+ if (check_date(ltime, tmp != 0,
+ (TIME_FUZZY_DATE |
+ (current_thd->variables.sql_mode &
+ (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
+ MODE_INVALID_DATES))), &error))
{
char buff[12];
String str(buff, sizeof(buff), &my_charset_latin1);
@@ -5633,11 +5633,11 @@ int Field_datetime::store_time(TIME *ltime,timestamp_type type)
{
tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*LL(1000000)+
(ltime->hour*10000L+ltime->minute*100+ltime->second));
- if ((my_bool)check_date(ltime, tmp,
- (TIME_FUZZY_DATE |
- (current_thd->variables.sql_mode &
- (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
- MODE_INVALID_DATES))), &error))
+ if (check_date(ltime, tmp != 0,
+ (TIME_FUZZY_DATE |
+ (current_thd->variables.sql_mode &
+ (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
+ MODE_INVALID_DATES))), &error))
{
char buff[19];
String str(buff, sizeof(buff), &my_charset_latin1);
@@ -8076,7 +8076,7 @@ int Field_bit::store_decimal(const my_decimal *val)
{
int err= 0;
longlong i= convert_decimal2longlong(val, 1, &err);
- return test(err | store(i));
+ return test(err | store(i, TRUE));
}
@@ -8229,7 +8229,7 @@ Field_bit_as_char::Field_bit_as_char(char *ptr_arg, uint32 len_arg,
int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs)
{
int delta;
- uchar bits= field_length & 7;
+ uchar bits= (uchar) (field_length & 7);
for (; length && !*from; from++, length--); // skip left 0's
delta= bytes_in_rec - length;