[MDEV-19781] Create MariaDB named commands on Windows Created: 2019-06-17  Updated: 2019-11-27  Resolved: 2019-11-26

Status: Closed
Project: MariaDB Server
Component/s: Platform Windows
Affects Version/s: None
Fix Version/s: 10.4.11

Type: Bug Priority: Critical
Reporter: Rasmus Johansson (Inactive) Assignee: Rasmus Johansson (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-17591 Create MariaDB named commands Closed

 Description   

Windows needs a different solution for MariaDB named commands. For linux the commands ar added as symlinks in cmake, which doesn't work on Windows.



 Comments   
Comment by Thirunarayanan Balathandayuthapani [ 2019-07-10 ]

The following commits have wrongly committed as MDEV-19781. It was supposed to be for MDEV-19871. please ignore the following
commits:

commit 41f6e68878df46dd7abc8a98234f58a1fa030592
Author: Thirunarayanan Balathandayuthapani <thiru@mariadb.com>
Date:   Mon Jul 1 21:58:20 2019 +0530
 
    MDEV-19781 Add page id matching check in innochecksum tool
 
commit 40c1f4bd4cdd8f8ed69c466e151a2c52f7b79b72
Author: Thirunarayanan Balathandayuthapani <thiru@mariadb.com>
Date:   Mon Jul 1 20:21:26 2019 +0530
 
    MDEV-19781 Add page id matching check in innochecksum tool
 
commit 0c6514eece98d6817bdf11830244c068b17bd06b
Author: Marko Mäkelä <marko.makela@mariadb.com>
Date:   Tue Jul 2 21:33:54 2019 +0300
 
    MDEV-19781: Skip the test for embedded server

Comment by Rasmus Johansson (Inactive) [ 2019-08-16 ]

wlad,

Can you give commit 08b1917 in branch bb-10.4-MDEV-19781 a review?

Comment by Rasmus Johansson (Inactive) [ 2019-11-10 ]

wlad I finally got further with this. Can you review latest revision 10092fdc4f4d351918 in the branch bb-10.4-MDEV-19781?

Comment by Vladislav Vaintroub [ 2019-11-11 ]

Hi Rasmus,
this will work. Feel free to push. However, there are some rough angles in this patch . I could fix them later.

  • 2 parallel string arrays
    Would be better (easier to read) to have

static struct

{ wstring exe, wstring symlink}

symlinks[] =
{

{L"mysqld.exe", L"mariadbd.exe"}

,
....
}

It is easier to read, because you do have to rely on the positions in the arrays to correspond.

  • it would be better if this array was stored in a CMake-generated file, based on the information that is already in CMakeLists.txt . So you would not have to change it every time new exe is added.
  • C++17 is an overkill, for that one symlink operation. We're on Windows, this is part of the Windows installer , it will never will be ported to anything else. Given that, CreateSymbolicLinkW() does what needs to do done.
    Some people are still using VS2015, (we recently had a bug report), and I have no idea if C++ 17 filesystem still works with it. We can also build with clang-cl, and do not know if clang-cl supports C++17 filesystem.
Comment by Rasmus Johansson (Inactive) [ 2019-11-17 ]

I've now removed C++17 and changed to use CreateSymbolicLinkW. Now the lists of executables are read from cmake where they are present for the Linux implementation.

The new commit is 0a6fb738c00

Comment by Vladislav Vaintroub [ 2019-11-22 ]

Hi Rasmus.
this is ok to push.
If you do not mind, I might still create a cleanup commit on top of it, so that the source and destination lists are not stored in MSI (I'd rather have a generated C/C++ file with source->destination file mapping )

Comment by Rasmus Johansson (Inactive) [ 2019-11-26 ]

Pushed https://github.com/MariaDB/server/commit/b6f7ec6a5b8da27866136d50f50337fcce64eff5

Generated at Thu Feb 08 08:54:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.