Skip to content

Commit

Permalink
Move get system tables sql for mysql driver
Browse files Browse the repository at this point in the history
  • Loading branch information
timw4mail committed Apr 16, 2012
1 parent 138e236 commit f6c3e89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
18 changes: 1 addition & 17 deletions drivers/mysql/mysql_driver.php
Expand Up @@ -20,6 +20,7 @@
class MySQL extends DB_PDO {

protected $escape_char = '`';
protected $system_db = 'information_schema';

/**
* Connect to MySQL Database
Expand Down Expand Up @@ -68,23 +69,6 @@ public function truncate($table)

// --------------------------------------------------------------------------

/**
* Returns system tables for the current database
*
* @return array
*/
public function get_system_tables()
{
$sql = 'SELECT `TABLE_NAME` FROM `information_schema`.`TABLES`
WHERE `TABLE_SCHEMA`=\'information_schema\'';

$res = $this->query($sql);

return db_filter($res->fetchAll(PDO::FETCH_ASSOC), 'TABLE_NAME');
}

// --------------------------------------------------------------------------

/**
* Return the number of rows returned for a SELECT query
*
Expand Down
3 changes: 2 additions & 1 deletion drivers/mysql/mysql_sql.php
Expand Up @@ -189,7 +189,8 @@ public function table_list()
*/
public function system_table_list()
{
return FALSE;
return 'SELECT `TABLE_NAME` FROM `information_schema`.`TABLES`
WHERE `TABLE_SCHEMA`=\'information_schema\'';
}

// --------------------------------------------------------------------------
Expand Down

0 comments on commit f6c3e89

Please sign in to comment.