~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/parser.test

  • Committer: Stewart Smith
  • Date: 2008-11-21 16:06:07 UTC
  • mto: This revision was merged to the branch mainline in revision 593.
  • Revision ID: stewart@flamingspork.com-20081121160607-n6gdlt013spuo54r
remove mysql_frm_type
and fix engines to return correct value from delete_table when table doesn't exist.
(it should be ENOENT).

Also fix up some tests that manipulated frm files by hand. These tests are no longer valid and will need to be rewritten in the not too distant future.

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
 
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);
 
458
 
 
459
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
400
460
select rand(1, 2, 3);
401
461
 
 
462
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
402
463
select round(1, 2, 3);
403
464
 
 
465
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
 
466
select yearweek();
 
467
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
 
468
select yearweek(1, 2, 3);
 
469
 
404
470
#
405
471
# Bug#24736: UDF functions parsed as Stored Functions
406
472
#
407
473
 
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
411
 
#
412
 
# but that's all nuts, so we allow named parameters now - although the names are
413
 
# currently just ignored.
 
476
 
 
477
# Native function with 1 argument
414
478
 
415
479
select abs(3);
 
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");
420
488
 
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
521
554
select atan(10);
 
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");
526
563
 
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);
537
583
 
538
584
#
543
589
DROP TABLE IF EXISTS t1;
544
590
--enable_warnings
545
591
 
 
592
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
 
593
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
546
594
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
547
595
SELECT 1 + INTERVAL(1,0,1,2) + 1;
548
596
SELECT INTERVAL(1,0,1,2) + 1;
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))};
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
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;