|
From: Carlos Guzm?n ?l. <car...@us...> - 2003-05-09 12:01:50
|
Update of /cvsroot/firebird/Net-Provider/source
In directory sc8-pr-cvs1:/tmp/cvs-serv12861
Modified Files:
Tag: branch-release-1-1
FbArray.cs
Log Message:
* source/FbArray.cs:
* source/NGDS/XdrOutputStream.cs:
* source/NGDS/XdrInputStream.cs:
- Added support for partial updates.
Index: FbArray.cs
===================================================================
RCS file: /cvsroot/firebird/Net-Provider/source/Attic/FbArray.cs,v
retrieving revision 1.9.2.16
retrieving revision 1.9.2.17
diff -b -U3 -r1.9.2.16 -r1.9.2.17
--- FbArray.cs 5 May 2003 11:55:33 -0000 1.9.2.16
+++ FbArray.cs 9 May 2003 12:01:47 -0000 1.9.2.17
@@ -69,7 +69,7 @@
transaction.IscTransaction,
array_id,
desc,
- getSliceLength(desc, null));
+ getSliceLength(desc, true));
return decodeSlice(desc, slice);
}
@@ -91,7 +91,7 @@
array_id,
desc,
source_array,
- getSliceLength(desc, source_array),
+ getSliceLength(desc, false),
connection.Encoding);
}
catch(GDSException ex)
@@ -257,25 +257,18 @@
}
}
- private int getSliceLength(ISC_ARRAY_DESC desc, System.Array source_array)
+ private int getSliceLength(ISC_ARRAY_DESC desc, bool read)
{
Encoding encoding = connection.Encoding;
int length = 0;
int elements = 0;
- if (source_array == null)
- {
for (int i = 0; i < desc.array_desc_dimensions; i++)
{
ISC_ARRAY_BOUND bound = desc.array_desc_bounds[i];
elements += bound.array_bound_lower * bound.array_bound_upper;
}
- }
- else
- {
- elements = source_array.Length;
- }
switch (desc.array_desc_dtype)
{
@@ -292,7 +285,7 @@
case GdsCodes.blr_short:
length = elements * desc.array_desc_length;
- if (source_array == null)
+ if (read)
{
length *= 2;
}
|