Fixed bug preventing correct detection of enums under mysqli. MDL-14215 ; backported from HEAD

This commit is contained in:
stronk7
2008-04-04 19:56:15 +00:00
parent fd6024c0be
commit 741859448b
+3 -1
View File
@@ -555,6 +555,8 @@ class ADODB_mysqli extends ADOConnection {
$fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
} elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
$fld->type = $query_array[1];
$arr = explode(",",$query_array[2]);
$fld->enums = $arr;
$fld->max_length = max(array_map("strlen",explode(",",$query_array[2]))) - 2; // PHP >= 4.0.6
$fld->max_length = ($fld->max_length == 0 ? 1 : $fld->max_length);
} else {
@@ -1128,4 +1130,4 @@ class ADORecordSet_array_mysqli extends ADORecordSet_array {
}
?>
?>