~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/parser.test

  • Committer: Brian Aker
  • Date: 2009-02-05 09:11:16 UTC
  • Revision ID: brian@tangent.org-20090205091116-iy0ersp6bhyzt1ad
Removed dead variables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
create table CURDATE (a int);
35
35
 
36
36
--error ER_PARSE_ERROR
 
37
create table CURTIME(a int);
 
38
--error ER_PARSE_ERROR
 
39
create table CURTIME (a int);
 
40
 
 
41
--error ER_PARSE_ERROR
37
42
create table DATE_ADD(a int);
38
43
--error ER_PARSE_ERROR
39
44
create table DATE_ADD (a int);
181
186
create table CURDATE (a int);
182
187
 
183
188
--error ER_PARSE_ERROR
 
189
create table CURTIME(a int);
 
190
--error ER_PARSE_ERROR
 
191
create table CURTIME (a int);
 
192
 
 
193
--error ER_PARSE_ERROR
184
194
create table DATE_ADD(a int);
185
195
--error ER_PARSE_ERROR
186
196
create table DATE_ADD (a int);
346
356
 
347
357
# Test coverage with edge conditions
348
358
 
 
359
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
349
360
select pi(3.14);
350
361
 
 
362
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
351
363
select tan();
 
364
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
352
365
select tan(1, 2);
353
366
 
 
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);
356
371
 
 
372
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
 
373
select maketime();
 
374
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
 
375
select maketime(1);
 
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);
 
380
 
 
381
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
357
382
select atan();
 
383
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
358
384
select atan2(1, 2, 3);
359
385
 
 
386
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
360
387
select concat();
361
388
select concat("foo");
362
389
 
 
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");
365
394
 
 
395
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
366
396
select elt();
 
397
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
367
398
select elt(1);
368
399
 
 
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");
373
408
 
 
409
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
374
410
select field();
 
411
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
375
412
select field("p1");
376
413
 
 
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);
379
418
 
 
419
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
380
420
select unix_timestamp(1, 2);
381
421
 
 
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);
384
426
 
 
427
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
385
428
select last_insert_id(1, 2);
386
429
 
 
430
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
387
431
select least();
 
432
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
388
433
select least(12);
389
434
 
 
435
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
390
436
select locate();
 
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);
393
441
 
 
442
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
394
443
select log();
 
444
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
395
445
select log(1, 2, 3);
396
446
 
 
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);
399
451
 
 
452
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
400
453
select rand(1, 2, 3);
401
454
 
 
455
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
402
456
select round(1, 2, 3);
403
457
 
404
458
#
405
459
# Bug#24736: UDF functions parsed as Stored Functions
406
460
#
407
461
 
408
 
# This used to do this:
409
462
# Verify that the syntax for calling UDF : foo(expr AS param, ...)
410
463
# 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.
 
464
 
 
465
# Native function with 1 argument
414
466
 
415
467
select abs(3);
 
468
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
416
469
select abs(3 AS three);
 
470
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
417
471
select abs(3 three);
 
472
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
418
473
select abs(3 AS "three");
 
474
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
419
475
select abs(3 "three");
420
476
 
421
477
# Native function with 2 arguments
519
540
#   atan(10) from 64-bit version returns 1.4711276743037345
520
541
--replace_result 1.4711276743037345 1.4711276743037347
521
542
select atan(10);
 
543
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
522
544
select atan(10 AS p1);
 
545
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
523
546
select atan(10 p1);
 
547
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
524
548
select atan(10 AS "p1");
 
549
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
525
550
select atan(10 "p1");
526
551
 
527
552
select atan(10, 20);
 
553
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
528
554
select atan(10 AS p1, 20);
 
555
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
529
556
select atan(10 p1, 20);
 
557
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
530
558
select atan(10 AS "p1", 20);
 
559
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
531
560
select atan(10 "p1", 20);
 
561
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
532
562
select atan(10, 20 AS p2);
 
563
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
533
564
select atan(10, 20 p2);
 
565
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
534
566
select atan(10, 20 AS "p2");
 
567
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
535
568
select atan(10, 20 "p2");
 
569
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
536
570
select atan(10 AS p1, 20 AS p2);
537
571
 
538
572
#
543
577
DROP TABLE IF EXISTS t1;
544
578
--enable_warnings
545
579
 
 
580
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
 
581
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
546
582
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
547
583
SELECT 1 + INTERVAL(1,0,1,2) + 1;
548
584
SELECT INTERVAL(1,0,1,2) + 1;
570
606
SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2;
571
607
SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)};
572
608
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
609
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
610
SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10;
581
611
SELECT {fn CONCAT(a1,a2)} FROM t1;
582
612
UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;