• Georgi Kodinov's avatar
    Bug #46175: NULL read_view and consistent read assertion · 43d7fb43
    Georgi Kodinov authored
    The SE API requires mysql to notify the storage engine that
    it's going to read certain tables at the beginning of the 
    statement (by calling start_stmt(), store_lock() or
    external_lock()).
    These are typically called by the lock_tables(). 
    However SHOW CREATE TABLE is not pre-locking the tables
    because it's not expected to access the data at all.
    But for some view definitions (that include comparing a
    date/datetime/timestamp column to a string returning
    scalar subquery) the JOIN::prepare may still access data
    when materializing the scalar non-correlated subquery
    in Arg_comparator::can_compare_as_dates().
    Fixed by not materializing the subquery when the function
    is called in a SHOW/EXPLAIN/CREATE VIEW
    43d7fb43
item_cmpfunc.cc 135 KB