summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-01-15 19:16:18 +0100
committerSergei Golubchik <sergii@pisem.net>2013-01-15 19:16:18 +0100
commit9b9c138e2aaa036c0cb4e833e45be3f612b7d131 (patch)
tree09a37928b317b79a32f780470e95003689c3e8a0 /sql
parent1f0e6837d1a38b87a323972ee3fb432f463f6bc7 (diff)
downloadmariadb-git-9b9c138e2aaa036c0cb4e833e45be3f612b7d131.tar.gz
small cleanups
Diffstat (limited to 'sql')
-rw-r--r--sql/log.cc13
-rw-r--r--sql/sql_load.cc4
2 files changed, 10 insertions, 7 deletions
diff --git a/sql/log.cc b/sql/log.cc
index abda8c52d88..567b3c69833 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2070,15 +2070,17 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv)
binlog_trans_log_savepos(thd, (my_off_t*) sv);
/* Write it to the binary log */
- String log_query;
- if (log_query.append(STRING_WITH_LEN("SAVEPOINT ")) ||
+ char buf[1024];
+ String log_query(buf, sizeof(buf), &my_charset_bin);
+ if (log_query.copy(STRING_WITH_LEN("SAVEPOINT "), &my_charset_bin) ||
append_identifier(thd, &log_query,
thd->lex->ident.str, thd->lex->ident.length))
DBUG_RETURN(1);
int errcode= query_error_code(thd, thd->killed == NOT_KILLED);
Query_log_event qinfo(thd, log_query.ptr(), log_query.length(),
TRUE, FALSE, TRUE, errcode);
- DBUG_RETURN(mysql_bin_log.write(&qinfo));
+ int ret= mysql_bin_log.write(&qinfo);
+ DBUG_RETURN(ret);
}
static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)
@@ -2093,8 +2095,9 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)
if (unlikely(trans_has_updated_non_trans_table(thd) ||
(thd->variables.option_bits & OPTION_KEEP_LOG)))
{
- String log_query;
- if (log_query.append(STRING_WITH_LEN("ROLLBACK TO ")) ||
+ char buf[1024];
+ String log_query(buf, sizeof(buf), &my_charset_bin);
+ if (log_query.copy(STRING_WITH_LEN("ROLLBACK TO "), &my_charset_bin) ||
append_identifier(thd, &log_query,
thd->lex->ident.str, thd->lex->ident.length))
DBUG_RETURN(1);
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 98031c96225..6c27a9d123a 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -741,14 +741,14 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
List_iterator<Item> lu(thd->lex->update_list);
List_iterator<Item> lv(thd->lex->value_list);
- query_str.append(" SET ");
+ query_str.append(STRING_WITH_LEN(" SET "));
n= 0;
while ((item= lu++))
{
val= lv++;
if (n++)
- query_str.append(", ");
+ query_str.append(STRING_WITH_LEN(", "));
append_identifier(thd, &query_str, item->name, strlen(item->name));
query_str.append(val->name);
}