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 when showing a table with unsupported data type #4

Open
kmpm opened this issue Oct 30, 2019 · 4 comments
Open

Panic when showing a table with unsupported data type #4

kmpm opened this issue Oct 30, 2019 · 4 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@kmpm
Copy link
Contributor

kmpm commented Oct 30, 2019

The first table I tried to open on the first database I tried to connect to gave me a panic.
OS: Windows 10 Pro 1903 (18364.418) amd64.

And no, I can not give you the schema for the database but I will try to debug some more.

2019/10/30 15:04:23 Successfully connected to MSSQL. @@version: Microsoft SQL Server 2017 (RTM-GDR) (KB4505224) - 14.0.2027.2 (X64)   Jun 15 2019 00:26:19   Copyright (C) 2017 Microsoft Corporation  Standard Edition (64-bit) on Windows Server 2016 Standard 10.0 <X64> (Build 14393: ) (Hypervisor)
2019/10/30 15:04:23 Connecting to mssql db
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8247: interface conversion: interface {} is []uint8, not float64
goroutine 41 [running]:
net/http.(*conn).serve.func1(0xc000554000)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc000d92000)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc000bde0a0, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc000bde0a0, 0xc000d58b00, 0x51, 0x51, 0xc000365100, 0xc00007e380, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc000d58b00, 0x51, 0x51, 0xc000365100, 0xc0004fb740, 0x64, 0x80, 0xc000365100)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc000798000, 0xa6ddc0, 0xc00081e7ff, 0xc000574600, 0xc0004fb740, 0xc0005ce2d0, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc000798000, 0xc000311d00, 0xc000d33c00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc000798000, 0xc000311d00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc000798000, 0xc000311d00)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc000798000, 0xc000311d00)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc000798000, 0xc000113900)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc000554000, 0xa6b040, 0xc0004146c0)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8244: interface conversion: interface {} is []uint8, not float64
goroutine 8 [running]:
net/http.(*conn).serve.func1(0xc0004de000)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc0008a0000)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc000d8e9a0, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc000d8e9a0, 0xc000cfe100, 0x51, 0x51, 0xc0002dc780, 0xc00007e380, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc000cfe100, 0x51, 0x51, 0xc0002dc780, 0xc0004fb740, 0x64, 0x80, 0xc0002dc780)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc000934460, 0xa6ddc0, 0xc0009fd3b7, 0xc000574600, 0xc0004fb740, 0xc0005cf540, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc000934460, 0xc00045cf00, 0xc000697c00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc000934460, 0xc00045cf00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc000934460, 0xc00045cf00)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc000934460, 0xc00045cf00)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc000934460, 0xc00045c500)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc0004de000, 0xa6b040, 0xc000414440)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8245: interface conversion: interface {} is []uint8, not float64
goroutine 68 [running]:
net/http.(*conn).serve.func1(0xc000522000)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc0007901b0)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc000570060, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc000570060, 0xc0000b5700, 0x51, 0x51, 0xc0003b9840, 0xc000620c80, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc0000b5700, 0x51, 0x51, 0xc0003b9840, 0xc0004fb740, 0x64, 0x80, 0xc0003b9840)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc000798000, 0xa6ddc0, 0xc000e2c077, 0xc000574600, 0xc0004fb740, 0xc0005ce140, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc000798000, 0xc000311d00, 0xc000473c00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc000798000, 0xc000311d00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc000798000, 0xc000311d00)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc000798000, 0xc000311d00)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc000798000, 0xc000113900)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc000522000, 0xa6b040, 0xc0003fee80)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8246: interface conversion: interface {} is []uint8, not float64
goroutine 10 [running]:
net/http.(*conn).serve.func1(0xc0004de0a0)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc000790e40)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc000482aa0, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc000482aa0, 0xc00078ec00, 0x51, 0x51, 0xc000053940, 0xc000621440, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc00078ec00, 0x51, 0x51, 0xc000053940, 0xc0004fb740, 0x64, 0x80, 0xc000053940)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc0007a8b60, 0xa6ddc0, 0xc000cc7f2f, 0xc000574600, 0xc0004fb740, 0xc0009dc050, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc0007a8b60, 0xc0003e0b00, 0xc00070bc00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc0007a8b60, 0xc0003e0b00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc0007a8b60, 0xc0003e0b00)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc0007a8b60, 0xc0003e0b00)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc0007a8b60, 0xc0003e0900)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc0004de0a0, 0xa6b040, 0xc000540000)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8243: interface conversion: interface {} is []uint8, not float64
goroutine 32 [running]:
net/http.(*conn).serve.func1(0xc0004940a0)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc0008a1020)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc00068a400, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc00068a400, 0xc000f78b00, 0x51, 0x51, 0xc000b76e40, 0xc000358c40, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc000f78b00, 0x51, 0x51, 0xc000b76e40, 0xc0004fb740, 0x64, 0x80, 0xc000b76e40)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc000874fc0, 0xa6ddc0, 0xc0009245e7, 0xc000574600, 0xc0004fb740, 0xc0003f0f00, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc000874fc0, 0xc00045d600, 0xc00069bc00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc000874fc0, 0xc00045d600)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc000874fc0, 0xc00045d600)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc000874fc0, 0xc00045d600)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc000874fc0, 0xc00045d400)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc0004940a0, 0xa6b040, 0xc0003fec40)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8242: interface conversion: interface {} is []uint8, not float64
goroutine 31 [running]:
net/http.(*conn).serve.func1(0xc000494000)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc000766030)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc000bdeae0, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc000bdeae0, 0xc000ffa680, 0x51, 0x51, 0xc000b77440, 0xc00007e380, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc000ffa680, 0x51, 0x51, 0xc000b77440, 0xc0004fb740, 0x64, 0x80, 0xc000b77440)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc000ac7a40, 0xa6ddc0, 0xc000df5d07, 0xc000574600, 0xc0004fb740, 0xc0003f1f40, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc000ac7a40, 0xc00045d900, 0xc000503c00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc000ac7a40, 0xc00045d900)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc000ac7a40, 0xc00045d900)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc000ac7a40, 0xc00045d900)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc000ac7a40, 0xc00045d700)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc000494000, 0xa6b040, 0xc0003d9f80)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8982: interface conversion: interface {} is []uint8, not float64
goroutine 6332 [running]:
net/http.(*conn).serve.func1(0xc0003c4aa0)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc0005f4030)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc000df2fa0, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc000df2fa0, 0xc001097080, 0x51, 0x51, 0xc000385780, 0xc000358880, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc001097080, 0x51, 0x51, 0xc000385780, 0xc0004fb740, 0x64, 0x80, 0xc000385780)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc000934000, 0xa6ddc0, 0xc000326e4f, 0xc000574600, 0xc0004fb740, 0xc0003f0280, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc000934000, 0xc000113900, 0xc000b3fc00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc000934000, 0xc000113900)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc000934000, 0xc000113900)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc000934000, 0xc000113900)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc000934000, 0xc000311900)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc0003c4aa0, 0xa6b040, 0xc000384840)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8986: interface conversion: interface {} is []uint8, not float64
goroutine 8053 [running]:
net/http.(*conn).serve.func1(0xc0004940a0)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc000d92030)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc000b72860, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc000b72860, 0xc000a03600, 0x51, 0x51, 0xc000322c40, 0xc000620700, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc000a03600, 0x51, 0x51, 0xc000322c40, 0xc0004fb740, 0x64, 0x80, 0xc000322c40)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc000935500, 0xa6ddc0, 0xc000df7fd7, 0xc000574600, 0xc0004fb740, 0xc0003f0f00, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc000935500, 0xc0003e0b00, 0xc000b59c00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc000935500, 0xc0003e0b00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc000935500, 0xc0003e0b00)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc000935500, 0xc0003e0b00)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc000935500, 0xc0003e0900)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc0004940a0, 0xa6b040, 0xc000365100)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8990: interface conversion: interface {} is []uint8, not float64
goroutine 7921 [running]:
net/http.(*conn).serve.func1(0xc000062000)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc000d92930)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc000acb5c0, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc000acb5c0, 0xc001107700, 0x51, 0x51, 0xc0003fec40, 0xc000620c80, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc001107700, 0x51, 0x51, 0xc0003fec40, 0xc0004fb740, 0x64, 0x80, 0xc0003fec40)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc000ac6000, 0xa6ddc0, 0xc000ae3647, 0xc000574600, 0xc0004fb740, 0xc0005ce140, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc000ac6000, 0xc000942500, 0xc000eb1c00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc000ac6000, 0xc000942500)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc000ac6000, 0xc000942500)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc000ac6000, 0xc000942500)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc000ac6000, 0xc0003e0c00)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc000062000, 0xa6b040, 0xc0000528c0)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
2019/10/30 15:04:48 Connecting to mssql db
2019/10/30 15:04:48 http: panic serving 127.0.0.1:8994: interface conversion: interface {} is []uint8, not float64
goroutine 8199 [running]:
net/http.(*conn).serve.func1(0xc0003c59a0)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1746 +0xd7
panic(0x969000, 0xc0005b61e0)
        /home/tim/.gvm/gos/go1.11.1/src/runtime/panic.go:513 +0x1c7
