diff options
author | Dan Ungureanu <udan1107@gmail.com> | 2015-06-22 15:24:50 +0300 |
---|---|---|
committer | Dan Ungureanu <udan1107@gmail.com> | 2015-07-10 23:18:13 +0300 |
commit | ffbbf21ef674002eb81c2321a7f7c32d1ef7233a (patch) | |
tree | 54bc5f3468f4a3ebc99877905a80386d7a74db66 | |
parent | e73c7a496737ef2d0e3dbef4d9b1bf2c91ff95d0 (diff) |
Removed dead code.
Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
-rw-r--r-- | libraries/Table.class.php | 49 | ||||
-rw-r--r-- | test/classes/PMA_Table_test.php | 31 |
2 files changed, 0 insertions, 80 deletions
diff --git a/libraries/Table.class.php b/libraries/Table.class.php index d1ec487863..f6eff4c8bb 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -248,55 +248,6 @@ class PMA_Table } /** - * Returns the analysis of 'SHOW CREATE TABLE' query for the table. - * In case of a view, the values are taken from the information_schema. - * - * @param string $db database - * @param string $table table - * - * @return array analysis of 'SHOW CREATE TABLE' query for the table - */ - static public function analyzeStructure($db = null, $table = null) - { - if (empty($db) || empty($table)) { - return false; - } - - $analyzed_sql = array(); - if (self::isView($db, $table)) { - // For a view, 'SHOW CREATE TABLE' returns the definition, - // but the structure of the view. So, we try to mock - // the result of analyzing 'SHOW CREATE TABLE' query. - $analyzed_sql[0] = array(); - $analyzed_sql[0]['create_table_fields'] = array(); - - $results = $GLOBALS['dbi']->fetchResult( - "SELECT COLUMN_NAME, DATA_TYPE - FROM information_schema.COLUMNS - WHERE TABLE_SCHEMA = '" . PMA_Util::sqlAddSlashes($db) . "' - AND TABLE_NAME = '" . PMA_Util::sqlAddSlashes($table) . "'" - ); - - foreach ($results as $result) { - $analyzed_sql[0]['create_table_fields'][$result['COLUMN_NAME']] - = array( - 'type' => /*overload*/mb_strtoupper($result['DATA_TYPE']) - ); - } - } else { - $show_create_table = $GLOBALS['dbi']->fetchValue( - 'SHOW CREATE TABLE ' - . PMA_Util::backquote($db) - . '.' . PMA_Util::backquote($table), - 0, - 1 - ); - $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); - } - return $analyzed_sql; - } - - /** * sets given $value for given $param * * @param string $param name diff --git a/test/classes/PMA_Table_test.php b/test/classes/PMA_Table_test.php index 4005ba508e..1bd637638c 100644 --- a/test/classes/PMA_Table_test.php +++ b/test/classes/PMA_Table_test.php @@ -608,37 +608,6 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase } /** - * Test for analyzeStructure - * - * @return void - */ - public function testAnalyzeStructure() - { - $this->assertEquals( - false, - PMA_Table::analyzeStructure() - ); - - //validate that it is the same as DBI fetchResult - $show_create_table = PMA_Table::analyzeStructure('PMA', 'PMA_BookMark'); - $this->assertEquals( - array('type'=>'DATA_TYPE'), - $show_create_table[0]['create_table_fields']['COLUMN_NAME'] - ); - //not a view - $show_create_table = PMA_Table::analyzeStructure('PMA', 'PMA_BookMark_2'); - $this->assertEquals( - array('type'=>'INT', 'timestamp_not_null'=>false), - $show_create_table[0]['create_table_fields']['id'] - ); - $this->assertEquals( - array('type'=>'TEXT', 'timestamp_not_null'=>false), - $show_create_table[0]['create_table_fields']['username'] - ); - - } - - /** * Test for isMerge * * @return void |