Date: Wed, 11 Jan 2006 22:12:36 +0100 From: "Björn König" <bkoenig@cs.tu-berlin.de> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/91684: Update port databases/mysqltcl: it works with MySQL 3.23 and 4.0 now Message-ID: <20060111211236.217DB5285C@eurystheus.local> Resent-Message-ID: <200601112120.k0BLK0Kh042420@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 91684 >Category: ports >Synopsis: Update port databases/mysqltcl: it works with MySQL 3.23 and 4.0 now >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Wed Jan 11 21:20:00 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Björn König >Release: FreeBSD 6.0-RELEASE-p1 i386 >Organization: >Environment: >Description: The following patch allows you to use mysqltcl 3.01 with MySQL 3.23 and 4.0. Users that are affected by this patch will be notified by a package message if they install mysqltcl. Nothing changed for users of MySQL 4.1 and 5.0. >How-To-Repeat: >Fix: --- mysqltcl-2006011101.diff begins here --- diff -ruN mysqltcl.orig/Makefile mysqltcl/Makefile --- mysqltcl.orig/Makefile Sun Oct 2 18:36:20 2005 +++ mysqltcl/Makefile Wed Jan 11 22:06:34 2006 @@ -16,7 +16,6 @@ LIB_DEPENDS= ${TCL_NODOT}:${PORTSDIR}/lang/${TCL_NODOT} USE_MYSQL= yes -BROKEN_WITH_MYSQL= 323 40 TCL_VERSION?= tcl8.4 TCL_NODOT= ${TCL_VERSION:S/.//} SQL_DIR= ${PREFIX}/lib/${TCL_VERSION}/mysqltcl @@ -31,15 +30,22 @@ REINPLACE_ARGS= -i '' pre-patch: - ${REINPLACE_CMD} -e 's, * ,,' ${WRKSRC}/generic/*.[ch] + @${REINPLACE_CMD} -e 's, * ,,' ${WRKSRC}/generic/*.[ch] do-install: - ${MKDIR} ${SQL_DIR} - ${INSTALL_DATA} ${WRKSRC}/${LIB_NAME} ${SQL_DIR} - ${ECHO} "package ifneeded mysqltcl ${PORTVERSION} {load ${SQL_DIR}/${LIB_NAME}}" \ + @${MKDIR} ${SQL_DIR} + @${INSTALL_DATA} ${WRKSRC}/${LIB_NAME} ${SQL_DIR} + @${ECHO} "package ifneeded mysqltcl ${PORTVERSION} {load ${SQL_DIR}/${LIB_NAME}}" \ > ${SQL_DIR}/pkgIndex.tcl - ${INSTALL_MAN} ${WRKSRC}/doc/${MANN} ${PREFIX}/man/mann + @${INSTALL_MAN} ${WRKSRC}/doc/${MANN} ${PREFIX}/man/mann + +post-install: + @${TEST} ! -f ${PKGMESSAGE} || ${CAT} ${PKGMESSAGE} .include <bsd.port.mk> + +.if ${MYSQL_VER} == 323 || ${MYSQL_VER} == 40 +PKGMESSAGE= ${PKGDIR}/pkg-message-legacy +.endif LIB_NAME!= ${MAKE_ENV} ${MAKE} -f ${FILESDIR}/Makefile.bsd -V SHLIB_NAME diff -ruN mysqltcl.orig/files/patch-generic::mysqltcl.c mysqltcl/files/patch-generic::mysqltcl.c --- mysqltcl.orig/files/patch-generic::mysqltcl.c Thu Jan 1 01:00:00 1970 +++ mysqltcl/files/patch-generic::mysqltcl.c Wed Jan 11 21:17:14 2006 @@ -0,0 +1,305 @@ +--- generic/mysqltcl.c.orig Wed Jan 11 21:08:48 2006 ++++ generic/mysqltcl.c Wed Jan 11 21:17:10 2006 +@@ -95,6 +95,8 @@ + /* C variable corresponding to mysqlstatus(nullvalue) */ + #define MYSQL_NULLV_INIT "" + ++#define FUNCTION_NOT_AVAILABLE "function not available" ++ + /* Check Level for mysql_prologue */ + enum CONNLEVEL {CL_PLAIN,CL_CONN,CL_DB,CL_RES}; + +@@ -183,7 +185,6 @@ + static int MysqlNullSet(Tcl_Interp *interp, Tcl_Obj *objPtr) + { + Tcl_ObjType *oldTypePtr = objPtr->typePtr; +- Tcl_HashEntry *entryPtr; + + if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { + oldTypePtr->freeIntRepProc(objPtr); +@@ -803,6 +804,7 @@ + if (booleanflag) + flags |= CLIENT_ODBC; + break; ++#if (MYSQL_VERSION_ID >= 40107) + case MYSQL_MULTISTATEMENT_OPT: + if (Tcl_GetBooleanFromObj(interp,objv[++i],&booleanflag) != TCL_OK ) + return TCL_ERROR; +@@ -817,6 +819,7 @@ + if (booleanflag) + flags |= CLIENT_MULTI_RESULTS; + break; ++#endif + + case MYSQL_LOCALFILES_OPT: + if (Tcl_GetBooleanFromObj(interp,objv[++i],&booleanflag) != TCL_OK ) +@@ -876,9 +879,11 @@ + #if (MYSQL_VERSION_ID>=32350) + mysql_options(handle->connection,MYSQL_READ_DEFAULT_GROUP,groupname); + #endif ++#if (MYSQL_VERSION_ID >= 40107) + if (isSSL) { + mysql_ssl_set(handle->connection,sslkey,sslcert, sslca, sslcapath, sslcipher); + } ++#endif + + if (!mysql_real_connect(handle->connection, hostname, user, + password, db, port, socket, flags)) { +@@ -1388,8 +1393,8 @@ + static int Mysqltcl_Receive(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { + MysqltclState *statePtr = (MysqltclState *)clientData; +- int code ; +- int count ; ++ int code = TCL_ERROR; ++ int count = 0; + + MysqlTclHandle *handle; + int idx ; +@@ -1397,7 +1402,6 @@ + Tcl_Obj** listObjv ; + MYSQL_ROW row ; + int *val = NULL; +- int breakLoop = 0; + unsigned long *lengths; + + +@@ -1455,15 +1459,9 @@ + switch(code=Tcl_EvalObjEx(interp, objv[4],0)) { + case TCL_CONTINUE: + case TCL_OK: +- break ; +- case TCL_BREAK: +- breakLoop=1; +- break; +- default: +- breakLoop=1; +- break; ++ continue; + } +- if (breakLoop==1) break; ++ break; + } + } + if (val!=NULL) { +@@ -1592,6 +1590,7 @@ + Tcl_SetObjResult(interp, Tcl_NewStringObj(val,-1)); + } + break; ++#if (MYSQL_VERSION_ID >= 40107) + case MYSQL_INF_SERVERVERSION: + Tcl_SetObjResult(interp, Tcl_NewStringObj(mysql_get_server_info(handle->connection),-1)); + break; +@@ -1604,6 +1603,7 @@ + case MYSQL_INFO_STATE: + Tcl_SetObjResult(interp, Tcl_NewStringObj(mysql_stat(handle->connection),-1)); + break; ++#endif + default: /* should never happen */ + return mysql_prim_confl(interp,objc,objv,"weirdness in Mysqltcl_Info") ; + } +@@ -1625,6 +1625,7 @@ + int idx ; + Tcl_Obj *resList; + char **option; ++#if (MYSQL_VERSION_ID >= 40107) + static CONST char* MysqlInfoOpt[] = + { + "connectparameters", "clientversion","clientversionid", NULL +@@ -1632,6 +1633,15 @@ + enum baseoption { + MYSQL_BINFO_CONNECT, MYSQL_BINFO_CLIENTVERSION,MYSQL_BINFO_CLIENTVERSIONID + }; ++#else ++ static CONST char* MysqlInfoOpt[] = ++ { ++ "connectparameters", "clientversion", NULL ++ }; ++ enum baseoption { ++ MYSQL_BINFO_CONNECT, MYSQL_BINFO_CLIENTVERSION ++ }; ++#endif + + if (objc <2) { + Tcl_WrongNumArgs(interp, 1, objv, "connectparameters | clientversion"); +@@ -1657,9 +1667,11 @@ + case MYSQL_BINFO_CLIENTVERSION: + Tcl_SetObjResult(interp, Tcl_NewStringObj(mysql_get_client_info(),-1)); + break; ++#if (MYSQL_VERSION_ID >= 40107) + case MYSQL_BINFO_CLIENTVERSIONID: + Tcl_SetObjResult(interp, Tcl_NewIntObj(mysql_get_client_version())); + break; ++#endif + } + return TCL_OK ; + } +@@ -1974,6 +1986,10 @@ + + static int Mysqltcl_AutoCommit(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { ++#if (MYSQL_VERSION_ID < 40107) ++ Tcl_AddErrorInfo(interp, FUNCTION_NOT_AVAILABLE); ++ return TCL_ERROR; ++#else + MysqlTclHandle *handle; + int isAutocommit = 0; + +@@ -1986,6 +2002,7 @@ + mysql_server_confl(interp,objc,objv,handle->connection); + } + return TCL_OK; ++#endif + } + /* + *---------------------------------------------------------------------- +@@ -1997,6 +2014,10 @@ + + static int Mysqltcl_Commit(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { ++#if (MYSQL_VERSION_ID < 40107) ++ Tcl_AddErrorInfo(interp, FUNCTION_NOT_AVAILABLE); ++ return TCL_ERROR; ++#else + MysqlTclHandle *handle; + + if ((handle = mysql_prologue(interp, objc, objv, 2, 2, CL_CONN, +@@ -2006,6 +2027,7 @@ + mysql_server_confl(interp,objc,objv,handle->connection); + } + return TCL_OK; ++#endif + } + /* + *---------------------------------------------------------------------- +@@ -2017,6 +2039,10 @@ + + static int Mysqltcl_Rollback(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { ++#if (MYSQL_VERSION_ID < 40107) ++ Tcl_AddErrorInfo(interp, FUNCTION_NOT_AVAILABLE); ++ return TCL_ERROR; ++#else + MysqlTclHandle *handle; + + if ((handle = mysql_prologue(interp, objc, objv, 2, 2, CL_CONN, +@@ -2026,6 +2052,7 @@ + mysql_server_confl(interp,objc,objv,handle->connection); + } + return TCL_OK; ++#endif + } + /* + *---------------------------------------------------------------------- +@@ -2037,6 +2064,10 @@ + + static int Mysqltcl_MoreResult(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { ++#if (MYSQL_VERSION_ID < 40107) ++ Tcl_AddErrorInfo(interp, FUNCTION_NOT_AVAILABLE); ++ return TCL_ERROR; ++#else + MysqlTclHandle *handle; + int boolResult = 0; + +@@ -2046,6 +2077,7 @@ + boolResult = mysql_more_results(handle->connection); + Tcl_SetObjResult(interp,Tcl_NewBooleanObj(boolResult)); + return TCL_OK; ++#endif + } + /* + +@@ -2059,6 +2091,10 @@ + + static int Mysqltcl_NextResult(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { ++#if (MYSQL_VERSION_ID < 40107) ++ Tcl_AddErrorInfo(interp, FUNCTION_NOT_AVAILABLE); ++ return TCL_ERROR; ++#else + MysqlTclHandle *handle; + int result = 0; + +@@ -2085,6 +2121,7 @@ + Tcl_SetObjResult(interp, Tcl_NewIntObj(handle->res_count)); + } + return TCL_OK; ++#endif + } + /* + *---------------------------------------------------------------------- +@@ -2096,6 +2133,10 @@ + + static int Mysqltcl_WarningCount(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { ++#if (MYSQL_VERSION_ID < 40107) ++ Tcl_AddErrorInfo(interp, FUNCTION_NOT_AVAILABLE); ++ return TCL_ERROR; ++#else + MysqlTclHandle *handle; + int count = 0; + +@@ -2105,6 +2146,7 @@ + count = mysql_warning_count(handle->connection); + Tcl_SetObjResult(interp,Tcl_NewIntObj(count)); + return TCL_OK; ++#endif + } + /* + *---------------------------------------------------------------------- +@@ -2149,7 +2191,6 @@ + + static int Mysqltcl_NewNull(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { +- Tcl_Obj *objPtr; + if (objc != 1) { + Tcl_WrongNumArgs(interp, 1, objv, ""); + return TCL_ERROR; +@@ -2164,13 +2205,19 @@ + * usage: mysql::setserveroption (- + * + */ ++#if (MYSQL_VERSION_ID >= 40107) + static CONST char* MysqlServerOpt[] = + { + "-multi_statment_on", "-multi_statment_off",NULL + }; ++#endif + + static int Mysqltcl_SetServerOption(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { ++#if (MYSQL_VERSION_ID < 40107) ++ Tcl_AddErrorInfo(interp, FUNCTION_NOT_AVAILABLE); ++ return TCL_ERROR; ++#else + MysqlTclHandle *handle; + int idx; + enum enum_mysql_set_option mysqlServerOption; +@@ -2201,6 +2248,7 @@ + mysql_server_confl(interp,objc,objv,handle->connection); + } + return TCL_OK; ++#endif + } + /* + *---------------------------------------------------------------------- +@@ -2211,6 +2259,10 @@ + */ + static int Mysqltcl_ShutDown(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + { ++#if (MYSQL_VERSION_ID < 40107) ++ Tcl_AddErrorInfo(interp, FUNCTION_NOT_AVAILABLE); ++ return TCL_ERROR; ++#else + MysqlTclHandle *handle; + + if ((handle = mysql_prologue(interp, objc, objv, 2, 2, CL_CONN, +@@ -2220,6 +2272,7 @@ + mysql_server_confl(interp,objc,objv,handle->connection); + } + return TCL_OK; ++#endif + } + /* + *---------------------------------------------------------------------- diff -ruN mysqltcl.orig/files/patch-warnings mysqltcl/files/patch-warnings --- mysqltcl.orig/files/patch-warnings Mon Aug 1 17:29:25 2005 +++ mysqltcl/files/patch-warnings Thu Jan 1 01:00:00 1970 @@ -1,45 +0,0 @@ ---- generic/mysqltcl.c Mon Dec 27 07:34:33 2004 -+++ generic/mysqltcl.c Sun Jul 31 19:43:08 2005 -@@ -184,5 +184,4 @@ - { - Tcl_ObjType *oldTypePtr = objPtr->typePtr; -- Tcl_HashEntry *entryPtr; - - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { -@@ -1389,6 +1388,6 @@ - { - MysqltclState *statePtr = (MysqltclState *)clientData; -- int code ; -- int count ; -+ int code = TCL_ERROR; -+ int count = 0; - - MysqlTclHandle *handle; -@@ -1398,5 +1397,4 @@ - MYSQL_ROW row ; - int *val = NULL; -- int breakLoop = 0; - unsigned long *lengths; - -@@ -1456,13 +1454,7 @@ - case TCL_CONTINUE: - case TCL_OK: -- break ; -- case TCL_BREAK: -- breakLoop=1; -- break; -+ continue; -- default: -- breakLoop=1; -- break; - } -- if (breakLoop==1) break; -+ break; - } - } -@@ -2150,5 +2143,4 @@ - static int Mysqltcl_NewNull(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) - { -- Tcl_Obj *objPtr; - if (objc != 1) { - Tcl_WrongNumArgs(interp, 1, objv, ""); diff -ruN mysqltcl.orig/pkg-descr mysqltcl/pkg-descr --- mysqltcl.orig/pkg-descr Tue Apr 29 04:35:43 2003 +++ mysqltcl/pkg-descr Wed Jan 11 19:45:06 2006 @@ -1,17 +1,14 @@ From the package man-page: - MySQLTcl is a collection of Tcl commands and a Tcl global - array that provide access to one or more mysql database - servers. + MySQLTcl is a collection of Tcl commands and a Tcl global array that + provide access to MySQL database servers. - MySQLTcl is nothing more than a patched version of a - patched version of Hakan Soderstrom's patch of Tom - Poindexter's Sybtcl. Most of the documentention has been - left as it was when I started to work with this interface - (a patch of msqltcl-1.50). However, I have tried to - replace appropriate occurrences of msql by MySQL. + MySQLTcl is nothing more than a patched version of a patched version of + Hakan Soderstrom's patch of Tom Poindexter's Sybtcl. -This port makes use of some of the Tcl-8.x niceties, but more on that -front can be done. + Mysqltcl is binary Tcl library (extension) written in C language that + use direkt official MySQL C-API. Almost all Tcl commands correspond to + MySQL C-API functions. For detail documentation see official MySQL C- + API manual. WWW: http://www.xdobry.de/mysqltcl/ diff -ruN mysqltcl.orig/pkg-message-legacy mysqltcl/pkg-message-legacy --- mysqltcl.orig/pkg-message-legacy Thu Jan 1 01:00:00 1970 +++ mysqltcl/pkg-message-legacy Wed Jan 11 21:37:18 2006 @@ -0,0 +1,25 @@ +###################################################################### + + Attention! + + This version of mysqltcl contains an unofficial patch that + allows you to use this Tcl module with MySQL 3.23 and 4.0. + Due to restrictions of the underlying MySQL version the + use of the following functions will always cause an error: + + - autocommit + - commit + - rollback + - moreresult + - nextresult + - warningcount + - setserverversion + - shutdown + + This is not supported by the author of mysqltcl. Please + send comments and questions solely to me. + + - Björn König + bkoenig@cs.tu-berlin.de + +###################################################################### --- mysqltcl-2006011101.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060111211236.217DB5285C>