Processing of varbinary fields

This commit is contained in:
Michal Čihař 2011-08-04 16:21:47 +02:00
parent 57dcfb780a
commit 5adf2fb352
2 changed files with 14 additions and 0 deletions

View File

@ -2639,6 +2639,8 @@ function PMA_extractFieldSpec($fieldspec) {
if (!preg_match('@binary[\(]@', $shorttype)) {
$binary = strpos($shorttype, 'blob') !== false || strpos($shorttype, 'binary') !== false;
$shorttype = preg_replace('@binary@', '', $shorttype);
} else {
$binary = false;
}
$shorttype = preg_replace('@zerofill@', '', $shorttype, -1, $zerofill_cnt);
$zerofill = ($zerofill_cnt > 0);

View File

@ -75,6 +75,18 @@ class PMA_extractFieldSpec_test extends PHPUnit_Extensions_OutputTestCase
'enum_set_values' => array(),
),
),
array(
"VARBINARY(255)",
array(
'type' => 'varbinary',
'short_type' => 'varbinary(255)',
'binary' => false,
'unsigned' => false,
'zerofill' => false,
'spec_in_brackets' => '255',
'enum_set_values' => array(),
),
),
);
}
}