From 15fc4fa7120a1795c6112f88145fdfa9bc460455 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 20 Apr 2007 07:39:56 +0000 Subject: Can't use SHOW FULL TABLES for MySQl 5.0.0 or earlier. --- framework/Data/Common/Mysql/TMysqlMetaData.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/framework/Data/Common/Mysql/TMysqlMetaData.php b/framework/Data/Common/Mysql/TMysqlMetaData.php index 32d5114f..ca1efaaa 100644 --- a/framework/Data/Common/Mysql/TMysqlMetaData.php +++ b/framework/Data/Common/Mysql/TMysqlMetaData.php @@ -151,6 +151,10 @@ class TMysqlMetaData extends TDbMetaData } /** + * For MySQL version 5.0.1 or later we can use SHOW FULL TABLES + * http://dev.mysql.com/doc/refman/5.0/en/show-tables.html + * + * For MySQL version 5.0.0 or ealier, this always return false. * @param string database name, null to use default connection database. * @param string table or view name. * @return boolean true if is view, false otherwise. @@ -158,6 +162,8 @@ class TMysqlMetaData extends TDbMetaData */ protected function getIsView($schemaName,$tableName) { + if(intval($this->getDbConnection()->getAttribute(PDO::ATTR_SERVER_VERSION))<5) + return false; if($schemaName!==null) $sql = "SHOW FULL TABLES FROM `{$schemaName}` LIKE :table"; else -- cgit v1.2.3