bitbucket.org/timabell/sql-data-viewer/reader.DbValueToString(0x936840, 0xc0007a43c0, 0xc0007340d0, 0x7, 0x10)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/reader/dbReader.go:191 +0x9e3
bitbucket.org/timabell/sql-data-viewer/render.buildCell(0x0, 0x0, 0xc000572b40, 0x936840, 0xc0007a43c0, 0xc000f5a680, 0x51, 0x51, 0xc000b77700, 0xc000621540, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:429 +0x77
bitbucket.org/timabell/sql-data-viewer/render.buildRow(0x0, 0x0, 0xc000f5a680, 0x51, 0x51, 0xc000b77700, 0xc0004fb740, 0x64, 0x80, 0xc000b77700)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:353 +0x181
bitbucket.org/timabell/sql-data-viewer/render.ShowTable(0xa6ad40, 0xc000ac61c0, 0xa6ddc0, 0xc0008cbc77, 0xc000574600, 0xc0004fb740, 0xc0005ce910, 0x9e8386, 0x13, 0x0, ...)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/render/render.go:248 +0x365
bitbucket.org/timabell/sql-data-viewer/serve.TableHandler(0xa6ad40, 0xc000ac61c0, 0xc000942a00, 0xc000cb3c00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:74 +0x502
bitbucket.org/timabell/sql-data-viewer/serve.TableInfoHandler(0xa6ad40, 0xc000ac61c0, 0xc000942a00)
        /home/tim/repo/go/src/bitbucket.org/timabell/sql-data-viewer/serve/table-handlers.go:24 +0x4b
net/http.HandlerFunc.ServeHTTP(0xa04fb8, 0xa6ad40, 0xc000ac61c0, 0xc000942a00)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1964 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0003c23f0, 0xa6ad40, 0xc000ac61c0, 0xc000942a00)
        /home/tim/.gvm/pkgsets/go1.11.1/global/src/github.com/gorilla/mux/mux.go:162 +0xf8
net/http.serverHandler.ServeHTTP(0xc00006eea0, 0xa6ad40, 0xc000ac61c0, 0xc000942800)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2741 +0xb2
net/http.(*conn).serve(0xc0003c59a0, 0xa6b040, 0xc000b77300)
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:1847 +0x64d
created by net/http.(*Server).Serve
        /home/tim/.gvm/gos/go1.11.1/src/net/http/server.go:2851 +0x2fc
@timabell
Copy link
Owner

There will probably be lots more of these. It means I haven't coded support for this particular column data type. Note that there are regression tests for all supported data types.

@kmpm
Copy link
Contributor Author

kmpm commented Oct 30, 2019

My guess from debugging is that the data type is [decimal](9,3).
It seems to be a column of that type that fails.

@kmpm
Copy link
Contributor Author

kmpm commented Oct 30, 2019

It got panic on [ntext], [numeric](5, 2), [numeric](6, 3) and [numeric](11, 5).
The [decimal](9,3) column worked as so far that it showed the 4 bytes of the value as an array.
Showing wrong output is in my view better than a panic. Will see if I can fix something in the interpretation so I actually can explore the schema. I can get the data anyway.

@timabell
Copy link
Owner

Aside: If I was actively working on this I'd probably make it so that it displays everything it can as you mentioned, but in such a way that the integration tests still fail if they encounter such a thing.

kmpm referenced this issue in kmpm/schema-explorer Nov 12, 2019
@timabell timabell added the bug Something isn't working label Jan 28, 2024
@timabell timabell changed the title Panic when showing a table Panic when showing a table with unsupported data type Jan 30, 2024
@timabell timabell added the enhancement New feature or request label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants