Example #1
0
 public int Compare(IClobData a, IClobData b)
 {
     lock (this)
     {
         if (a.GetId() == b.GetId())
         {
             return(0);
         }
         return(this.CompareText(a.GetId(), b.GetId()));
     }
 }
Example #2
0
 public int Compare(IClobData a, string b)
 {
     lock (this)
     {
         long    num2       = (long)this.GetLobHeader(a.GetId())[1];
         int[][] numArray   = this.GetBlockAddresses(a.GetId(), 0, 0x7fffffff);
         int     index      = 0;
         int     startIndex = 0;
         int     num5       = 0;
         do
         {
             int  blockAddress = numArray[index][0] + num5;
             long num8         = num2 - (((numArray[index][2] + num5) * this._lobBlockSize) / 2);
             if (num8 > (this._lobBlockSize / 2))
             {
                 num8 = this._lobBlockSize / 2;
             }
             string str    = new string(ArrayUtil.ByteArrayToChars(this._lobStore.GetBlockBytes(blockAddress, 1)), 0, (int)num8);
             int    length = b.Length - startIndex;
             if (length > (this._lobBlockSize / 2))
             {
                 length = this._lobBlockSize / 2;
             }
             string str2 = b.Substring(startIndex, length);
             int    num6 = this._database.collation.Compare(str, str2);
             if (num6 != 0)
             {
                 return(num6);
             }
             num5++;
             startIndex += this._lobBlockSize / 2;
             if (num5 == numArray[index][1])
             {
                 num5 = 0;
                 index++;
             }
         }while (index != numArray.Length);
         return(0);
     }
 }
Example #3
0
 protected override void WriteClob(IClobData o, SqlType type)
 {
     this.WriteLong(o.GetId());
 }