403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/main/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/main/ctype_sjis.test
-- source include/no_valgrind_without_big.inc
-- source include/have_sjis.inc

#
# Tests with the sjis character set
#
--disable_warnings
drop table if exists t1;
--enable_warnings

set names sjis;

select 'a' like 'a';
select 'A' like 'a';
select 'A' like 'a' collate sjis_bin;

set @sjis1= _sjis   0xa1a2a3a4a5a6a7a8a9aaabacadaeaf;
set @sjis2= _sjis 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebf;
set @sjis3= _sjis 0xc0c1c2c3c4c5c6c7c8c9cacbcccdcecf;
set @sjis4= _sjis 0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedf;

set @utf81= CONVERT(@sjis1 USING utf8);
set @utf82= CONVERT(@sjis2 USING utf8);
set @utf83= CONVERT(@sjis3 USING utf8);
set @utf84= CONVERT(@sjis4 USING utf8);

select hex(@utf81);
select hex(@utf82);
select hex(@utf83);
select hex(@utf84);

select hex(CONVERT(@utf81 USING sjis));
select hex(CONVERT(@utf82 USING sjis));
select hex(CONVERT(@utf83 USING sjis));
select hex(CONVERT(@utf84 USING sjis));

#
# Allow to insert extra CP932 characters
# into a SJIS column
#
create table t1 (a char(10) character set sjis);
insert into t1 values (0x878A);
select hex(a) from t1;
drop table t1;

#
# Bug #6206 ENUMs are not case sensitive even if declared BINARY
#
create table t1(c enum(0x9353,0x9373) character set sjis);
show create table t1;
insert into t1 values (0x9353);
insert into t1 values (0x9373);
select hex(c) from t1;
drop table t1;

#
# Bug #6223 Japanese half-width kana characters get truncated
#
SET NAMES sjis;
CREATE TABLE t1 (
 c char(16) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=sjis;
insert into t1 values(0xb1),(0xb2),(0xb3);
select hex(c) from t1;
drop table t1;


--disable_service_connection
SET collation_connection='sjis_japanese_ci';
-- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
-- source include/ctype_str_to_date.inc
-- source include/ctype_ascii_order.inc
SET collation_connection='sjis_bin';
-- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
-- source include/ctype_ascii_order.inc
--enable_service_connection

# Check parsing of string literals in SJIS with multibyte characters that
# have an embedded \ in them. (Bug #8303)

--character_set sjis
SET NAMES sjis;
SELECT HEX('�����@�\') FROM DUAL;

# End of 4.1 tests

--echo # Start of 5.1 tests

--echo Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
CREATE TABLE t1 (a varchar(16)) character set sjis;
INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a);
DROP TABLE t1;

--echo #
--echo # Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
--echo #
# In the below string backslash (0x5C) is a part of a multi-byte
# character, so it should not be quoted.
SELECT QUOTE('�\');


--echo # End of 5.1 tests


--echo #
--echo # Start of 5.5 tests
--echo #

--echo #
--echo # Testing WL#4583 Case conversion in Asian character sets 
--echo #
#
# Populate t1 with all hex digits
#
SET NAMES utf8;
SET collation_connection=sjis_japanese_ci;
CREATE TABLE t1 (b VARCHAR(2));
INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
#
# Populate tables head and tail with values '00'-'FF'
#
CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
DROP TABLE t1;
#
# Populate table t1 with all codes [80..FF][20..FF]
# excluding Half Width Kana [A1..DF]
# Expected valid sjis codes:
# [81..9F,E0..FC][40..7E,80..fC]  (60x188=11280 characters)
#
CREATE TABLE t1 AS
SELECT concat(head, tail) AS code, ' ' AS a
FROM head, tail
WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN 'A1' AND 'DF')
AND   (tail BETWEEN '20' AND 'FF')
ORDER BY head, tail;
#
# Populate Half Width Kana: [A1..DF]
# 
INSERT IGNORE t1 (code) SELECT head FROM head WHERE (head BETWEEN 'A1' AND 'DF');
DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
UPDATE IGNORE t1 SET a=unhex(code) ORDER BY code;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t1 WHERE a<>'?' AND OCTET_LENGTH(a)=1;
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
#
# Display all characters that have upper or lower case mapping.
#
SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a)
FROM t1
WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a))
ORDER BY code;
#
# Make sure all possible conversion happened
#
# Expect U+212B ANGSTROM SIGN
#
SELECT * FROM t1
WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
      HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
#
# Expect no results
#
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
      HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;

