~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-proposed

« back to all changes in this revision

Viewing changes to mysql-test/suite/federated/federated_bug_35333.result

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.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

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Bug 35333 "If a Federated table can't connect to the remote hose, can't retrieve metadata"
 
3
#
 
4
# Queries such as SHOW TABLE STATUS and SELECT * FROM INFORMATION_SCHEMA.TABLES fail
 
5
# when encountering a federated table that cannot connect to its remote table.
 
6
#
 
7
# The fix is to store the error text in the TABLE COMMENTS column of I_S.TABLES, clear
 
8
# the remote connection error and push a warning instead. This allows the SELECT operation
 
9
# to complete while still indicating a problem. This fix applies to any non-fatal system
 
10
# error that occurs during a query against I_S.TABLES.de
 
11
CREATE DATABASE federated;
 
12
CREATE DATABASE federated;
 
13
CREATE DATABASE IF NOT EXISTS realdb;
 
14
DROP TABLE IF EXISTS realdb.t0;
 
15
DROP TABLE IF EXISTS federated.t0;
 
16
#
 
17
# Create the base table to be referenced
 
18
#
 
19
CREATE TABLE realdb.t0 (a text, b text) ENGINE=MYISAM;
 
20
#
 
21
# Create a federated table with a bogus port number
 
22
#
 
23
CREATE TABLE federated.t0 (a text, b text) ENGINE=FEDERATED
 
24
CONNECTION='mysql://root@127.0.0.1:63333/realdb/t0';
 
25
#
 
26
# Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query
 
27
#
 
28
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
 
29
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'realdb' or TABLE_SCHEMA = 'federated';
 
30
TABLE_SCHEMA    TABLE_NAME      TABLE_TYPE      ENGINE  ROW_FORMAT      TABLE_ROWS      DATA_LENGTH     TABLE_COMMENT
 
31
federated       t0      BASE TABLE      FEDERATED               NULL    0       Unable to connect to foreign data source: Can't connect to MySQL server on '127.
 
32
realdb  t0      BASE TABLE      MyISAM  Dynamic 0       0       
 
33
Warnings:
 
34
Warning 1429    Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno)
 
35
SHOW WARNINGS;
 
36
Level   Code    Message
 
37
Warning 1429    Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno)
 
38
#
 
39
# Create a MyISAM table then corrupt the file
 
40
#
 
41
USE realdb;
 
42
CREATE TABLE t1 (c1 int) ENGINE=MYISAM;
 
43
#
 
44
# Corrupt the MyISAM table by deleting the base file
 
45
#
 
46
#
 
47
# Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query
 
48
#
 
49
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
 
50
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
 
51
TABLE_SCHEMA    TABLE_NAME      TABLE_TYPE      ENGINE  ROW_FORMAT      TABLE_ROWS      DATA_LENGTH     TABLE_COMMENT
 
52
realdb  t1      BASE TABLE      NULL    NULL    NULL    NULL    Can't find file: 't1' (errno: 2)
 
53
Warnings:
 
54
Warning 1017    Can't find file: 't1' (errno: 2)
 
55
SHOW WARNINGS;
 
56
Level   Code    Message
 
57
Warning 1017    Can't find file: 't1' (errno: 2)
 
58
#
 
59
# Cleanup
 
60
#
 
61
DROP TABLE IF EXISTS realdb.t0;
 
62
DROP TABLE IF EXISTS federated.t0;
 
63
DROP DATABASE realdb;
 
64
DROP TABLE IF EXISTS federated.t1;
 
65
DROP DATABASE federated;
 
66
DROP TABLE IF EXISTS federated.t1;
 
67
DROP DATABASE federated;