Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Oracle select support

  • Loading branch information...
commit 84d068df8b90ebbf2fbadcc560b6c9aa3cbef401 1 parent e4df0c6
@vrana authored
Showing with 23 additions and 6 deletions.
  1. +20 −6 adminer/drivers/oracle.inc.php
  2. +3 −0  todo.txt
View
26 adminer/drivers/oracle.inc.php
@@ -86,12 +86,21 @@ function Min_Result($result) {
$this->num_rows = -1; // all results unbuffered
}
+ function _convert($row) {
+ foreach ((array) $row as $key => $val) {
+ if (is_a($val, 'OCI-Lob')) {
+ $row[$key] = $val->load();
+ }
+ }
+ return $row;
+ }
+
function fetch_assoc() {
- return oci_fetch_assoc($this->_result);
+ return $this->_convert(oci_fetch_assoc($this->_result));
}
function fetch_row() {
- return oci_fetch_row($this->_result);
+ return $this->_convert(oci_fetch_row($this->_result));
}
function fetch_field() {
@@ -189,7 +198,7 @@ function table_status($name = "") {
}
function fk_support($table_status) {
- return false; //!
+ return true;
}
function fields($table) {
@@ -252,7 +261,7 @@ function alter_table($table, $name, $fields, $foreign, $comment, $engine, $colla
foreach ($fields as $field) {
$val = $field[1];
if ($val && $field[0] != "" && idf_escape($field[0]) != $val[0]) {
- queries("ALTER TABLE " . table($name) . " RENAME COLUMN " . idf_escape($field[0]) . " TO $val[0]");
+ queries("ALTER TABLE " . table($table) . " RENAME COLUMN " . idf_escape($field[0]) . " TO $val[0]");
}
if ($val) {
$alter[] = ($table != "" ? ($field[0] != "" ? "MODIFY (" : "ADD (") : " ") . implode($val) . ($table != "" ? ")" : ""); //! error with name change only
@@ -263,11 +272,16 @@ function alter_table($table, $name, $fields, $foreign, $comment, $engine, $colla
if ($table == "") {
return queries("CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)");
}
- return (!$alter || queries("ALTER TABLE " . table($name) . "\n" . implode("\n", $alter)))
- && (!$drop || queries("ALTER TABLE " . table($name) . " DROP (" . implode(", ", $drop) . ")"))
+ return (!$alter || queries("ALTER TABLE " . table($table) . "\n" . implode("\n", $alter)))
+ && (!$drop || queries("ALTER TABLE " . table($table) . " DROP (" . implode(", ", $drop) . ")"))
+ && ($table == $name || queries("ALTER TABLE " . table($table) . " RENAME TO " . table($name)))
;
}
+ function foreign_keys($table) {
+ return array(); //!
+ }
+
function truncate_tables($tables) {
return apply_queries("TRUNCATE TABLE", $tables);
}
View
3  todo.txt
@@ -44,3 +44,6 @@ Non UTF-8 character sets
Rename by sp_rename
Detection of table collation
PDO driver with seek
+
+Oracle:
+clob comparable with string
Please sign in to comment.
Something went wrong with that request. Please try again.