From 67ac0f9761b48f6c09adcb1bba6bd2a577d1c105 Mon Sep 17 00:00:00 2001 From: mi Date: Fri, 25 Feb 2005 16:25:33 +0000 Subject: Fix a crash, that affected users of modern versions of MySQL. Reported and tested by: Yves Gurin --- databases/tcl-Mysql/Makefile | 2 +- databases/tcl-Mysql/files/Makefile.bsd | 1 + databases/tcl-Mysql/files/patch-real_connect | 19 +++++++++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/databases/tcl-Mysql/Makefile b/databases/tcl-Mysql/Makefile index 4de968f7741..90294d4dde5 100644 --- a/databases/tcl-Mysql/Makefile +++ b/databases/tcl-Mysql/Makefile @@ -7,7 +7,7 @@ PORTNAME= ${TCL_NODOT}-sql PORTVERSION= 20000114 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= databases ${TCL_NODOT} MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= tcl-sql diff --git a/databases/tcl-Mysql/files/Makefile.bsd b/databases/tcl-Mysql/files/Makefile.bsd index b8f4f14b1cf..9ee4ba62e04 100644 --- a/databases/tcl-Mysql/files/Makefile.bsd +++ b/databases/tcl-Mysql/files/Makefile.bsd @@ -6,6 +6,7 @@ CC = ${CXX} # a hack to force linking with c++ SRCS = sql-mysql.cc sql.cc sql-manager.cc CXXFLAGS+= -I${LOCALBASE}/include/${TCL_VERSION} CXXFLAGS+= -I${LOCALBASE}/include/mysql +CXXFLAGS+= -O0 -g LDADD += -L${LOCALBASE}/lib -l${TCL_NODOT} LDADD += -L${LOCALBASE}/lib/mysql -lmysqlclient diff --git a/databases/tcl-Mysql/files/patch-real_connect b/databases/tcl-Mysql/files/patch-real_connect index 9b966ac3cb7..f70f1715ac5 100644 --- a/databases/tcl-Mysql/files/patch-real_connect +++ b/databases/tcl-Mysql/files/patch-real_connect @@ -1,11 +1,22 @@ +Simulate the "old" mysql_connect() function -- the actual code +is adapted from MySQL's libmysql.c. + + -mi + --- sql-mysql.cc Wed Jan 12 20:50:03 2000 +++ sql-mysql.cc Wed Nov 10 18:49:18 2004 -@@ -2,4 +2,9 @@ +@@ -2,4 +2,15 @@ #include "sql-mysql.h" -+#ifdef HAVE_MYSQL_REAL_CONNECT -+# define mysql_connect(h, ho, us, pa) \ -+ mysql_real_connect(h, ho, us, pa, NULL, 0, NULL, 0) ++#if defined(HAVE_MYSQL_REAL_CONNECT) && !defined(USE_OLD_FUNCTIONS) ++static MYSQL * STDCALL ++mysql_connect(MYSQL *mysql,const char *host, ++ const char *user, const char *passwd) ++{ ++ ++ mysql=mysql_init(mysql); ++ return mysql_real_connect(mysql, host, user, passwd, NULL, 0, NULL, 0); ++} +#endif + // ------------------------------------------------------------- -- cgit