[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@52.14.60.56: ~ $
drop table if exists t1, t2, t3, t4, t5;
flush status;
drop table if exists t1, t2, t3, t4, t5;
flush status;
create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
create table t2 (op char(1), a int not null, b decimal (63,30)) engine=ndb;
create table t3  engine=ndb select 1 as i;
create table t4 (a int not null primary key, b int) engine=ndb;
create table t5 (a int not null primary key, b int) engine=ndb;
create trigger t1_bu before update on t1 for each row
begin
insert into t2 values ("u", old.a, old.b);
set new.b = old.b + 10;
end;//
create trigger t1_bd before delete on t1 for each row
begin
insert into t2 values ("d", old.a, old.b);
end;//
create trigger t4_au after update on t4
for each row begin
update t5 set b = b+1;
end;
//
create trigger t4_ad after delete on t4
for each row begin
update t5 set b = b+1;
end;
//
insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
insert into t4 values (1,1), (2,2), (3,3), (4, 4);
insert into t5 values (1,0);
update t1 set a=5 where a != 3;
select * from t1 order by id;
id	a	b
1	5	11.050000000000000000000000000000
2	5	12.050000000000000000000000000000
3	3	3.050000000000000000000000000000
4	5	14.050000000000000000000000000000
select * from t2 order by op, a, b;
op	a	b
u	1	1.050000000000000000000000000000
u	2	2.050000000000000000000000000000
u	4	4.050000000000000000000000000000
delete from t2;
update t1, t3 set a=6 where a = 5;
select * from t1 order by id;
id	a	b
1	6	21.050000000000000000000000000000
2	6	22.050000000000000000000000000000
3	3	3.050000000000000000000000000000
4	6	24.050000000000000000000000000000
select * from t2 order by op, a, b;
op	a	b
u	5	11.050000000000000000000000000000
u	5	12.050000000000000000000000000000
u	5	14.050000000000000000000000000000
delete from t2;
delete from t1 where a != 3;
select * from t1 order by id;
id	a	b
3	3	3.050000000000000000000000000000
select * from t2 order by op, a, b;
op	a	b
d	6	21.050000000000000000000000000000
d	6	22.050000000000000000000000000000
d	6	24.050000000000000000000000000000
delete from t2;
insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (4, 4, 4.05);
delete t1 from t1, t3 where a != 3;
select * from t1 order by id;
id	a	b
3	3	3.050000000000000000000000000000
select * from t2 order by op, a, b;
op	a	b
d	1	1.050000000000000000000000000000
d	2	2.050000000000000000000000000000
d	4	4.050000000000000000000000000000
delete from t2;
insert into t1 values (4, 4, 4.05);
insert into t1 (id, a) values (4, 1), (3, 1) on duplicate key update a= a + 1;
select * from t1 order by id;
id	a	b
3	4	13.050000000000000000000000000000
4	5	14.050000000000000000000000000000
select * from t2 order by op, a, b;
op	a	b
u	3	3.050000000000000000000000000000
u	4	4.050000000000000000000000000000
delete from t2;
delete from t3;
insert into t3 values (4), (3);
insert into t1 (id, a) (select i, 1 from t3) on duplicate key update a= a + 1;
select * from t1 order by id;
id	a	b
3	5	23.050000000000000000000000000000
4	6	24.050000000000000000000000000000
select * from t2 order by op, a, b;
op	a	b
u	4	13.050000000000000000000000000000
u	5	14.050000000000000000000000000000
delete from t2;
replace into t1 (id, a) values (4, 1), (3, 1);
select * from t1 order by id;
id	a	b
3	1	0.000000000000000000000000000000
4	1	0.000000000000000000000000000000
select * from t2 order by op, a, b;
op	a	b
d	5	23.050000000000000000000000000000
d	6	24.050000000000000000000000000000
delete from t1;
delete from t2;
insert into t1 values (3, 1, 1.05), (4, 1, 2.05);
replace into t1 (id, a) (select i, 2 from t3);
select * from t1 order by id;
id	a	b
3	2	0.000000000000000000000000000000
4	2	0.000000000000000000000000000000
select * from t2 order by op, a, b;
op	a	b
d	1	1.050000000000000000000000000000
d	1	2.050000000000000000000000000000
delete from t1;
delete from t2;
insert into t1 values (3, 1, 1.05), (5, 2, 2.05);
load data infile '../../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
select * from t1 order by id;
id	a	b
3	4	0.000000000000000000000000000000
5	6	0.000000000000000000000000000000
select * from t2 order by op, a, b;
op	a	b
d	1	1.050000000000000000000000000000
d	2	2.050000000000000000000000000000
update t4 set b = 10 where a = 1;
select * from t5 order by a;
a	b
1	1
update t5 set b = 0;
delete from t4 where a = 1;
select * from t5 order by a;
a	b
1	1
drop trigger t4_au;
drop trigger t4_ad;
drop table t1, t2, t3, t4, t5;
CREATE TABLE t1 (
id INT NOT NULL PRIMARY KEY,
xy INT
) ENGINE=ndbcluster;
INSERT INTO t1 VALUES (1, 0);
CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id = NEW.id; END //
CREATE TABLE t2 (
id INT NOT NULL PRIMARY KEY,
xy INT
) ENGINE=ndbcluster;
INSERT INTO t2 VALUES (2, 0);
CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY) ENGINE=ndbcluster;
INSERT INTO t3 VALUES (1);
CREATE TABLE t4 LIKE t1;
CREATE TRIGGER t4_update AFTER UPDATE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id = NEW.id; END //
CREATE TABLE t5 LIKE t2;
UPDATE t1 SET xy = 3 WHERE id = 1;
SELECT xy FROM t1 where id = 1;
xy
3
SELECT xy FROM t2 where id = 1;
xy
3
UPDATE t1 SET xy  = 4 WHERE id IN (SELECT id FROM t3 WHERE id = 1);
SELECT xy FROM t1 where id = 1;
xy
4
SELECT xy FROM t2 where id = 1;
xy
4
INSERT INTO t4 SELECT * FROM t1;
INSERT INTO t5 SELECT * FROM t2;
UPDATE t1,t4 SET t1.xy = 3, t4.xy = 3 WHERE t1.id = 1 AND t4.id = 1;
SELECT xy FROM t1 where id = 1;
xy
3
SELECT xy FROM t2 where id = 1;
xy
3
SELECT xy FROM t4 where id = 1;
xy
3
SELECT xy FROM t5 where id = 1;
xy
3
UPDATE t1,t4 SET t1.xy = 4, t4.xy = 4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 1) AND t4.id IN (SELECT id FROM t3 WHERE id = 1);
SELECT xy FROM t1 where id = 1;
xy
4
SELECT xy FROM t2 where id = 1;
xy
4
SELECT xy FROM t4 where id = 1;
xy
4
SELECT xy FROM t5 where id = 1;
xy
4
INSERT INTO t1 VALUES (1,0) ON DUPLICATE KEY UPDATE xy = 5;
SELECT xy FROM t1 where id = 1;
xy
5
SELECT xy FROM t2 where id = 1;
xy
5
DROP TRIGGER t1_update;
DROP TRIGGER t4_update;
CREATE TRIGGER t1_delete AFTER DELETE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id > 4; END //
CREATE TRIGGER t4_delete AFTER DELETE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id > 4; END //
INSERT INTO t1 VALUES (5, 0),(6,0);
INSERT INTO t2 VALUES (5, 1),(6,1);
INSERT INTO t3 VALUES (5);
SELECT * FROM t1 order by id;
id	xy
1	5
5	0
6	0
SELECT * FROM t2 order by id;
id	xy
1	5
2	0
5	1
6	1
DELETE FROM t1 WHERE id IN (SELECT id FROM t3 WHERE id = 5);
SELECT * FROM t1 order by id;
id	xy
1	5
6	0
SELECT * FROM t2 order by id;
id	xy
1	5
2	0
5	1
6	0
INSERT INTO t1 VALUES (5,0);
UPDATE t2 SET xy = 1 WHERE id = 6;
TRUNCATE t4;
INSERT INTO t4 SELECT * FROM t1;
TRUNCATE t5;
INSERT INTO t5 SELECT * FROM t2;
SELECT * FROM t1 order by id;
id	xy
1	5
5	0
6	0
SELECT * FROM t2 order by id;
id	xy
1	5
2	0
5	1
6	1
SELECT * FROM t4 order by id;
id	xy
1	5
5	0
6	0
SELECT * FROM t5 order by id;
id	xy
1	5
2	0
5	1
6	1
DELETE FROM t1,t4 USING t1,t3,t4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 5) AND t4.id IN (SELECT id FROM t3 WHERE id = 5);
SELECT * FROM t1 order by id;
id	xy
1	5
6	0
SELECT * FROM t2 order by id;
id	xy
1	5
2	0
5	1
6	0
SELECT * FROM t4 order by id;
id	xy
1	5
6	0
SELECT * FROM t5 order by id;
id	xy
1	5
2	0
5	1
6	0
INSERT INTO t1 VALUES (5, 0);
REPLACE INTO t2 VALUES (6,1);
SELECT * FROM t1 order by id;
id	xy
1	5
5	0
6	0
SELECT * FROM t2 order by id;
id	xy
1	5
2	0
5	1
6	1
REPLACE INTO t1 VALUES (5, 1);
SELECT * FROM t1 order by id;
id	xy
1	5
5	1
6	0
SELECT * FROM t2 order by id;
id	xy
1	5
2	0
5	1
6	0
DROP TRIGGER t1_delete;
DROP TRIGGER t4_delete;
DROP TABLE t1, t2, t3, t4, t5;
create table t1(a int, b varchar(10), c date) engine=ndb;
CREATE TRIGGER trg1 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN
SET new.c = date(now());
End //
select trigger_name,event_object_table from information_schema.triggers where
trigger_name='trg1';
trigger_name	event_object_table
trg1	t1
CREATE TRIGGER trg1 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN
SET new.c = date(now());
End //
select trigger_name,event_object_table from information_schema.triggers where
trigger_name='trg1';
trigger_name	event_object_table
trg1	t1
rename table t1 to t2;
select trigger_name,event_object_table from information_schema.triggers where
trigger_name='trg1';
trigger_name	event_object_table
trg1	t2
select trigger_name,event_object_table from information_schema.triggers where
trigger_name='trg1';
trigger_name	event_object_table
trg1	t2
drop table t2;
create table t1(c1 int(11) not null auto_increment primary key, c2 int(11) not null) engine=ndb;
create trigger bi_t1 before insert on t1
FOR EACH ROW BEGIN 
SET new.c2 = last_insert_id();
End
|
INSERT INTO t1 (c2) VALUES (17);
INSERT INTO t1 (c2) VALUES (17);
INSERT INTO t1 (c2) VALUES (17);
select c1 from t1 where c1=last_insert_id();
c1
3
select * from t1 order by c1;
c1	c2
1	0
2	1
3	2
start transaction;
INSERT INTO t1 (c2) VALUES (17);
INSERT INTO t1 (c2) VALUES (17);
select c1 from t1 where c1=last_insert_id();
c1
5
select * from t1 order by c1;
c1	c2
1	0
2	1
3	2
4	3
5	4
rollback;
select c1 from t1 where c1=last_insert_id();
c1
select * from t1 order by c1;
c1	c2
1	0
2	1
3	2
start transaction;
INSERT INTO t1 (c2) VALUES (17);
INSERT INTO t1 (c2) VALUES (17);
select c1 from t1 where c1=last_insert_id();
c1
7
select * from t1 order by c1;
c1	c2
1	0
2	1
3	2
6	5
7	6
commit;
select c1 from t1 where c1=last_insert_id();
c1
7
select * from t1 order by c1;
c1	c2
1	0
2	1
3	2
6	5
7	6
drop trigger bi_t1;
drop table t1;
End of 5.1 tests

