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

Fix SQL truncated when print-level or print-length are changed #93

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

kisaragi-hiu
Copy link
Contributor

For long values or statements (like saving entire hash tables into a field, for instance), if print-level and print-length were not reset to nil, format (prin1-to-string under the hood) would truncate the string, leading to an invalid value being sent.

    ;; Last 5 characters of the string
    ;; (eval-last-sexp does its own truncation)
    (s-right 5 (format "%s" (make-list 100 t)))
    ;; -> " t t)" if the result is not truncated
    ;;    " ...)" if it is

For long values or statements (like saving entire hash tables into a
field, for instance), if print-level and print-length were not reset
to nil, `format` (`prin1-to-string` under the hood) would truncate the
string, leading to an invalid value being sent.

    ;; Last 5 characters of the string
    ;; (eval-last-sexp does its own truncation)
    (s-right 5 (format "%s" (make-list 100 t)))
    ;; -> " t t)" if the result is not truncated
    ;;    " ...)" if it is
@tarsius tarsius merged commit 2e9e2d6 into magit:master Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants