File: 90no-async.t

package info (click to toggle)
libdbd-mysql-perl 4.041-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,068 kB
  • ctags: 409
  • sloc: ansic: 4,511; perl: 817; makefile: 27; sh: 22
file content (48 lines) | stat: -rw-r--r-- 995 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use strict;
use warnings;

use Test::More;
use DBI;
use DBI::Const::GetInfoType;

use vars qw($test_dsn $test_user $test_password);
use lib 't', '.';
require 'lib.pl';

my $dbh;
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
                      { RaiseError => 0, PrintError => 0, AutoCommit => 0 });};
if (!$dbh) {
    plan skip_all => "no database connection";
}

if($dbh->get_info($GetInfoType{'SQL_ASYNC_MODE'})) {
    plan skip_all => "Async support was built into this version of DBD::mysql";
}

is $dbh->get_info($GetInfoType{'SQL_MAX_ASYNC_CONCURRENT_STATEMENTS'}), 0;

ok !$dbh->do('SELECT 1', { async => 1 });
ok $dbh->errstr;

ok !$dbh->prepare('SELECT 1', { async => 1 });
ok $dbh->errstr;

ok !$dbh->mysql_async_result;
ok $dbh->errstr;

ok !$dbh->mysql_async_ready;
ok $dbh->errstr;

my $sth = $dbh->prepare('SELECT 1');
ok $sth;

ok !$sth->mysql_async_result;
ok $dbh->errstr;

ok !$sth->mysql_async_ready;
ok $dbh->errstr;

ok $dbh->disconnect;

done_testing;