diff options
author | wei <> | 2007-04-20 07:39:56 +0000 |
---|---|---|
committer | wei <> | 2007-04-20 07:39:56 +0000 |
commit | 15fc4fa7120a1795c6112f88145fdfa9bc460455 (patch) | |
tree | d0dcd45d46fc250ebc4f72af7b57543d444cc033 | |
parent | 543fe5e5054c02efab8a9160999711d03ccdf952 (diff) |
Can't use SHOW FULL TABLES for MySQl 5.0.0 or earlier.
-rw-r--r-- | framework/Data/Common/Mysql/TMysqlMetaData.php | 6 |
1 files changed, 6 insertions, 0 deletions
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
|