347
357
# Test coverage with edge conditions
359
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
362
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
364
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
352
365
select tan(1, 2);
367
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
354
368
select makedate(1);
369
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
355
370
select makedate(1, 2, 3);
372
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
374
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
376
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
377
select maketime(1, 2);
378
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
379
select maketime(1, 2, 3, 4);
381
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
383
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
358
384
select atan2(1, 2, 3);
386
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
361
388
select concat("foo");
390
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
363
391
select concat_ws();
392
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
364
393
select concat_ws("foo");
395
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
397
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
400
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
369
401
select export_set();
402
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
370
403
select export_set("p1");
404
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
371
405
select export_set("p1", "p2");
406
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
372
407
select export_set("p1", "p2", "p3", "p4", "p5", "p6");
409
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
411
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
375
412
select field("p1");
414
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
377
415
select from_unixtime();
416
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
378
417
select from_unixtime(1, 2, 3);
419
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
380
420
select unix_timestamp(1, 2);
422
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
382
423
select greatest();
424
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
383
425
select greatest(12);
427
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
385
428
select last_insert_id(1, 2);
430
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
432
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
388
433
select least(12);
435
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
437
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
391
438
select locate(1);
439
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
392
440
select locate(1, 2, 3, 4);
442
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
444
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
395
445
select log(1, 2, 3);
447
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
397
448
select make_set();
449
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
398
450
select make_set(1);
452
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
453
select master_pos_wait();
454
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
455
select master_pos_wait(1);
456
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
457
select master_pos_wait(1, 2, 3, 4);
459
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
400
460
select rand(1, 2, 3);
462
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
402
463
select round(1, 2, 3);
465
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
467
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
468
select yearweek(1, 2, 3);
405
471
# Bug#24736: UDF functions parsed as Stored Functions
408
# This used to do this:
409
474
# Verify that the syntax for calling UDF : foo(expr AS param, ...)
410
475
# can not be used when calling native functions
412
# but that's all nuts, so we allow named parameters now - although the names are
413
# currently just ignored.
477
# Native function with 1 argument
480
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
416
481
select abs(3 AS three);
482
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
417
483
select abs(3 three);
484
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
418
485
select abs(3 AS "three");
486
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
419
487
select abs(3 "three");
421
489
# Native function with 2 arguments
519
552
# atan(10) from 64-bit version returns 1.4711276743037345
520
553
--replace_result 1.4711276743037345 1.4711276743037347
555
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
522
556
select atan(10 AS p1);
557
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
523
558
select atan(10 p1);
559
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
524
560
select atan(10 AS "p1");
561
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
525
562
select atan(10 "p1");
527
564
select atan(10, 20);
565
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
528
566
select atan(10 AS p1, 20);
567
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
529
568
select atan(10 p1, 20);
569
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
530
570
select atan(10 AS "p1", 20);
571
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
531
572
select atan(10 "p1", 20);
573
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
532
574
select atan(10, 20 AS p2);
575
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
533
576
select atan(10, 20 p2);
577
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
534
578
select atan(10, 20 AS "p2");
579
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
535
580
select atan(10, 20 "p2");
581
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
536
582
select atan(10 AS p1, 20 AS p2);
570
618
SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2;
571
619
SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)};
572
620
SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))};
574
# MySQL didn't follow the SQL standard on CROSS. INNER requires ON, but
575
# CROSS does not make use of ON.
577
--error ER_PARSE_ERROR
578
621
SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)};
579
SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) INNER JOIN t3 ON (t3.a2=t2.a3)};
580
622
SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10;
581
623
SELECT {fn CONCAT(a1,a2)} FROM t1;
582
624
UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;