first bug in db_details_qbe

This commit is contained in:
Mike Beck
2002-09-19 07:55:05 +00:00
parent 4061729f5c
commit 2f66c315e4

View File

@@ -776,7 +776,7 @@ if (isset($Field) && count($Field) > 0) {
if (substr($Criteria[$x],0,1) == '=' || eregi('is',$Criteria[$x])) { if (substr($Criteria[$x],0,1) == '=' || eregi('is',$Criteria[$x])) {
$col_where[$_col] = $_col; $col_where[$_col] = $_col;
$tab_where[$_tab] = $_tab; $tab_where[$_tab] = $_tab;
//echo "new Whereclause:".$_tab."\n"; // echo "new Whereclause:".$_tab."\n";
} }
} }
} }
@@ -786,14 +786,14 @@ if (isset($Field) && count($Field) > 0) {
unset($_tab_raw,$_col_raw); unset($_tab_raw,$_col_raw);
if (count($col_where) == 1) { if (count($tab_where) == 1) {
// if there is exactly one column that has a decent where-clause // if there is exactly one column that has a decent where-clause
// we will just use this // we will just use this
$master = $col_where[0]; $master = key($tab_where);
//echo "nur ein where: master =".$master . "\n"; // echo "nur ein where: master =".$master . "\n";
} else { } else {
// now let's find out which of the tables has an index // now let's find out which of the tables has an index
//echo "pr<70>fe indexe:\n"; // echo "pr<70>fe indexe:\n";
while (list(, $_tab) = each($tab_all)) { while (list(, $_tab) = each($tab_all)) {
$ind_qry = 'SHOW INDEX FROM ' . PMA_backquote($_tab); $ind_qry = 'SHOW INDEX FROM ' . PMA_backquote($_tab);
$ind_rs = PMA_mysql_query($ind_qry); $ind_rs = PMA_mysql_query($ind_qry);
@@ -821,20 +821,20 @@ if (isset($Field) && count($Field) > 0) {
// now we want to find the best. // now we want to find the best.
if (isset($col_unique) && count($col_unique)>0) { if (isset($col_unique) && count($col_unique)>0) {
$col_cand = $col_unique; $col_cand = $col_unique;
//echo "Kandidaten sind jetzt alle mit unique index\n"; // echo "Kandidaten sind jetzt alle mit unique index\n";
$_needsort= 1; $_needsort= 1;
} elseif (isset($col_index) && count($col_index) > 0) { } elseif (isset($col_index) && count($col_index) > 0) {
$col_cand = $col_index; $col_cand = $col_index;
$_needsort= 1; $_needsort= 1;
//echo "Kandidaten sind jetzt alle mit index\n"; // echo "Kandidaten sind jetzt alle mit index\n";
} elseif (isset($col_where) && count($col_where) > 0) { } elseif (isset($col_where) && count($col_where) > 0) {
$col_cand = $tab_where; $col_cand = $tab_where;
//echo "Kandidaten sind jetzt alle im whereclause\n"; // echo "Kandidaten sind jetzt alle im whereclause\n";
$_needsort= 0; $_needsort= 0;
} else { } else {
$col_cand = $tab_all; $col_cand = $tab_all;
$_needsort= 0; $_needsort= 0;
//echo "Kandidaten sind jetzt alle \n"; // echo "Kandidaten sind jetzt alle \n";
} }
// if we came up with $col_unique (very good) or // if we came up with $col_unique (very good) or
@@ -854,10 +854,10 @@ if (isset($Field) && count($Field) > 0) {
} }
if (isset($vg)) { if (isset($vg)) {
$col_cand = $vg; $col_cand = $vg;
//echo "Kandidaten konnten auf index+where beschr<68>nkt werden\n"; // echo "Kandidaten konnten auf index+where beschr<68>nkt werden\n";
} else { } else {
$col_cand = $sg; $col_cand = $sg;
//echo "keiner der Kandidaten mit Index ist im wherclause\n"; // echo "keiner der Kandidaten mit Index ist im wherclause\n";
} }
} }
@@ -979,7 +979,7 @@ if (isset($Field) && count($Field) > 0) {
if ($run>5) { if ($run>5) {
while ( list(,$_tab) = each($tab_left)) { while ( list(,$_tab) = each($tab_left)) {
$emerg .= ', '.$t_tab; $emerg .= ', '.$_tab;
$tab_left=array_short($tab_left,$_tab); $tab_left=array_short($tab_left,$_tab);
} }
} }
@@ -1086,4 +1086,4 @@ if (!empty($qry_orderby)) {
* Displays the footer * Displays the footer
*/ */
require('./footer.inc.php3'); require('./footer.inc.php3');
?> ?>