Commit b4751a93 authored by unknown's avatar unknown
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into neptunus.(none):/home/msvensson/mysql/mysql-5.0

parents a58edfc5 d81f0574
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -555,3 +555,25 @@ IFNULL(a, 'TEST') COALESCE(b, 'TEST')
4	TEST
TEST	TEST
DROP TABLE t1,t2;
CREATE TABLE t1(id int, type char(1));
INSERT INTO t1 VALUES
(1,"A"),(2,"C"),(3,"A"),(4,"A"),(5,"B"),
(6,"B"),(7,"A"),(8,"C"),(9,"A"),(10,"C");
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT type FROM t1 GROUP BY type WITH ROLLUP;
type
A
B
C
NULL
SELECT type FROM v1 GROUP BY type WITH ROLLUP;
type
A
B
C
NULL
EXPLAIN SELECT type FROM v1 GROUP BY type WITH ROLLUP;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	10	Using filesort
DROP VIEW v1;
DROP TABLE t1;
+1 −1
Original line number Diff line number Diff line
@@ -1563,7 +1563,7 @@ one 1025,2025,3025
two	1050,1050
select col1,group_concat(col2,col3) from v1 group by col1;
col1	group_concat(col2,col3)
two	1025,2025,3025
one	1025,2025,3025
two	1050,1050
drop view v1;
drop table t1;
+16 −0
Original line number Diff line number Diff line
@@ -250,3 +250,19 @@ SELECT IFNULL(a, 'TEST'), COALESCE(b, 'TEST') FROM t2

DROP TABLE t1,t2;

#
# Tests for bug #11639: ROLLUP over view executed through filesort
#

CREATE TABLE t1(id int, type char(1));
INSERT INTO t1 VALUES
  (1,"A"),(2,"C"),(3,"A"),(4,"A"),(5,"B"),
  (6,"B"),(7,"A"),(8,"C"),(9,"A"),(10,"C");
CREATE VIEW v1 AS SELECT * FROM t1;

SELECT type FROM t1 GROUP BY type WITH ROLLUP;
SELECT type FROM v1 GROUP BY type WITH ROLLUP;
EXPLAIN SELECT type FROM v1 GROUP BY type WITH ROLLUP;

DROP VIEW v1;
DROP TABLE t1;
+4 −1
Original line number Diff line number Diff line
@@ -1440,7 +1440,10 @@ class Item_ref :public Item_ident
    :Item_ident(thd, item), result_field(item->result_field), ref(item->ref) {}
  enum Type type() const		{ return REF_ITEM; }
  bool eq(const Item *item, bool binary_cmp) const
  { return ref && (*ref)->eq(item, binary_cmp); }
  { 
    Item *it= ((Item *) item)->real_item();
    return ref && (*ref)->eq(it, binary_cmp);
  }
  double val_real();
  longlong val_int();
  my_decimal *val_decimal(my_decimal *);
+1 −0
Original line number Diff line number Diff line
@@ -2447,6 +2447,7 @@ Prepared_statement::~Prepared_statement()
  if (cursor)
    cursor->Cursor::~Cursor();
  free_items();
  free_root(cursor->mem_root, MYF(0));
  delete lex->result;
}

Loading