~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/parser.test

  • Committer: Brian Aker
  • Date: 2009-06-16 00:53:22 UTC
  • mto: This revision was merged to the branch mainline in revision 1094.
  • Revision ID: brian@gaz-20090616005322-w0ode4jul9z8s2y9
Partial fix for tests for tmp

Show diffs side-by-side

added added

removed removed

Lines of Context:
346
346
 
347
347
# Test coverage with edge conditions
348
348
 
 
349
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
349
350
select pi(3.14);
350
351
 
 
352
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
351
353
select tan();
 
354
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
352
355
select tan(1, 2);
353
356
 
 
357
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
354
358
select makedate(1);
 
359
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
355
360
select makedate(1, 2, 3);
356
361
 
 
362
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
357
363
select atan();
 
364
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
358
365
select atan2(1, 2, 3);
359
366
 
 
367
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
360
368
select concat();
361
369
select concat("foo");
362
370
 
 
371
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
363
372
select concat_ws();
 
373
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
364
374
select concat_ws("foo");
365
375
 
 
376
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
366
377
select elt();
 
378
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
367
379
select elt(1);
368
380
 
 
381
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
369
382
select export_set();
 
383
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
370
384
select export_set("p1");
 
385
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
371
386
select export_set("p1", "p2");
 
387
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
372
388
select export_set("p1", "p2", "p3", "p4", "p5", "p6");
373
389
 
 
390
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
374
391
select field();
 
392
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
375
393
select field("p1");
376
394
 
 
395
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
377
396
select from_unixtime();
 
397
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
378
398
select from_unixtime(1, 2, 3);
379
399
 
 
400
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
380
401
select unix_timestamp(1, 2);
381
402
 
 
403
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
382
404
select greatest();
 
405
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
383
406
select greatest(12);
384
407
 
 
408
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
385
409
select last_insert_id(1, 2);
386
410
 
 
411
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
387
412
select least();
 
413
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
388
414
select least(12);
389
415
 
 
416
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
390
417
select locate();
 
418
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
391
419
select locate(1);
 
420
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
392
421
select locate(1, 2, 3, 4);
393
422
 
 
423
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
394
424
select log();
 
425
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
395
426
select log(1, 2, 3);
396
427
 
 
428
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
397
429
select make_set();
 
430
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
398
431
select make_set(1);
399
432
 
 
433
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
400
434
select rand(1, 2, 3);
401
435
 
 
436
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
402
437
select round(1, 2, 3);
403
438
 
404
439
#
405
440
# Bug#24736: UDF functions parsed as Stored Functions
406
441
#
407
442
 
408
 
# This used to do this:
409
443
# Verify that the syntax for calling UDF : foo(expr AS param, ...)
410
444
# can not be used when calling native functions
411
 
#
412
 
# but that's all nuts, so we allow named parameters now - although the names are
413
 
# currently just ignored.
 
445
 
 
446
# Native function with 1 argument
414
447
 
415
448
select abs(3);
 
449
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
416
450
select abs(3 AS three);
 
451
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
417
452
select abs(3 three);
 
453
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
418
454
select abs(3 AS "three");
 
455
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
419
456
select abs(3 "three");
420
457
 
421
458
# Native function with 2 arguments
519
521
#   atan(10) from 64-bit version returns 1.4711276743037345
520
522
--replace_result 1.4711276743037345 1.4711276743037347
521
523
select atan(10);
 
524
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
522
525
select atan(10 AS p1);
 
526
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
523
527
select atan(10 p1);
 
528
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
524
529
select atan(10 AS "p1");
 
530
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
525
531
select atan(10 "p1");
526
532
 
527
533
select atan(10, 20);
 
534
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
528
535
select atan(10 AS p1, 20);
 
536
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
529
537
select atan(10 p1, 20);
 
538
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
530
539
select atan(10 AS "p1", 20);
 
540
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
531
541
select atan(10 "p1", 20);
 
542
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
532
543
select atan(10, 20 AS p2);
 
544
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
533
545
select atan(10, 20 p2);
 
546
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
534
547
select atan(10, 20 AS "p2");
 
548
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
535
549
select atan(10, 20 "p2");
 
550
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
536
551
select atan(10 AS p1, 20 AS p2);
537
552
 
538
553
#
570
585
SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2;
571
586
SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)};
572
587
SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))};
573
 
#
574
 
# MySQL didn't follow the SQL standard on CROSS. INNER requires ON, but
575
 
# CROSS does not make use of ON.
576
 
#
577
 
--error ER_PARSE_ERROR 
578
588
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
589
SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10;
581
590
SELECT {fn CONCAT(a1,a2)} FROM t1;
582
591
UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;