@@ -503,6 +503,7 @@ struct ArrayProperties
503
503
{
504
504
OidType OID = OidType.Undefined; // / Oid
505
505
int [] dimsSize; // / Dimensions sizes info
506
+ int [] leftBounds; // / Left bounds of each dimension. Can differ from 1 for slices. Useful to restore coordinates inside of a slice.
506
507
size_t nElems; // / Total elements
507
508
package size_t dataOffset;
508
509
@@ -540,26 +541,21 @@ struct ArrayProperties
540
541
dataOffset = ArrayHeader_net.sizeof + Dim_net.sizeof * nDims;
541
542
542
543
dimsSize = new int [nDims];
544
+ leftBounds = new int [nDims];
543
545
544
546
// Recognize dimensions of array
545
547
for ( auto i = 0 ; i < nDims; ++ i )
546
548
{
547
549
Dim_net* d = (cast (Dim_net* ) (h + 1 )) + i;
548
550
549
551
const dim_size = bigEndianToNative! int (d.dim_size);
550
- const lbound = bigEndianToNative! int (d.lbound);
552
+ leftBounds[i] = bigEndianToNative! int (d.lbound);
551
553
552
554
if (dim_size < 0 )
553
555
throw new ValueConvException(ConvExceptionType.CORRUPTED_ARRAY ,
554
556
" Dimension size is negative (" ~ to! string (dim_size)~ " )" ,
555
557
);
556
558
557
- // FIXME: What is lbound in postgresql array reply?
558
- if (! (lbound == 1 ))
559
- throw new ValueConvException(ConvExceptionType.CORRUPTED_ARRAY ,
560
- " Please report if you came across this error! lbound==" ~ to! string (lbound),
561
- );
562
-
563
559
dimsSize[i] = dim_size;
564
560
565
561
if (i == 0 ) // first dimension
0 commit comments