• Sergei Golubchik's avatar
    MDEV-6603 SBR failure upon executing a prepared statement with input... · 30ea6ddd
    Sergei Golubchik authored
    MDEV-6603 SBR failure upon executing a prepared statement with input placeholder under anonymous block
    
    Normally, Prepared_statement object rewrites the query on execution
    to replace ?-placeholders with values. The rewritten query may be written
    to logs (including binlog) or stored in the query cache.
    
    But for compound statements, the whole block is prepared and executed,
    while contained statements are logged individually. So it doesn't make
    sense to rewrite the original statement block. Instead, we need to rewrite
    every contained statement. SP is already doing it to replace SP variables
    with values. Let it rewrite PS parameters too in the same loop.
    30ea6ddd
sql_yacc.yy 489 KB