------------------------------------------------------------
revno: 2840
tags: clone-5.0.88-build
committer: Georgi Kodinov <joro@sun.com>
branch nick: merge-5.0-bugteam
timestamp: Wed 2009-11-04 11:13:55 +0200
message:
  version change
------------------------------------------------------------
revno: 2839
committer: Georgi Kodinov <joro@sun.com>
branch nick: merge-5.0-bugteam
timestamp: Wed 2009-11-04 11:13:22 +0200
message:
  Disabled the rpl_killed_ddl test in 5.0 because of bug #45520
------------------------------------------------------------
revno: 2838
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: mysql-5.0-bugteam
timestamp: Tue 2009-11-03 16:17:06 -0200
message:
  Fix compiler warnings -- tag unused parameters.
------------------------------------------------------------
revno: 2837
committer: Konstantin Osipov <kostja@sun.com>
branch nick: 5.0-41756
timestamp: Tue 2009-11-03 19:58:54 +0300
message:
  A fix and a test case for
  Bug#41756 "Strange error messages about locks from InnoDB".
  
  In JT_EQ_REF (join_read_key()) access method,
  don't try to unlock rows in the handler, unless certain that
  a) they were locked
  b) they are not used.
  
  Unlocking of rows is done by the logic of the nested join loop,
  and is unaware of the possible caching that the access method may
  have. This could lead to double unlocking, when a row
  was unlocked first after reading into the cache, and then
  when taken from cache, as well as to unlocking of rows which
  were actually used (but taken from cache).
  
  Delegate part of the unlocking logic to the access method,
  and in JT_EQ_REF count how many times a record was actually
  used in the join. Unlock it only if it's usage count is 0.
  
  Implemented review comments.
------------------------------------------------------------
revno: 2836
committer: <Li-Bing.Song@sun.com>
branch nick: mysql-5.0-bugteam
timestamp: Tue 2009-11-03 17:00:41 +0800
message:
  BUG#48216 Replication fails on all slaves after upgrade to 5.0.86 on master
  
  When a sessione is closed, all temporary tables of the session are automatically 
  dropped and are binlogged. But it will be binlogged with wrong database names when
  the length of the temporary tables' database names are greater than the 
  length of the current database name or the current database is not set.
  
  Query_log_event's db_len is forgot to set when Query_log_event's db is set.
  This patch wrote code to set db_len immediately after db has set.
------------------------------------------------------------
revno: 2835
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: mysql-5.0-bugteam
timestamp: Mon 2009-11-02 18:10:21 -0200
message:
  Bug#44952: Ndbd file system inconsistency error
  
  Backport a ndb patch: fix bug with crash during restart, where
  a mbyte incorrectly could be skipped, leading to "end of log
  wo/ finding gci".
------------------------------------------------------------
revno: 2834
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 41728-5.0
timestamp: Tue 2009-09-29 09:55:53 -0300
message:
  Bug#41728: Dropped symbol but no soname change
  
  Restore a stub of the removed mysql_odbc_escape_string function
  to fix a ABI breakage. The function was intended to be private
  and used only by Connector/ODBC, but, unfortunately, it was exported
  as part of the ABI. Nonetheless, only a stub is restored as the
  original function is inherently broken and shouldn't be used.
  
  This restoration only applies to MySQL 5.0. This will be addressed
  differently in later versions -- reworked library versioning.
------------------------------------------------------------
revno: 2833
committer: Alexey Kopytov <Alexey.Kopytov@Sun.com>
branch nick: mysql-5.0-bugteam
timestamp: Fri 2009-10-30 19:16:25 +0300
message:
  Automerge.
    ------------------------------------------------------------
    revno: 2819.2.1
    committer: Alexey Kopytov <Alexey.Kopytov@Sun.com>
    branch nick: my50-bug48131
    timestamp: Fri 2009-10-30 18:54:53 +0300
    message:
      Bug #48131: crash group by with rollup, distinct, filesort,
                  with temporary tables
      
      There were two problems the test case from this bug was
      triggering:
      
      1. JOIN::rollup_init() was supposed to wrap all constant Items
      into another object for queries with the WITH ROLLUP modifier
      to ensure they are never considered as constants and therefore
      are written into temporary tables if the optimizer chooses to
      employ them for DISTINCT/GROUP BY handling.
      
      However, JOIN::rollup_init() was called before
      make_join_statistics(), so Items corresponding to fields in
      const tables could not be handled as intended, which was
      causing all kinds of problems later in the query execution. In
      particular, create_tmp_table() assumed all constant items
      except "hidden" ones to be removed earlier by remove_const()
      which led to improperly initialized Field objects for the
      temporary table being created. This is what was causing crashes
      and valgrind errors in storage engines.
      
      2. Even when the above problem had been fixed, the query from
      the test case produced incorrect results due to some
      DISTINCT/GROUP BY optimizations being performed by the
      optimizer that are inapplicable in the WITH ROLLUP case.
      
      Fixed by disabling inapplicable DISTINCT/GROUP BY optimizations
      when the WITH ROLLUP modifier is present, and splitting the
      const-wrapping part of JOIN::rollup_init() into a separate
      method which is now invoked after make_join_statistics() when
      the const tables are already known.
