2 --echo # Start of WL#2649
Number-
to-
string conversions
8 create
table t1 as select concat(1) as c1;
10 select hex(c1) from t1;
13 select hex(concat(18446744073709551615));
14 create
table t1 as select concat(18446744073709551615) as c1;
16 select hex(c1) from t1;
19 select hex(concat(1.1));
20 create
table t1 as select concat(1.1) as c1;
22 select hex(c1) from t1;
27 # Arithmetic operators
30 select hex(concat(
'a', 1+2)), charset(concat(1+2));
31 create
table t1 as select concat(1+2) as c1;
35 select hex(concat(1-2));
36 create
table t1 as select concat(1-2) as c1;
40 select hex(concat(1*2));
41 create
table t1 as select concat(1*2) as c1;
45 select hex(concat(1/2));
46 create
table t1 as select concat(1/2) as c1;
50 select hex(concat(1 div 2));
51 create
table t1 as select concat(1 div 2) as c1;
55 select hex(concat(1 % 2));
56 create
table t1 as select concat(1 % 2) as c1;
60 select hex(concat(-1));
61 create
table t1 as select concat(-1) as c1;
65 select hex(concat(-(1+2)));
66 create
table t1 as select concat(-(1+2)) as c1;
75 select hex(concat(1|2));
76 create
table t1 as select concat(1|2) as c1;
80 select hex(concat(1&2));
81 create
table t1 as select concat(1&2) as c1;
85 select hex(concat(bit_count(12)));
86 create
table t1 as select concat(bit_count(12)) as c1;
90 select hex(concat(2<<1));
91 create
table t1 as select concat(2<<1) as c1;
95 select hex(concat(2>>1));
96 create
table t1 as select concat(2>>1) as c1;
100 select hex(concat(~0));
101 create
table t1 as select concat(~0) as c1;
102 show create
table t1;
105 select hex(concat(3^2));
106 create
table t1 as select concat(3^2) as c1;
107 show create
table t1;
115 # Note, some tests use LEFT(func(),1) to avoid
116 # non-deterministic results on various platforms.
119 select hex(concat(abs(-2)));
120 create
table t1 as select concat(abs(-2)) as c1;
121 show create
table t1;
124 select hex(left(concat(exp(2)),1));
125 create
table t1 as select concat(exp(2)) as c1;
126 show create
table t1;
129 select hex(left(concat(log(2)),1));
130 create
table t1 as select concat(log(2)) as c1;
131 show create
table t1;
134 select hex(left(concat(log2(2)),1));
135 create
table t1 as select concat(log2(2)) as c1;
136 show create
table t1;
139 select hex(left(concat(log10(2)),1));
140 create
table t1 as select concat(log10(2)) as c1;
141 show create
table t1;
144 select hex(left(concat(sqrt(2)),1));
145 create
table t1 as select concat(sqrt(2)) as c1;
146 show create
table t1;
149 select hex(left(concat(pow(2,2)),1));
150 create
table t1 as select concat(pow(2,2)) as c1;
151 show create
table t1;
154 select hex(left(concat(acos(0.5)),1));
155 create
table t1 as select concat(acos(0.5)) as c1;
156 show create
table t1;
159 select hex(left(concat(asin(0.5)),1));
160 create
table t1 as select concat(asin(0.5)) as c1;
161 show create
table t1;
164 select hex(left(concat(atan(0.5)),1));
165 create
table t1 as select concat(atan(0.5)) as c1;
166 show create
table t1;
169 select hex(left(concat(cos(0.5)),1));
170 create
table t1 as select concat(cos(0.5)) as c1;
171 show create
table t1;
174 select hex(left(concat(sin(0.5)),1));
175 create
table t1 as select concat(sin(0.5)) as c1;
176 show create
table t1;
179 select hex(left(concat(tan(0.5)),1));
180 create
table t1 as select concat(tan(0.5)) as c1;
181 show create
table t1;
184 select hex(concat(degrees(0)));
185 create
table t1 as select concat(degrees(0)) as c1;
186 show create
table t1;
189 select hex(concat(radians(0)));
190 create
table t1 as select concat(radians(0)) as c1;
191 show create
table t1;
194 select hex(concat(ceiling(0.5)));
195 create
table t1 as select concat(ceiling(0.5)) as c1;
196 show create
table t1;
199 select hex(concat(floor(0.5)));
200 create
table t1 as select concat(floor(0.5)) as c1;
201 show create
table t1;
204 select hex(concat(round(0.5)));
205 create
table t1 as select concat(round(0.5)) as c1;
206 show create
table t1;
209 select hex(concat(sign(0.5)));
210 create
table t1 as select concat(sign(0.5)) as c1;
211 show create
table t1;
214 create
table t1 as select concat(rand()) as c1;
215 show create
table t1;
223 select hex(concat(length(
'a')));
224 create
table t1 as select concat(length(
'a')) as c1;
225 show create
table t1;
228 select hex(concat(char_length('a')));
229 create
table t1 as select concat(char_length('a')) as c1;
230 show create
table t1;
233 select hex(concat(bit_length('a')));
234 create
table t1 as select concat(bit_length('a')) as c1;
235 show create
table t1;
238 select hex(concat(coercibility('a')));
239 create
table t1 as select concat(coercibility('a')) as c1;
240 show create
table t1;
243 select hex(concat(locate('a','a')));
244 create
table t1 as select concat(locate('a','a')) as c1;
245 show create
table t1;
248 select hex(concat(field('c','a','b','c')));
249 create
table t1 as select concat(field('c','a','b','c')) as c1;
250 show create
table t1;
253 select hex(concat(ascii(61)));
254 create
table t1 as select concat(ascii(61)) as c1;
255 show create
table t1;
258 select hex(concat(ord(61)));
259 create
table t1 as select concat(ord(61)) as c1;
260 show create
table t1;
263 select hex(concat(find_in_set('b','a,b,c,d')));
264 create
table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
265 show create
table t1;
270 # String hash functions
273 select md5(
'a'), hex(md5(
'a'));
274 create
table t1 as select md5(
'a') as c1;
275 show create
table t1;
278 select old_password('a'), hex(old_password('a'));
279 create
table t1 as select old_password('a') as c1;
280 show create
table t1;
283 select password('a'), hex(password('a'));
284 create
table t1 as select password('a') as c1;
285 show create
table t1;
288 select sha('a'), hex(sha('a'));
289 create
table t1 as select sha('a') as c1;
290 show create
table t1;
293 select sha1('a'), hex(sha1('a'));
294 create
table t1 as select sha1('a') as c1;
295 show create
table t1;
298 #select sha2('a',224), hex(sha2('a',224));
299 #create table t1 as select sha2('a',224) as c1;
300 #show create table t1;
309 select hex(concat(cast(
'-1' as
signed)));
310 create
table t1 as select concat(cast(
'-1' as
signed)) as c1;
311 show create
table t1;
314 select hex(concat(cast(
'1' as
unsigned)));
315 create
table t1 as select concat(cast(
'1' as
unsigned)) as c1;
316 show create
table t1;
319 select hex(concat(cast(1/2 as decimal(5,5))));
320 create
table t1 as select concat(cast(1/2 as decimal(5,5))) as c1;
321 show create
table t1;
324 select hex(concat(cast('2001-01-02 03:04:05' as date)));
325 create
table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1;
326 show create
table t1;
330 select hex(concat(cast('2001-01-02 03:04:05' as time)));
331 create
table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1;
332 show create
table t1;
336 select hex(concat(cast('2001-01-02' as datetime)));
337 create
table t1 as select concat(cast('2001-01-02' as datetime)) as c1;
338 show create
table t1;
344 # Aggregation: LEAST, GREATEST
346 select hex(concat(least(1,2)));
347 create
table t1 as select concat(least(1,2)) as c1;
348 show create
table t1;
351 select hex(concat(greatest(1,2)));
352 create
table t1 as select concat(greatest(1,2)) as c1;
353 show create
table t1;
360 select hex(concat(
case when 11 then 22
else 33 end));
361 create
table t1 as select concat(
case when 11 then 22
else 33 end) as c1;
362 show create
table t1;
367 # Aggregation: COALESCE
369 select hex(concat(coalesce(1,2)));
370 create
table t1 as select concat(coalesce(1,2)) as c1;
371 show create
table t1;
376 # Aggregation: CONCAT_WS, GROUP_CONCAT
378 select hex(concat_ws(1,2,3));
379 create
table t1 as select concat_ws(1,2,3) as c1;
380 show create
table t1;
383 select hex(group_concat(1,2,3));
384 create
table t1 as select group_concat(1,2,3) as c1;
385 show create
table t1;
391 create
table t1 as select 1 as c1
union select 'a';
392 show create
table t1;
393 select hex(c1) from t1 order by c1;
398 # Miscelaneous functions
401 create
table t1 as select concat(last_insert_id()) as c1;
402 show create
table t1;
405 select hex(concat(benchmark(0,0)));
406 create
table t1 as select concat(benchmark(0,0)) as c1;
407 show create
table t1;
410 select hex(concat(sleep(0)));
411 create
table t1 as select concat(sleep(0)) as c1;
412 show create
table t1;
415 # Fails with "mtr --ps-protocol" for some reasons.
416 #select hex(concat(get_lock('a',0)));
417 #select hex(concat(release_lock('a')));
418 #create table t1 as select concat(get_lock('a',0)) as c1;
419 #show create table t1;
422 select hex(concat(is_free_lock(
'xxxx')));
423 create
table t1 as select concat(is_free_lock(
'xxxx')) as c1;
424 show create
table t1;
427 create
table t1 as select concat(is_used_lock('a')) as c1;
428 show create
table t1;
431 create
table t1 as select concat(release_lock('a')) as c1;
432 show create
table t1;
435 select hex(concat(crc32('')));
436 create
table t1 as select concat(crc32('')) as c1;
437 show create
table t1;
440 select hex(concat(uncompressed_length('')));
441 create
table t1 as select concat(uncompressed_length('')) as c1;
442 show create
table t1;
446 show create
table t1;
449 select hex(concat(inet_aton('127.1.1.1')));
450 create
table t1 as select concat(inet_aton('127.1.1.1')) as c1;
451 show create
table t1;
454 select hex(concat(inet_ntoa(2130772225)));
455 create
table t1 as select concat(inet_ntoa(2130772225)) as c1;
457 show create
table t1;
460 # Ensure that row_count() value is reset after drop table.
462 select hex(concat(row_count()));
463 create
table t1 as select concat(row_count()) as c1;
464 show create
table t1;
467 select hex(concat(found_rows()));
468 create
table t1 as select concat(found_rows()) as c1;
469 show create
table t1;
472 create
table t1 as select concat(uuid_short()) as c1;
473 show create
table t1;
476 create
table t1 as select concat(uuid()) as c1;
477 show create
table t1;
481 # Make sure we can mix uuid() to a latin1 object
482 # with DERIVATION_IMPLICIT (and higher):
483 # (DERIVATION_COERCIBLE + MY_REPERTOIRE_ASCII allow to do so)
485 select coercibility(uuid()), coercibility(cast(
'a' as
char character
set latin1));
486 select charset(concat(uuid(), cast(
'a' as
char character
set latin1)));
487 create
table t1 as select concat(uuid(), cast(
'a' as
char character
set latin1)) as c1;
488 show create
table t1;
491 create
table t1 as select concat(master_pos_wait(
'non-existent',0,2)) as c1;
492 show create
table t1;
497 # User and system variable functions
500 # User variables: INT
501 select hex(concat(@a1:=1));
502 create
table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2;
503 select hex(c1) from t1;
504 show create
table t1;
508 select hex(concat(@a2));
509 create
table t1 as select concat(@a2) as c1, @a2 as c2;
510 select hex(c1) from t1;
511 show create
table t1;
514 # User variables: REAL
515 select hex(concat(@a1:=sqrt(1)));
516 create
table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2;
517 select hex(c1) from t1;
518 show create
table t1;
522 select hex(concat(@a2));
523 create
table t1 as select concat(@a2) as c1, @a2 as c2;
524 select hex(c1) from t1;
525 show create
table t1;
528 # User variables: DECIMAL
529 select hex(concat(@a1:=1.1));
530 create
table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2;
531 select hex(c1) from t1;
532 show create
table t1;
536 select hex(concat(@a2));
537 create
table t1 as select concat(@a2) as c1, @a2 as c2;
538 select hex(c1) from t1;
539 show create
table t1;
543 select hex(concat(@@ft_max_word_len));
544 create
table t1 as select concat(@@ft_max_word_len) as c1;
545 select hex(c1) from t1;
546 show create
table t1;
550 # Comparison functions
553 select hex(concat(
'a'=
'a' IS TRUE));
554 create
table t1 as select concat(
'a'=
'a' IS TRUE) as c1;
555 show create
table t1;
558 select hex(concat(
'a'=
'a' IS NOT TRUE));
559 create
table t1 as select concat(
'a'=
'a' IS NOT TRUE) as c1;
560 show create
table t1;
563 select hex(concat(NOT
'a'=
'a'));
564 create
table t1 as select concat(NOT
'a'=
'a') as c1;
565 show create
table t1;
568 select hex(concat('a' IS NULL));
569 create
table t1 as select concat('a' IS NULL) as c1;
570 show create
table t1;
573 select hex(concat('a' IS NOT NULL));
574 create
table t1 as select concat('a' IS NOT NULL) as c1;
575 show create
table t1;
578 select hex(concat('a' rlike 'a'));
579 create
table t1 as select concat('a' IS NOT NULL) as c1;
580 show create
table t1;
583 select hex(concat(strcmp('a','b')));
584 create
table t1 as select concat(strcmp('a','b')) as c1;
585 show create
table t1;
588 select hex(concat('a' like 'a'));
589 create
table t1 as select concat('a' like 'b') as c1;
590 show create
table t1;
593 select hex(concat('a' between 'b' and 'c'));
594 create
table t1 as select concat('a' between 'b' and 'c') as c1;
595 show create
table t1;
598 select hex(concat('a' in ('a','b')));
599 create
table t1 as select concat('a' in ('a','b')) as c1;
600 show create
table t1;
603 select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
604 create
table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
605 show create
table t1;
608 create
table t1 (a varchar(10), fulltext key(a));
609 insert into t1 values ('a');
610 select hex(concat(
match (a) against ('a'))) from t1;
611 create
table t2 as select concat(
match (a) against ('a')) as a from t1;
612 show create
table t2;
615 select hex(ifnull(1,'a'));
616 create
table t1 as select ifnull(1,'a') as c1;
617 show create
table t1;
620 select hex(concat(ifnull(1,1)));
621 create
table t1 as select concat(ifnull(1,1)) as c1;
622 show create
table t1;
625 select hex(concat(ifnull(1.1,1.1)));
626 create
table t1 as select concat(ifnull(1.1,1.1)) as c1;
627 show create
table t1;
630 select hex(if(1,'b',1));
631 create
table t1 as select if(1,'b',1) as c1;
632 show create
table t1;
635 select hex(if(1,1,'b'));
636 create
table t1 as select if(1,1,'b') as c1;
637 show create
table t1;
640 select hex(concat(if(1,1,1)));
641 create
table t1 as select concat(if(1,1,1)) as c1;
642 show create
table t1;
645 select hex(concat(nullif(1,2)));
646 create
table t1 as select concat(nullif(1,2)) as c1;
647 show create
table t1;
654 select hex(concat(Dimension(GeomFromText(
'LINESTRING(0 0,10 10)'))));
655 create
table t1 as select concat(Dimension(GeomFromText(
'LINSTRING(0 0,10 10)'))) as c1;
656 show create
table t1;
659 select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
660 create
table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
661 show create
table t1;
664 select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))));
665 create
table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1;
666 show create
table t1;
669 select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
670 create
table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
671 show create
table t1;
674 select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))));
675 create
table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1;
676 show create
table t1;
679 select hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))));
680 create
table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1;
681 show create
table t1;
684 select hex(concat(IsSimple(GeomFromText('POINT(1 1)'))));
685 create
table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
686 show create
table t1;
689 select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
690 create
table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1;
691 show create
table t1;
694 select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
695 create
table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1;
698 select hex(concat(x(GeomFromText('Point(1 2)'))));
699 create
table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
700 show create
table t1;
703 select hex(concat(y(GeomFromText('Point(1 2)'))));
704 create
table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
705 show create
table t1;
708 select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))));
709 create
table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1;
710 show create
table t1;
713 select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))));
714 create
table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1;
715 show create
table t1;
718 select hex(concat(GeometryType(GeomFromText('Point(1 2)'))));
719 create
table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1;
720 show create
table t1;
723 select hex(concat(AsText(GeomFromText('Point(1 2)'))));
724 create
table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1;
725 show create
table t1;
731 # Date/Time functions
734 select hex(concat(period_add(200902, 2)));
735 create
table t1 as select concat(period_add(200902, 2)) as c1;
736 show create
table t1;
739 select hex(concat(period_diff(200902, 200802)));
740 create
table t1 as select concat(period_add(200902, 200802)) as c1;
741 show create
table t1;
744 select hex(concat(to_days(20090224)));
745 create
table t1 as select concat(to_days(20090224)) as c1;
746 show create
table t1;
749 select hex(concat(dayofmonth(20090224)));
750 create
table t1 as select concat(dayofmonth(20090224)) as c1;
751 show create
table t1;
754 select hex(concat(dayofyear(20090224)));
755 create
table t1 as select concat(dayofyear(20090224)) as c1;
756 show create
table t1;
759 select hex(concat(hour('10:11:12')));
760 create
table t1 as select concat(hour('10:11:12')) as c1;
761 show create
table t1;
764 select hex(concat(minute('10:11:12')));
765 create
table t1 as select concat(minute('10:11:12')) as c1;
766 show create
table t1;
769 select hex(concat(second('10:11:12')));
770 create
table t1 as select concat(second('10:11:12')) as c1;
771 show create
table t1;
774 select hex(concat(quarter(20090224)));
775 create
table t1 as select concat(quarter(20090224)) as c1;
776 show create
table t1;
779 select hex(concat(week(20090224)));
780 create
table t1 as select concat(week(20090224)) as c1;
781 show create
table t1;
784 select hex(concat(yearweek(20090224)));
785 create
table t1 as select concat(yearweek(20090224)) as c1;
786 show create
table t1;
789 select hex(concat(year(20090224)));
790 create
table t1 as select concat(year(20090224)) as c1;
791 show create
table t1;
794 select hex(concat(weekday(20090224)));
795 create
table t1 as select concat(weekday(20090224)) as c1;
796 show create
table t1;
799 select hex(concat(dayofweek(20090224)));
800 create
table t1 as select concat(dayofweek(20090224)) as c1;
801 show create
table t1;
804 select hex(concat(unix_timestamp(20090224)));
805 create
table t1 as select concat(unix_timestamp(20090224)) as c1;
806 show create
table t1;
809 select hex(concat(time_to_sec('10:11:12')));
810 create
table t1 as select concat(time_to_sec('10:11:12')) as c1;
811 show create
table t1;
814 select hex(concat(extract(year from 20090702)));
815 create
table t1 as select concat(extract(year from 20090702)) as c1;
816 show create
table t1;
819 select hex(concat(microsecond('12:00:00.123456')));
820 create
table t1 as select concat(microsecond('12:00:00.123456')) as c1;
821 show create
table t1;
824 select hex(concat(month(20090224)));
825 create
table t1 as select concat(month(20090224)) as c1;
826 show create
table t1;
830 create
table t1 as select concat(last_day('2003-02-05')) as c1;
831 show create
table t1;
832 select c1, hex(c1) from t1;
835 create
table t1 as select concat(from_days(730669)) as c1;
836 show create
table t1;
837 select c1, hex(c1) from t1;
840 create
table t1 as select concat(curdate()) as c1;
841 show create
table t1;
844 create
table t1 as select concat(utc_date()) as c1;
845 show create
table t1;
848 create
table t1 as select concat(curtime()) as c1;
849 show create
table t1;
852 create
table t1 as select repeat('a',20) as c1
limit 0;
853 set timestamp=1216359724;
854 insert into t1 values (current_date);
855 insert into t1 values (current_time);
856 select c1, hex(c1) from t1;
859 create
table t1 as select concat(utc_time()) as c1;
860 show create
table t1;
863 select hex(concat(sec_to_time(2378)));
864 create
table t1 as select concat(sec_to_time(2378)) as c1;
865 show create
table t1;
868 select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')));
869 create
table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1;
870 show create
table t1;
873 select hex(concat(maketime(10,11,12)));
874 create
table t1 as select concat(maketime(10,11,12)) as c1;
875 show create
table t1;
878 select hex(get_format(DATE,'USA'));
879 create
table t1 as select get_format(DATE,'USA') as c1;
880 show create
table t1;
883 select hex(left(concat(from_unixtime(1111885200)),4));
884 create
table t1 as select concat(from_unixtime(1111885200)) as c1;
885 show create
table t1;
888 select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')));
889 create
table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1;
890 show create
table t1;
893 select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)));
894 create
table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1;
895 show create
table t1;
899 select hex(concat(makedate(2009,1)));
900 create
table t1 as select concat(makedate(2009,1)) as c1;
901 show create
table t1;
905 create
table t1 as select concat(now()) as c1;
906 show create
table t1;
909 create
table t1 as select concat(utc_timestamp()) as c1;
910 show create
table t1;
913 create
table t1 as select concat(sysdate()) as c1;
914 show create
table t1;
917 select hex(concat(addtime('00:00:00','11:22:33')));
918 create
table t1 as select concat(addtime('00:00:00','11:22:33')) as c1;
919 show create
table t1;
922 select hex(concat(subtime('23:59:59','11:22:33')));
923 create
table t1 as select concat(subtime('23:59:59','11:22:33')) as c1;
924 show create
table t1;
929 # Other string functions with numeric input
931 select hex(elt(1,2,3));
932 create
table t1 as select elt(1,2,3) as c1;
933 show create
table t1;
936 select hex(export_set(1,2,3,4,2));
937 create
table t1 as select export_set(1,2,3,4,2) as c1;
938 show create
table t1;
941 select hex(insert(1133,3,0,22));
942 create
table t1 as select insert(1133,3,0,22) as c1;
943 show create
table t1;
946 select hex(lcase(123));
947 create
table t1 as select lcase(123) as c1;
948 show create
table t1;
951 select hex(left(123,1));
952 create
table t1 as select left(123,1) as c1;
953 show create
table t1;
956 select hex(lower(123));
957 create
table t1 as select lower(123) as c1;
958 show create
table t1;
961 select hex(lpad(1,2,0));
962 create
table t1 as select lpad(1,2,0) as c1;
963 show create
table t1;
966 select hex(ltrim(1));
967 create
table t1 as select ltrim(1) as c1;
968 show create
table t1;
971 select hex(mid(1,1,1));
972 create
table t1 as select mid(1,1,1) as c1;
973 show create
table t1;
976 select hex(repeat(1,2));
977 create
table t1 as select repeat(1,2) as c1;
978 show create
table t1;
982 create
table t1 as select replace(1,1,2) as c1;
983 show create
table t1;
986 select hex(reverse(12));
987 create
table t1 as select reverse(12) as c1;
988 show create
table t1;
991 select hex(right(123,1));
992 create
table t1 as select right(123,1) as c1;
993 show create
table t1;
996 select hex(rpad(1,2,0));
997 create
table t1 as select rpad(1,2,0) as c1;
998 show create
table t1;
1001 select hex(rtrim(1));
1002 create
table t1 as select rtrim(1) as c1;
1003 show create
table t1;
1006 select hex(soundex(1));
1007 create
table t1 as select soundex(1) as c1;
1008 show create
table t1;
1011 select hex(substring(1,1,1));
1012 create
table t1 as select substring(1,1,1) as c1;
1013 show create
table t1;
1016 select hex(trim(1));
1017 create
table t1 as select trim(1) as c1;
1018 show create
table t1;
1021 select hex(ucase(1));
1022 create
table t1 as select ucase(1) as c1;
1023 show create
table t1;
1026 select hex(upper(1));
1027 create
table t1 as select upper(1) as c1;
1028 show create
table t1;
1035 create
table t1 as select repeat(
' ', 64) as a limit 0;
1036 show create
table t1;
1037 insert into t1 values ("1.1"), ("2.1");
1038 select a, hex(a) from t1;
1039 update t1 set a= a + 0.1;
1040 select a, hex(a) from t1;
1047 create
table t1 (a tinyint);
1048 insert into t1 values (1);
1049 select hex(concat(a)) from t1;
1050 create
table t2 as select concat(a) from t1;
1051 show create
table t2;
1054 create
table t1 (a tinyint zerofill);
1055 insert into t1 values (1), (10), (100);
1056 select hex(concat(a)), a from t1;
1059 create
table t1 (a tinyint(4) zerofill);
1060 insert into t1 values (1), (10), (100);
1061 select hex(concat(a)), a from t1;
1064 create
table t1 (a decimal(10,2));
1065 insert into t1 values (123.45);
1066 select hex(concat(a)) from t1;
1067 create
table t2 as select concat(a) from t1;
1068 show create
table t2;
1071 create
table t1 (a smallint);
1072 insert into t1 values (1);
1073 select hex(concat(a)) from t1;
1074 create
table t2 as select concat(a) from t1;
1075 show create
table t2;
1078 create
table t1 (a smallint zerofill);
1079 insert into t1 values (1), (10), (100), (1000), (10000);
1080 select hex(concat(a)), a from t1;
1083 create
table t1 (a mediumint);
1084 insert into t1 values (1);
1085 select hex(concat(a)) from t1;
1086 create
table t2 as select concat(a) from t1;
1087 show create
table t2;
1090 create
table t1 (a mediumint zerofill);
1091 insert into t1 values (1), (10), (100), (1000), (10000);
1092 select hex(concat(a)), a from t1;
1095 create
table t1 (a
int);
1096 insert into t1 values (1);
1097 select hex(concat(a)) from t1;
1098 create
table t2 as select concat(a) from t1;
1099 show create
table t2;
1102 create
table t1 (a
int zerofill);
1103 insert into t1 values (1), (10), (100), (1000), (10000);
1104 select hex(concat(a)), a from t1;
1107 create
table t1 (a bigint);
1108 insert into t1 values (1);
1109 select hex(concat(a)) from t1;
1110 create
table t2 as select concat(a) from t1;
1111 show create
table t2;
1114 create
table t1 (a bigint zerofill);
1115 insert into t1 values (1), (10), (100), (1000), (10000);
1116 select hex(concat(a)), a from t1;
1119 create
table t1 (a
float);
1120 insert into t1 values (123.456);
1121 select hex(concat(a)) from t1;
1122 select concat(a) from t1;
1123 create
table t2 as select concat(a) from t1;
1124 show create
table t2;
1127 create
table t1 (a
float zerofill);
1128 insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
1129 select hex(concat(a)), a from t1;
1132 create
table t1 (a
double);
1133 insert into t1 values (123.456);
1134 select hex(concat(a)) from t1;
1135 select concat(a) from t1;
1136 create
table t2 as select concat(a) from t1;
1137 show create
table t2;
1140 create
table t1 (a
double zerofill);
1141 insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
1142 select hex(concat(a)), a from t1;
1145 create
table t1 (a year(2));
1146 insert into t1 values (1);
1147 select hex(concat(a)) from t1;
1148 create
table t2 as select concat(a) from t1;
1149 show create
table t2;
1152 create
table t1 (a year);
1153 insert into t1 values (1);
1154 select hex(concat(a)) from t1;
1155 create
table t2 as select concat(a) from t1;
1156 show create
table t2;
1159 create
table t1 (a bit(64));
1160 # BIT is always BINARY
1161 insert into t1 values (1);
1162 select hex(concat(a)) from t1;
1163 create
table t2 as select concat(a) from t1;
1164 show create
table t2;
1167 create
table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
1168 insert into t1 values (0);
1169 insert into t1 values (20010203040506);
1170 insert into t1 values (19800203040506);
1171 insert into t1 values ('2001-02-03 04:05:06');
1172 select hex(concat(a)) from t1;
1173 select concat(a) from t1;
1174 create
table t2 as select concat(a) from t1;
1175 show create
table t2;
1178 create
table t1 (a date);
1179 insert into t1 values ('2001-02-03');
1180 insert into t1 values (20010203);
1181 select hex(concat(a)) from t1;
1182 create
table t2 as select concat(a) from t1;
1183 show create
table t2;
1186 create
table t1 (a time);
1187 insert into t1 values (1);
1188 insert into t1 values ('01:02:03');
1189 select hex(concat(a)) from t1;
1190 select concat(a) from t1;
1191 create
table t2 as select concat(a) from t1;
1192 show create
table t2;
1195 create
table t1 (a datetime);
1196 insert into t1 values ('2001-02-03 04:05:06');
1197 insert into t1 values (20010203040506);
1198 select hex(concat(a)) from t1;
1199 create
table t2 as select concat(a) from t1;
1200 show create
table t2;
1205 # create view with string functions with numeric input
1207 # Switched off in ucs tests due to bug#50716
1210 create
view v1 as select concat(1,2,3) as c1;
1211 show columns from v1;
1212 select hex(c1) from v1;
1215 create
view v1 as select concat_ws(',',1,2,3) as c1;
1216 show columns from v1;
1217 select hex(c1) from v1;
1220 create
view v1 as select elt(1,2,3) as c1;
1221 show columns from v1;
1222 select hex(c1) from v1;
1225 create
view v1 as select export_set(1,2,3,4,2) as c1;
1226 show columns from v1;
1227 select hex(c1) from v1;
1230 create
view v1 as select insert(1133,3,0,22) as c1;
1231 show columns from v1;
1232 select hex(c1) from v1;
1235 create
view v1 as select lcase(123) as c1;
1236 show columns from v1;
1237 select hex(c1) from v1;
1240 create
view v1 as select left(123,1) as c1;
1241 show columns from v1;
1242 select hex(c1) from v1;
1245 create
view v1 as select lower(123) as c1;
1246 show columns from v1;
1247 select hex(c1) from v1;
1250 create
view v1 as select lpad(1,2,0) as c1;
1251 show columns from v1;
1252 select hex(c1) from v1;
1255 create
view v1 as select ltrim(1) as c1;
1256 show columns from v1;
1257 select hex(c1) from v1;
1260 create
view v1 as select mid(1,1,1) as c1;
1261 show columns from v1;
1262 select hex(c1) from v1;
1265 create
view v1 as select repeat(1,2) as c1;
1266 show columns from v1;
1267 select hex(c1) from v1;
1270 create
view v1 as select replace(1,1,2) as c1;
1271 show columns from v1;
1272 select hex(c1) from v1;
1275 create
view v1 as select reverse(12) as c1;
1276 show columns from v1;
1277 select hex(c1) from v1;
1280 create
view v1 as select right(123,1) as c1;
1281 show columns from v1;
1282 select hex(c1) from v1;
1285 create
view v1 as select rpad(1,2,0) as c1;
1286 show columns from v1;
1287 select hex(c1) from v1;
1290 create
view v1 as select rtrim(1) as c1;
1291 show columns from v1;
1292 select hex(c1) from v1;
1295 create
view v1 as select soundex(1) as c1;
1296 show columns from v1;
1297 select hex(c1) from v1;
1300 create
view v1 as select substring(1,1,1) as c1;
1301 show columns from v1;
1302 select hex(c1) from v1;
1305 create
view v1 as select trim(1) as c1;
1306 show columns from v1;
1307 select hex(c1) from v1;
1310 create
view v1 as select ucase(1) as c1;
1311 show columns from v1;
1312 select hex(c1) from v1;
1315 create
view v1 as select upper(1) as c1;
1316 show columns from v1;
1317 select hex(c1) from v1;
1323 # Views from tables with numeric columns
1325 create
table t1 (a tinyint);
1326 insert into t1 values (1);
1327 create
view v1(a) as select concat(a) from t1;
1328 show columns from v1;
1329 select hex(a) from v1;
1333 create
table t1 (a tinyint zerofill);
1334 insert into t1 values (1), (10), (100);
1335 create
view v1(a) as select concat(a) from t1;
1336 show columns from v1;
1337 select hex(a) from v1;
1341 create
table t1 (a tinyint(30) zerofill);
1342 insert into t1 values (1), (10), (100);
1343 create
view v1(a) as select concat(a) from t1;
1344 show columns from v1;
1345 select hex(a) from v1;
1349 create
table t1 (a decimal(10,2));
1350 insert into t1 values (123.45);
1351 create
view v1(a) as select concat(a) from t1;
1352 show columns from v1;
1353 select hex(a) from v1;
1357 create
table t1 (a smallint);
1358 insert into t1 values (1);
1359 create
view v1(a) as select concat(a) from t1;
1360 show columns from v1;
1361 select hex(a) from v1;
1365 create
table t1 (a smallint zerofill);
1366 insert into t1 values (1), (10), (100), (1000), (10000);
1367 create
view v1(a) as select concat(a) from t1;
1368 show columns from v1;
1369 select hex(a) from v1;
1373 create
table t1 (a mediumint);
1374 insert into t1 values (1);
1375 create
view v1(a) as select concat(a) from t1;
1376 show columns from v1;
1377 select hex(a) from v1;
1381 create
table t1 (a mediumint zerofill);
1382 insert into t1 values (1), (10), (100), (1000), (10000);
1383 create
view v1(a) as select concat(a) from t1;
1384 show columns from v1;
1385 select hex(a) from v1;
1389 create
table t1 (a
int);
1390 insert into t1 values (1);
1391 create
view v1(a) as select concat(a) from t1;
1392 show columns from v1;
1393 select hex(a) from v1;
1397 create
table t1 (a
int zerofill);
1398 insert into t1 values (1), (10), (100), (1000), (10000);
1399 create
view v1(a) as select concat(a) from t1;
1400 show columns from v1;
1401 select hex(a) from v1;
1405 create
table t1 (a bigint);
1406 insert into t1 values (1);
1407 create
view v1(a) as select concat(a) from t1;
1408 show columns from v1;
1409 select hex(a) from v1;
1413 create
table t1 (a bigint zerofill);
1414 insert into t1 values (1), (10), (100), (1000), (10000);
1415 create
view v1(a) as select concat(a) from t1;
1416 show columns from v1;
1417 select hex(a) from v1;
1421 create
table t1 (a
float);
1422 insert into t1 values (123.456);
1423 create
view v1(a) as select concat(a) from t1;
1424 show columns from v1;
1425 select hex(a) from v1;
1429 create
table t1 (a
float zerofill);
1430 insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
1431 create
view v1(a) as select concat(a) from t1;
1432 show columns from v1;
1433 select hex(a) from v1;
1437 create
table t1 (a
double);
1438 insert into t1 values (123.456);
1439 select concat(a) from t1;
1440 create
view v1(a) as select concat(a) from t1;
1441 show columns from v1;
1442 select hex(a) from v1;
1446 create
table t1 (a
double zerofill);
1447 insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
1448 create
view v1(a) as select concat(a) from t1;
1449 show columns from v1;
1450 select hex(a) from v1;
1454 create
table t1 (a year(2));
1455 insert into t1 values (1);
1456 create
view v1(a) as select concat(a) from t1;
1457 show columns from v1;
1458 select hex(a) from v1;
1462 create
table t1 (a year);
1463 insert into t1 values (1);
1464 create
view v1(a) as select concat(a) from t1;
1465 show columns from v1;
1466 select hex(a) from v1;
1470 create
table t1 (a bit(64));
1471 # BIT is always BINARY
1472 insert into t1 values (1);
1473 create
view v1(a) as select concat(a) from t1;
1474 show columns from v1;
1475 select hex(a) from v1;
1479 create
table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
1480 insert into t1 values (0);
1481 insert into t1 values (20010203040506);
1482 insert into t1 values (19800203040506);
1483 insert into t1 values ('2001-02-03 04:05:06');
1484 create
view v1(a) as select concat(a) from t1;
1485 show columns from v1;
1486 select hex(a) from v1;
1490 create
table t1 (a date);
1491 insert into t1 values ('2001-02-03');
1492 insert into t1 values (20010203);
1493 create
view v1(a) as select concat(a) from t1;
1494 show columns from v1;
1495 select hex(a) from v1;
1499 create
table t1 (a time);
1500 insert into t1 values (1);
1501 insert into t1 values ('01:02:03');
1502 create
view v1(a) as select concat(a) from t1;
1503 show columns from v1;
1504 select hex(a) from v1;
1508 create
table t1 (a datetime);
1509 insert into t1 values ('2001-02-03 04:05:06');
1510 insert into t1 values (20010203040506);
1511 create
view v1(a) as select concat(a) from t1;
1512 show columns from v1;
1513 select hex(a) from v1;
1518 # User defined function returning numeric result
1521 create
function f1 (par1
int) returns
int
1523 return concat(par1);
1529 select hex(concat(f1(1)));
1530 create
table t1 as select f1(1) as c1;
1531 show create
table t1;
1533 create
table t1 as select concat(f1(1)) as c1;
1534 show create
table t1;
1535 create
view v1 as select concat(f1(1)) as c1;
1536 show columns from v1;
1542 create function f1 (par1 decimal(18,2)) returns decimal(18,2)
1544 return concat(par1);
1550 select hex(concat(f1(123.45)));
1551 create
table t1 as select f1(123.45) as c1;
1552 show create
table t1;
1554 create
table t1 as select concat(f1(123.45)) as c1;
1555 show create
table t1;
1556 create
view v1 as select concat(f1(123.45)) as c1;
1557 show columns from v1;
1563 create function f1 (par1
float) returns
float
1565 return concat(par1);
1571 select hex(concat(f1(123.45)));
1572 create
table t1 as select f1(123.45) as c1;
1573 show create
table t1;
1575 create
table t1 as select concat(f1(123.45)) as c1;
1576 show create
table t1;
1577 create
view v1 as select concat(f1(123.45)) as c1;
1578 show columns from v1;
1584 create function f1 (par1 date) returns date
1586 return concat(par1);
1590 set @a= f1(cast('2001-01-02' as date));
1592 select hex(concat(f1(cast('2001-01-02' as date))));
1593 create
table t1 as select f1(cast('2001-01-02' as date)) as c1;
1594 show create
table t1;
1596 create
table t1 as select concat(f1(cast('2001-01-02' as date))) as c1;
1597 show create
table t1;
1598 create
view v1 as select concat(f1(cast('2001-01-02' as date))) as c1;
1599 show columns from v1;
1606 --echo # End of WL#2649
Number-
to-
string conversions
1610 --echo # Bug#54668 User variable assignments
get wrong
type
1613 SELECT charset(@x), collation(@x);
1614 SET @x=old_password(
'a');
1615 SELECT charset(@x), collation(@x);
1616 SET @x=password(
'a');
1617 SELECT charset(@x), collation(@x);
1619 SELECT charset(@x), collation(@x);
1621 SELECT charset(@x), collation(@x);
1622 SET @x=astext(point(1,2));
1623 SELECT charset(@x), collation(@x);
1624 SET @x=aswkt(point(1,2));
1625 SELECT charset(@x), collation(@x);
1629 --echo # Bug#54916 GROUP_CONCAT + IFNULL truncates output
1631 SELECT @@collation_connection;
1632 # ENGINE=MYISAM is very important to make sure "SYSTEM" join type
1633 # is in use, which will create instances of Item_copy.
1634 CREATE
TABLE t1 (a MEDIUMINT NULL) ENGINE=MYISAM;
1635 INSERT INTO t1 VALUES (1234567);
1636 SELECT GROUP_CONCAT(IFNULL(a,
'')) FROM t1;
1637 SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1;
1638 SELECT GROUP_CONCAT(
CASE WHEN a THEN a ELSE '' END) FROM t1;
1640 SELECT COALESCE(a,'') FROM t1 GROUP BY 1;
1642 --echo
# All columns must be VARCHAR(9) with the same length:
1649 CASE WHEN a THEN a ELSE
'' END,
1653 # The above query is expected to send a warning
1654 # in case of ucs2 character set, until Bug#55744 is fixed.
1655 SHOW CREATE
TABLE t2;
1658 CREATE
TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1;
1659 SHOW CREATE
TABLE t2;
1662 CREATE
TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1;
1663 SHOW CREATE
TABLE t2;
1666 CREATE
TABLE t2 AS SELECT LCASE(a) FROM t1;
1667 SHOW CREATE
TABLE t2;
1670 CREATE
TABLE t2 AS SELECT UCASE(a) FROM t1;
1671 SHOW CREATE
TABLE t2;
1674 CREATE
TABLE t2 AS SELECT REPEAT(1,2) FROM t1;
1675 SHOW CREATE
TABLE t2;
1678 CREATE
TABLE t2 AS SELECT LEFT(123,2) FROM t1;
1679 SHOW CREATE
TABLE t2;
1682 CREATE
TABLE t2 AS SELECT RIGHT(123,2) FROM t1;
1683 SHOW CREATE
TABLE t2;
1686 CREATE
TABLE t2 AS SELECT LTRIM(123) FROM t1;
1687 SHOW CREATE
TABLE t2;
1690 CREATE
TABLE t2 AS SELECT RTRIM(123) FROM t1;
1691 SHOW CREATE
TABLE t2;
1694 CREATE
TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1;
1695 SHOW CREATE
TABLE t2;
1699 SHOW CREATE
TABLE t2;
1702 CREATE
TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1;
1703 SHOW CREATE
TABLE t2;
1706 CREATE
TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1;
1707 SHOW CREATE
TABLE t2;
1710 CREATE
TABLE t2 AS SELECT SOUNDEX(1) FROM t1;
1711 SHOW CREATE
TABLE t2;
1714 CREATE
TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8);
1715 SHOW CREATE
TABLE t2;
1721 --echo # End of Bug#54916
1725 --echo # WL#5510 Functions to_base64 and from_base64
1727 CREATE
TABLE t1 AS SELECT TO_BASE64(
'test') AS to_base64;
1728 SHOW CREATE
TABLE t1;
1729 SELECT to_base64, LENGTH(to_base64), HEX(to_base64) FROM t1;
1730 CREATE
TABLE t2 AS SELECT FROM_BASE64(to_base64) AS from_base64 FROM t1;
1731 SHOW CREATE
TABLE t2;
1732 SELECT CAST(from_base64 AS CHAR), LENGTH(from_base64), HEX(from_base64) FROM t2;
1738 --echo # Bug#58190 BETWEEN no longer uses indexes
for date or datetime fields
1740 SELECT @@collation_connection;
1742 id INT(11) DEFAULT NULL,
1743 date_column DATE DEFAULT NULL,
1745 INSERT INTO t1 VALUES (1,
'2010-09-01'),(2,
'2010-10-01');
1746 EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN
'2010-09-01' AND
'2010-10-01';
1747 ALTER
TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
1748 EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN
'2010-09-01' AND
'2010-10-01';
1753 --echo # Bug #31384 DATE_ADD() and DATE_SUB() return binary data
1755 SELECT @@collation_connection, @@character_set_results;
1758 DATE_SUB(
'2007-08-03',
INTERVAL 1 MINUTE) AS field_str1,
1759 DATE_SUB(
'2007-08-03 17:33:00',
INTERVAL 1 MINUTE) AS field1_str2,
1760 DATE_SUB(DATE(
'2007-08-03'),
INTERVAL 1 DAY) AS field_date,
1761 DATE_SUB(CAST(
'2007-08-03 17:33:00' AS DATETIME),
INTERVAL 1 MINUTE) AS field_datetime;
1762 SHOW CREATE
TABLE t1;
1765 # PS protocol gives different "Max length" value for DATETIME.
1766 --disable_ps_protocol
1768 DATE_SUB(
'2007-08-03',
INTERVAL 1 DAY) AS field_str1,
1769 DATE_SUB(
'2007-08-03 17:33:00',
INTERVAL 1 MINUTE) AS field1_str2,
1770 DATE_SUB(DATE(
'2007-08-03'),
INTERVAL 1 DAY) AS field_date,
1771 DATE_SUB(CAST(
'2007-08-03 17:33:00' AS DATETIME),
INTERVAL 1 MINUTE) AS field_datetime;
1773 --enable_ps_protocol
1775 HEX(DATE_SUB(
'2007-08-03',
INTERVAL 1 MINUTE)) AS field_str1,
1776 HEX(DATE_SUB(
'2007-08-03 17:33:00',
INTERVAL 1 MINUTE)) AS field1_str2,
1777 HEX(DATE_SUB(DATE(
'2007-08-03'),
INTERVAL 1 DAY)) AS field_date,
1778 HEX(DATE_SUB(CAST(
'2007-08-03 17:33:00' AS DATETIME),
INTERVAL 1 MINUTE)) AS field_datetime;
1781 --echo # Bug#11926811 / Bug#60625 Illegal mix of collations
1783 SELECT @@collation_connection;
1785 CREATE PROCEDURE p1()
1787 DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
1788 SELECT v_LastPaymentDate < NOW();
1789 EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
1791 EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
1798 --echo # Bug#52159 returning time
type from
function and empty left join causes debug assertion
1800 CREATE FUNCTION f1() RETURNS TIME RETURN 1;
1801 CREATE
TABLE t1 (b INT);
1802 INSERT INTO t1 VALUES (0);
1803 SELECT f1() FROM t1 LEFT
JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY a;
1809 CREATE
TABLE t1(a
char(215) CHARACTER SET utf8 NOT NULL DEFAULT '',
KEY(a));
1810 INSERT INTO t1 VALUES ();
1812 SELECT maketime(`a`,`a`,`a`) FROM t1 GROUP BY 1;
1815 SET sql_mode=default;