Debian Codegraph @

mysql-test/suite/memcached/include/sdi_insert_delete.inc

raw
1 perl;
2 use strict;
3 use warnings;
4 use Cwd;
5
6 my $srcdir = getcwd;
7 require "$srcdir/include/sdi_perl_func.pl";
8
9 print "1. Insert Small data\n";
10 sdi_set_get(0, 0, "Hello How are you?");
11
12 print "2. Insert Large data. Will be stored in external pages\n";
13 my $input = "abcdefghijklmnopqrstuvwxyz" x 800;
14 sdi_set_get(1, 1, $input);
15
16 print "3. Move off-page to in-page\n";
17 sdi_set_get(1, 1, "Reducing from off page to in-page");
18
19 print "4. Move in-page to off-page\n";
20 sdi_set_get(1, 1, $input);
21
22 print "5. Insert 1000 rows and delete\n";
23 $input = "abcdef";
24 for (my $i=2; $i <= 1001; $i++) {
25 sdi_set_get($i, $i, $input x $i);
26 }
27
28 # The list of SDI keys
29 my $input_list;
30 for (my $i=0; $i <=1001; $i++) {
31 $input_list .= "$i:$i|";
32 }
33
34 # Retrieve only SDI Keys
35 my $out = sdi_get_only_keys();
36
37 my $list_cmp_result = $input_list eq $out;
38
39 if (!$list_cmp_result) {
40 print "List Keys mismatch\n";
41 print "input is $input_list\n";
42 print "output is $out\n";
43 }
44
45 for (my $i=0; $i <= 1001; $i++) {
46 sdi_remove_get($i, $i);
47 }
48
49 sdi_disconnect();
50 EOF