------------------------------------------------------------
revno: 2832
committer: Georgi Kodinov <joro@sun.com>
branch nick: merge-5.0-bugteam
timestamp: Fri 2009-10-30 16:34:54 +0200
message:
  merge from 5.0-main
    ------------------------------------------------------------
    revno: 2819.1.1
    author: karen.langford@sun.com
    committer: MySQL Build Team <build@mysql.com>
    branch nick: mysql-5.0
    timestamp: Mon 2009-10-26 19:20:02 +0100
    message:
      Merge from mysql-5.0.87-release
    ------------------------------------------------------------
    revno: 2812.2.1
    tags: mysql-5.0.87
    committer: Hery Ramilison <hery.ramilison@sun.com>
    branch nick: mysql-5.0.87-release
    timestamp: Thu 2009-10-15 00:40:40 +0200
    message:
      Added make targets 'test-bt-fast' and 'test-bt-debug-fast'
      Put variable declaration at the beginning of a block
------------------------------------------------------------
revno: 2831
committer: Georgi Kodinov <joro@sun.com>
branch nick: B48291-5.0-bugteam
timestamp: Fri 2009-10-30 15:15:43 +0200
message:
  Bug #48291 : crash with row() operator,select into @var, and 
    subquery returning multiple rows
  
  Error handling was missing when handling subqueires in WHERE 
  and when assigning a SELECT result to a @variable.
  This caused crash(es). 
  
  Fixed by adding error handling code to both the WHERE 
  condition evaluation and to assignment to an @variable.
------------------------------------------------------------
revno: 2830
committer: Georgi Kodinov <joro@sun.com>
branch nick: B48293-5.0-bugteam
timestamp: Fri 2009-10-30 11:40:44 +0200
message:
  Bug #48293: crash with procedure analyse, view with > 10 columns,
  having clause...
  
  The fix for bug 46184 was not very complete. It was not covering
  views using temporary tables and multiple tables in a FROM clause.
  Fixed by reverting the fix for 46184 and making a more general
  check that is checking at the right execution stage and for all
  of the non-supported cases.
  Now PROCEDURE ANALYZE on non-top level SELECT is also forbidden.
  Updated the analyse.test and subselect.test accordingly.
------------------------------------------------------------
revno: 2829
committer: Georgi Kodinov <joro@sun.com>
branch nick: B42116-5.0-bugteam
timestamp: Thu 2009-10-29 17:24:29 +0200
message:
  Bug #42116 : Mysql crash on specific query
  
  Queries with nested outer joins may lead to crashes or 
  bad results because an internal data structure is not handled
  correctly.
  The optimizer uses bitmaps of nested JOINs to determine
  if certain table can be placed at a certain place in the
  JOIN order.
  It does maintain a bitmap describing in which JOINs 
  last placed table is nested.
  When it puts a table it makes sure the bit of every JOIN that
  contains the table in question is set (because JOINs can be nested).
  It does that by recursively setting the bit for the next enclosing
  JOIN when this is the first table in the JOIN and recursively 
  resetting the bit if it's the last table in the JOIN.
  When it removes a table from the join order it should do the
  opposite : recursively unset the bit if it's the only remaining 
  table in this join and and recursively set the bit if it's removing
  the last table of a JOIN.
  There was an error in how the bits was set for the upper levels :
  when removing a table it was setting the bit for all the enclosing 
  nested JOINs even if there were more tables left in the current JOIN
  (which practically means that the upper nested JOINs were not affected).
  Fixed by stopping the recursion at the relevant level.
