-
-
Notifications
You must be signed in to change notification settings - Fork 840
dolthub/dolt#10866: fix(sql-shell): parse input per character instead of per line #11202
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
9d17015
b9eacae
c752a0f
fd00b4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,4 +208,6 @@ require ( | |
| gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect | ||
| ) | ||
|
|
||
| replace github.com/dolthub/ishell => github.com/codeaucafe/ishell v0.0.0-20260607220657-061915e86568 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this line. run
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe this works for forks/outside contributors like myself. I had to do this same thing when making changes in Doltgres that a Dolt Pr I made needed for it to work/be fixed. That's why I did it this way. I'll find those PRs later tonight to show u what I mean.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. forgot to add: but I'll also try that just to be sure again
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I think you're right this doesn't work because it's a forked repo, instead of a regular branch in the original repo. |
||
|
|
||
| go 1.26.2 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,6 +187,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk | |
| github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= | ||
| github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/Tv1FZd4SCg8axKApyNyRsAt/w= | ||
| github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI= | ||
| github.com/codeaucafe/ishell v0.0.0-20260607220657-061915e86568 h1:zAWHQAgb62ygwjQsDscI9btOt/lWEa5NbgMjKL2y1qM= | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be dolthub/ishell |
||
| github.com/codeaucafe/ishell v0.0.0-20260607220657-061915e86568/go.mod h1:ehexgi1mPxRTk0Mok/pADALuHbvATulTh6gzr7NzZto= | ||
| github.com/colinmarc/hdfs/v2 v2.1.1/go.mod h1:M3x+k8UKKmxtFu++uAZ0OtDU8jR3jnaZIAc6yK4Ue0c= | ||
| github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= | ||
| github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= | ||
|
|
@@ -216,8 +218,6 @@ github.com/dolthub/go-mysql-server v0.20.1-0.20260505171600-5a9dda3f04ff h1:q3GZ | |
| github.com/dolthub/go-mysql-server v0.20.1-0.20260505171600-5a9dda3f04ff/go.mod h1:55n1yslSIZ5uewFbtd82DsYt3f9vUKwnRN5GZJie+nE= | ||
| github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI= | ||
| github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q= | ||
| github.com/dolthub/ishell v0.0.0-20260414231531-5f031e3e9037 h1:oIW9HwuWrhxv+4HZxA+QQSKHLqWFyXZ2FmNjUYwkdiM= | ||
| github.com/dolthub/ishell v0.0.0-20260414231531-5f031e3e9037/go.mod h1:ehexgi1mPxRTk0Mok/pADALuHbvATulTh6gzr7NzZto= | ||
| github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 h1:bMGS25NWAGTEtT5tOBsCuCrlYnLRKpbJVJkDbrTRhwQ= | ||
| github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71/go.mod h1:2/2zjLQ/JOOSbbSboojeg+cAwcRV0fDLzIiWch/lhqI= | ||
| github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216 h1:JWkKRE4EHUcEVQCMRBej8DYxjYjRz/9MdF/NNQh0o70= | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #!/usr/bin/expect -f | ||
| # A ; inside an unclosed block or line comment does not end the statement. | ||
|
|
||
| set timeout 10 | ||
| spawn dolt sql | ||
|
|
||
| expect { | ||
| "> " {} | ||
| timeout { send_user "\nFAIL: no initial prompt\n"; exit 1 } | ||
| } | ||
|
|
||
| # block comment | ||
| send "select /* ;\r" | ||
| expect { | ||
| -exact "-> " {} | ||
| -re "syntax error" { send_user "\nFAIL block: treated as complete\n"; exit 1 } | ||
| timeout { send_user "\nFAIL block: no continuation\n"; exit 1 } | ||
| } | ||
| send "*/ null;\r" | ||
| expect { | ||
| "NULL" {} | ||
| -re "syntax error" { send_user "\nFAIL block: parse failed\n"; exit 1 } | ||
| timeout { send_user "\nFAIL block: no NULL row\n"; exit 1 } | ||
| } | ||
| expect { | ||
| "> " {} | ||
| timeout { send_user "\nFAIL block: no primary prompt\n"; exit 1 } | ||
| } | ||
|
|
||
| # line comment | ||
| send "select -- ;\r" | ||
| expect { | ||
| -exact "-> " {} | ||
| -re "syntax error" { send_user "\nFAIL line: treated as complete\n"; exit 1 } | ||
| timeout { send_user "\nFAIL line: no continuation\n"; exit 1 } | ||
| } | ||
| send "null;\r" | ||
| expect { | ||
| "NULL" {} | ||
| -re "syntax error" { send_user "\nFAIL line: parse failed\n"; exit 1 } | ||
| timeout { send_user "\nFAIL line: no NULL row\n"; exit 1 } | ||
| } | ||
| expect { | ||
| "> " {} | ||
| timeout { send_user "\nFAIL line: no primary prompt\n"; exit 1 } | ||
| } | ||
|
|
||
| send "exit;\r" | ||
| expect eof |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/usr/bin/expect -f | ||
| # An empty Enter stays at the primary prompt instead of entering continuation. | ||
|
|
||
| set timeout 10 | ||
| spawn dolt sql | ||
|
|
||
| expect { | ||
| "> " {} | ||
| timeout { send_user "\nFAIL: no initial prompt\n"; exit 1 } | ||
| } | ||
|
|
||
| send "\r" | ||
| after 200 | ||
| send "select 10865 as ok;\r" | ||
| expect { | ||
| -re "10865" {} | ||
| -re "syntax" { send_user "\nFAIL: syntax error after empty Enter\n"; exit 1 } | ||
| timeout { send_user "\nFAIL: no response\n"; exit 1 } | ||
| } | ||
| expect { | ||
| "> " {} | ||
| timeout { send_user "\nFAIL: no primary prompt\n"; exit 1 } | ||
| } | ||
|
|
||
| send "exit;\r" | ||
| expect eof |
Uh oh!
There was an error while loading. Please reload this page.