~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/t/order_by.test

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
474
474
# Let us also test various ambiguos and potentially ambiguos cases 
475
475
# related to aliases
476
476
#
477
 
--error 1052
 
477
--error ER_NON_UNIQ_ERROR
478
478
select col1 as col, col from t1 order by col;
479
 
--error 1052
480
 
select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2
481
 
  order by col;
482
 
--error 1052
483
 
select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2
484
 
  order by col;
485
 
--error 1052
 
479
--error ER_NON_UNIQ_ERROR
 
480
select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2
 
481
  order by col;
 
482
--error ER_NON_UNIQ_ERROR
 
483
select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2
 
484
  order by col;
 
485
--error ER_NON_UNIQ_ERROR
486
486
select col1 from t1, t2 where t1.col1=t2.col2 order by col;
487
 
--error 1052
 
487
--error ER_NON_UNIQ_ERROR
488
488
select t1.col as t1_col, t2.col2 from t1, t2 where t1.col1=t2.col2
489
489
  order by col;
490
490
 
580
580
SELECT CONCAT('test', a) AS str FROM t1 ORDER BY UPPER(str);
581
581
SELECT a + 1 AS num FROM t1 GROUP BY 30 - num;
582
582
SELECT a + 1 AS num FROM t1 HAVING 30 - num;
583
 
--error 1054
 
583
--error ER_BAD_FIELD_ERROR
584
584
SELECT a + 1 AS num, num + 1 FROM t1;
585
585
SELECT a + 1 AS num, (select num + 2 FROM t1 LIMIT 1) FROM t1;
586
 
--error 1054
 
586
--error ER_BAD_FIELD_ERROR
587
587
SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
588
588
DROP TABLE t1;
589
589
 
594
594
CREATE TABLE bug25126 (
595
595
  val int NOT NULL AUTO_INCREMENT PRIMARY KEY
596
596
);
597
 
--error 1054
 
597
--error ER_BAD_FIELD_ERROR
598
598
UPDATE bug25126 SET MissingCol = MissingCol;
599
 
--error 1054
 
599
--error ER_BAD_FIELD_ERROR
600
600
UPDATE bug25126 SET val = val ORDER BY MissingCol;
601
601
UPDATE bug25126 SET val = val ORDER BY val;
602
602
UPDATE bug25126 SET val = 1 ORDER BY val;
603
 
--error 1054
 
603
--error ER_BAD_FIELD_ERROR
604
604
UPDATE bug25126 SET val = 1 ORDER BY MissingCol;
605
 
--error 1054
 
605
--error ER_BAD_FIELD_ERROR
606
606
UPDATE bug25126 SET val = 1 ORDER BY val, MissingCol;
607
 
--error 1054
 
607
--error ER_BAD_FIELD_ERROR
608
608
UPDATE bug25126 SET val = MissingCol ORDER BY MissingCol;
609
 
--error 1054
 
609
--error ER_BAD_FIELD_ERROR
610
610
UPDATE bug25126 SET MissingCol = 1 ORDER BY val, MissingCol;
611
 
--error 1054
 
611
--error ER_BAD_FIELD_ERROR
612
612
UPDATE bug25126 SET MissingCol = 1 ORDER BY MissingCol;
613
 
--error 1054
 
613
--error ER_BAD_FIELD_ERROR
614
614
UPDATE bug25126 SET MissingCol = val ORDER BY MissingCol;
615
 
--error 1054
 
615
--error ER_BAD_FIELD_ERROR
616
616
UPDATE bug25126 SET MissingCol = MissingCol ORDER BY MissingCol;
617
617
DROP TABLE bug25126;
618
618
 
624
624
CREATE TABLE t1 (a int);
625
625
 
626
626
SELECT p.a AS val, q.a AS val1 FROM t1 p, t1 q ORDER BY val > 1;
627
 
--error 1052
 
627
--error ER_NON_UNIQ_ERROR
628
628
SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val;
629
 
--error 1052
 
629
--error ER_NON_UNIQ_ERROR
630
630
SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1;
631
631
 
632
632
DROP TABLE t1;
742
742
INSERT INTO t1 SELECT a +32, b +32 FROM t1;
743
743
INSERT INTO t1 SELECT a +64, b +64 FROM t1;
744
744
 
 
745
--error ER_KEY_DOES_NOT_EXITS
745
746
SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (a, ab) GROUP BY a;
746
747
 
 
748
SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (primary, ab) GROUP BY a;
 
749
 
747
750
SELECT @tmp_tables_after = @tmp_tables_before ;
748
751
 
 
752
--error ER_KEY_DOES_NOT_EXITS
749
753
SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (a, ab) ORDER BY a;
 
754
SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (primary, ab) ORDER BY a;
750
755
 
751
756
SELECT @tmp_tables_after = @tmp_tables_before;
752
757