Example #1
0
        /// <summary>
        /// parse header part of the result set
        /// </summary>
        bool Parse_Header_Content(MySqlStreamReader reader)
        {
            if (!reader.Ensure(_currentHeader.ContentLength))
            {
                return(_needMoreData = true);
            }
            //can parse
            var resultSetHeaderPacket = new ResultSetHeaderPacket(_currentHeader);

            resultSetHeaderPacket.ParsePacketContent(reader);
            _tableHeader = new TableHeader(this.ForPrepareResult);

            _parsingState = ResultPacketState.Field_Header;
            _rows         = new List <DataRowPacket>();
            return(false);
        }
Example #2
0
        void ParseResultSet()
        {
            ResultSetHeaderPacket resultPacket = new ResultSetHeaderPacket();

            resultPacket.ParsePacket(_parser);

            this._tableHeader       = new TableHeader();
            _tableHeader.TypeCast   = typeCast;
            _tableHeader.NestTables = nestTables;
            _tableHeader.ConnConfig = _conn.config;

            bool protocol41 = _conn.IsProtocol41;

            while (_receiveBuffer[_parser.Position + 4] != EOF_CODE)
            {
                FieldPacket fieldPacket = ParseColumn();
                _tableHeader.AddField(fieldPacket);
            }

            EofPacket fieldEof = ParseEOF();

            //-----
            _lastRow = new RowDataPacket(_tableHeader);
        }
        /// <summary>
        /// parse header part of the result set
        /// </summary>
        bool Parse_Header_Content(MySqlStreamReader reader)
        {
            if (!reader.Ensure(_currentHeader.ContentLength))
            {
                return _needMoreData = true;
            }
            //can parse
            var resultSetHeaderPacket = new ResultSetHeaderPacket(_currentHeader);
            resultSetHeaderPacket.ParsePacketContent(reader);
            _tableHeader = new TableHeader(this.ForPrepareResult);

            _parsingState = ResultPacketState.Field_Header;
            _rows = new List<DataRowPacket>();
            return false;
        }