1
# we are assuming the memcached binary is contained in PATH or
2
# common directories we might expect it to be in
3
--exec $DRIZZLE_TEST_DIR/suite/memcached_functions/start_mc.sh stop
4
--exec $DRIZZLE_TEST_DIR/suite/memcached_functions/start_mc.sh start
6
DROP TABLE IF EXISTS `t1`;
7
--replace_result $MC_PORT MC_A_PORT
8
--eval select memc_servers_set('127.0.0.1:$MC_PORT');
10
CREATE TABLE `t1` (id integer NOT NULL auto_increment primary key, bcol text);
11
INSERT INTO `t1` (bcol) values ('This documentation is NOT distributed under a GPL license. Use of this documentation is subject to the following terms: You may create a printed copy of this documentation solely for your own personal use. Conversion to other formats is allowed as long as the actual content is not altered or edited in any way. You shall not publish or distribute this documentation in any form or on any media, except if you distribute the documentation in a manner similar to how MySQL disseminates it (that is, electronically for download on a Web site with the software) or on a CD-ROM or similar medium, provided however that the documentation is disseminated together with the software on the same medium. Any other use, such as any dissemination of printed copies or use of this documentation, in whole or in part, in another publication, requires the prior written consent from an authorized representative of MySQL AB. MySQL AB reserves any and all rights to this documentation not expressly granted above.');
12
select memc_set('mysql:doc1', bcol) from t1;
13
select memc_get('mysql:doc1');
15
select memc_delete('mysql:doc1');
16
select memc_get('mysql:doc1');
18
select memc_set('spot:test', ' Spot ');
19
select memc_get('spot:test');
20
select memc_prepend('spot:test', 'See');
21
select memc_get('spot:test');
22
select memc_append('spot:test', 'run.');
23
select memc_get('spot:test');
24
select memc_delete('spot:test');
26
select memc_set('increment:test', 1);
27
select memc_get('increment:test');
28
select memc_increment('increment:test');
29
select memc_get('increment:test');
30
select memc_increment('increment:test', 5);
31
select memc_get('increment:test');
32
select memc_increment('increment:test', 20);
33
select memc_get('increment:test');
34
select memc_decrement('increment:test', 20);
35
select memc_get('increment:test');
36
select memc_decrement('increment:test');
37
select memc_get('increment:test');
38
select memc_delete('increment:test');
40
select memc_set('this_should_expire', '10 seconds', 10);
41
select memc_get('this_should_expire');
43
select memc_get('this_should_expire');
45
select memc_get('this_should_expire');
47
select memc_set('add:test', 'someval');
48
select memc_add('add:test', 'someval');
49
select memc_delete('add:test');
50
select memc_add('add:test', 'someval');
51
select memc_get('add:test');
52
select memc_delete('add:test');
54
select memc_add('add:test', 'someval');
55
select memc_get('add:test');
56
select memc_replace('replace:test', 'replaced');
57
select memc_set('replace:test', 'initial');
58
select memc_get('replace:test');
59
select memc_replace('replace:test', 'replaced');
60
select memc_get('replace:test');
61
select memc_replace('replace:test', 'replaced again');
62
select memc_get('replace:test');
63
select memc_delete('replace:test');
65
select memc_add_by_key('A', 'add:test', 'someval');
66
select memc_get_by_key('A', 'add:test');
67
select memc_set_by_key('A', 'replace:test', 'initial');
68
select memc_get_by_key('A', 'replace:test');
69
select memc_add_by_key('A', 'add:test', 'someotherval');
70
select memc_get_by_key('A', 'add:test');
71
select memc_replace_by_key('A', 'replace:test', 'replaced');
72
select memc_get_by_key('A', 'replace:test');
73
select memc_delete_by_key('A', 'replace:test');
74
select memc_get_by_key('A', 'replace:test');
76
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_NO_BLOCK');
78
select memc_behavior_set('MEMCACHED_BEHAVIOR_NO_BLOCK', '1');
79
select memc_behavior_get('MEMCACHED_BEHAVIOR_NO_BLOCK');
80
select memc_behavior_set('MEMCACHED_BEHAVIOR_NO_BLOCK', @behavior);
82
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_SUPPORT_CAS');
84
select memc_behavior_set('MEMCACHED_BEHAVIOR_SUPPORT_CAS', '1');
85
select memc_behavior_get('MEMCACHED_BEHAVIOR_SUPPORT_CAS');
86
select memc_behavior_set('MEMCACHED_BEHAVIOR_SUPPORT_CAS', @behavior);
88
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_TCP_NODELAY');
89
select memc_behavior_set('MEMCACHED_BEHAVIOR_TCP_NODELAY', '1');
90
select memc_behavior_get('MEMCACHED_BEHAVIOR_TCP_NODELAY');
91
select memc_behavior_set('MEMCACHED_BEHAVIOR_TCP_NODELAY', @behavior);
93
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_BUFFER_REQUESTS');
94
select memc_behavior_set('MEMCACHED_BEHAVIOR_BUFFER_REQUESTS', '1');
95
select memc_behavior_get('MEMCACHED_BEHAVIOR_BUFFER_REQUESTS');
96
select memc_behavior_set('MEMCACHED_BEHAVIOR_BUFFER_REQUESTS', @behavior);
98
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_USER_DATA');
99
select memc_behavior_set('MEMCACHED_BEHAVIOR_USER_DATA', '1');
100
select memc_behavior_get('MEMCACHED_BEHAVIOR_USER_DATA');
101
select memc_behavior_set('MEMCACHED_BEHAVIOR_USER_DATA', @behavior);
103
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_SORT_HOSTS');
104
select memc_behavior_set('MEMCACHED_BEHAVIOR_SORT_HOSTS', '1');
105
select memc_behavior_get('MEMCACHED_BEHAVIOR_SORT_HOSTS');
106
select memc_behavior_set('MEMCACHED_BEHAVIOR_SORT_HOSTS', @behavior);
108
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_VERIFY_KEY');
109
select memc_behavior_set('MEMCACHED_BEHAVIOR_VERIFY_KEY', '1');
110
select memc_behavior_get('MEMCACHED_BEHAVIOR_VERIFY_KEY');
111
select memc_behavior_set('MEMCACHED_BEHAVIOR_VERIFY_KEY', @behavior);
113
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_KETAMA');
114
select memc_behavior_set('MEMCACHED_BEHAVIOR_KETAMA', '1');
115
select memc_behavior_get('MEMCACHED_BEHAVIOR_KETAMA');
117
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_CACHE_LOOKUPS');
118
select memc_behavior_set('MEMCACHED_BEHAVIOR_CACHE_LOOKUPS', '1');
119
select memc_behavior_get('MEMCACHED_BEHAVIOR_CACHE_LOOKUPS');
120
select memc_behavior_set('MEMCACHED_BEHAVIOR_CACHE_LOOKUPS', @behavior);
122
set @behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_BUFFER_REQUESTS');
123
select memc_behavior_set('MEMCACHED_BEHAVIOR_BUFFER_REQUESTS', '1');
124
select memc_behavior_get('MEMCACHED_BEHAVIOR_BUFFER_REQUESTS');
125
select memc_behavior_set('MEMCACHED_BEHAVIOR_BUFFER_REQUESTS', @behavior);
127
set @preserve_behavior = memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
128
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_DEFAULT' );
129
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
131
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_MD5' );
132
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
134
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_CRC' );
135
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
137
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_FNV1_64' );
138
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
140
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_FNV1A_64' );
141
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
143
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_FNV1_32' );
144
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
146
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_FNV1A_32' );
147
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
149
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_JENKINS' );
150
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
152
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_HSIEH' );
153
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
155
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH','MEMCACHED_HASH_MURMUR' );
156
select memc_behavior_get('MEMCACHED_BEHAVIOR_HASH');
158
select memc_behavior_set('MEMCACHED_BEHAVIOR_HASH', @preserve_behavior);
160
set @preserve_dist= memc_behavior_get('MEMCACHED_BEHAVIOR_DISTRIBUTION');
161
select memc_behavior_set('MEMCACHED_BEHAVIOR_DISTRIBUTION', 'MEMCACHED_DISTRIBUTION_MODULA');
162
select memc_behavior_get('MEMCACHED_BEHAVIOR_DISTRIBUTION');
164
select memc_behavior_set('MEMCACHED_BEHAVIOR_DISTRIBUTION', 'MEMCACHED_DISTRIBUTION_CONSISTENT');
165
select memc_behavior_get('MEMCACHED_BEHAVIOR_DISTRIBUTION');
167
select memc_behavior_set('MEMCACHED_BEHAVIOR_DISTRIBUTION', 'MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA');
168
select memc_behavior_get('MEMCACHED_BEHAVIOR_DISTRIBUTION');
169
select memc_behavior_set('MEMCACHED_BEHAVIOR_DISTRIBUTION', @preserve_dist);
171
set @size = memc_behavior_get('MEMCACHED_BEHAVIOR_POLL_TIMEOUT');
173
select memc_behavior_set('MEMCACHED_BEHAVIOR_POLL_TIMEOUT', 100);
174
select memc_behavior_get('MEMCACHED_BEHAVIOR_POLL_TIMEOUT');
175
select memc_behavior_set('MEMCACHED_BEHAVIOR_POLL_TIMEOUT', @size);
178
set @size = memc_behavior_get('MEMCACHED_BEHAVIOR_RETRY_TIMEOUT');
180
select memc_behavior_set('MEMCACHED_BEHAVIOR_RETRY_TIMEOUT', 5);
181
select memc_behavior_get('MEMCACHED_BEHAVIOR_RETRY_TIMEOUT');
182
select memc_behavior_set('MEMCACHED_BEHAVIOR_RETRY_TIMEOUT', @size);
184
set @size = memc_behavior_get('MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK');
186
select memc_behavior_set('MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK', 5);
187
select memc_behavior_get('MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK');
188
select memc_behavior_set('MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK', @size);
190
set @size = memc_behavior_get('MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK');
192
select memc_behavior_set('MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK', 5);
193
select memc_behavior_get('MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK');
194
select memc_behavior_set('MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK', @size);
196
--exec $DRIZZLE_TEST_DIR/suite/memcached_functions/start_mc.sh stop