add tests

This commit is contained in:
Timofey Turenko
2017-05-17 18:16:06 +03:00
committed by Markus Mäkelä
parent dbfd631fed
commit 8c6ca38a8a
594 changed files with 48376 additions and 0 deletions

View File

@ -0,0 +1,6 @@
#!/bin/bash
for ((i=0 ; i<100 ; i++)) ;
do
mysql --host=$maxscale_IP -P 4006 -u $node_user -p$node_password --verbose --force --unbuffered=true --disable-reconnect $ssl_options > /dev/null < $test_dir/session_hang/setmix.sql >& /dev/null
done

View File

@ -0,0 +1,37 @@
set autocommit=0;
use mysql;
set autocommit=1;
use test;
set autocommit=0;
use mysql;
set autocommit=1;
select user,host from user;
set autocommit=0;
use fakedb;
use test;
use mysql;
use dontuse;
use mysql;
drop table if exists t1;
commit;
use test;
use mysql;
set autocommit=1;
create table t1(id integer primary key);
insert into t1 values(5);
use test;
use mysql;
select user from user;
set autocommit=0;
set autocommit=1;
set autocommit=0;
insert into mysql.t1 values(7);
use mysql;
rollback work;
commit;
delete from mysql.t1 where id=7;
insert into mysql.t1 values(7);
select host,user from mysql.user;
set autocommit=1;
delete from mysql.t1 where id = 7;
select 1 as "endof cycle" from dual;

View File

@ -0,0 +1,31 @@
#!/usr/bin/perl
my $host = $ENV{'node_000_network'};
my $port = $ENV{'node_000_port'};
my $user = $ENV{'node_user'};
my $password = $ENV{'node_password'};
my $test_dir = $ENV{'test_dir'};
use strict;
use DBI;
my $dsn = "DBI:mysql:database=test;host=$host;port=$port;mysql_use_result=0;mysql_server_prepare=1;mysql_ssl_client_key=$test_dir/ssl-cert/client-key.pem;mysql_ssl_client_cert=$test_dir/ssl-cert/client-cert.pem;";
my $dbh = DBI->connect($dsn, $user, $password) or die "Failed to connect!";
my $sth = $dbh->prepare("SELECT id, \@\@server_id from test.t1 where id=(?)");
$sth->bind_param(1, "%"); # placeholders are numbered from 1
for (my $i=0; $i<100000; $i++) {
if ($i % 5000 == 0) {
print "$i\n";
}
if (defined($sth)) {
$sth->execute($i) or warn "Did not execute successfully: ".$dbh->errstr;
#DBI::dump_results($sth);
}
}
$sth->finish();
$dbh->disconnect() or warn "Did not successfully disconnect from backend!";