Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

GUID bytes are incorrect #2

Open
robsmith11 opened this issue Jun 25, 2017 · 3 comments
Open

GUID bytes are incorrect #2

robsmith11 opened this issue Jun 25, 2017 · 3 comments

Comments

@robsmith11
Copy link

It appears that only the last 8 bytes of a GUID are captured.

For example, here's an embedded rust function that simply prints an atomic GUID:

#[no_mangle]
pub extern fn f(k: *const K) -> *const K {
    match KVal::new(k) {
        KVal::Guid(KData::Atom(a)) => { println!("{:?}", a); kvoid() }
        _ => kerror("nyi")
    }
}
q)f 0x0 sv 16#0xff
[1, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255]
@rahulpowar
Copy link

@robsmith11 I forked your branch and fixed this https://github.com/redsift/krust

Looks like a GUID is always stored using the list struct in the k0 union (as a list of size 1). Above you are seeing the size_t (set to 1) and the first 8 bytes. I could submit the PR to @adwhit but not sure if this package is live or if one of us should take it on?

@robsmith11
Copy link
Author

@rahulpowar

That's awesome! I still use krust on a regular basis, but have been avoiding use of GUIDs. Also nice that you fixed kdb error strings.

If you're up for it, I'd recommend you take on maintenance. Your rust and kdb knowledge appears to be beyond mine, and from adwhit's comment in #1 , it sounds like he is no longer an active user.

I also have some code that hasn't been pushed to my github. I wrote a proc_macro to derive boiler-plate code to convert any Vec of named primitive field structs into a kdb table. It needs to be cleaned up a bit first though.

@rahulpowar
Copy link

@robsmith11

Moved a few things around and switched from a fork to a new package on crates.io at https://github.com/redsift/rkdb

Just noticed you pushed your proc_macro up on your fork. Would be very happy to take a PR at the new repo as we plan to be active there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants