~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
drop table if exists t1,t2;
2
select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo';
3
hello	'hello'	""hello""	'h'e'l'l'o'	hel"lo	hel'lo
4
hello	'hello'	""hello""	'h'e'l'l'o'	hel"lo	hel'lo
5
select 'hello' 'monty';
6
hello
7
hellomonty
8
select length('\n\t\r\b\0\_\%\\');
9
length('\n\t\r\b\0\_\%\\')
10
10
11
select char_length('\n\t\r\b\0\_\%\\');
12
char_length('\n\t\r\b\0\_\%\\')
13
10
1086.5.2 by Devananda
added simple test case
14
select character_length('\n\t\r\b\0\_\%\\');
15
character_length('\n\t\r\b\0\_\%\\')
16
10
512 by Brian Aker
Adding back more test cases.
17
select length('\n\t\n\b\0\\_\\%\\');
18
length('\n\t\n\b\0\\_\\%\\')
1 by brian
clean slate
19
10
20
select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h');
21
concat('monty',' was here ','again')	length('hello')	char(ascii('h'))	ord('h')
22
monty was here again	5	h	104
23
select hex(char(256));
24
hex(char(256))
25
0100
26
select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ;
27
locate('he','hello')	locate('he','hello',2)	locate('lo','hello',2)
28
1	0	4
29
select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE');
30
instr('hello','HE')	instr('hello',binary 'HE')	instr(binary 'hello','HE')
31
1	0	0
32
select position(binary 'll' in 'hello'),position('a' in binary 'hello');
33
position(binary 'll' in 'hello')	position('a' in binary 'hello')
34
3	0
35
select left('hello',null), right('hello',null);
36
left('hello',null)	right('hello',null)
37
NULL	NULL
38
select left('hello',2),right('hello',2),substring('hello',2,2),mid('hello',1,5) ;
39
left('hello',2)	right('hello',2)	substring('hello',2,2)	mid('hello',1,5)
40
he	lo	el	hello
41
select concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1)) ;
42
concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1))
43
happy
44
select substring_index('www.tcx.se','.',-2),substring_index('www.tcx.se','.',1);
45
substring_index('www.tcx.se','.',-2)	substring_index('www.tcx.se','.',1)
46
tcx.se	www
47
select substring_index('www.tcx.se','tcx',1),substring_index('www.tcx.se','tcx',-1);
48
substring_index('www.tcx.se','tcx',1)	substring_index('www.tcx.se','tcx',-1)
49
www.	.se
50
select substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1);
51
substring_index('.tcx.se','.',-2)	substring_index('.tcx.se','.tcx',-1)
52
tcx.se	.se
53
select substring_index('aaaaaaaaa1','a',1);
54
substring_index('aaaaaaaaa1','a',1)
55
56
select substring_index('aaaaaaaaa1','aa',1);
57
substring_index('aaaaaaaaa1','aa',1)
58
59
select substring_index('aaaaaaaaa1','aa',2);
60
substring_index('aaaaaaaaa1','aa',2)
61
aa
62
select substring_index('aaaaaaaaa1','aa',3);
63
substring_index('aaaaaaaaa1','aa',3)
64
aaaa
65
select substring_index('aaaaaaaaa1','aa',4);
66
substring_index('aaaaaaaaa1','aa',4)
67
aaaaaa
68
select substring_index('aaaaaaaaa1','aa',5);
69
substring_index('aaaaaaaaa1','aa',5)
70
aaaaaaaaa1
71
select substring_index('aaaaaaaaa1','aaa',1);
72
substring_index('aaaaaaaaa1','aaa',1)
73
74
select substring_index('aaaaaaaaa1','aaa',2);
75
substring_index('aaaaaaaaa1','aaa',2)
76
aaa
77
select substring_index('aaaaaaaaa1','aaa',3);
78
substring_index('aaaaaaaaa1','aaa',3)
79
aaaaaa
80
select substring_index('aaaaaaaaa1','aaa',4);
81
substring_index('aaaaaaaaa1','aaa',4)
82
aaaaaaaaa1
83
select substring_index('aaaaaaaaa1','aaaa',1);
84
substring_index('aaaaaaaaa1','aaaa',1)
85
86
select substring_index('aaaaaaaaa1','aaaa',2);
87
substring_index('aaaaaaaaa1','aaaa',2)
88
aaaa
89
select substring_index('aaaaaaaaa1','1',1);
90
substring_index('aaaaaaaaa1','1',1)
91
aaaaaaaaa
92
select substring_index('aaaaaaaaa1','a',-1);
93
substring_index('aaaaaaaaa1','a',-1)
94
1
95
select substring_index('aaaaaaaaa1','aa',-1);
96
substring_index('aaaaaaaaa1','aa',-1)
512 by Brian Aker
Adding back more test cases.
97
a1
1 by brian
clean slate
98
select substring_index('aaaaaaaaa1','aa',-2);
99
substring_index('aaaaaaaaa1','aa',-2)
512 by Brian Aker
Adding back more test cases.
100
aaa1
1 by brian
clean slate
101
select substring_index('aaaaaaaaa1','aa',-3);
102
substring_index('aaaaaaaaa1','aa',-3)
512 by Brian Aker
Adding back more test cases.
103
aaaaa1
1 by brian
clean slate
104
select substring_index('aaaaaaaaa1','aa',-4);
105
substring_index('aaaaaaaaa1','aa',-4)
512 by Brian Aker
Adding back more test cases.
106
aaaaaaa1
1 by brian
clean slate
107
select substring_index('aaaaaaaaa1','aa',-5);
108
substring_index('aaaaaaaaa1','aa',-5)
109
aaaaaaaaa1
110
select substring_index('aaaaaaaaa1','aaa',-1);
111
substring_index('aaaaaaaaa1','aaa',-1)
112
1
113
select substring_index('aaaaaaaaa1','aaa',-2);
114
substring_index('aaaaaaaaa1','aaa',-2)
115
aaa1
116
select substring_index('aaaaaaaaa1','aaa',-3);
117
substring_index('aaaaaaaaa1','aaa',-3)
118
aaaaaa1
119
select substring_index('aaaaaaaaa1','aaa',-4);
120
substring_index('aaaaaaaaa1','aaa',-4)
512 by Brian Aker
Adding back more test cases.
121
aaaaaaaaa1
1 by brian
clean slate
122
select substring_index('the king of thethe hill','the',-2);
123
substring_index('the king of thethe hill','the',-2)
124
the hill
125
select substring_index('the king of the the hill','the',-2);
126
substring_index('the king of the the hill','the',-2)
127
 the hill
128
select substring_index('the king of the  the hill','the',-2);
129
substring_index('the king of the  the hill','the',-2)
130
  the hill
131
select substring_index('the king of the  the hill',' the ',-1);
132
substring_index('the king of the  the hill',' the ',-1)
133
hill
134
select substring_index('the king of the  the hill',' the ',-2);
135
substring_index('the king of the  the hill',' the ',-2)
136
 the hill
137
select substring_index('the king of the  the hill',' ',-1);
138
substring_index('the king of the  the hill',' ',-1)
139
hill
140
select substring_index('the king of the  the hill',' ',-2);
141
substring_index('the king of the  the hill',' ',-2)
142
the hill
143
select substring_index('the king of the  the hill',' ',-3);
144
substring_index('the king of the  the hill',' ',-3)
145
 the hill
146
select substring_index('the king of the  the hill',' ',-4);
147
substring_index('the king of the  the hill',' ',-4)
148
the  the hill
149
select substring_index('the king of the  the hill',' ',-5);
150
substring_index('the king of the  the hill',' ',-5)
151
of the  the hill
152
select substring_index('the king of the.the hill','the',-2);
153
substring_index('the king of the.the hill','the',-2)
154
.the hill
155
select substring_index('the king of thethethe.the hill','the',-3);
156
substring_index('the king of thethethe.the hill','the',-3)
157
the.the hill
158
select substring_index('the king of thethethe.the hill','the',-1);
159
substring_index('the king of thethethe.the hill','the',-1)
160
 hill
161
select substring_index('the king of the the hill','the',1);
162
substring_index('the king of the the hill','the',1)
163
164
select substring_index('the king of the the hill','the',2);
165
substring_index('the king of the the hill','the',2)
166
the king of 
167
select substring_index('the king of the the hill','the',3);
168
substring_index('the king of the the hill','the',3)
169
the king of the 
170
select concat(':',ltrim('  left  '),':',rtrim('  right  '),':');
171
concat(':',ltrim('  left  '),':',rtrim('  right  '),':')
172
:left  :  right:
173
select concat(':',trim(leading from '  left  '),':',trim(trailing from '  right  '),':');
174
concat(':',trim(leading from '  left  '),':',trim(trailing from '  right  '),':')
175
:left  :  right:
176
select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':');
177
concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':')
178
:left: right:
179
select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':');
180
concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':')
181
:m:y:s:
182
select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':');
183
concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':')
184
:my:sql:
185
select concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':');
186
concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':')
187
:my:sql:
188
select TRIM("foo" FROM "foo"), TRIM("foo" FROM "foook"), TRIM("foo" FROM "okfoo");
189
TRIM("foo" FROM "foo")	TRIM("foo" FROM "foook")	TRIM("foo" FROM "okfoo")
190
	ok	ok
