Closed CmpHDL closed 1 year ago
Hi @CmpHDL , Callstack looks similar to the issue from this thread. Did you manage to create reproducible sample? Also could you share how your destination looks like.
@go-jet Destination is a slice.
var as []A
return as, stmt.Query(db, &as)
type A struct {
model.As
B *B
Cs []C
}
type B struct {
model.Bs
}
type C struct {
model.Cs
}
I've add a new test on bug226 branch that resembles your case. But, I still can't reproduce it.
Could you share what are the field types of As.ID, Bs.ID, Cs.ID in model types. Also is there sql:"primary_key"
tag on those fields?
Did you in any way changed something in jet, or you're just using official tag release?
@go-jet It's interacting with a belongs-to on a property not being selected. Trying to figure it out, this is going to be hard to recreate.
type A struct {
model.As
B *B
Cs []C
D *D
}
// Crash
type D struct {
model.Ds
Z []Z
Y []Y
X []X
}
jet-go select A innerjoin B innerjoin C
// Crash
type D struct {
model.Ds
Z []Z
Y []Y
}
jet-go select A innerjoin B innerjoin C
// Crash
type D struct {
model.Ds
Y []Y
}
jet-go select A innerjoin B innerjoin C
// Crash
type D struct {
model.Ds
Z []Z
}
jet-go select A innerjoin B innerjoin C
// Crash
type D struct {
model.Ds
X []X
}
jet-go select A innerjoin B innerjoin C
// Works
type D struct {
model.Ds
}
jet-go select A innerjoin B innerjoin C
`
Z Y and X are all
type Z struct { model.Zs }
If I put any wrapped model like Z
as a property or slice on D
it crashes even if its not being selected at all.
Ok, I've managed to reproduce it. Could you check if the bug226
branch now fixes the issue for you.
@go-jet Worked, man how do you do it.
Jet v2.9.0
I'm doing an inner join just like any other day and I'm getting the following error with no context. Strangely enough the .DebugSQL() query works when done directly into the DB. And I'm not using any aliases.
Heres the statement but I doubt the reason is here.
It seems to work fine when I remove table.C's Select (and leave the inner-join), although as you can see I'm not aliasing anything so there shouldn't be any name conflicts or similar.