From 99d3926318dd03df6316a43a595d53b4ae4f40b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Nov 2006 14:04:20 +0100 Subject: [PATCH 01/21] ndb - bug#24447 api disconnect just after SCAN_TABREQ ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: 1) add error insert for faking DISCONNECT of API just after SCAN_TABREQ 2) handle error :-) ndb/test/ndbapi/testScan.cpp: Add etstcase for bug 24447 ndb/test/run-test/daily-basic-tests.txt: Add etstcase for bug 24447 --- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 38 +++++++++++++++++++++-- ndb/test/ndbapi/testScan.cpp | 41 ++++++++++++++++++++++++- ndb/test/run-test/daily-basic-tests.txt | 4 +++ 3 files changed, 80 insertions(+), 3 deletions(-) diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 59e6bd35baf..cdab0635dce 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -8619,6 +8619,20 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) * IF ANY TO RECEIVE. **********************************************************/ scanptr.p->scanState = ScanRecord::WAIT_AI; + + if (ERROR_INSERTED(8038)) + { + /** + * Force API_FAILREQ + */ + DisconnectRep * const rep = (DisconnectRep *)signal->getDataPtrSend(); + rep->nodeId = refToNode(apiConnectptr.p->ndbapiBlockref); + rep->err = 8038; + + EXECUTE_DIRECT(CMVMI, GSN_DISCONNECT_REP, signal, 2); + CLEAR_ERROR_INSERT_VALUE; + } + return; SCAN_error_check: @@ -8706,6 +8720,7 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr, jam(); ScanFragRecPtr ptr; ndbrequire(list.seize(ptr)); + ptr.p->scanFragState = ScanFragRec::IDLE; ptr.p->scanRec = scanptr.i; ptr.p->scanFragId = 0; ptr.p->m_apiPtr = cdata[i]; @@ -9457,9 +9472,17 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){ ScanRecord* scanP = scanPtr.p; ndbrequire(scanPtr.p->scanState != ScanRecord::IDLE); + ScanRecord::ScanState old = scanPtr.p->scanState; scanPtr.p->scanState = ScanRecord::CLOSING_SCAN; scanPtr.p->m_close_scan_req = req_received; + if (old == ScanRecord::WAIT_FRAGMENT_COUNT) + { + jam(); + scanPtr.p->scanState = old; + return; // Will continue on execDI_FCOUNTCONF + } + /** * Queue : Action * ============= : ================= @@ -9487,11 +9510,22 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){ ScanFragRecPtr curr = ptr; // Remove while iterating... running.next(ptr); - if(curr.p->scanFragState == ScanFragRec::WAIT_GET_PRIMCONF){ + switch(curr.p->scanFragState){ + case ScanFragRec::IDLE: + jam(); // real early abort + ndbrequire(old == ScanRecord::WAIT_AI); + running.release(curr); + continue; + case ScanFragRec::WAIT_GET_PRIMCONF: jam(); continue; + case ScanFragRec::LQH_ACTIVE: + jam(); + break; + default: + jamLine(curr.p->scanFragState); + ndbrequire(false); } - ndbrequire(curr.p->scanFragState == ScanFragRec::LQH_ACTIVE); curr.p->startFragTimer(ctcTimer); curr.p->scanFragState = ScanFragRec::LQH_ACTIVE; diff --git a/ndb/test/ndbapi/testScan.cpp b/ndb/test/ndbapi/testScan.cpp index f1018d29846..e228c9c0bd1 100644 --- a/ndb/test/ndbapi/testScan.cpp +++ b/ndb/test/ndbapi/testScan.cpp @@ -622,7 +622,7 @@ int runRestarter(NDBT_Context* ctx, NDBT_Step* step){ int nodeId = restarter.getDbNodeId(lastId); lastId = (lastId + 1) % restarter.getNumDbNodes(); - if(restarter.restartOneDbNode(nodeId) != 0){ + if(restarter.restartOneDbNode(nodeId, false, false, true) != 0){ g_err << "Failed to restartNextDbNode" << endl; result = NDBT_FAILED; break; @@ -1080,6 +1080,39 @@ int runScanRestart(NDBT_Context* ctx, NDBT_Step* step){ } +int +runBug24447(NDBT_Context* ctx, NDBT_Step* step){ + int loops = 1; //ctx->getNumLoops(); + int records = ctx->getNumRecords(); + int abort = ctx->getProperty("AbortProb", 15); + NdbRestarter restarter; + HugoTransactions hugoTrans(*ctx->getTab()); + int i = 0; + while (iisTestStopped()) + { + g_info << i++ << ": "; + + int nodeId = restarter.getRandomNotMasterNodeId(rand()); + if (nodeId == -1) + nodeId = restarter.getMasterNodeId(); + if (restarter.insertErrorInNode(nodeId, 8038) != 0) + { + ndbout << "Could not insert error in node="< Date: Tue, 21 Nov 2006 14:06:20 +0100 Subject: [PATCH 02/21] ndb - update error code list (for bug#24447) ndb/src/kernel/blocks/ERROR_codes.txt: ndb - update error code list --- ndb/src/kernel/blocks/ERROR_codes.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt index 874c128a56d..a1472cf8376 100644 --- a/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/ndb/src/kernel/blocks/ERROR_codes.txt @@ -6,7 +6,7 @@ Next DBTUP 4014 Next DBLQH 5043 Next DBDICT 6006 Next DBDIH 7178 -Next DBTC 8038 +Next DBTC 8039 Next CMVMI 9000 Next BACKUP 10022 Next DBUTIL 11002 @@ -285,6 +285,11 @@ ABORT OF TCKEYREQ 8037 : Invalid schema version in TCINDXREQ +------ + +8038 : Simulate API disconnect just after SCAN_TAB_REQ + + CMVMI ----- 9000 Set RestartOnErrorInsert to restart -n From 9e9f5fc2ce5ec25bb968c54c5b846ca01055a428 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Nov 2006 14:05:40 +0100 Subject: [PATCH 03/21] ndb - bug#24461 - LockPagesInMemory ignored actually do run mlockall ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: actually do run mlockall --- ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index f9290a75afb..fde73b4e22a 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -330,9 +330,6 @@ void Cmvmi::execSTTOR(Signal* signal) signal->theData[2] = NodeInfo::REP; execOPEN_COMREQ(signal); globalData.theStartLevel = NodeState::SL_STARTED; - sendSTTORRY(signal); - } else { - jam(); if(theConfig.lockPagesInMainMemory()){ int res = NdbMem_MemLockAll(); @@ -341,7 +338,6 @@ void Cmvmi::execSTTOR(Signal* signal) warningEvent("Failed to memlock pages"); } } - sendSTTORRY(signal); } } From 55640f608db5813f381913cb541fec989ac708f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Nov 2006 14:13:32 +0100 Subject: [PATCH 04/21] ndb - bug#24461 m ove mlock to much earlier in startphases not to affect heartbeats ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: move mlock to much earlier in startphases not to affect heartbeats --- ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index fde73b4e22a..6519444c364 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -311,6 +311,16 @@ void Cmvmi::execSTTOR(Signal* signal) jamEntry(); if (theStartPhase == 1){ jam(); + + if(theConfig.lockPagesInMainMemory()) + { + int res = NdbMem_MemLockAll(); + if(res != 0){ + g_eventLogger.warning("Failed to memlock pages"); + warningEvent("Failed to memlock pages"); + } + } + sendSTTORRY(signal); return; } else if (theStartPhase == 3) { @@ -330,14 +340,6 @@ void Cmvmi::execSTTOR(Signal* signal) signal->theData[2] = NodeInfo::REP; execOPEN_COMREQ(signal); globalData.theStartLevel = NodeState::SL_STARTED; - - if(theConfig.lockPagesInMainMemory()){ - int res = NdbMem_MemLockAll(); - if(res != 0){ - g_eventLogger.warning("Failed to memlock pages"); - warningEvent("Failed to memlock pages"); - } - } sendSTTORRY(signal); } } From 55e0ff5c33817fcb75a4a026893dfda2505ce77f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 19:36:11 +0100 Subject: [PATCH 05/21] Test "help": Shift the ID values up into a range where they will not collide with those which we use for real data, when we fill the system tables. Will be merged up to 5.0 where it is needed for 5.0.38. mysql-test/r/help.result: Fix the result file according to the changed ID values in "help.test". mysql-test/t/help.test: Now that (at least in 5.0) the system tables are filled with real data, inserting rows vith ID values 1 .. 5 will fail in release build tests (it did in 5.0.38) like it should already have done in customer installations. Shift the ID values up into a high area where they will not conflict, also make the distinct for the different kinds of values (= unique throughout the test). No change to the logic. --- mysql-test/r/help.result | 88 ++++++++++++++++++++-------------------- mysql-test/t/help.test | 44 ++++++++++---------- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/mysql-test/r/help.result b/mysql-test/r/help.result index edf7d0e91cb..690d7dee5dc 100644 --- a/mysql-test/r/help.result +++ b/mysql-test/r/help.result @@ -1,47 +1,47 @@ -insert into mysql.help_category(help_category_id,name)values(1,'impossible_category_1'); -select @category1_id:= 1; -@category1_id:= 1 -1 -insert into mysql.help_category(help_category_id,name)values(2,'impossible_category_2'); -select @category2_id:= 2; -@category2_id:= 2 -2 -insert into mysql.help_category(help_category_id,name,parent_category_id)values(3,'impossible_category_3',@category2_id); -select @category3_id:= 3; -@category3_id:= 3 -3 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(1,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); -select @topic1_id:= 1; -@topic1_id:= 1 -1 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(2,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); -select @topic2_id:= 2; -@topic2_id:= 2 -2 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(3,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); -select @topic3_id:= 3; -@topic3_id:= 3 -3 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(4,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); -select @topic4_id:= 4; -@topic4_id:= 4 -4 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(5,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); -select @topic5_id:= 5; -@topic5_id:= 5 -5 -insert into mysql.help_keyword(help_keyword_id,name)values(1,'impossible_function_1'); -select @keyword1_id:= 1; -@keyword1_id:= 1 -1 -insert into mysql.help_keyword(help_keyword_id,name)values(2,'impossible_function_5'); -select @keyword2_id:= 2; -@keyword2_id:= 2 -2 -insert into mysql.help_keyword(help_keyword_id,name)values(3,'impossible_function_6'); -select @keyword3_id:= 3; -@keyword3_id:= 3 -3 +insert into mysql.help_category(help_category_id,name)values(10001,'impossible_category_1'); +select @category1_id:= 10001; +@category1_id:= 10001 +10001 +insert into mysql.help_category(help_category_id,name)values(10002,'impossible_category_2'); +select @category2_id:= 10002; +@category2_id:= 10002 +10002 +insert into mysql.help_category(help_category_id,name,parent_category_id)values(10003,'impossible_category_3',@category2_id); +select @category3_id:= 10003; +@category3_id:= 10003 +10003 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10101,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); +select @topic1_id:= 10101; +@topic1_id:= 10101 +10101 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10102,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); +select @topic2_id:= 10102; +@topic2_id:= 10102 +10102 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10103,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); +select @topic3_id:= 10103; +@topic3_id:= 10103 +10103 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10104,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); +select @topic4_id:= 10104; +@topic4_id:= 10104 +10104 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10105,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); +select @topic5_id:= 10105; +@topic5_id:= 10105 +10105 +insert into mysql.help_keyword(help_keyword_id,name)values(10201,'impossible_function_1'); +select @keyword1_id:= 10201; +@keyword1_id:= 10201 +10201 +insert into mysql.help_keyword(help_keyword_id,name)values(10202,'impossible_function_5'); +select @keyword2_id:= 10202; +@keyword2_id:= 10202 +10202 +insert into mysql.help_keyword(help_keyword_id,name)values(10203,'impossible_function_6'); +select @keyword3_id:= 10203; +@keyword3_id:= 10203 +10203 insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword1_id,@topic2_id); insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword2_id,@topic1_id); insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword3_id,@topic3_id); diff --git a/mysql-test/t/help.test b/mysql-test/t/help.test index ff431fb4ebd..de0cefab76c 100644 --- a/mysql-test/t/help.test +++ b/mysql-test/t/help.test @@ -13,30 +13,30 @@ # impossible_category_3 # impossible_function_7 -insert into mysql.help_category(help_category_id,name)values(1,'impossible_category_1'); -select @category1_id:= 1; -insert into mysql.help_category(help_category_id,name)values(2,'impossible_category_2'); -select @category2_id:= 2; -insert into mysql.help_category(help_category_id,name,parent_category_id)values(3,'impossible_category_3',@category2_id); -select @category3_id:= 3; +insert into mysql.help_category(help_category_id,name)values(10001,'impossible_category_1'); +select @category1_id:= 10001; +insert into mysql.help_category(help_category_id,name)values(10002,'impossible_category_2'); +select @category2_id:= 10002; +insert into mysql.help_category(help_category_id,name,parent_category_id)values(10003,'impossible_category_3',@category2_id); +select @category3_id:= 10003; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(1,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); -select @topic1_id:= 1; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(2,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); -select @topic2_id:= 2; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(3,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); -select @topic3_id:= 3; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(4,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); -select @topic4_id:= 4; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(5,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); -select @topic5_id:= 5; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10101,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); +select @topic1_id:= 10101; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10102,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); +select @topic2_id:= 10102; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10103,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); +select @topic3_id:= 10103; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10104,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); +select @topic4_id:= 10104; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10105,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); +select @topic5_id:= 10105; -insert into mysql.help_keyword(help_keyword_id,name)values(1,'impossible_function_1'); -select @keyword1_id:= 1; -insert into mysql.help_keyword(help_keyword_id,name)values(2,'impossible_function_5'); -select @keyword2_id:= 2; -insert into mysql.help_keyword(help_keyword_id,name)values(3,'impossible_function_6'); -select @keyword3_id:= 3; +insert into mysql.help_keyword(help_keyword_id,name)values(10201,'impossible_function_1'); +select @keyword1_id:= 10201; +insert into mysql.help_keyword(help_keyword_id,name)values(10202,'impossible_function_5'); +select @keyword2_id:= 10202; +insert into mysql.help_keyword(help_keyword_id,name)values(10203,'impossible_function_6'); +select @keyword3_id:= 10203; insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword1_id,@topic2_id); insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword2_id,@topic1_id); From f76ab0c46937a0d53ee0907c2a17daca6106c52a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 08:30:16 +0200 Subject: [PATCH 06/21] Deleted reject files accidently checked in configure.in.rej include/my_global.h.rej BUILD/SETUP.sh.rej mysys/thr_alarm.c.rej include/my_pthread.h.rej BitKeeper/deleted/.del-SETUP.sh.rej: Delete: BUILD/SETUP.sh.rej BitKeeper/deleted/.del-configure.in.rej: Delete: configure.in.rej BitKeeper/deleted/.del-my_global.h.rej: Delete: include/my_global.h.rej BitKeeper/deleted/.del-my_pthread.h.rej: Delete: include/my_pthread.h.rej BitKeeper/deleted/.del-thr_alarm.c.rej: Delete: mysys/thr_alarm.c.rej --- BUILD/SETUP.sh.rej | 19 --- configure.in.rej | 299 --------------------------------------- include/my_global.h.rej | 17 --- include/my_pthread.h.rej | 80 ----------- mysys/thr_alarm.c.rej | 220 ---------------------------- 5 files changed, 635 deletions(-) delete mode 100644 BUILD/SETUP.sh.rej delete mode 100644 configure.in.rej delete mode 100644 include/my_global.h.rej delete mode 100644 include/my_pthread.h.rej delete mode 100644 mysys/thr_alarm.c.rej diff --git a/BUILD/SETUP.sh.rej b/BUILD/SETUP.sh.rej deleted file mode 100644 index ccbcaa4404f..00000000000 --- a/BUILD/SETUP.sh.rej +++ /dev/null @@ -1,19 +0,0 @@ -*************** -*** 39,46 **** - c_warnings="$global_warnings -Wunused" - cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" - -! alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet -! pentium_cflags="-mcpu=pentiumpro" - sparc_cflags="" - - # be as fast as we can be without losing our ability to backtrace ---- 39,46 ---- - c_warnings="$global_warnings -Wunused" - cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" - -! #alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet -! #pentium_cflags="-mcpu=pentiumpro" - sparc_cflags="" - - # be as fast as we can be without losing our ability to backtrace diff --git a/configure.in.rej b/configure.in.rej deleted file mode 100644 index 46fbf83b198..00000000000 --- a/configure.in.rej +++ /dev/null @@ -1,299 +0,0 @@ -*************** -*** 388,402 **** - if expr "$target_os" : "[[Ll]]inux.*" > /dev/null - then - MYSQLD_DEFAULT_SWITCHES="--skip-locking" -! IS_LINUX="true" - AC_MSG_RESULT("yes"); - else - MYSQLD_DEFAULT_SWITCHES="" -! IS_LINUX="false" - AC_MSG_RESULT("no"); - fi - AC_SUBST(MYSQLD_DEFAULT_SWITCHES) -! AC_SUBST(IS_LINUX) - - dnl Find paths to some shell programs - AC_PATH_PROG(LN, ln, ln) ---- 388,403 ---- - if expr "$target_os" : "[[Ll]]inux.*" > /dev/null - then - MYSQLD_DEFAULT_SWITCHES="--skip-locking" -! TARGET_LINUX="true" - AC_MSG_RESULT("yes"); -+ AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux]) - else - MYSQLD_DEFAULT_SWITCHES="" -! TARGET_LINUX="false" - AC_MSG_RESULT("no"); - fi - AC_SUBST(MYSQLD_DEFAULT_SWITCHES) -! AC_SUBST(TARGET_LINUX) - - dnl Find paths to some shell programs - AC_PATH_PROG(LN, ln, ln) -*************** -*** 576,582 **** - # (this is true on the MySQL build machines to avoid NSS problems) - # - -! if test "$IS_LINUX" = "true" -a "$static_nss" = "" - then - tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r` - if test -n "$tmp" ---- 577,583 ---- - # (this is true on the MySQL build machines to avoid NSS problems) - # - -! if test "$TARGET_LINUX" = "true" -a "$static_nss" = "" - then - tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r` - if test -n "$tmp" -*************** -*** 827,833 **** - ]) - AC_SUBST(WRAPLIBS) - -! if test "$IS_LINUX" = "true"; then - AC_MSG_CHECKING([for atomic operations]) - - AC_LANG_SAVE ---- 828,834 ---- - ]) - AC_SUBST(WRAPLIBS) - -! if test "$TARGET_LINUX" = "true"; then - AC_MSG_CHECKING([for atomic operations]) - - AC_LANG_SAVE -*************** -*** 870,876 **** - [ USE_PSTACK=no ]) - pstack_libs= - pstack_dirs= -! if test "$USE_PSTACK" = yes -a "$IS_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" - then - have_libiberty= have_libbfd= - my_save_LIBS="$LIBS" ---- 871,877 ---- - [ USE_PSTACK=no ]) - pstack_libs= - pstack_dirs= -! if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" - then - have_libiberty= have_libbfd= - my_save_LIBS="$LIBS" -*************** -*** 1239,1301 **** - # Hack for DEC-UNIX (OSF1) - if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" - then -! # Look for LinuxThreads. -! AC_MSG_CHECKING("LinuxThreads") -! grepres=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` -! getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep LINUXTHREADS | wc -l || echo 0` -! if test "$grepres" -gt 0 -o "$getconfres" -gt 0 - then -! AC_MSG_RESULT("Found") -! AC_DEFINE(HAVE_LINUXTHREADS) -! # Linux 2.0 sanity check -! AC_TRY_COMPILE([#include ], [int a = sched_get_priority_min(1);], , -! AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) -! # RedHat 5.0 does not work with dynamic linking of this. -static also -! # gives a speed increase in linux so it does not hurt on other systems. -! with_named_thread="-lpthread" -! else -! AC_MSG_RESULT("Not found") -! # If this is a linux machine we should barf -! AC_MSG_CHECKING("NPTL") -! if test "$IS_LINUX" = "true" -! then -! getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep NPTL | wc -l || echo 0` -! if test "$getconfres" -gt 0 - then -! AC_DEFINE(HAVE_LINUXTHREADS) dnl All this code predates NPTL, so "have linuxthreads" is a poor name. -! with_named_thread="-lpthread" - else -! AC_MSG_ERROR([This is a Linux system and neither Linuxthreads nor NPTL were -! found. Please install Linuxthreads or a new glibc and try -! again. See the Installation chapter in the Reference Manual for -! more information.]) - fi -! else -! AC_MSG_CHECKING("DEC threads") -! if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthread -lmach -lexc" -! CFLAGS="$CFLAGS -D_REENTRANT" -! CXXFLAGS="$CXXFLAGS -D_REENTRANT" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! AC_MSG_CHECKING("DEC 3.2 threads") -! if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthreads -lmach -lc_r" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_DEFINE(HAVE_DEC_3_2_THREADS) -! with_osf32_threads="yes" -! MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority" -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! fi -! fi -! fi -! fi - fi - - ---- 1240,1337 ---- - # Hack for DEC-UNIX (OSF1) - if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" - then -! AC_MSG_CHECKING("Linux threads") -! if test "$TARGET_LINUX" = "true" - then -! AC_MSG_RESULT("starting") -! # use getconf to check glibc contents -! AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION") -! case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in -! NPTL* ) -! AC_MSG_RESULT("NPTL") -! AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation]) -! with_named_thread="-lpthread" -! ;; -! LINUXTHREADS* ) -! AC_MSG_RESULT("Linuxthreads") -! AC_DEFINE([HAVE_LINUXTHREADS], [1], -! [Whether we are using Xavier Leroy's LinuxThreads]) -! with_named_thread="-lpthread" -! ;; -! * ) -! AC_MSG_RESULT("unknown") -! ;; -! esac -! if test "$with_named_thread" = "no" - then -! # old method, check headers -! # Look for LinuxThreads. -! AC_MSG_CHECKING("LinuxThreads in header file comment") -! res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` -! if test "$res" -gt 0 -! then -! AC_MSG_RESULT("Found") -! AC_DEFINE([HAVE_LINUXTHREADS], [1], -! [Whether we are using Xavier Leroy's LinuxThreads]) -! # Linux 2.0 sanity check -! AC_TRY_COMPILE([#include ], [int a = sched_get_priority_min(1);], , -! AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) -! # RedHat 5.0 does not work with dynamic linking of this. -static also -! # gives a speed increase in linux so it does not hurt on other systems. -! with_named_thread="-lpthread" -! else -! AC_MSG_RESULT("Not found") -! # If this is a linux machine we should barf -! AC_MSG_ERROR([This is a Linux system without a working getconf, -! and Linuxthreads was not found. Please install it (or a new glibc) and try again. -! See the Installation chapter in the Reference Manual for more information.]) -! fi - else -! AC_MSG_RESULT("no need to check headers") - fi -! AC_MSG_CHECKING("for pthread_create in -lpthread"); -! ac_save_LIBS="$LIBS" -! LIBS="$LIBS -lpthread" -! AC_TRY_LINK( [#include ], -! [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], -! AC_MSG_RESULT("yes"), -! [ AC_MSG_RESULT("no") -! AC_MSG_ERROR([ -! This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed. -! Please install one of these (or a new glibc) and try again. -! See the Installation chapter in the Reference Manual for more information.]) ] -! ) -! LIBS="$ac_save_LIBS" -! else -! AC_MSG_RESULT("no") -! fi # "$TARGET_LINUX" -! fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -! -! if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -! then -! AC_MSG_CHECKING("DEC threads") -! if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthread -lmach -lexc" -! CFLAGS="$CFLAGS -D_REENTRANT" -! CXXFLAGS="$CXXFLAGS -D_REENTRANT" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! AC_MSG_CHECKING("DEC 3.2 threads") -! if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthreads -lmach -lc_r" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_DEFINE(HAVE_DEC_3_2_THREADS) -! with_osf32_threads="yes" -! MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority" -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! fi -! fi - fi - - -*************** -*** 1720,1726 **** - AC_SUBST(COMPILATION_COMMENT) - - AC_MSG_CHECKING("need of special linking flags") -! if test "$IS_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" - then - LDFLAGS="$LDFLAGS -rdynamic" - AC_MSG_RESULT("-rdynamic") ---- 1756,1762 ---- - AC_SUBST(COMPILATION_COMMENT) - - AC_MSG_CHECKING("need of special linking flags") -! if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" - then - LDFLAGS="$LDFLAGS -rdynamic" - AC_MSG_RESULT("-rdynamic") -*************** -*** 1873,1878 **** - tell atod memcpy memmove \ - setupterm strcasecmp sighold vidattr lrand48 localtime_r \ - sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \ - pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \ - pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \ - pthread_attr_getstacksize pthread_key_delete \ ---- 1909,1915 ---- - tell atod memcpy memmove \ - setupterm strcasecmp sighold vidattr lrand48 localtime_r \ - sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \ -+ sigaction sigemptyset sigaddset \ - pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \ - pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \ - pthread_attr_getstacksize pthread_key_delete \ -*************** -*** 1884,1890 **** - # Sanity check: We chould not have any fseeko symbol unless - # large_file_support=yes - AC_CHECK_FUNCS(fseeko, -! [if test "$large_file_support" = no -a "$IS_LINUX" = "true"; - then - AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!"); - fi] ---- 1921,1927 ---- - # Sanity check: We chould not have any fseeko symbol unless - # large_file_support=yes - AC_CHECK_FUNCS(fseeko, -! [if test "$large_file_support" = no -a "$TARGET_LINUX" = "true"; - then - AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!"); - fi] diff --git a/include/my_global.h.rej b/include/my_global.h.rej deleted file mode 100644 index f2953d169e7..00000000000 --- a/include/my_global.h.rej +++ /dev/null @@ -1,17 +0,0 @@ -*************** -*** 97,103 **** - - - /* Fix problem with S_ISLNK() on Linux */ -! #if defined(HAVE_LINUXTHREADS) - #undef _GNU_SOURCE - #define _GNU_SOURCE 1 - #endif ---- 97,103 ---- - - - /* Fix problem with S_ISLNK() on Linux */ -! #if defined(TARGET_OS_LINUX) || defined(__GLIBC__) - #undef _GNU_SOURCE - #define _GNU_SOURCE 1 - #endif diff --git a/include/my_pthread.h.rej b/include/my_pthread.h.rej deleted file mode 100644 index 1f73655b0bd..00000000000 --- a/include/my_pthread.h.rej +++ /dev/null @@ -1,80 +0,0 @@ -*************** -*** 286,293 **** - #undef HAVE_PTHREAD_RWLOCK_RDLOCK - #undef HAVE_SNPRINTF - -! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) -! #define signal(A,B) pthread_signal((A),(void (*)(int)) (B)) - #define my_pthread_attr_setprio(A,B) - #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ - ---- 294,301 ---- - #undef HAVE_PTHREAD_RWLOCK_RDLOCK - #undef HAVE_SNPRINTF - -! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) -! #define my_signal(A,B) pthread_signal((A),(void (*)(int)) (B)) - #define my_pthread_attr_setprio(A,B) - #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ - -*************** -*** 324,337 **** - #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) - int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ - #endif -! #if !defined(HAVE_SIGSET) && !defined(HAVE_mit_thread) && !defined(sigset) -! #define sigset(A,B) do { struct sigaction s; sigset_t set; \ -! sigemptyset(&set); \ -! s.sa_handler = (B); \ -! s.sa_mask = set; \ -! s.sa_flags = 0; \ -! sigaction((A), &s, (struct sigaction *) NULL); \ - } while (0) - #endif - - #ifndef my_pthread_setprio ---- 332,358 ---- - #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) - int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ - #endif -! -! /* -! We define my_sigset() and use that instead of the system sigset() so that -! we can favor an implementation based on sigaction(). On some systems, such -! as Mac OS X, sigset() results in flags such as SA_RESTART being set, and -! we want to make sure that no such flags are set. -! */ -! #if defined(HAVE_SIGACTION) && !defined(my_sigset) -! #define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; \ -! DBUG_ASSERT((A) != 0); \ -! sigemptyset(&set); \ -! s.sa_handler = (B); \ -! s.sa_mask = set; \ -! s.sa_flags = 0; \ -! rc= sigaction((A), &s, (struct sigaction *) NULL); \ -! DBUG_ASSERT(rc == 0); \ - } while (0) -+ #elif defined(HAVE_SIGSET) && !defined(my_sigset) -+ #define my_sigset(A,B) sigset((A),(B)) -+ #elif !defined(my_sigset) -+ #define my_sigset(A,B) signal((A),(B)) - #endif - - #ifndef my_pthread_setprio -*************** -*** 416,422 **** - #undef pthread_detach_this_thread - #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } - #undef sigset -! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) - #endif - - #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) ---- 437,443 ---- - #undef pthread_detach_this_thread - #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } - #undef sigset -! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) - #endif - - #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) diff --git a/mysys/thr_alarm.c.rej b/mysys/thr_alarm.c.rej deleted file mode 100644 index c991121052e..00000000000 --- a/mysys/thr_alarm.c.rej +++ /dev/null @@ -1,220 +0,0 @@ -*************** -*** 76,96 **** - alarm_aborted=0; - init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0, - compare_ulong,NullS); -! sigfillset(&full_signal_set); /* Neaded to block signals */ - pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_alarm,NULL); -! #if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) -! #if defined(HAVE_mit_thread) -! sigset(THR_CLIENT_ALARM,thread_alarm); /* int. thread system calls */ -! #else - { -! struct sigaction sact; -! sact.sa_flags = 0; -! sact.sa_handler = thread_alarm; -! sigaction(THR_CLIENT_ALARM, &sact, (struct sigaction*) 0); - } -- #endif -- #endif - sigemptyset(&s); - sigaddset(&s, THR_SERVER_ALARM); - alarm_thread=pthread_self(); ---- 74,89 ---- - alarm_aborted=0; - init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0, - compare_ulong,NullS); -! sigfillset(&full_signal_set); /* Needed to block signals */ - pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_alarm,NULL); -! #ifndef USE_ALARM_THREAD -! if (thd_lib_detected != THD_LIB_LT) -! #endif - { -! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1, -! thread_alarm); - } - sigemptyset(&s); - sigaddset(&s, THR_SERVER_ALARM); - alarm_thread=pthread_self(); -*************** -*** 108,120 **** - } - #elif defined(USE_ONE_SIGNAL_HAND) - pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ -! #if THR_SERVER_ALARM == THR_CLIENT_ALARM -! sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */ -! pthread_sigmask(SIG_UNBLOCK, &s, NULL); -! #endif - #else - pthread_sigmask(SIG_UNBLOCK, &s, NULL); -- sigset(THR_SERVER_ALARM,process_alarm); - #endif - DBUG_VOID_RETURN; - } ---- 101,115 ---- - } - #elif defined(USE_ONE_SIGNAL_HAND) - pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ -! if (thd_lib_detected == THD_LIB_LT) -! { -! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1, -! process_alarm); /* Linuxthreads */ -! pthread_sigmask(SIG_UNBLOCK, &s, NULL); -! } - #else -+ my_sigset(THR_SERVER_ALARM, process_alarm); - pthread_sigmask(SIG_UNBLOCK, &s, NULL); - #endif - DBUG_VOID_RETURN; - } -*************** -*** 240,246 **** - if (alarm_data->malloced) - my_free((gptr) alarm_data,MYF(0)); - found++; -! #ifndef DBUG_OFF - break; - #endif - } ---- 235,241 ---- - if (alarm_data->malloced) - my_free((gptr) alarm_data,MYF(0)); - found++; -! #ifdef DBUG_OFF - break; - #endif - } -*************** -*** 249,258 **** - if (!found) - { - if (*alarmed) -! fprintf(stderr,"Warning: Didn't find alarm %lx in queue of %d alarms\n", -! (long) *alarmed, alarm_queue.elements); -! DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n", -! (long) *alarmed)); - } - pthread_mutex_unlock(&LOCK_alarm); - pthread_sigmask(SIG_SETMASK,&old_mask,NULL); ---- 244,254 ---- - if (!found) - { - if (*alarmed) -! fprintf(stderr, -! "Warning: Didn't find alarm 0x%lx in queue of %d alarms\n", -! (long) *alarmed, alarm_queue.elements); -! DBUG_PRINT("warning",("Didn't find alarm 0x%lx in queue\n", -! (long) *alarmed)); - } - pthread_mutex_unlock(&LOCK_alarm); - pthread_sigmask(SIG_SETMASK,&old_mask,NULL); -*************** -*** 274,291 **** - This must be first as we can't call DBUG inside an alarm for a normal thread - */ - -! #if THR_SERVER_ALARM == THR_CLIENT_ALARM -! if (!pthread_equal(pthread_self(),alarm_thread)) - { - #if defined(MAIN) && !defined(__bsdi__) -! printf("thread_alarm\n"); fflush(stdout); - #endif - #ifdef DONT_REMEMBER_SIGNAL -! sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */ - #endif - return; - } -- #endif - - /* - We have to do do the handling of the alarm in a sub function, ---- 270,287 ---- - This must be first as we can't call DBUG inside an alarm for a normal thread - */ - -! if (thd_lib_detected == THD_LIB_LT && -! !pthread_equal(pthread_self(),alarm_thread)) - { - #if defined(MAIN) && !defined(__bsdi__) -! printf("thread_alarm in process_alarm\n"); fflush(stdout); - #endif - #ifdef DONT_REMEMBER_SIGNAL -! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1, -! process_alarm); /* int. thread system calls */ - #endif - return; - } - - /* - We have to do do the handling of the alarm in a sub function, -*************** -*** 301,307 **** - process_alarm_part2(sig); - #ifndef USE_ALARM_THREAD - #if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND) -! sigset(THR_SERVER_ALARM,process_alarm); - #endif - pthread_mutex_unlock(&LOCK_alarm); - pthread_sigmask(SIG_SETMASK,&old_mask,NULL); ---- 297,303 ---- - process_alarm_part2(sig); - #ifndef USE_ALARM_THREAD - #if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND) -! my_sigset(THR_SERVER_ALARM, process_alarm); - #endif - pthread_mutex_unlock(&LOCK_alarm); - pthread_sigmask(SIG_SETMASK,&old_mask,NULL); -*************** -*** 504,520 **** - ARGSUSED - */ - -- #if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) - static sig_handler thread_alarm(int sig) - { - #ifdef MAIN - printf("thread_alarm\n"); fflush(stdout); - #endif - #ifdef DONT_REMEMBER_SIGNAL -! sigset(sig,thread_alarm); /* int. thread system calls */ - #endif - } -- #endif - - - #ifdef HAVE_TIMESPEC_TS_SEC ---- 499,513 ---- - ARGSUSED - */ - - static sig_handler thread_alarm(int sig) - { - #ifdef MAIN - printf("thread_alarm\n"); fflush(stdout); - #endif - #ifdef DONT_REMEMBER_SIGNAL -! my_sigset(sig, thread_alarm); /* int. thread system calls */ - #endif - } - - - #ifdef HAVE_TIMESPEC_TS_SEC -*************** -*** 915,921 **** - printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name()); - fflush(stdout); - #ifdef DONT_REMEMBER_SIGNAL -! sigset(sig,print_signal_warning); /* int. thread system calls */ - #endif - #ifndef OS2 - if (sig == SIGALRM) ---- 908,914 ---- - printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name()); - fflush(stdout); - #ifdef DONT_REMEMBER_SIGNAL -! my_sigset(sig, print_signal_warning); /* int. thread system calls */ - #endif - #ifndef OS2 - if (sig == SIGALRM) From 6866ca008c941d2cc7afa106607257d9aaace519 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 01:40:35 +0500 Subject: [PATCH 07/21] =?UTF-8?q?BUG#24342=20-=20Incorrect=20results=20wit?= =?UTF-8?q?h=20query=20over=20MERGE=20table=20MERGE=20engine=20may=20retur?= =?UTF-8?q?n=20incorrect=20values=20when=20several=20representations=20of?= =?UTF-8?q?=20equal=20keys=20are=20present=20in=20the=20index.=20For=20exa?= =?UTF-8?q?mple=20"gro=C3=9F"=20and=20"gross"=20or=20"gross"=20and=20"gros?= =?UTF-8?q?s=20"=20(trailing=20space),=20which=20are=20considered=20equal,?= =?UTF-8?q?=20but=20have=20different=20lengths.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The problem was that key length was not recalculated after key lookup. Only MERGE engine is affected. myisam/mi_rkey.c: info->lastkey gets rewritten by mi_search. Later we recalculate found lastkey length. This is done to make sure that mi_rnext_same gets true, found (not searched) lastkey length. Searched and found key lengths may be different, for example in case searched key is "groß" and found is "gross" or in case a key has trailing spaces. Unfortunately we recalculate found lastkey length only for first underlying table. To recalculate found key length for non-first underlying table we need to know how much key segments were used to create this key. When mi_rkey is called for first underlying table of a merge table, store offset to last used key segment. Restore last_used_keyseg variable when mi_rkey is called for non-first underlying table. myisam/myisamdef.h: Added last_used_keyseg variable to MI_INFO. It is used by merge engine to calculate key length. myisammrg/myrg_rkey.c: Pass last used key segment returned by first table key read to other table key reads. mysql-test/r/merge.result: A test case for bug#24342. mysql-test/t/merge.test: A test case for bug#24342. --- myisam/mi_rkey.c | 3 ++- myisam/myisamdef.h | 1 + myisammrg/myrg_rkey.c | 4 ++++ mysql-test/r/merge.result | 11 +++++++++++ mysql-test/t/merge.test | 13 +++++++++++++ 5 files changed, 31 insertions(+), 1 deletion(-) diff --git a/myisam/mi_rkey.c b/myisam/mi_rkey.c index b2d40288645..2933d694318 100644 --- a/myisam/mi_rkey.c +++ b/myisam/mi_rkey.c @@ -50,7 +50,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, key_buff=info->lastkey+info->s->base.max_key_length; pack_key_length= key_len; bmove(key_buff,key,key_len); - last_used_keyseg= 0; + last_used_keyseg= info->s->keyinfo[inx].seg + info->last_used_keyseg; } else { @@ -62,6 +62,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, key_len, &last_used_keyseg); /* Save packed_key_length for use by the MERGE engine. */ info->pack_key_length= pack_key_length; + info->last_used_keyseg= last_used_keyseg - info->s->keyinfo[inx].seg; DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg, key_buff, pack_key_length);); } diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 6365f0e1b0c..6ed041e8b9d 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -263,6 +263,7 @@ struct st_myisam_info { enum ha_rkey_function last_key_func; /* CONTAIN, OVERLAP, etc */ uint save_lastkey_length; uint pack_key_length; /* For MYISAMMRG */ + uint16 last_used_keyseg; /* For MyISAMMRG */ int errkey; /* Got last error on this key */ int lock_type; /* How database was locked */ int tmp_lock_type; /* When locked by readinfo */ diff --git a/myisammrg/myrg_rkey.c b/myisammrg/myrg_rkey.c index f87b264081e..b72334ea7dd 100644 --- a/myisammrg/myrg_rkey.c +++ b/myisammrg/myrg_rkey.c @@ -41,12 +41,14 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, { byte *key_buff; uint pack_key_length; + uint16 last_used_keyseg; MYRG_TABLE *table; MI_INFO *mi; int err; DBUG_ENTER("myrg_rkey"); LINT_INIT(key_buff); LINT_INIT(pack_key_length); + LINT_INIT(last_used_keyseg); if (_myrg_init_queue(info,inx,search_flag)) DBUG_RETURN(my_errno); @@ -61,10 +63,12 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, /* Get the saved packed key and packed key length. */ key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length; pack_key_length=mi->pack_key_length; + last_used_keyseg= mi->last_used_keyseg; } else { mi->once_flags|= USE_PACKED_KEYS; + mi->last_used_keyseg= last_used_keyseg; err=mi_rkey(mi,0,inx,key_buff,pack_key_length,search_flag); } info->last_used_table=table+1; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 00d8aa3d586..b12e4eb2d3a 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -819,3 +819,14 @@ ALTER TABLE m1 ENGINE=MERGE UNION=(t1); SELECT * FROM m1; c1 c2 c3 c4 c5 c6 c7 c8 c9 DROP TABLE t1, m1; +CREATE TABLE t1 (a VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_german2_ci, +b INT, INDEX(a,b)); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +ALTER TABLE t3 ENGINE=MERGE UNION=(t1,t2); +INSERT INTO t1 VALUES ('ss',1); +INSERT INTO t2 VALUES ('ss',2),(0xDF,2); +SELECT COUNT(*) FROM t3 WHERE a=0xDF AND b=2; +COUNT(*) +2 +DROP TABLE t1,t2,t3; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 032e80ecc93..377160d0312 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -454,4 +454,17 @@ ALTER TABLE m1 ENGINE=MERGE UNION=(t1); SELECT * FROM m1; DROP TABLE t1, m1; +# +# BUG#24342 - Incorrect results with query over MERGE table +# +CREATE TABLE t1 (a VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_german2_ci, + b INT, INDEX(a,b)); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +ALTER TABLE t3 ENGINE=MERGE UNION=(t1,t2); +INSERT INTO t1 VALUES ('ss',1); +INSERT INTO t2 VALUES ('ss',2),(0xDF,2); +SELECT COUNT(*) FROM t3 WHERE a=0xDF AND b=2; +DROP TABLE t1,t2,t3; + # End of 4.1 tests From a908db7b74eb5925bf3ca6ab019b44df346bf4f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 08:23:16 +0200 Subject: [PATCH 08/21] ndb - bug#27748 fix commit trigger on multi-update ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp: fix commit trigger on multi-update --- ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp b/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp index e16d3df6d8d..37bf33f0313 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp @@ -390,6 +390,7 @@ Dbtup::commitRecord(Signal* signal, fragptr.p = regFragPtr; tabptr.p = regTabPtr; + Uint32 hashValue = firstOpPtr.p->hashValue; if (opType == ZINSERT_DELETE) { ljam(); @@ -412,6 +413,7 @@ Dbtup::commitRecord(Signal* signal, //-------------------------------------------------------------------- Uint32 saveOpType = regOperPtr->optype; regOperPtr->optype = ZINSERT; + regOperPtr->hashValue = hashValue; operPtr.p = regOperPtr; checkDetachedTriggers(signal, @@ -444,6 +446,8 @@ Dbtup::commitRecord(Signal* signal, befOpPtr.p->changeMask.clear(); befOpPtr.p->changeMask.bitOR(attributeMask); befOpPtr.p->gci = regOperPtr->gci; + befOpPtr.p->optype = ZUPDATE; + befOpPtr.p->hashValue = hashValue; befOpPtr.p->optype = opType; operPtr.p = befOpPtr.p; @@ -478,11 +482,13 @@ Dbtup::commitRecord(Signal* signal, Uint32 fragPageId = befOpPtr.p->fragPageId; Uint32 pageIndex = befOpPtr.p->pageIndex; + befOpPtr.p->optype = ZDELETE; befOpPtr.p->realPageId = befOpPtr.p->realPageIdC; befOpPtr.p->pageOffset = befOpPtr.p->pageOffsetC; befOpPtr.p->fragPageId = befOpPtr.p->fragPageIdC; befOpPtr.p->pageIndex = befOpPtr.p->pageIndexC; befOpPtr.p->gci = regOperPtr->gci; + befOpPtr.p->hashValue = hashValue; befOpPtr.p->optype = opType; operPtr.p = befOpPtr.p; From aa051961c9ac4629fd7dca9f236172e47660bbeb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 11:41:12 -0700 Subject: [PATCH 09/21] Fixed bug #27484: a crash when incompatible row expressions with nested rows are used as arguments of the IN predicate. Added a function to check compatibility of row expressions. Made sure that this function to be called for Item_func_in objects by fix_length_and_dec(). mysql-test/r/row.result: Added a test case for bug #27484. mysql-test/t/row.test: Added a test case for bug #27484. --- mysql-test/r/row.result | 18 ++++++++++++ mysql-test/t/row.test | 25 ++++++++++++++++ sql/item_cmpfunc.cc | 65 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 104 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 76d6fa13766..1c1c4809f36 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -170,3 +170,21 @@ ROW(2,10) <=> ROW(3,4) SELECT ROW(NULL,10) <=> ROW(3,NULL); ROW(NULL,10) <=> ROW(3,NULL) 0 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1)); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1),ROW(1,ROW(2,3))); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,ROW(2,2,2))); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3,4)) IN (ROW(1,ROW(2,3,4)),ROW(1,ROW(2,2))); +ERROR 21000: Operand should contain 3 column(s) +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1)); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1),ROW(1,ROW(2,4))); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3)) IN ((SELECT 1,1),ROW(1,ROW(2,3))); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0)); +ERROR 21000: Operand should contain 1 column(s) +SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2)); +ERROR 21000: Operand should contain 1 column(s) diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test index d8d9a244134..6c66d45b942 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -83,4 +83,29 @@ drop table t1; SELECT ROW(2,10) <=> ROW(3,4); SELECT ROW(NULL,10) <=> ROW(3,NULL); +# +# Bug #27484: nested row expressions in IN predicate +# + +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1)); +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1),ROW(1,ROW(2,3))); +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,ROW(2,2,2))); +--error 1241 +SELECT ROW(1,ROW(2,3,4)) IN (ROW(1,ROW(2,3,4)),ROW(1,ROW(2,2))); + +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1)); +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1),ROW(1,ROW(2,4))); +--error 1241 +SELECT ROW(1,ROW(2,3)) IN ((SELECT 1,1),ROW(1,ROW(2,3))); + +--error 1241 +SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0)); +--error 1241 +SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2)); + # End of 4.1 tests diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 4d54dfc2b39..ce3096da778 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -61,6 +61,42 @@ static void agg_result_type(Item_result *type, Item **items, uint nitems) } +/* + Compare row signature of two expressions + + SYNOPSIS: + cmp_row_type() + item1 the first expression + item2 the second expression + + DESCRIPTION + The function checks that two expressions have compatible row signatures + i.e. that the number of columns they return are the same and that if they + are both row expressions then each component from the first expression has + a row signature compatible with the signature of the corresponding component + of the second expression. + + RETURN VALUES + 1 type incompatibility has been detected + 0 otherwise +*/ + +static int cmp_row_type(Item* item1, Item* item2) +{ + uint n= item1->cols(); + if (item2->check_cols(n)) + return 1; + for (uint i=0; iel(i)->check_cols(item1->el(i)->cols()) || + (item1->el(i)->result_type() == ROW_RESULT && + cmp_row_type(item1->el(i), item2->el(i)))) + return 1; + } + return 0; +} + + /* Aggregates result types from the array of items. @@ -75,14 +111,32 @@ static void agg_result_type(Item_result *type, Item **items, uint nitems) This function aggregates result types from the array of items. Found type supposed to be used later for comparison of values of these items. Aggregation itself is performed by the item_cmp_type() function. + The function also checks compatibility of row signatures for the + submitted items (see the spec for the cmp_row_type function). + + RETURN VALUES + 1 type incompatibility has been detected + 0 otherwise */ -static void agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems) +static int agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems) { uint i; type[0]= items[0]->result_type(); for (i= 1 ; i < nitems ; i++) + { type[0]= item_cmp_type(type[0], items[i]->result_type()); + /* + When aggregating types of two row expressions we have to check + that they have the same cardinality and that each component + of the first row expression has a compatible row signature with + the signature of the corresponding component of the second row + expression. + */ + if (type[0] == ROW_RESULT && cmp_row_type(items[0], items[i])) + return 1; // error found: invalid usage of rows + } + return 0; } static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, @@ -984,7 +1038,8 @@ void Item_func_between::fix_length_and_dec() */ if (!args[0] || !args[1] || !args[2]) return; - agg_cmp_type(thd, &cmp_type, args, 3); + if ( agg_cmp_type(thd, &cmp_type, args, 3)) + return; if (cmp_type == STRING_RESULT && agg_arg_charsets(cmp_collation, args, 3, MY_COLL_CMP_CONV)) return; @@ -1532,7 +1587,8 @@ void Item_func_case::fix_length_and_dec() for (nagg= 0; nagg < ncases/2 ; nagg++) agg[nagg+1]= args[nagg*2]; nagg++; - agg_cmp_type(current_thd, &cmp_type, agg, nagg); + if (agg_cmp_type(current_thd, &cmp_type, agg, nagg)) + return; if ((cmp_type == STRING_RESULT) && agg_arg_charsets(cmp_collation, agg, nagg, MY_COLL_CMP_CONV)) return; @@ -2013,7 +2069,8 @@ void Item_func_in::fix_length_and_dec() uint const_itm= 1; THD *thd= current_thd; - agg_cmp_type(thd, &cmp_type, args, arg_count); + if (agg_cmp_type(thd, &cmp_type, args, arg_count)) + return; if (cmp_type == STRING_RESULT && agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV)) From 202f34e2f51cc888cecb6d1be683cf01ba3fbf88 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Apr 2007 02:31:34 +0500 Subject: [PATCH 10/21] BUG#25951 - ignore/use index does not work with fulltext IGNORE/USE/FORCE INDEX hints were honored when choosing FULLTEXT index. With this fix these hints are ignored. For regular indexes we may perform table scan instead of index lookup when IGNORE INDEX was specified. We cannot do this for FULLTEXT in NLQ mode. mysql-test/r/fulltext.result: A test case for bug#25951. mysql-test/t/fulltext.test: A test case for bug#25951. sql/item_func.cc: IGNOR/USE/FORCE INDEX hints should not be honored when choosing FULLTEXT index. Use proper bitmap, that is not modified by IGNORE/USE/FORCE INDEX hints. --- mysql-test/r/fulltext.result | 7 +++++++ mysql-test/t/fulltext.test | 10 ++++++++++ sql/item_func.cc | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index c1dd5f80d5c..3700ace4b19 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -447,3 +447,10 @@ a MATCH(a) AGAINST('test1 test') test1 0.68526661396027 DEALLOCATE PREPARE stmt; DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(255), FULLTEXT(a)); +SELECT * FROM t1 IGNORE INDEX(a) WHERE MATCH(a) AGAINST('test'); +a +ALTER TABLE t1 DISABLE KEYS; +SELECT * FROM t1 WHERE MATCH(a) AGAINST('test'); +ERROR HY000: Can't find FULLTEXT index matching the column list +DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index d5ce6241490..1a9a6b578dc 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -369,4 +369,14 @@ EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; +# +# BUG#25951 - ignore/use index does not work with fulltext +# +CREATE TABLE t1 (a VARCHAR(255), FULLTEXT(a)); +SELECT * FROM t1 IGNORE INDEX(a) WHERE MATCH(a) AGAINST('test'); +ALTER TABLE t1 DISABLE KEYS; +--error 1191 +SELECT * FROM t1 WHERE MATCH(a) AGAINST('test'); +DROP TABLE t1; + # End of 4.1 tests diff --git a/sql/item_func.cc b/sql/item_func.cc index 88c3dfcdfc0..c6b2fa5cc3e 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3158,7 +3158,7 @@ bool Item_func_match::fix_index() for (keynr=0 ; keynr < table->keys ; keynr++) { if ((table->key_info[keynr].flags & HA_FULLTEXT) && - (table->keys_in_use_for_query.is_set(keynr))) + (table->keys_in_use.is_set(keynr))) { ft_to_key[fts]=keynr; ft_cnt[fts]=0; From 50e158402bf51521dce5fb69be9100cc8ccfebd7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Apr 2007 16:52:50 +0500 Subject: [PATCH 11/21] Fix for bug #27515: DROP previlege is not required anymore for RENAME TABLE Added missed DROP privilege check on the original table for RENAME TABLE command. mysql-test/r/grant.result: Fix for bug #27515: DROP previlege is not required anymore for RENAME TABLE - test result. mysql-test/t/grant.test: Fix for bug #27515: DROP previlege is not required anymore for RENAME TABLE - test case. sql/sql_parse.cc: Fix for bug #27515: DROP previlege is not required anymore for RENAME TABLE - added DROP privilege check on the original table for RENAME TABLE command. --- mysql-test/r/grant.result | 11 +++++++++++ mysql-test/t/grant.test | 23 ++++++++++++++++++++++- sql/sql_parse.cc | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 1960f3a76b9..4e4e2ccff48 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -492,3 +492,14 @@ delete from mysql.db where user='mysqltest1'; delete from mysql.tables_priv where user='mysqltest1'; flush privileges; drop database mysqltest; +create database db27515; +use db27515; +create table t1 (a int); +grant alter on db27515.t1 to user27515@localhost; +grant insert, create on db27515.t2 to user27515@localhost; +rename table t1 to t2; +ERROR 42000: DROP command denied to user 'user27515'@'localhost' for table 't1' +revoke all privileges, grant option from user27515@localhost; +drop user user27515@localhost; +drop database db27515; +End of 4.1 tests diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 3365145650a..ea148c67262 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -451,4 +451,25 @@ delete from mysql.tables_priv where user='mysqltest1'; flush privileges; drop database mysqltest; -# End of 4.1 tests +# +# Bug #27515: DROP previlege is not required for RENAME TABLE +# +connection master; +create database db27515; +use db27515; +create table t1 (a int); +grant alter on db27515.t1 to user27515@localhost; +grant insert, create on db27515.t2 to user27515@localhost; + +connect (conn27515, localhost, user27515, , db27515); +connection conn27515; +--error 1142 +rename table t1 to t2; +disconnect conn27515; + +connection master; +revoke all privileges, grant option from user27515@localhost; +drop user user27515@localhost; +drop database db27515; + +--echo End of 4.1 tests diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 66b68cfc2f1..659926bdea3 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2818,7 +2818,7 @@ unsent_create_error: old_list=table[0]; new_list=table->next[0]; old_list.next=new_list.next=0; - if (check_grant(thd, ALTER_ACL, &old_list, 0, UINT_MAX, 0) || + if (check_grant(thd, ALTER_ACL | DROP_ACL, &old_list, 0, UINT_MAX, 0) || (!test_all_bits(table->next->grant.privilege, INSERT_ACL | CREATE_ACL) && check_grant(thd, INSERT_ACL | CREATE_ACL, &new_list, 0, From 3673aaeb6b6e04b804e5308147234cfa80cd78de Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Apr 2007 11:53:25 +0500 Subject: [PATCH 12/21] Fixed a warning on win64. --- myisam/mi_rkey.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/myisam/mi_rkey.c b/myisam/mi_rkey.c index 2933d694318..e34799da6ed 100644 --- a/myisam/mi_rkey.c +++ b/myisam/mi_rkey.c @@ -62,7 +62,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, key_len, &last_used_keyseg); /* Save packed_key_length for use by the MERGE engine. */ info->pack_key_length= pack_key_length; - info->last_used_keyseg= last_used_keyseg - info->s->keyinfo[inx].seg; + info->last_used_keyseg= (uint16) (last_used_keyseg - + info->s->keyinfo[inx].seg); DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg, key_buff, pack_key_length);); } From a8f639fccc19ef80d67c52e698bf6366fdcf6f94 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Apr 2007 15:14:09 +0500 Subject: [PATCH 13/21] Bug#27704: incorrect comparison of rows with NULL components Support for NULL components was incomplete for row comparison, fixed. Added support for abort_on_null at compare_row() like in 5.x sql/item_cmpfunc.h: Bug#27704: incorrect comparison of rows with NULL components Added support for abort_on_null at Item_bool_func2 like in 5.x sql/item_cmpfunc.cc: Bug#27704: incorrect comparison of rows with NULL components Support for NULL components was incomplete for row comparison, fixed. Added support for abort_on_null at compare_row() like in 5.x mysql-test/t/row.test: Test case updated for Bug#27704 (incorrect comparison of rows with NULL components) mysql-test/r/row.result: Test case updated for Bug#27704 (incorrect comparison of rows with NULL components) mysql-test/r/subselect.result: Test case updated for Bug#27704 (incorrect comparison of rows with NULL components) --- mysql-test/r/row.result | 99 ++++++++++++++++++++++++++++++++++- mysql-test/r/subselect.result | 4 +- mysql-test/t/row.test | 45 ++++++++++++++++ sql/item_cmpfunc.cc | 36 +++++++++++-- sql/item_cmpfunc.h | 4 +- 5 files changed, 180 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 1c1c4809f36..6169619712b 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -53,7 +53,7 @@ SELECT (1,2,3)=(1,NULL,3); NULL SELECT (1,2,3)=(1,NULL,0); (1,2,3)=(1,NULL,0) -NULL +0 SELECT ROW(1,2,3)=ROW(1,2,3); ROW(1,2,3)=ROW(1,2,3) 1 @@ -188,3 +188,100 @@ SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0)); ERROR 21000: Operand should contain 1 column(s) SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2)); ERROR 21000: Operand should contain 1 column(s) +CREATE TABLE t1(a int, b int, c int); +INSERT INTO t1 VALUES (1, 2, 3), +(NULL, 2, 3 ), (1, NULL, 3 ), (1, 2, NULL), +(NULL, 2, 3+1), (1, NULL, 3+1), (1, 2+1, NULL), +(NULL, 2, 3-1), (1, NULL, 3-1), (1, 2-1, NULL); +SELECT (1,2,3) = (1, NULL, 3); +(1,2,3) = (1, NULL, 3) +NULL +SELECT (1,2,3) = (1+1, NULL, 3); +(1,2,3) = (1+1, NULL, 3) +0 +SELECT (1,2,3) = (1, NULL, 3+1); +(1,2,3) = (1, NULL, 3+1) +0 +SELECT * FROM t1 WHERE (a,b,c) = (1,2,3); +a b c +1 2 3 +SELECT (1,2,3) <> (1, NULL, 3); +(1,2,3) <> (1, NULL, 3) +NULL +SELECT (1,2,3) <> (1+1, NULL, 3); +(1,2,3) <> (1+1, NULL, 3) +1 +SELECT (1,2,3) <> (1, NULL, 3+1); +(1,2,3) <> (1, NULL, 3+1) +1 +SELECT * FROM t1 WHERE (a,b,c) <> (1,2,3); +a b c +NULL 2 4 +1 NULL 4 +1 3 NULL +NULL 2 2 +1 NULL 2 +1 1 NULL +SELECT (1,2,3) < (NULL, 2, 3); +(1,2,3) < (NULL, 2, 3) +NULL +SELECT (1,2,3) < (1, NULL, 3); +(1,2,3) < (1, NULL, 3) +NULL +SELECT (1,2,3) < (1-1, NULL, 3); +(1,2,3) < (1-1, NULL, 3) +0 +SELECT (1,2,3) < (1+1, NULL, 3); +(1,2,3) < (1+1, NULL, 3) +1 +SELECT * FROM t1 WHERE (a,b,c) < (1,2,3); +a b c +1 1 NULL +SELECT (1,2,3) <= (NULL, 2, 3); +(1,2,3) <= (NULL, 2, 3) +NULL +SELECT (1,2,3) <= (1, NULL, 3); +(1,2,3) <= (1, NULL, 3) +NULL +SELECT (1,2,3) <= (1-1, NULL, 3); +(1,2,3) <= (1-1, NULL, 3) +0 +SELECT (1,2,3) <= (1+1, NULL, 3); +(1,2,3) <= (1+1, NULL, 3) +1 +SELECT * FROM t1 WHERE (a,b,c) <= (1,2,3); +a b c +1 2 3 +1 1 NULL +SELECT (1,2,3) > (NULL, 2, 3); +(1,2,3) > (NULL, 2, 3) +NULL +SELECT (1,2,3) > (1, NULL, 3); +(1,2,3) > (1, NULL, 3) +NULL +SELECT (1,2,3) > (1-1, NULL, 3); +(1,2,3) > (1-1, NULL, 3) +1 +SELECT (1,2,3) > (1+1, NULL, 3); +(1,2,3) > (1+1, NULL, 3) +0 +SELECT * FROM t1 WHERE (a,b,c) > (1,2,3); +a b c +1 3 NULL +SELECT (1,2,3) >= (NULL, 2, 3); +(1,2,3) >= (NULL, 2, 3) +NULL +SELECT (1,2,3) >= (1, NULL, 3); +(1,2,3) >= (1, NULL, 3) +NULL +SELECT (1,2,3) >= (1-1, NULL, 3); +(1,2,3) >= (1-1, NULL, 3) +1 +SELECT (1,2,3) >= (1+1, NULL, 3); +(1,2,3) >= (1+1, NULL, 3) +0 +SELECT * FROM t1 WHERE (a,b,c) >= (1,2,3); +a b c +1 2 3 +1 3 NULL +DROP TABLE t1; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index a339a139687..5bb79a53771 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -913,7 +913,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a) 1 1 a 2 0 b -NULL NULL NULL +NULL 0 NULL select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2; a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a) 1 0 a @@ -923,7 +923,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a) 1 0 a 2 0 b -NULL NULL NULL +NULL 0 NULL drop table t1,t2; create table t1 (a int, b real, c varchar(10)); insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b'); diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test index 6c66d45b942..6f845607d8c 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -108,4 +108,49 @@ SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0)); --error 1241 SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2)); +# +# Bug#27704: erroneous comparison of rows with NULL components +# +CREATE TABLE t1(a int, b int, c int); +INSERT INTO t1 VALUES (1, 2, 3), + (NULL, 2, 3 ), (1, NULL, 3 ), (1, 2, NULL), + (NULL, 2, 3+1), (1, NULL, 3+1), (1, 2+1, NULL), + (NULL, 2, 3-1), (1, NULL, 3-1), (1, 2-1, NULL); + +SELECT (1,2,3) = (1, NULL, 3); +SELECT (1,2,3) = (1+1, NULL, 3); +SELECT (1,2,3) = (1, NULL, 3+1); +SELECT * FROM t1 WHERE (a,b,c) = (1,2,3); + +SELECT (1,2,3) <> (1, NULL, 3); +SELECT (1,2,3) <> (1+1, NULL, 3); +SELECT (1,2,3) <> (1, NULL, 3+1); +SELECT * FROM t1 WHERE (a,b,c) <> (1,2,3); + +SELECT (1,2,3) < (NULL, 2, 3); +SELECT (1,2,3) < (1, NULL, 3); +SELECT (1,2,3) < (1-1, NULL, 3); +SELECT (1,2,3) < (1+1, NULL, 3); +SELECT * FROM t1 WHERE (a,b,c) < (1,2,3); + +SELECT (1,2,3) <= (NULL, 2, 3); +SELECT (1,2,3) <= (1, NULL, 3); +SELECT (1,2,3) <= (1-1, NULL, 3); +SELECT (1,2,3) <= (1+1, NULL, 3); +SELECT * FROM t1 WHERE (a,b,c) <= (1,2,3); + +SELECT (1,2,3) > (NULL, 2, 3); +SELECT (1,2,3) > (1, NULL, 3); +SELECT (1,2,3) > (1-1, NULL, 3); +SELECT (1,2,3) > (1+1, NULL, 3); +SELECT * FROM t1 WHERE (a,b,c) > (1,2,3); + +SELECT (1,2,3) >= (NULL, 2, 3); +SELECT (1,2,3) >= (1, NULL, 3); +SELECT (1,2,3) >= (1-1, NULL, 3); +SELECT (1,2,3) >= (1+1, NULL, 3); +SELECT * FROM t1 WHERE (a,b,c) >= (1,2,3); + +DROP TABLE t1; + # End of 4.1 tests diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index ce3096da778..be44d490415 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -680,17 +680,45 @@ int Arg_comparator::compare_e_int_diff_signedness() int Arg_comparator::compare_row() { int res= 0; + bool was_null= 0; (*a)->bring_value(); (*b)->bring_value(); uint n= (*a)->cols(); for (uint i= 0; inull_value) - return -1; + { + // NULL was compared + switch (owner->functype()) { + case Item_func::NE_FUNC: + break; // NE never aborts on NULL even if abort_on_null is set + case Item_func::LT_FUNC: + case Item_func::LE_FUNC: + case Item_func::GT_FUNC: + case Item_func::GE_FUNC: + return -1; // <, <=, > and >= always fail on NULL + default: // EQ_FUNC + if (owner->abort_on_null) + return -1; // We do not need correct NULL returning + } + was_null= 1; + owner->null_value= 0; + res= 0; // continue comparison (maybe we will meet explicit difference) + } + else if (res) + return res; } - return res; + if (was_null) + { + /* + There was NULL(s) in comparison in some parts, but there was no + explicit difference in other parts, so we have to return NULL. + */ + owner->null_value= 1; + return -1; + } + return 0; } int Arg_comparator::compare_e_row() diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 132e019b4a3..7dbbdc7a63b 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -206,10 +206,11 @@ class Item_bool_func2 :public Item_int_func protected: Arg_comparator cmp; String tmp_value1,tmp_value2; + bool abort_on_null; public: Item_bool_func2(Item *a,Item *b) - :Item_int_func(a,b), cmp(tmp_arg, tmp_arg+1) {} + :Item_int_func(a,b), cmp(tmp_arg, tmp_arg+1), abort_on_null(FALSE) {} void fix_length_and_dec(); void set_cmp_func() { @@ -222,6 +223,7 @@ public: bool is_null() { return test(args[0]->is_null() || args[1]->is_null()); } bool is_bool_func() { return 1; } CHARSET_INFO *compare_collation() { return cmp.cmp_collation.collation; } + void top_level_item() { abort_on_null= TRUE; } friend class Arg_comparator; }; From f90870e98fe0e5626ccef14eb5b324d06195243a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Apr 2007 00:50:33 +0500 Subject: [PATCH 14/21] Fixed bug #20710. This bug occurs when error message length exceeds allowed limit: my_error() function outputs "%s" sequences instead of long string arguments. Formats like %-.64s are very common in errmsg.txt files, however my_error() function simply ignores precision of those formats. mysys/my_error.c: Fixed bug #20710. This bug occurs when error message length exceeds allowed limit: my_error() function output "%s" sequences instead of long string arguments. my_error() function has been fixed to accept formats like %-.64s. mysql-test/t/alter_table.test: Added test case for bug #20710. mysql-test/r/alter_table.result: Added test case for bug #20710. --- mysql-test/r/alter_table.result | 5 +++++ mysql-test/t/alter_table.test | 11 +++++++++++ mysys/my_error.c | 13 +++++++++++++ 3 files changed, 29 insertions(+) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index da5cf688325..8957e1ee7a1 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -803,3 +803,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp alter table table_24562 order by no_such_col; ERROR 42S22: Unknown column 'no_such_col' in 'order clause' drop table table_24562; +CREATE TABLE t1 (c1 CHAR(255)); +INSERT INTO t1 VALUES (REPEAT("x", 255)), (REPEAT("x", 255)); +ALTER TABLE t1 ADD UNIQUE (c1); +ERROR 23000: Duplicate entry 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' for key 1 +DROP TABLE t1; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 52a569dfb57..874c42ac0b6 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -583,5 +583,16 @@ alter table table_24562 order by no_such_col; drop table table_24562; +# +# Bug #20710: adding unique index of column with duplicated +# long values to reproduce error message with truncated key value. +# + +CREATE TABLE t1 (c1 CHAR(255)); +INSERT INTO t1 VALUES (REPEAT("x", 255)), (REPEAT("x", 255)); +--error 1062 +ALTER TABLE t1 ADD UNIQUE (c1); +DROP TABLE t1; + # End of 4.1 tests diff --git a/mysys/my_error.c b/mysys/my_error.c index 8a377f63c7e..0f8ffb7c05f 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -82,6 +82,11 @@ int my_error(int nr,myf MyFlags, ...) If "%.*u" or "%.*d" are encountered, the precision number is read from the variable argument list but its value is ignored. */ + if (*tpos == '-') + { + tpos++; + olen--; + } prec_supplied= 0; if (*tpos== '.') { @@ -94,6 +99,14 @@ int my_error(int nr,myf MyFlags, ...) prec_chars= va_arg(ap, int); /* get length parameter */ prec_supplied= 1; } + else + { + for (prec_chars= 0; my_isdigit(&my_charset_latin1, *tpos); tpos++, olen--) + { + prec_supplied= 1; + prec_chars= prec_chars * 10 + *tpos - '0'; + } + } } if (!prec_supplied) From 98c0da4ed5dd8cbfc8450675e2c008b829367318 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Apr 2007 04:16:17 +0500 Subject: [PATCH 15/21] Fixed bug #13191. INSERT...ON DUPLICATE KEY UPDATE may cause error 1032: "Can't find record in ..." if we are inserting into InnoDB table unique index of partial key with underlying UTF-8 string field. This error occurs because INSERT...ON DUPLICATE uses a wrong procedure to copy string fields of multi-byte character sets for index search. mysql-test/t/innodb_mysql.test: Added test case for bug #13191. mysql-test/r/innodb_mysql.result: Added test case for bug #13191. sql/field.h: Fixed bug #13191. Field_string::get_key_image() virtual function was overloaded to implement copying of variable length character (UTF-8) fields. Field::get_key_image() function prototype has been changed to return byte size of copied data. sql/field.cc: Fixed bug #13191. Field_string::get_key_image() virtual function was overloaded to implement copying of variable length character (UTF-8) fields. Field::get_key_image() function prototype has been changed to return byte size of copied data. sql/key.cc: Fixed bug #13191. INSERT...ON DUPLICATE KEY UPDATE may cause error 1032: "Can't find record in ...". This error occurs because INSERT...ON DUPLICATE uses a wrong procedure to copy field parts for index search. key_copy() function has been fixed. --- mysql-test/r/innodb_mysql.result | 33 ++++++++++++++++++++++ mysql-test/t/innodb_mysql.test | 30 ++++++++++++++++++++ sql/field.cc | 41 ++++++++++++++++++--------- sql/field.h | 48 ++++++++++++++++++++++++++++---- sql/key.cc | 23 +++++++-------- 5 files changed, 145 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 2cd6f7826ca..12c8b414d2d 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -128,4 +128,37 @@ show /*!50002 GLOBAL */ status like 'Handler_rollback'; Variable_name Value Handler_rollback 0 drop table t1; +CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1) +ENGINE=INNODB CHARACTER SET UTF8; +INSERT INTO t1 (c1) VALUES ('1a'); +SELECT * FROM t1; +c1 cnt +1a 1 +INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1; +SELECT * FROM t1; +c1 cnt +1a 2 +DROP TABLE t1; +CREATE TABLE t1(c1 VARCHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1) +ENGINE=INNODB CHARACTER SET UTF8; +INSERT INTO t1 (c1) VALUES ('1a'); +SELECT * FROM t1; +c1 cnt +1a 1 +INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1; +SELECT * FROM t1; +c1 cnt +1a 2 +DROP TABLE t1; +CREATE TABLE t1(c1 CHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1) +ENGINE=INNODB CHARACTER SET UTF8; +INSERT INTO t1 (c1) VALUES ('1a'); +SELECT * FROM t1; +c1 cnt +1a 1 +INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1; +SELECT * FROM t1; +c1 cnt +1a 2 +DROP TABLE t1; End of 4.1 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index c5a5e997775..0973385dc5b 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -161,4 +161,34 @@ show /*!50002 GLOBAL */ status like 'Handler_rollback'; connection default; drop table t1; disconnect con1; + +# +# Bug #13191: INSERT...ON DUPLICATE KEY UPDATE of UTF-8 string fields +# used in partial unique indices. +# + +CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1) + ENGINE=INNODB CHARACTER SET UTF8; +INSERT INTO t1 (c1) VALUES ('1a'); +SELECT * FROM t1; +INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1(c1 VARCHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1) + ENGINE=INNODB CHARACTER SET UTF8; +INSERT INTO t1 (c1) VALUES ('1a'); +SELECT * FROM t1; +INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1(c1 CHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1) + ENGINE=INNODB CHARACTER SET UTF8; +INSERT INTO t1 (c1) VALUES ('1a'); +SELECT * FROM t1; +INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1; +SELECT * FROM t1; +DROP TABLE t1; + --echo End of 4.1 tests diff --git a/sql/field.cc b/sql/field.cc index acc837c1d37..1b27e12e078 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5204,6 +5204,16 @@ uint Field_string::max_packed_col_length(uint max_length) return (max_length > 255 ? 2 : 1)+max_length; } +uint Field_string::get_key_image(char *buff, uint length, CHARSET_INFO *cs, + imagetype type_arg) +{ + uint bytes = my_charpos(cs, ptr, ptr + field_length, + length / field_charset->mbmaxlen); + memcpy(buff, ptr, bytes); + if (bytes < length) + bzero(buff + bytes, length - bytes); + return bytes; +} /**************************************************************************** ** VARCHAR type (Not available for the end user yet) @@ -5414,8 +5424,8 @@ uint Field_varstring::max_packed_col_length(uint max_length) return (max_length > 255 ? 2 : 1)+max_length; } -void Field_varstring::get_key_image(char *buff, uint length, CHARSET_INFO *cs, - imagetype type) +uint Field_varstring::get_key_image(char *buff, uint length, CHARSET_INFO *cs, + imagetype type) { uint f_length=uint2korr(ptr); if (f_length > length) @@ -5426,6 +5436,7 @@ void Field_varstring::get_key_image(char *buff, uint length, CHARSET_INFO *cs, if (f_length < length) bzero(buff+HA_KEY_BLOB_LENGTH+f_length, (length-f_length)); #endif + return HA_KEY_BLOB_LENGTH+f_length; } void Field_varstring::set_key_image(char *buff,uint length, CHARSET_INFO *cs) @@ -5724,8 +5735,8 @@ int Field_blob::cmp_binary(const char *a_ptr, const char *b_ptr, /* The following is used only when comparing a key */ -void Field_blob::get_key_image(char *buff,uint length, - CHARSET_INFO *cs, imagetype type) +uint Field_blob::get_key_image(char *buff,uint length, + CHARSET_INFO *cs, imagetype type) { uint32 blob_length= get_length(ptr); char *blob; @@ -5737,16 +5748,17 @@ void Field_blob::get_key_image(char *buff,uint length, MBR mbr; Geometry_buffer buffer; Geometry *gobj; + const uint image_length= SIZEOF_STORED_DOUBLE*4; if (blob_length < SRID_SIZE) { - bzero(buff, SIZEOF_STORED_DOUBLE*4); - return; + bzero(buff, image_length); + return image_length; } get_ptr(&blob); gobj= Geometry::construct(&buffer, blob, blob_length); if (gobj->get_mbr(&mbr, &dummy)) - bzero(buff, SIZEOF_STORED_DOUBLE*4); + bzero(buff, image_length); else { float8store(buff, mbr.xmin); @@ -5754,7 +5766,7 @@ void Field_blob::get_key_image(char *buff,uint length, float8store(buff+16, mbr.ymin); float8store(buff+24, mbr.ymax); } - return; + return image_length; } #endif /*HAVE_SPATIAL*/ @@ -5774,6 +5786,7 @@ void Field_blob::get_key_image(char *buff,uint length, } int2store(buff,length); memcpy(buff+HA_KEY_BLOB_LENGTH, blob, length); + return HA_KEY_BLOB_LENGTH+length; } void Field_blob::set_key_image(char *buff,uint length, CHARSET_INFO *cs) @@ -6021,8 +6034,8 @@ uint Field_blob::max_packed_col_length(uint max_length) #ifdef HAVE_SPATIAL -void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs, - imagetype type) +uint Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs, + imagetype type) { char *blob; const char *dummy; @@ -6030,16 +6043,17 @@ void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs, ulong blob_length= get_length(ptr); Geometry_buffer buffer; Geometry *gobj; + const uint image_length= SIZEOF_STORED_DOUBLE*4; if (blob_length < SRID_SIZE) { - bzero(buff, SIZEOF_STORED_DOUBLE*4); - return; + bzero(buff, image_length); + return image_length; } get_ptr(&blob); gobj= Geometry::construct(&buffer, blob, blob_length); if (gobj->get_mbr(&mbr, &dummy)) - bzero(buff, SIZEOF_STORED_DOUBLE*4); + bzero(buff, image_length); else { float8store(buff, mbr.xmin); @@ -6047,6 +6061,7 @@ void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs, float8store(buff + 16, mbr.ymin); float8store(buff + 24, mbr.ymax); } + return image_length; } diff --git a/sql/field.h b/sql/field.h index 58177747120..20f1209a439 100644 --- a/sql/field.h +++ b/sql/field.h @@ -228,9 +228,43 @@ public: { memcpy(buff,ptr,length); } inline void set_image(char *buff,uint length, CHARSET_INFO *cs) { memcpy(ptr,buff,length); } - virtual void get_key_image(char *buff,uint length, CHARSET_INFO *cs, - imagetype type) - { get_image(buff,length,cs); } + + + /* + Copy a field part into an output buffer. + + SYNOPSIS + Field::get_key_image() + buff [out] output buffer + length output buffer size + cs charset, always same as this->charset(), + (to be removed in 5.x) + type itMBR for geometry blobs, otherwise itRAW + + DESCRIPTION + This function makes a copy of field part of size equal to or + less than "length" parameter value. + For fields of string types (CHAR, VARCHAR, TEXT) the rest of buffer + is padded by zero byte. + + NOTES + For variable length character fields (i.e. UTF-8) the "length" + parameter means a number of output buffer bytes as if all field + characters have maximal possible size (mbmaxlen). In the other words, + "length" parameter is a number of characters multiplied by + field_charset->mbmaxlen. + + RETURN + Number of copied bytes (excluding padded zero bytes -- see above). + */ + + virtual uint get_key_image(char *buff, uint length, + CHARSET_INFO *cs, + imagetype type) + { + get_image(buff,length,cs); + return length; + } virtual void set_key_image(char *buff,uint length, CHARSET_INFO *cs) { set_image(buff,length,cs); } inline longlong val_int_offset(uint row_offset) @@ -947,6 +981,8 @@ public: enum_field_types real_type() const { return FIELD_TYPE_STRING; } bool has_charset(void) const { return charset() == &my_charset_bin ? FALSE : TRUE; } + virtual uint get_key_image(char *buff,uint length, CHARSET_INFO *cs, + imagetype type); }; @@ -981,7 +1017,7 @@ public: String *val_str(String*,String *); int cmp(const char *,const char*); void sort_string(char *buff,uint length); - void get_key_image(char *buff,uint length, CHARSET_INFO *cs, imagetype type); + uint get_key_image(char *buff,uint length, CHARSET_INFO *cs, imagetype type); void set_key_image(char *buff,uint length, CHARSET_INFO *cs); void sql_type(String &str) const; char *pack(char *to, const char *from, uint max_length=~(uint) 0); @@ -1060,7 +1096,7 @@ public: store_length(length); memcpy_fixed(ptr+packlength,&data,sizeof(char*)); } - void get_key_image(char *buff,uint length, CHARSET_INFO *cs, imagetype type); + uint get_key_image(char *buff,uint length, CHARSET_INFO *cs, imagetype type); void set_key_image(char *buff,uint length, CHARSET_INFO *cs); void sql_type(String &str) const; inline bool copy() @@ -1117,7 +1153,7 @@ public: int store(longlong nr) { return 1; } int reset(void) { return !maybe_null() || Field_blob::reset(); } - void get_key_image(char *buff,uint length, CHARSET_INFO *cs,imagetype type); + uint get_key_image(char *buff,uint length, CHARSET_INFO *cs,imagetype type); void set_key_image(char *buff,uint length, CHARSET_INFO *cs); }; #endif /*HAVE_SPATIAL*/ diff --git a/sql/key.cc b/sql/key.cc index 7ddd40de2c9..d57d1570da7 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -89,20 +89,21 @@ void key_copy(byte *key,TABLE *table,uint idx,uint key_length) } if (key_part->key_part_flag & HA_BLOB_PART) { - char *pos; - ulong blob_length=((Field_blob*) key_part->field)->get_length(); - key_length-=2; - ((Field_blob*) key_part->field)->get_ptr(&pos); - length=min(key_length,key_part->length); - set_if_smaller(blob_length,length); - int2store(key,(uint) blob_length); - key+=2; // Skip length info - memcpy(key,pos,blob_length); + key_length-= HA_KEY_BLOB_LENGTH; + length= min(key_length, key_part->length); + key_part->field->get_key_image((char *) key, length, + key_part->field->charset(), + Field::itRAW); + key+= HA_KEY_BLOB_LENGTH; } else { - length=min(key_length,key_part->length); - memcpy(key,table->record[0]+key_part->offset,(size_t) length); + length= min(key_length, key_part->length); + Field *field= key_part->field; + CHARSET_INFO *cs= field->charset(); + uint bytes= field->get_key_image(key, length, cs, Field::itRAW); + if (bytes < length) + cs->cset->fill(cs, key + bytes, length - bytes, ' '); } key+=length; key_length-=length; From 3f169678479be890f6813f16615d413247b3e779 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Apr 2007 05:06:14 +0500 Subject: [PATCH 16/21] Adjusted results after the fix for bug #20710. --- mysql-test/r/heap.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 6bb9d0c87ee..b19ccca2f44 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -294,7 +294,7 @@ drop table t1; create table t1 (c char(255), primary key(c(90))); insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); -ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1 +ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1 drop table t1; CREATE TABLE t1 (a int, key(a)) engine=heap; insert into t1 values (0); From e8225073649844a43bc4ea6362a5df5e6210933b Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Apr 2007 11:56:23 +0500 Subject: [PATCH 17/21] Patch to eliminate compilation errors under VC after bug #13191 fix. --- sql/key.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/key.cc b/sql/key.cc index d57d1570da7..5bb389fcb45 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -101,9 +101,9 @@ void key_copy(byte *key,TABLE *table,uint idx,uint key_length) length= min(key_length, key_part->length); Field *field= key_part->field; CHARSET_INFO *cs= field->charset(); - uint bytes= field->get_key_image(key, length, cs, Field::itRAW); + uint bytes= field->get_key_image((char *) key, length, cs, Field::itRAW); if (bytes < length) - cs->cset->fill(cs, key + bytes, length - bytes, ' '); + cs->cset->fill(cs, (char *) key + bytes, length - bytes, ' '); } key+=length; key_length-=length; From dd34042ec17557f50994bdf09846b52755a6fd6b Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Apr 2007 16:04:43 -0700 Subject: [PATCH 18/21] Fixed bug #24856: the result set of a ROLLUP query with DISTINCT could lack some rollup rows (rows with NULLs for grouping attributes) if GROUP BY list contained constant expressions. This happened because the results of constant expressions were not put in the temporary table used for duplicate elimination. In fact a constant item from the GROUP BY list of a ROLLUP query can be replaced for an Item_null_result object when a rollup row is produced . Now the JOIN::rollup_init function wraps any constant item referenced in the GROYP BY list of a ROLLUP query into an Item_func object of a special class that is never detected as constant item. This ensures creation of fields for such constant items in temporary tables and guarantees right results when the result of the rollup operation first has to be written into a temporary table, e.g. in the cases when duplicate elimination is required. mysql-test/r/olap.result: Added a test case for bug #24856. mysql-test/t/olap.test: Added a test case for bug #24856. sql/item_func.h: Fixed bug #24856: the result set of a ROLLUP query with DISTINCT could lack some rollup rows (rows with NULLs for grouping attributes) if GROUP BY list contained constant expressions. Itroduced class Item_func_rollup_const derived from Item_func. The object of this class are never detected as constant items. We use them for wrapping constant items from the GROUP BY list of any ROLLUP query. This wrapping allows us to ensure writing constant items into temporary tables whenever the result of the ROLLUP operation has to be written into a temporary table, e.g. when ROLLUP is used together with DISTINCT in the SELECT list. sql/sql_select.cc: Fixed bug #24856: the result set of a ROLLUP query with DISTINCT could lack some rollup rows (rows with NULLs for grouping attributes) if GROUP BY list contained constant expressions. Now the JOIN::rollup_init function wraps any constant item referenced in the GROYP BY list of a ROLLUP query into an Item_func object of a special class that is never detected as constant item. This ensures creation of fields for such constant items in temporary tables and guarantees right results when the result of the rollup operation first has to be written into a temporary table, e.g. in the cases when duplicate elimination is required. --- mysql-test/r/olap.result | 61 ++++++++++++++++++++++++++++++++++++++++ mysql-test/t/olap.test | 19 +++++++++++++ sql/item_func.h | 25 ++++++++++++++++ sql/sql_select.cc | 28 +++++++++++++++++- 4 files changed, 132 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 74b7570ea2a..0300fc1759e 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -556,3 +556,64 @@ x a sum(b) 2006-07-01 NULL 11 NULL NULL 11 drop table t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 +VALUES (2,10),(3,30),(2,40),(1,10),(2,30),(1,20),(2,10); +SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP; +a SUM(b) +1 30 +2 90 +3 30 +NULL 150 +SELECT DISTINCT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP; +a SUM(b) +1 30 +2 90 +3 30 +NULL 150 +SELECT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP; +a b COUNT(*) +1 10 1 +1 20 1 +1 NULL 2 +2 10 2 +2 30 1 +2 40 1 +2 NULL 4 +3 30 1 +3 NULL 1 +NULL NULL 7 +SELECT DISTINCT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP; +a b COUNT(*) +1 10 1 +1 20 1 +1 NULL 2 +2 10 2 +2 30 1 +2 40 1 +2 NULL 4 +3 30 1 +3 NULL 1 +NULL NULL 7 +SELECT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP; +x a SUM(b) +x 1 30 +x 2 90 +x 3 30 +x NULL 150 +NULL NULL 150 +SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP; +x a SUM(b) +x 1 30 +x 2 90 +x 3 30 +x NULL 150 +NULL NULL 150 +SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP; +x a SUM(b) +x 1 30 +x 2 90 +x 3 30 +x NULL 150 +NULL NULL 150 +DROP TABLE t1; diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 683e1402678..99db3874883 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -281,4 +281,23 @@ select left(a,10), a, sum(b) from t1 group by 1,2 with rollup; select left(a,10) x, a, sum(b) from t1 group by x,a with rollup; drop table t1; +# +# Bug #20825: ROLLUP by const item in a query with DISTINCT +# + +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 + VALUES (2,10),(3,30),(2,40),(1,10),(2,30),(1,20),(2,10); + +SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP; +SELECT DISTINCT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP; +SELECT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP; +SELECT DISTINCT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP; + +SELECT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP; +SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP; +SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP; + +DROP TABLE t1; + # End of 4.1 tests diff --git a/sql/item_func.h b/sql/item_func.h index 467b88eda76..ebe3a589aa1 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -590,6 +590,31 @@ public: }; +/* + Objects of this class are used for ROLLUP queries to wrap up + each constant item referred to in GROUP BY list. +*/ + +class Item_func_rollup_const :public Item_func +{ +public: + Item_func_rollup_const(Item *a) :Item_func(a) + { name= a->name; } + double val() { return args[0]->val(); } + longlong val_int() { return args[0]->val_int(); } + String *val_str(String *str) { return args[0]->val_str(str); } + const char *func_name() const { return "rollup_const"; } + bool const_item() const { return 0; } + Item_result result_type() const { return args[0]->result_type(); } + void fix_length_and_dec() + { + collation= args[0]->collation; + max_length= args[0]->max_length; + decimals=args[0]->decimals; + } +}; + + class Item_func_length :public Item_int_func { String value; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index af3ad782ee3..36a15841065 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9754,7 +9754,7 @@ bool JOIN::rollup_init() for (j=0 ; j < fields_list.elements ; j++) rollup.fields[i].push_back(rollup.null_items[i]); } - List_iterator_fast it(all_fields); + List_iterator it(all_fields); Item *item; while ((item= it++)) { @@ -9767,6 +9767,32 @@ bool JOIN::rollup_init() { item->maybe_null= 1; found_in_group= 1; + if (item->const_item()) + { + /* + For ROLLUP queries each constant item referenced in GROUP BY list + is wrapped up into an Item_func object yielding the same value + as the constant item. The objects of the wrapper class are never + considered as constant items and besides they inherit all + properties of the Item_result_field class. + This wrapping allows us to ensure writing constant items + into temporary tables whenever the result of the ROLLUP + operation has to be written into a temporary table, e.g. when + ROLLUP is used together with DISTINCT in the SELECT list. + Usually when creating temporary tables for a intermidiate + result we do not include fields for constant expressions. + */ + Item* new_item= new Item_func_rollup_const(item); + if (!new_item) + return 1; + new_item->fix_fields(thd,0, (Item **) 0); + thd->change_item_tree(it.ref(), new_item); + for (ORDER *tmp= group_tmp; tmp; tmp= tmp->next) + { + if (*tmp->item == item) + thd->change_item_tree(tmp->item, new_item); + } + } } } if (item->type() == Item::FUNC_ITEM && !found_in_group) From c004ad09444b8b3be367b6620aa4f0716684bdc3 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Apr 2007 18:28:58 -0700 Subject: [PATCH 19/21] Fix in comments. --- mysql-test/t/olap.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 99db3874883..61c1bd45e5f 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -282,7 +282,7 @@ select left(a,10) x, a, sum(b) from t1 group by x,a with rollup; drop table t1; # -# Bug #20825: ROLLUP by const item in a query with DISTINCT +# Bug #24856: ROLLUP by const item in a query with DISTINCT # CREATE TABLE t1 (a int, b int); From 4d263c49946c241d18c66519fa384ce505480f50 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 May 2007 13:17:07 -0400 Subject: [PATCH 20/21] Bug #27173: "Enabling keys got errno ..." does not say which table Warnings may show up in the error log that complain about a table, yet don't tell us which table. Add the database and table names to the message. sql/ha_myisam.cc: Add the database and table names to the warning message. --- sql/ha_myisam.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 39cf4782ed2..ef44cbdbb32 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -882,8 +882,8 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt) param.sort_buffer_length= check_opt->sort_buffer_size; if ((error= repair(thd,param,1)) && param.retry_repair) { - sql_print_warning("Warning: Optimize table got errno %d, retrying", - my_errno); + sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying", + my_errno, param.db_name, param.table_name); param.testflag&= ~T_REP_BY_SORT; error= repair(thd,param,1); } @@ -1273,8 +1273,8 @@ int ha_myisam::enable_indexes(uint mode) param.tmpdir=&mysql_tmpdir_list; if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair) { - sql_print_warning("Warning: Enabling keys got errno %d, retrying", - my_errno); + sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying", + my_errno, param.db_name, param.table_name); param.testflag&= ~(T_REP_BY_SORT | T_QUICK); error= (repair(thd,param,0) != HA_ADMIN_OK); } From d64e63b36094aec1fc3c3132716d55322ac97dbf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 May 2007 17:38:29 -0400 Subject: [PATCH 21/21] Bug #27976: Misleading error message, 'Sort buffer to small' The message is gramatically wrong, and factually wrong. Change it to refer to the myisam_sort_buffer_size variable and change "to" to "too". myisam/sort.c: Change error messages to be gramatically correct and to refer to the correct variable. mysql-test/r/repair.result: Refer to the correct variable. Message changed. --- myisam/sort.c | 8 ++++---- mysql-test/r/repair.result | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/myisam/sort.c b/myisam/sort.c index fe9459e572b..b909a16e8e6 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -152,7 +152,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, keys < (uint) maxbuffer) { mi_check_print_error(info->sort_info->param, - "sort_buffer_size is to small"); + "myisam_sort_buffer_size is too small"); goto err; } } @@ -176,7 +176,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, } if (memavl < MIN_SORT_MEMORY) { - mi_check_print_error(info->sort_info->param,"Sort buffer to small"); /* purecov: tested */ + mi_check_print_error(info->sort_info->param,"MyISAM sort buffer too small"); /* purecov: tested */ goto err; /* purecov: tested */ } (*info->lock_in_memory)(info->sort_info->param);/* Everything is allocated */ @@ -370,7 +370,7 @@ pthread_handler_decl(thr_find_all_keys,arg) keys < (uint) maxbuffer) { mi_check_print_error(sort_param->sort_info->param, - "sort_buffer_size is to small"); + "myisam_sort_buffer_size is too small"); goto err; } } @@ -393,7 +393,7 @@ pthread_handler_decl(thr_find_all_keys,arg) } if (memavl < MIN_SORT_MEMORY) { - mi_check_print_error(sort_param->sort_info->param, "Sort buffer too small"); + mi_check_print_error(sort_param->sort_info->param, "MyISAM sort buffer too small"); goto err; /* purecov: tested */ } diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index bf46d19777f..355a8c25434 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -77,7 +77,7 @@ INSERT INTO t1 VALUES SET myisam_repair_threads=2; REPAIR TABLE t1; Table Op Msg_type Msg_text -test.t1 repair error sort_buffer_size is to small +test.t1 repair error myisam_sort_buffer_size is too small test.t1 repair warning Number of rows changed from 0 to 157 test.t1 repair status OK SET myisam_repair_threads=@@global.myisam_repair_threads;