| 1 |
# Bug #29539701 MEMCACHED PLUGIN WITH MULTI-COLUMN PRIMARY INDEX CAUSES CRASH |
| 2 |
# This scenario demonstrates a bug in handling a partial rollback (undo) of |
| 3 |
# row insert when it violates uniqueness constraint. |
| 4 |
|
| 5 |
source include/not_valgrind.inc; |
| 6 |
source include/have_memcached_plugin.inc; |
| 7 |
source include/not_windows.inc; |
| 8 |
|
| 9 |
--disable_query_log |
| 10 |
CALL mtr.add_suppression("daemon-memcached-w-batch-size': unsigned"); |
| 11 |
CALL mtr.add_suppression("Could not obtain server's UPN to be used as target service name"); |
| 12 |
CALL mtr.add_suppression("Warning: MySQL is trying to drop"); |
| 13 |
--enable_query_log |
| 14 |
|
| 15 |
--enable_connect_log |
| 16 |
SET @transaction_isolation= @@global.transaction_isolation; |
| 17 |
SET GLOBAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; |
| 18 |
|
| 19 |
# Create the memcached tables |
| 20 |
--disable_query_log |
| 21 |
source include/memcache_config.inc; |
| 22 |
--enable_query_log |
| 23 |
|
| 24 |
INSERT INTO cache_policies VALUES("cache_policy", "innodb_only", |
| 25 |
"innodb_only", "innodb_only", "innodb_only"); |
| 26 |
|
| 27 |
INSERT INTO config_options VALUES("separator", "|"); |
| 28 |
INSERT INTO config_options VALUES("table_map_delimiter", "."); |
| 29 |
|
| 30 |
# describe table for memcache |
| 31 |
|
| 32 |
# It seems crucial to reproduce the bug that we need more than one description |
| 33 |
# (probably because otherwise we keep reusing some connection/settings instead of |
| 34 |
# creating new one for @@desct15 ?) |
| 35 |
|
| 36 |
INSERT INTO containers VALUES ("desct11", "test", "t1", |
| 37 |
"c1", "c2,c21,c22,c23,c24,c25,c26,c27", "c3", "c4", "c5", |
| 38 |
"PRIMARY"); |
| 39 |
INSERT INTO containers VALUES ("desct15", "test", "t1", |
| 40 |
"c23", "c1,c21,c22,c24", "c3", "c4", "c5", "i15"); |
| 41 |
|
| 42 |
USE test; |
| 43 |
|
| 44 |
--disable_warnings |
| 45 |
DROP TABLE IF EXISTS t1,t2; |
| 46 |
--enable_warnings |
| 47 |
CREATE TABLE t1 (c1 VARCHAR(32), |
| 48 |
c2 VARCHAR(512), |
| 49 |
c21 VARCHAR(767), |
| 50 |
c22 VARCHAR(512), |
| 51 |
c23 VARCHAR(128), |
| 52 |
c24 VARCHAR(24), |
| 53 |
c25 VARCHAR(512), |
| 54 |
c26 VARCHAR(128), |
| 55 |
c27 VARCHAR(128), |
| 56 |
c3 INT, c4 BIGINT UNSIGNED, c5 INT, primary key(c1)) |
| 57 |
ENGINE = INNODB; |
| 58 |
|
| 59 |
INSERT INTO t1 VALUES ('D','Duesseldorf','City','98765','Hafen','1','A','a','Z',0,0,0); |
| 60 |
INSERT INTO t1 VALUES ('O','Oldenburg','Mitte','87654','Deich','2','B','b','Y',0,0,0); |
| 61 |
INSERT INTO t1 VALUES ('K','Koeln','West','76543','Rhein','3','C','c','X',0,0,0); |
| 62 |
INSERT INTO t1 VALUES ('S','Stuttgart','Nord','65432','Fernsehturm','4','D','d','U',0,0,0); |
| 63 |
|
| 64 |
CREATE UNIQUE INDEX i15 ON t1(c23); |
| 65 |
CREATE UNIQUE INDEX u24 ON t1(c24); |
| 66 |
|
| 67 |
# Tables must exist before plugin can be started! |
| 68 |
--let $memcached_address=127.0.0.1:11298 |
| 69 |
--source ../include/load_daemon_memcached_expecting_success.inc |
| 70 |
|
| 71 |
--sorted_result |
| 72 |
SELECT c1,c2,c21,c22,c23,c24,c25,c26,c27 FROM t1; |
| 73 |
|
| 74 |
perl; |
| 75 |
use DBI; |
| 76 |
use Cache::Memcached; |
| 77 |
my $memd = new Cache::Memcached { |
| 78 |
'servers' => [ "127.0.0.1:11298" ], |
| 79 |
'connect_timeout' => 20, |
| 80 |
'select_timeout' => 20 |
| 81 |
}; |
| 82 |
print "Here are the memcached results after set in desct15:\n"; |
| 83 |
$val = $memd->set('@@desct15.Zebra',"u1|u2|u3|u4"); |
| 84 |
$val = $memd->get("\@\@desct15.Zebra"); |
| 85 |
if ($val) { print "$val\n"; } |
| 86 |
$val = $memd->set('@@desct15.Leopard',"v1|v2|v3|u4"); |
| 87 |
$val = $memd->get("\@\@desct15.Leopard"); |
| 88 |
if ($val) { print "$val\n"; } |
| 89 |
$memd->disconnect_all; |
| 90 |
EOF |
| 91 |
|
| 92 |
--sorted_result |
| 93 |
SELECT c1,c2,c21,c22,c23,c24,c25,c26,c27 FROM t1; |
| 94 |
|
| 95 |
--sorted_result |
| 96 |
SELECT c1,c2,c21,c22,c23,c24,c25,c26,c27 FROM t1; |
| 97 |
|
| 98 |
DROP TABLE t1; |
| 99 |
|
| 100 |
UNINSTALL PLUGIN daemon_memcached; |
| 101 |
DROP DATABASE innodb_memcache; |
| 102 |
|
| 103 |
SET @@global.transaction_isolation= @transaction_isolation; |