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

[Rust] BUG sbe-tool calculate wrong NULL value for uint64 fields #1025

Open
wbprime opened this issue Nov 15, 2024 · 0 comments
Open

[Rust] BUG sbe-tool calculate wrong NULL value for uint64 fields #1025

wbprime opened this issue Nov 15, 2024 · 0 comments

Comments

@wbprime
Copy link
Contributor

wbprime commented Nov 15, 2024

In PrimitiveValue, SBE uint64 value were represented using long type, leading to NULL value of uint64 (which is 2^64^ -1) output as -1.

This is observed in generated Rust code, and might also exists in other lang generated code.

Example:

 <type name="Fixed16u64" description="Array of 16 u64" length="16" primitiveType="uint64" />

<field name="fixed16u64" id="34" type="Fixed16u64"/>

Will generate something in Rust like:

        /// primitive array field 'fixed16u64'
        /// - min value: 0
        /// - max value: -2
        /// - null value: -1
        /// - characterEncoding: null
        /// - semanticType: null
        /// - encodedOffset: 464
        /// - encodedLength: 128
        /// - version: 0
        #[inline]
        pub fn fixed_16_u64(&mut self, value: &[u64; 16]) {

The generated null value in commets was -1.

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

No branches or pull requests

1 participant