mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
be4a1c2e94
BitKeeper/deleted/.del-rpl_row_multi_update3.test~fcf9a2234bd0f1b: Delete: mysql-test/t/rpl_row_multi_update3.test BitKeeper/deleted/.del-rpl_row_multi_update3.test~b366698f8379f38f: Delete: mysql-test/extra/rpl_tests/rpl_row_multi_update3.test BitKeeper/deleted/.del-rpl_row_multi_update3.result~1a3a8438eaaf11f2: Delete: mysql-test/r/rpl_row_multi_update3.result mysql-test/t/rpl_ndb_commit_afterflush.test: added comments mysql-test/r/rpl_ndb_commit_afterflush.result: New results file mysql-test/t/rpl_ddl.test: Added to skip default ndb engine mysql-test/t/rpl_ndb_ddl.test: new wrapper for ndb mysql-test/r/rpl_ndb_ddl.result: new wrapper for ndb mysql-test/t/rpl_insert_ignore.test: Added to skip ndb if default engine mysql-test/t/rpl_ndb_insert_ignore.test: New wrapper for ndb mysql-test/r/rpl_ndb_insert_ignore.result: New Results file mysql-test/t/rpl_multi_update2.test: Updated to skip ndb default engine + added comments mysql-test/t/rpl_ndb_multi_update2.test: New ndb wrapper for test case mysql-test/t/rpl_ndb_multi_update2-slave.opt: New slave option file to go with new NDB test wrapper mysql-test/r/rpl_ndb_multi_update2.result: New results file mysql-test/t/rpl_multi_update3.test: Updated to skip ndb default engine + added comments mysql-test/t/rpl_ndb_multi_update3.test: New ndb wrapper for test case mysql-test/r/rpl_ndb_multi_update3.result: New results file mysql-test/t/rpl_relayrotate.test: added comments and ability to sjip when ndb is default engine mysql-test/t/rpl_ndb_relayrotate.test: New wrapper for ndb mysql-test/t/rpl_ndb_relayrotate-slave.opt: New option file for ndb slave mysql-test/r/rpl_ndb_relayrotate.result: New results file mysql-test/t/rpl_loaddata.test: Updated mysql-test/t/rpl_multi_update.test: Updated mysql-test/t/rpl_relay_space_myisam.test: Updated mysql-test/t/rpl_row_001.test: Updated mysql-test/t/rpl_row_blob_myisam.test: Updated mysql-test/t/rpl_row_charset.test: Updated mysql-test/t/rpl_row_delayed_ins.test: Updated mysql-test/t/rpl_row_log.test: Updated mysql-test/t/rpl_row_UUID.test: Updated mysql-test/t/rpl_auto_increment.test: Updated mysql-test/t/rpl_commit_after_flush.test: Updated mysql-test/t/rpl_deadlock_innodb.test: Updated mysql-test/t/rpl_failed_optimize.test: Updated mysql-test/t/rpl_foreign_key_innodb.test: Updated mysql-test/t/rpl_insert_id_pk.test: Updated mysql-test/t/rpl_insert_id.test: Updated mysql-test/t/rpl_relay_space_innodb.test: Updated mysql-test/t/rpl_row_blob_innodb.test: Updated mysql-test/t/rpl_row_func003.test: Updated mysql-test/t/rpl_row_log_innodb.test: Updated mysql-test/t/rpl_row_sp002_innodb.test: Updated mysql-test/t/rpl_row_sp003.test: Updated mysql-test/t/rpl_row_sp006_InnoDB.test: Updated mysql-test/t/rpl_row_sp007_innodb.test: Updated mysql-test/t/rpl_ndb_row_001.test: New wrapper for ndb mysql-test/r/rpl_ndb_row_001.result: New results file mysql-test/t/rpl_ndb_UUID.test: New wrapper for ndb mysql-test/r/rpl_ndb_UUID.result: New results file mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test: Updated with order by mysql-test/r/rpl_row_delayed_ins.result: Updated results file mysql-test/t/rpl_ndb_charset.test: New wrapper for ndb mysql-test/r/rpl_ndb_charset.result: New results file mysql-test/t/rpl_row_until.test: Updated to skip when ndb is default. ndb bin logs are different size, so test would need to be rewitten for ndb mysql-test/t/rpl_row_max_relay_size.test: Updated mysql-test/t/rpl_row_sp008.test: Removed show binlog as it is not needed for test mysql-test/r/rpl_row_sp008.result: Updated results mysql-test/t/rpl_row_basic_11bugs.test: Removed show binlog as it is not needed for test mysql-test/r/rpl_row_basic_11bugs.result: Updated results BitKeeper/deleted/.del-rpl_ndb_max_relay_size.test~afa6834a51627676: Delete: mysql-test/t/rpl_ndb_max_relay_size.test BitKeeper/deleted/.del-rpl_ndb_max_relay_size.result~1e944e2782e270d8: Delete: mysql-test/r/rpl_ndb_max_relay_size.result mysql-test/t/disabled.def: Updated
196 lines
3.4 KiB
Text
196 lines
3.4 KiB
Text
stop slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
reset master;
|
|
reset slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
start slave;
|
|
|
|
-------- Test for BUG#9361 --------
|
|
CREATE TABLE t1 (
|
|
a int unsigned not null auto_increment primary key,
|
|
b int unsigned
|
|
) ENGINE=NDB;
|
|
CREATE TABLE t2 (
|
|
a int unsigned not null auto_increment primary key,
|
|
b int unsigned
|
|
) ENGINE=NDB;
|
|
INSERT INTO t1 VALUES (NULL, 0);
|
|
INSERT INTO t1 SELECT NULL, 0 FROM t1;
|
|
INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
|
|
SELECT * FROM t1 ORDER BY a;
|
|
a b
|
|
1 0
|
|
2 0
|
|
SELECT * FROM t2 ORDER BY a;
|
|
a b
|
|
1 0
|
|
2 1
|
|
UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
|
|
SELECT * FROM t1 ORDER BY a;
|
|
a b
|
|
1 0
|
|
2 0
|
|
SELECT * FROM t2 ORDER BY a;
|
|
a b
|
|
1 6
|
|
2 6
|
|
SELECT * FROM t1 ORDER BY a;
|
|
a b
|
|
1 0
|
|
2 0
|
|
SELECT * FROM t2 ORDER BY a;
|
|
a b
|
|
1 6
|
|
2 6
|
|
drop table t1,t2;
|
|
|
|
-------- Test 1 for BUG#9361 --------
|
|
DROP TABLE IF EXISTS t1;
|
|
DROP TABLE IF EXISTS t2;
|
|
CREATE TABLE t1 (
|
|
a1 char(30),
|
|
a2 int,
|
|
a3 int,
|
|
a4 char(30),
|
|
a5 char(30)
|
|
);
|
|
CREATE TABLE t2 (
|
|
b1 int,
|
|
b2 char(30)
|
|
);
|
|
INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
|
|
INSERT INTO t2 VALUES (1, 'baz');
|
|
UPDATE t1 a, t2
|
|
SET a.a1 = 'No'
|
|
WHERE a.a2 =
|
|
(SELECT b1
|
|
FROM t2
|
|
WHERE b2 = 'baz')
|
|
AND a.a3 IS NULL
|
|
AND a.a4 = 'foo'
|
|
AND a.a5 = 'bar';
|
|
SELECT * FROM t1;
|
|
a1 a2 a3 a4 a5
|
|
No 1 NULL foo bar
|
|
SELECT * FROM t2;
|
|
b1 b2
|
|
1 baz
|
|
DROP TABLE t1, t2;
|
|
|
|
-------- Test 2 for BUG#9361 --------
|
|
DROP TABLE IF EXISTS t1;
|
|
DROP TABLE IF EXISTS t2;
|
|
DROP TABLE IF EXISTS t3;
|
|
CREATE TABLE t1 (
|
|
i INT,
|
|
j INT,
|
|
x INT,
|
|
y INT,
|
|
z INT
|
|
);
|
|
CREATE TABLE t2 (
|
|
i INT,
|
|
k INT,
|
|
x INT,
|
|
y INT,
|
|
z INT
|
|
);
|
|
CREATE TABLE t3 (
|
|
j INT,
|
|
k INT,
|
|
x INT,
|
|
y INT,
|
|
z INT
|
|
);
|
|
INSERT INTO t1 VALUES ( 1, 2,13,14,15);
|
|
INSERT INTO t2 VALUES ( 1, 3,23,24,25);
|
|
INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
|
|
UPDATE t1 AS a
|
|
INNER JOIN t2 AS b
|
|
ON a.i = b.i
|
|
INNER JOIN t3 AS c
|
|
ON a.j = c.j AND b.k = c.k
|
|
SET a.x = b.x,
|
|
a.y = b.y,
|
|
a.z = (
|
|
SELECT sum(z)
|
|
FROM t3
|
|
WHERE y = 34
|
|
)
|
|
WHERE b.x = 23;
|
|
SELECT * FROM t1;
|
|
i j x y z
|
|
1 2 23 24 71
|
|
DROP TABLE t1, t2, t3;
|
|
DROP TABLE IF EXISTS t1;
|
|
Warnings:
|
|
Note 1051 Unknown table 't1'
|
|
DROP TABLE IF EXISTS t2;
|
|
Warnings:
|
|
Note 1051 Unknown table 't2'
|
|
CREATE TABLE t1 (
|
|
idp int(11) NOT NULL default '0',
|
|
idpro int(11) default NULL,
|
|
price decimal(19,4) default NULL,
|
|
PRIMARY KEY (idp)
|
|
);
|
|
CREATE TABLE t2 (
|
|
idpro int(11) NOT NULL default '0',
|
|
price decimal(19,4) default NULL,
|
|
nbprice int(11) default NULL,
|
|
PRIMARY KEY (idpro)
|
|
);
|
|
INSERT INTO t1 VALUES
|
|
(1,1,'3.0000'),
|
|
(2,2,'1.0000'),
|
|
(3,1,'1.0000'),
|
|
(4,1,'4.0000'),
|
|
(5,3,'2.0000'),
|
|
(6,2,'4.0000');
|
|
INSERT INTO t2 VALUES
|
|
(1,'0.0000',0),
|
|
(2,'0.0000',0),
|
|
(3,'0.0000',0);
|
|
update
|
|
t2
|
|
join
|
|
( select idpro, min(price) as min_price, count(*) as nbr_price
|
|
from t1
|
|
where idpro>0 and price>0
|
|
group by idpro
|
|
) as table_price
|
|
on t2.idpro = table_price.idpro
|
|
set t2.price = table_price.min_price,
|
|
t2.nbprice = table_price.nbr_price;
|
|
select "-- MASTER AFTER JOIN --" as "";
|
|
|
|
-- MASTER AFTER JOIN --
|
|
select * from t1;
|
|
idp idpro price
|
|
1 1 3.0000
|
|
2 2 1.0000
|
|
3 1 1.0000
|
|
4 1 4.0000
|
|
5 3 2.0000
|
|
6 2 4.0000
|
|
select * from t2;
|
|
idpro price nbprice
|
|
1 1.0000 3
|
|
2 1.0000 2
|
|
3 2.0000 1
|
|
select "-- SLAVE AFTER JOIN --" as "";
|
|
|
|
-- SLAVE AFTER JOIN --
|
|
select * from t1;
|
|
idp idpro price
|
|
1 1 3.0000
|
|
2 2 1.0000
|
|
3 1 1.0000
|
|
4 1 4.0000
|
|
5 3 2.0000
|
|
6 2 4.0000
|
|
select * from t2;
|
|
idpro price nbprice
|
|
1 1.0000 3
|
|
2 1.0000 2
|
|
3 2.0000 1
|