191
select concat_ws(', ','monty','was here','again');
192
concat_ws(', ','monty','was here','again')
193
monty, was here, again
194
select concat_ws(NULL,'a'),concat_ws(',',NULL,'');
195
concat_ws(NULL,'a')	concat_ws(',',NULL,'')
196
NULL	
197
select concat_ws(',','',NULL,'a');
198
concat_ws(',','',NULL,'a')
199
,a
200
SELECT CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"');
201
CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"')
202
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
203
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
204
insert('txs',2,1,'hi')	insert('is ',4,0,'a')	insert('txxxxt',2,4,'es')
205
this	is a	test
206
select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');
207
replace('aaaa','a','b')	replace('aaaa','aa','b')	replace('aaaa','a','bb')	replace('aaaa','','b')	replace('bbbb','a','c')
208
bbbb	bb	bbbbbbbb	aaaa	bbbb
209
select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ;
210
replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL')
211
this is a REAL test
212
select crc32("123");
213
crc32("123")
214
2286445522
215
select repeat('monty',5),concat('*',space(5),'*');
216
repeat('monty',5)	concat('*',space(5),'*')
217
montymontymontymontymonty	*     *
218
select reverse('abc'),reverse('abcd');
219
reverse('abc')	reverse('abcd')
220
cba	dcba
221
select rpad('a',4,'1'),rpad('a',4,'12'),rpad('abcd',3,'12'), rpad(11, 10 , 22), rpad("ab", 10, 22);
222
rpad('a',4,'1')	rpad('a',4,'12')	rpad('abcd',3,'12')	rpad(11, 10 , 22)	rpad("ab", 10, 22)
223
a111	a121	abc	1122222222	ab22222222
224
select lpad('a',4,'1'),lpad('a',4,'12'),lpad('abcd',3,'12'), lpad(11, 10 , 22);
225
lpad('a',4,'1')	lpad('a',4,'12')	lpad('abcd',3,'12')	lpad(11, 10 , 22)
226
111a	121a	abc	2222222211
227
select rpad(741653838,17,'0'),lpad(741653838,17,'0');
228
rpad(741653838,17,'0')	lpad(741653838,17,'0')
229
74165383800000000	00000000741653838
230
select rpad('abcd',7,'ab'),lpad('abcd',7,'ab');
231
rpad('abcd',7,'ab')	lpad('abcd',7,'ab')
232
abcdaba	abaabcd
233
select rpad('abcd',1,'ab'),lpad('abcd',1,'ab');
234
rpad('abcd',1,'ab')	lpad('abcd',1,'ab')
235
a	a
236
select rpad('STRING', 20, CONCAT('p','a','d') );
237
rpad('STRING', 20, CONCAT('p','a','d') )
238
STRINGpadpadpadpadpa
239
select lpad('STRING', 20, CONCAT('p','a','d') );
240
lpad('STRING', 20, CONCAT('p','a','d') )
241
padpadpadpadpaSTRING
242
select LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD'),GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD');
243
LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD')	GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD')
244
NULL	NULL
245
select quote('\'\"\\test');
246
quote('\'\"\\test')
247
'\'"\\test'
248
select quote(concat('abc\'', '\\cba'));
249
quote(concat('abc\'', '\\cba'))
250
'abc\'\\cba'
251
select quote(1/0), quote('\0\Z');
1812.4.2 by Brian Aker
Fix issue with divide by zero not being an error.
252
ERROR 22012: Division by 0
1 by brian
clean slate
253
select length(quote(concat(char(0),"test")));
254
length(quote(concat(char(0),"test")))
255
8
256
select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
257
hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))))
258
27E0E3E6E7E8EAEB27
259
select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL);
260
unhex(hex("foobar"))	hex(unhex("1234567890ABCDEF"))	unhex("345678")	unhex(NULL)
261
foobar	1234567890ABCDEF	4Vx	NULL
262
select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
263
hex(unhex("1"))	hex(unhex("12"))	hex(unhex("123"))	hex(unhex("1234"))	hex(unhex("12345"))	hex(unhex("123456"))
264
01	12	0123	1234	012345	123456
265
select concat('a', quote(NULL));
266
concat('a', quote(NULL))
267
aNULL
268
select reverse("");
269
reverse("")
270
271
select insert("aa",100,1,"b"),insert("aa",1,3,"b"),left("aa",-1),substring("a",1,2);
272
insert("aa",100,1,"b")	insert("aa",1,3,"b")	left("aa",-1)	substring("a",1,2)
273
aa	b		a
274
select elt(2,1),field(NULL,"a","b","c"),reverse("");
275
elt(2,1)	field(NULL,"a","b","c")	reverse("")
276
NULL	0	
277
select locate("a","b",2),locate("","a",1);
278
locate("a","b",2)	locate("","a",1)
279
0	1
280
select ltrim("a"),rtrim("a"),trim(BOTH "" from "a"),trim(BOTH " " from "a");
281
ltrim("a")	rtrim("a")	trim(BOTH "" from "a")	trim(BOTH " " from "a")
282
a	a	a	a
283
select substring_index("www.tcx.se","",3);
284
substring_index("www.tcx.se","",3)
285
286
select length(repeat("a",100000000)),length(repeat("a",1000*64));
287
length(repeat("a",100000000))	length(repeat("a",1000*64))
288
NULL	64000
289
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
290
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
291
select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql"));
292
position("0" in "baaa" in (1))	position("0" in "1" in (1,2,3))	position("sql" in ("mysql"))
293
1	0	3
294
Warnings:
295
Warning	1292	Truncated incorrect DOUBLE value: 'baaa'
296
select position(("1" in (1,2,3)) in "01");
297
position(("1" in (1,2,3)) in "01")
298
2
299
select length(repeat("a",65500)),length(concat(repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",10000)))),length(insert(repeat("a",40000),1,30000,repeat("b",50000)));
300
length(repeat("a",65500))	length(concat(repeat("a",32000),repeat("a",32000)))	length(replace("aaaaa","a",concat(repeat("a",10000))))	length(insert(repeat("a",40000),1,30000,repeat("b",50000)))
301
65500	64000	50000	60000
302
select length(repeat("a",1000000)),length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",32000)))),length(insert(repeat("a",48000),1,1000,repeat("a",48000)));
303
length(repeat("a",1000000))	length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000)))	length(replace("aaaaa","a",concat(repeat("a",32000))))	length(insert(repeat("a",48000),1,1000,repeat("a",48000)))
304
1000000	96000	160000	95000
305
create table t1 ( domain char(50) );
306
insert into t1 VALUES ("hello.de" ), ("test.de" );
307
select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@hello.de';
308
domain
309
hello.de
310
select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@test.de';
311
domain
312
test.de
313
drop table t1;
1063.9.3 by Brian Aker
Partial fix for tests for tmp
314
CREATE TEMPORARY TABLE t1 (
512 by Brian Aker
Adding back more test cases.
315
id int NOT NULL,
1 by brian
clean slate
316
title varchar(255) default NULL,
512 by Brian Aker
Adding back more test cases.
317
prio int default NULL,
318
category int default NULL,
319
program int default NULL,
1 by brian
clean slate
320
bugdesc text,
321
created datetime default NULL,
322
modified timestamp NOT NULL,
512 by Brian Aker
Adding back more test cases.
323
bugstatus int default NULL,
324
submitter int default NULL
1 by brian
clean slate
325
) ENGINE=MyISAM;
326
INSERT INTO t1 VALUES (1,'Link',1,1,1,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa','2001-02-28 08:40:16',20010228084016,0,4);
327
SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter), '"') FROM t1;
328
CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter), '"')
329
"Link";"1";"1";"1";"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"2001-02-28 08:40:16";"20010228084016";"0";"4"
330
SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"') FROM t1;
331
CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"')
332
"Link";"1";"1";"1";"0";"4"
333
SELECT CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter) FROM t1;
334
CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter)
335
Link";"1";"1";"1";"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"2001-02-28 08:40:16";"20010228084016";"0";"4
336
SELECT bugdesc, REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb') from t1 group by bugdesc;
337
bugdesc	REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb')
338
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa	aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
339
drop table t1;
1063.9.3 by Brian Aker
Partial fix for tests for tmp
340
CREATE TEMPORARY TABLE t1 (id int NOT NULL auto_increment, tmp text NOT NULL, KEY id (id)) ENGINE=MyISAM;
1 by brian
clean slate
341
INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
342
DROP TABLE t1;
343
CREATE TABLE t1 (
512 by Brian Aker
Adding back more test cases.
344
wid int NOT NULL auto_increment,
1 by brian
clean slate
345
data_podp date default NULL,
346
status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
347
PRIMARY KEY(wid)
348
);
349
INSERT INTO t1 VALUES (8,NULL,'real');
350
INSERT INTO t1 VALUES (9,NULL,'nowy');
351
SELECT elt(status_wnio,data_podp) FROM t1 GROUP BY wid;
352
elt(status_wnio,data_podp)
353
NULL
354
NULL
355
DROP TABLE t1;
1063.9.3 by Brian Aker
Partial fix for tests for tmp
356
CREATE TEMPORARY TABLE t1 (title text) ENGINE=MyISAM;
1 by brian
clean slate
357
INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education');
358
INSERT INTO t1 VALUES ('House passes the CAREERS bill');
359
SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
360
CONCAT("</a>",RPAD("",(55 - LENGTH(title)),"."))
361
NULL
362
</a>..........................
363
DROP TABLE t1;
364
CREATE TABLE t1 (i int, j int);
365
INSERT INTO t1 VALUES (1,1),(2,2);
366
SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
367
i	ELT(j, '345', '34')
368
1	345
369
2	34
370
DROP TABLE t1;
371
create table t1(a char(4));
372
insert into t1 values ('one'),(NULL),('two'),('four');
373
select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1;
374
a	quote(a)	isnull(quote(a))	quote(a) is null	ifnull(quote(a), 'n')
375
one	'one'	0	0	'one'
376
NULL	NULL	0	0	NULL
377
two	'two'	0	0	'two'
378
four	'four'	0	0	'four'
379
drop table t1;
380
select trim(trailing 'foo' from 'foo');
381
trim(trailing 'foo' from 'foo')
382
383
select trim(leading 'foo' from 'foo');
384
trim(leading 'foo' from 'foo')
385
386
select quote(ltrim(concat('    ', 'a')));
387
quote(ltrim(concat('    ', 'a')))
388
'a'
389
select quote(trim(concat('    ', 'a')));
390
quote(trim(concat('    ', 'a')))
391
'a'
392
CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3;
393
SELECT QUOTE('A') FROM t1;
394
QUOTE('A')
395
'A'
396
'A'
397
'A'
398
DROP TABLE t1;
399
select SUBSTR('abcdefg',3,2);
400
SUBSTR('abcdefg',3,2)
401
cd
402
select SUBSTRING('abcdefg',3,2);
403
SUBSTRING('abcdefg',3,2)
404
cd
512 by Brian Aker
Adding back more test cases.
405
select SUBSTR('abcdefg',-3,2);
1 by brian
clean slate
406
SUBSTR('abcdefg',-3,2)
407
ef
512 by Brian Aker
Adding back more test cases.
408
select SUBSTR('abcdefg',-1,5);
1 by brian
clean slate
409
SUBSTR('abcdefg',-1,5)
410
g
512 by Brian Aker
Adding back more test cases.
411
select SUBSTR('abcdefg',0,0);
1 by brian
clean slate
412
SUBSTR('abcdefg',0,0)
413
512 by Brian Aker
Adding back more test cases.
414
select SUBSTR('abcdefg',-1,-1);
1 by brian
clean slate
415
SUBSTR('abcdefg',-1,-1)
416
512 by Brian Aker
Adding back more test cases.
417
select SUBSTR('abcdefg',1,-1);
1 by brian
clean slate
418
SUBSTR('abcdefg',1,-1)
419
420
select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2);
421
substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)	substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2)
422
1abcd;2abcd	3abcd;4abcd
423
explain extended select concat('*',space(5),'*');
424
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
425
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
426
Warnings:
427
Note	1003	select concat('*',repeat(' ',5),'*') AS `concat('*',space(5),'*')`
428
explain extended select reverse('abc');
429
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
430
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
431
Warnings:
432
Note	1003	select reverse('abc') AS `reverse('abc')`
433
explain extended select rpad('a',4,'1');
434
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
435
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
436
Warnings:
437
Note	1003	select rpad('a',4,'1') AS `rpad('a',4,'1')`
438
explain extended select lpad('a',4,'1');
439
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
440
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
441
Warnings:
442
Note	1003	select lpad('a',4,'1') AS `lpad('a',4,'1')`
443
explain extended select concat_ws(',','',NULL,'a');
444
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
445
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
446
Warnings:
447
Note	1003	select concat_ws(',','',NULL,'a') AS `concat_ws(',','',NULL,'a')`
448
explain extended select elt(2,1);
449
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
450
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
451
Warnings:
452
Note	1003	select elt(2,1) AS `elt(2,1)`
453
explain extended select locate("a","b",2);
454
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
455
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
456
Warnings:
457
Note	1003	select locate('a','b',2) AS `locate("a","b",2)`
458
explain extended select char(0);
459
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
460
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
461
Warnings:
462
Note	1003	select char(0) AS `char(0)`
463
explain extended select conv(130,16,10);
464
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
465
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
466
Warnings:
467
Note	1003	select conv(130,16,10) AS `conv(130,16,10)`
468
explain extended select hex(130);
469
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
470
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
471
Warnings:
472
Note	1003	select hex(130) AS `hex(130)`
473
explain extended select binary 'HE';
474
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
475
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
476
Warnings:
477
Note	1003	select cast('HE' as char charset binary) AS `binary 'HE'`
478
explain extended select collation(conv(130,16,10));
479
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
480
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
481
Warnings:
482
Note	1003	select collation(conv(130,16,10)) AS `collation(conv(130,16,10))`
483
explain extended select length('\n\t\r\b\0\_\%\\');
484
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
485
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
486
Warnings:
487
Note	1003	select length('\n	\r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`
488
explain extended select concat('monty',' was here ','again');
489
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
490
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
491
Warnings:
492
Note	1003	select concat('monty',' was here ','again') AS `concat('monty',' was here ','again')`
493
explain extended select length('hello');
494
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
495
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
496
Warnings:
497
Note	1003	select length('hello') AS `length('hello')`
498
explain extended select char(ascii('h'));
499
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
500
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
501
Warnings:
502
Note	1003	select char(ascii('h')) AS `char(ascii('h'))`
503
explain extended select ord('h');
504
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
505
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
506
Warnings:
507
Note	1003	select ord('h') AS `ord('h')`
508
explain extended select quote(1/0);
509
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
510
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
511
Warnings:
512
Note	1003	select quote((1 / 0)) AS `quote(1/0)`
513
explain extended select crc32("123");
514
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
515
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
516
Warnings:
517
Note	1003	select crc32('123') AS `crc32("123")`
518
explain extended select replace('aaaa','a','b');
519
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
520
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
521
Warnings:
522
Note	1003	select replace('aaaa','a','b') AS `replace('aaaa','a','b')`
523
explain extended select insert('txs',2,1,'hi');
524
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
525
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
526
Warnings:
527
Note	1003	select insert('txs',2,1,'hi') AS `insert('txs',2,1,'hi')`
528
explain extended select SUBSTR('abcdefg',3,2);
529
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
530
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
531
Warnings:
532
Note	1003	select substr('abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`
533
explain extended select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2);
534
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
535
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
536
Warnings:
537
Note	1003	select substring_index('1abcd;2abcd;3abcd;4abcd',';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`
538
SELECT lpad(12345, 5, "#");
539
lpad(12345, 5, "#")
540
12345
541
SELECT conv(71, 10, 36), conv('1Z', 36, 10);
542
conv(71, 10, 36)	conv('1Z', 36, 10)
543
1Z	71
544
SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10);
545
conv(71, 10, 37)	conv('1Z', 37, 10)	conv(0,1,10)	conv(0,0,10)	conv(0,-1,10)
546
NULL	NULL	NULL	NULL	NULL
512 by Brian Aker
Adding back more test cases.
547
create table t1 (id int, str varchar(10));
1 by brian
clean slate
548
insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb');
512 by Brian Aker
Adding back more test cases.
549
create table t2 (id int, str varchar(10));
1 by brian
clean slate
550
insert into t2 values (1,'cccccccccc'), (2,'dddddddddd');
551
select substring(concat(t1.str, t2.str), 1, 15) "name" from t1, t2 
552
where t2.id=t1.id order by name;
553
name
554
aaaaaaaaaaccccc
555
bbbbbbbbbbddddd
556
drop table t1, t2;
512 by Brian Aker
Adding back more test cases.
557
create table t1 (c1 INT, c2 INT);
1 by brian
clean slate
558
insert into t1 values ('21474836461','21474836461');
512 by Brian Aker
Adding back more test cases.
559
ERROR 22003: Out of range value for column 'c1' at row 1
1 by brian
clean slate
560
insert into t1 values ('-21474836461','-21474836461');
512 by Brian Aker
Adding back more test cases.
561
ERROR 22003: Out of range value for column 'c1' at row 1
1 by brian
clean slate
562
select * from t1;
563
c1	c2
564
drop table t1;
565
select left(1234, 3) + 0;
566
left(1234, 3) + 0
567
123
568
create table t1 (a int not null primary key, b varchar(40), c datetime);
569
insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14');
570
select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
571
total	reg
572
10	2004-12-10
573
drop table t1;
574
select trim(null from 'kate') as "must_be_null";
575
must_be_null
576
NULL
577
select trim('xyz' from null) as "must_be_null";
578
must_be_null
579
NULL
580
select trim(leading NULL from 'kate') as "must_be_null";
581
must_be_null
582
NULL
583
select trim(trailing NULL from 'xyz') as "must_be_null";
584
must_be_null
585
NULL
1063.9.3 by Brian Aker
Partial fix for tests for tmp
586
CREATE TEMPORARY TABLE t1 (
512 by Brian Aker
Adding back more test cases.
587
id int NOT NULL auto_increment,
588
a bigint default NULL,
1 by brian
clean slate
589
PRIMARY KEY  (id)
590
) ENGINE=MyISAM;
512 by Brian Aker
Adding back more test cases.
591
INSERT INTO t1 VALUES ('0','16307858876001849059');
592
ERROR 22003: Out of range value for column 'a' at row 1
1 by brian
clean slate
593
SELECT CONV('e251273eb74a8ee3', 16, 10);
594
CONV('e251273eb74a8ee3', 16, 10)
595
16307858876001849059
596
EXPLAIN 
597
SELECT id
598
FROM t1
599
WHERE a = 16307858876001849059;
600
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
512 by Brian Aker
Adding back more test cases.
601
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
1 by brian
clean slate
602
EXPLAIN 
603
SELECT id
604
FROM t1
605
WHERE a = CONV('e251273eb74a8ee3', 16, 10);
606
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
512 by Brian Aker
Adding back more test cases.
607
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
1 by brian
clean slate
608
DROP TABLE t1;
609
SELECT CHAR(NULL,121,83,81,'76') as my_column;
610
my_column
611
ySQL
612
SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column;
613
my_column
614
4
615
CREATE TABLE t1 (id int PRIMARY KEY, str char(255) NOT NULL);
616
CREATE TABLE t2 (id int NOT NULL UNIQUE);
617
INSERT INTO t2 VALUES (1),(2);
618
INSERT INTO t1 VALUES (2, 'not valid');
619
DROP TABLE t1, t2;
620
select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0);
621
field(0,NULL,1,0)	field("",NULL,"bar","")	field(0.0,NULL,1.0,0.0)
622
3	3	3
623
select field(NULL,1,2,NULL), field(NULL,1,2,0);
624
field(NULL,1,2,NULL)	field(NULL,1,2,0)
625
0	0
626
CREATE TABLE t1 (str varchar(20) PRIMARY KEY);
627
CREATE TABLE t2 (num int primary key);
628
INSERT INTO t1 VALUES ('notnumber');
629
INSERT INTO t2 VALUES (0), (1);
630
SELECT * FROM t1, t2 WHERE num=str;
631
str	num
632
notnumber	0
633
SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
634
str	num
635
notnumber	0
636
DROP TABLE t1,t2;
637
CREATE TABLE t1(
512 by Brian Aker
Adding back more test cases.
638
id int NOT NULL auto_increment,
639
pc int NOT NULL default '0',
1 by brian
clean slate
640
title varchar(20) default NULL,
641
PRIMARY KEY (id)
642
);
643
INSERT INTO t1 VALUES
644
(1, 0, 'Main'),
645
(2, 1, 'Toys'),
646
(3, 1, 'Games');
647
SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
648
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
649
LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
650
id	col1
651
1	Main
652
2	Main->Toys
653
3	Main->Games
654
SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
655
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
656
LEFT JOIN t1 AS t3 ON t2.pc=t3.id
657
WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%';
658
id	col1
659
2	Main->Toys
660
DROP TABLE t1;
661
CREATE TABLE t1(
512 by Brian Aker
Adding back more test cases.
662
trackid     int NOT NULL auto_increment,
1 by brian
clean slate
663
trackname   varchar(100) NOT NULL default '',
664
PRIMARY KEY (trackid)
665
);
666
CREATE TABLE t2(
512 by Brian Aker
Adding back more test cases.
667
artistid    int NOT NULL auto_increment,
1 by brian
clean slate
668
artistname  varchar(100) NOT NULL default '',
669
PRIMARY KEY (artistid)
670
);
671
CREATE TABLE t3(
512 by Brian Aker
Adding back more test cases.
672
trackid     int NOT NULL,
673
artistid    int NOT NULL,
1 by brian
clean slate
674
PRIMARY KEY (trackid,artistid)
675
);
676
INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York');
677
INSERT INTO t2 VALUES (1, 'Vernon Duke');
678
INSERT INTO t3 VALUES (1,1);
679
SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname
680
FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid
681
LEFT JOIN t2 ON t2.artistid=t3.artistid
682
WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%';
683
trackname	artistname
684
April In Paris Vernon Duke	Vernon Duke
685
Autumn In New York	NULL
686
DROP TABLE t1,t2,t3;
687
create table t1 (b varchar(5));
688
insert t1 values ('ab'), ('abc'), ('abcd'), ('abcde');
689
select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1;
690
b	substring(b,1)	substring(b,-1)	substring(b,-2)	substring(b,-3)	substring(b,-4)	substring(b,-5)
691
ab	ab	b	ab			
692
abc	abc	c	bc	abc		
693
abcd	abcd	d	cd	bcd	abcd	
694
abcde	abcde	e	de	cde	bcde	abcde
695
select * from (select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1) t;
696
b	substring(b,1)	substring(b,-1)	substring(b,-2)	substring(b,-3)	substring(b,-4)	substring(b,-5)
697
ab	ab	b	ab			
698
abc	abc	c	bc	abc		
699
abcd	abcd	d	cd	bcd	abcd	
700
abcde	abcde	e	de	cde	bcde	abcde
701
drop table t1;
702
select hex(29223372036854775809), hex(-29223372036854775809);
703
hex(29223372036854775809)	hex(-29223372036854775809)
704
FFFFFFFFFFFFFFFF	FFFFFFFFFFFFFFFF
705
create table t1 (i int);
706
insert into t1 values (1000000000),(1);
707
select lpad(i, 7, ' ') as t from t1;
708
Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
971.7.6 by Eric Day
Merged Stewart's tinyint removal, and fixed a few things to not break protocol.
709
def					t	8	7	7	Y	128	31	63
1 by brian
clean slate
710
t
711
1000000
712
      1
