From aeb00f7e3f873c9c3d3ab20a8e5c4bfabe3e3854 Mon Sep 17 00:00:00 2001 From: Ade Lovett Date: Mon, 18 Sep 2000 21:44:45 +0000 Subject: Fix a number of issues in the code. See the PR for the long and detailed explanation. PORTREVISION bumped. PR: 20058 Submitted by: maintainer --- databases/tcl-Mysql/Makefile | 1 + databases/tcl-Mysql/files/patch-aa | 14 +++++----- databases/tcl-Mysql/files/patch-ab | 52 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 databases/tcl-Mysql/files/patch-ab (limited to 'databases') diff --git a/databases/tcl-Mysql/Makefile b/databases/tcl-Mysql/Makefile index 5f495e57ae0f..79162d67b0ac 100644 --- a/databases/tcl-Mysql/Makefile +++ b/databases/tcl-Mysql/Makefile @@ -7,6 +7,7 @@ PORTNAME= tcl-sql PORTVERSION= 20000114 +PORTREVISION= 1 CATEGORIES= databases ${TCL_NODOT} MASTER_SITES= http://www.binevolve.com/~tdarugar/tcl-sql/download/ EXTRACT_SUFX= .tgz diff --git a/databases/tcl-Mysql/files/patch-aa b/databases/tcl-Mysql/files/patch-aa index e6007cc1ea7e..954548f7ab1d 100644 --- a/databases/tcl-Mysql/files/patch-aa +++ b/databases/tcl-Mysql/files/patch-aa @@ -109,7 +109,7 @@ same queries. + if (objc == 1) { + Tcl_WrongNumArgs(interp, 1, objv, "command ?handle?"); return TCL_ERROR; -@@ -133,75 +93,84 @@ +@@ -133,58 +93,58 @@ Manager_sql *mgr = (Manager_sql *)clientData; - int res = TCL_OK; + int res; @@ -207,17 +207,17 @@ same queries. - res = selectdbCmd(interp, conn, argv[3]); - } else { - Tcl_AppendResult(interp, "sql: unknown sql command: ", argv[1], NULL); -- return TCL_ERROR; + // take care of the command: + if (subcommand < Disconnect && subcommand > Query) { + /* get the "result handle" returned previously */ -+ if (Tcl_GetIntFromObj(NULL, objv[3], &res) != TCL_OK || ++ if (objc < 4) res = 0; /* oddly, this is how it was -- bug? */ ++ else if (Tcl_GetIntFromObj(NULL, objv[3], &res) != TCL_OK || + res < 0) { + Tcl_SetObjResult(interp, objv[3]); + Tcl_AppendResult(interp, ": invalid result" + " handle", NULL); -+ return TCL_OK; - } + return TCL_ERROR; +@@ -192,16 +152,26 @@ } - - return res; @@ -256,7 +256,7 @@ same queries. + } + return TCL_ERROR; /* not reachable */ } -@@ -226,7 +195,7 @@ +@@ -226,7 +196,7 @@ - Tcl_CreateCommand (interp, "sql", SqlCmd ,(ClientData) s, - (Tcl_CmdDeleteProc*) NULL); @@ -266,5 +266,5 @@ same queries. - // Provide a package called Sample - if (Tcl_PkgProvide(interp, "Sql", "1.0") == TCL_ERROR) + // Provide a package called ``sql'' -+ if (Tcl_PkgProvide(interp, "sql", "1.0") == TCL_ERROR) ++ if (Tcl_PkgProvide(interp, "sql", "1.1") == TCL_ERROR) return TCL_ERROR; diff --git a/databases/tcl-Mysql/files/patch-ab b/databases/tcl-Mysql/files/patch-ab new file mode 100644 index 000000000000..30ad95fb26ca --- /dev/null +++ b/databases/tcl-Mysql/files/patch-ab @@ -0,0 +1,52 @@ +--- docs/api.html Wed Jul 22 21:54:38 1998 ++++ docs/api.html Wed Jul 19 17:19:34 2000 +@@ -1,2 +1,5 @@ ++ ++ + Generic Tcl Database Interface API ++ + +@@ -55,3 +58,3 @@ + statement). Use with fetchrow and endquery.
+- sql query $conn "select * from sample where x > 3" ++ set query [sql query $conn "select * from sample where x > 3"] + +@@ -62,3 +65,3 @@ + is returned.
+- while {[set row [sql fetchrow $conn]] != ""} { puts $row } ++ while {[set row [sql fetchrow $conn $query]] != ""} { puts $row } + +@@ -66,4 +69,4 @@ +

+-


+-

Sample Usage:

++
++

Sample Usage:

+ Also see +@@ -86,3 +89,3 @@ + # Put some dummy data in: +-for {set i 0} {$i < 10} {incr i} { ++for {set i 0} {$i < 10} {incr i} { + sql exec $conn "insert into junk values ($i, $i.01, 'xx $i xx')" +@@ -91,5 +94,5 @@ + # Do a select and display the results +-sql query $conn "select * from junk where i > 3" ++set query [sql query $conn "select * from junk where i > 3"] + +-while {[set row [sql fetchrow $conn]] != ""} { ++while {[set row [sql fetchrow $conn $query]] != ""} { + puts "row = $row" +@@ -97,3 +100,3 @@ + +-sql endquery $conn ++sql endquery $conn $query + +@@ -113 +116,3 @@ + ++ ++ + +>Release-Note: +>Audit-Trail: +>Unformatted: + -- cgit v1.2.3