• unknown's avatar
    Fixed bug #28272: crash that occurs when running an EXPLAIN command · 577ffdb2
    unknown authored
    for a query over an empty table right after its creation. 
    The crash is the result of an attempt made by JOIN::optimize to evaluate
    the WHERE condition when no records have been actually read.
    The added test case can reproduce the crash only with InnoDB tables and
    only with 5.0.x.
     
    
    
    mysql-test/r/innodb_mysql.result:
      Added a test case for bug #28272.
    mysql-test/t/innodb_mysql.test:
      Added a test case for bug #28272.
    sql/sql_select.cc:
      Fixed bug #28272: crash that occurs when running an EXPLAIN command
      for a query over an empty table right after its creation. 
      The crash is the result of an attempt made by JOIN::optimize to evaluate
      the WHERE condition when no records have been actually read.
      Such attempts could be observed only with EXPLAIN commands.
      Now at the optimization phase the WHERE condition is never evaluated if 
      there is no record previously read from the table.
    577ffdb2
sql_select.cc 301 KB