Cater for length part of TEXT field in indexes for MySQL

Cater for length on TEXT column in index for _alterIndexes

Handle nested arrays in schemas

Used when writing indexes containg TEXT field for MySQL

Change comment style from code review

Remove stray space

Only generate length part of TEXT index column field when necessary

Override buildIndex() in Mysql instead of name()
Revert DboSource::buildIndex to previous state
Update Mysql::_alterIndexes for code reuse
Update MysqlTest to handle quoted index names.

Make code clearer, as per code review

Adjust function comments, as per code review
This commit is contained in:
Reuben Helms 2012-12-03 13:58:57 +10:00
parent 0b508b887a
commit 07dbc4a527
4 changed files with 133 additions and 36 deletions

View file

@ -574,13 +574,17 @@ class CakeSchema extends Object {
if (is_array($values)) {
foreach ($values as $key => $val) {
if (is_array($val)) {
$vals[] = "'{$key}' => array('" . implode("', '", $val) . "')";
} elseif (!is_numeric($key)) {
$vals[] = "'{$key}' => array(" . implode(", ", $this->_values($val)) . ")";
} else {
$val = var_export($val, true);
if ($val === 'NULL') {
$val = 'null';
}
$vals[] = "'{$key}' => {$val}";
if (!is_numeric($key)) {
$vals[] = "'{$key}' => {$val}";
} else {
$vals[] = "{$val}";
}
}
}
}