diff options
author | unknown <monty@mysql.com> | 2004-02-16 10:15:52 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-02-16 10:15:52 +0200 |
commit | d00fbce3083f11d071300447e11dab124debb2b7 (patch) | |
tree | f9bef14abcf4ef1e6145cb3c16e63c9a56e221e9 /sql | |
parent | a07e48eca04b1564da9868f229ba5d958994db69 (diff) | |
parent | 40ad9154930ca5d42649b776f84989cc372b060c (diff) | |
download | mariadb-git-d00fbce3083f11d071300447e11dab124debb2b7.tar.gz |
Merge with 4.0 to get fix for mysqlbinlog
mysql-test/r/mysqlbinlog.result:
Auto merged
mysql-test/r/select_found.result:
Auto merged
mysql-test/t/select_found.test:
Auto merged
sql/log_event.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_load.cc:
Auto merged
support-files/mysql.spec.sh:
Auto merged
client/mysqlbinlog.cc:
Merge with 4.0
configure.in:
Merge with 4.0
mysql-test/r/range.result:
Use local file
mysql-test/t/range.test:
Use local file
sql/share/english/errmsg.txt:
Use local file
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 18 | ||||
-rw-r--r-- | sql/log_event.h | 6 | ||||
-rw-r--r-- | sql/opt_range.cc | 1 | ||||
-rw-r--r-- | sql/sql_load.cc | 2 |
4 files changed, 19 insertions, 8 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index f64f740da30..a128b5809b2 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1218,7 +1218,7 @@ void Load_log_event::pack_info(Protocol *protocol) 18 + fname_len + 2 + // "LOAD DATA INFILE 'file''" 7 + // LOCAL 9 + // " REPLACE or IGNORE " - 11 + table_name_len + // "INTO TABLE table" + 13 + table_name_len*2 + // "INTO TABLE `table`" 21 + sql_ex.field_term_len*4 + 2 + // " FIELDS TERMINATED BY 'str'" 23 + sql_ex.enclosed_len*4 + 2 + // " OPTIONALLY ENCLOSED BY 'str'" 12 + sql_ex.escaped_len*4 + 2 + // " ESCAPED BY 'str'" @@ -1249,12 +1249,12 @@ void Load_log_event::pack_info(Protocol *protocol) else if (sql_ex.opt_flags & IGNORE_FLAG) pos= strmov(pos, " IGNORE "); - pos= strmov(pos ,"INTO TABLE "); + pos= strmov(pos ,"INTO TABLE `"); memcpy(pos, table_name, table_name_len); pos+= table_name_len; /* We have to create all optinal fields as the default is not empty */ - pos= strmov(pos, " FIELDS TERMINATED BY "); + pos= strmov(pos, "` FIELDS TERMINATED BY "); pos= pretty_print_str(pos, sql_ex.field_term, sql_ex.field_term_len); if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG) pos= strmov(pos, " OPTIONALLY "); @@ -1545,7 +1545,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db, else if (sql_ex.opt_flags & IGNORE_FLAG) fprintf(file," IGNORE "); - fprintf(file, "INTO TABLE %s ", table_name); + fprintf(file, "INTO TABLE `%s`", table_name); fprintf(file, " FIELDS TERMINATED BY "); pretty_print_str(file, sql_ex.field_term, sql_ex.field_term_len); @@ -2570,7 +2570,7 @@ Create_file_log_event(THD* thd_arg, sql_exchange* ex, char* block_arg, uint block_len_arg, bool using_trans) :Load_log_event(thd_arg,ex,db_arg,table_name_arg,fields_arg,handle_dup, using_trans), - fake_base(0),block(block_arg),block_len(block_len_arg), + fake_base(0), block(block_arg), event_buf(0), block_len(block_len_arg), file_id(thd_arg->file_id = mysql_bin_log.next_file_id()) { DBUG_ENTER("Create_file_log_event"); @@ -2634,8 +2634,14 @@ Create_file_log_event::Create_file_log_event(const char* buf, int len, int block_offset; DBUG_ENTER("Create_file_log_event"); - if (copy_log_event(buf,len,old_format)) + /* + We must make copy of 'buf' as this event may have to live over a + rotate log entry when used in mysqlbinlog + */ + if (!(event_buf= my_memdup(buf, len, MYF(MY_WME))) || + (copy_log_event(event_buf, len, old_format))) DBUG_VOID_RETURN; + if (!old_format) { file_id = uint4korr(buf + LOG_EVENT_HEADER_LEN + diff --git a/sql/log_event.h b/sql/log_event.h index 1a5f0543766..28d1f44df92 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -885,6 +885,7 @@ protected: bool fake_base; public: char* block; + const char *event_buf; uint block_len; uint file_id; bool inited_from_old; @@ -906,7 +907,10 @@ public: #endif Create_file_log_event(const char* buf, int event_len, bool old_format); - ~Create_file_log_event() {} + ~Create_file_log_event() + { + my_free((char*) event_buf, MYF(MY_ALLOW_ZERO_PTR)); + } Log_event_type get_type_code() { diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 1dbe883aef4..6f97a5afe94 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -496,6 +496,7 @@ SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg) return 0; // OOM } increment_use_count(1); + tmp->color= color; return tmp; } diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 45b76e44f28..f910e947720 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -94,7 +94,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, #endif char *db = table_list->db; // This is never null /* If no current database, use database where table is located */ - char *tdb= thd->db ? thd->db : db; + char *tdb= thd->db ? thd->db : db; // Result is never null bool transactional_table, log_delayed; ulong skip_lines= ex->skip_lines; DBUG_ENTER("mysql_load"); |