| Versionen | |
|---|---|
| drupal7 | protected DatabaseSchema_mysql::buildTableNameCondition($table_name, $operator = '=') |
Build a condition to match a table name against a standard information_schema.
MySQL uses databases like schemas rather than catalogs so when we build a condition to query the information_schema.tables, we set the default database as the schema unless specified otherwise, and exclude table_catalog from the condition criteria.
includes/
<?php
protected function buildTableNameCondition($table_name, $operator = '=') {
$info = Database::getConnectionInfo();
if (strpos($table_name, '.')) {
list($schema, $table_name) = explode('.', $table_name);
}
else {
$schema = $info['default']['database'];
}
$condition = new DatabaseCondition('AND');
$condition->condition('table_schema', $schema);
$condition->condition('table_name', $table_name, $operator);
return $condition;
}
?>
Kommentare
Kommentar hinzufügen