Added a filter for 'CREATE TABLE IF NOT EXISTS'

git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@545542 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
hawk__
2012-05-17 20:13:57 +00:00
parent b2c7c3e662
commit 70b7af7142

View File

@@ -169,6 +169,7 @@ WHERE pg_class.relname='$table_name' AND pg_attribute.attnum>=1 AND NOT pg_attri
elseif( 0 === strpos($sql, 'CREATE TABLE'))
{
$logto = 'CREATE';
$sql = str_replace( 'CREATE TABLE IF NOT EXISTS ', 'CREATE TABLE ', $sql);
$pattern = '/CREATE TABLE [`]?(\w+)[`]?/';
preg_match($pattern, $sql, $matches);
$table = $matches[1];