summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-02-28 18:42:49 +0100
committerSergei Golubchik <sergii@pisem.net>2013-02-28 18:42:49 +0100
commit8161c6772d144d6a4f08fc924ff6e6e403d1371d (patch)
tree3f1fe5f8048a163da4eadf0f86c1fd2a3007955d /client
parent154aac8eb002f5d167153e09f1d13570989521e0 (diff)
parent31c06437c970d4d0f4ec0301acac9c56e0ed29b5 (diff)
downloadmariadb-git-8161c6772d144d6a4f08fc924ff6e6e403d1371d.tar.gz
merge with mysql-5.5.30 minus few incorrect or not applicable changesets
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc12
-rw-r--r--client/mysqlbinlog.cc4
-rw-r--r--client/mysqldump.c17
3 files changed, 13 insertions, 20 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 70c0815ea76..ad792abc23f 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2312,17 +2312,19 @@ static bool add_line(String &buffer,char *line,char *in_string,
{
uint length=(uint) (out-line);
- if (!truncated &&
- (length < 9 ||
- my_strnncoll (charset_info,
- (uchar *)line, 9, (const uchar *) "delimiter", 9)))
+ if (!truncated && (length < 9 ||
+ my_strnncoll (charset_info, (uchar *)line, 9,
+ (const uchar *) "delimiter", 9) ||
+ (*in_string || *ml_comment)))
{
/*
Don't add a new line in case there's a DELIMITER command to be
added to the glob buffer (e.g. on processing a line like
"<command>;DELIMITER <non-eof>") : similar to how a new line is
not added in the case when the DELIMITER is the first command
- entered with an empty glob buffer.
+ entered with an empty glob buffer. However, if the delimiter is
+ part of a string or a comment, the new line should be added. (e.g.
+ SELECT '\ndelimiter\n';\n)
*/
*out++='\n';
length++;
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 777e68902dd..2dae59af9ea 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -2430,6 +2430,8 @@ int main(int argc, char** argv)
else
load_processor.init_by_cur_dir();
+ fprintf(result_file, "/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;\n");
+
fprintf(result_file,
"/*!40019 SET @@session.max_insert_delayed_threads=0*/;\n");
@@ -2480,6 +2482,8 @@ int main(int argc, char** argv)
"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n"
"/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n");
+ fprintf(result_file, "/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;\n");
+
if (tmpdir.list)
free_tmpdir(&tmpdir);
if (result_file != stdout)
diff --git a/client/mysqldump.c b/client/mysqldump.c
index c4dda927c68..11bb74ae1d7 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2298,7 +2298,6 @@ static uint dump_routines_for_db(char *db)
const char *routine_type[]= {"FUNCTION", "PROCEDURE"};
char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3];
char *routine_name;
- char *query_str;
int i;
FILE *sql_file= md_result_file;
MYSQL_RES *routine_res, *routine_list_res;
@@ -2392,17 +2391,6 @@ static uint dump_routines_for_db(char *db)
fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;\n",
routine_type[i], routine_name);
- query_str= cover_definer_clause(row[2], strlen(row[2]),
- C_STRING_WITH_LEN("50020"),
- C_STRING_WITH_LEN("50003"),
- C_STRING_WITH_LEN(" FUNCTION"));
-
- if (!query_str)
- query_str= cover_definer_clause(row[2], strlen(row[2]),
- C_STRING_WITH_LEN("50020"),
- C_STRING_WITH_LEN("50003"),
- C_STRING_WITH_LEN(" PROCEDURE"));
-
if (mysql_num_fields(routine_res) >= 6)
{
if (switch_db_collation(sql_file, db_name_buff, ";",
@@ -2440,9 +2428,9 @@ static uint dump_routines_for_db(char *db)
fprintf(sql_file,
"DELIMITER ;;\n"
- "/*!50003 %s */;;\n"
+ "%s ;;\n"
"DELIMITER ;\n",
- (const char *) (query_str != NULL ? query_str : row[2]));
+ (const char *) row[2]);
restore_sql_mode(sql_file, ";");
@@ -2457,7 +2445,6 @@ static uint dump_routines_for_db(char *db)
}
}
- my_free(query_str);
}
} /* end of routine printing */
mysql_free_result(routine_res);