Skip to content

[FIX] OpenFileGDB: read default value of non-editable fields - #15385

Merged
dbaston merged 5 commits into
OSGeo:masterfrom
dashie:openfilegdb-nonEditable-default
Oct 22, 2026
Merged

dbaston merged 5 commits into
OSGeo:masterfrom
dashie:openfilegdb-nonEditable-default

Conversation

@dashie

@dashie dashie commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes opening of OpenFileGDB tables that contain a field that is not editable but still stores a default value. Such tables were reported as an empty layer (0 features, no fields).

This layout is seen in ArcGIS Utility Network geodatabases, e.g. the ASSOCIATIONSTATUS field.

Cause

In FileGDBTable::Open(), the bytes of a field's default value were only consumed when the field had the EDITABLE flag. For a field with flags 0x02 (required, not editable) followed by a non-zero default value length, the default value was not skipped, so parsing of the field definitions shifted by defaultValueLength bytes:

00        field type = int16
02        width
02        flags = REQUIRED (no EDITABLE bit)
02        default value length
00 00     default value = 0        <- not skipped
16 ...    next field: name length 0x16 (22) = "ISSUBNETWORKCONTROLLER"

The name length of the next field (22) was then read as its field type, giving:

OpenFileGDB: Unhandled field type : 22

and the table failed to open.

What are related issues/pull requests?

Fixes #14910

AI tool usage

  • AI supported my development of this PR. Claude Code (Anthropic) was used to apply the patch, write the test and run the build, the tests and the pre-commit checks in a container. I reviewed the change before submitting it.

Tasklist

  • Make sure code is correctly formatted (cf pre-commit configuration)
  • Add test case(s)
  • Add documentation
  • Updated Python API documentation (swig/include/python/docs/)
  • Review
  • Adjust for comments
  • All CI builds and checks have passed

Environment

  • OS: Ubuntu 24.04 (Docker, aarch64), host macOS
  • Compiler: GCC (Ubuntu 24.04 default), Release build

@dashie

dashie commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

@elpaso or @dbaston last approval process failed just because of this #15405 so I've updated the PR branch, now it should work

@dashie dashie changed the title OpenFileGDB: read default value of non-editable fields [FIX] OpenFileGDB: read default value of non-editable fields Oct 20, 2026
@dashie

dashie commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

@elpaso why the "Windows builds / windows_build (Visual Studio 17, 2022, rel..." failed at

ERROR: ..\downloads\release-1930-dev.zip
7-Zip 26.04 (x64) : Copyright (c) 1999-2026 Igor Pavlov : 2026-10-05

Scanning the drive for archives:
1 file, 12026 bytes (12 KiB)

Extracting archive: ..\downloads\release-1930-dev.zip
..\downloads\release-1930-dev.zip
Open ERROR: Cannot open the file as [zip] archive

It seems a pipeline error? Isn't it?
I've just checked other PRs and that archive exists and it is extracted without any problem.

@dbaston

dbaston commented Oct 20, 2026

Copy link
Copy Markdown
Member

Yes, it's a random failure. I restarted that job manually.

@dashie

dashie commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

@dbaston is it enough to trigger and wait the last step "Code Checks / cmake-lint..." and then it is merged? Or do I need to add something else to the PR?

Comment thread ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp Outdated
@dashie

dashie commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

I've just fixed the linting issue on the comment after removing the inner IF

Comment thread ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp Outdated
@dbaston
dbaston merged commit 2c7893c into OSGeo:master Oct 22, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenFileGDB: table with a non-editable field that has a default value fails to open (field-descriptor parse desync, 0 fields / 0 features)

2 participants