/**
  * Precompiles a SELECT prepared SQL statement.
  *
  * @param array $components
  * @return array Precompiled SQL statement
  */
 protected function precompileSELECTquery(array $components)
 {
     $parameterWrap = '__' . dechex(time()) . '__';
     foreach ($components['parameters'] as $key => $params) {
         if ($key === '?') {
             foreach ($params as $index => $param) {
                 $components['parameters'][$key][$index][0] = $parameterWrap . $param[0] . $parameterWrap;
             }
         } else {
             $components['parameters'][$key][0] = $parameterWrap . $params[0] . $parameterWrap;
         }
     }
     $select_fields = $this->SQLparser->compileFieldList($components['SELECT']);
     $from_table = $this->SQLparser->compileFromTables($components['FROM']);
     $where_clause = $this->SQLparser->compileWhereClause($components['WHERE']);
     $groupBy = $this->SQLparser->compileFieldList($components['GROUPBY']);
     $orderBy = $this->SQLparser->compileFieldList($components['ORDERBY']);
     $limit = $components['LIMIT'];
     $precompiledParts = array();
     $this->lastHandlerKey = $this->handler_getFromTableList($components['ORIG_tableName']);
     $hType = (string) $this->handlerCfg[$this->lastHandlerKey]['type'];
     $precompiledParts['handler'] = $hType;
     $precompiledParts['ORIG_tableName'] = $components['ORIG_tableName'];
     switch ($hType) {
         case 'native':
             $query = parent::SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);
             $precompiledParts['queryParts'] = explode($parameterWrap, $query);
             break;
         case 'adodb':
             $this->dbmsSpecifics->transformQueryParts($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);
             $query = parent::SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy);
             $precompiledParts['queryParts'] = explode($parameterWrap, $query);
             $precompiledParts['LIMIT'] = $limit;
             break;
         case 'userdefined':
             $precompiledParts['queryParts'] = array('SELECT' => $select_fields, 'FROM' => $from_table, 'WHERE' => $where_clause, 'GROUPBY' => $groupBy, 'ORDERBY' => $orderBy, 'LIMIT' => $limit);
             break;
     }
     return $precompiledParts;
 }