[MDEV-27142] Windows - Disable text mode when opening files Created: 2021-11-30 Updated: 2022-11-04 Resolved: 2022-07-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Platform Windows |
| Fix Version/s: | 10.9.2 |
| Type: | Task | Priority: | Major |
| Reporter: | Vladislav Vaintroub | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
By default, C runtime when creating or opening files would use so-called text mode , which means translating LF to CRLF when writing, and CRLF to LF when reading. This is because traditionally, Windows text files used CRLF to indicate end of line. For a while already, since Notepad gained ability to read text files with whatever ending , none of this is necessary. CRT and other libraries have supported reading and writing text files with LF, since very long time. Yet, the added CRLF adds some obscurity whenever it comes to MariaDB (search for 'Win' in this test ported from MySQL. Moreover, there had been subtle bugs in text mode over the years in the C runtime. Nobody benefits from having a extra character inserted and removed every line, at least not since Notepad was fixed. But I think MariaDB would benefit very much from removing obscure code fragments, where it reads "remove \r unconditionally on Windows" in the source code , without much explanation, and then many extra lines were added in the test case to compensate for platform differences (I actually doubt that --binary-mode works on Windows, at all) The plan
|