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

Appending a NULL in UUID[] column panics #214

Closed
disq opened this issue May 16, 2024 · 2 comments
Closed

Appending a NULL in UUID[] column panics #214

disq opened this issue May 16, 2024 · 2 comments

Comments

@disq
Copy link

disq commented May 16, 2024

I thought with #193 for nulls we'd have to use untyped nils for NULL values, doing so doesn't seem to work for uuid[] columns.

panic: interface conversion: interface {} is nil, not duckdb.UUID

goroutine 23 [running]:
github.com/marcboeker/go-duckdb.(*vector).init.(*vector).initUUID.func15(0x1400163a410?, 0x0?, {0x0?, 0x0?})
	/user/go/pkg/mod/github.com/marcboeker/[email protected]/appender_vector.go:393 +0x98
github.com/marcboeker/go-duckdb.(*vector).setList(0x1400163a3c0, 0x0, {0x1075199e0?, 0x14001c8c510?})
	/user/go/pkg/mod/github.com/marcboeker/[email protected]/appender_vector.go:333 +0x164
github.com/marcboeker/go-duckdb.(*vector).initList.func3(0x14001aecb90?, 0x107518de0?, {0x1075199e0?, 0x14001c8c510?})
	/user/go/pkg/mod/github.com/marcboeker/[email protected]/appender_vector.go:426 +0x24
github.com/marcboeker/go-duckdb.(*Appender).appendRowSlice(0x140000d6090, {0x14000af4008, 0xbd, 0xbd?})
	/user/go/pkg/mod/github.com/marcboeker/[email protected]/appender.go:205 +0x114
github.com/marcboeker/go-duckdb.(*Appender).AppendRow(0x107806fd8?, {0x14000af4008?, 0x140005f2808?, 0xbd?})
	/user/go/pkg/mod/github.com/marcboeker/[email protected]/appender.go:142 +0x28

I tried a typed nil (of *duckdb.UUID) which gave me:
database/sql/driver: could not append row: cast error: cannot cast *duckdb.UUID to duckdb.UUID: column index: 47

So, what's the correct way to insert nulls using appender?

@disq disq changed the title Appending a NULL in UUID column panics Appending a NULL in UUID[] column panics May 16, 2024
@taniabogatsch
Copy link
Collaborator

Hi @disq. Could you add a self-contained Go program to reproduce this, please? Then I can have a look

@disq
Copy link
Author

disq commented Sep 3, 2024

This seems fixed, I no longer get panic: interface conversion: interface {} is nil, not duckdb.UUID

@disq disq closed this as completed Sep 3, 2024
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

2 participants