-
Notifications
You must be signed in to change notification settings - Fork 346
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
Crashed after executing the command #464
Comments
What's in your |
The |
Are you sure it's empty? It fails when executing an |
I tried many times and finally found the problem. connections:
xxx: xxxx
init: |
\echo date `date` Then after deleting the |
Oh I totally forgot there's a yaml config too, thanks! @kenshaw PTAL, |
I'll look in to this shortly. Probably a simple oversight on my part. |
I'm not able to reproduce this error: ken@ken-desktop:~/Downloads$ mkdir usql
ken@ken-desktop:~/Downloads$ cd usql/
[config.yaml.txt](https://github.com/xo/usql/files/15292979/config.yaml.txt)
ken@ken-desktop:~/Downloads/usql$ mv ../usql_static-0.19.1-linux-amd64.tar.bz2 .
ken@ken-desktop:~/Downloads/usql$ tar -jxvf usql_static-0.19.1-linux-amd64.tar.bz2
usql_static
LICENSE
ken@ken-desktop:~/Downloads/usql$ md5sum usql_static
c110e337bb43dd359c34813bb459366c usql_static
ken@ken-desktop:~/Downloads/usql$ ./usql_static
Type "help" for help.
date Mon May 13 05:18:34 PM WIB 2024
(not connected)=> \q
ken@ken-desktop:~/Downloads/usql$ cat ~/.config/usql/config.yaml
---
init: |
\echo date `date`
ken@ken-desktop:~/Downloads/usql$ ./usql_static -V
usql 0.19.1
ken@ken-desktop:~/Downloads/usql$ Can you please share your exact yaml config file? Note that GitHub doesn't seem to allow uploads of .yaml extensions, for whatever reason. You'll need to rename the file prior to upload. This is the simple debugging config file that I used: |
Are you perhaps using something like Windows encoding? With Are you able to get init: '\echo hi' Which has this output on my system: $ usql
Type "help" for help.
hi
(not connected)=> \q |
I repeat it again. ~$ cat .config/usql/config.yaml
connections:
xx: mysql://xxxx
cr: mysql://xxxx
init: |
\echo `date`
~$ ./usql
Type "help" for help.
panic: runtime error: slice bounds out of range [:43] with capacity 32
goroutine 1 [running]:
github.com/xo/usql/stmt.(*Params).Get(0xc000d0f660, 0xc00173ea28)
github.com/xo/usql/stmt/params.go:86 +0x9fb
github.com/xo/usql/metacmd.(*Params).Get(0xc00174ef00, 0x1)
github.com/xo/usql/metacmd/types.go:164 +0x192
github.com/xo/usql/metacmd.(*Params).GetOptional(0xc0007763c0?, 0xa0?)
github.com/xo/usql/metacmd/types.go:189 +0x13
github.com/xo/usql/metacmd.init.0.func15(0xc00174ef00)
github.com/xo/usql/metacmd/cmds.go:428 +0x2c
github.com/xo/usql/handler.(*Handler).Run.Decode.func3({0x6c8a398, 0xc0015fa9c0})
github.com/xo/usql/metacmd/metacmd.go:26 +0xd8
github.com/xo/usql/metacmd.RunnerFunc.Run(0x56b4360?, {0x6c8a398?, 0xc0015fa9c0?})
github.com/xo/usql/metacmd/types.go:82 +0x4d
github.com/xo/usql/handler.(*Handler).Run(0xc0015fa9c0)
github.com/xo/usql/handler/handler.go:282 +0xb30
main.Run({0x6c2d9c0, 0xabad740}, 0xc001277cb0, 0xc000f22bd0, {0xc000f0cd40, 0xd})
github.com/xo/usql/run.go:355 +0xce2
main.New.func3(0xc00012d808?, {0xabad740?, 0x7?, 0x5ed2453?})
github.com/xo/usql/run.go:126 +0x185
github.com/spf13/cobra.(*Command).execute(0xc00012d808, {0xc0000740a0, 0x0, 0x0})
github.com/spf13/cobra@v1.8.0/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xc00012d808)
github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(0xc0000740a0?, {0x6c2d9c0?, 0xabad740?})
github.com/spf13/cobra@v1.8.0/command.go:1032 +0x47
main.main()
github.com/xo/usql/main.go:40 +0x13c
~$
~$ vim .config/usql/config.yaml
~$ cat .config/usql/config.yaml
connections:
xx: mysql://xxxx
cr: mysql://xxxx
~$
~$ ./usql
Type "help" for help.
(not connected)=> \q
~$ |
Now I found the cause of this problem, because the output of the i = start + len([]rune(z)) - 1 // Line-59 Another solution: |
The text was updated successfully, but these errors were encountered: