00001 <?php 00002 /* 00003 * $Id: MySQLDatabaseInfo.php,v 1.13 2006/01/17 19:44:39 hlellelid Exp $ 00004 * 00005 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00006 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00007 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00008 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00009 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00010 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00011 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00012 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00013 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00014 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00015 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00016 * 00017 * This software consists of voluntary contributions made by many individuals 00018 * and is licensed under the LGPL. For more information please see 00019 * <http://creole.phpdb.org>. 00020 */ 00021 00022 require_once 'creole/metadata/DatabaseInfo.php'; 00023 00031 class MySQLDatabaseInfo extends DatabaseInfo { 00032 00037 protected function initTables() 00038 { 00039 include_once 'creole/drivers/mysql/metadata/MySQLTableInfo.php'; 00040 // using $this->dblink was causing tests to break 00041 // perhaps dblink is changed by another test ... ? 00042 $result = @mysql_query("SHOW TABLES FROM `" . $this->dbname . "`", $this->conn->getResource()); 00043 00044 if (!$result) { 00045 throw new SQLException("Could not list tables", mysql_error($this->conn->getResource())); 00046 } 00047 00048 while ($row = mysql_fetch_row($result)) { 00049 $this->tables[strtoupper($row[0])] = new MySQLTableInfo($this, $row[0]); 00050 } 00051 00052 $this->tablesLoaded = true; 00053 00054 } 00055 00062 protected function initSequences() 00063 { 00064 // throw new SQLException("MySQL does not support sequences natively."); 00065 } 00066 }