diff options
author | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-02-26 14:30:44 -0500 |
---|---|---|
committer | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-02-26 14:30:44 -0500 |
commit | 1636d00fa7fd6ff2b8d5a0117efc44d7997860fb (patch) | |
tree | 98b999d0b64cff83861d0e19ff89a040e7969f07 /sql/sp_head.cc | |
parent | dc8b4bacc5bb76540cb33cfdcaecf916b716fa89 (diff) | |
parent | 3a8a519acb3cb44ce861375a3343b04dc812ee66 (diff) | |
download | mariadb-git-1636d00fa7fd6ff2b8d5a0117efc44d7997860fb.tar.gz |
Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into mysql_cab_desk.:C:/source/c++/mysql-5.0-rpl
sql/item_func.cc:
Auto merged
sql/log.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index e2959cc4486..cabdd07b711 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1462,8 +1462,24 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, binlog_save_options= thd->options; if (need_binlog_call) { + query_id_t q; reset_dynamic(&thd->user_var_events); - mysql_bin_log.start_union_events(thd); + /* + In case of artificially constructed events for function calls + we have separate union for each such event and hence can't use + query_id of real calling statement as the start of all these + unions (this will break logic of replication of user-defined + variables). So we use artifical value which is guaranteed to + be greater than all query_id's of all statements belonging + to previous events/unions. + Possible alternative to this is logging of all function invocations + as one select and not resetting THD::user_var_events before + each invocation. + */ + VOID(pthread_mutex_lock(&LOCK_thread_count)); + q= ::query_id; + VOID(pthread_mutex_unlock(&LOCK_thread_count)); + mysql_bin_log.start_union_events(thd, q + 1); } /* |