read (Mysql::Net)

    # File lib/active_record/vendor/mysql.rb, line 1089
        def read()
          buf = []
          len = nil
          @sock.sync = false
          while len == nil or len == MAX_PACKET_LENGTH do
            a = @sock.read(4)
            len = a[0]+a[1]*256+a[2]*256*256
            pkt_nr = a[3]
            if @pkt_nr != pkt_nr then
              raise "Packets out of order: #{@pkt_nr}<>#{pkt_nr}"
            end
            @pkt_nr = @pkt_nr + 1 & 0xff
            buf << @sock.read(len)
          end
          @sock.sync = true
          buf.join
        rescue
          errno = Error::CR_SERVER_LOST
          raise Error::new(errno, Error::err(errno))
        end