From: Ole John Aske Date: December 1 2010 9:36pm Subject: bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3381 to 3382) Bug#58628 List-Archive: http://lists.mysql.com/commits/125717 X-Bug: 58628 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0895037329==" --===============0895037329== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 3382 Ole John Aske 2010-12-01 Addendum patch for bug#58628: Update of result file due to changed (improved) behaviour when constructing a REF key from 'out of bound' values. As the main fix will cause failing const key value ::copy() to be reevaluate inside JOIN::exec(), we will detect out of bound values (which will form an illegal/undefined REF key) before executing the access request. Previously these const REF keys was produced by JOIN::optimize() and any conversion/range errors was ignored. - Possibly causing undefined keys to be produced. These access request may then be ignored wo/ a Handler_read_key request being executed. modified: mysql-test/r/update.result 3381 Ole John Aske 2010-12-01 SPJ-scan-scan: Cherry picked fix for bug#58628 Incorrect result for 'WHERE NULL NOT IN () create_ref_for_key() allowed any constant part of a REF key to be evaluated and stored into the 'key_buff' during ::optimize(). These 'store_key*' was *not* kept in ref.key_copy[] as they where constant and we assumed we would not have to reevaluate them during JOIN::exec() However, during execute NULL values in REF key has to be detected as they may need special attention - as in 'Full scan on NULL key'. This is done by subselect_uniquesubquery_engine::copy_ref_key() which check if any keyparts evaluated to a NULL-value. As we didn't keep a store_key for a constant value, a NULL-constant was not detected by subselect_uniquesubquery_engine::copy_ref_key() ! This fixs modifies create_ref_for_key() to check if a NULL-value constant was produced - In these cases it keeps the store_key, which then will be reevaluated in JOIN::exec() and trigger correct handling of NULL-valued keys. modified: mysql-test/r/func_in.result mysql-test/t/func_in.test sql/sql_select.cc sql/sql_select.h === modified file 'mysql-test/r/update.result' --- a/mysql-test/r/update.result 2010-07-19 09:03:52 +0000 +++ b/mysql-test/r/update.result 2010-12-01 21:35:17 +0000 @@ -404,7 +404,7 @@ user_id show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -414,7 +414,7 @@ user_id show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -423,7 +423,7 @@ UPDATE t1 SET user_id=null WHERE request show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 1 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -432,7 +432,7 @@ UPDATE t1 SET user_id=null WHERE request show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 1 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 --===============0895037329== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/ole.john.aske@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: ole.john.aske@stripped\ # 2ls122fz6roancu1 # target_branch: file:///home/oleja/mysql/mysql-5.1-telco-7.0-spj-\ # scan-scan/ # testament_sha1: 9888188b3344c47395299f84f72dec843f1cd2f6 # timestamp: 2010-12-01 22:36:23 +0100 # source_branch: bzr+ssh://oaske@stripped/bzrroot/server\ # /mysql-5.1-telco-7.0-spj/ # base_revision_id: ole.john.aske@stripped\ # vc14367mtq6m55v0 # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWXn0XL4AAd/fgAAwWOf/93Nx 1gC////wUATrN7d3O4uPbdae91s9vXCShAGhNTyPRTYpowpptT1DIAZBoNNIBMmRqp7JqJo9QDIy YmTEAGCUCEKbEE0an6j0p6GKeoeo0Bo009JoCRSp6egppspgRpkeoGTR6QAwmgAkiIn6phMptGhD QnqMBGQ0YmEeof4HU3dZYaj762jLmlMLXId6MSHyYOfjONxljkafBhl1+2q/sfeGTIb+zQ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