����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
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 @common_safe_methods = qw/
can err errstr parse_trace_flag parse_trace_flags
private_attribute_info trace trace_msg visit_child_handles
/;
my @db_safe_methods = (@common_safe_methods, qw/
clone mysql_async_ready
/);
my @db_unsafe_methods = qw/
data_sources do last_insert_id selectrow_array
selectrow_arrayref selectrow_hashref selectall_arrayref selectall_hashref
selectcol_arrayref prepare prepare_cached commit
rollback begin_work ping get_info
table_info column_info primary_key_info primary_key
foreign_key_info statistics_info tables type_info_all
type_info quote quote_identifier
/;
my @st_safe_methods = qw/
fetchrow_arrayref fetch fetchrow_array fetchrow_hashref
fetchall_arrayref fetchall_hashref finish rows
/;
my @st_unsafe_methods = qw/
bind_param bind_param_inout bind_param_array execute execute_array
execute_for_fetch bind_col bind_columns
/;
my %dbh_args = (
can => ['can'],
parse_trace_flag => ['SQL'],
parse_trace_flags => ['SQL'],
trace_msg => ['message'],
visit_child_handles => [sub { }],
quote => ['string'],
quote_identifier => ['Users'],
do => ['SELECT 1'],
last_insert_id => [undef, undef, undef, undef],
selectrow_array => ['SELECT 1'],
selectrow_arrayref => ['SELECT 1'],
selectrow_hashref => ['SELECT 1'],
selectall_arrayref => ['SELECT 1'],
selectall_hashref => ['SELECT 1', '1'],
selectcol_arrayref => ['SELECT 1'],
prepare => ['SELECT 1'],
prepare_cached => ['SELECT 1'],
get_info => [$GetInfoType{'SQL_DBMS_NAME'}],
column_info => [undef, undef, '%', '%'],
primary_key_info => [undef, undef, 'async_test'],
primary_key => [undef, undef, 'async_test'],
foreign_key_info => [undef, undef, 'async_test', undef, undef, undef],
statistics_info => [undef, undef, 'async_test', 0, 1],
);
my %sth_args = (
fetchall_hashref => [1],
bind_param => [1, 1],
bind_param_inout => [1, \(my $scalar = 1), 64],
bind_param_array => [1, [1]],
execute_array => [{ ArrayTupleStatus => [] }, [1]],
execute_for_fetch => [sub { undef } ],
bind_col => [1, \(my $scalar2 = 1)],
bind_columns => [\(my $scalar3)],
);
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";
}
plan tests =>
2 * @db_safe_methods +
4 * @db_unsafe_methods +
7 * @st_safe_methods +
3 * @common_safe_methods +
2 * @st_unsafe_methods +
3;
$dbh->do(<<SQL);
CREATE TEMPORARY TABLE async_test (
value INTEGER
)
SQL
foreach my $method (@db_safe_methods) {
$dbh->do('SELECT 1', { async => 1 });
my $args = $dbh_args{$method} || [];
$dbh->$method(@$args);
ok !$dbh->errstr, "Testing method '$method' on DBD::mysql::db during asynchronous operation";
ok defined($dbh->mysql_async_result);
}
$dbh->do('SELECT 1', { async => 1 });
ok defined($dbh->mysql_async_result);
foreach my $method (@db_unsafe_methods) {
$dbh->do('SELECT 1', { async => 1 });
my $args = $dbh_args{$method} || [];
my @values = $dbh->$method(@$args); # some methods complain unless they're called in list context
like $dbh->errstr, qr/Calling a synchronous function on an asynchronous handle/, "Testing method '$method' on DBD::mysql::db during asynchronous operation";
ok defined($dbh->mysql_async_result);
}
foreach my $method (@common_safe_methods) {
my $sth = $dbh->prepare('SELECT 1', { async => 1 });
$sth->execute;
my $args = $dbh_args{$method} || []; # they're common methods, so this should be ok!
$sth->$method(@$args);
ok !$sth->errstr, "Testing method '$method' on DBD::mysql::db during asynchronous operation";
ok defined($sth->mysql_async_result);
ok defined($sth->mysql_async_result);
}
foreach my $method (@st_safe_methods) {
my $sth = $dbh->prepare('SELECT 1', { async => 1 });
$sth->execute;
my $args = $sth_args{$method} || [];
$sth->$method(@$args);
ok !$sth->errstr, "Testing method '$method' on DBD::mysql::st during asynchronous operation";
# statement safe methods cache async result and mysql_async_result can be called multiple times
ok defined($sth->mysql_async_result), "Testing DBD::mysql::st method '$method' for async result";
ok defined($sth->mysql_async_result), "Testing DBD::mysql::st method '$method' for async result";
}
foreach my $method (@st_safe_methods) {
my $sync_sth = $dbh->prepare('SELECT 1');
my $async_sth = $dbh->prepare('SELECT 1', { async => 1 });
$dbh->do('SELECT 1', { async => 1 });
ok !$sync_sth->execute;
ok $sync_sth->errstr;
ok !$async_sth->execute;
ok $async_sth->errstr;
$dbh->mysql_async_result;
}
foreach my $method (@db_unsafe_methods) {
my $sth = $dbh->prepare('SELECT 1', { async => 1 });
$sth->execute;
ok !$dbh->do('SELECT 1', { async => 1 });
ok $dbh->errstr;
$sth->mysql_async_result;
}
foreach my $method (@st_unsafe_methods) {
my $sth = $dbh->prepare('SELECT value FROM async_test WHERE value = ?', { async => 1 });
$sth->execute(1);
my $args = $sth_args{$method} || [];
my @values = $sth->$method(@$args);
like $dbh->errstr, qr/Calling a synchronous function on an asynchronous handle/, "Testing method '$method' on DBD::mysql::st during asynchronous operation";
ok(defined $sth->mysql_async_result);
}
my $sth = $dbh->prepare('SELECT 1', { async => 1 });
$sth->execute;
ok defined($sth->mysql_async_ready);
ok $sth->mysql_async_result;
undef $sth;
$dbh->disconnect;
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| 00base.t | File | 634 B | 0644 |
|
| 01caching_sha2_prime.t | File | 735 B | 0644 |
|
| 05dbcreate.t | File | 760 B | 0644 |
|
| 10connect.t | File | 2.6 KB | 0644 |
|
| 15reconnect.t | File | 1.55 KB | 0644 |
|
| 16dbi-get_info.t | File | 1.26 KB | 0644 |
|
| 17quote.t | File | 1.16 KB | 0644 |
|
| 20createdrop.t | File | 745 B | 0644 |
|
| 25lockunlock.t | File | 1.48 KB | 0644 |
|
| 29warnings.t | File | 1.73 KB | 0644 |
|
| 30insertfetch.t | File | 1.2 KB | 0644 |
|
| 31insertid.t | File | 2.3 KB | 0644 |
|
| 32insert_error.t | File | 901 B | 0644 |
|
| 35limit.t | File | 2.22 KB | 0644 |
|
| 35prepare.t | File | 3.31 KB | 0644 |
|
| 40bindparam.t | File | 2.87 KB | 0644 |
|
| 40bindparam2.t | File | 1.31 KB | 0644 |
|
| 40bit.t | File | 1.25 KB | 0644 |
|
| 40blobs.t | File | 1.88 KB | 0644 |
|
| 40catalog.t | File | 10.27 KB | 0644 |
|
| 40keyinfo.t | File | 1.99 KB | 0644 |
|
| 40listfields.t | File | 2.22 KB | 0644 |
|
| 40nulls.t | File | 1004 B | 0644 |
|
| 40nulls_prepare.t | File | 2.48 KB | 0644 |
|
| 40numrows.t | File | 1.96 KB | 0644 |
|
| 40server_prepare.t | File | 3.37 KB | 0644 |
|
| 40server_prepare_crash.t | File | 2.2 KB | 0644 |
|
| 40server_prepare_error.t | File | 968 B | 0644 |
|
| 40types.t | File | 3.44 KB | 0644 |
|
| 41bindparam.t | File | 1.02 KB | 0644 |
|
| 41blobs_prepare.t | File | 2.04 KB | 0644 |
|
| 41int_min_max.t | File | 6.31 KB | 0644 |
|
| 42bindparam.t | File | 997 B | 0644 |
|
| 43count_params.t | File | 1.93 KB | 0644 |
|
| 50chopblanks.t | File | 2.81 KB | 0644 |
|
| 50commit.t | File | 2.37 KB | 0644 |
|
| 51bind_type_guessing.t | File | 6.03 KB | 0644 |
|
| 52comment.t | File | 1.96 KB | 0644 |
|
| 53comment.t | File | 1.83 KB | 0644 |
|
| 55utf8.t | File | 3.1 KB | 0644 |
|
| 55utf8_errors.t | File | 3.56 KB | 0644 |
|
| 55utf8_identifiers.t | File | 5.53 KB | 0644 |
|
| 55utf8mb4.t | File | 1.04 KB | 0644 |
|
| 56connattr.t | File | 1.65 KB | 0644 |
|
| 57trackgtid.t | File | 944 B | 0644 |
|
| 60leaks.t | File | 7.69 KB | 0644 |
|
| 65segfault.t | File | 1.12 KB | 0644 |
|
| 65types.t | File | 1.31 KB | 0644 |
|
| 70takeimp.t | File | 2.64 KB | 0644 |
|
| 71impdata.t | File | 1.08 KB | 0644 |
|
| 75supported_sql.t | File | 1.21 KB | 0644 |
|
| 76multi_statement.t | File | 2.85 KB | 0644 |
|
| 80procs.t | File | 2.89 KB | 0644 |
|
| 81procs.t | File | 2.86 KB | 0644 |
|
| 85init_command.t | File | 752 B | 0644 |
|
| 86_bug_36972.t | File | 1.24 KB | 0644 |
|
| 87async.t | File | 6.09 KB | 0644 |
|
| 88async-multi-stmts.t | File | 931 B | 0644 |
|
| 89async-method-check.t | File | 5.96 KB | 0644 |
|
| 91errcheck.t | File | 485 B | 0644 |
|
| 92ssl_backronym_vulnerability.t | File | 1.46 KB | 0644 |
|
| 92ssl_optional.t | File | 1.47 KB | 0644 |
|
| 92ssl_riddle_vulnerability.t | File | 1.48 KB | 0644 |
|
| 99_bug_server_prepare_blob_null.t | File | 1.38 KB | 0644 |
|
| 99compression.t | File | 1.16 KB | 0644 |
|
| gh352.t | File | 626 B | 0644 |
|
| gh360.t | File | 842 B | 0644 |
|
| gh447-paramvalues.t | File | 4.15 KB | 0644 |
|
| lib.pl | File | 3.89 KB | 0644 |
|
| manifest.t | File | 290 B | 0644 |
|
| mysql.mtest | File | 950 B | 0644 |
|
| pod.t | File | 129 B | 0644 |
|
| rt110983-valid-mysqlfd.t | File | 724 B | 0644 |
|
| rt118977-zerofill.t | File | 897 B | 0644 |
|
| rt25389-bin-case.t | File | 1.44 KB | 0644 |
|
| rt50304-column_info_parentheses.t | File | 1.54 KB | 0644 |
|
| rt61849-bind-param-buffer-overflow.t | File | 711 B | 0644 |
|
| rt75353-innodb-lock-timeout.t | File | 2.96 KB | 0644 |
|
| rt83494-quotes-comments.t | File | 922 B | 0644 |
|
| rt85919-fetch-lost-connection.t | File | 2.32 KB | 0644 |
|
| rt86153-reconnect-fail-memory.t | File | 1.94 KB | 0644 |
|
| rt88006-bit-prepare.t | File | 3.66 KB | 0644 |
|
| rt91715.t | File | 850 B | 0644 |
|
| version.t | File | 406 B | 0644 |
|