public function getMaxAllowedPacket()
    {
        if ($this->maxAllowedPacket === null) {
            $statement = $this->prepare('SELECT @@global.max_allowed_packet');
            $statement->execute();

            $this->maxAllowedPacket = (int) $statement->fetchColumn();
        }

        return $this->maxAllowedPacket;
    }