- Patch #165160 by hswong3i: made two SQL queries work on DB2.
parent
f23c24c8a3
commit
a21275a58f
|
@ -822,7 +822,7 @@ function drupal_is_denied($type, $mask) {
|
||||||
// (allowed).
|
// (allowed).
|
||||||
// The use of ORDER BY / LIMIT is more efficient than "MAX(status) = 0"
|
// The use of ORDER BY / LIMIT is more efficient than "MAX(status) = 0"
|
||||||
// in PostgreSQL <= 8.0.
|
// in PostgreSQL <= 8.0.
|
||||||
return (bool) db_result(db_query_range("SELECT CASE WHEN status=1 THEN 0 ELSE 1 END FROM {access} WHERE type = '%s' AND LOWER('%s') LIKE LOWER(mask) ORDER BY status DESC", $type, $mask, 0, 1));
|
return (bool) db_result(db_query_range("SELECT CASE WHEN status=1 THEN 0 ELSE 1 END FROM {access} WHERE type = '%s' AND LOWER(mask) LIKE LOWER('%s') ORDER BY status DESC", $type, $mask, 0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1679,7 +1679,7 @@ function _menu_link_move_children($item, $existing_item) {
|
||||||
}
|
}
|
||||||
elseif ($shift > 0) {
|
elseif ($shift > 0) {
|
||||||
// The order of $set must be reversed so the new values don't overwrite the
|
// The order of $set must be reversed so the new values don't overwrite the
|
||||||
// old ones before they can be used because "Single-table UPDATE
|
// old ones before they can be used because "Single-table UPDATE
|
||||||
// assignments are generally evaluated from left to right"
|
// assignments are generally evaluated from left to right"
|
||||||
// see: http://dev.mysql.com/doc/refman/5.0/en/update.html
|
// see: http://dev.mysql.com/doc/refman/5.0/en/update.html
|
||||||
$set = array_reverse($set);
|
$set = array_reverse($set);
|
||||||
|
|
|
@ -821,7 +821,7 @@ function _taxonomy_term_children($tid) {
|
||||||
* An array of matching term objects.
|
* An array of matching term objects.
|
||||||
*/
|
*/
|
||||||
function taxonomy_get_term_by_name($name) {
|
function taxonomy_get_term_by_name($name) {
|
||||||
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER('%s') LIKE LOWER(t.name)", 't', 'tid'), trim($name));
|
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER(t.name) LIKE LOWER('%s')", 't', 'tid'), trim($name));
|
||||||
$result = array();
|
$result = array();
|
||||||
while ($term = db_fetch_object($db_result)) {
|
while ($term = db_fetch_object($db_result)) {
|
||||||
$result[] = $term;
|
$result[] = $term;
|
||||||
|
|
Loading…
Reference in New Issue