Fix grabing indexes with MYSQLI_USE_RESULT (bug #1007286).
This commit is contained in:
@@ -7,7 +7,10 @@ $Source$
|
|||||||
|
|
||||||
2004-08-11 Michal Čihař <michal@cihar.com>
|
2004-08-11 Michal Čihař <michal@cihar.com>
|
||||||
* tbl_replace.php: Do not empty protected values (bug #1006812).
|
* tbl_replace.php: Do not empty protected values (bug #1006812).
|
||||||
* libraries/display_tbl.lib.php: Wrong parameters for PMA_DBI_free_result (bug #1007287).
|
* libraries/display_tbl.lib.php: Wrong parameters for PMA_DBI_free_result
|
||||||
|
(bug #1007287).
|
||||||
|
* tbl_indexes.php, libraries/display_tbl.lib.php: Fix grabing indexes with
|
||||||
|
MYSQLI_USE_RESULT (bug #1007286).
|
||||||
|
|
||||||
2004-08-10 Michal Čihař <michal@cihar.com>
|
2004-08-10 Michal Čihař <michal@cihar.com>
|
||||||
* libraries/tbl_change.js: Forcibily use 10 as base for parsed numbers,
|
* libraries/tbl_change.js: Forcibily use 10 as base for parsed numbers,
|
||||||
|
@@ -489,12 +489,18 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|||||||
$sort_expression_nodir = isset($matches[1]) ? trim($matches[1]) : $sort_expression;
|
$sort_expression_nodir = isset($matches[1]) ? trim($matches[1]) : $sort_expression;
|
||||||
|
|
||||||
// grab indexes data:
|
// grab indexes data:
|
||||||
$result = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($table) . ';');
|
if (!defined('PMA_IDX_INCLUDED')) {
|
||||||
$idx_cnt = PMA_DBI_num_rows($result);
|
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
|
||||||
|
$result = PMA_DBI_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
||||||
|
$ret_keys = array();
|
||||||
|
while ($row = PMA_DBI_fetch_assoc($result)) {
|
||||||
|
$ret_keys[] = $row;
|
||||||
|
}
|
||||||
|
PMA_DBI_free_result($result);
|
||||||
|
}
|
||||||
|
|
||||||
$prev_index = '';
|
$prev_index = '';
|
||||||
for ($i = 0; $i < $idx_cnt; $i++) {
|
foreach ($ret_keys as $row) {
|
||||||
$row = (defined('PMA_IDX_INCLUDED') ? $ret_keys[$i] : PMA_DBI_fetch_assoc($result));
|
|
||||||
|
|
||||||
if ($row['Key_name'] != $prev_index ){
|
if ($row['Key_name'] != $prev_index ){
|
||||||
$indexes[] = $row['Key_name'];
|
$indexes[] = $row['Key_name'];
|
||||||
|
@@ -66,17 +66,17 @@ $prev_index = '';
|
|||||||
$indexes_info = array();
|
$indexes_info = array();
|
||||||
$indexes_data = array();
|
$indexes_data = array();
|
||||||
// keys had already been grabbed in "tbl_properties.php"
|
// keys had already been grabbed in "tbl_properties.php"
|
||||||
if (defined('PMA_IDX_INCLUDED')) {
|
if (!defined('PMA_IDX_INCLUDED')) {
|
||||||
$idx_cnt = count($ret_keys);
|
|
||||||
} else {
|
|
||||||
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
|
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
|
||||||
$result = PMA_DBI_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
$result = PMA_DBI_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
||||||
$idx_cnt = PMA_DBI_num_rows($result);
|
$ret_keys = array();
|
||||||
|
while ($row = PMA_DBI_fetch_assoc($result)) {
|
||||||
|
$ret_keys[] = $row;
|
||||||
|
}
|
||||||
|
PMA_DBI_free_result($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i = 0; $i < $idx_cnt; $i++) {
|
foreach ($ret_keys as $row) {
|
||||||
$row = (defined('PMA_IDX_INCLUDED') ? $ret_keys[$i] : PMA_DBI_fetch_assoc($result));
|
|
||||||
|
|
||||||
if ($row['Key_name'] != $prev_index ){
|
if ($row['Key_name'] != $prev_index ){
|
||||||
$indexes[] = $row['Key_name'];
|
$indexes[] = $row['Key_name'];
|
||||||
$prev_index = $row['Key_name'];
|
$prev_index = $row['Key_name'];
|
||||||
@@ -101,12 +101,6 @@ for ($i = 0; $i < $idx_cnt; $i++) {
|
|||||||
}
|
}
|
||||||
} // end while
|
} // end while
|
||||||
|
|
||||||
if (defined('PMA_IDX_INCLUDED')) {
|
|
||||||
unset($ret_keys);
|
|
||||||
} else if ($result) {
|
|
||||||
PMA_DBI_free_result($result);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get fields and stores their name/type
|
// Get fields and stores their name/type
|
||||||
// fields had already been grabbed in "tbl_properties.php"
|
// fields had already been grabbed in "tbl_properties.php"
|
||||||
if (!defined('PMA_IDX_INCLUDED')) {
|
if (!defined('PMA_IDX_INCLUDED')) {
|
||||||
@@ -427,7 +421,7 @@ else if (!defined('PMA_IDX_INCLUDED')
|
|||||||
$drop_link_text = '<nobr>' . $drop_link_text . '</nobr>';
|
$drop_link_text = '<nobr>' . $drop_link_text . '</nobr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($idx_cnt > 0) {
|
if (count($ret_keys) > 0) {
|
||||||
?>
|
?>
|
||||||
<!--table border="<?php echo $cfg['Border']; ?>" cellpadding="2" cellspacing="1"-->
|
<!--table border="<?php echo $cfg['Border']; ?>" cellpadding="2" cellspacing="1"-->
|
||||||
<tr>
|
<tr>
|
||||||
|
Reference in New Issue
Block a user