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

panic on sql_table #248

Closed
mdigger opened this issue Nov 29, 2022 · 1 comment · Fixed by #519
Closed

panic on sql_table #248

mdigger opened this issue Nov 29, 2022 · 1 comment · Fixed by #519
Assignees
Labels
bug Something isn't working

Comments

@mdigger
Copy link

mdigger commented Nov 29, 2022

test {
    shape: sql_table
    test_id: varchar(64) {constraint: [primary_key, foreign_key]}
}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x100e364dc]

goroutine 51 [running]:
oss.terrastruct.com/d2/d2compiler.(*compiler).compileSQLTable(0x140000bea20?, 0x14001ea81c0)
        /Users/ec2-user/src/d2/d2compiler/compile.go:669 +0x70c
oss.terrastruct.com/d2/d2compiler.(*compiler).compileShapes(0x140000261f8?, 0x14001ea8000)
        /Users/ec2-user/src/d2/d2compiler/compile.go:566 +0x168
oss.terrastruct.com/d2/d2compiler.compileAST({0x0, 0x0}, {0x0?, {0x0?, 0x14000334900?, 0x1400007a720?}}, 0x140000be900)
        /Users/ec2-user/src/d2/d2compiler/compile.go:57 +0x178
oss.terrastruct.com/d2/d2compiler.Compile({0x0, 0x0}, {0x103221840, 0x1400007a720}, 0x14000334900?)
        /Users/ec2-user/src/d2/d2compiler/compile.go:40 +0xcc
oss.terrastruct.com/d2.Compile({0x1032252b8, 0x14000626040}, {0x14000034540, 0x61}, 0x14000608d78?)
        /Users/ec2-user/src/d2/d2.go:30 +0xbc
main.compile({0x1032252b8, 0x14000626040}, 0x14000608d88?, {0x103224f98, 0x1036d1e00}, 0x0, {0x16f4176ae?, 0x0?}, {0x16f4176b4, 0x6}, ...)
        /Users/ec2-user/src/d2/cmd/d2/main.go:190 +0xe0
main.(*watcher).compileLoop(0x14000634000, {0x1032252b8, 0x14000626040})
        /Users/ec2-user/src/d2/cmd/d2/watch.go:348 +0x2c4
main.(*watcher).goFunc.func1()
        /Users/ec2-user/src/d2/cmd/d2/watch.go:187 +0x7c
created by main.(*watcher).goFunc
        /Users/ec2-user/src/d2/cmd/d2/watch.go:183 +0x8c

:)

@alixander alixander transferred this issue from terrastruct/d2-docs Nov 29, 2022
@alixander alixander added the bug Something isn't working label Nov 29, 2022
@alixander alixander added this to D2 Nov 29, 2022
@alixander alixander self-assigned this Nov 29, 2022
@alixander alixander moved this to Done in D2 Dec 24, 2022
@janydoe
Copy link
Contributor

janydoe commented Jun 14, 2023

now we can use primary_key_foreign_key #1245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants