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

Go bindings bug, same code returns different keys on macOS and Ubuntu #11922

Open
davidsky opened this issue Feb 3, 2025 · 0 comments
Open

Comments

@davidsky
Copy link

davidsky commented Feb 3, 2025

Tested with:
FDB 7.1.61 and 7.3.57
Go 1.22.2 and 1..23.5
Multiple Ubuntu (Including WSL), and macOS.

To replicate, run:

package main

import (
	"log"
	"github.com/apple/foundationdb/bindings/go/src/fdb"
)

func main() {
	fdb.MustAPIVersion(730)
	db := fdb.MustOpenDefault()

	key := fdb.Key("hello")
	_, _ = db.Transact(func(tr fdb.Transaction) (any, error) {
		tr.Set(key, []byte("world"))
		return nil, nil
	})

	_, _ = db.Transact(func(tr fdb.Transaction) (any, error) {
		keySelector := fdb.KeySelector{Key: key, OrEqual: true, Offset: 2}
		nextKey := tr.GetKey(keySelector).MustGet()
		log.Println("nextKey: ", nextKey)
		return nil, nil
	})
}

macOS prints nextKey: \xfe\x01\x14\x00\x14\x02system\x00
Ubuntu prints nextKey: \xff

@davidsky davidsky changed the title Go bindings returns different keys on macOS and Ubuntu Go bindings, same code returns different keys on macOS and Ubuntu Feb 3, 2025
@davidsky davidsky changed the title Go bindings, same code returns different keys on macOS and Ubuntu Go bindings bug, same code returns different keys on macOS and Ubuntu Feb 3, 2025
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