Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -1012,39 +1012,22 @@ |
1013 | 1013 | return array( $startOpts, $useIndex, $preLimitTail, $postLimitTail ); |
1014 | 1014 | } |
1015 | 1015 | |
1016 | | - /* redundand ... will remove after confirming bitwise operations functionality |
1017 | 1016 | public function makeList( $a, $mode = LIST_COMMA ) { |
1018 | | - if ( !is_array( $a ) ) { |
| 1017 | + if ( !is_array( $a ) ) { |
1019 | 1018 | throw new DBUnexpectedError( $this, 'DatabaseOracle::makeList called with incorrect parameters' ); |
1020 | 1019 | } |
| 1020 | + |
1021 | 1021 | $a2 = array(); |
1022 | | - foreach ($a as $key => $value) { |
1023 | | - if (strpos($key, ' & ') !== FALSE) |
1024 | | - $a2[preg_replace('/(.*)\s&\s(.*)/', 'BITAND($1, $2)', $key)] = $value; |
1025 | | - elseif (strpos($key, ' | ') !== FALSE) |
1026 | | - $a2[preg_replace('/(.*)\s|\s(.*)/', 'BITOR($1, $2)', $key)] = $value; |
1027 | | - elseif (!is_array($value)) { |
1028 | | - if (strpos($value, ' = ') !== FALSE) { |
1029 | | - if (strpos($value, ' & ') !== FALSE) |
1030 | | - $a2[$key] = preg_replace('/(.*)\s&\s(.*?)\s=\s(.*)/', 'BITAND($1, $2) = $3', $value); |
1031 | | - elseif (strpos($value, ' | ') !== FALSE) |
1032 | | - $a2[$key] = preg_replace('/(.*)\s|\s(.*?)\s=\s(.*)/', 'BITOR($1, $2) = $3', $value); |
1033 | | - else $a2[$key] = $value; |
1034 | | - } |
1035 | | - elseif (strpos($value, ' & ') !== FALSE) |
1036 | | - $a2[$key] = preg_replace('/(.*)\s&\s(.*)/', 'BITAND($1, $2)', $value); |
1037 | | - elseif (strpos($value, ' | ') !== FALSE) |
1038 | | - $a2[$key] = preg_replace('/(.*)\s|\s(.*)/', 'BITOR($1, $2)', $value); |
1039 | | - else |
1040 | | - $a2[$key] = $value; |
1041 | | - } |
| 1022 | + foreach($a as $col=>$val) { |
| 1023 | + $col_type=$this->fieldInfo($this->tableName($table), $col)->type(); |
| 1024 | + if ($col_type == 'CLOB') |
| 1025 | + $a2['TO_CHAR('.$col.')'] = $val; |
1042 | 1026 | else |
1043 | | - $a2[$key] = $value; |
| 1027 | + $a2[$col] = $val; |
1044 | 1028 | } |
1045 | | - |
| 1029 | + |
1046 | 1030 | return parent::makeList($a2, $mode); |
1047 | 1031 | } |
1048 | | - */ |
1049 | 1032 | |
1050 | 1033 | function bitNot($field) { |
1051 | 1034 | //expecting bit-fields smaller than 4bytes |