From 92d6bdc1b6e21cf68091c9d8c56925dcab04d19a Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Tue, 11 Feb 2003 23:19:47 +0100 Subject: backporting Peter's fix for better RAND() initialization from 4.0 --- sql/sql_class.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index eada94e3d40..319bc87ad8d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -156,7 +156,7 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0), */ { pthread_mutex_lock(&LOCK_thread_count); - ulong tmp=(ulong) (rnd(&sql_rand) * 3000000); + ulong tmp=(ulong) (rnd(&sql_rand) * ((ulong)~0L)); randominit(&rand, tmp + (ulong) start_time, tmp + (ulong) thread_id); pthread_mutex_unlock(&LOCK_thread_count); -- cgit v1.2.1 From 9dd13a9a4ad7ccc134445d1c52643b8408092222 Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Wed, 12 Feb 2003 11:03:41 +0100 Subject: backported MERGE+MAX bugfix from 4.0 --- sql/opt_sum.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index b88cfb4e073..9385e993859 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -165,10 +165,9 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) error=table->file->index_last(table->record[0]) !=0; else { - (void) table->file->index_read(table->record[0], key_buff, - ref.key_length, - HA_READ_AFTER_KEY); - error=table->file->index_prev(table->record[0]) || + error = table->file->index_read(table->record[0], key_buff, + ref.key_length, + HA_READ_PREFIX_LAST) || key_cmp(table,key_buff,ref.key,ref.key_length); } if (table->key_read) -- cgit v1.2.1