diff options
author | unknown <guilhem@gbichot3.local> | 2007-01-08 22:01:06 +0100 |
---|---|---|
committer | unknown <guilhem@gbichot3.local> | 2007-01-08 22:01:06 +0100 |
commit | 3a05847abb0e7a05c3d1997293fe2d332730ed7a (patch) | |
tree | 29e33fd92576a4b44560d1f28fc2bfdf59c53fcd /sql/sql_trigger.cc | |
parent | 26ecdbd0248b8c6605e3d3baa58047f090d063ac (diff) | |
download | mariadb-git-3a05847abb0e7a05c3d1997293fe2d332730ed7a.tar.gz |
Fix for BUG#19725 "Calls to SF in other database are not replicated
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.
mysql-test/r/rpl_sp.result:
Because I moved the SHOW BINLOG EVENTS down a bit, big portions of its
output move. Also, the function's database name appears in
SELECT statements.
mysql-test/t/rpl_sp.test:
Adding test for BUG#19725.
Moving the SHOW BINLOG EVENTS down, it is run at the very end to
test everything.
sql/sp_head.cc:
When binlogging a "SELECT myfunc()" (when a stored function is executed
inside a statement which does not go to the binlog (like a SET,
SELECT, DO), we need to write "SELECT db_of_myfunc().myfunc()",
because the function may be in a database which is not the default
database.
Diffstat (limited to 'sql/sql_trigger.cc')
0 files changed, 0 insertions, 0 deletions