|
| 1 | +connection node_2; |
| 2 | +connection node_1; |
| 3 | +# Case 1 CREATE SEQUENCE with no NOCACHE |
| 4 | +CREATE SEQUENCE s ENGINE=InnoDB; |
| 5 | +ERROR 42000: This version of MariaDB doesn't yet support 'CACHE without INCREMENT BY 0 in Galera cluster' |
| 6 | +CREATE SEQUENCE s NOCACHE ENGINE=InnoDB; |
| 7 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; |
| 8 | +START TRANSACTION; |
| 9 | +REPLACE INTO s VALUES (1,1,9223372036854775806,1,1,1000,0,0); |
| 10 | +OPTIMIZE TABLE t1; |
| 11 | +Table Op Msg_type Msg_text |
| 12 | +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead |
| 13 | +test.t1 optimize status OK |
| 14 | +SELECT * FROM t1; |
| 15 | +a |
| 16 | +SELECT * FROM s; |
| 17 | +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count |
| 18 | +1 1 9223372036854775806 1 1 1000 0 0 |
| 19 | +connection node_2; |
| 20 | +SELECT * FROM t1; |
| 21 | +a |
| 22 | +SELECT * FROM s; |
| 23 | +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count |
| 24 | +1 1 9223372036854775806 1 1 1000 0 0 |
| 25 | +connection node_1; |
| 26 | +DROP TABLE t1; |
| 27 | +DROP SEQUENCE s; |
| 28 | +# Case 2 REPLACE INTO ... SELECT with error |
| 29 | +CREATE TABLE t (id INT KEY,a YEAR,INDEX (id,a)) engine=innodb; |
| 30 | +REPLACE INTO t (id,a)SELECT /*!99997 */ 1; |
| 31 | +ERROR 21S01: Column count doesn't match value count at row 1 |
| 32 | +REPLACE INTO t (id,a)SELECT /*!99997 */ 1,2; |
| 33 | +SELECT * FROM t; |
| 34 | +id a |
| 35 | +1 2002 |
| 36 | +CREATE TABLE t2 (id INT KEY,a YEAR,INDEX (id,a)) engine=myisam; |
| 37 | +REPLACE INTO t2 (id,a)SELECT /*!99997 */ 1; |
| 38 | +ERROR 21S01: Column count doesn't match value count at row 1 |
| 39 | +REPLACE INTO t2 (id,a)SELECT /*!99997 */ 1,2; |
| 40 | +Warnings: |
| 41 | +Warning 138 Galera cluster does support consistency check only for InnoDB tables. |
| 42 | +SELECT * FROM t2; |
| 43 | +id a |
| 44 | +1 2002 |
| 45 | +CREATE TABLE t3 (id INT KEY,a YEAR,INDEX (id,a)) engine=aria; |
| 46 | +REPLACE INTO t3 (id,a)SELECT /*!99997 */ 1; |
| 47 | +ERROR 21S01: Column count doesn't match value count at row 1 |
| 48 | +REPLACE INTO t3 (id,a)SELECT /*!99997 */ 1,2; |
| 49 | +Warnings: |
| 50 | +Warning 138 Galera cluster does support consistency check only for InnoDB tables. |
| 51 | +SELECT * FROM t3; |
| 52 | +id a |
| 53 | +1 2002 |
| 54 | +connection node_2; |
| 55 | +SELECT * FROM t; |
| 56 | +id a |
| 57 | +1 2002 |
| 58 | +SELECT * FROM t2; |
| 59 | +id a |
| 60 | +1 2002 |
| 61 | +SELECT * FROM t3; |
| 62 | +id a |
| 63 | +1 2002 |
| 64 | +connection node_1; |
| 65 | +DROP TABLE t,t2,t3; |
| 66 | +# Bigger REPLACE ... AS SELECT test |
| 67 | +SET GLOBAL wsrep_replicate_myisam=ON; |
| 68 | +CREATE TABLE t1(id int not null primary key ,b int) ENGINE=InnoDB; |
| 69 | +CREATE TABLE t2(id int not null primary key ,b int) ENGINE=MyISAM; |
| 70 | +CREATE TABLE t3(id int not null primary key ,b int) ENGINE=Aria; |
| 71 | +CREATE TABLE t4(id int not null primary key ,b int) ENGINE=InnoDB; |
| 72 | +CREATE TABLE t5(id int not null primary key ,b int) ENGINE=InnoDB; |
| 73 | +CREATE TABLE t6(id int not null primary key ,b int) ENGINE=InnoDB; |
| 74 | +CREATE TABLE t7(id int not null primary key ,b int) ENGINE=MyISAM; |
| 75 | +CREATE TABLE t8(id int not null primary key ,b int) ENGINE=Aria; |
| 76 | +INSERT INTO t1(id) SELECT seq FROM seq_1_to_1000; |
| 77 | +INSERT INTO t2(id) SELECT seq FROM seq_1_to_1000; |
| 78 | +INSERT INTO t3(id) SELECT seq FROM seq_1_to_1000; |
| 79 | +REPLACE INTO t4 SELECT * FROM t1; |
| 80 | +REPLACE INTO t5 SELECT * FROM t2; |
| 81 | +REPLACE INTO t6 SELECT * FROM t3; |
| 82 | +REPLACE INTO t7 SELECT * FROM t2; |
| 83 | +REPLACE INTO t8 SELECT * FROM t3; |
| 84 | +SELECT COUNT(*) AS EXPECT_1000 FROM t1; |
| 85 | +EXPECT_1000 |
| 86 | +1000 |
| 87 | +SELECT COUNT(*) AS EXPECT_1000 FROM t2; |
| 88 | +EXPECT_1000 |
| 89 | +1000 |
| 90 | +SELECT COUNT(*) AS EXPECT_1000 FROM t3; |
| 91 | +EXPECT_1000 |
| 92 | +1000 |
| 93 | +SELECT COUNT(*) AS EXPECT_1000 FROM t4; |
| 94 | +EXPECT_1000 |
| 95 | +1000 |
| 96 | +SELECT COUNT(*) AS EXPECT_1000 FROM t5; |
| 97 | +EXPECT_1000 |
| 98 | +1000 |
| 99 | +SELECT COUNT(*) AS EXPECT_1000 FROM t6; |
| 100 | +EXPECT_1000 |
| 101 | +1000 |
| 102 | +SELECT COUNT(*) AS EXPECT_1000 FROM t7; |
| 103 | +EXPECT_1000 |
| 104 | +1000 |
| 105 | +SELECT COUNT(*) AS EXPECT_1000 FROM t8; |
| 106 | +EXPECT_1000 |
| 107 | +1000 |
| 108 | +connection node_2; |
| 109 | +SELECT COUNT(*) AS EXPECT_1000 FROM t1; |
| 110 | +EXPECT_1000 |
| 111 | +1000 |
| 112 | +SELECT COUNT(*) AS EXPECT_1000 FROM t2; |
| 113 | +EXPECT_1000 |
| 114 | +1000 |
| 115 | +SELECT COUNT(*) AS EXPECT_1000 FROM t3; |
| 116 | +EXPECT_1000 |
| 117 | +1000 |
| 118 | +SELECT COUNT(*) AS EXPECT_1000 FROM t4; |
| 119 | +EXPECT_1000 |
| 120 | +1000 |
| 121 | +SELECT COUNT(*) AS EXPECT_1000 FROM t5; |
| 122 | +EXPECT_1000 |
| 123 | +1000 |
| 124 | +SELECT COUNT(*) AS EXPECT_1000 FROM t6; |
| 125 | +EXPECT_1000 |
| 126 | +1000 |
| 127 | +SELECT COUNT(*) AS EXPECT_1000 FROM t7; |
| 128 | +EXPECT_1000 |
| 129 | +1000 |
| 130 | +SELECT COUNT(*) AS EXPECT_1000 FROM t8; |
| 131 | +EXPECT_1000 |
| 132 | +1000 |
| 133 | +connection node_1; |
| 134 | +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8; |
| 135 | +# Bigger INSERT INTO ... SELECT test |
| 136 | +CREATE TABLE t1(id int not null primary key ,b int) ENGINE=InnoDB; |
| 137 | +CREATE TABLE t2(id int not null primary key ,b int) ENGINE=MyISAM; |
| 138 | +CREATE TABLE t3(id int not null primary key ,b int) ENGINE=Aria; |
| 139 | +CREATE TABLE t4(id int not null primary key ,b int) ENGINE=InnoDB; |
| 140 | +CREATE TABLE t5(id int not null primary key ,b int) ENGINE=InnoDB; |
| 141 | +CREATE TABLE t6(id int not null primary key ,b int) ENGINE=InnoDB; |
| 142 | +CREATE TABLE t7(id int not null primary key ,b int) ENGINE=MyISAM; |
| 143 | +CREATE TABLE t8(id int not null primary key ,b int) ENGINE=Aria; |
| 144 | +INSERT INTO t1(id) SELECT seq FROM seq_1_to_1000; |
| 145 | +INSERT INTO t2(id) SELECT seq FROM seq_1_to_1000; |
| 146 | +INSERT INTO t3(id) SELECT seq FROM seq_1_to_1000; |
| 147 | +INSERT INTO t4 SELECT * FROM t1; |
| 148 | +INSERT INTO t5 SELECT * FROM t2; |
| 149 | +INSERT INTO t6 SELECT * FROM t3; |
| 150 | +INSERT INTO t7 SELECT * FROM t2; |
| 151 | +INSERT INTO t8 SELECT * FROM t3; |
| 152 | +SELECT COUNT(*) AS EXPECT_1000 FROM t1; |
| 153 | +EXPECT_1000 |
| 154 | +1000 |
| 155 | +SELECT COUNT(*) AS EXPECT_1000 FROM t2; |
| 156 | +EXPECT_1000 |
| 157 | +1000 |
| 158 | +SELECT COUNT(*) AS EXPECT_1000 FROM t3; |
| 159 | +EXPECT_1000 |
| 160 | +1000 |
| 161 | +SELECT COUNT(*) AS EXPECT_1000 FROM t4; |
| 162 | +EXPECT_1000 |
| 163 | +1000 |
| 164 | +SELECT COUNT(*) AS EXPECT_1000 FROM t5; |
| 165 | +EXPECT_1000 |
| 166 | +1000 |
| 167 | +SELECT COUNT(*) AS EXPECT_1000 FROM t6; |
| 168 | +EXPECT_1000 |
| 169 | +1000 |
| 170 | +SELECT COUNT(*) AS EXPECT_1000 FROM t7; |
| 171 | +EXPECT_1000 |
| 172 | +1000 |
| 173 | +SELECT COUNT(*) AS EXPECT_1000 FROM t8; |
| 174 | +EXPECT_1000 |
| 175 | +1000 |
| 176 | +connection node_2; |
| 177 | +SELECT COUNT(*) AS EXPECT_1000 FROM t1; |
| 178 | +EXPECT_1000 |
| 179 | +1000 |
| 180 | +SELECT COUNT(*) AS EXPECT_1000 FROM t2; |
| 181 | +EXPECT_1000 |
| 182 | +1000 |
| 183 | +SELECT COUNT(*) AS EXPECT_1000 FROM t3; |
| 184 | +EXPECT_1000 |
| 185 | +1000 |
| 186 | +SELECT COUNT(*) AS EXPECT_1000 FROM t4; |
| 187 | +EXPECT_1000 |
| 188 | +1000 |
| 189 | +SELECT COUNT(*) AS EXPECT_1000 FROM t5; |
| 190 | +EXPECT_1000 |
| 191 | +1000 |
| 192 | +SELECT COUNT(*) AS EXPECT_1000 FROM t6; |
| 193 | +EXPECT_1000 |
| 194 | +1000 |
| 195 | +SELECT COUNT(*) AS EXPECT_1000 FROM t7; |
| 196 | +EXPECT_1000 |
| 197 | +1000 |
| 198 | +SELECT COUNT(*) AS EXPECT_1000 FROM t8; |
| 199 | +EXPECT_1000 |
| 200 | +1000 |
| 201 | +connection node_1; |
| 202 | +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8; |
| 203 | +CREATE TABLE t1(pk int not null primary key) engine=innodb; |
| 204 | +INSERT INTO t1 values (1),(2),(3),(4); |
| 205 | +CREATE VIEW view_t1 AS SELECT * FROM t1; |
| 206 | +INSERT INTO view_t1 VALUES (5); |
| 207 | +SELECT * FROM t1; |
| 208 | +pk |
| 209 | +1 |
| 210 | +2 |
| 211 | +3 |
| 212 | +4 |
| 213 | +5 |
| 214 | +DROP TABLE t1; |
| 215 | +DROP VIEW view_t1; |
| 216 | +CREATE TABLE t1(pk int not null primary key) engine=myisam; |
| 217 | +INSERT INTO t1 values (1),(2),(3),(4); |
| 218 | +CREATE VIEW view_t1 AS SELECT * FROM t1; |
| 219 | +INSERT INTO view_t1 VALUES (5); |
| 220 | +SELECT * FROM t1; |
| 221 | +pk |
| 222 | +1 |
| 223 | +2 |
| 224 | +3 |
| 225 | +4 |
| 226 | +5 |
| 227 | +DROP TABLE t1; |
| 228 | +DROP VIEW view_t1; |
| 229 | +CREATE TABLE t1(pk int not null primary key) engine=aria; |
| 230 | +INSERT INTO t1 values (1),(2),(3),(4); |
| 231 | +CREATE VIEW view_t1 AS SELECT * FROM t1; |
| 232 | +INSERT INTO view_t1 VALUES (5); |
| 233 | +SELECT * FROM t1; |
| 234 | +pk |
| 235 | +1 |
| 236 | +2 |
| 237 | +3 |
| 238 | +4 |
| 239 | +5 |
| 240 | +DROP TABLE t1; |
| 241 | +DROP VIEW view_t1; |
| 242 | +SET GLOBAL wsrep_replicate_myisam=OFF; |
0 commit comments