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

Buffer reuse/overwrite bug when reading results into types.JSON values #1427

Open
ianrose14 opened this issue Dec 10, 2024 · 1 comment
Open

Comments

@ianrose14
Copy link

If you're having a generation problem please answer these questions before submitting your issue. Thanks!

What version of SQLBoiler are you using (sqlboiler --version)?

SQLBoiler v4.16.1

What is your database and version (eg. Postgresql 10)

Postgresql 12.1

If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)

If this happened at runtime what code produced the issue? (if not applicable leave blank)

What is the output of the command above with the -d flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)

Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)

Further information. What did you do, what did you expect?

I've added a failing testcase here that demonstrates the issue I am having: #1426

I'm not sure how to trigger tests in github. Regardless, this test fails for me locally with:

--- FAIL: TestBindJsonSlice (0.00s)
    reflect_test.go:221: wrong name: {}foo": "bar"}
FAIL
FAIL	github.com/volatiletech/sqlboiler/v4/queries	0.216s
FAIL

Note that the first two characters (which should be {") have been overwriten with the next row's column contents ({}). That's why this looks like a buffer reuse bug to me.

@stephenafamo
Copy link
Collaborator

I've initiated the actions on the PR, so the tests should run now.

I'll label this as a bug. Unfortunately, I don't have time to investigate it now.

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

No branches or pull requests

2 participants