Commit 16f3cb03 authored by unknown's avatar unknown

fixes after merge of 4.1.


mysql-test/r/subselect.result:
  correcting non-ascii chars hosed by automerge as usual
mysql-test/t/subselect.test:
  correcting non-ascii chars hosed by automerge as usual
sql/log_event.cc:
  correcting bad manual merge. ZERO_LEN is not needed in 5.0, as ::exec_event() just tell()s the relay log instead
  of using get_event_len().
sql/log_event.h:
  get_event_len() is not needed in 5.0, ZERO_LEN neither.
sql/slave.cc:
  fixes to take into account 5.0 specificities in replication. ZERO_LEN is not needed.
parent bec38058
...@@ -1160,7 +1160,7 @@ Code2 char(2) NOT NULL default '', ...@@ -1160,7 +1160,7 @@ Code2 char(2) NOT NULL default '',
PRIMARY KEY (Code) PRIMARY KEY (Code)
) ENGINE=MyISAM; ) ENGINE=MyISAM;
INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU');
INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azrbaycan','Federal Republic','Heydr liyev',144,'AZ');
select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent);
Continent Name Population Continent Name Population
Oceania Sydney 3276207 Oceania Sydney 3276207
...@@ -2512,7 +2512,7 @@ Code2 char(2) NOT NULL default '' ...@@ -2512,7 +2512,7 @@ Code2 char(2) NOT NULL default ''
) ENGINE=MyISAM; ) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX');
INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS');
INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes franaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF');
INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM');
/*!40000 ALTER TABLE t1 ENABLE KEYS */; /*!40000 ALTER TABLE t1 ENABLE KEYS */;
SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200);
......
...@@ -665,7 +665,7 @@ CREATE TABLE t2 ( ...@@ -665,7 +665,7 @@ CREATE TABLE t2 (
) ENGINE=MyISAM; ) ENGINE=MyISAM;
INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU');
INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azrbaycan','Federal Republic','Heydr liyev',144,'AZ');
select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent);
...@@ -1526,7 +1526,7 @@ CREATE TABLE t1 ( ...@@ -1526,7 +1526,7 @@ CREATE TABLE t1 (
) ENGINE=MyISAM; ) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX');
INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS');
INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes franaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF');
INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM');
/*!40000 ALTER TABLE t1 ENABLE KEYS */; /*!40000 ALTER TABLE t1 ENABLE KEYS */;
SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200);
...@@ -1962,7 +1962,6 @@ insert into t1 values ('1'); ...@@ -1962,7 +1962,6 @@ insert into t1 values ('1');
select * from (select max(fld) from t1) as foo; select * from (select max(fld) from t1) as foo;
drop table t1; drop table t1;
# #
# BUG #10308: purge log with subselect # BUG #10308: purge log with subselect
# #
......
...@@ -2992,12 +2992,9 @@ Rotate_log_event::Rotate_log_event(THD* thd_arg, ...@@ -2992,12 +2992,9 @@ Rotate_log_event::Rotate_log_event(THD* thd_arg,
#endif #endif
Rotate_log_event::Rotate_log_event(const char* buf, int event_len,
bool old_format)
:Log_event(buf, old_format), new_log_ident(0), flags(DUP_NAME)
Rotate_log_event::Rotate_log_event(const char* buf, uint event_len, Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event) const Format_description_log_event* description_event)
:Log_event(buf, description_event) ,new_log_ident(NULL),alloced(0) :Log_event(buf, description_event) ,new_log_ident(0), flags(DUP_NAME)
{ {
DBUG_ENTER("Rotate_log_event::Rotate_log_event(char*,...)"); DBUG_ENTER("Rotate_log_event::Rotate_log_event(char*,...)");
// The caller will ensure that event_len is what we have at EVENT_LEN_OFFSET // The caller will ensure that event_len is what we have at EVENT_LEN_OFFSET
...@@ -3027,7 +3024,6 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len, ...@@ -3027,7 +3024,6 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
bool Rotate_log_event::write(IO_CACHE* file) bool Rotate_log_event::write(IO_CACHE* file)
{ {
char buf[ROTATE_HEADER_LEN]; char buf[ROTATE_HEADER_LEN];
DBUG_ASSERT(!(flags & ZERO_LEN)); // such an event cannot be written
int8store(buf + R_POS_OFFSET, pos); int8store(buf + R_POS_OFFSET, pos);
return (write_header(file, ROTATE_HEADER_LEN + ident_len) || return (write_header(file, ROTATE_HEADER_LEN + ident_len) ||
my_b_safe_write(file, (byte*)buf, ROTATE_HEADER_LEN) || my_b_safe_write(file, (byte*)buf, ROTATE_HEADER_LEN) ||
......
...@@ -640,13 +640,6 @@ class Log_event ...@@ -640,13 +640,6 @@ class Log_event
const char **error, const char **error,
const Format_description_log_event const Format_description_log_event
*description_event); *description_event);
virtual int get_event_len()
{
return (cached_event_len ? cached_event_len :
(cached_event_len = LOG_EVENT_HEADER_LEN + get_data_size()));
}
static Log_event* read_log_event(const char* buf, int event_len,
const char **error, bool old_format);
/* returns the human readable name of the event's type */ /* returns the human readable name of the event's type */
const char* get_type_str(); const char* get_type_str();
}; };
...@@ -1255,7 +1248,6 @@ class Rotate_log_event: public Log_event ...@@ -1255,7 +1248,6 @@ class Rotate_log_event: public Log_event
{ {
public: public:
enum { enum {
ZERO_LEN= 1, // if event should report 0 as its length
DUP_NAME= 2 // if constructor should dup the string argument DUP_NAME= 2 // if constructor should dup the string argument
}; };
const char* new_log_ident; const char* new_log_ident;
...@@ -1282,14 +1274,6 @@ class Rotate_log_event: public Log_event ...@@ -1282,14 +1274,6 @@ class Rotate_log_event: public Log_event
my_free((gptr) new_log_ident, MYF(MY_ALLOW_ZERO_PTR)); my_free((gptr) new_log_ident, MYF(MY_ALLOW_ZERO_PTR));
} }
Log_event_type get_type_code() { return ROTATE_EVENT;} Log_event_type get_type_code() { return ROTATE_EVENT;}
virtual int get_event_len()
{
if (flags & ZERO_LEN)
return 0;
if (cached_event_len == 0)
cached_event_len= LOG_EVENT_HEADER_LEN + get_data_size();
return cached_event_len;
}
int get_data_size() { return ident_len + ROTATE_HEADER_LEN;} int get_data_size() { return ident_len + ROTATE_HEADER_LEN;}
bool is_valid() const { return new_log_ident != 0; } bool is_valid() const { return new_log_ident != 0; }
#ifndef MYSQL_CLIENT #ifndef MYSQL_CLIENT
......
...@@ -4438,10 +4438,12 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) ...@@ -4438,10 +4438,12 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
if (buf[EVENT_TYPE_OFFSET]!=FORMAT_DESCRIPTION_EVENT && if (buf[EVENT_TYPE_OFFSET]!=FORMAT_DESCRIPTION_EVENT &&
buf[EVENT_TYPE_OFFSET]!=ROTATE_EVENT && buf[EVENT_TYPE_OFFSET]!=ROTATE_EVENT &&
buf[EVENT_TYPE_OFFSET]!=STOP_EVENT) buf[EVENT_TYPE_OFFSET]!=STOP_EVENT)
{
mi->master_log_pos+= inc_pos; mi->master_log_pos+= inc_pos;
memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN); memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN);
DBUG_ASSERT(rli->ign_master_log_name_end[0]); DBUG_ASSERT(rli->ign_master_log_name_end[0]);
rli->ign_master_log_pos_end= mi->master_log_pos; rli->ign_master_log_pos_end= mi->master_log_pos;
}
rli->relay_log.signal_update(); // the slave SQL thread needs to re-check rli->relay_log.signal_update(); // the slave SQL thread needs to re-check
DBUG_PRINT("info", ("master_log_pos: %d, event originating from the same server, ignored", (ulong) mi->master_log_pos)); DBUG_PRINT("info", ("master_log_pos: %d, event originating from the same server, ignored", (ulong) mi->master_log_pos));
} }
...@@ -4850,8 +4852,7 @@ Log_event* next_event(RELAY_LOG_INFO* rli) ...@@ -4850,8 +4852,7 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
DBUG_PRINT("info",("seeing an ignored end segment")); DBUG_PRINT("info",("seeing an ignored end segment"));
ev= new Rotate_log_event(thd, rli->ign_master_log_name_end, ev= new Rotate_log_event(thd, rli->ign_master_log_name_end,
0, rli->ign_master_log_pos_end, 0, rli->ign_master_log_pos_end,
Rotate_log_event::DUP_NAME | Rotate_log_event::DUP_NAME);
Rotate_log_event::ZERO_LEN);
rli->ign_master_log_name_end[0]= 0; rli->ign_master_log_name_end[0]= 0;
if (unlikely(!ev)) if (unlikely(!ev))
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment