Re: [Maria-developers] fc90a39426c: MDEV-20604: Duplicate key value is silently truncated to 64 characters in print_keydup_error
Hi, Oleksandr! Looks good. Thanks for tests. Ok to push. One comment, see below. On Mar 25, Oleksandr Byelkin wrote:
revision-id: fc90a39426c (mariadb-10.2.31-87-gfc90a39426c) parent(s): fb74de97287 author: Oleksandr Byelkin <sanja@mariadb.com> committer: Oleksandr Byelkin <sanja@mariadb.com> timestamp: 2020-03-24 10:34:14 +0100 message:
MDEV-20604: Duplicate key value is silently truncated to 64 characters in print_keydup_error
Added indication of truncated string for "s" and "M" formats
diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c index 6ba0a42cf7e..872e88ddd7e 100644 --- a/unittest/mysys/my_vsnprintf-t.c +++ b/unittest/mysys/my_vsnprintf-t.c @@ -168,14 +184,14 @@ int main(void) test1("M with positional: 0 \"Internal error/check (Not system error)\"", "M with positional: %1$M", 0);
- test1("M with width: 0 \"Internal error/ch", + test1("M with width: 0 \"Internal error...", "M with width: %.20M", 0); - test1("M with width positional: 0 \"Internal error/ch", + test1("M with width positional: 0 \"Internal error...", "M with width positional: %2$.*1$M", 20, 0);
- test_w_len("M small buf: 0 \"In", + test_w_len("M small buf: 0 \"..", 19, "M small buf: %M", 0); - test_w_len("M small buf positional: 0 \"In", + test_w_len("M small buf positional: 0 \"..", 30, "M small buf positional: %1$M", 0);
return exit_status();
We didn't discuss truncation when the buffer is too small, only truncation by width. It's not at all clear why truncation by small buffer should also use ellipsis. But it's not clear that it shouldn't either. I don't have a strong opinion in favor of either, so feel free to keep it your way. Regards, Sergei VP of MariaDB Server Engineering and security@mariadb.org
participants (1)
-
Sergei Golubchik