The branch, master has been updated via f64de0a3ead27c07b99231097bc226f8de4f9048 (commit) via fe53e42d1dfff53967ef5c3d6930b1bd9ac4b428 (commit) from da8521c9b181199b21555488e20f237b0eae3ad3 (commit)
- Log ----------------------------------------------------------------- commit f64de0a3ead27c07b99231097bc226f8de4f9048 Author: Dieter Adriaenssens ruleant@users.sourceforge.net Date: Fri May 20 23:21:11 2011 +0200
Remove deprecated function PMA_DBI_get_fields
commit fe53e42d1dfff53967ef5c3d6930b1bd9ac4b428 Author: Piotr Przybylski piotrprz@gmail.com Date: Wed May 18 20:49:04 2011 +0200
Remove deprecated function PMA_DBI_get_fields
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + db_qbe.php | 2 +- libraries/database_interface.lib.php | 23 ----------------------- libraries/import/csv.php | 2 +- libraries/relation.lib.php | 6 +++--- libraries/replication_gui.lib.php | 2 +- libraries/server_synchronize.lib.php | 10 +++++----- server_privileges.php | 2 +- tbl_indexes.php | 2 +- 9 files changed, 14 insertions(+), 36 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 2219ea4..d2da49e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ + Update to jQuery 1.6.1 + Patch #3256122 [search] Show/hide db search results + Patch #3302354 Add gettext wrappers around a message ++ Remove deprecated function PMA_DBI_get_fields
3.4.2.0 (not yet released) - bug #3301249 [interface] Iconic table operations does not remove inline edit label diff --git a/db_qbe.php b/db_qbe.php index 34c85ee..a076798 100644 --- a/db_qbe.php +++ b/db_qbe.php @@ -105,7 +105,7 @@ if (0 == $tbl_result_cnt) {
// The tables list gets from MySQL while (list($tbl) = PMA_DBI_fetch_row($tbl_result)) { - $fld_results = PMA_DBI_get_fields($db, $tbl); + $fld_results = PMA_DBI_get_columns($db, $tbl, true);
if (empty($tbl_names[$tbl]) && !empty($_REQUEST['TableList'])) { $tbl_names[$tbl] = ''; diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index be8d9f5..9735a82 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -775,29 +775,6 @@ function PMA_DBI_get_columns_full($database = null, $table = null, }
/** - * @todo should only return columns names, for more info use PMA_DBI_get_columns_full() - * - * @deprecated by PMA_DBI_get_columns() or PMA_DBI_get_columns_full() - * @param string $database name of database - * @param string $table name of table to retrieve columns from - * @param mixed $link mysql link resource - * @return array column info - */ -function PMA_DBI_get_fields($database, $table, $link = null) -{ - // here we use a try_query because when coming from - // tbl_create + tbl_properties.inc.php, the table does not exist - $fields = PMA_DBI_fetch_result( - 'SHOW FULL COLUMNS - FROM ' . PMA_backquote($database) . '.' . PMA_backquote($table), - null, null, $link); - if (! is_array($fields) || count($fields) < 1) { - return false; - } - return $fields; -} - -/** * array PMA_DBI_get_columns(string $database, string $table, bool $full = false, mysql db link $link = null) * * @param string $database name of database diff --git a/libraries/import/csv.php b/libraries/import/csv.php index aaff1b1..757e3b4 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -106,7 +106,7 @@ if (!$analyze) { } $sql_template .= ' INTO ' . PMA_backquote($table);
- $tmp_fields = PMA_DBI_get_fields($db, $table); + $tmp_fields = PMA_DBI_get_columns($db, $table);
if (empty($csv_columns)) { $fields = $tmp_fields; diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 9588853..338f833 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -517,7 +517,7 @@ function PMA_getDisplayField($db, $table) * Gets the comments for all rows of a table or the db itself * * @access public - * @uses PMA_DBI_get_fields() + * @uses PMA_DBI_get_columns() * @uses PMA_getDbComment() * @param string the name of the db to check for * @param string the name of the table to check for @@ -529,9 +529,9 @@ function PMA_getComments($db, $table = '')
if ($table != '') { // MySQL native column comments - $fields = PMA_DBI_get_fields($db, $table); + $fields = PMA_DBI_get_columns($db, $table); if ($fields) { - foreach ($fields as $key => $field) { + foreach ($fields as $field) { if (! empty($field['Comment'])) { $comments[$field['Field']] = $field['Comment']; } diff --git a/libraries/replication_gui.lib.php b/libraries/replication_gui.lib.php index d64e5f4..1d99166 100644 --- a/libraries/replication_gui.lib.php +++ b/libraries/replication_gui.lib.php @@ -204,7 +204,7 @@ function PMA_replication_print_slaves_table($hidden = false) { */
function PMA_replication_get_username_hostname_length() { - $fields_info = PMA_DBI_get_fields('mysql', 'user'); + $fields_info = PMA_DBI_get_columns('mysql', 'user'); $username_length = 16; $hostname_length = 41; foreach ($fields_info as $key => $val) { diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php index ba6f813..aca007f 100644 --- a/libraries/server_synchronize.lib.php +++ b/libraries/server_synchronize.lib.php @@ -68,7 +68,7 @@ function PMA_getNonMatchingTargetTables($trg_tables, $matching_tables, &$uncommo * If update is required, it is placed in $update_array * Otherwise that entry is placed in the $insert_array. * - * @uses PMA_DBI_get_fields() + * @uses PMA_DBI_get_columns() * @uses PMA_DBI_get_column_values() * @uses PMA_DBI_fetch_result() * @@ -95,7 +95,7 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching { if (isset($matching_table[$matching_table_index])) { $fld = array(); - $fld_results = PMA_DBI_get_fields($src_db, $matching_table[$matching_table_index], $src_link); + $fld_results = PMA_DBI_get_columns($src_db, $matching_table[$matching_table_index], true, $src_link); $is_key = array(); if (isset($fld_results)) { foreach ($fld_results as $each_field) { @@ -113,7 +113,7 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching $source_result_set = PMA_DBI_get_column_values($src_db, $matching_table[$matching_table_index], $is_key, $src_link); $source_size = sizeof($source_result_set);
- $trg_fld_results = PMA_DBI_get_fields($trg_db, $matching_table[$matching_table_index], $trg_link); + $trg_fld_results = PMA_DBI_get_columns($trg_db, $matching_table[$matching_table_index], true, $trg_link); $all_keys_match = true; $trg_keys = array();
@@ -597,7 +597,7 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link, /** * PMA_createTargetTables() Create the missing table $uncommon_table in target database * -* @uses PMA_DBI_get_fields() +* @uses PMA_DBI_get_columns() * @uses PMA_backquote() * @uses PMA_DBI_fetch_result() * @@ -613,7 +613,7 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link, function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncommon_tables, $table_index, &$uncommon_tables_fields, $display) { if (isset($uncommon_tables[$table_index])) { - $fields_result = PMA_DBI_get_fields($src_db, $uncommon_tables[$table_index], $src_link); + $fields_result = PMA_DBI_get_columns($src_db, $uncommon_tables[$table_index], true, $src_link); $fields = array(); foreach ($fields_result as $each_field) { $field_name = $each_field['Field']; diff --git a/server_privileges.php b/server_privileges.php index e2a930e..1407fdf 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -663,7 +663,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE) function PMA_displayLoginInformationFields($mode = 'new') { // Get user/host name lengths - $fields_info = PMA_DBI_get_fields('mysql', 'user'); + $fields_info = PMA_DBI_get_columns('mysql', 'user', true); $username_length = 16; $hostname_length = 41; foreach ($fields_info as $key => $val) { diff --git a/tbl_indexes.php b/tbl_indexes.php index 46e5e1c..5fcfee9 100644 --- a/tbl_indexes.php +++ b/tbl_indexes.php @@ -15,7 +15,7 @@ require_once './libraries/tbl_common.php';
// Get fields and stores their name/type $fields = array(); -foreach (PMA_DBI_get_fields($db, $table) as $row) { +foreach (PMA_DBI_get_columns($db, $table) as $row) { if (preg_match('@^(set|enum)((.+))$@i', $row['Type'], $tmp)) { $tmp[2] = substr(preg_replace('@([^,])''@', '\1\'', ',' . $tmp[2]), 1);
hooks/post-receive