summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2006-02-18 17:26:30 +0100
committerguilhem@mysql.com <>2006-02-18 17:26:30 +0100
commit56bed24c926e7427002c342eef9cb3d0839aa780 (patch)
treef116e5166e64745d3a2d9e1b36b23de4e8815782 /sql/sp_head.cc
parent4c5d18b1505fe4fbbfd51268df0784d9c3faf983 (diff)
downloadmariadb-git-56bed24c926e7427002c342eef9cb3d0839aa780.tar.gz
Fix for BUG#14769 "Function fails to replicate if fails half-way (slave stops)":
if the function, invoked in a non-binlogged caller (e.g. SELECT, DO), failed half-way on the master, slave would stop and complain that error code between him and master mismatch. To solve this, when a stored function is invoked in a non-binlogged caller (e.g. SELECT, DO), we binlog the function call as SELECT instead of as DO (see revision comment of sp_head.cc for more). And: minor wording change in the help text. This cset will cause conflicts in 5.1, I'll merge.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 27dc0103335..aff773a32bc 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -736,13 +736,7 @@ int cmp_splocal_locations(Item_splocal * const *a, Item_splocal * const *b)
Statements that have is_update_query(stmt) == FALSE (e.g. SELECTs) are not
written into binary log. Instead we catch function calls the statement
makes and write it into binary log separately (see #3).
-
- We actually can easily write SELECT statements into the binary log in the
- right order (we don't have issues with const tables being unlocked early
- because SELECTs that use FUNCTIONs unlock all tables at once) We don't do
- it because replication slave thread currently can't execute SELECT
- statements. Fixing this is on the TODO.
-
+
2. PROCEDURE calls
CALL statements are not written into binary log. Instead
@@ -763,7 +757,7 @@ int cmp_splocal_locations(Item_splocal * const *a, Item_splocal * const *b)
function execution (grep for start_union_events and stop_union_events)
If the answers are No and Yes, we write the function call into the binary
- log as "DO spfunc(<param1value>, <param2value>, ...)"
+ log as "SELECT spfunc(<param1value>, <param2value>, ...)".
4. Miscellaneous issues.
@@ -1310,7 +1304,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
char buf[256];
String bufstr(buf, sizeof(buf), &my_charset_bin);
bufstr.length(0);
- bufstr.append(STRING_WITH_LEN("DO "));
+ bufstr.append(STRING_WITH_LEN("SELECT "));
append_identifier(thd, &bufstr, m_name.str, m_name.length);
bufstr.append('(');
for (uint i=0; i < argcount; i++)