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

Don't segfault in ArraySchema::dump #4583

Merged

Conversation

davisp
Copy link
Contributor

@davisp davisp commented Dec 18, 2023

There was no check for whether an enumeration was loaded before attempting to dump it during a call to ArraySchema::dump. Obviously, dereferencing nullptr is bad so this avoids doing that.

The new output now shows the following when a Enumeration isn't loaded:

### Attribute ###
- Name: a
- Type: INT32
- Nullable: false
- Cell val num: 1
- Filters: 0
- Fill value: -2147483648
- Enumeration name: flintstones

### Enumeration ###
- Name: flintstones
- Loaded: false

And after calling load_all_enumerations:

### Attribute ###
- Name: a
- Type: INT32
- Nullable: false
- Cell val num: 1
- Filters: 0
- Fill value: -2147483648
- Enumeration name: flintstones

### Enumeration ###
- Name: flintstones
- Loaded: true
- Type: STRING_ASCII
- Cell Val Num: 4294967295
- Ordered: false
- Element Count: 4

TYPE: BUG
DESC: Don't segfault in ArraySchema::dump

There was no check for whether an enumeration was loaded before
attempting to dump it during a call to ArraySchema::dump. Obviously,
dereferencing nullptr is bad so this avoids doing that.
Copy link

@KiterLuc KiterLuc merged commit 2be338e into dev Dec 19, 2023
62 checks passed
@KiterLuc KiterLuc deleted the pd/sc-38300/fix-schema-dump-with-unloaded-enumerations branch December 19, 2023 09:47
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