------------------------------------------------------------
revno: 2828
committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
branch nick: mysql-5.0-bugteam
timestamp: Wed 2009-10-28 13:15:33 +0400
message:
  Bug#41049 does syntax "grant" case insensitive?
  test result fix
------------------------------------------------------------
revno: 2827
committer: Georgi Kodinov <joro@sun.com>
branch nick: B47320-5.0-bugteam
timestamp: Tue 2009-10-27 15:11:06 +0200
message:
  merge from 4.1
    ------------------------------------------------------------
    revno: 1616.3133.7
    committer: Georgi Kodinov <joro@sun.com>
    branch nick: B47320-4.1
    timestamp: Tue 2009-10-20 13:09:16 +0300
    message:
      Bug #47320: OpenSSL client does not check YaSSL server certificate
      
      Removed the verify callback, as it's not needed to verify even self
      signed certificates and is a security problem.
    ------------------------------------------------------------
    revno: 1616.3133.6
    committer: Timothy Smith <timothy.smith@sun.com>
    branch nick: 41-b27294
    timestamp: Mon 2008-12-01 12:46:57 -0700
    message:
      Minor clean up in build system; make BUILD/compile-pentium-debug work with
      current auto tools (create BUILD/autorun.sh based on 5.0 version).  Remove
      some generated files from version control.  Ignore some generated files.
    ------------------------------------------------------------
    revno: 1616.3133.5
    committer: Timothy Smith <timothy.smith@sun.com>
    branch nick: 41-b27294
    timestamp: Mon 2008-12-01 12:37:04 -0700
    message:
      Bug #27294: crash with innodb_locks_unsafe_for_binlog=1
      
      Back-port 5.0 fix to 4.1.  Fix Bug#27294 by using trx returned by
      check_trx_exists() instead of prebuilt->trx. This has been fixed in 5.1 in
      r782.
    ------------------------------------------------------------
    revno: 1616.3133.4
    author: kent.boortz@sun.com
    committer: Build Team <bteam@astra04>
    branch nick: mysql-4.1
    timestamp: Thu 2008-11-27 11:00:24 +0100
    message:
      Raise version number after cloning 4.1.25
    ------------------------------------------------------------
    revno: 1616.3133.3
    tags: clone-4.1.25-build
    committer: Alexey Botchkov <holyfoot@mysql.com>
    branch nick: 32167
    timestamp: Sat 2008-07-26 14:39:31 +0500
    message:
      Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
            
            test_if_data_home_dir fixed to look into real path.
            Checks added to mi_open for symlinks into data home directory.
      modified:
        include/my_sys.h
        include/myisam.h
        myisam/mi_check.c
        myisam/mi_open.c
        myisam/mi_static.c
        myisam/myisamchk.c
        myisam/myisamdef.h
        mysql-test/r/symlink.result
        mysys/my_symlink.c
        sql/mysql_priv.h
        sql/mysqld.cc
        sql/sql_parse.cc
      
      per-file messages:
        include/my_sys.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink interface added
        include/myisam.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlink interface added
        myisam/mi_check.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile calls modified
        myisam/mi_open.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          code added to mi_open to check for symlinks into data home directory.
          mi_open_datafile now accepts 'original' file path to check if it's
          an allowed symlink.
        myisam/mi_static.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invlaid_symlink defined
        myisam/myisamchk.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile call modified
        myisam/myisamdef.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile interface modified - 'real_path' parameter added
        mysql-test/r/symlink.test
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error codes corrected as some patch now rejected pointing inside datahome
        mysql-test/r/symlink.result
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected in the result
        mysys/my_symlink.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink() implementsd
          my_realpath() now returns the 'realpath' even if a file isn't a symlink
        sql/mysql_priv.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          test_if_data_home_dir interface
        sql/mysqld.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlik set with the 'test_if_data_home_dir'
        sql/sql_parse.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected
          test_if_data_home_dir code fixed
    ------------------------------------------------------------
    revno: 1616.3133.2
    committer: Daniel Fischer <df@sun.com>
    branch nick: mysql-4.1
    timestamp: Wed 2008-06-11 20:56:45 +0200
    message:
      update from bk repository
