以下测试脚本摘自memcached_functions_mysql的源码目录有兴趣可以试试
PLAIN TEXTCODE: drop table if exists urls;
create table urls (
id int() not null
url varchar() not null default
primary key (id)
);
select memc_servers_set(localhost:);
select memc_set(urls:sequence );
DELIMITER |
DROP TRIGGER IF EXISTS url_mem_insert;
CREATE TRIGGER url_mem_insert
BEFORE INSERT ON urls
FOR EACH ROW BEGIN
SET NEWid= memc_increment(urls:sequence);
SET @mm= memc_set(concat(urls:NEWid) NEWurl);
END |
DELIMITER ;
insert into urls (url) values (http://googlecom);
insert into urls (url) values (http://wwwoosonet/indexphp);
insert into urls (url) values (http://wwwoosonet/);
insert into urls (url) values (http://slashdotorg);
insert into urls (url) values (http://mysqlcom);
select * from urls;
select memc_get(urls:);
select memc_get(urls:);
select memc_get(urls:);
select memc_get(urls:);
select memc_get(urls:);
[] []