15
13
# - an error is the expected result with the current implementation,
16
14
# and is a limitation.
20
16
create table ADDDATE(a int);
21
17
drop table ADDDATE;
22
18
create table ADDDATE (a int);
23
19
drop table ADDDATE;
25
21
--error ER_PARSE_ERROR
26
create table BIT_AND(a int);
27
create table BIT_AND (a int);
30
--error ER_PARSE_ERROR
31
create table BIT_OR(a int);
32
create table BIT_OR (a int);
35
--error ER_PARSE_ERROR
36
create table BIT_XOR(a int);
37
create table BIT_XOR (a int);
40
--error ER_PARSE_ERROR
41
22
create table CAST(a int);
23
--error ER_PARSE_ERROR
42
24
create table CAST (a int);
45
26
--error ER_PARSE_ERROR
46
27
create table COUNT(a int);
28
--error ER_PARSE_ERROR
47
29
create table COUNT (a int);
50
31
--error ER_PARSE_ERROR
51
32
create table CURDATE(a int);
33
--error ER_PARSE_ERROR
52
34
create table CURDATE (a int);
55
--error ER_PARSE_ERROR
56
create table CURTIME(a int);
57
create table CURTIME (a int);
60
36
--error ER_PARSE_ERROR
61
37
create table DATE_ADD(a int);
38
--error ER_PARSE_ERROR
62
39
create table DATE_ADD (a int);
65
41
--error ER_PARSE_ERROR
66
42
create table DATE_SUB(a int);
43
--error ER_PARSE_ERROR
67
44
create table DATE_SUB (a int);
70
46
--error ER_PARSE_ERROR
71
47
create table EXTRACT(a int);
48
--error ER_PARSE_ERROR
72
49
create table EXTRACT (a int);
75
51
--error ER_PARSE_ERROR
76
52
create table GROUP_CONCAT(a int);
53
--error ER_PARSE_ERROR
77
54
create table GROUP_CONCAT (a int);
78
drop table GROUP_CONCAT;
80
56
# Limitation removed in 5.1
81
57
create table GROUP_UNIQUE_USERS(a int);
399
347
# Test coverage with edge conditions
349
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
352
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
354
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
404
355
select tan(1, 2);
357
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
406
358
select makedate(1);
359
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
407
360
select makedate(1, 2, 3);
411
select maketime(1, 2);
412
select maketime(1, 2, 3, 4);
362
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
364
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
415
365
select atan2(1, 2, 3);
367
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
418
369
select concat("foo");
371
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
420
372
select concat_ws();
373
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
421
374
select concat_ws("foo");
424
select encrypt(1, 2, 3);
426
select des_encrypt("p1", "p2", "not expected");
427
select des_decrypt("p1", "p2", "not expected");
376
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
378
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
381
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
432
382
select export_set();
383
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
433
384
select export_set("p1");
385
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
434
386
select export_set("p1", "p2");
387
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
435
388
select export_set("p1", "p2", "p3", "p4", "p5", "p6");
390
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
392
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
438
393
select field("p1");
395
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
440
396
select from_unixtime();
397
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
441
398
select from_unixtime(1, 2, 3);
400
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
443
401
select unix_timestamp(1, 2);
403
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
445
404
select greatest();
405
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
446
406
select greatest(12);
408
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
448
409
select last_insert_id(1, 2);
411
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
413
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
451
414
select least(12);
416
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
418
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
454
419
select locate(1);
420
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
455
421
select locate(1, 2, 3, 4);
423
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
425
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
458
426
select log(1, 2, 3);
428
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
460
429
select make_set();
430
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
461
431
select make_set(1);
463
select master_pos_wait();
464
select master_pos_wait(1);
465
select master_pos_wait(1, 2, 3, 4);
433
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
467
434
select rand(1, 2, 3);
436
-- error ER_WRONG_PARAMCOUNT_TO_FUNCTION
469
437
select round(1, 2, 3);
472
select yearweek(1, 2, 3);
475
440
# Bug#24736: UDF functions parsed as Stored Functions
641
558
DROP TABLE IF EXISTS t1;
642
559
--enable_warnings
644
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
645
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
646
561
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
647
562
SELECT 1 + INTERVAL(1,0,1,2) + 1;
648
SELECT INTERVAL(1^1,0,1,2) + 1;
563
SELECT INTERVAL(1,0,1,2) + 1;
649
564
SELECT INTERVAL(1,0+1,2,3) * 5.5;
650
565
SELECT INTERVAL(3,3,1+3,4+4) / 0.5;
651
566
SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2;
652
567
SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2);
653
568
SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3);
656
SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND;
657
SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND;
660
570
CREATE TABLE t1 (a INT, b DATETIME);
661
571
INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND);
662
572
SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1;