Commit d43ee040 authored by unknown's avatar unknown

Code/testcase cleanups


mysql-test/r/insert_select.result:
  Fixed results
mysql-test/r/join_outer.result:
  New test case for inner join table dependency
mysql-test/t/insert_select.test:
  Remove not used drop tables.
  Fixed table names
mysql-test/t/join_outer.test:
  New test case for inner join table dependency
sql/slave.cc:
  Simple optimizations
parent 41b70aef
...@@ -21,8 +21,7 @@ payoutID ...@@ -21,8 +21,7 @@ payoutID
20 20
22 22
drop table t1,t2; drop table t1,t2;
DROP TABLE IF EXISTS crash1,crash2; CREATE TABLE `t1` (
CREATE TABLE `crash1` (
`numeropost` bigint(20) unsigned NOT NULL default '0', `numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0', `icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment, `numreponse` bigint(20) unsigned NOT NULL auto_increment,
...@@ -37,7 +36,7 @@ KEY `date` (`date`), ...@@ -37,7 +36,7 @@ KEY `date` (`date`),
KEY `pseudo` (`pseudo`), KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`) KEY `numreponse` (`numreponse`)
) TYPE=MyISAM; ) TYPE=MyISAM;
CREATE TABLE `crash2` ( CREATE TABLE `t2` (
`numeropost` bigint(20) unsigned NOT NULL default '0', `numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0', `icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment, `numreponse` bigint(20) unsigned NOT NULL auto_increment,
...@@ -52,22 +51,20 @@ KEY `date` (`date`), ...@@ -52,22 +51,20 @@ KEY `date` (`date`),
KEY `pseudo` (`pseudo`), KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`) KEY `numreponse` (`numreponse`)
) TYPE=MyISAM; ) TYPE=MyISAM;
INSERT INTO crash2 INSERT INTO t2
(numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES (numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES
(9,1,56,'test','joce','2001-07-25 13:50:53' (9,1,56,'test','joce','2001-07-25 13:50:53'
,3649052399,0); ,3649052399,0);
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip) INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM crash2 SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC; WHERE numeropost=9 ORDER BY numreponse ASC;
show variables like '%bulk%'; show variables like '%bulk%';
Variable_name Value Variable_name Value
bulk_insert_buffer_size 8388608 bulk_insert_buffer_size 8388608
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip) INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM crash2 SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC; WHERE numeropost=9 ORDER BY numreponse ASC;
DROP TABLE IF EXISTS crash1,crash2; DROP TABLE t1,t2;
drop table if exists t1;
drop table if exists t2;
create table t1(a int, unique(a)); create table t1(a int, unique(a));
insert into t1 values(2); insert into t1 values(2);
create table t2(a int); create table t2(a int);
......
...@@ -659,3 +659,11 @@ i i i ...@@ -659,3 +659,11 @@ i i i
1 NULL NULL 1 NULL NULL
2 2 2 2 2 2
drop table t1,t2,t3; drop table t1,t2,t3;
create table t1 (f1 integer,f2 integer,f3 integer);
create table t2 (f2 integer,f4 integer);
create table t3 (f3 integer,f5 integer);
select * from t1
left outer join t2 using (f2)
left outer join t3 using (f3);
Unknown column 'test.t2.f3' in 'on clause'
drop table t1,t2,t3;
...@@ -12,13 +12,13 @@ insert into t2 (payoutID) SELECT payoutID+10 FROM t1; ...@@ -12,13 +12,13 @@ insert into t2 (payoutID) SELECT payoutID+10 FROM t1;
insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1; insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1;
select * from t2; select * from t2;
drop table t1,t2; drop table t1,t2;
# #
# bug in bulk insert optimization # bug in bulk insert optimization
# test case by Fournier Jocelyn <joc@presence-pc.com> # test case by Fournier Jocelyn <joc@presence-pc.com>
# #
DROP TABLE IF EXISTS crash1,crash2; CREATE TABLE `t1` (
CREATE TABLE `crash1` (
`numeropost` bigint(20) unsigned NOT NULL default '0', `numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0', `icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment, `numreponse` bigint(20) unsigned NOT NULL auto_increment,
...@@ -34,7 +34,7 @@ CREATE TABLE `crash1` ( ...@@ -34,7 +34,7 @@ CREATE TABLE `crash1` (
KEY `numreponse` (`numreponse`) KEY `numreponse` (`numreponse`)
) TYPE=MyISAM; ) TYPE=MyISAM;
CREATE TABLE `crash2` ( CREATE TABLE `t2` (
`numeropost` bigint(20) unsigned NOT NULL default '0', `numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0', `icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment, `numreponse` bigint(20) unsigned NOT NULL auto_increment,
...@@ -50,30 +50,27 @@ CREATE TABLE `crash2` ( ...@@ -50,30 +50,27 @@ CREATE TABLE `crash2` (
KEY `numreponse` (`numreponse`) KEY `numreponse` (`numreponse`)
) TYPE=MyISAM; ) TYPE=MyISAM;
INSERT INTO crash2 INSERT INTO t2
(numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES (numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES
(9,1,56,'test','joce','2001-07-25 13:50:53' (9,1,56,'test','joce','2001-07-25 13:50:53'
,3649052399,0); ,3649052399,0);
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip) INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM crash2 SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC; WHERE numeropost=9 ORDER BY numreponse ASC;
show variables like '%bulk%'; show variables like '%bulk%';
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip) INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM crash2 SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC; WHERE numeropost=9 ORDER BY numreponse ASC;
DROP TABLE IF EXISTS crash1,crash2; DROP TABLE t1,t2;
# Addendum by Guilhem:
# Check if a partly-completed INSERT SELECT in a MyISAM table goes # Check if a partly-completed INSERT SELECT in a MyISAM table goes
# into the binlog # into the binlog
drop table if exists t1;
drop table if exists t2;
create table t1(a int, unique(a)); create table t1(a int, unique(a));
insert into t1 values(2); insert into t1 values(2);
create table t2(a int); create table t2(a int);
......
...@@ -425,3 +425,15 @@ insert into t2 values(2),(3); ...@@ -425,3 +425,15 @@ insert into t2 values(2),(3);
insert into t3 values(2),(4); insert into t3 values(2),(4);
select * from t1 natural left join t2 natural left join t3; select * from t1 natural left join t2 natural left join t3;
drop table t1,t2,t3; drop table t1,t2,t3;
#
# Test of USING
#
create table t1 (f1 integer,f2 integer,f3 integer);
create table t2 (f2 integer,f4 integer);
create table t3 (f3 integer,f5 integer);
--error 1054
select * from t1
left outer join t2 using (f2)
left outer join t3 using (f3);
drop table t1,t2,t3;
...@@ -2146,8 +2146,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) ...@@ -2146,8 +2146,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
DBUG_ASSERT(rli->sql_thd==thd); DBUG_ASSERT(rli->sql_thd==thd);
if (sql_slave_killed(thd,rli)) if (sql_slave_killed(thd,rli))
{ {
/* do not forget to free ev ! */ delete ev;
if (ev) delete ev;
return 1; return 1;
} }
if (ev) if (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