• unknown's avatar
    Bug#28249 Query Cache returns wrong result with concurrent insert / certain lock · 9a7f0fe2
    unknown authored
    A race condition in the integration between MyISAM and the query cache code 
    caused the query cache to fail to invalidate itself on concurrently inserted
    data.
    
    This patch fix this problem by using the existing handler interface which, upon
    each statement cache attempt, compare the size of the table as viewed from the 
    cache writing thread and with any snap shot of the global table state. If the
    two sizes are different the global table size is unknown and the current
    statement can't be cached.
    
    
    mysql-test/r/query_cache.result:
      Added test case
    mysql-test/t/query_cache.test:
      Added test case
    sql/ha_myisam.cc:
      - Implemented handler interface for ha_myisam class to dermine if the table
       belonging to the currently processed statement can be cached or not.
    sql/ha_myisam.h:
      - Implemented handler interface for ha_myisam class to dermine if the table
       belonging to the currently processed statement can be cached or not.
    sql/handler.h:
      - Documented register_query_cache_table method in the handler interface.
    9a7f0fe2
query_cache.test 26.9 KB