summaryrefslogtreecommitdiff
path: root/mysql-test/main/ctype_filename.test
blob: 940be6a7c2427e94fa03227f22b1af1c11cf6b75 (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
--disable_warnings
drop table if exists con, aux, nul, lpt1, com1, `clock$`;
--enable_warnings

create table con (a int);
drop table con;

create table aux (a int);
drop table aux;

create table nul (a int);
drop table nul;

create table lpt1 (a int);
drop table lpt1;

create table com1 (a int);
drop table com1;

create table `clock$` (a int);
drop table `clock$`;

select convert(convert(',' using filename) using binary);

--echo #
--echo # MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member
--echo #
SET NAMES utf8;
SELECT @a:=CONVERT('aя' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a), HEX(REVERSE(@a));


--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 filename;
--error ER_PARSE_ERROR
EXECUTE IMMEDIATE _latin1 0x01;
SET NAMES utf8;

--echo #
--echo # MDEV-23435 Functions do not convert numbers to character_set_results
--echo #

--disable_ps_protocol

SET NAMES utf8, character_set_results=filename;

CREATE TABLE t1 (a DATETIME(6));
INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000');
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (a TIME(6));
INSERT INTO t1 VALUES ('00:00:00.000000');
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (a DATE);
INSERT INTO t1 VALUES ('2001-01-01');
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (a TINYINT);
INSERT INTO t1 VALUES (-1);
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (a SMALLINT);
INSERT INTO t1 VALUES (-1);
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (a MEDIUMINT);
INSERT INTO t1 VALUES (-1);
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (a BIGINT);
INSERT INTO t1 VALUES (-1);
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (a DECIMAL(10.2));
INSERT INTO t1 VALUES (-1);
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (a FLOAT);
INSERT INTO t1 VALUES (-1);
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (-1);
SELECT a, COALESCE(a) AS c FROM t1;
DROP TABLE t1;

SET NAMES utf8;

--enable_ps_protocol


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