Ejemplo n.º 1
0
        IMySqlValue IMySqlValue.ReadValue(MySqlPacket packet, long length, bool nullVal)
        {
            MySqlGuid g = new MySqlGuid();

            g.IsNull   = true;
            g.OldGuids = OldGuids;
            if (!nullVal)
            {
                if (OldGuids)
                {
                    return(ReadOldGuid(packet, length));
                }
                string s = String.Empty;
                if (length == -1)
                {
                    s = packet.ReadLenString();
                }
                else
                {
                    s = packet.ReadString(length);
                }
                g.Value  = new Guid(s);
                g.IsNull = false;
            }
            return(g);
        }
Ejemplo n.º 2
0
        IMySqlValue IMySqlValue.ReadValue(MySqlPacket packet, long length, bool nullVal)
        {
            MySqlGuid mySqlGuid = default(MySqlGuid);

            mySqlGuid.isNull   = true;
            mySqlGuid.OldGuids = this.OldGuids;
            if (!nullVal)
            {
                if (this.OldGuids)
                {
                    return(this.ReadOldGuid(packet, length));
                }
                string g = string.Empty;
                if (length == -1L)
                {
                    g = packet.ReadLenString();
                }
                else
                {
                    g = packet.ReadString(length);
                }
                mySqlGuid.mValue = new Guid(g);
                mySqlGuid.isNull = false;
            }
            return(mySqlGuid);
        }
Ejemplo n.º 3
0
        private MySqlGuid ReadOldGuid(MySqlPacket packet, long length)
        {
            if (length == -1)
            {
                length = (long)packet.ReadFieldLength();
            }

            byte[] buff = new byte[length];
            packet.Read(buff, 0, (int)length);
            MySqlGuid g = new MySqlGuid(buff);

            g.OldGuids = OldGuids;
            return(g);
        }
Ejemplo n.º 4
0
 private void WriteOldGuid(MySqlPacket packet, Guid guid, bool binary)
 {
     byte[] array = guid.ToByteArray();
     if (binary)
     {
         packet.WriteLength((long)array.Length);
         packet.Write(array);
         return;
     }
     packet.WriteStringNoNull("_binary ");
     packet.WriteByte(39);
     MySqlGuid.EscapeByteArray(array, array.Length, packet);
     packet.WriteByte(39);
 }
Ejemplo n.º 5
0
 IMySqlValue IMySqlValue.ReadValue(MySqlPacket packet, long length, bool nullVal)
 {
   MySqlGuid g = new MySqlGuid();
   g.isNull = true;
   g.OldGuids = OldGuids;
   if (!nullVal)
   {
     if (OldGuids)
       return ReadOldGuid(packet, length);
     string s = String.Empty;
     if (length == -1)
       s = packet.ReadLenString();
     else
       s = packet.ReadString(length);
     g.mValue = new Guid(s);
     g.isNull = false;
   }
   return g;
 }
Ejemplo n.º 6
0
    private MySqlGuid ReadOldGuid(MySqlPacket packet, long length)
    {
      if (length == -1)
        length = (long)packet.ReadFieldLength();

      byte[] buff = new byte[length];
      packet.Read(buff, 0, (int)length);
      MySqlGuid g = new MySqlGuid(buff);
      g.OldGuids = OldGuids;
      return g;
    }