Filemanager

Name Type Size Permission Actions
bug36547.result File 455 B 0644
loaddata_autocom_ndb.result File 726 B 0644
ndb_add_partition.result File 5.91 KB 0644
ndb_alter_table.result File 10.88 KB 0644
ndb_alter_table2.result File 685 B 0644
ndb_alter_table3.result File 1.48 KB 0644
ndb_alter_table_backup.result File 1.76 KB 0644
ndb_alter_table_error.result File 648 B 0644
ndb_alter_table_online.result File 26.79 KB 0644
ndb_alter_table_online2.result File 2.62 KB 0644
ndb_alter_table_online_multi.result File 1.98 KB 0644
ndb_auto_increment.result File 9.99 KB 0644
ndb_autoinc.result File 793 B 0644
ndb_basic.result File 29.94 KB 0644
ndb_bitfield.result File 8.26 KB 0644
ndb_blob.result File 22.71 KB 0644
ndb_blob_big.result File 1.24 KB 0644
ndb_blob_partition.result File 9.03 KB 0644
ndb_bug26793.result File 257 B 0644
ndb_bug31477.result File 1.85 KB 0644
ndb_bug31754.result File 262 B 0644
ndb_bulk_delete.result File 1.87 KB 0644
ndb_cache.result File 8.68 KB 0644
ndb_cache2.result File 13.31 KB 0644
ndb_cache_multi.result File 1.67 KB 0644
ndb_cache_multi2.result File 1.68 KB 0644
ndb_cache_trans.result File 6.65 KB 0644
ndb_charset.result File 5.77 KB 0644
ndb_column_properties.result File 15.98 KB 0644
ndb_condition_pushdown.result File 72.29 KB 0644
ndb_config.result File 3.21 KB 0644
ndb_config2.result File 475 B 0644
ndb_create_table.result File 1.02 KB 0644
ndb_cursor.result File 865 B 0644
ndb_database.result File 1.23 KB 0644
ndb_dbug_lock.result File 1.64 KB 0644
ndb_dbug_tc_select.result File 5.98 KB 0644
ndb_dd_alter.result File 27.07 KB 0644
ndb_dd_basic.result File 20.67 KB 0644
ndb_dd_bug12581213.result File 334 B 0644
ndb_dd_ddl.result File 5.56 KB 0644
ndb_dd_disk2memory.result File 12.99 KB 0644
ndb_dd_dump.result File 15.97 KB 0644
ndb_dd_restore_compat.result File 3.61 KB 0644
ndb_dd_sql_features.result File 22.4 KB 0644
ndb_ddl_open_trans.result File 1.36 KB 0644
ndb_disconnect_ddl.result File 281 B 0644
ndb_discover_db.result File 1.55 KB 0644
ndb_dist_priv.result File 4.8 KB 0644
ndb_gis.result File 47.18 KB 0644
ndb_global_schema_lock.result File 3.43 KB 0644
ndb_global_schema_lock_error.result File 1.94 KB 0644
ndb_grant.result File 17.65 KB 0644
ndb_hidden_pk.result File 10.55 KB 0644
ndb_index.result File 13.93 KB 0644
ndb_index_ordered.result File 16.71 KB 0644
ndb_index_stat.result File 14.33 KB 0644
ndb_index_unique.result File 17.43 KB 0644
ndb_insert.result File 36.2 KB 0644
ndb_join_pushdown.result File 274.88 KB 0644
ndb_limit.result File 2.01 KB 0644
ndb_load.result File 2.64 KB 0644
ndb_loaddatalocal.result File 1.39 KB 0644
ndb_lock.result File 4.17 KB 0644
ndb_lock_table.result File 205 B 0644
ndb_mgm.result File 3.55 KB 0644
ndb_minmax.result File 1.47 KB 0644
ndb_multi.result File 3.7 KB 0644
ndb_multi_row.result File 1.33 KB 0644
ndb_native_default_support.result File 47.23 KB 0644
ndb_optimize_table.result File 2 KB 0644
ndb_optimized_node_selection.result File 1017 B 0644
ndb_partition_error.result File 1.41 KB 0644
ndb_partition_error2.result File 150 B 0644
ndb_partition_hash.result File 890 B 0644
ndb_partition_key.result File 8.16 KB 0644
ndb_partition_list.result File 2.31 KB 0644
ndb_partition_range.result File 7.91 KB 0644
ndb_read_multi_range.result File 14.54 KB 0644
ndb_reconnect.result File 560 B 0644
ndb_rename.result File 772 B 0644
ndb_replace.result File 3.64 KB 0644
ndb_restore_compat_downward.result File 132.43 KB 0644
ndb_restore_compat_endianness.result File 10.87 KB 0644
ndb_restore_conv_lossy_charbinary.result File 15.46 KB 0644
ndb_restore_conv_lossy_integral.result File 20.72 KB 0644
ndb_restore_conv_padding.result File 6.14 KB 0644
ndb_restore_conv_promotion.result File 23.26 KB 0644
ndb_restore_discover.result File 540 B 0644
ndb_restore_misc.result File 23.77 KB 0644
ndb_restore_print.result File 9.8 KB 0644
ndb_restore_schema_blobs.result File 6.44 KB 0644
ndb_restore_schema_partitions.result File 13.3 KB 0644
ndb_restore_schema_rewrites.result File 12.22 KB 0644
ndb_restore_schema_subsets.result File 95.9 KB 0644
ndb_restore_schema_tolerance.result File 4.57 KB 0644
ndb_restore_undolog.result File 18.66 KB 0644
ndb_row_count.result File 5.11 KB 0644
ndb_row_format.result File 1.74 KB 0644
ndb_select_count.result File 334 B 0644
ndb_share.result File 9.85 KB 0644
ndb_short_sigs.result File 2.53 KB 0644
ndb_single_user.result File 3.97 KB 0644
ndb_sp.result File 1.1 KB 0644
ndb_sql_allow_batching.result File 918 B 0644
ndb_statistics0.result File 7.78 KB 0644
ndb_statistics1.result File 8.04 KB 0644
ndb_subquery.result File 3.07 KB 0644
ndb_temporary.result File 939 B 0644
ndb_tmp_table_and_DDL.result File 3.11 KB 0644
ndb_transaction.result File 4.62 KB 0644
ndb_trigger.result File 9.38 KB 0644
ndb_truncate.result File 425 B 0644
ndb_types.result File 3.12 KB 0644
ndb_update.result File 2.76 KB 0644
ndb_update_no_read.result File 11.37 KB 0644
ndb_view.result File 597 B 0644
ndbapi.result File 734 B 0644
ndbinfo.result File 12.86 KB 0644
ndbinfo_cache.result File 423 B 0644
ndbinfo_dump.result File 95 B 0644
ps_7ndb.result File 103.12 KB 0644
strict_autoinc_5ndb.result File 651 B 0644