~mathiaz/ubuntu/lucid/mysql-dfsg-5.1/zap-bug-552053

« back to all changes in this revision

Viewing changes to mysql-test/r/view.result

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090625125545-m8ogs96zzsri74xe
Tags: 5.1.34-1ubuntu1
* Merge from debian experimental (and 5.0 from main), remaining changes:
  - debian/mysql-server-5.1.config:
    + ask for MySQL root password at priority high instead of medium so
      that the password prompt is seen on a default install. (LP: #319843)
    + don't ask for root password when upgrading from a 5.0 install.
  - debian/control:
    + Make libmysqlclient16-dev a transitional package depending on
      libmysqlclient-dev.
    + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
    + Don't build mysql-server, mysql-client, mysql-common and
      libmysqlclient15-dev binary packages since they're still provided
      by mysql-dfsg-5.0.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in
      a full MTA on all installs of mysql-server. (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
    + install mysql-test and sql-bench to /usr/share/mysql/ rather than
      /usr/.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    - debian/apparmor-profile: apparmor profile.
    - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
    - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
    - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
      purge.
    - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    - debian/mysql-server-5.1.postinst: reload apparmor profiles.
  - debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.0. Setting the language
    option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
    use a default value that works. (LP: #316974)
  - debian/mysql-server-5.1.mysql.init:
    + Clearly indicate that we do not support running multiple instances
      of mysqld by duplicating the init script.
      (closes: #314785, #324834, #435165, #444216)
    + Properly parameterize all existing references to the mysql config
      file (/etc/mysql/my.cnf).
  - debian/mysql-server-5.0.postinst: Clear out the second password
    when setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package.
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - Don't package sql-bench and mysql-test file.
* Dropped changes:
  - debian/patches/92_ssl_test_cert.dpatch: certificate expiration in
    test suite (LP: #323755). Included upstream.
* Dropped from 5.0:
  - apparmor profile:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6. All version
      of apparmor-profile (>hardy) are higher than this version.
    - debian/mysql-server-5.0.preinst: create symlink for force-complain/
      on pre-feisty upgrades, upgrades where apparmor-profiles profile is
      unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist. Support for pre-hardy upgrades is no longer needed.
* debian/mysql-server-5.1.postinst: fix debian-sys-maint user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1314
1314
drop table t1;
1315
1315
create table t1 (a int, b char(10));
1316
1316
create view v1 as select * from t1 where a != 0 with check option;
1317
 
load data infile '../std_data_ln/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
 
1317
load data infile '../../std_data/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
1318
1318
ERROR HY000: CHECK OPTION failed 'test.v1'
1319
1319
select * from t1;
1320
1320
a       b
1325
1325
1       row 1
1326
1326
2       row 2
1327
1327
delete from t1;
1328
 
load data infile '../std_data_ln/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
 
1328
load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
1329
1329
Warnings:
1330
1330
Warning 1366    Incorrect integer value: 'error      ' for column 'a' at row 3
1331
1331
Error   1369    CHECK OPTION failed 'test.v1'
1345
1345
drop table t1;
1346
1346
create table t1 (a text, b text);
1347
1347
create view v1 as select * from t1 where a <> 'Field A' with check option;
1348
 
load data infile '../std_data_ln/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
 
1348
load data infile '../../std_data/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
1349
1349
ERROR HY000: CHECK OPTION failed 'test.v1'
1350
1350
select concat('|',a,'|'), concat('|',b,'|') from t1;
1351
1351
concat('|',a,'|')       concat('|',b,'|')
1352
1352
select concat('|',a,'|'), concat('|',b,'|') from v1;
1353
1353
concat('|',a,'|')       concat('|',b,'|')
1354
1354
delete from t1;
1355
 
load data infile '../std_data_ln/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
 
1355
load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
1356
1356
Warnings:
1357
1357
Error   1369    CHECK OPTION failed 'test.v1'
1358
1358
Warning 1261    Row 2 doesn't contain data for all columns
1673
1673
INSERT INTO t2 VALUES (6,1,'n');
1674
1674
INSERT INTO t2 VALUES (8,1,'y');
1675
1675
CREATE VIEW v1 AS SELECT * FROM t1;
1676
 
SELECT a.col1,a.col2,b.col2,b.col3 
 
1676
SELECT a.col1,a.col2,b.col2,b.col3
1677
1677
FROM t1 a LEFT JOIN t2 b ON a.col1=b.col1
1678
 
WHERE b.col2 IS NULL OR 
 
1678
WHERE b.col2 IS NULL OR
1679
1679
b.col2=(SELECT MAX(col2) FROM t2 b WHERE b.col1=a.col1);
1680
1680
col1    col2    col2    col3
1681
1681
1       trudy   2       y
1687
1687
7       carsten NULL    NULL
1688
1688
8       ranger  1       y
1689
1689
10      matt    NULL    NULL
1690
 
SELECT a.col1,a.col2,b.col2,b.col3 
 
1690
SELECT a.col1,a.col2,b.col2,b.col3
1691
1691
FROM v1 a LEFT JOIN t2 b ON a.col1=b.col1
1692
 
WHERE b.col2 IS NULL OR 
 
1692
WHERE b.col2 IS NULL OR
1693
1693
b.col2=(SELECT MAX(col2) FROM t2 b WHERE b.col1=a.col1);
1694
1694
col1    col2    col2    col3
1695
1695
1       trudy   2       y
1743
1743
2       2
1744
1744
3       3
1745
1745
create table t3 as select a a,a b from t2;
1746
 
create view v2 as select * from t3 where 
 
1746
create view v2 as select * from t3 where
1747
1747
a in (select * from t1) or b in (select * from t2);
1748
1748
select * from v2 A, v2 B where A.a = B.b;
1749
1749
a       b       a       b
1999
1999
drop view v1;
2000
2000
create table t1 (f59 int, f60 int, f61 int);
2001
2001
insert into t1 values (19,41,32);
2002
 
create view v1 as select f59, f60 from t1 where f59 in  
 
2002
create view v1 as select f59, f60 from t1 where f59 in
2003
2003
(select f59 from t1);
2004
2004
update v1 set f60=2345;
2005
2005
ERROR HY000: The target table v1 of the UPDATE is not updatable
2115
2115
INSERT INTO t1 VALUES(1,'a','b'), (2,'c','d');
2116
2116
INSERT INTO t2 values (1,1), (2,1), (2,2);
2117
2117
CREATE VIEW v1 AS SELECT t1.*,t2.pid FROM t1,t2 WHERE t1.aid = t2.aid;
2118
 
SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2 
 
2118
SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2
2119
2119
WHERE t1.aid = t2.aid GROUP BY pid;
2120
2120
pid     GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1)
2121
2121
1       a b,c d
2217
2217
) engine = InnoDB;
2218
2218
create table t2 (
2219
2219
r_object_id char(16) NOT NULL,
2220
 
i_position int(11) NOT NULL, 
 
2220
i_position int(11) NOT NULL,
2221
2221
users_names varchar(32) default NULL
2222
2222
) Engine = InnoDB;
2223
2223
create view v1 as select r_object_id, group_name from t1;
2230
2230
insert into t2 values('120001a080000542',-1, 'guser01');
2231
2231
insert into t2 values('120001a080000542',-2, 'guser02');
2232
2232
select v1.r_object_id, v2.users_names from v1, v2
2233
 
where (v1.group_name='tstgroup1') and v2.r_object_id=v1.r_object_id 
 
2233
where (v1.group_name='tstgroup1') and v2.r_object_id=v1.r_object_id
2234
2234
order by users_names;
2235
2235
r_object_id     users_names
2236
2236
120001a080000542        guser01
2380
2380
create view v1 as
2381
2381
select t1.x
2382
2382
from (
2383
 
(t1 join t2 on ((t1.y = t2.y))) 
2384
 
join 
 
2383
(t1 join t2 on ((t1.y = t2.y)))
 
2384
join
2385
2385
(t3 left join t4 on (t3.y = t4.y) and (t3.z = t4.z))
2386
2386
);
2387
2387
prepare stmt1 from "select count(*) from v1 where x = ?";
2557
2557
Warning 1052    Column 'x' in group statement is ambiguous
2558
2558
DROP VIEW v1;
2559
2559
DROP TABLE t1;
2560
 
drop table if exists t1; 
2561
 
drop view if exists v1; 
2562
 
create table t1 (id int); 
2563
 
create view v1 as select * from t1; 
2564
 
drop table t1; 
2565
 
show create view v1; 
 
2560
drop table if exists t1;
 
2561
drop view if exists v1;
 
2562
create table t1 (id int);
 
2563
create view v1 as select * from t1;
 
2564
drop table t1;
 
2565
show create view v1;
2566
2566
drop view v1;
2567
2567
//
2568
2568
View    Create View     character_set_client    collation_connection
2609
2609
DROP TABLE t1, t2;
2610
2610
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY,
2611
2611
td date DEFAULT NULL, KEY idx(td));
2612
 
INSERT INTO t1 VALUES 
 
2612
INSERT INTO t1 VALUES
2613
2613
(1, '2005-01-01'), (2, '2005-01-02'), (3, '2005-01-02'),
2614
2614
(4, '2005-01-03'), (5, '2005-01-04'), (6, '2005-01-05'),
2615
2615
(7, '2005-01-05'), (8, '2005-01-05'), (9, '2005-01-06');
2973
2973
drop table t1;
2974
2974
CREATE TABLE t1(pk int PRIMARY KEY);
2975
2975
CREATE TABLE t2(pk int PRIMARY KEY, fk int, ver int, org int);
2976
 
CREATE ALGORITHM=MERGE VIEW v1 AS 
 
2976
CREATE ALGORITHM=MERGE VIEW v1 AS
2977
2977
SELECT t1.*
2978
 
FROM t1 JOIN t2 
2979
 
ON t2.fk = t1.pk AND 
 
2978
FROM t1 JOIN t2
 
2979
ON t2.fk = t1.pk AND
2980
2980
t2.ver = (SELECT MAX(t.ver) FROM t2 t WHERE t.org = t2.org);
2981
2981
SHOW WARNINGS;
2982
2982
Level   Code    Message
3306
3306
INSERT INTO t1 (lid, name) VALUES
3307
3307
(1, 'YES'), (2, 'NO');
3308
3308
CREATE TABLE t2 (
3309
 
id int NOT NULL PRIMARY KEY, 
 
3309
id int NOT NULL PRIMARY KEY,
3310
3310
gid int NOT NULL,
3311
3311
lid int NOT NULL,
3312
3312
dt date
3405
3405
CREATE TABLE t2 (id int, c int DEFAULT 0);
3406
3406
INSERT INTO t1 (id) VALUES (1);
3407
3407
INSERT INTO t2 (id) VALUES (1);
3408
 
CREATE VIEW v1 AS 
3409
 
SELECT t2.c FROM t1, t2 
 
3408
CREATE VIEW v1 AS
 
3409
SELECT t2.c FROM t1, t2
3410
3410
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
3411
3411
UPDATE v1 SET c=1;
3412
3412
DROP VIEW v1;
3514
3514
app_name varchar(40) NOT NULL,
3515
3515
INDEX idx_app_name(app_name)
3516
3516
);
3517
 
CREATE VIEW v1 AS 
 
3517
CREATE VIEW v1 AS
3518
3518
SELECT profile.person_id AS person_id
3519
3519
FROM t1 profile, t2 userrole, t3 role
3520
3520
WHERE userrole.person_id = profile.person_id AND
3526
3526
(-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0');
3527
3527
INSERT INTO t2 VALUES
3528
3528
(1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10);
3529
 
INSERT INTO t3 VALUES 
 
3529
INSERT INTO t3 VALUES
3530
3530
(1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'),
3531
3531
(3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'),
3532
3532
(5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'),
3552
3552
2
3553
3553
3
3554
3554
4
3555
 
select table_name, is_updatable from information_schema.views 
 
3555
select table_name, is_updatable from information_schema.views
3556
3556
where table_name = 'v1';
3557
3557
table_name      is_updatable
3558
3558
v1      NO
3598
3598
DROP VIEW v3;
3599
3599
DROP TABLE t1;
3600
3600
#
3601
 
# Bug#29477: Not all fields of the target table were checked to have
3602
 
#            a default value when inserting into a view.
 
3601
# Bug#29477 Not all fields of the target table were checked to have
 
3602
#           a default value when inserting into a view.
3603
3603
#
3604
3604
create table t1(f1 int, f2 int not null);
3605
3605
create view v1 as select f1 from t1;
3616
3616
create table t1 (a int, key(a));
3617
3617
create table t2 (c int);
3618
3618
create view v1 as select a b from t1;
3619
 
create view v2 as select 1 a from t2, v1 where c in 
 
3619
create view v2 as select 1 a from t2, v1 where c in
3620
3620
(select 1 from t1 where b = a);
3621
3621
insert into t1 values (1), (1);
3622
3622
insert into t2 values (1), (1);
3638
3638
DROP VIEW v1;
3639
3639
DROP TABLE t1;
3640
3640
# -----------------------------------------------------------------
3641
 
# -- Bug#34337: Server crash when Altering a view using a table name.
 
3641
# -- Bug#34337 Server crash when Altering a view using a table name.
3642
3642
# -----------------------------------------------------------------
3643
3643
 
3644
3644
DROP TABLE IF EXISTS t1;
3655
3655
# -- End of test case for Bug#34337.
3656
3656
 
3657
3657
# -----------------------------------------------------------------
3658
 
# -- Bug#35193: VIEW query is rewritten without "FROM DUAL",
3659
 
# --            causing syntax error
 
3658
# -- Bug#35193 VIEW query is rewritten without "FROM DUAL",
 
3659
# --           causing syntax error
3660
3660
# -----------------------------------------------------------------
3661
3661
 
3662
3662
CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1;
3723
3723
USE test;
3724
3724
 
3725
3725
#
3726
 
# Bug#26676: VIEW using old table schema in a session.
 
3726
# Bug#26676 VIEW using old table schema in a session.
3727
3727
#
3728
3728
 
3729
3729
DROP VIEW IF EXISTS v1;
3765
3765
# End of test case for Bug#26676.
3766
3766
 
3767
3767
# -----------------------------------------------------------------
3768
 
# -- Bug#32538: View definition picks up character set, but not collation
 
3768
# -- Bug#32538 View definition picks up character set, but not collation
3769
3769
# -----------------------------------------------------------------
3770
3770
 
3771
3771
DROP VIEW IF EXISTS v1;