原因是内部有此代码dbDelta()
:
// Create a tablename index for an array ($cqueries) of queries.
foreach ( $queries as $qry ) {
if ( preg_match( \'|CREATE TABLE ([^ ]*)|\', $qry, $matches ) ) {
$cqueries[ trim( $matches[1], \'`\' ) ] = $qry;
$for_update[ $matches[1] ] = \'Created table \' . $matches[1];
} elseif ( preg_match( \'|CREATE DATABASE ([^ ]*)|\', $qry, $matches ) ) {
array_unshift( $cqueries, $qry );
} elseif ( preg_match( \'|INSERT INTO ([^ ]*)|\', $qry, $matches ) ) {
$iqueries[] = $qry;
} elseif ( preg_match( \'|UPDATE ([^ ]*)|\', $qry, $matches ) ) {
$iqueries[] = $qry;
} else {
// Unrecognized query type.
}
}
ths功能
dbDelta()
不支持“替换为”,并且在
else
具有
// Unrecognized query type.
议论