From: stronk7 Date: Mon, 10 Sep 2007 22:30:26 +0000 (+0000) Subject: Now Oracle is also able to detect its check constraints per field. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=faa1a939f0f2bc335eccc485f10dad8de2444a25;p=moodle.git Now Oracle is also able to detect its check constraints per field. --- diff --git a/lib/xmldb/classes/generators/oci8po/oci8po.class.php b/lib/xmldb/classes/generators/oci8po/oci8po.class.php index 5ff92a5801..ea68d652f5 100644 --- a/lib/xmldb/classes/generators/oci8po/oci8po.class.php +++ b/lib/xmldb/classes/generators/oci8po/oci8po.class.php @@ -502,8 +502,17 @@ class XMLDBoci8po extends XMLDBgenerator { /// Filter by the required field if specified if ($xmldb_field) { + $filtered_results = array(); $filter = $xmldb_field->getName(); - /// Lets clean a bit each constraint description, looking for the filtered fiel + /// Lets clean a bit each constraint description, looking for the filtered field + foreach ($results as $key => $result) { + /// description starts by "$filter IN" assume it's a constraint beloging to the field + if (preg_match("/^{$filter} IN/i", $result->description)) { + $filtered_results[$key] = $result; + } + } + /// Assign filtered results to the final results array + $results = $filtered_results; } return $results;