713
select rpad(i, 7, ' ') as t from t1;
714
Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
971.7.6 by Eric Day
Merged Stewart's tinyint removal, and fixed a few things to not break protocol.
715
def					t	8	7	7	Y	128	31	63
1 by brian
clean slate
716
t
717
1000000
718
1      
719
drop table t1;
1878.8.7 by patrick crews
Recorded func_str.result file after changes to test file
720
select load_file(DRIZZLETEST_BAD_FILE);
1878.8.5 by patrick crews
Tweak func_str and outfile to deal with the limitations of only 128 chars available for filename + path in error messages
721
ERROR HY000: The file 'DRIZZLETEST_BAD_FILE' must be in the schema directory or be readable by all
1 by brian
clean slate
722
CREATE TABLE t1 (a varchar(10));
723
INSERT INTO t1 VALUES ('abc'), ('xyz');
724
SELECT a, CONCAT(a,' ',a) AS c FROM t1
725
HAVING LEFT(c,LENGTH(c)-INSTR(REVERSE(c)," ")) = a;
726
a	c
727
abc	abc abc
728
xyz	xyz xyz
729
SELECT a, CONCAT(a,' ',a) AS c FROM t1
730
HAVING LEFT(CONCAT(a,' ',a),
731
LENGTH(CONCAT(a,' ',a))-
732
INSTR(REVERSE(CONCAT(a,' ',a))," ")) = a;
733
a	c
734
abc	abc abc
735
xyz	xyz xyz
736
DROP TABLE t1;
737
CREATE TABLE t1 (s varchar(10));
738
INSERT INTO t1 VALUES ('yadda'), ('yaddy');
739
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab';
740
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
741
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
742
Warnings:
743
Note	1003	select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(`test`.`t1`.`s`) > 'ab')
744
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab';
745
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
746
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
747
Warnings:
748
Note	1003	select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both 'y' from `test`.`t1`.`s`) > 'ab')
749
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab';
750
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
751
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
752
Warnings:
753
Note	1003	select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(leading 'y' from `test`.`t1`.`s`) > 'ab')
754
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab';
755
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
756
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
757
Warnings:
758
Note	1003	select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(trailing 'y' from `test`.`t1`.`s`) > 'ab')
759
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';
760
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
761
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
762
Warnings:
763
Note	1003	select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both 'y' from `test`.`t1`.`s`) > 'ab')
764
DROP TABLE t1;
1063.9.3 by Brian Aker
Partial fix for tests for tmp
765
create TEMPORARY table t1 (a bigint not null)engine=myisam;
1 by brian
clean slate
766
insert into t1 set a = 1024*1024*1024*4;
767
drop table t1;
1063.9.3 by Brian Aker
Partial fix for tests for tmp
768
create TEMPORARY table t1 (a char(36) not null)engine=myisam;
1 by brian
clean slate
769
insert ignore into t1 set a = ' ';
770
insert ignore into t1 set a = ' ';
771
select * from t1 order by (oct(a));
772
a
512 by Brian Aker
Adding back more test cases.
773
 