--echo #
--echo # WL#3090 Japanese Character Set adjustments
--echo # Test sjis->Unicode conversion
--echo #
# enable view-protocol in 10.6 version
--disable_view_protocol
SELECT HEX(a), HEX(CONVERT(a USING utf8)) as b FROM t1
WHERE a<>'' HAVING b<>'3F' ORDER BY code;

DROP TABLE t1;


--echo #
--echo # WL#3090 Japanese Character Set adjustments
--echo # Test Unicode->sjis conversion
--echo #
--source include/ctype_utf8_table.inc
SELECT HEX(a), HEX(CONVERT(a using sjis)) as b FROM t1 HAVING b<>'3F' ORDER BY BINARY a;
DROP TABLE t1;

--enable_view_protocol

--echo #
--echo # End of 5.5 tests
--echo #


--echo #
--echo # Start of 5.6 tests
--echo #

--echo #
--echo # WL#3664 WEIGHT_STRING
--echo #

set names sjis;
--source include/weight_string.inc
--source include/weight_string_l1.inc
--source include/weight_string_8140.inc


set collation_connection=sjis_bin;
--source include/weight_string.inc
--source include/weight_string_l1.inc
--source include/weight_string_8140.inc

--echo #
--echo # End of 5.6 tests
--echo #

--echo #
--echo # Start of 10.0 tests
--echo #

# Tests will be skipped for the view protocol because the view protocol creates 
# an additional util connection and other statistics data 
# (it is necessary to run the view-protocol not in util session )
--disable_view_protocol

let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc


--character_set sjis
SET NAMES sjis;
--source include/ctype_E05C.inc

--enable_view_protocol


--echo #
--echo # End of 10.0 tests
--echo #

--echo #
--echo # Start of 10.2 tests
--echo #

--echo #
--echo # MDEV-9842 LOAD DATA INFILE does not work well with a TEXT column when using sjis
--echo #
CREATE TABLE t1 (a TEXT CHARACTER SET sjis);
LOAD DATA INFILE '../../std_data/loaddata/mdev9842.txt' INTO TABLE t1 CHARACTER SET sjis;
SELECT HEX(a) FROM t1;
SELECT a=CONCAT('x', REPEAT(_sjis 0x835C, 200)) FROM t1;
DROP TABLE t1;

--echo #
--echo # MDEV-9711 NO PAD Collatons
--echo #
SET character_set_connection=sjis;
let $coll='sjis_japanese_nopad_ci';
let $coll_pad='sjis_japanese_ci';
--source include/ctype_pad_all_engines.inc

let $coll='sjis_nopad_bin';
let $coll_pad='sjis_bin';
--source include/ctype_pad_all_engines.inc

--echo #
--echo # End of 10.2 tests
--echo #

--echo #
--echo # Start of 10.4 tests
--echo #

--echo #
--echo # MDEV-26953 Assertion `!str || str != Ptr || !is_alloced()' failed in String::copy upon SELECT with sjis
--echo #

SET NAMES sjis;
CREATE TABLE t (a VARCHAR(3));
INSERT INTO t VALUES (''),('');
SELECT GROUP_CONCAT(PASSWORD(a)) AS f FROM t;
DROP TABLE t;

--echo #
--echo # End of 10.4 tests
--echo #

--echo #
--echo # Start of 10.5 tests
--echo #

--echo #
--echo # MDEV-22043 Special character leads to assertion in my_wc_to_printable_generic on 10.5.2 (debug)
--echo #

SET NAMES sjis;
SET @@CHARACTER_SET_CLIENT='cp1257';
--error ER_PARSE_ERROR
(a(b 'т'));

SET NAMES sjis;
SET @@CHARACTER_SET_CLIENT='cp1257';
--error ER_PARSE_ERROR
'т';

SET NAMES sjis;
SET @@CHARACTER_SET_CLIENT='cp1257';
--error ER_PARSE_ERROR
EXECUTE IMMEDIATE _cp1257 0xD182;

SET NAMES sjis;

--echo #
--echo # MDEV-22625 SIGSEGV in intern_find_sys_var (optimized builds)
--echo #

SET NAMES sjis;
SET @seq=_sjis 0x81AD;
--source include/ctype_ident_sys.inc

--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #

select strcmp(_sjis'' collate sjis_japanese_nopad_ci, _sjis 0x0001050001) as c1;
select strcmp(_sjis'' collate sjis_nopad_bin, _sjis 0x0001050001) as c1;

--echo #
--echo # End of 10.5 tests
--echo #

Youez - 2016 - github.com/yon3zu
LinuXploit