~tsarev/percona-server/5.5.12-786645-slow_extended

« back to all changes in this revision

Viewing changes to HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test01.pl

  • Committer: Ignacio Nin
  • Date: 2011-05-18 00:03:53 UTC
  • mfrom: (88.2.28 release-5.5.11-20.2)
  • Revision ID: ignacio.nin@percona.com-20110518000353-wuf8zlopfh7okafj
Merge release branch, update version

Create release-5.5.12-20.3 with 5.5.12 changes and release branch from
5.5.11. Update versions to 5.5.12 and 20.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
# vim:sw=2:ai
 
4
 
 
5
# test for libmysql
 
6
 
 
7
BEGIN {
 
8
        push @INC, "../common/";
 
9
};
 
10
 
 
11
use strict;
 
12
use warnings;
 
13
use hstest;
 
14
 
 
15
my $dbh = hstest::init_testdb();
 
16
my $table = 'hstesttbl';
 
17
my $tablesize = 100;
 
18
$dbh->do(
 
19
  "create table $table (k varchar(30) primary key, v varchar(30) not null) " .
 
20
  "engine = innodb");
 
21
srand(999);
 
22
 
 
23
my %valmap = ();
 
24
 
 
25
my $sth = $dbh->prepare("insert into $table values (?,?)");
 
26
for (my $i = 0; $i < $tablesize; ++$i) {
 
27
  my $k = "k" . $i;
 
28
  my $v = "v" . int(rand(1000)) . $i;
 
29
  $sth->execute($k, $v);
 
30
  $valmap{$k} = $v;
 
31
}
 
32
 
 
33
my $aref = $dbh->selectall_arrayref("select k,v from $table order by k");
 
34
for my $row (@$aref) {
 
35
  my ($k, $v) = @$row;
 
36
  print "$k $v\n";
 
37
}
 
38