Debian Codegraph @

mysql-test/suite/group_replication/r/gr_rename_index.result

raw
1 include/group_replication.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection server1]
6
7 #1. Create table on master with index
8 [connection server1]
9 CREATE TABLE t1 (a int PRIMARY KEY, b char(10), FULLTEXT KEY (b));
10 INSERT INTO t1 VALUES (1,'abc'), (2, 'def'), (3,'ghi');
11 include/assert.inc [There should be a index named b on table t1.]
12 include/rpl_sync.inc
13 [connection server2]
14 include/assert.inc [There should be a index named b on table t1.]
15
16 #2. Rename the index using ALTER TABLE..RENAME INDEX command.
17 [connection server1]
18 ALTER TABLE t1 RENAME index b to idx;
19
20 #3. Check that index is renamed sucessfully on both the servers.
21 include/assert.inc [There should not be a index named b on table t1.]
22 include/assert.inc [There should be a index named idx on table t1.]
23 include/rpl_sync.inc
24 [connection server2]
25 include/assert.inc [There should not be a index named b on table t1.]
26 include/assert.inc [There should be a index named idx on table t1.]
27 [connection server1]
28 UPDATE t1 SET b='mysql' WHERE b='abc';
29 include/rpl_sync.inc
30 include/diff_tables.inc [server1:t1, server2:t1]
31
32 #4. Clean-up
33 DROP TABLE t1;
34 include/rpl_sync.inc
35
36 #1. Create table on master with index
37 [connection server1]
38 CREATE TABLE t1 (a int PRIMARY KEY, b GEOMETRY NOT NULL SRID 0);
39 CREATE SPATIAL INDEX b ON t1 (b);
40 INSERT INTO t1 VALUES (1, ST_GEOMFROMText('POINT(1 1)')),
41 (2, ST_GEOMFROMTEXT('POLYGON((1 2,5 4,9 9,1 9,1 2))')),
42 (3, ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
43 include/assert.inc [There should be a index named b on table t1.]
44 include/rpl_sync.inc
45 [connection server2]
46 include/assert.inc [There should be a index named b on table t1.]
47
48 #2. Rename the index using ALTER TABLE..RENAME INDEX command.
49 [connection server1]
50 ALTER TABLE t1 RENAME index b to idx;
51
52 #3. Check that index is renamed sucessfully on both the servers.
53 include/assert.inc [There should not be a index named b on table t1.]
54 include/assert.inc [There should be a index named idx on table t1.]
55 include/rpl_sync.inc
56 [connection server2]
57 include/assert.inc [There should not be a index named b on table t1.]
58 include/assert.inc [There should be a index named idx on table t1.]
59 [connection server1]
60 UPDATE t1 SET b=ST_GEOMFROMText('POINT(5 5)') WHERE b=ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)');
61 include/rpl_sync.inc
62 include/diff_tables.inc [server1:t1, server2:t1]
63
64 #4. Clean-up
65 DROP TABLE t1;
66 include/rpl_sync.inc
67
68 #1. Create table on master with index
69 [connection server1]
70 CREATE TABLE t1 ( a INT PRIMARY KEY, b int, KEY (b));
71 INSERT INTO t1 VALUES (1,10),(2,20),(3,30);
72 include/assert.inc [There should be a index named b on table t1.]
73 include/rpl_sync.inc
74 [connection server2]
75 include/assert.inc [There should be a index named b on table t1.]
76
77 #2. Rename the index using ALTER TABLE..RENAME INDEX command.
78 [connection server1]
79 ALTER TABLE t1 RENAME index b to idx;
80
81 #3. Check that index is renamed sucessfully on both the servers.
82 include/assert.inc [There should not be a index named b on table t1.]
83 include/assert.inc [There should be a index named idx on table t1.]
84 include/rpl_sync.inc
85 [connection server2]
86 include/assert.inc [There should not be a index named b on table t1.]
87 include/assert.inc [There should be a index named idx on table t1.]
88 [connection server1]
89 UPDATE t1 SET b=11 WHERE b=10;
90 include/rpl_sync.inc
91 include/diff_tables.inc [server1:t1, server2:t1]
92
93 #4. Clean-up
94 DROP TABLE t1;
95 include/rpl_sync.inc
96 include/group_replication_end.inc