------------------------------------------------------------
revno: 2826
committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
branch nick: mysql-5.0-bugteam
timestamp: Tue 2009-10-27 15:02:58 +0400
message:
  automerge
    ------------------------------------------------------------
    revno: 2824.1.1
    committer: Sergey Vojtovich <svoj@sun.com>
    branch nick: mysql-5.0-bugteam-quickfix
    timestamp: Tue 2009-10-27 12:37:57 +0400
    message:
      An addition to fix for
      
      BUG#41597 - After rename of user, there are additional grants
                  when grants are reapplied.
      
      Fixed build failure on Windows. Added missing cast.
------------------------------------------------------------
revno: 2825
committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
branch nick: mysql-5.0-bugteam
timestamp: Tue 2009-10-27 12:09:19 +0400
message:
  Bug#41049 does syntax "grant" case insensitive?
  Problem 1:
  column_priv_hash uses utf8_general_ci collation
  for the key comparison. The key consists of user name,
  db name and table name. Thus user with privileges on table t1
  is able to perform the same operation on T1
  (the similar situation with user name & db name, see acl_cache).
  So collation which is used for column_priv_hash and acl_cache
  should be case sensitive.
  The fix:
  replace system_charset_info with my_charset_utf8_bin for
  column_priv_hash and acl_cache
  Problem 2:
  The same situation with proc_priv_hash, func_priv_hash,
  the only difference is that Routine name is case insensitive.
  So the fix is to use my_charset_utf8_bin for
  proc_priv_hash & func_priv_hash and convert routine name into lower
  case before writing the element into the hash and
  before looking up the key.
  Additional fix: mysql.procs_priv Routine_name field collation
  is changed to utf8_general_ci.
  It's necessary for REVOKE command
  (to find a field by routine hash element values).
  Note: 
  It's safe for lower-case-table-names mode too because
  db name & table name are converted into lower case
  (see GRANT_NAME::GRANT_NAME).
------------------------------------------------------------
revno: 2824
committer: Georgi Kodinov <joro@sun.com>
branch nick: B47780-5.0-bugteam
timestamp: Wed 2009-10-21 11:43:45 +0300
message:
  Bug #47780: crash when comparing GIS items from subquery
        
  If the first argument to GeomFromWKB function is a geometry
  field then the function just returns its value.
  However in doing so it's not preserving first argument's 
  null_value flag and this causes unexpected null value to
  be returned to the calling function.
        
  Fixed by updating the null_value of the GeomFromWKB function
  in such cases (and all other cases that return a NULL e.g.
  because of not enough memory for the return buffer).
