| 1 |
BUG #13511949 |
| 2 |
"NDB_RESTORE --PRINT-LOG DOES NOT PRODUCE VALID SQL" |
| 3 |
create table t1 |
| 4 |
(id1 int unsigned not null, |
| 5 |
id2 int unsigned not null, |
| 6 |
id3 char(10), |
| 7 |
id4 varchar(10), |
| 8 |
id5 binary(10), |
| 9 |
id6 varbinary(10), |
| 10 |
id7 datetime, |
| 11 |
id8 date, |
| 12 |
id9 time, |
| 13 |
primary key(id1,id2) |
| 14 |
)engine=ndbcluster; |
| 15 |
create table t2 |
| 16 |
(id1 int primary key |
| 17 |
)engine=ndbcluster; |
| 18 |
"Logged queries:" |
| 19 |
insert into t1 values(1,1,'abc','def','ghi','jkl','2016-05-25 12:42:45','2016-05-25','12:42:45'); |
| 20 |
update t1 set id5='def' where id1<2 and id2=1; |
| 21 |
update t1 set id3='mno' where id1=1 and id2>0; |
| 22 |
delete from t1 where id1 is not null and id4 like 'd%'; |
| 23 |
drop table t2; |
| 24 |
|
| 25 |
"Restore with --print-sql-log option" |
| 26 |
INSERT INTO test.t1 VALUES(1,1,'abc','def','ghi','jkl','2016-05-25/12:42:45','2016-05-25','12:42:45'); |
| 27 |
UPDATE test.t1 SET id5='def' WHERE id1=1 AND id2=1; |
| 28 |
UPDATE test.t1 SET id3='mno' WHERE id1=1 AND id2=1; |
| 29 |
DELETE FROM test.t1 WHERE id1=1 AND id2=1; |
| 30 |
drop table t1; |
| 31 |
drop table if exists t2; |
| 32 |
|
| 33 |
"No primary key declared" |
| 34 |
create table t3 |
| 35 |
(id1 int, |
| 36 |
id2 int |
| 37 |
)engine=ndbcluster; |
| 38 |
create table t4 |
| 39 |
(id1 int primary key |
| 40 |
)engine=ndbcluster; |
| 41 |
"Logged queries:" |
| 42 |
insert into t3 values(1,2); |
| 43 |
insert into t3 values(2,3); |
| 44 |
update t3 set id2=5 where id1=1; |
| 45 |
delete from t3; |
| 46 |
drop table t4; |
| 47 |
|
| 48 |
"Restore with --print-sql-log option" |
| 49 |
XXXX-XX-XX XX:XX:XX Found hidden primary key with print-sql-log option set. Exiting... |
| 50 |
drop table t3; |
| 51 |
drop table if exists t4; |
| 52 |
|
| 53 |
create table t5 |
| 54 |
(id1 int primary key, |
| 55 |
id2 int |
| 56 |
)engine=ndbcluster; |
| 57 |
create table t6 |
| 58 |
(id1 int primary key |
| 59 |
)engine=ndbcluster; |
| 60 |
"Logged queries:" |
| 61 |
insert into t5 values(1000,2000); |
| 62 |
update t5 set id2=5000 where id1=1000; |
| 63 |
delete from t5; |
| 64 |
drop table t6; |
| 65 |
|
| 66 |
"Restore with --print-sql-log and --print-log options" |
| 67 |
XXXX-XX-XX XX:XX:XX Both print-sql-log and print-log options passed. Exiting... |
| 68 |
drop table t5; |
| 69 |
drop table if exists t6; |
| 70 |
|
| 71 |
"Table contains column of type blob" |
| 72 |
create table t7 |
| 73 |
(id1 int primary key, |
| 74 |
id2 blob |
| 75 |
)engine=ndbcluster; |
| 76 |
create table t8 |
| 77 |
(id1 int primary key |
| 78 |
)engine=ndbcluster; |
| 79 |
"Logged queries:" |
| 80 |
insert into t7 values(1,'a'); |
| 81 |
drop table t8; |
| 82 |
|
| 83 |
"Restore with --print-sql-log option" |
| 84 |
XXXX-XX-XX XX:XX:XX Found column of type blob with print-sql-log option set. Exiting... |
| 85 |
drop table t7; |
| 86 |
drop table if exists t8; |