• Aleksey Midenkov's avatar
    MDEV-23779 Error upon querying the view, that selecting from versioned table with partitions · ddea8f6a
    Aleksey Midenkov authored
    PARTITION clause in SELECT means query is non-versioned (see
    WITH_PARTITION_STORAGE_ENGINE in vers_setup_conds()).
    
    vers_setup_conds() expands such query to SYSTEM_TIME_ALL which is then
    added to VIEW specification. When VIEW is queried both clauses
    PARTITION and FOR SYSTEM_TIME ALL lead to ER_VERS_QUERY_IN_PARTITION
    (same place WITH_PARTITION_STORAGE_ENGINE).
    
    Fix removes FOR SYSTEM_TIME ALL from VIEW by accessing original
    SYSTEM_TIME clause: the one specified in parser. As a side-effect
    EXPLAIN SELECT displays SYSTEM_TIME specified in SELECT which is
    user-friendly.
    ddea8f6a
view.test 8.11 KB