summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/r/type_text_indexes.result
blob: ddab60cc5c38da2eed85d9c268c2d94a2842b236 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
SET @ORIG_PAUSE_BACKGROUND_WORK = @@ROCKSDB_PAUSE_BACKGROUND_WORK;
SET GLOBAL ROCKSDB_PAUSE_BACKGROUND_WORK = 1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
t TEXT,
tt TINYTEXT,
m MEDIUMTEXT,
l LONGTEXT,
PRIMARY KEY t (t(32))
) ENGINE=rocksdb;
Warnings:
Warning	1280	Name 't' ignored for PRIMARY key.
SHOW INDEX IN t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment	Ignored
t1	0	PRIMARY	1	t	A	1000	32	NULL		LSMTREE			NO
INSERT INTO t1 (t,tt,m,l) VALUES
('','','',''),
('a','b','c','d'),
('b','d','c','b'),
('test1','test2','test3','test4'),
(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
('abc','def','ghi','jkl'),
('test2','test3','test4','test5'),
('test3','test4','test5','test6'),
(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	range	PRIMARY	PRIMARY	34	NULL	#	Using where; Using filesort
SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f;
f


EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	#	Using where; Using filesort
SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f;
f


DROP TABLE t1;
CREATE TABLE t1 (
t TEXT,
tt TINYTEXT,
m MEDIUMTEXT,
l LONGTEXT,
pk TINYTEXT PRIMARY KEY,
UNIQUE INDEX l_tt (l(256),tt(64))
) ENGINE=rocksdb;
ERROR 42000: BLOB/TEXT column 'pk' used in key specification without a key length
CREATE TABLE t1 (
t TEXT,
tt TINYTEXT,
m MEDIUMTEXT,
l LONGTEXT,
pk MEDIUMTEXT,
PRIMARY KEY mt (pk(1)),
INDEX (m(128))
) ENGINE=rocksdb;
Warnings:
Warning	1280	Name 'mt' ignored for PRIMARY key.
SHOW INDEX IN t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment	Ignored
t1	0	PRIMARY	1	pk	A	1000	1	NULL		LSMTREE			NO
t1	1	m	1	m	A	500	128	NULL	YES	LSMTREE			NO
INSERT INTO t1 (t,tt,m,l,pk) VALUES
('','','','','0'),
('a','b','c','d','1'),
('b','d','c','b','2'),
('test1','test2','test3','test4','3'),
(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128),'4'),
('abc','def','ghi','jkl','5'),
('test2','test3','test4','test5','6'),
('test3','test4','test5','test6','7'),
(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128),'8'),
(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128),'9');
EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	m	m	131	const	#	Using where; Using filesort
SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
f
DROP TABLE t1;
CREATE TABLE t1 (
b TEXT,
PRIMARY KEY b (b(32))
) ENGINE=rocksdb;
Warnings:
Warning	1280	Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'),
('00000000000000000000000000000001'),
('00000000000000000000000000000002');
SELECT b FROM t1;
b
00000000000000000000000000000000
00000000000000000000000000000001
00000000000000000000000000000002
DROP TABLE t1;
CREATE TABLE t1 (
b TINYTEXT,
PRIMARY KEY b (b(32))
) ENGINE=rocksdb;
Warnings:
Warning	1280	Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'),
('00000000000000000000000000000001'),
('00000000000000000000000000000002');
SELECT b FROM t1;
b
00000000000000000000000000000000
00000000000000000000000000000001
00000000000000000000000000000002
DROP TABLE t1;
CREATE TABLE t1 (
b MEDIUMTEXT,
PRIMARY KEY b (b(32))
) ENGINE=rocksdb;
Warnings:
Warning	1280	Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'),
('00000000000000000000000000000001'),
('00000000000000000000000000000002');
SELECT b FROM t1;
b
00000000000000000000000000000000
00000000000000000000000000000001
00000000000000000000000000000002
DROP TABLE t1;
CREATE TABLE t1 (
b LONGTEXT,
PRIMARY KEY b (b(32))
) ENGINE=rocksdb;
Warnings:
Warning	1280	Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'),
('00000000000000000000000000000001'),
('00000000000000000000000000000002');
SELECT b FROM t1;
b
00000000000000000000000000000000
00000000000000000000000000000001
00000000000000000000000000000002
DROP TABLE t1;
CREATE TABLE t1 (
b LONGTEXT CHARACTER SET "binary" COLLATE "binary",
PRIMARY KEY b (b(32))
) ENGINE=rocksdb;
Warnings:
Warning	1280	Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'),
('00000000000000000000000000000001'),
('00000000000000000000000000000002');
INSERT INTO t1 (b) VALUES (''), (_binary 0x0), (' ');
SELECT hex(b) FROM t1;
hex(b)

00
20
3030303030303030303030303030303030303030303030303030303030303030
3030303030303030303030303030303030303030303030303030303030303031
3030303030303030303030303030303030303030303030303030303030303032
DROP TABLE t1;
CREATE TABLE t1 (
b LONGTEXT CHARACTER SET "latin1" COLLATE "latin1_bin",
PRIMARY KEY b (b(32))
) ENGINE=rocksdb;
Warnings:
Warning	1280	Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES (''), (_binary 0x0), (' ');
ERROR 23000: Duplicate entry ' ' for key 'PRIMARY'
INSERT INTO t1 (b) VALUES (''), (_binary 0x0);
SELECT hex(b) FROM t1;
hex(b)
00

DROP TABLE t1;
SET GLOBAL ROCKSDB_PAUSE_BACKGROUND_WORK = @ORIG_PAUSE_BACKGROUND_WORK;