Bug #22695 » 14456_core.diff
t3lib/class.t3lib_sqlparser.php (working copy) | ||
---|---|---|
$result['TABLE'] = $this->nextPart($parseString, '^([[:alnum:]_]+)[[:space:]]+');
|
||
if ($result['TABLE']) {
|
||
if ($result['action'] = $this->nextPart($parseString, '^(CHANGE|DROP[[:space:]]+KEY|DROP[[:space:]]+PRIMARY[[:space:]]+KEY|ADD[[:space:]]+KEY|ADD[[:space:]]+PRIMARY[[:space:]]+KEY|ADD[[:space:]]+UNIQUE|DROP|ADD|RENAME)([[:space:]]+|\()')) {
|
||
if ($result['action'] = $this->nextPart($parseString, '^(CHANGE|DROP[[:space:]]+KEY|DROP[[:space:]]+PRIMARY[[:space:]]+KEY|ADD[[:space:]]+KEY|ADD[[:space:]]+PRIMARY[[:space:]]+KEY|ADD[[:space:]]+UNIQUE|DROP|ADD|RENAME|ENGINE)([[:space:]]+|\(|=)')) {
|
||
$actionKey = strtoupper(str_replace(array(' ',TAB,CR,LF),'',$result['action']));
|
||
// Getting field:
|
||
if (t3lib_div::inList('ADDPRIMARYKEY,DROPPRIMARYKEY',$actionKey) || $fieldKey = $this->nextPart($parseString, '^([[:alnum:]_]+)[[:space:]]+')) {
|
||
if (t3lib_div::inList('ADDPRIMARYKEY,DROPPRIMARYKEY,ENGINE', $actionKey) || $fieldKey = $this->nextPart($parseString, '^([[:alnum:]_]+)[[:space:]]+')) {
|
||
switch($actionKey) {
|
||
case 'ADD':
|
||
... | ... | |
case 'DROPPRIMARYKEY':
|
||
// ??? todo!
|
||
break;
|
||
case 'ENGINE':
|
||
$result['engine'] = $this->nextPart($parseString, '^=[[:space:]]*([[:alnum:]]+)[[:space:]]+', TRUE);
|
||
break;
|
||
}
|
||
} else return $this->parseError('No field name found',$parseString);
|
||
} else return $this->parseError('No action CHANGE, DROP or ADD found!',$parseString);
|
||
... | ... | |
case 'ADDUNIQUE':
|
||
$query.=' ('.implode(',',$components['fields']).')';
|
||
break;
|
||
case 'ENGINE':
|
||
$query .= '= ' . $components['engine'];
|
||
break;
|
||
}
|
||
// Return query
|