From: Date: April 25 2006 2:27am Subject: bk commit into 5.0 tree (konstantin:1.2101) BUG#19308 List-Archive: http://lists.mysql.com/commits/5444 X-Bug: 19308 Message-Id: <20060425002734.4308C8909@dragonfly.local> Below is the list of changes that have just been committed into a local 5.0 repository of kostja. When kostja does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2101 06/04/25 04:27:23 konstantin@stripped +6 -0 A fix and a test case for Bug#19308 "REPAIR/OPTIMIZE/ANALYZE supported in SP but not in PS": just enable them in prepared statements, the supporting functionality was implemented when they were enabled in stored procedures. sql/sql_prepare.cc 1.176 06/04/25 04:27:16 konstantin@stripped +3 -0 Enable ANALYZE, OPTIMIZE, REPAIR in prepared statements. mysql-test/t/ps_1general.test 1.27 06/04/25 04:27:16 konstantin@stripped +0 -3 Adjust existing test cases (ANALYZE/OPTIMIZE/REPAIR are now allowed in prepared statements. mysql-test/t/ps.test 1.63 06/04/25 04:27:16 konstantin@stripped +36 -0 Add a test case for Bug#19308 "REPAIR/OPTIMIZE/ANALYZE supported in SP but not in PS" mysql-test/r/sp-dynamic.result 1.4 06/04/25 04:27:16 konstantin@stripped +3 -3 Adjust existing test cases (ANALYZE/OPTIMIZE/REPAIR are now allowed in prepared statements. mysql-test/r/ps_1general.result 1.53 06/04/25 04:27:16 konstantin@stripped +0 -3 Adjust existing test cases (ANALYZE/OPTIMIZE/REPAIR are now allowed in prepared statements. mysql-test/r/ps.result 1.65 06/04/25 04:27:16 konstantin@stripped +101 -0 Bug#19308: test results fixed. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: konstantin # Host: dragonfly.local # Root: /opt/local/work/mysql-5.0-19308 --- 1.52/mysql-test/r/ps_1general.result 2006-01-26 19:54:26 +03:00 +++ 1.53/mysql-test/r/ps_1general.result 2006-04-25 04:27:16 +04:00 @@ -422,13 +422,10 @@ prepare stmt1 from ' select * into outfile ''data.txt'' from t1 '; execute stmt1 ; prepare stmt1 from ' optimize table t1 ' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt1 from ' analyze table t1 ' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt1 from ' checksum table t1 ' ; ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt1 from ' repair table t1 ' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt1 from ' restore table t1 from ''data.txt'' ' ; ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt1 from ' handler t1 open '; --- 1.26/mysql-test/t/ps_1general.test 2006-01-26 19:54:27 +03:00 +++ 1.27/mysql-test/t/ps_1general.test 2006-04-25 04:27:16 +04:00 @@ -453,13 +453,10 @@ prepare stmt1 from ' select * into outfile ''data.txt'' from t1 '; execute stmt1 ; ## ---error 1295 prepare stmt1 from ' optimize table t1 ' ; ---error 1295 prepare stmt1 from ' analyze table t1 ' ; --error 1295 prepare stmt1 from ' checksum table t1 ' ; ---error 1295 prepare stmt1 from ' repair table t1 ' ; --error 1295 prepare stmt1 from ' restore table t1 from ''data.txt'' ' ; --- 1.3/mysql-test/r/sp-dynamic.result 2005-12-07 17:01:06 +03:00 +++ 1.4/mysql-test/r/sp-dynamic.result 2006-04-25 04:27:16 +04:00 @@ -286,12 +286,12 @@ 1 select 1 supported 2 flush tables not supported 3 handler t1 open as ha not supported -4 analyze table t1 not supported +4 analyze table t1 supported 5 check table t1 not supported 6 checksum table t1 not supported 7 check table t1 not supported -8 optimize table t1 not supported -9 repair table t1 not supported +8 optimize table t1 supported +9 repair table t1 supported 10 describe extended select * from t1 supported 11 help help not supported 12 show databases supported --- 1.64/mysql-test/r/ps.result 2006-04-13 01:46:36 +04:00 +++ 1.65/mysql-test/r/ps.result 2006-04-25 04:27:16 +04:00 @@ -1056,3 +1056,104 @@ 1 9 3 7 drop table t1; +create table t1 (a int); +create table t2 like t1; +create table t3 like t2; +prepare stmt from "repair table t1"; +execute stmt; +Table Op Msg_type Msg_text +test.t1 repair status OK +execute stmt; +Table Op Msg_type Msg_text +test.t1 repair status OK +prepare stmt from "optimize table t1"; +execute stmt; +Table Op Msg_type Msg_text +test.t1 optimize status OK +execute stmt; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +prepare stmt from "analyze table t1"; +execute stmt; +Table Op Msg_type Msg_text +test.t1 analyze status Table is already up to date +execute stmt; +Table Op Msg_type Msg_text +test.t1 analyze status Table is already up to date +prepare stmt from "repair table t1, t2, t3"; +execute stmt; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +test.t3 repair status OK +execute stmt; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +test.t3 repair status OK +prepare stmt from "optimize table t1, t2, t3"; +execute stmt; +Table Op Msg_type Msg_text +test.t1 optimize status OK +test.t2 optimize status OK +test.t3 optimize status OK +execute stmt; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +test.t2 optimize status Table is already up to date +test.t3 optimize status Table is already up to date +prepare stmt from "analyze table t1, t2, t3"; +execute stmt; +Table Op Msg_type Msg_text +test.t1 analyze status Table is already up to date +test.t2 analyze status Table is already up to date +test.t3 analyze status Table is already up to date +execute stmt; +Table Op Msg_type Msg_text +test.t1 analyze status Table is already up to date +test.t2 analyze status Table is already up to date +test.t3 analyze status Table is already up to date +prepare stmt from "repair table t1, t4, t3"; +execute stmt; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t4 repair error Table 'test.t4' doesn't exist +test.t3 repair status OK +Warnings: +Error 1146 Table 'test.t4' doesn't exist +execute stmt; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t4 repair error Table 'test.t4' doesn't exist +test.t3 repair status OK +Warnings: +Error 1146 Table 'test.t4' doesn't exist +prepare stmt from "optimize table t1, t3, t4"; +execute stmt; +Table Op Msg_type Msg_text +test.t1 optimize status OK +test.t3 optimize status OK +test.t4 optimize error Table 'test.t4' doesn't exist +Warnings: +Error 1146 Table 'test.t4' doesn't exist +execute stmt; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +test.t3 optimize status Table is already up to date +test.t4 optimize error Table 'test.t4' doesn't exist +Warnings: +Error 1146 Table 'test.t4' doesn't exist +prepare stmt from "analyze table t4, t1"; +execute stmt; +Table Op Msg_type Msg_text +test.t4 analyze error Table 'test.t4' doesn't exist +test.t1 analyze status Table is already up to date +Warnings: +Error 1146 Table 'test.t4' doesn't exist +execute stmt; +Table Op Msg_type Msg_text +test.t4 analyze error Table 'test.t4' doesn't exist +test.t1 analyze status Table is already up to date +Warnings: +Error 1146 Table 'test.t4' doesn't exist +deallocate prepare stmt; --- 1.62/mysql-test/t/ps.test 2006-04-13 01:46:36 +04:00 +++ 1.63/mysql-test/t/ps.test 2006-04-25 04:27:16 +04:00 @@ -1110,4 +1110,40 @@ drop table t1; +# +# Bug#19308 "REPAIR/OPTIMIZE/ANALYZE supported in SP but not in PS". +# Add test coverage for the added commands. +# +create table t1 (a int); +create table t2 like t1; +create table t3 like t2; +prepare stmt from "repair table t1"; +execute stmt; +execute stmt; +prepare stmt from "optimize table t1"; +execute stmt; +execute stmt; +prepare stmt from "analyze table t1"; +execute stmt; +execute stmt; +prepare stmt from "repair table t1, t2, t3"; +execute stmt; +execute stmt; +prepare stmt from "optimize table t1, t2, t3"; +execute stmt; +execute stmt; +prepare stmt from "analyze table t1, t2, t3"; +execute stmt; +execute stmt; +prepare stmt from "repair table t1, t4, t3"; +execute stmt; +execute stmt; +prepare stmt from "optimize table t1, t3, t4"; +execute stmt; +execute stmt; +prepare stmt from "analyze table t4, t1"; +execute stmt; +execute stmt; +deallocate prepare stmt; + # End of 5.0 tests --- 1.175/sql/sql_prepare.cc 2006-04-13 01:46:36 +04:00 +++ 1.176/sql/sql_prepare.cc 2006-04-25 04:27:16 +04:00 @@ -1753,6 +1753,9 @@ case SQLCOM_CALL: case SQLCOM_CREATE_VIEW: case SQLCOM_DROP_VIEW: + case SQLCOM_REPAIR: + case SQLCOM_ANALYZE: + case SQLCOM_OPTIMIZE: break; default: