| 1 |
# Test for Bug# 16875543 MEMCACHED: SERVER CRASH IN MEMCACHED SET OPERATION. |
| 2 |
|
| 3 |
source include/not_valgrind.inc; |
| 4 |
source include/have_memcached_plugin.inc; |
| 5 |
source include/not_windows.inc; |
| 6 |
|
| 7 |
--disable_query_log |
| 8 |
CALL mtr.add_suppression("daemon-memcached-w-batch-size': unsigned"); |
| 9 |
CALL mtr.add_suppression("Could not obtain server's UPN to be used as target service name"); |
| 10 |
CALL mtr.add_suppression("Warning: MySQL is trying to drop"); |
| 11 |
--enable_query_log |
| 12 |
|
| 13 |
--enable_connect_log |
| 14 |
SET @transaction_isolation= @@global.transaction_isolation; |
| 15 |
SET GLOBAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; |
| 16 |
|
| 17 |
# Create the memcached tables |
| 18 |
--disable_query_log |
| 19 |
source include/memcache_config.inc; |
| 20 |
--enable_query_log |
| 21 |
|
| 22 |
INSERT INTO cache_policies VALUES("cache_policy", "innodb_only", |
| 23 |
"innodb_only", "innodb_only", "innodb_only"); |
| 24 |
|
| 25 |
INSERT INTO config_options VALUES("separator", "|"); |
| 26 |
|
| 27 |
# describe table for memcache |
| 28 |
INSERT INTO containers VALUES ("desc_t1", "test", "t1", |
| 29 |
"c1", "c2,c21", "c3", "c4", "c5", "PRIMARY"); |
| 30 |
|
| 31 |
USE test; |
| 32 |
|
| 33 |
--disable_warnings |
| 34 |
DROP TABLE IF EXISTS t1; |
| 35 |
--enable_warnings |
| 36 |
CREATE TABLE t1 (c1 VARCHAR(30) NOT NULL DEFAULT '', |
| 37 |
c2 CHAR(120) NOT NULL DEFAULT '', |
| 38 |
c21 CHAR(60) NOT NULL DEFAULT '', |
| 39 |
primary key(c1)) |
| 40 |
ENGINE = INNODB DEFAULT CHARSET UTF8; |
| 41 |
|
| 42 |
INSERT INTO t1 VALUES ('1', 'Darmstadt', 'City'); |
| 43 |
INSERT INTO t1 VALUES ('2', 'Berlin', 'Mitte'); |
| 44 |
INSERT INTO t1 VALUES ('3', 'Cottbus', 'West'); |
| 45 |
INSERT INTO t1 VALUES ('4', 'München', 'Süd'); |
| 46 |
|
| 47 |
# Tables must exist before plugin can be started! |
| 48 |
--let $memcached_address=127.0.0.1:11281 |
| 49 |
--source ../include/load_daemon_memcached_expecting_success.inc |
| 50 |
|
| 51 |
SHOW CREATE TABLE t1; |
| 52 |
|
| 53 |
--sorted_result |
| 54 |
SELECT c1, c2, c21 FROM t1; |
| 55 |
|
| 56 |
# Test set/get by key. |
| 57 |
# Here we test if the key is an invalid utf8 string, |
| 58 |
# and if the key exceed the column length. |
| 59 |
perl; |
| 60 |
use DBI; |
| 61 |
use Cache::Memcached; |
| 62 |
my $memd = new Cache::Memcached { |
| 63 |
'servers' => [ "127.0.0.1:11281" ], |
| 64 |
'connect_timeout' => 20, |
| 65 |
'select_timeout' =>20 |
| 66 |
}; |
| 67 |
|
| 68 |
# Test for set (update). |
| 69 |
print "Here are the memcached results before set:\n"; |
| 70 |
$val = $memd->get("1"); |
| 71 |
if ($val) { print "$val\n"; } |
| 72 |
print "Here are the memcached results after set:\n"; |
| 73 |
$val = $memd->set("1","Beijing|City"); |
| 74 |
$val = $memd->get("1"); |
| 75 |
if ($val) { print "$val\n"; } |
| 76 |
$memd->disconnect_all; |
| 77 |
EOF |
| 78 |
|
| 79 |
--sorted_result |
| 80 |
SELECT c1, c2, c21 FROM t1; |
| 81 |
|
| 82 |
DROP TABLE t1; |
| 83 |
|
| 84 |
UNINSTALL PLUGIN daemon_memcached; |
| 85 |
DROP DATABASE innodb_memcache; |
| 86 |
|
| 87 |
SET @@global.transaction_isolation= @transaction_isolation; |