Debian Codegraph @

mysql-test/suite/memcached/t/memc279_wrong_index.test

raw
1 source include/not_valgrind.inc;
2 source include/have_memcached_plugin.inc;
3 source include/not_windows.inc;
4
5
6 --let SEARCH_FILE = $MYSQLTEST_VARDIR/log/memcached_wrong_index.err
7
8 --disable_query_log
9 CALL mtr.add_suppression("daemon-memcached-w-batch-size': unsigned");
10 CALL mtr.add_suppression("Could not obtain server's UPN to be used as target service name");
11 CALL mtr.add_suppression("Warning: MySQL is trying to drop");
12 --enable_query_log
13
14 --enable_connect_log
15 SET @transaction_isolation= @@global.transaction_isolation;
16 SET GLOBAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
17
18 # Create the memcached tables
19 --disable_query_log
20 source include/memcache_config.inc;
21 --enable_query_log
22
23 INSERT INTO cache_policies VALUES("cache_policy", "innodb_only",
24 "innodb_only", "innodb_only", "innodb_only");
25
26 INSERT INTO config_options VALUES("separator", "|");
27 INSERT INTO config_options VALUES("table_map_delimiter", ".");
28
29 # describe table for memcache
30 # This one is wrong because PRIMARY key has two columns
31 INSERT INTO containers VALUES ("desct1", "test", "t1", "c1", "c2", "c3", "c4", "c5", "PRIMARY");
32 # This one is wrong because PRIMARY is on wrong column
33 INSERT INTO containers VALUES ("desct2", "test", "t2", "c1", "c2", "c3", "c4", "c5", "PRIMARY");
34
35 # This one is wrong because i1 is not UNIQUE
36 INSERT INTO containers VALUES ("desct3", "test", "t1", "c1", "c2", "c3", "c4", "c5", "i1");
37 # This one is wrong because i2 is on two columns
38 INSERT INTO containers VALUES ("desct4", "test", "t1", "c1", "c2", "c3", "c4", "c5", "i2");
39 # This one is wrong because i3 is on wrong column
40 INSERT INTO containers VALUES ("desct5", "test", "t1", "c1", "c2", "c3", "c4", "c5", "i3");
41
42 # This one is OK
43 INSERT INTO containers VALUES ("desct6", "test", "t1", "c1", "c2", "c3", "c4", "c5", "i4");
44
45 use test;
46
47 CREATE TABLE t1 (
48 c1 VARCHAR(32),
49 c2 VARCHAR(512),
50 c3 INT,
51 c4 BIGINT UNSIGNED,
52 c5 INT,
53 primary key(c1,c5)
54 ) ENGINE = INNODB;
55
56 CREATE TABLE t2 (
57 c1 VARCHAR(32),
58 c2 VARCHAR(512),
59 c3 INT,
60 c4 BIGINT UNSIGNED,
61 c5 INT,
62 primary key(c3)
63 ) ENGINE = INNODB;
64
65 CREATE INDEX i1 ON t1(c1);
66 CREATE UNIQUE INDEX i2 ON t1(c1,c5);
67 CREATE UNIQUE INDEX i3 ON t1(c5);
68 CREATE UNIQUE INDEX i4 ON t1(c1);
69
70 # Tables must exist before plugin can be started!
71 --let $memcached_address=127.0.0.1:11279
72 --source ../include/load_daemon_memcached_expecting_success.inc
73
74 --let SEARCH_PATTERN = InnoDB_Memcached: The unique_idx_name_on_key \(PRIMARY\) must be on key column \(c1\) only but it is on 2 columns
75 --source include/search_pattern_multiline.inc
76 --let SEARCH_PATTERN = InnoDB_Memcached: The unique_idx_name_on_key \(PRIMARY\) must be on key column \(c1\) but it is on \(c3\)
77 --source include/search_pattern_multiline.inc
78 --let SEARCH_PATTERN = InnoDB_Memcached: Index on key column must be a Unique index
79 --source include/search_pattern_multiline.inc
80 --let SEARCH_PATTERN = InnoDB_Memcached: The unique_idx_name_on_key \(i2\) must be on key column \(c1\) only but it is on 2 columns
81 --source include/search_pattern_multiline.inc
82 --let SEARCH_PATTERN = InnoDB_Memcached: The unique_idx_name_on_key \(i3\) must be on key column \(c1\) but it is on \(c5\)
83 --source include/search_pattern_multiline.inc
84
85
86 DROP TABLE t1,t2;
87
88 UNINSTALL PLUGIN daemon_memcached;
89 DROP DATABASE innodb_memcache;
90
91 SET @@global.transaction_isolation= @transaction_isolation;