Exemplo n.º 1
0
        public MySqlField GetField()
        {
            MySqlField f = new MySqlField(driver.Encoding);

            packet = driver.ReadPacket();

            f.TableName    = packet.ReadLenString();
            f.ColumnName   = packet.ReadLenString();
            f.ColumnLength = (int)packet.ReadNBytes();
            f.Type         = (MySqlDbType)packet.ReadNBytes();
            packet.ReadByte();                                                  // this is apparently 2 -- not sure what it is for
            f.Flags        = (ColumnFlags)packet.ReadInteger(2);                //(short)(d.ReadByte() & 0xff);
            f.NumericScale = packet.ReadByte();
            fieldsRead++;
            return(f);
        }
Exemplo n.º 2
0
        private void ReadOffResultSet()
        {
            Driver driver = connection.InternalConnection.Driver;

            // first read off the schema
            Packet packet = driver.ReadPacket();

            while (!packet.IsLastPacket())
            {
                packet = driver.ReadPacket();
            }

            // now read off the data
            packet = driver.ReadPacket();
            while (!packet.IsLastPacket())
            {
                packet = driver.ReadPacket();
            }
        }