Patch #2975533 New search operators

This commit is contained in:
Martynas Mickevičius
2010-03-29 17:26:27 -04:00
committed by Marc Delisle
parent 775d2ce264
commit dbd83fa123
3 changed files with 28 additions and 2 deletions

View File

@@ -53,6 +53,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
to Pavel Konnikov and Herman van Rink
+ patch #2974341 [structure] Clicking on table name in db Structure should
Browse the table if possible, thanks to bhdouglass - dougboybhd
+ patch #2975533 [search] New search operators, thanks to
Martynas Mickevičius
3.3.2.0 (not yet released)
- patch #2969449 [core] Name for MERGE engine varies depending on the

View File

@@ -2990,6 +2990,10 @@ $cfg['NumOperators'] = array(
'!=',
'LIKE',
'NOT LIKE',
'IN (...)',
'NOT IN (...)',
'BETWEEN',
'NOT BETWEEN',
);
/**
@@ -3007,7 +3011,11 @@ $cfg['TextOperators'] = array(
'REGEXP ^...$',
'NOT REGEXP',
"= ''",
"!= ''"
"!= ''",
'IN (...)',
'NOT IN (...)',
'BETWEEN',
'NOT BETWEEN',
);
/**

View File

@@ -408,7 +408,23 @@ else {
$func_type = 'REGEXP';
$fields[$i] = '^' . $fields[$i] . '$';
}
$w[] = PMA_backquote($names[$i]) . ' ' . $func_type . ' ' . $quot . PMA_sqlAddslashes($fields[$i]) . $quot;
if ($func_type == 'IN (...)' || $func_type == 'NOT IN (...)' || $func_type == 'BETWEEN' || $func_type == 'NOT BETWEEN') {
$func_type = str_replace(' (...)', '', $func_type);
// quote values one by one
$values = explode(',', $fields[$i]);
foreach ($values as &$value)
$value = $quot . PMA_sqlAddslashes(trim($value)) . $quot;
if ($func_type == 'BETWEEN' || $func_type == 'NOT BETWEEN')
$w[] = PMA_backquote($names[$i]) . ' ' . $func_type . ' ' . (isset($values[0]) ? $values[0] : '') . ' AND ' . (isset($values[1]) ? $values[1] : '');
else
$w[] = PMA_backquote($names[$i]) . ' ' . $func_type . ' (' . implode(',', $values) . ')';
}
else {
$w[] = PMA_backquote($names[$i]) . ' ' . $func_type . ' ' . $quot . PMA_sqlAddslashes($fields[$i]) . $quot;;
}
} // end if
} // end for