Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenFileGDB: add missing GetIndexCount() in FileGDBTable::CreateIndex #10624

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

AlbertXingZhang
Copy link
Contributor

What does this PR do?

It adds calling GetIndexCount() to retrieve all the existing indexes before creating a new index.

What are related issues/pull requests?

Currently, creating a new index using OpenFileGDB drive causes all the existing indexes are lost.
For example, I have a table with two indexes "FDO_OBJECTID" for "OBJECTID" and "IDx" for "ID. Here are the contents of its gdbindexes file.
image
But after I run ./ogrinfo BASE.gdb -sql "CREATE INDEX DESCRIPTx ON PIPE_h(DESCRIPT)", there is only "DESCRIPTx" for "DESCRIPT" in its gdbindexes file.
image
I find it doesn't call GetIndexCount() to retrieve the existing indexes before creating a new index in the FileGDBTable::CreateIndex function. I think it might be the reason. After I add this line, everything works properly now.

@rouault rouault merged commit 30eaea3 into OSGeo:master Aug 24, 2024
33 of 35 checks passed
@AlbertXingZhang
Copy link
Contributor Author

Thanks for merging! 🎉

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.

2 participants