------------------------------------------------------------
revno: 2823
committer: Ramil Kalimullin <ramil@mysql.com>
branch nick: b48258-5.0-bugteam
timestamp: Fri 2009-10-23 16:26:48 +0500
message:
  Fix for bug#48258: Assertion failed when using a spatial index
  
  Problem: involving a spatial index for "non-spatial" queries
  (that don't containt MBRXXX() functions) may lead to failed assert.
  
  Fix: don't use spatial indexes in such cases.
------------------------------------------------------------
revno: 2822
committer: Ramil Kalimullin <ramil@mysql.com>
branch nick: b47019-5.0-bugteam
timestamp: Wed 2009-10-21 14:04:08 +0500
message:
  Fix for bug#47019: Assertion failed: 0, file .\rt_mbr.c, 
  line 138 when forcing a spatial index
  
  Problem: "Spatial indexes can be involved in the search 
  for queries that use a function such as MBRContains() 
  or MBRWithin() in the WHERE clause".
  Using spatial indexes for JOINs with =, <=> etc.
  predicates is incorrect.
  
  Fix: disable spatial indexes for such queries.
------------------------------------------------------------
revno: 2821
committer: Tatiana A. Nurnberg <azundris@mysql.com>
branch nick: 50-28141
timestamp: Tue 2009-10-20 20:38:56 -0700
message:
  auto-merge
    ------------------------------------------------------------
    revno: 2817.1.2
    committer: Satya B <satya.bn@sun.com>
    branch nick: mysql-5.0-bugteam-41597
    timestamp: Tue 2009-10-20 12:21:58 +0530
    message:
      merge to mysql-5.0-bugteam
    ------------------------------------------------------------
    revno: 2817.1.1
    committer: Satya B <satya.bn@sun.com>
    branch nick: mysql-5.0-bugteam-41597
    timestamp: Tue 2009-10-20 11:47:57 +0530
    message:
      Fix for Bug #41597 - After rename of user, there are additional grants when 
                           grants are reapplied.
      
      
      After renaming a user and trying to re-apply grants results in additional
      grants.
      
      This is because we use username as part of the key for GRANT_TABLE structure.
      When the user is renamed, we only change the username stored and the hash key
      still contains the old user name and this results in the extra privileges
      
      Fixed by rebuilding the hash key and updating the column_priv_hash structure
      when the user is renamed
------------------------------------------------------------
revno: 2820
committer: Tatiana A. Nurnberg <azundris@mysql.com>
branch nick: 50-28141
timestamp: Mon 2009-10-19 21:42:10 -0700
message:
  Bug#28141: Control C on query waiting on lock causes ERROR 1053 (server shutdown)
  
  If a thread is killed in the server, we throw "shutdown" only if one is actually in
  progress; otherwise, we throw "query interrupted".
  
  Control-C in the mysql command-line client is "incremental" now.
  First Control-C sends KILL QUERY (when connected to 5.0+ server, otherwise, see next)
  Next  Control-C sends KILL CONNECTION
  Next  Control-C aborts client.
  
  As the first two steps only pertain to an existing query,
  Control-C will abort the client right away if no query is running.
  
  client will give more detailed/consistent feedback on Control-C now.
------------------------------------------------------------
revno: 2819
committer: Joerg Bruehe <joerg@mysql.com>
branch nick: mysql-5.0
timestamp: Fri 2009-10-16 14:29:41 +0200
message:
  Merge 5.0-bugteam (compile fix) into main 5.0
    ------------------------------------------------------------
    revno: 2818.1.3
    committer: Joerg Bruehe <joerg@mysql.com>
    branch nick: push-5.0
    timestamp: Fri 2009-10-16 14:09:31 +0200
    message:
      Merge the Windows compile fix into the push tree.
        ------------------------------------------------------------
        revno: 2816.1.2
        committer: Joerg Bruehe <joerg@mysql.com>
        branch nick: bug47923-5.0
        timestamp: Fri 2009-10-16 14:06:33 +0200
        message:
          Compile fix for Windows:
          Use "#ifdef", not plain "#if".
    ------------------------------------------------------------
    revno: 2818.1.2
    committer: Joerg Bruehe <joerg@mysql.com>
    branch nick: push-5.0
    timestamp: Thu 2009-10-15 20:14:07 +0200
    message:
      Merge bug fix into push tree.
        ------------------------------------------------------------
        revno: 2816.1.1
        committer: Joerg Bruehe <joerg@mysql.com>
        branch nick: bug47923-5.0
        timestamp: Thu 2009-10-08 21:58:17 +0200
        message:
          Fix bug#47923  New "mf_keycache.c" requires thread support
          
          The bug is a compilation issue:
          Function "find_key_block()" had thread operations
          which were not guarded by "#if THREAD", add that now.
    ------------------------------------------------------------
    revno: 2818.1.1
    committer: Georgi Kodinov <joro@sun.com>
    branch nick: fix-5.0-pe-stage
    timestamp: Wed 2009-10-14 18:44:22 +0300
    message:
      version change
------------------------------------------------------------
revno: 2818
committer: Georgi Kodinov <joro@sun.com>
branch nick: fix-5.0-pe-stage
timestamp: Wed 2009-10-14 17:33:20 +0300
message:
  merged main to mysql-5.0-bugteam
    ------------------------------------------------------------
    revno: 2812.1.9
    author: sunanda.menon@sun.com
    committer: MySQL Build Team <build@mysql.com>
    branch nick: mysql-5.0
    timestamp: Wed 2009-10-14 10:16:04 +0200
    message:
      Null-merge from mysql-5.0.84sp1-release
        ------------------------------------------------------------
        revno: 2774.17.4
        tags: mysql-5.0.84sp1
        committer: MySQL Build Team <build@mysql.com>
        branch nick: mysql-5.0.84sp1-release
        timestamp: Wed 2009-09-30 14:26:15 +0200
        message:
          Backport into build-200909301147-5.0.84sp1
          
          > ------------------------------------------------------------
          > revno: 2802.1.1
          > tags: mysql-5.0.86
          > revision-id: hery.ramilison@sun.com-20090909185217-mooeczu391ztp2fz
          > parent: joro@sun.com-20090902123318-8qe40pr91xmui5ue
          > committer: hery <hery.ramilison@sun.com>
          > branch nick: mysql-5.0.86-release
          > timestamp: Wed 2009-09-09 20:52:17 +0200
          > message:
          >   change c++ comment to c comment
        ------------------------------------------------------------
        revno: 2774.17.3
        committer: MySQL Build Team <build@mysql.com>
        branch nick: mysql-5.0.84sp1-release
        timestamp: Wed 2009-09-30 14:24:59 +0200
        message:
          Backport into build-200909301147-5.0.84sp1
          
          > ------------------------------------------------------------
          > revno: 2796
          > revision-id: sergey.glukhov@sun.com-20090827102219-sgjz0v5t1rfccs14
          > parent: joro@sun.com-20090824122803-1d5jlaysjc7a7j6q
          > committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
          > branch nick: mysql-5.0-bugteam
          > timestamp: Thu 2009-08-27 15:22:19 +0500
          > message:
          >   Bug#46184 Crash, SELECT ... FROM derived table procedure analyze
          >   The crash happens because select_union object is used as result set
          >   for queries which have derived tables.
          >   select_union use temporary table as data storage and if
          >   fields count exceeds 10(count of values for procedure ANALYSE())
          >   then we get a crash on fill_record() function.
        ------------------------------------------------------------
        revno: 2774.17.2
        committer: MySQL Build Team <build@mysql.com>
        branch nick: mysql-5.0.84sp1-release
        timestamp: Wed 2009-09-30 14:22:38 +0200
        message:
          Backport into build-200909301147-5.0.84sp1
          
          > ------------------------------------------------------------
          > revno: 2791.2.3
          > revision-id: joro@sun.com-20090827114042-h55n7qp9990bl6ge
          > parent: anurag.shekhar@sun.com-20090831073231-e55y1hsck6n08ux8
          > committer: Georgi Kodinov <joro@sun.com>
          > branch nick: B46749-5.0-bugteam
          > timestamp: Thu 2009-08-27 14:40:42 +0300
          > message:
          >   Bug #46749: Segfault in add_key_fields() with outer subquery level 
          >     field references
          >   
          >   This error requires a combination of factors : 
          >   1. An "impossible where" in the outermost SELECT
          >   2. An aggregate in the outermost SELECT
          >   3. A correlated subquery with a WHERE clause that includes an outer 
          >   field reference as a top level WHERE sargable predicate
          >   
          >   When JOIN::optimize detects an "impossible WHERE" it will bail out
          >   without doing the rest of the work and initializations. It will not
          >   call make_join_statistics() as well.  And make_join_statistics fills 
          >   in various structures for each table referenced.
          >   When processing the result of the "impossible WHERE" the query must
          >   send a single row of data if there are aggregate functions in it.
          >   In this case the server marks all the aggregates as having received 
          >   no rows and calls the relevant Item::val_xxx() method on the SELECT
          >   list. However if this SELECT list happens to contain a correlated 
          >   subquery this subquery is evaluated in a normal evaluation mode.
          >   And if this correlated subquery has a reference to a field from the 
          >   outermost "impossible where" SELECT the add_key_fields will mistakenly
          >   consider the outer field reference as a "local" field reference when 
          >   looking for sargable predicates.
          >   But since the SELECT where the outer field reference refers to is not
          >   completely initialized due to the "impossible WHERE" in this level
          >   we'll get a NULL pointer reference.
          >   Fixed by making a better condition for discovering if a field is "local"
          >   to the SELECT level being processed. 
          >   It's not enough to look for OUTER_REF_TABLE_BIT in this case since 
          >   for outer references to constant tables the Item_field::used_tables() 
          >   will return 0 regardless of whether the field reference is from the 
          >   local SELECT or not.
        ------------------------------------------------------------
        revno: 2774.17.1
        author: sunanda.menon@sun.com
        committer: Timothy <Timothy.Smith@Sun.COM>
        branch nick: mysql-5.0.84sp1-release
        timestamp: Wed 2009-09-30 13:53:41 +0200
        message:
          Set version number for mysql-5.0.84sp1 release
    ------------------------------------------------------------
    revno: 2812.1.8
    author: karen.langford@sun.com
    committer: MySQL Build Team <build@mysql.com>
    branch nick: mysql-5.0
    timestamp: Tue 2009-10-13 20:50:37 +0200
    message:
      Raise version number after cloning 5.0.87
