Fixed bug preventing correct detection of enums under mysqli. MDL-14215 ; merged from 19_STABLE

This commit is contained in:
stronk7 2008-04-04 19:55:26 +00:00
parent 05c75fcebf
commit 91703c7792

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 {
}
?>
?>