41 lines
1.3 KiB
Plaintext

# The include statement below is a temp one for tests that are yet to
#be ported to run with InnoDB,
#but needs to be kept for tests that would need MyISAM in future.
--source include/force_myisam_default.inc
--source include/have_ndb.inc
--source suite/ndb_memcache/include/have_memcache.inc
--source suite/ndb_memcache/include/memcached_wait_for_ready.inc
--source suite/ndb_memcache/include/misc_tables.inc
--perl
use strict;
use Carp;
use lib "lib";
use My::Memcache;
my $port = $ENV{NDB_MEMCACHED_1_PORT} or die "Need NDB_MEMCACHED_1_PORT";
# Use a binary protocol connection (so keys can contain spaces)
my $mc = My::Memcache::Binary->new();
my $r = $mc->connect("localhost",$port);
$mc->delete("hashtag:oscon\t1");
$mc->delete("hashtag:mysql\t1");
$mc->delete("hashtag:oscon\t2");
$mc->set("hashtag:oscon\t1","fred") || $mc->fail("t01 (SET)");
$mc->add("hashtag:mysql\t1","frederick") || $mc->fail("t02 (SET)");
$mc->set("hashtag:oscon\t2","freddy") || $mc->fail("t03 (SET)");
($mc->get("hashtag:oscon\t1") == "fred") || $mc->fail("t04 (expected fred)");
($mc->get("hashtag:mysql\t1") == "frederick") || $mc->fail("t05 (expected frederick)");
($mc->get("hashtag:oscon\t2") == "freddy") || $mc->fail("t06 (expected freddy)");
EOF
--sorted_result
SELECT * FROM ndbmemcache.hashtags;