summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <gbichot@production.mysql.com>2006-03-13 19:59:27 +0100
committerunknown <gbichot@production.mysql.com>2006-03-13 19:59:27 +0100
commit628e86df112ce77674616ea07f10a22a4e276bcc (patch)
tree720ef43fd7ef27c95bef6fae61d3c125c18604b1 /sql
parentd0b16b6ee57b1fcdbcc91d3237d76703bb1b2fe2 (diff)
parent3debde2b2ba3db45b6e3ab60bd0c3248bf7c09b8 (diff)
downloadmariadb-git-628e86df112ce77674616ea07f10a22a4e276bcc.tar.gz
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into production.mysql.com:/usersnfs/gbichot/mysql-5.1-new
Diffstat (limited to 'sql')
-rw-r--r--sql/item_create.cc4
-rw-r--r--sql/item_func.cc1
-rw-r--r--sql/item_strfunc.cc1
-rw-r--r--sql/set_var.cc1
-rw-r--r--sql/sql_lex.cc1
-rw-r--r--sql/sql_lex.h6
-rw-r--r--sql/sql_parse.cc8
-rw-r--r--sql/sql_yacc.yy2
8 files changed, 18 insertions, 6 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 17f1fbca471..fb1ef0ee9bc 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -431,7 +431,9 @@ Item *create_func_unhex(Item* a)
Item *create_func_uuid(void)
{
- return new Item_func_uuid();
+ THD *thd= current_thd;
+ thd->lex->binlog_row_based_if_mixed= 1;
+ return new(thd->mem_root) Item_func_uuid();
}
Item *create_func_version(void)
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 0277ac96a4e..34fd07e5a16 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2657,7 +2657,6 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func,
u_d->name.str, ER(ER_UNKNOWN_ERROR));
DBUG_RETURN(TRUE);
}
- thd->set_current_stmt_binlog_row_based_if_mixed();
DBUG_RETURN(FALSE);
}
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index eb89eb7708c..a3e47154bc3 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -3002,7 +3002,6 @@ String *Item_func_uuid::val_str(String *str)
char *s;
THD *thd= current_thd;
- thd->set_current_stmt_binlog_row_based_if_mixed();
pthread_mutex_lock(&LOCK_uuid_generator);
if (! uuid_time) /* first UUID() call. initializing data */
{
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 443a11736b5..899bb8543df 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1271,7 +1271,6 @@ bool sys_var_thd_binlog_format::is_readonly() const
*/
if (thd->spcont && thd->prelocked_mode)
{
- DBUG_ASSERT(thd->variables.binlog_format != BINLOG_FORMAT_ROW);
my_error(ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT, MYF(0));
return 1;
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index b5c1d943339..e1a519060aa 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -191,6 +191,7 @@ void lex_start(THD *thd, const uchar *buf, uint length)
lex->nest_level=0 ;
lex->allow_sum_func= 0;
lex->in_sum_func= NULL;
+ lex->binlog_row_based_if_mixed= 0;
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 66f097a101c..59ebdd2a1cc 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -880,7 +880,11 @@ typedef struct st_lex
uint8 create_view_check;
bool drop_if_exists, drop_temporary, local_file, one_shot_set;
bool in_comment, ignore_space, verbose, no_write_to_binlog;
- bool tx_chain, tx_release;
+ /*
+ binlog_row_based_if_mixed tells if the parsing stage detected that some
+ items require row-based binlogging to give a reliable binlog/replication.
+ */
+ bool tx_chain, tx_release, binlog_row_based_if_mixed;
/*
Special JOIN::prepare mode: changing of query is prohibited.
When creating a view, we need to just check its syntax omitting
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 112d2e3440a..871c8bdff9f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2446,6 +2446,9 @@ mysql_execute_command(THD *thd)
statistic_increment(thd->status_var.com_stat[lex->sql_command],
&LOCK_status);
+ if (lex->binlog_row_based_if_mixed)
+ thd->set_current_stmt_binlog_row_based_if_mixed();
+
switch (lex->sql_command) {
case SQLCOM_SELECT:
{
@@ -5065,6 +5068,8 @@ end_with_restore_list:
send_ok(thd);
break;
}
+
+end:
thd->proc_info="query end";
/*
@@ -5095,7 +5100,8 @@ end_with_restore_list:
DBUG_RETURN(res || thd->net.report_error);
error:
- DBUG_RETURN(1);
+ res= 1; // would be better to set res=1 before "goto error"
+ goto end;
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index a2e8f10d706..d654020ebd9 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -6425,6 +6425,8 @@ simple_expr:
if (udf->type == UDFTYPE_AGGREGATE)
Select->in_sum_expr--;
+ Lex->binlog_row_based_if_mixed= 1;
+
switch (udf->returns) {
case STRING_RESULT:
if (udf->type == UDFTYPE_FUNCTION)