From e12f1a44537074aef095fa1f75a5af6ea367c9c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Mar 2005 22:17:11 +0200 Subject: [PATCH 1/8] ndb - CSC#4927: ordered index + long pk, second half ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: ACC_LOCKREQ - element may have moved after lock request was made --- ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index a124e15eea4..c6d4e6af4d4 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -2522,6 +2522,26 @@ void Dbacc::execACC_LOCKREQ(Signal* signal) *sig = *req; return; } + operationRecPtr.i = req->accOpPtr; + ptrCheckGuard(operationRecPtr, coprecsize, operationrec); + fragrecptr.i = operationRecPtr.p->fragptr; + ptrCheckGuard(fragrecptr, cfragmentsize, fragmentrec); + if (fragrecptr.p->keyLength == 0 && + // should test some state variable + operationRecPtr.p->elementPage != RNIL) { + jam(); + // re-compute long key vars + Page8Ptr tPageptr; + tPageptr.i = operationRecPtr.p->elementPage; + ptrCheckGuard(tPageptr, cpagesize, page8); + Uint32 tKeyptr = + operationRecPtr.p->elementPointer + + operationRecPtr.p->elementIsforward * + (ZELEM_HEAD_SIZE + fragrecptr.p->localkeylen); + tslcPageIndex = tPageptr.p->word32[tKeyptr] & 0x3ff; + tslcPagedir = tPageptr.p->word32[tKeyptr] >> 10; + searchLongKey(signal, false); + } if (lockOp == AccLockReq::Unlock) { jam(); // do unlock via ACC_COMMITREQ (immediate) From f485db429a26666a8468c1ec1227d6bd64a45682 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 31 Mar 2005 03:44:51 +0400 Subject: [PATCH 2/8] A fix for Bug#9443 "mysql_client_test fails on linux and some solaris platforms": yet another issue with floating pointer comparisons. The fix uses the workaround with volatiles. sql/item_cmpfunc.cc: A fix for the failing mysql_client_test on some Intel platforms when compiled with optimization. We don't use -ffloat-store compileation as it may slow all floating point operations. --- sql/item_cmpfunc.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 690da1be18c..8498ab4800e 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -393,10 +393,16 @@ int Arg_comparator::compare_e_binary_string() int Arg_comparator::compare_real() { - double val1= (*a)->val(); + /* + Fix yet another manifestation of Bug#2338. 'Volatile' will instruct + gcc to flush double values out of 80-bit Intel FPU registers before + performing the comparison. + */ + volatile double val1, val2; + val1= (*a)->val(); if (!(*a)->null_value) { - double val2= (*b)->val(); + val2= (*b)->val(); if (!(*b)->null_value) { owner->null_value= 0; From dbbe069019f25bb93de43f3d966c642c1af82e2f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 31 Mar 2005 14:25:03 +0400 Subject: [PATCH 3/8] Bug #9507 /etc/init.d/mysql script does not stop mysqld correctly wait_for_pid function is fixed to wait for pid removal in "stop". recomitted with post-review fix support-files/mysql.server.sh: wait_for_pid function corrected to work properly with start/stop --- support-files/mysql.server.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index aafd3f8f187..376d9051b10 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -90,7 +90,18 @@ wait_for_pid () { i=0 while test $i -lt 35 ; do sleep 1 - test -s $pid_file && i='' && break + case "$1" in + 'created') + test -s $pid_file && i='' && break + ;; + 'removed') + test ! -s $pid_file && i='' && break + ;; + *) + echo "wait_for_pid () usage: wait_for_pid created|removed" + exit 1 + ;; + esac echo $echo_n ".$echo_c" i=`expr $i + 1` done @@ -180,7 +191,7 @@ case "$mode" in # be overwritten at next upgrade. echo $echo_n "Starting MySQL" $bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file >/dev/null 2>&1 & - wait_for_pid + wait_for_pid created # Make lock for RedHat / SuSE if test -w /var/lock/subsys @@ -201,7 +212,7 @@ case "$mode" in echo $echo_n "Shutting down MySQL" kill $mysqld_pid # mysqld should remove the pid_file when it exits, so wait for it. - wait_for_pid + wait_for_pid removed # delete lock for RedHat / SuSE if test -f /var/lock/subsys/mysql From b75aa53e61f99eed28964f8c40e52bf46a372a70 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 31 Mar 2005 14:31:06 +0200 Subject: [PATCH 4/8] Removed warnings --- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index b1e573e1cc8..0b8e1910850 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -2227,7 +2227,6 @@ void Dbdict::checkSchemaStatus(Signal* signal) restartCreateTab(signal, tableId, oldEntry, false); return; }//if - ndbrequire(ok); break; } } @@ -2452,7 +2451,9 @@ Dbdict::restartCreateTab_writeTableConf(Signal* signal, callback.m_callbackFunction = safe_cast(&Dbdict::restartCreateTab_dihComplete); - SegmentedSectionPtr fragDataPtr; fragDataPtr.setNull(); + SegmentedSectionPtr fragDataPtr; + fragDataPtr.sz = 0; + fragDataPtr.setNull(); createTab_dih(signal, createTabPtr, fragDataPtr, &callback); } From 26bb934313de62ca2e2d55fd460c117c6f7a83e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 31 Mar 2005 20:23:10 +0400 Subject: [PATCH 5/8] Make the tests deterministic: change DELETE ... LIMIT to DELETE ... ORDER BY ... LIMIT --- mysql-test/r/group_by.result | 2 +- mysql-test/t/group_by.test | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index e4904bb7a04..a8766907fa5 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -693,7 +693,7 @@ concat('val-', x3.a + 3*x4.a), -- 12 concat('val-', @a:=x3.a + 3*x4.a + 12*C.a), -- 120 concat('val-', @a + 120*D.a) from t1 x3, t1 x4, t1 C, t1 D where x3.a < 3 and x4.a < 4 and D.a < 4; -delete from t2 where a = 2 and b = 'val-2' limit 30; +delete from t2 where a = 2 and b = 'val-2' order by a,b,c,d limit 30; explain select c from t2 where a = 2 and b = 'val-2' group by c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref PRIMARY,a PRIMARY 400 const,const 6 Using where diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 327be1b724b..46e58cd00fd 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -508,7 +508,8 @@ insert into t2 select concat('val-', @a:=x3.a + 3*x4.a + 12*C.a), -- 120 concat('val-', @a + 120*D.a) from t1 x3, t1 x4, t1 C, t1 D where x3.a < 3 and x4.a < 4 and D.a < 4; -delete from t2 where a = 2 and b = 'val-2' limit 30; + +delete from t2 where a = 2 and b = 'val-2' order by a,b,c,d limit 30; explain select c from t2 where a = 2 and b = 'val-2' group by c; select c from t2 where a = 2 and b = 'val-2' group by c; From 181205f0327bcbdf047b78d5e1f1be3b6d36be0b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 31 Mar 2005 19:18:50 +0200 Subject: [PATCH 6/8] Fixed so no merge conflict with 5.0 ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Fixed so no merge conflict with --- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 0b8e1910850..7247b7e2b9c 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -2227,8 +2227,9 @@ void Dbdict::checkSchemaStatus(Signal* signal) restartCreateTab(signal, tableId, oldEntry, false); return; }//if - break; } + ndbrequire(ok); + break; } case SchemaFile::DROP_TABLE_STARTED: jam(); From 2547464488f5ba1a2b4bbb80671a8e1ea20a66ad Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 31 Mar 2005 20:27:29 +0200 Subject: [PATCH 7/8] include sql/examples in the window source distribution --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 036ed6fcc93..a003e52196e 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -251,7 +251,7 @@ copy_dir_dirs() { for i in client dbug extra heap include isam \ libmysql libmysqld merge myisam \ - myisammrg mysys regex sql strings sql-common \ + myisammrg mysys regex sql strings sql-common sql/examples \ tools vio zlib do copy_dir_files $i From 8ef1afbaa4ba0c639f2ecf47853086e783cc1efa Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Apr 2005 11:05:17 +0400 Subject: [PATCH 8/8] Better comment --- sql/sql_select.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 57b09fa40b4..3c66574231d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7179,8 +7179,9 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, /* We'll use ref access method on key new_ref_key. In general case the index search tuple for new_ref_key will be different (e.g. - when one of the indexes only covers prefix of the field, see - BUG#9213 in group_by.test). + when one index is defined as (part1, part2, ...) and another as + (part1, part2(N), ...) and the WHERE clause contains + "part1 = const1 AND part2=const2". So we build tab->ref from scratch here. */ KEYUSE *keyuse= tab->keyuse;