summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2007-04-20 07:39:56 +0000
committerwei <>2007-04-20 07:39:56 +0000
commit15fc4fa7120a1795c6112f88145fdfa9bc460455 (patch)
treed0dcd45d46fc250ebc4f72af7b57543d444cc033
parent543fe5e5054c02efab8a9160999711d03ccdf952 (diff)
Can't use SHOW FULL TABLES for MySQl 5.0.0 or earlier.
-rw-r--r--framework/Data/Common/Mysql/TMysqlMetaData.php6
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