protected function execute(array $prepared)
    {
        if ($this->logQueries) {
            $start = microtime(true);
            $log = [
                'query' => $this->replaceParams($prepared['query'], $prepared['params']),
            ];
            $this->log[] = &$log;
        }

        try {
            if ($prepared['params']) {
                $this->bindValues($prepared['statement'], $prepared['params']);
            }
            $result = $prepared['statement']->execute();
        } catch (PDOException $e) {
            throw new PDOException($e->getMessage() . ' [ ' . $this->replaceParams($prepared['query'],
                    $prepared['params']) . ' ] ', (int)$e->getCode(), $e->getPrevious());
        }

        if ($this->logQueries) {
            /** @noinspection PhpUndefinedVariableInspection */
            $log['time'] = microtime(true) - $start;
        }

        return $result;
    }