diff options
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 5712ad38fa4..54f679bcf4c 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4996,6 +4996,18 @@ Item_func_sp::execute_impl(THD *thd, Field *return_value_fld) goto error; /* + Throw an error if a non-deterministic function is called while + statement-based replication (SBR) is active. + */ + if (!m_sp->m_chistics->detistic && + (mysql_bin_log.is_open() && + thd->variables.binlog_format == BINLOG_FORMAT_STMT)) + { + my_error(ER_BINLOG_ROW_RBR_TO_SBR, MYF(0)); + goto error; + } + + /* Disable the binlogging if this is not a SELECT statement. If this is a SELECT, leave binlogging on, so execute_function() code writes the function call into binlog. |