Bug #15366 » 2186_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|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)([[:space:]]+|\()')) {
|
||
$actionKey = strtoupper(str_replace(array(' ',TAB,CR,LF),'',$result['action']));
|
||
// Getting field:
|
||
... | ... | |
case 'ADDKEY':
|
||
case 'ADDPRIMARYKEY':
|
||
case 'ADDUNIQUE':
|
||
$result['KEY'] = $fieldKey;
|
||
$result['fields'] = $this->getValue($parseString, '_LIST', 'INDEX');
|
||
if ($this->parse_error) { return $this->parse_error; }
|
||
... | ... | |
* @param string Regular expressing to STOP parsing, eg. '^(GROUP BY|ORDER BY|LIMIT)([[:space:]]*)'
|
||
* @return mixed If successful parsing, returns an array, otherwise an error string.
|
||
*/
|
||
public function parseFieldDef(&$parseString, $stopRegex = '') {
|
||
public function parseFieldDef(&$parseString, $stopRegex = '') {
|
||
// Prepare variables:
|
||
$parseString = $this->trimSQL($parseString);
|
||
$this->lastStopKeyWord = '';
|
||
... | ... | |
break;
|
||
case 'ADDKEY':
|
||
case 'ADDPRIMARYKEY':
|
||
case 'ADDUNIQUE':
|
||
$query.=' ('.implode(',',$components['fields']).')';
|
||
break;
|
||
}
|