From c88b91020866b1505404157c76c56cbb92410ec5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Nov 2002 03:54:00 +0200 Subject: Portability fixes for Fortre C++ 5.0 (on Sun) in 32 and 64 bit modes. client/mysqlbinlog.cc: Portability fix configure.in: Added use of ASFLAGS (For Solaris with Forte 5.0) include/my_global.h: Portability fix include/myisam.h: Portability fix include/queues.h: Portability fix innobase/include/ut0ut.h: Portability fix innobase/log/log0log.c: Portability fix innobase/rem/rem0cmp.c: Portability fix innobase/trx/trx0sys.c: Portability fix isam/pack_isam.c: Portability fix myisam/ft_boolean_search.c: Portability fix myisam/mi_dynrec.c: Code change to go around bug in Forte 5.0 myisam/sort.c: Portability fix mysys/my_aes.c: Portability fix scripts/Makefile.am: Support for ASFLAGS scripts/mysqlbug.sh: Support for ASFLAGS sql/field.cc: Portability fix sql/filesort.cc: Portability fix sql/gen_lex_hash.cc: Portability fix sql/ha_innodb.cc: Portability fix Changed SHOW INNODB STATUS to return error instead of writing message to log file. sql/ha_isammrg.cc: Portability fix sql/ha_myisam.cc: Portability fix sql/ha_myisammrg.cc: Portability fix sql/hash_filo.h: Portability fix sql/hostname.cc: Portability fix sql/item_cmpfunc.h: Indentation change sql/item_func.cc: Portability fix sql/item_func.h: Portability fix sql/log.cc: Portability fix sql/log_event.cc: Portability fix sql/mysql_priv.h: Portability fix sql/mysqld.cc: Portability fix Fixed bug with rpl_recovery_rank command line option on 64 bit systems sql/opt_range.cc: Portability fix sql/repl_failsafe.cc: Portability fix sql/slave.cc: Portability fix sql/slave.h: Portability fix sql/sql_acl.cc: Portability fix sql/sql_base.cc: Portability fix sql/sql_cache.cc: Portability fix sql/sql_cache.h: Portability fix sql/sql_class.cc: Portability fix sql/sql_delete.cc: Portability fix sql/sql_insert.cc: Portability fix sql/sql_manager.cc: Portability fix sql/sql_parse.cc: Portability fix BUILD/compile-solaris-sparc-forte: C sql/sql_udf.cc: Portability fix sql/sql_update.cc: Portability fix strings/Makefile.am: Portability fix strings/bmove_upp-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/str_test.c: Cleanup strings/strappend-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strend-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strmake-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strmov-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strnmov-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strstr-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strxmov-sparc.s: Fixes to make this more portable, but it's still not usable on 64 bit systems :( BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- sql/item_func.cc | 63 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) (limited to 'sql/item_func.cc') diff --git a/sql/item_func.cc b/sql/item_func.cc index 7da5435276d..48b11efcace 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -711,13 +711,14 @@ double Item_func_rand::val() } else if (!thd->rand_used) { - // no need to send a Rand log event if seed was given eg: RAND(seed), - // as it will be replicated in the query as such. - - // save the seed only the first time RAND() is used in the query - - // once events are forwarded rather than recreated, - // the following can be skipped if inside the slave thread + /* + No need to send a Rand log event if seed was given eg: RAND(seed), + as it will be replicated in the query as such. + + Save the seed only the first time RAND() is used in the query + Once events are forwarded rather than recreated, + the following can be skipped if inside the slave thread + */ thd->rand_used=1; thd->rand_saved_seed1=thd->rand.seed1; thd->rand_saved_seed2=thd->rand.seed2; @@ -1957,13 +1958,13 @@ void Item_func_set_user_var::print(String *str) user_var_entry *Item_func_get_user_var::get_entry() { - if (!entry || ! entry->value) + if (!var_entry || ! var_entry->value) { null_value=1; return 0; } null_value=0; - return entry; + return var_entry; } @@ -2032,8 +2033,8 @@ void Item_func_get_user_var::fix_length_and_dec() maybe_null=1; decimals=NOT_FIXED_DEC; max_length=MAX_BLOB_WIDTH; - if ((entry= get_variable(&thd->user_vars, name, 0))) - const_var_flag= thd->query_id != entry->update_query_id; + if ((var_entry= get_variable(&thd->user_vars, name, 0))) + const_var_flag= thd->query_id != var_entry->update_query_id; } @@ -2208,18 +2209,18 @@ bool Item_func_match::fix_index() { List_iterator_fast li(fields); Item_field *item; - uint ft_to_key[MAX_KEY], ft_cnt[MAX_KEY], fts=0, key; + uint ft_to_key[MAX_KEY], ft_cnt[MAX_KEY], fts=0, keynr; uint max_cnt=0, mkeys=0; - if (this->key == NO_SUCH_KEY) + if (key == NO_SUCH_KEY) return 0; - for (key=0 ; keykeys ; key++) + for (keynr=0 ; keynr < table->keys ; keynr++) { - if ((table->key_info[key].flags & HA_FULLTEXT) && - (table->keys_in_use_for_query & (((key_map)1) << key))) + if ((table->key_info[keynr].flags & HA_FULLTEXT) && + (table->keys_in_use_for_query & (((key_map)1) << keynr))) { - ft_to_key[fts]=key; + ft_to_key[fts]=keynr; ft_cnt[fts]=0; fts++; } @@ -2230,45 +2231,45 @@ bool Item_func_match::fix_index() while ((item=(Item_field*)(li++))) { - for (key=0 ; keykey_info[ft_to_key[key]]; + KEY *ft_key=&table->key_info[ft_to_key[keynr]]; uint key_parts=ft_key->key_parts; for (uint part=0 ; part < key_parts ; part++) { if (item->field->eq(ft_key->key_part[part].field)) - ft_cnt[key]++; + ft_cnt[keynr]++; } } } - for (key=0 ; key max_cnt) + if (ft_cnt[keynr] > max_cnt) { mkeys=0; - max_cnt=ft_cnt[mkeys]=ft_cnt[key]; - ft_to_key[mkeys]=ft_to_key[key]; + max_cnt=ft_cnt[mkeys]=ft_cnt[keynr]; + ft_to_key[mkeys]=ft_to_key[keynr]; continue; } - if (max_cnt && ft_cnt[key] == max_cnt) + if (max_cnt && ft_cnt[keynr] == max_cnt) { mkeys++; - ft_cnt[mkeys]=ft_cnt[key]; - ft_to_key[mkeys]=ft_to_key[key]; + ft_cnt[mkeys]=ft_cnt[keynr]; + ft_to_key[mkeys]=ft_to_key[keynr]; continue; } } - for (key=0 ; key<=mkeys ; key++) + for (keynr=0 ; keynr <= mkeys ; keynr++) { // for now, partial keys won't work. SerG if (max_cnt < fields.elements || - max_cnt < table->key_info[ft_to_key[key]].key_parts) + max_cnt < table->key_info[ft_to_key[keynr]].key_parts) continue; - this->key=ft_to_key[key]; + key=ft_to_key[keynr]; return 0; } @@ -2276,7 +2277,7 @@ bool Item_func_match::fix_index() err: if (mode == FT_BOOL) { - this->key=NO_SUCH_KEY; + key=NO_SUCH_KEY; return 0; } my_printf_error(ER_FT_MATCHING_KEY_NOT_FOUND, -- cgit v1.2.1