some more mistakes in db_details_qbe - for example usage

of the variable $col in my stuff to create the LEFT JOIN
which disabled the WHERE
This commit is contained in:
Mike Beck
2002-09-26 16:09:56 +00:00
parent ee73f75616
commit 800a0c6f72

View File

@@ -763,21 +763,21 @@ if (isset($Field) && count($Field) > 0) {
if ($cfgRelation['relwork'] && count($tab_all) > 0) {
// Now we need all tables that we have in the whereclause
for ($x = 0; $x < count($Criteria); $x++) {
$tab_wher = explode('.', urldecode($Field[$x]));
if (!empty($tab_wher[0]) && !empty($tab_wher[1])) {
$tab_raw = urldecode($tab_wher[0]);
$_currtab = explode('.', urldecode($Field[$x]));
if (!empty($_currtab[0]) && !empty($_currtab[1])) {
$tab_raw = urldecode($_currtab[0]);
$tab = str_replace('`', '', $tab_raw);
$col_raw = urldecode($tab_wher[1]);
$col = str_replace('`', '', $col_raw);
$col = $tab . '.' . $col;
$col_raw = urldecode($_currtab[1]);
$_col = str_replace('`', '', $col_raw);
$_col = $tab . '.' . $_col;
// Now we know that our array has the same numbers as $Criteria
// we can check which of our columns has a whereclause
if (!empty($Criteria[$x])) {
if (substr($Criteria[$x],0,1) == '=' || eregi('is', $Criteria[$x])) {
$col_where[$col] = $col;
$col_where[$col] = $_col;
$tab_wher[$tab] = $tab;
//echo 'new Whereclause: ' . $tab . "\n";
// echo 'new Whereclause: ' . $tab_wher[$tab] . "||\n";
}
}
}
@@ -790,7 +790,7 @@ if (isset($Field) && count($Field) > 0) {
// If there is exactly one column that has a decent where-clause
// we will just use this
$master = key($tab_wher);
//echo 'nur ein where: master = ' . $master . "\n";
// echo 'nur ein where: master = ' .$master . "||\n";
} else {
// Now let's find out which of the tables has an index
// echo "pr<70>fe indexe:\n";
@@ -798,20 +798,20 @@ if (isset($Field) && count($Field) > 0) {
$ind_qry = 'SHOW INDEX FROM ' . PMA_backquote($tab);
$ind_rs = PMA_mysql_query($ind_qry);
while ($ind = PMA_mysql_fetch_array($ind_rs)) {
$col = $tab . '.' . $ind['Column_name'];
if (isset($col_all[$col])) {
$_col = $tab . '.' . $ind['Column_name'];
if (isset($col_all[$_col])) {
if ($ind['non_unique'] == 0) {
if (isset($col_where[$col])) {
$col_unique[$col] = 'Y';
if (isset($col_where[$_col])) {
$col_unique[$_col] = 'Y';
} else {
$col_unique[$col] = 'N';
$col_unique[$_col] = 'N';
}
//echo 'neuen unique index gefunden: ' . $col . "\n";
} else {
if (isset($col_where[$col])) {
$col_index[$col] = 'Y';
if (isset($col_where[$_col])) {
$col_index[$_col] = 'Y';
} else {
$col_index[$col] = 'N';
$col_index[$_col] = 'N';
}
//echo 'neuen index gefunden: ' . $col . "\n";
}
@@ -1029,7 +1029,6 @@ for ($x = 0; $x < $col; $x++) {
if ($criteria_cnt > 1) {
$qry_where = '(' . $qry_where . ')';
}
// OR rows ${"cur".$or}[$x]
if (!isset($curAndOrRow)) {
$curAndOrRow = array();