Description:
A mysql-client can't open a shared-memory-connection if run under windows vista.
Identical behaviour on winxp/srv2003/win2k if the connection attempt is made from within
a windows-session other than zero (e.g. a remote-desktop-session).
How to repeat:
start the mysql-daemon with shared-memory enabled.
*********************************************************************
* windows vista
*********************************************************************
C:\Programme\mysql\bin>mysql --protocol=memory -hlocalhost -uroot
ERROR 2038 (HY000): Can't open shared memory; client could not create request ev
ent (2)
C:\Programme\mysql\bin>ver
Microsoft Windows [Version 6.0.6000]
SESSIONNAME=console
*********************************************************************
* windows server 2003
*********************************************************************
X:\program files\mysql\bin>mysql --protocol=memory -hlocalhost -uroot
ERROR 2038 (HY000): Can't open shared memory; client could not create request ev
ent (2)
X:\program files\mysql\bin>ver
Microsoft Windows [Version 5.2.3790]
SESSIONNAME=RDP-Tcp#1
Suggested fix:
Whereas XP/2k assigns session zero to the first logged on user, Windows Vista, reserves
session 0 for system processes. The first user to log on is given a session ID number of
one (1) even if this is the console.
The shared-memory-protocol relies on global named (event/filemapping)-objects created by
the server process.
From win-sessions other than 0, named (event)objects need to be prefixed with the
"Global\"-tag to form a valid object-name:
client.c
HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
instead of
OpenEvent(event_access_rights, FALSE, "MYSQL_CONNECT_REQUEST")
we need
OpenEvent(event_access_rights, FALSE, "Global\\MYSQL_CONNECT_REQUEST")
same for OpenFileMapping
:-)
armin.