Branch: Tag:

2015-06-10

2015-06-10 15:21:55 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Mysql: Fixed use of mysql_real_connect().

It seems the #define of HAVE_MYSQL_REAL_CONNECT was lost during
an edit of the configure script some time ago.

This fixes linking with modern mysql client libraries, where
the variable mysql_unix_port has become internal.

124:      struct program * mysql_error_program = NULL;    + #ifndef HAVE_MYSQL_REAL_CONNECT   #if defined(HAVE_MYSQL_PORT) || defined(HAVE_MYSQL_UNIX_PORT)   #ifdef HAVE_MYSQL_PORT   extern unsigned int mysql_port;
144:   #define STUPID_PORT_DESTROY()   #endif /* _REENTRANT */   #endif /* HAVE_MYSQL_PORT */ + #endif /* !HAVE_MYSQL_REAL_CONNECT */      #ifdef _REENTRANT   #define MYSQL_LOCK (&(PIKE_MYSQL->lock))
517:       MYSQL_ALLOW();    - #if defined(HAVE_MYSQL_PORT) || defined(HAVE_MYSQL_UNIX_PORT) -  STUPID_PORT_LOCK(); - #endif /* HAVE_MYSQL_PORT || HAVE_MYSQL_UNIX_PORT */ +    #ifdef HAVE_MYSQL_REAL_CONNECT    socket = mysql_real_connect(mysql, host, user, password,    NULL, port, portptr, options);   #else -  + #if defined(HAVE_MYSQL_PORT) || defined(HAVE_MYSQL_UNIX_PORT) +  STUPID_PORT_LOCK(); + #endif /* HAVE_MYSQL_PORT || HAVE_MYSQL_UNIX_PORT */      #ifdef HAVE_MYSQL_PORT    if (port) {
551:    }   #endif /* HAVE_MYSQL_UNIX_PORT */    - #endif /* HAVE_MYSQL_REAL_CONNECT */ +    #if defined(HAVE_MYSQL_PORT) || defined(HAVE_MYSQL_UNIX_PORT)    STUPID_PORT_UNLOCK();   #endif /* HAVE_MYSQL_PORT || MAVE_MYSQL_UNIX_PORT*/ -  + #endif /* HAVE_MYSQL_REAL_CONNECT */       MYSQL_DISALLOW();