~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to mysql-test/t/merge.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120222223355-or06x1euyk8n0ldi
Tags: 5.1.61-0ubuntu0.10.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496
* Dropped patches unnecessary with 5.1.61:
  - debian/patches/90_mysql_safer_strmov.dpatch
  - debian/patches/51_ssl_test_certs.dpatch
  - debian/patches/52_CVE-2009-4030.dpatch
  - debian/patches/53_CVE-2009-4484.dpatch
  - debian/patches/54_CVE-2008-7247.dpatch
  - debian/patches/55_CVE-2010-1621.dpatch
  - debian/patches/56_CVE-2010-1850.dpatch
  - debian/patches/57_CVE-2010-1849.dpatch
  - debian/patches/58_CVE-2010-1848.dpatch
  - debian/patches/59_CVE-2010-1626.dpatch
  - debian/patches/60_CVE-2010-2008.dpatch
  - debian/patches/60_CVE-2010-3677.dpatch
  - debian/patches/60_CVE-2010-3678.dpatch
  - debian/patches/60_CVE-2010-3679.dpatch
  - debian/patches/60_CVE-2010-3680.dpatch
  - debian/patches/60_CVE-2010-3681.dpatch
  - debian/patches/60_CVE-2010-3682.dpatch
  - debian/patches/60_CVE-2010-3683.dpatch
  - debian/patches/60_CVE-2010-3833.dpatch
  - debian/patches/60_CVE-2010-3834.dpatch
  - debian/patches/60_CVE-2010-3835.dpatch
  - debian/patches/60_CVE-2010-3836.dpatch
  - debian/patches/60_CVE-2010-3837.dpatch
  - debian/patches/60_CVE-2010-3838.dpatch
  - debian/patches/60_CVE-2010-3839.dpatch
  - debian/patches/60_CVE-2010-3840.dpatch
  - debian/patches/61_disable_longfilename_test.dpatch
  - debian/patches/62_alter_table_fix.dpatch
  - debian/patches/63_cherrypick-upstream-49479.dpatch
  - debian/patches/10_readline_build_fix.dpatch
* debian/mysql-client-5.1.docs: removed EXCEPTIONS-CLIENT file
* debian/mysql-server-5.1.docs,debian/libmysqlclient16.docs,
  debian/libmysqlclient-dev.docs: removed, no longer necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
drop database if exists mysqltest;
8
8
--enable_warnings
9
9
 
 
10
let $MYSQLD_DATADIR= `select @@datadir`;
 
11
 
10
12
create table t1 (a int not null primary key auto_increment, message char(20));
11
13
create table t2 (a int not null primary key auto_increment, message char(20));
12
14
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("t1");
1633
1635
DROP TRIGGER tr1;
1634
1636
DROP TABLE t1, t2, t3;
1635
1637
 
 
1638
--echo #
 
1639
--echo # BUG#48265 - MRG_MYISAM problem (works in 5.0.85, does't work in 5.1.40)
 
1640
--echo #
 
1641
CREATE DATABASE `test/1`;
 
1642
 
 
1643
CREATE TABLE `test/1`.`t/1`(a INT);
 
1644
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
 
1645
SELECT * FROM m1;
 
1646
SHOW CREATE TABLE m1;
 
1647
DROP TABLE m1;
 
1648
 
 
1649
CREATE TABLE `test/1`.m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
 
1650
SELECT * FROM `test/1`.m1;
 
1651
SHOW CREATE TABLE `test/1`.m1;
 
1652
DROP TABLE `test/1`.m1;
 
1653
DROP TABLE `test/1`.`t/1`;
 
1654
 
 
1655
CREATE TEMPORARY TABLE `test/1`.`t/1`(a INT);
 
1656
CREATE TEMPORARY TABLE m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
 
1657
SELECT * FROM m1;
 
1658
SHOW CREATE TABLE m1;
 
1659
DROP TABLE m1;
 
1660
 
 
1661
CREATE TEMPORARY TABLE `test/1`.m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
 
1662
SELECT * FROM `test/1`.m1;
 
