go-sqlcmd icon indicating copy to clipboard operation
go-sqlcmd copied to clipboard

sqlcmd panic when run inside emacs

Open the42 opened this issue 2 weeks ago • 0 comments

Precondition: currentcontext ist set

On Windows 11

I open bash

I execute sqlcmd -G

I can use the current cotext = issue queries.

I open emacs from that shell

I spawn an integrated shell

I run sqlcmd -G

panic:

sqlcmd -G panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x28 pc=0xddb842]

goroutine 1 [running]: github.com/microsoft/go-sqlcmd/pkg/sqlcmd.(*Sqlcmd).scanNext(...) /__w/1/s/go-sqlcmd/pkg/sqlcmd/sqlcmd.go:115 github.com/microsoft/go-sqlcmd/pkg/sqlcmd.(*Batch).Next(0xc000230400) /__w/1/s/go-sqlcmd/pkg/sqlcmd/batch.go:86 +0x56 github.com/microsoft/go-sqlcmd/pkg/sqlcmd.(*Sqlcmd).Run(0xc00029e000, 0x40?, 0x1) /__w/1/s/go-sqlcmd/pkg/sqlcmd/sqlcmd.go:143 +0x24a github.com/microsoft/go-sqlcmd/cmd/sqlcmd.run(0xc00011e0c0, 0x1ae93e0) /__w/1/s/go-sqlcmd/cmd/sqlcmd/sqlcmd.go:882 +0xe4a github.com/microsoft/go-sqlcmd/cmd/sqlcmd.Execute.func2(0xc00016c308, {0xc000254a60?, 0x4?, 0x1023798?}) /__w/1/s/go-sqlcmd/cmd/sqlcmd/sqlcmd.go:251 +0x427 github.com/spf13/cobra.(*Command).execute(0xc00016c308, {0xc0004913b0, 0x1, 0x1}) /go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x847 github.com/spf13/cobra.(*Command).ExecuteC(0xc00016c308) /go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5 github.com/spf13/cobra.(*Command).Execute(...) /go/pkg/mod/github.com/spf13/[email protected]/command.go:968 github.com/microsoft/go-sqlcmd/cmd/sqlcmd.Execute({0x1381ccc, 0x6}) /__w/1/s/go-sqlcmd/cmd/sqlcmd/sqlcmd.go:275 +0x18e main.main() /__w/1/s/go-sqlcmd/cmd/modern/main.go:52 +0x209

the42 avatar Nov 17 '25 15:11 the42