Skip to content

Commit 3593b06

Browse files
committed
Merge branch 'master' into net_addr_support
2 parents abac1de + 75be9e1 commit 3593b06

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ concurrency:
2121
jobs:
2222
setup:
2323
name: 'Load job configuration'
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-22.04
2525
outputs:
2626
compilers: ${{ steps.load-config.outputs.compilers }}
2727
steps:
28-
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
28+
- uses: actions/checkout@v4
2929
# This step checks if we want to skip CI entirely, then outputs the compilers to be used for
3030
# each job. A little overkill, as we don't intend to support multiple platforms, but I digress.
3131
- id: load-config
@@ -56,7 +56,7 @@ jobs:
5656
5757
ci:
5858
name: '[ci] ${{ matrix.dc }}/${{ matrix.build }}-${{ matrix.stat_type }}'
59-
runs-on: ubuntu-20.04
59+
runs-on: ubuntu-22.04
6060
needs: setup
6161
# Only run if the setup phase explicitly defined compilers to be used
6262
if: ${{ fromJSON(needs.setup.outputs.compilers) != '' && fromJSON(needs.setup.outputs.compilers) != '[]' }}
@@ -91,15 +91,15 @@ jobs:
9191
stat_type: none
9292
steps:
9393
- name: Checkout repo
94-
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
94+
uses: actions/checkout@v4
9595
- name: Setup D compiler
96-
uses: dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
96+
uses: dlang-community/setup-dlang@v1.3.0
9797
with:
9898
compiler: ${{ matrix.dc }}
9999
- name: Install dependencies
100100
run: sudo apt-get -y update && sudo apt-get -y install libpq-dev libevent-dev libcurl4-gnutls-dev postgresql
101101
- name: Cache dub dependencies
102-
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
102+
uses: actions/cache@v4
103103
with:
104104
path: ~/.dub/packages
105105
key: ubuntu-latest-build-${{ hashFiles('**/dub.sdl', '**/dub.json') }}
@@ -125,4 +125,4 @@ jobs:
125125
shell: bash
126126
- name: Upload coverage data
127127
if: matrix.build == 'tests_and_cov'
128-
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b
128+
uses: codecov/codecov-action@v2

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ concurrency:
1717
jobs:
1818
build_docs:
1919
name: Build documentation
20-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-22.04
2121
permissions:
2222
# Allow this action and this action only to write to the repo itself
2323
contents: write

src/dpq2/result.d

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ struct ArrayProperties
503503
{
504504
OidType OID = OidType.Undefined; /// Oid
505505
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.
506507
size_t nElems; /// Total elements
507508
package size_t dataOffset;
508509

@@ -540,26 +541,21 @@ struct ArrayProperties
540541
dataOffset = ArrayHeader_net.sizeof + Dim_net.sizeof * nDims;
541542

542543
dimsSize = new int[nDims];
544+
leftBounds = new int[nDims];
543545

544546
// Recognize dimensions of array
545547
for( auto i = 0; i < nDims; ++i )
546548
{
547549
Dim_net* d = (cast(Dim_net*) (h + 1)) + i;
548550

549551
const dim_size = bigEndianToNative!int(d.dim_size);
550-
const lbound = bigEndianToNative!int(d.lbound);
552+
leftBounds[i] = bigEndianToNative!int(d.lbound);
551553

552554
if(dim_size < 0)
553555
throw new ValueConvException(ConvExceptionType.CORRUPTED_ARRAY,
554556
"Dimension size is negative ("~to!string(dim_size)~")",
555557
);
556558

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-
563559
dimsSize[i] = dim_size;
564560

565561
if(i == 0) // first dimension

src/dpq2/value.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct Value
9090
import std.exception;
9191
import core.exception;
9292

93-
enforce!AssertError(!isNull, "Attempt to read NULL value", __FILE__, __LINE__);
93+
enforce!AssertError(!isNull, "Attempt to read SQL NULL value", __FILE__, __LINE__);
9494

9595
return _data;
9696
}

0 commit comments

Comments
 (0)