774
 
1 by brian
clean slate
775
drop table t1;
776
End of 4.1 tests
777
create table t1 (d decimal default null);
778
insert into t1 values (null);
779
select format(d, 2) from t1;
780
format(d, 2)
781
NULL
782
drop table t1;
783
create table t1 (c varchar(40));
784
insert into t1 values ('y,abc'),('y,abc');
785
select c, substring_index(lcase(c), @q:=',', -1) as res from t1;
786
c	res
787
y,abc	abc
788
y,abc	abc
789
drop table t1;
790
select cast(rtrim('  20.06 ') as decimal(19,2));
791
cast(rtrim('  20.06 ') as decimal(19,2))
792
20.06
793
select cast(ltrim('  20.06 ') as decimal(19,2));
794
cast(ltrim('  20.06 ') as decimal(19,2))
795
20.06
796
select cast(rtrim(ltrim('  20.06 ')) as decimal(19,2));
797
cast(rtrim(ltrim('  20.06 ')) as decimal(19,2))
798
20.06
799
select conv("18383815659218730760",10,10) + 0;
800
conv("18383815659218730760",10,10) + 0
1108.5.2 by rm
fix test results so they expect valid precision, rather than more than can be relied upon
801
1.83838156592187e19
1 by brian
clean slate
802
select "18383815659218730760" + 0;
803
"18383815659218730760" + 0
1108.5.2 by rm
fix test results so they expect valid precision, rather than more than can be relied upon
804
1.83838156592187e19
1 by brian
clean slate
805
CREATE TABLE t1 (code varchar(10));
806
INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13');
807
SELECT ASCII(code), code FROM t1 WHERE code='A12';
808
ASCII(code)	code
809
97	a12
810
65	A12
811
SELECT ASCII(code), code FROM t1 WHERE code='A12' AND ASCII(code)=65;
812
ASCII(code)	code
813
65	A12
814
INSERT INTO t1 VALUES ('a12 '), ('A12  ');
815
SELECT LENGTH(code), code FROM t1 WHERE code='A12';
816
LENGTH(code)	code
817
3	a12
818
3	A12
819
4	a12 
820
5	A12  
821
SELECT LENGTH(code), code FROM t1 WHERE code='A12' AND LENGTH(code)=5;
822
LENGTH(code)	code
823
5	A12  
824
ALTER TABLE t1 ADD INDEX (code);
825
CREATE TABLE t2 (id varchar(10) PRIMARY KEY);
826
INSERT INTO t2 VALUES ('a11'), ('a12'), ('a13'), ('a14');
827
SELECT * FROM t1 INNER JOIN t2 ON t1.code=t2.id 
828
WHERE t2.id='a12' AND (LENGTH(code)=5 OR code < 'a00');
829
code	id
830
A12  	a12
831
EXPLAIN EXTENDED 
832
SELECT * FROM t1 INNER JOIN t2 ON code=id 
833
WHERE id='a12' AND (LENGTH(code)=5 OR code < 'a00');
834
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
512 by Brian Aker
Adding back more test cases.
835
1	SIMPLE	t2	const	PRIMARY	PRIMARY	42	const	1	100.00	Using index
1819.9.66 by Stewart Smith
EXPLAIN in test result changes due to modified InnoDB stats
836
1	SIMPLE	t1	ref	code	code	43	const	4	100.00	Using where; Using index
1 by brian
clean slate
837
Warnings:
1240.8.11 by Dennis Schoen
record more test changes
838
Note	1003	select `test`.`t1`.`code` AS `code`,'a12' AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = 'a12') and <cache>(('a12' = 'a12')) and ((length(`test`.`t1`.`code`) = 5) or <cache>(('a12' < 'a00'))))
1 by brian
clean slate
839
DROP TABLE t1,t2;
840
select benchmark(-1, 1);
841
benchmark(-1, 1)
842
NULL
843
Warnings:
844
Error	1411	Incorrect count value: '-1' for function benchmark
845
set @dec=5;
846
select format(pi(), (1+1));
847
format(pi(), (1+1))
848
3.14
512 by Brian Aker
Adding back more test cases.
849
select format(pi(), (select 3));
850
format(pi(), (select 3))
1 by brian
clean slate
851
3.142
852
select format(pi(), @dec);
853
format(pi(), @dec)
854
3.14159
855
set @bench_count=10;
856
select benchmark(10, pi());
857
benchmark(10, pi())
858
0
859
select benchmark(5+5, pi());
860
benchmark(5+5, pi())
861
0
512 by Brian Aker
Adding back more test cases.
862
select benchmark((select 10), pi());
863
benchmark((select 10), pi())
1 by brian
clean slate
864
0
865
select benchmark(@bench_count, pi());
866
benchmark(@bench_count, pi())
867
0
868
select locate('he','hello',-2);
869
locate('he','hello',-2)
870
0
871
select locate('lo','hello',-4294967295);
872
locate('lo','hello',-4294967295)
873
0
874
select locate('lo','hello',4294967295);
875
locate('lo','hello',4294967295)
876
0
877
select locate('lo','hello',-4294967296);
878
locate('lo','hello',-4294967296)
879
0
880
select locate('lo','hello',4294967296);
881
locate('lo','hello',4294967296)
882
0
883
select locate('lo','hello',-4294967297);
884
locate('lo','hello',-4294967297)
885
0
886
select locate('lo','hello',4294967297);
887
locate('lo','hello',4294967297)
888
0
889
select locate('lo','hello',-18446744073709551615);
890
locate('lo','hello',-18446744073709551615)
891
0
892
Warnings:
893
Error	1292	Truncated incorrect DECIMAL value: ''
894
select locate('lo','hello',18446744073709551615);
895
locate('lo','hello',18446744073709551615)
896
0
897
select locate('lo','hello',-18446744073709551616);
898
locate('lo','hello',-18446744073709551616)
899
0
900
Warnings:
901
Error	1292	Truncated incorrect DECIMAL value: ''
902
select locate('lo','hello',18446744073709551616);
903
locate('lo','hello',18446744073709551616)
904
0
905
Warnings:
906
Error	1292	Truncated incorrect DECIMAL value: ''
907
select locate('lo','hello',-18446744073709551617);
908
locate('lo','hello',-18446744073709551617)
909
0
910
Warnings:
911
Error	1292	Truncated incorrect DECIMAL value: ''
912
select locate('lo','hello',18446744073709551617);
913
locate('lo','hello',18446744073709551617)
914
0
915
Warnings:
916
Error	1292	Truncated incorrect DECIMAL value: ''
917
select left('hello', 10);
918
left('hello', 10)
919
hello
920
select left('hello', 0);
921
left('hello', 0)
922
923
select left('hello', -1);
924
left('hello', -1)
925
926
select left('hello', -4294967295);
927
left('hello', -4294967295)
928
929
select left('hello', 4294967295);
930
left('hello', 4294967295)
931
hello
932
select left('hello', -4294967296);
933
left('hello', -4294967296)
934
935
select left('hello', 4294967296);
936
left('hello', 4294967296)
937
hello
938
select left('hello', -4294967297);
939
left('hello', -4294967297)
940
941
select left('hello', 4294967297);
942
left('hello', 4294967297)
943
hello
944
select left('hello', -18446744073709551615);
945
left('hello', -18446744073709551615)
946
947
Warnings:
948
Error	1292	Truncated incorrect DECIMAL value: ''
949
Error	1292	Truncated incorrect DECIMAL value: ''
950
select left('hello', 18446744073709551615);
951
left('hello', 18446744073709551615)
952
hello
953
select left('hello', -18446744073709551616);
954
left('hello', -18446744073709551616)
955
956
Warnings:
957
Error	1292	Truncated incorrect DECIMAL value: ''
958
Error	1292	Truncated incorrect DECIMAL value: ''
959
select left('hello', 18446744073709551616);
960
left('hello', 18446744073709551616)
961
hello
962
Warnings:
963
Error	1292	Truncated incorrect DECIMAL value: ''
964
Error	1292	Truncated incorrect DECIMAL value: ''
965
select left('hello', -18446744073709551617);
966
left('hello', -18446744073709551617)
967
968
Warnings:
969
Error	1292	Truncated incorrect DECIMAL value: ''
970
Error	1292	Truncated incorrect DECIMAL value: ''
971
select left('hello', 18446744073709551617);
972
left('hello', 18446744073709551617)
973
hello
974
Warnings:
975
Error	1292	Truncated incorrect DECIMAL value: ''
976
Error	1292	Truncated incorrect DECIMAL value: ''
977
select right('hello', 10);
978
right('hello', 10)
979
hello
980
select right('hello', 0);
981
right('hello', 0)
982
983
select right('hello', -1);
984
right('hello', -1)
985
986
select right('hello', -4294967295);
987
right('hello', -4294967295)
988
989
select right('hello', 4294967295);
990
right('hello', 4294967295)
991
hello
992
select right('hello', -4294967296);
993
right('hello', -4294967296)
994
995
select right('hello', 4294967296);
996
right('hello', 4294967296)
997
hello
998
select right('hello', -4294967297);
999
right('hello', -4294967297)
1000
1001
select right('hello', 4294967297);
1002
right('hello', 4294967297)
1003
hello
1004
select right('hello', -18446744073709551615);
1005
right('hello', -18446744073709551615)
1006
1007
Warnings:
1008
Error	1292	Truncated incorrect DECIMAL value: ''
1009
Error	1292	Truncated incorrect DECIMAL value: ''
1010
select right('hello', 18446744073709551615);
1011
right('hello', 18446744073709551615)
1012
hello
1013
select right('hello', -18446744073709551616);
1014
right('hello', -18446744073709551616)
1015
1016
Warnings:
1017
Error	1292	Truncated incorrect DECIMAL value: ''
1018
Error	1292	Truncated incorrect DECIMAL value: ''
1019
select right('hello', 18446744073709551616);
1020
right('hello', 18446744073709551616)
1021
hello
1022
Warnings:
1023
Error	1292	Truncated incorrect DECIMAL value: ''
1024
Error	1292	Truncated incorrect DECIMAL value: ''
1025
select right('hello', -18446744073709551617);
1026
right('hello', -18446744073709551617)
1027
1028
Warnings:
1029
Error	1292	Truncated incorrect DECIMAL value: ''
1030
Error	1292	Truncated incorrect DECIMAL value: ''
1031
select right('hello', 18446744073709551617);
1032
right('hello', 18446744073709551617)
1033
hello
1034
Warnings:
1035
Error	1292	Truncated incorrect DECIMAL value: ''
1036
Error	1292	Truncated incorrect DECIMAL value: ''
1037
select substring('hello', 2, -1);
1038
substring('hello', 2, -1)
1039
1040
select substring('hello', -1, 1);
1041
substring('hello', -1, 1)
1042
o
1043
select substring('hello', -2, 1);
1044
substring('hello', -2, 1)
1045
l
1046
select substring('hello', -4294967295, 1);
1047
substring('hello', -4294967295, 1)
1048
1049
select substring('hello', 4294967295, 1);
1050
substring('hello', 4294967295, 1)
1051
1052
select substring('hello', -4294967296, 1);
1053
substring('hello', -4294967296, 1)
1054
1055
select substring('hello', 4294967296, 1);
1056
substring('hello', 4294967296, 1)
1057
1058
select substring('hello', -4294967297, 1);
1059
substring('hello', -4294967297, 1)
1060
1061
select substring('hello', 4294967297, 1);
1062
substring('hello', 4294967297, 1)
1063
1064
select substring('hello', -18446744073709551615, 1);
1065
substring('hello', -18446744073709551615, 1)
1066
1067
Warnings:
1068
Error	1292	Truncated incorrect DECIMAL value: ''
1069
Error	1292	Truncated incorrect DECIMAL value: ''
1070
select substring('hello', 18446744073709551615, 1);
1071
substring('hello', 18446744073709551615, 1)
1072
1073
select substring('hello', -18446744073709551616, 1);
1074
substring('hello', -18446744073709551616, 1)
1075
1076
Warnings:
1077
Error	1292	Truncated incorrect DECIMAL value: ''
1078
Error	1292	Truncated incorrect DECIMAL value: ''
1079
select substring('hello', 18446744073709551616, 1);
1080
substring('hello', 18446744073709551616, 1)
1081
1082
Warnings:
1083
Error	1292	Truncated incorrect DECIMAL value: ''
1084
Error	1292	Truncated incorrect DECIMAL value: ''
1085
select substring('hello', -18446744073709551617, 1);
1086
substring('hello', -18446744073709551617, 1)
1087
1088
Warnings:
1089
Error	1292	Truncated incorrect DECIMAL value: ''
1090
Error	1292	Truncated incorrect DECIMAL value: ''
1091
select substring('hello', 18446744073709551617, 1);
1092
substring('hello', 18446744073709551617, 1)
1093
1094
Warnings:
1095
Error	1292	Truncated incorrect DECIMAL value: ''
1096
Error	1292	Truncated incorrect DECIMAL value: ''
1097
select substring('hello', 1, -1);
1098
substring('hello', 1, -1)
1099
1100
select substring('hello', 1, -4294967295);
1101
substring('hello', 1, -4294967295)
1102
1103
select substring('hello', 1, 4294967295);
1104
substring('hello', 1, 4294967295)
1105
hello
1106
select substring('hello', 1, -4294967296);
1107
substring('hello', 1, -4294967296)
1108
1109
select substring('hello', 1, 4294967296);
1110
substring('hello', 1, 4294967296)
1111
hello
1112
select substring('hello', 1, -4294967297);
1113
substring('hello', 1, -4294967297)
1114
1115
select substring('hello', 1, 4294967297);
1116
substring('hello', 1, 4294967297)
1117
hello
1118
select substring('hello', 1, -18446744073709551615);
1119
substring('hello', 1, -18446744073709551615)
1120
1121
Warnings:
1122
Error	1292	Truncated incorrect DECIMAL value: ''
1123
Error	1292	Truncated incorrect DECIMAL value: ''
1124
select substring('hello', 1, 18446744073709551615);
1125
substring('hello', 1, 18446744073709551615)
1126
hello
1127
select substring('hello', 1, -18446744073709551616);
1128
substring('hello', 1, -18446744073709551616)
1129
1130
Warnings:
1131
Error	1292	Truncated incorrect DECIMAL value: ''
1132
Error	1292	Truncated incorrect DECIMAL value: ''
1133
select substring('hello', 1, 18446744073709551616);
1134
substring('hello', 1, 18446744073709551616)
1135
hello
1136
Warnings:
1137
Error	1292	Truncated incorrect DECIMAL value: ''
1138
Error	1292	Truncated incorrect DECIMAL value: ''
1139
select substring('hello', 1, -18446744073709551617);
1140
substring('hello', 1, -18446744073709551617)
1141
1142
Warnings:
1143
Error	1292	Truncated incorrect DECIMAL value: ''
1144
Error	1292	Truncated incorrect DECIMAL value: ''
1145
select substring('hello', 1, 18446744073709551617);
1146
substring('hello', 1, 18446744073709551617)
1147
hello
1148
Warnings:
1149
Error	1292	Truncated incorrect DECIMAL value: ''
1150
Error	1292	Truncated incorrect DECIMAL value: ''
1151
select substring('hello', -1, -1);
1152
substring('hello', -1, -1)
1153
1154
select substring('hello', -4294967295, -4294967295);
1155
substring('hello', -4294967295, -4294967295)
1156
1157
select substring('hello', 4294967295, 4294967295);
1158
substring('hello', 4294967295, 4294967295)
1159
1160
select substring('hello', -4294967296, -4294967296);
1161
substring('hello', -4294967296, -4294967296)
1162
1163
select substring('hello', 4294967296, 4294967296);
1164
substring('hello', 4294967296, 4294967296)
1165
1166
select substring('hello', -4294967297, -4294967297);
1167
substring('hello', -4294967297, -4294967297)
1168
1169
select substring('hello', 4294967297, 4294967297);
1170
substring('hello', 4294967297, 4294967297)
1171
1172
select substring('hello', -18446744073709551615, -18446744073709551615);
1173
substring('hello', -18446744073709551615, -18446744073709551615)
1174
1175
Warnings:
1176
Error	1292	Truncated incorrect DECIMAL value: ''
1177
Error	1292	Truncated incorrect DECIMAL value: ''
1178
Error	1292	Truncated incorrect DECIMAL value: ''
1179
Error	1292	Truncated incorrect DECIMAL value: ''
1180
select substring('hello', 18446744073709551615, 18446744073709551615);
1181
substring('hello', 18446744073709551615, 18446744073709551615)
1182
1183
select substring('hello', -18446744073709551616, -18446744073709551616);
1184
substring('hello', -18446744073709551616, -18446744073709551616)
1185
1186
Warnings:
1187
Error	1292	Truncated incorrect DECIMAL value: ''
1188
Error	1292	Truncated incorrect DECIMAL value: ''
1189
Error	1292	Truncated incorrect DECIMAL value: ''
1190
Error	1292	Truncated incorrect DECIMAL value: ''
1191
select substring('hello', 18446744073709551616, 18446744073709551616);
1192
substring('hello', 18446744073709551616, 18446744073709551616)
1193
1194
Warnings:
1195
Error	1292	Truncated incorrect DECIMAL value: ''
1196
Error	1292	Truncated incorrect DECIMAL value: ''
1197
Error	1292	Truncated incorrect DECIMAL value: ''
1198
Error	1292	Truncated incorrect DECIMAL value: ''
1199
select substring('hello', -18446744073709551617, -18446744073709551617);
1200
substring('hello', -18446744073709551617, -18446744073709551617)
1201
1202
Warnings:
1203
Error	1292	Truncated incorrect DECIMAL value: ''
1204
Error	1292	Truncated incorrect DECIMAL value: ''
1205
Error	1292	Truncated incorrect DECIMAL value: ''
1206
Error	1292	Truncated incorrect DECIMAL value: ''
1207
select substring('hello', 18446744073709551617, 18446744073709551617);
1208
substring('hello', 18446744073709551617, 18446744073709551617)
1209
1210
Warnings:
1211
Error	1292	Truncated incorrect DECIMAL value: ''
1212
Error	1292	Truncated incorrect DECIMAL value: ''
1213
Error	1292	Truncated incorrect DECIMAL value: ''
1214
Error	1292	Truncated incorrect DECIMAL value: ''
1215
select insert('hello', -1, 1, 'hi');
1216
insert('hello', -1, 1, 'hi')
1217
hello
1218
select insert('hello', -4294967295, 1, 'hi');
1219
insert('hello', -4294967295, 1, 'hi')
1220
hello
1221
select insert('hello', 4294967295, 1, 'hi');
1222
insert('hello', 4294967295, 1, 'hi')
1223
hello
1224
select insert('hello', -4294967296, 1, 'hi');
1225
insert('hello', -4294967296, 1, 'hi')
1226
hello
1227
select insert('hello', 4294967296, 1, 'hi');
1228
insert('hello', 4294967296, 1, 'hi')
1229
hello
1230
select insert('hello', -4294967297, 1, 'hi');
1231
insert('hello', -4294967297, 1, 'hi')
1232
hello
1233
select insert('hello', 4294967297, 1, 'hi');
1234
insert('hello', 4294967297, 1, 'hi')
1235
hello
1236
select insert('hello', -18446744073709551615, 1, 'hi');
1237
insert('hello', -18446744073709551615, 1, 'hi')
1238
hello
1239
Warnings:
1240
Error	1292	Truncated incorrect DECIMAL value: ''
1241
select insert('hello', 18446744073709551615, 1, 'hi');
1242
insert('hello', 18446744073709551615, 1, 'hi')
1243
hello
1244
select insert('hello', -18446744073709551616, 1, 'hi');
1245
insert('hello', -18446744073709551616, 1, 'hi')
1246
hello
1247
Warnings:
1248
Error	1292	Truncated incorrect DECIMAL value: ''
1249
select insert('hello', 18446744073709551616, 1, 'hi');
1250
insert('hello', 18446744073709551616, 1, 'hi')
1251
hello
1252
Warnings:
1253
Error	1292	Truncated incorrect DECIMAL value: ''
1254
select insert('hello', -18446744073709551617, 1, 'hi');
1255
insert('hello', -18446744073709551617, 1, 'hi')
1256
hello
1257
Warnings:
1258
Error	1292	Truncated incorrect DECIMAL value: ''
1259
select insert('hello', 18446744073709551617, 1, 'hi');
1260
insert('hello', 18446744073709551617, 1, 'hi')
1261
hello
1262
Warnings:
1263
Error	1292	Truncated incorrect DECIMAL value: ''
1264
select insert('hello', 1, -1, 'hi');
1265
insert('hello', 1, -1, 'hi')
1266
hi
1267
select insert('hello', 1, -4294967295, 'hi');
1268
insert('hello', 1, -4294967295, 'hi')
1269
hi
1270
select insert('hello', 1, 4294967295, 'hi');
1271
insert('hello', 1, 4294967295, 'hi')
1272
hi
1273
select insert('hello', 1, -4294967296, 'hi');
1274
insert('hello', 1, -4294967296, 'hi')
1275
hi
1276
select insert('hello', 1, 4294967296, 'hi');
1277
insert('hello', 1, 4294967296, 'hi')
1278
hi
1279
select insert('hello', 1, -4294967297, 'hi');
1280
insert('hello', 1, -4294967297, 'hi')
1281
hi
1282
select insert('hello', 1, 4294967297, 'hi');
1283
insert('hello', 1, 4294967297, 'hi')
1284
hi
1285
select insert('hello', 1, -18446744073709551615, 'hi');
1286
insert('hello', 1, -18446744073709551615, 'hi')
1287
hi
1288
Warnings:
1289
Error	1292	Truncated incorrect DECIMAL value: ''
1290
select insert('hello', 1, 18446744073709551615, 'hi');
1291
insert('hello', 1, 18446744073709551615, 'hi')
1292
hi
1293
select insert('hello', 1, -18446744073709551616, 'hi');
1294
insert('hello', 1, -18446744073709551616, 'hi')
1295
hi
1296
Warnings:
1297
Error	1292	Truncated incorrect DECIMAL value: ''
1298
select insert('hello', 1, 18446744073709551616, 'hi');
1299
insert('hello', 1, 18446744073709551616, 'hi')
1300
hi
1301
Warnings:
1302
Error	1292	Truncated incorrect DECIMAL value: ''
1303
select insert('hello', 1, -18446744073709551617, 'hi');
1304
insert('hello', 1, -18446744073709551617, 'hi')
1305
hi
1306
Warnings:
1307
Error	1292	Truncated incorrect DECIMAL value: ''
1308
select insert('hello', 1, 18446744073709551617, 'hi');
1309
insert('hello', 1, 18446744073709551617, 'hi')
1310
hi
1311
Warnings:
1312
Error	1292	Truncated incorrect DECIMAL value: ''
1313
select insert('hello', -1, -1, 'hi');
1314
insert('hello', -1, -1, 'hi')
1315
hello
1316
select insert('hello', -4294967295, -4294967295, 'hi');
1317
insert('hello', -4294967295, -4294967295, 'hi')
1318
hello
1319
select insert('hello', 4294967295, 4294967295, 'hi');
1320
insert('hello', 4294967295, 4294967295, 'hi')
1321
hello
1322
select insert('hello', -4294967296, -4294967296, 'hi');
1323
insert('hello', -4294967296, -4294967296, 'hi')
1324
hello
1325
select insert('hello', 4294967296, 4294967296, 'hi');
1326
insert('hello', 4294967296, 4294967296, 'hi')
1327
hello
1328
select insert('hello', -4294967297, -4294967297, 'hi');
1329
insert('hello', -4294967297, -4294967297, 'hi')
1330
hello
1331
select insert('hello', 4294967297, 4294967297, 'hi');
1332
insert('hello', 4294967297, 4294967297, 'hi')
1333
hello
1334
select insert('hello', -18446744073709551615, -18446744073709551615, 'hi');
1335
insert('hello', -18446744073709551615, -18446744073709551615, 'hi')
1336
hello
1337
Warnings:
1338
Error	1292	Truncated incorrect DECIMAL value: ''
1339
Error	1292	Truncated incorrect DECIMAL value: ''
1340
select insert('hello', 18446744073709551615, 18446744073709551615, 'hi');
1341
insert('hello', 18446744073709551615, 18446744073709551615, 'hi')
1342
hello
1343
select insert('hello', -18446744073709551616, -18446744073709551616, 'hi');
1344
insert('hello', -18446744073709551616, -18446744073709551616, 'hi')
1345
hello
1346
Warnings:
1347
Error	1292	Truncated incorrect DECIMAL value: ''
1348
Error	1292	Truncated incorrect DECIMAL value: ''
1349
select insert('hello', 18446744073709551616, 18446744073709551616, 'hi');
1350
insert('hello', 18446744073709551616, 18446744073709551616, 'hi')
1351
hello
1352
Warnings:
1353
Error	1292	Truncated incorrect DECIMAL value: ''
1354
Error	1292	Truncated incorrect DECIMAL value: ''
1355
select insert('hello', -18446744073709551617, -18446744073709551617, 'hi');
1356
insert('hello', -18446744073709551617, -18446744073709551617, 'hi')
1357
hello
1358
Warnings:
1359
Error	1292	Truncated incorrect DECIMAL value: ''
1360
Error	1292	Truncated incorrect DECIMAL value: ''
1361
select insert('hello', 18446744073709551617, 18446744073709551617, 'hi');
1362
insert('hello', 18446744073709551617, 18446744073709551617, 'hi')
1363
hello
1364
Warnings:
1365
Error	1292	Truncated incorrect DECIMAL value: ''
1366
Error	1292	Truncated incorrect DECIMAL value: ''
1367
select repeat('hello', -1);
1368
repeat('hello', -1)
1369
1370
select repeat('hello', -4294967295);
1371
repeat('hello', -4294967295)
1372
1373
select repeat('hello', 4294967295);
1374
repeat('hello', 4294967295)
1375
NULL
1376
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1377
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1378
select repeat('hello', -4294967296);
1379
repeat('hello', -4294967296)
1380
1381
select repeat('hello', 4294967296);
1382
repeat('hello', 4294967296)
1383
NULL
1384
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1385
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1386
select repeat('hello', -4294967297);
1387
repeat('hello', -4294967297)
1388
1389
select repeat('hello', 4294967297);
1390
repeat('hello', 4294967297)
1391
NULL
1392
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1393
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1394
select repeat('hello', -18446744073709551615);
1395
repeat('hello', -18446744073709551615)
1396
1397
Warnings:
1398
Error	1292	Truncated incorrect DECIMAL value: ''
1399
Error	1292	Truncated incorrect DECIMAL value: ''
1400
select repeat('hello', 18446744073709551615);
1401
repeat('hello', 18446744073709551615)
1402
NULL
1403
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1404
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1405
select repeat('hello', -18446744073709551616);
1406
repeat('hello', -18446744073709551616)
1407
1408
Warnings:
1409
Error	1292	Truncated incorrect DECIMAL value: ''
1410
Error	1292	Truncated incorrect DECIMAL value: ''
1411
select repeat('hello', 18446744073709551616);
1412
repeat('hello', 18446744073709551616)
1413
NULL
1414
Warnings:
1415
Error	1292	Truncated incorrect DECIMAL value: ''
1416
Error	1292	Truncated incorrect DECIMAL value: ''
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1417
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1418
select repeat('hello', -18446744073709551617);
1419
repeat('hello', -18446744073709551617)
1420
1421
Warnings:
1422
Error	1292	Truncated incorrect DECIMAL value: ''
1423
Error	1292	Truncated incorrect DECIMAL value: ''
1424
select repeat('hello', 18446744073709551617);
1425
repeat('hello', 18446744073709551617)
1426
NULL
1427
Warnings:
1428
Error	1292	Truncated incorrect DECIMAL value: ''
1429
Error	1292	Truncated incorrect DECIMAL value: ''
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1430
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1431
select space(-1);
1432
space(-1)
1433
1434
select space(-4294967295);
1435
space(-4294967295)
1436
1437
select space(4294967295);
1438
space(4294967295)
1439
NULL
1440
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1441
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1442
select space(-4294967296);
1443
space(-4294967296)
1444
1445
select space(4294967296);
1446
space(4294967296)
1447
NULL
1448
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1449
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1450
select space(-4294967297);
1451
space(-4294967297)
1452
1453
select space(4294967297);
1454
space(4294967297)
1455
NULL
1456
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1457
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1458
select space(-18446744073709551615);
1459
space(-18446744073709551615)
1460
1461
Warnings:
1462
Error	1292	Truncated incorrect DECIMAL value: ''
1463
Error	1292	Truncated incorrect DECIMAL value: ''
1464
select space(18446744073709551615);
1465
space(18446744073709551615)
1466
NULL
1467
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1468
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1469
select space(-18446744073709551616);
1470
space(-18446744073709551616)
1471
1472
Warnings:
1473
Error	1292	Truncated incorrect DECIMAL value: ''
1474
Error	1292	Truncated incorrect DECIMAL value: ''
1475
select space(18446744073709551616);
1476
space(18446744073709551616)
1477
NULL
1478
Warnings:
1479
Error	1292	Truncated incorrect DECIMAL value: ''
1480
Error	1292	Truncated incorrect DECIMAL value: ''
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1481
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1482
select space(-18446744073709551617);
1483
space(-18446744073709551617)
1484
1485
Warnings:
1486
Error	1292	Truncated incorrect DECIMAL value: ''
1487
Error	1292	Truncated incorrect DECIMAL value: ''
1488
select space(18446744073709551617);
1489
space(18446744073709551617)
1490
NULL
1491
Warnings:
1492
Error	1292	Truncated incorrect DECIMAL value: ''
1493
Error	1292	Truncated incorrect DECIMAL value: ''
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1494
Warning	1301	Result of repeat() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1495
select rpad('hello', -1, '1');
1496
rpad('hello', -1, '1')
1497
NULL
1498
select rpad('hello', -4294967295, '1');
1499
rpad('hello', -4294967295, '1')
1500
NULL
1501
select rpad('hello', 4294967295, '1');
1502
rpad('hello', 4294967295, '1')
1503
NULL
1504
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1505
Warning	1301	Result of rpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1506
select rpad('hello', -4294967296, '1');
1507
rpad('hello', -4294967296, '1')
1508
NULL
1509
select rpad('hello', 4294967296, '1');
1510
rpad('hello', 4294967296, '1')
1511
NULL
1512
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1513
Warning	1301	Result of rpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1514
select rpad('hello', -4294967297, '1');
1515
rpad('hello', -4294967297, '1')
1516
NULL
1517
select rpad('hello', 4294967297, '1');
1518
rpad('hello', 4294967297, '1')
1519
NULL
1520
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1521
Warning	1301	Result of rpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1522
select rpad('hello', -18446744073709551615, '1');
1523
rpad('hello', -18446744073709551615, '1')
1524
NULL
1525
Warnings:
1526
Error	1292	Truncated incorrect DECIMAL value: ''
1527
Error	1292	Truncated incorrect DECIMAL value: ''
1528
select rpad('hello', 18446744073709551615, '1');
1529
rpad('hello', 18446744073709551615, '1')
1530
NULL
1531
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1532
Warning	1301	Result of rpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1533
select rpad('hello', -18446744073709551616, '1');
1534
rpad('hello', -18446744073709551616, '1')
1535
NULL
1536
Warnings:
1537
Error	1292	Truncated incorrect DECIMAL value: ''
1538
Error	1292	Truncated incorrect DECIMAL value: ''
1539
select rpad('hello', 18446744073709551616, '1');
1540
rpad('hello', 18446744073709551616, '1')
1541
NULL
1542
Warnings:
1543
Error	1292	Truncated incorrect DECIMAL value: ''
1544
Error	1292	Truncated incorrect DECIMAL value: ''
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1545
Warning	1301	Result of rpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1546
select rpad('hello', -18446744073709551617, '1');
1547
rpad('hello', -18446744073709551617, '1')
1548
NULL
1549
Warnings:
1550
Error	1292	Truncated incorrect DECIMAL value: ''
1551
Error	1292	Truncated incorrect DECIMAL value: ''
1552
select rpad('hello', 18446744073709551617, '1');
1553
rpad('hello', 18446744073709551617, '1')
1554
NULL
1555
Warnings:
1556
Error	1292	Truncated incorrect DECIMAL value: ''
1557
Error	1292	Truncated incorrect DECIMAL value: ''
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1558
Warning	1301	Result of rpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1559
select lpad('hello', -1, '1');
1560
lpad('hello', -1, '1')
1561
NULL
1562
select lpad('hello', -4294967295, '1');
1563
lpad('hello', -4294967295, '1')
1564
NULL
1565
select lpad('hello', 4294967295, '1');
1566
lpad('hello', 4294967295, '1')
1567
NULL
1568
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1569
Warning	1301	Result of lpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1570
select lpad('hello', -4294967296, '1');
1571
lpad('hello', -4294967296, '1')
1572
NULL
1573
select lpad('hello', 4294967296, '1');
1574
lpad('hello', 4294967296, '1')
1575
NULL
1576
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1577
Warning	1301	Result of lpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1578
select lpad('hello', -4294967297, '1');
1579
lpad('hello', -4294967297, '1')
1580
NULL
1581
select lpad('hello', 4294967297, '1');
1582
lpad('hello', 4294967297, '1')
1583
NULL
1584
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1585
Warning	1301	Result of lpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1586
select lpad('hello', -18446744073709551615, '1');
1587
lpad('hello', -18446744073709551615, '1')
1588
NULL
1589
Warnings:
1590
Error	1292	Truncated incorrect DECIMAL value: ''
1591
Error	1292	Truncated incorrect DECIMAL value: ''
1592
select lpad('hello', 18446744073709551615, '1');
1593
lpad('hello', 18446744073709551615, '1')
1594
NULL
1595
Warnings:
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1596
Warning	1301	Result of lpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1597
select lpad('hello', -18446744073709551616, '1');
1598
lpad('hello', -18446744073709551616, '1')
1599
NULL
1600
Warnings:
1601
Error	1292	Truncated incorrect DECIMAL value: ''
1602
Error	1292	Truncated incorrect DECIMAL value: ''
1603
select lpad('hello', 18446744073709551616, '1');
1604
lpad('hello', 18446744073709551616, '1')
1605
NULL
1606
Warnings:
1607
Error	1292	Truncated incorrect DECIMAL value: ''
1608
Error	1292	Truncated incorrect DECIMAL value: ''
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1609
Warning	1301	Result of lpad() was larger than max_allowed_packet (67108864) - truncated
1 by brian
clean slate
1610
select lpad('hello', -18446744073709551617, '1');
1611
lpad('hello', -18446744073709551617, '1')
1612
NULL
1613
Warnings:
1614
Error	1292	Truncated incorrect DECIMAL value: ''
1615
Error	1292	Truncated incorrect DECIMAL value: ''
1616
select lpad('hello', 18446744073709551617, '1');
1617
lpad('hello', 18446744073709551617, '1')
1618
NULL
1619
Warnings:
1620
Error	1292	Truncated incorrect DECIMAL value: ''
1621
Error	1292	Truncated incorrect DECIMAL value: ''
1877.1.4 by Andrew Hutchings
Fix test cases for the new default max_packet_size
1622
Warning	1301	Result of lpad() was larger than max_allowed_packet (67108864) - truncated
512 by Brian Aker
Adding back more test cases.
1623
SELECT CHAR(0xff,0x8f);
1624
CHAR(0xff,0x8f)
1625
ÿ
1626
SELECT CHAR(0xff,0x8f) IS NULL;
1627
CHAR(0xff,0x8f) IS NULL
1628
0
1 by brian
clean slate
1629
create table t1(f1 longtext);
1630
insert into t1 values ("123"),("456");
1631
select substring(f1,1,1) from t1 group by 1;
1632
substring(f1,1,1)
1633
1
1634
4
1635
create table t2(f1 varchar(3));
1636
insert into t1 values ("123"),("456");
1637
select substring(f1,4,1), substring(f1,-4,1) from t2;
1638
substring(f1,4,1)	substring(f1,-4,1)
1639
drop table t1,t2;
1640
DROP TABLE IF EXISTS t1;
1641
CREATE TABLE `t1` (
1642
`id` varchar(20) NOT NULL,
512 by Brian Aker
Adding back more test cases.
1643
`tire` int NOT NULL,
1 by brian
clean slate
1644
PRIMARY KEY (`id`)
1645
);
1646
INSERT INTO `t1` (`id`, `tire`) VALUES ('A', 0), ('B', 1),('C', 2);
1647
SELECT REPEAT( '#', tire ) AS A,
1648
REPEAT( '#', tire % 999 ) AS B, tire FROM `t1`;
1649
A	B	tire
1650
		0
