Skip to content

Commit

Permalink
fullTableName needs to check for empty schemaName
Browse files Browse the repository at this point in the history
  • Loading branch information
rchavik committed Dec 29, 2011
1 parent b1aae5b commit 1d333fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/DataSource.php
Expand Up @@ -413,7 +413,7 @@ public function resolveKey(Model $model, $key) {
* @access public
*/
public function getSchemaName() {
return false;
return null;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -930,14 +930,14 @@ public function fullTableName($model, $quote = true, $schema = true) {
}

if ($quote) {
if ($schema && isset($schemaName)) {
if ($schema && !empty($schemaName)) {
if (false == strstr($table, '.')) {
return $this->name($schemaName) . '.' . $this->name($table);
}
}
return $this->name($table);
}
if ($schema && isset($schemaName)) {
if ($schema && !empty($schemaName)) {
if (false == strstr($table, '.')) {
return $schemaName . '.' . $table;
}
Expand Down

0 comments on commit 1d333fd

Please sign in to comment.