1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge olga.mysql.com:/home/igor/mysql-5.0-opt

into  olga.mysql.com:/home/igor/mysql-5.1-opt
This commit is contained in:
igor@olga.mysql.com
2007-02-13 13:31:23 -08:00
3 changed files with 52 additions and 14 deletions

View File

@ -3098,6 +3098,24 @@ Warnings:
Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` order by `test`.`t1`.`f1`,`test`.`t1`.`f2`
drop view v1;
drop table t1;
CREATE TABLE t1 (
id int(11) NOT NULL PRIMARY KEY,
country varchar(32),
code int(11) default NULL
);
INSERT INTO t1 VALUES
(1,'ITALY',100),(2,'ITALY',200),(3,'FRANCE',100), (4,'ITALY',100);
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT code, COUNT(DISTINCT country) FROM t1 GROUP BY code ORDER BY MAX(id);
code COUNT(DISTINCT country)
200 1
100 2
SELECT code, COUNT(DISTINCT country) FROM v1 GROUP BY code ORDER BY MAX(id);
code COUNT(DISTINCT country)
200 1
100 2
DROP VIEW v1;
DROP TABLE t1;
End of 5.0 tests.
CREATE TABLE t1(id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, val INT UNSIGNED NOT NULL);
CREATE VIEW v1 AS SELECT id, val FROM t1 WHERE val >= 1 AND val <= 5 WITH CHECK OPTION;

View File

@ -748,12 +748,12 @@ drop view v1;
#
# VIEWs with national characters
#
create table t<EFBFBD> (c<EFBFBD> char);
create view v<EFBFBD> as select c<EFBFBD> from t<EFBFBD>;
insert into v<EFBFBD> values ('<EFBFBD>');
select * from v<EFBFBD>;
drop view v<EFBFBD>;
drop table t<EFBFBD>;
create table tü (cü char);
create view vü as select cü from tü;
insert into vü values ('ü');
select * from vü;
drop view vü;
drop table tü;
#
# problem with used_tables() of outer reference resolved in VIEW
@ -3015,6 +3015,26 @@ explain extended select * from v1 order by f1;
drop view v1;
drop table t1;
#
# Bug#26209: queries with GROUP BY and ORDER BY using views
#
CREATE TABLE t1 (
id int(11) NOT NULL PRIMARY KEY,
country varchar(32),
code int(11) default NULL
);
INSERT INTO t1 VALUES
(1,'ITALY',100),(2,'ITALY',200),(3,'FRANCE',100), (4,'ITALY',100);
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT code, COUNT(DISTINCT country) FROM t1 GROUP BY code ORDER BY MAX(id);
SELECT code, COUNT(DISTINCT country) FROM v1 GROUP BY code ORDER BY MAX(id);
DROP VIEW v1;
DROP TABLE t1;
--echo End of 5.0 tests.
# Bug #16813 (WITH CHECK OPTION doesn't work with UPDATE)