1663
SHOW CREATE TABLE `test/1`.m1;
 
1664
DROP TABLE `test/1`.m1;
 
1665
DROP TABLE `test/1`.`t/1`;
 
1666
 
 
1667
DROP DATABASE `test/1`;
 
1668
 
 
1669
# Test compatibility. Use '@' instead of '/' (was not allowed in 5.0)
 
1670
 
 
1671
CREATE TABLE `t@1`(a INT);
 
1672
copy_file std_data/bug48265.frm $MYSQLD_DATADIR/test/m1.frm;
 
1673
write_file $MYSQLD_DATADIR/test/m1.MRG;
 
1674
t@1
 
1675
EOF
 
1676
SELECT * FROM m1;
 
1677
SHOW CREATE TABLE m1;
 
1678
DROP TABLE `t@1`;
 
1679
 
 
1680
CREATE DATABASE `test@1`;
 
1681
CREATE TABLE `test@1`.`t@1`(a INT);
 
1682
FLUSH TABLE m1;
 
1683
remove_file $MYSQLD_DATADIR/test/m1.MRG;
 
1684
write_file $MYSQLD_DATADIR/test/m1.MRG;
 
1685
./test@1/t@1
 
1686
EOF
 
1687
SELECT * FROM m1;
 
1688
SHOW CREATE TABLE m1;
 
1689
DROP TABLE m1;
 
1690
DROP TABLE `test@1`.`t@1`;
 
1691
DROP DATABASE `test@1`;
 
1692
 
 
1693
--echo #
 
1694
--echo # Bug#51494c rash with join, explain and 'sounds like' operator
 
1695
--echo #
 
1696
 
 
1697
CREATE TABLE t1 (a INT) ENGINE=MYISAM;
 
1698
INSERT INTO t1 VALUES(1);
 
1699
 
 
1700
CREATE TABLE t2 (b INT NOT NULL,c INT,d INT,e BLOB NOT NULL,
 
1701
KEY idx0 (d, c)) ENGINE=MERGE;
 
1702
 
 
1703
EXPLAIN SELECT * FROM t1 NATURAL RIGHT JOIN
 
1704
t2 WHERE b SOUNDS LIKE e AND d = 1;
 
1705
 
 
1706
DROP TABLE t2, t1;
 
1707
 
 
1708
--echo #
 
1709
--echo # Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
 
1710
--echo #
 
1711
--disable_warnings
 
1712
DROP TABLE IF EXISTS m1, t1;
 
1713
--enable_warnings
 
1714
#
 
1715
# Test derived from a proposal of Shane Bester.
 
1716
#
 
1717
CREATE TABLE t1 (c1 INT) ENGINE=MYISAM;
 
1718
CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1) INSERT_METHOD=LAST;
 
1719
#
 
1720
# REPAIR ... USE_FRM with LOCK TABLES.
 
1721
#
 
1722
LOCK TABLE m1 READ;
 
1723
REPAIR TABLE m1 USE_FRM;
 
1724
UNLOCK TABLES;
 
1725
#
 
1726
# REPAIR ... USE_FRM without LOCK TABLES.
 
1727
#
 
1728
# This statement crashed the server (Bug#46339).
 
1729
#
 
1730
REPAIR TABLE m1 USE_FRM;
 
1731
#
 
1732
DROP TABLE m1,t1;
 
1733
#
 
1734
# Test derived from a proposal of Matthias Leich.
 
1735
#
 
1736
# Base table is missing.
 
1737
#
 
1738
CREATE TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
 
1739
#
 
1740
# This statement crashed the server (Bug#46339).
 
1741
#
 
1742
REPAIR TABLE m1 USE_FRM;
 
1743
#
 
1744
# Create base table.
 
1745
#
 
1746
CREATE TABLE t1 (f1 BIGINT) ENGINE = MyISAM;
 
1747
#
 
1748
# This statement crashed the server (Bug#46339).
 
1749
#
 
1750
REPAIR TABLE m1 USE_FRM;
 
1751
#
 