1651
#	#	1
1652
##	##	2
512 by Brian Aker
Adding back more test cases.
1653
SELECT REPEAT('0', 0);
1654
REPEAT('0', 0)
1 by brian
clean slate
1655
1656
SELECT REPEAT('0', -2);
1657
REPEAT('0', -2)
1658
1659
SELECT REPEAT('0', 2);
1660
REPEAT('0', 2)
1661
00
1662
DROP TABLE t1;
1663
SELECT UNHEX('G');
1664
UNHEX('G')
1665
NULL
1666
SELECT UNHEX('G') IS NULL;
1667
UNHEX('G') IS NULL
1668
1
1669
SELECT INSERT('abc', 3, 3, '1234');
1670
INSERT('abc', 3, 3, '1234')
1671
ab1234
1672
SELECT INSERT('abc', 4, 3, '1234');
1673
INSERT('abc', 4, 3, '1234')
1674
abc1234
1675
SELECT INSERT('abc', 5, 3, '1234');
1676
INSERT('abc', 5, 3, '1234')
1677
abc
1678
SELECT INSERT('abc', 6, 3, '1234');
1679
INSERT('abc', 6, 3, '1234')
1680
abc
512 by Brian Aker
Adding back more test cases.
1681
SELECT LOCATE('foo', NULL);
1 by brian
clean slate
1682
LOCATE('foo', NULL)
1683
NULL
512 by Brian Aker
Adding back more test cases.
1684
SELECT LOCATE(NULL, 'o');
1 by brian
clean slate
1685
LOCATE(NULL, 'o')
1686
NULL
512 by Brian Aker
Adding back more test cases.
1687
SELECT LOCATE(NULL, NULL);
1 by brian
clean slate
1688
LOCATE(NULL, NULL)
1689
NULL
512 by Brian Aker
Adding back more test cases.
1690
SELECT LOCATE('foo', NULL) IS NULL;
1 by brian
clean slate
1691
LOCATE('foo', NULL) IS NULL
1692
1
512 by Brian Aker
Adding back more test cases.
1693
SELECT LOCATE(NULL, 'o') IS NULL;
1 by brian
clean slate
1694
LOCATE(NULL, 'o') IS NULL
1695
1
512 by Brian Aker
Adding back more test cases.
1696
SELECT LOCATE(NULL, NULL) IS NULL;
1 by brian
clean slate
1697
LOCATE(NULL, NULL) IS NULL
1698
1
512 by Brian Aker
Adding back more test cases.
1699
SELECT ISNULL(LOCATE('foo', NULL));
1 by brian
clean slate
1700
ISNULL(LOCATE('foo', NULL))
1701
1
512 by Brian Aker
Adding back more test cases.
1702
SELECT ISNULL(LOCATE(NULL, 'o'));
1 by brian
clean slate
1703
ISNULL(LOCATE(NULL, 'o'))
1704
1
512 by Brian Aker
Adding back more test cases.
1705
SELECT ISNULL(LOCATE(NULL, NULL));
1 by brian
clean slate
1706
ISNULL(LOCATE(NULL, NULL))
1707
1
512 by Brian Aker
Adding back more test cases.
1708
SELECT LOCATE('foo', NULL) <=> NULL;
1 by brian
clean slate
1709
LOCATE('foo', NULL) <=> NULL
1710
1
512 by Brian Aker
Adding back more test cases.
1711
SELECT LOCATE(NULL, 'o') <=> NULL;
1 by brian
clean slate
1712
LOCATE(NULL, 'o') <=> NULL
1713
1
512 by Brian Aker
Adding back more test cases.
1714
SELECT LOCATE(NULL, NULL) <=> NULL;
1 by brian
clean slate
1715
LOCATE(NULL, NULL) <=> NULL
1716
1
1717
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a varchar(10), p varchar(10));
1718
INSERT INTO t1 VALUES (1, 'foo', 'o');
1719
INSERT INTO t1 VALUES (2, 'foo', NULL);
1720
INSERT INTO t1 VALUES (3, NULL, 'o');
1721
INSERT INTO t1 VALUES (4, NULL, NULL);
1722
SELECT id, LOCATE(a,p) FROM t1;
1723
id	LOCATE(a,p)
1724
1	0
1725
2	NULL
1726
3	NULL
1727
4	NULL
1728
SELECT id, LOCATE(a,p) IS NULL FROM t1;
512 by Brian Aker
Adding back more test cases.
1729
id	LOCATE(a,p) IS NULL 
1 by brian
clean slate
1730
1	0
1731
2	1
1732
3	1
1733
4	1
1734
SELECT id, ISNULL(LOCATE(a,p)) FROM t1;
1735
id	ISNULL(LOCATE(a,p))
1736
1	0
1737
2	1
1738
3	1
1739
4	1
1740
SELECT id, LOCATE(a,p) <=> NULL FROM t1;
512 by Brian Aker
Adding back more test cases.
1741
id	LOCATE(a,p) <=> NULL 
1 by brian
clean slate
1742
1	0
1743
2	1
1744
3	1
1745
4	1
1746
SELECT id FROM t1 WHERE LOCATE(a,p) IS NULL;
1747
id
1748
2
1749
3
1750
4
1751
SELECT id FROM t1 WHERE LOCATE(a,p) <=> NULL;
1752
id
1753
2
1754
3
1755
4
1756
DROP TABLE t1;
512 by Brian Aker
Adding back more test cases.
1757
SELECT SUBSTR('foo',1,0);
1758
SUBSTR('foo',1,0)
1759
1760
SELECT SUBSTR('foo',1,0);
1761
SUBSTR('foo',1,0)
1762
1763
SELECT SUBSTR('foo',1,0);
1764
SUBSTR('foo',1,0)
1765
1766
CREATE TABLE t1 (a varchar(10), len int);
1 by brian
clean slate
1767
INSERT INTO t1 VALUES ('bar', 2), ('foo', 0);
1768
SELECT SUBSTR(a,1,len) FROM t1;
1769
SUBSTR(a,1,len)
1770
ba
1771
1772
DROP TABLE t1;
1773
CREATE TABLE t1 AS SELECT CHAR(0x414243) as c1;
1774
SELECT HEX(c1) from t1;
1775
HEX(c1)
1776
414243
1777
DROP TABLE t1;
1778
End of 5.0 tests