Skip to content

Commit

Permalink
Simplified describe table
Browse files Browse the repository at this point in the history
  • Loading branch information
joanhey committed Mar 21, 2018
1 parent 373f279 commit 67a15c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/libs/db/adapters/firebird.php
Expand Up @@ -501,11 +501,11 @@ public function list_tables()
*/
public function describe_table($table, $schema = '')
{
if ($schema == '') {
return $this->fetch_all("DESCRIBE $table");
if ($schema) {
return $this->fetch_all("DESCRIBE $schema.$table");
}

return $this->fetch_all("DESCRIBE $schema.$table");
return $this->fetch_all("DESCRIBE $table");
}

/**
Expand Down
6 changes: 3 additions & 3 deletions core/libs/db/adapters/mysql.php
Expand Up @@ -448,11 +448,11 @@ public function list_tables()
*/
public function describe_table($table, $schema = '')
{
if ($schema == '') {
return $this->fetch_all("DESCRIBE `$table`");
if ($schema) {
return $this->fetch_all("DESCRIBE `$schema`.`$table`");
}

return $this->fetch_all("DESCRIBE `$schema`.`$table`");
return $this->fetch_all("DESCRIBE `$schema`");
}

/**
Expand Down

0 comments on commit 67a15c1

Please sign in to comment.