1752
# Normal repair as reference.
 
1753
#
 
1754
REPAIR TABLE m1;
 
1755
#
 
1756
# Cleanup.
 
1757
#
 
1758
DROP TABLE m1, t1;
 
1759
#
 
1760
# Same with temporary tables.
 
1761
#
 
1762
# Base table is missing.
 
1763
#
 
1764
CREATE TEMPORARY TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
 
1765
#
 
1766
# This statement crashed the server (Bug#46339).
 
1767
#
 
1768
REPAIR TABLE m1 USE_FRM;
 
1769
#
 
1770
# Create base table.
 
1771
#
 
1772
CREATE TEMPORARY TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
 
1773
#
 
1774
# This statement crashed the server (Bug#46339).
 
1775
#
 
1776
REPAIR TABLE m1 USE_FRM;
 
1777
#
 
1778
# Normal repair as reference.
 
1779
#
 
1780
REPAIR TABLE m1;
 
1781
#
 
1782
# Cleanup.
 
1783
#
 
1784
DROP TABLE m1, t1;
 
1785
 
 
1786
 
 
1787
--echo #
 
1788
--echo # BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD
 
1789
--echo #                       CRASHES SERVER
 
1790
--echo #
 
1791
CREATE TABLE t1(a INT);
 
1792
CREATE TABLE t2(a INT);
 
1793
CREATE TABLE t3(a INT, b INT);
 
1794
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
 
1795
 
 
1796
--echo # Test reopen merge parent failure
 
1797
LOCK TABLES m1 READ;
 
1798
--echo # Remove 'm1' table using file operations.
 
1799
remove_file $MYSQLD_DATADIR/test/m1.MRG;
 
1800
remove_file $MYSQLD_DATADIR/test/m1.frm;
 
1801
--error ER_NO_SUCH_TABLE
 
1802
FLUSH TABLES;
 
1803
UNLOCK TABLES;
 
1804
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
 
1805
 
 
1806
--echo # Test reopen merge child failure
 
1807
LOCK TABLES m1 READ;
 
1808
--echo # Remove 't1' table using file operations.
 
1809
remove_file $MYSQLD_DATADIR/test/t1.frm;
 
1810
remove_file $MYSQLD_DATADIR/test/t1.MYI;
 
1811
remove_file $MYSQLD_DATADIR/test/t1.MYD;
 
1812
--error ER_NO_SUCH_TABLE
 
1813
FLUSH TABLES;
 
1814
UNLOCK TABLES;
 
1815
CREATE TABLE t1(a INT);
 
1816
 
 
1817
--echo # Test reattach merge failure
 
1818
LOCK TABLES m1 READ;
 
1819
--echo # Replace 't1' with 't3' table using file operations.
 
1820
# move + remove is a work around for windows.
 
1821
move_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/oldt1.frm;
 
1822
move_file $MYSQLD_DATADIR/test/t1.MYI $MYSQLD_DATADIR/test/oldt1.MYI;
 
1823
move_file $MYSQLD_DATADIR/test/t1.MYD $MYSQLD_DATADIR/test/oldt1.MYD;
 
1824
remove_file $MYSQLD_DATADIR/test/oldt1.frm;
 
1825
remove_file $MYSQLD_DATADIR/test/oldt1.MYI;
 
1826
remove_file $MYSQLD_DATADIR/test/oldt1.MYD;
 
1827
copy_file $MYSQLD_DATADIR/test/t3.frm $MYSQLD_DATADIR/test/t1.frm;
 
1828
copy_file $MYSQLD_DATADIR/test/t3.MYI $MYSQLD_DATADIR/test/t1.MYI;
 
1829
copy_file $MYSQLD_DATADIR/test/t3.MYD $MYSQLD_DATADIR/test/t1.MYD;
 
1830
--error ER_CANT_REOPEN_TABLE
 
1831
FLUSH TABLES;
 
1832
UNLOCK TABLES;
 
1833
DROP TABLE t1, t2, t3, m1;
 
1834
 
1636
1835
--echo End of 5.1 tests