/**
  * Compiles an ALTER TABLE statement from components array
  *
  * @param array Array of SQL query components
  * @return string SQL ALTER TABLE query
  * @see parseALTERTABLE()
  */
 public function compileALTERTABLE($components)
 {
     // Execute query (based on handler derived from the TABLE name which we actually know for once!)
     switch ((string) $GLOBALS['TYPO3_DB']->handlerCfg[$GLOBALS['TYPO3_DB']->lastHandlerKey]['type']) {
         case 'native':
             $query[] = parent::compileALTERTABLE($components);
             break;
         case 'adodb':
             $tableName = $GLOBALS['TYPO3_DB']->quoteName($components['TABLE'], NULL, TRUE);
             $fieldName = $GLOBALS['TYPO3_DB']->quoteName($components['FIELD'], NULL, TRUE);
             switch (strtoupper(str_replace(array(' ', "\n", "\r", "\t"), '', $components['action']))) {
                 case 'ADD':
                     $query = $GLOBALS['TYPO3_DB']->handlerInstance[$GLOBALS['TYPO3_DB']->lastHandlerKey]->DataDictionary->AddColumnSQL($tableName, $fieldName . ' ' . $this->compileFieldCfg($components['definition']));
                     break;
                 case 'CHANGE':
                     $query = $GLOBALS['TYPO3_DB']->handlerInstance[$GLOBALS['TYPO3_DB']->lastHandlerKey]->DataDictionary->AlterColumnSQL($tableName, $fieldName . ' ' . $this->compileFieldCfg($components['definition']));
                     break;
                 case 'DROP':
                 case 'DROPKEY':
                     break;
                 case 'ADDKEY':
                 case 'ADDPRIMARYKEY':
                 case 'ADDUNIQUE':
                     $query .= ' (' . implode(',', $components['fields']) . ')';
                     break;
                 case 'DEFAULTCHARACTERSET':
                 case 'ENGINE':
                     // ??? todo!
                     break;
             }
             break;
     }
     return $query;
 }