-
-
Notifications
You must be signed in to change notification settings - Fork 831
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 all commits
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 |
|---|---|---|
| @@ -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.