• Oleksandr Byelkin's avatar
    MDEV-17124: mariadb 10.1.34, views and prepared statements: ERROR 1615... · f65ba9ae
    Oleksandr Byelkin authored
    MDEV-17124: mariadb 10.1.34, views and prepared statements:  ERROR 1615 (HY000): Prepared statement needs to be re-prepared
    
    The problem is that if table definition cache (TDC) is full of real tables
    which are in tables cache, view definition can not stay there so will be
    removed by its own underlying tables.
    In situation above old mechanism of detection matching definition in PS
    and current version always require reprepare and so prevent executing
    the PS.
    
    One work around is to increase TDC, other - improve version check for
    views/triggers (which is done here). Now in suspicious cases we check:
     - timestamp (microseconds) of the view to be sure that version really
       have changed;
     - time (microseconds) of creation of a trigger related to time
       (microseconds) of statement preparation.
    f65ba9ae
sql_trigger.h 10.7 KB