From ecffc1b83c45c3a804c0d7abc586c448365043cc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 16:47:08 +0300 Subject: Several fixes revelaled by Intel compiler. cmd-line-utils/readline/complete.c: Added a cast. dbug/my_main.c: Added an include to avoid implicit declaration of my_thread_global_init() include/my_global.h: undef cannot be used on this predefined name. Since it is a custom fix for gcc 2.8.0, let's make it only effective in that case. include/my_sys.h: Added a new type, TYPE_NOT_SET. myisam/ft_boolean_search.c: Added casts. myisam/mi_key.c: Added cast. myisam/mi_open.c: Added cast. Changed function types. myisam/mi_test1.c: Added cast. myisam/myisamchk.c: Added cast. myisam/myisamdef.h: Changed function type. myisam/myisampack.c: Added casts. myisam/sp_key.c: Added cast. mysys/mf_iocache.c: Fixed invalid use of 0 to info->type. According to comment it should not have been set, but in earlier code by setting it to 0 would have been same as setting it to READ_CACHE. This probably was not desired, potential bug. server-tools/instance-manager/instance_options.cc: Fixed a typo. server-tools/instance-manager/protocol.cc: Changed enum to int. Changed char to uchar. Added casts. sql/mysql_priv.h: Bit overflow. sql/sql_base.cc: Removed unused label. The code below label was unused too, because there is a return just before. sql/sql_parse.cc: Removed unneccessary extra argument. --- sql/mysql_priv.h | 2 +- sql/sql_base.cc | 3 --- sql/sql_parse.cc | 3 +-- 3 files changed, 2 insertions(+), 6 deletions(-) (limited to 'sql') diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index fc7bac89274..7e598543a38 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -284,7 +284,7 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; /* Flag set if setup_tables already done */ #define OPTION_SETUP_TABLES_DONE (1L << 30) // intern /* If not set then the thread will ignore all warnings with level notes. */ -#define OPTION_SQL_NOTES (1L << 31) // THD, user +#define OPTION_SQL_NOTES (1UL << 31) // THD, user /* Force the used temporary table to be a MyISAM table (because we will use fulltext functions when reading from it. diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 16842c4969c..745d4070a05 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4791,9 +4791,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves, } DBUG_RETURN(test(thd->net.report_error)); -err: - if (arena) - thd->restore_active_arena(arena, &backup); err_no_arena: DBUG_RETURN(1); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ff3d56266f6..b5c251df89e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5644,8 +5644,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, and so on, the display width is ignored. */ char buf[32]; - my_snprintf(buf, sizeof(buf), - "TIMESTAMP(%s)", length, system_charset_info); + my_snprintf(buf, sizeof(buf), "TIMESTAMP(%s)", length); push_warning_printf(thd,MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX), -- cgit v1.2.1 From ab0d7e2ace7d8cb42835e8194da648ede1e03b14 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 21:28:56 +0300 Subject: Some minor fixes revealed as warnings by Intel compiler. client/mysqltest.c: Fixed a warning from using reference to a memory area, which is outside an object. This is just a minor clean-up, not a bug fix. server-tools/instance-manager/buffer.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/buffer.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/command.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/command.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/guardian.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/guardian.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance_map.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance_map.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance_options.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance_options.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/listener.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/listener.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/mysql_connection.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/mysql_connection.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/options.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/options.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/parse_output.cc: Removed unused goto. server-tools/instance-manager/thread_registry.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/thread_registry.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/user_map.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/user_map.h: Fixed pragma warning for those compilers that do not support it. sql/field.cc: Fixed a warning about overflow. sql/item.h: Fixed implicit function declaration warning. sql/item_sum.cc: Fixed implicit function declaration warning. --- sql/field.cc | 2 +- sql/item.h | 3 +++ sql/item_sum.cc | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/field.cc b/sql/field.cc index e8731cb0ea5..eeff2ec9881 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -3438,7 +3438,7 @@ int Field_long::store(longlong nr, bool unsigned_val) else { if (nr < 0 && unsigned_val) - nr= INT_MAX32+1; // Generate overflow + nr= ((longlong) INT_MAX32) + 1; // Generate overflow if (nr < (longlong) INT_MIN32) { res=(int32) INT_MIN32; diff --git a/sql/item.h b/sql/item.h index 381ba98e193..dfe36d6d2ec 100644 --- a/sql/item.h +++ b/sql/item.h @@ -164,6 +164,7 @@ struct Hybrid_type_traits virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const; virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const; static const Hybrid_type_traits *instance(); + Hybrid_type_traits() {}; }; @@ -185,6 +186,7 @@ struct Hybrid_type_traits_decimal: public Hybrid_type_traits { return &val->dec_buf[val->used_dec_buf_no]; } virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const; static const Hybrid_type_traits_decimal *instance(); + Hybrid_type_traits_decimal() {}; }; @@ -215,6 +217,7 @@ struct Hybrid_type_traits_integer: public Hybrid_type_traits virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const { buf->set(val->integer, &my_charset_bin); return buf;} static const Hybrid_type_traits_integer *instance(); + Hybrid_type_traits_integer() {}; }; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 880ab4c8cb1..1bbfef40f4f 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -545,6 +545,7 @@ struct Hybrid_type_traits_fast_decimal: public val->traits->div(val, u); } static const Hybrid_type_traits_fast_decimal *instance(); + Hybrid_type_traits_fast_decimal() {}; }; static const Hybrid_type_traits_fast_decimal fast_decimal_traits_instance; -- cgit v1.2.1