
Otto Kekäläinen via developers <developers@lists.mariadb.org> writes:
My question was here for upstream if you know if that test was intentionally introduced with Windows line endings or if it just happened?
Yes, the file mysql-interactive.result needs to have carriage-returns in it for the test to pass. It is not related to Windows though (this is a Linux-only test), but due to how the test runs the mysql client program in a PTY or something like that. That's the TL;DR, I got curious so got a bit carried away with a longer explanation below ;-)
The .result files are compared verbatim against the test output to check for test passing or failing. So you can easily check this by removing the CR bytes and run the main.mysql-interactive to see if it still pases.
Secondly, I won'd have a Windows machine to test on if the test still works. On my Linux machine the test will surely pass if I remove those endings.
Ok, then I'll test for you :-) I just meant, take an editor, remove a carriage-return character, and see what happens. As I suspected, the test will _not_ pass on Linux: ----------------------------------------------------------------------- main.mysql-interactive [ fail ] Test ended at 2025-05-13 07:30:25 CURRENT_TEST: main.mysql-interactive --- /kvm/src/my/dev/mariadb3/mysql-test/main/mysql-interactive.result 2025-05-13 07:30:23.046065796 +0200 +++ /kvm/src/my/dev/mariadb3/mysql-test/main/mysql-interactive.reject 2025-05-13 07:30:25.666029754 +0200 @@ -3,7 +3,7 @@ # delimiter $ select 1; -$ +$ exit Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is X Result length mismatch ----------------------------------------------------------------------- So you see, the test framework does nothing special about carriage-return characters, it just compares the output verbatim to the .result file. Therefore, if the output contains carriage-returns on some lines (as in this test), then those carriage-returns must be in the .result file. It is not related to "Windows line endings", that test is not even run on windows, it has: source include/not_windows.inc; The test runs the mysql client program interactively (in a terminal), this causes those carriage-return to appear in the output due to PTY or whatever reason. So yes, those carriage-returns in the .result file are "intentional" in the sense that the test as written does not work without them.
Firstly, I cannot use 'patch' to remove Windows line endings. I can't even use it to modify that file due to git attributes or patch itself mangling on them (e.g. https://salsa.debian.org/otto/mariadb-server/-/jobs/7569516). I didn't manage to fully debug which step exactly cleans them away and from what file.
patching file mysql-test/main/mysql-interactive.result Hunk #1 FAILED at 10 (different line endings).
This looks like the patch is incorrect, ie. that the carriage-returns in the patch file are not matching the actual file. This random googled answer suggests it's something with quilt, and has some suggested solution that may or may not work for you depending on how you produced the patch: https://unix.stackexchange.com/questions/793759/apply-debian-quilt-patch-on-... Try opening the patch file and the file mysql-test/main/mysql-interactive.result in an editor that shows carriage-returns, and check that the line endings in the two file match.
I need to patch this file in the Debian packaging. I could alternatively also just disable this new test, so it is not a showstopper.
I tried manually patching the file with the `patch` program, that seems to work fine (see attached example). It can modify the test in the file without corrupting the line endings: patch -p0 < /tmp/1.patch
I need to patch this file in the Debian packaging. I could alternatively also just disable this new test, so it is not a showstopper.
It seems to be some issue with how Debian tooling (or the particular usage of it in the mariadb package when generating or applying the patch), presumably there's some way to handle that, it can't be the first time that debian/patches needs to modify files with carriage-return in them. But yes, if it is tricky to sort out, then agree, not critical, just disable the test with a comment that there was some unresolved issue with required patching of a file with partial carriage-returns in it. - Kristian.