Error fixes related with the improved oracle compatibility

This commit is contained in:
Alejandro Gallardo Escobar 2015-04-29 15:31:46 +02:00
parent 0b7b32f526
commit 4008b12add
3 changed files with 7 additions and 2 deletions

View File

@ -253,6 +253,9 @@ switch ($config["dbtype"]) {
}
break;
case "oracle":
if (!isset($config['quote_string'])) {
$config['db_quote_string'] = "'";
}
break;
}
//======================================================================

View File

@ -453,7 +453,9 @@ function oracle_encapsule_fields_with_same_name_to_instructions($field) {
if (is_string($return)) {
if ($return[0] !== '"') {
$return = '"' . $return . '"';
// The columns declared without quotes are converted to uppercase in oracle.
// A column named asd is equal to asd, ASD or "ASD", but no to "asd".
$return = '"' . strtoupper($return) . '"';
}
}

View File

@ -2213,7 +2213,7 @@ function get_news($arguments) {
case "oracle":
$sql = sprintf("SELECT subject,timestamp,text,author
FROM tnews
WHERE rownum <= %limit AND id_group IN (%s) AND
WHERE rownum <= %s AND id_group IN (%s) AND
modal = %s AND
(expire = 0 OR (expire = 1 AND expire_timestamp > '%s'))
ORDER BY timestamp DESC", $limit, $id_group, $modal, $current_datetime);