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

cli/sql: bad behavior upon very long pastes #102083

Closed
knz opened this issue Apr 22, 2023 · 1 comment · Fixed by #102084
Closed

cli/sql: bad behavior upon very long pastes #102083

knz opened this issue Apr 22, 2023 · 1 comment · Fixed by #102084
Assignees
Labels
A-cli-client CLI commands that pertain to using SQL features C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@knz
Copy link
Contributor

knz commented Apr 22, 2023

Describe the problem

Found by @fabiog1901

When pasting a very large file, the line editor in the SQL interactive shell misbehaves.

To Reproduce

Try pasting a file that's >2kb in size or >100 lines long.

Jira issue: CRDB-27268
Epic: CRDB-28893

@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-cli-client CLI commands that pertain to using SQL features labels Apr 22, 2023
@knz knz self-assigned this Apr 22, 2023
@blathers-crl blathers-crl bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Apr 22, 2023
@knz
Copy link
Contributor Author

knz commented Apr 22, 2023

There are two separate issues here:

  • there's a hardcoded limit at 99 lines in the editor. When a paste is longer than that, all the lines afterwards start to misbehave.
  • there's an internal line reader bug for input larger than 1-2KB. They only process the first part as a bracketed paste and the remaining lines are processed line-by-line, which is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli-client CLI commands that pertain to using SQL features C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant