• guilhem@gbichot3.local's avatar
    Fix for BUG#19725 "Calls to SF in other database are not replicated · 3e760410
    guilhem@gbichot3.local authored
    correctly in some cases".
    In short, calls to a stored function located in another database
    than the default database, may fail to replicate if the call was made
    by SET, SELECT, or DO.
    Longer: when a stored function is called from a statement which does not go
    to binlog ("SET @A=somedb.myfunc()", "SELECT somedb.myfunc()",
    "DO somedb.myfunc()"), this crafted statement is binlogged:
    "SELECT myfunc();" (accompanied with a mention of the default database
    if there is one). So, if "somedb" is not the default database,
    the slave would fail to find myfunc(). The fix is to specify the
    function's database name in the crafted binlogged statement, like this:
    "SELECT somedb.myfunc();". Test added in rpl_sp.test.
    3e760410
rpl_sp.test 12.4 KB