Re: 0.91RC1

Konrad J Hambrick <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Organization PayPlus Software, Inc
Message-ID <[email protected]>
James / Freddy / Bill --

I hope I am not too late ...

I submitted a patch long ago against version 0.64
to fix those Hints that require info in addition
to the hint keyword itself( ORDER, ROWS_PER_BATCH
and KILOBYTES_PER_BATCH ) ...

Anyhow, the fix seems to have gotten lost somewhere ...

See attached patch against src/dblibs/bcp.c:

    src-dblib-bcp.c-diff-u-kjh.patch

I also found it useful (and more secure ps-wise) to
avoid setting the HostName / UserName / PassWord on
the commandline.

freebcp.c already looks for a environment varb: FREEBCP
so I added code to src/apps/freebcp.c to use FREEBCPHOST,
FREEBCPUSER and FREEBCPPASS from the user's environment
instead of from the commandline.

See attached src-apps-freebcp.c-diff-u-kjh.patch ...

Thanks for FreeTDS !

-- kjh


James K. Lowden wrote, On 04/09/2011 03:33 PM:
> http://www.ibiblio.org/pub/Linux/ALPHA/freetds/stable/release_candidates/freetds-0.91rc1.tgz
>
> FreeTDS proudly, and with great relief, announces the first release
> candidate for its next version, 0.91.  It will supersede the current
> version, 0.82, released in May 2008.
>
> The jump in release numbers represents three years' progress.  We issue
> releases infrequently to minimize users' administrative overhead.  But
> the time has truly arrived to raise the flag and tell everyone to
> upgrade.
>
> Please give it a whirl.
>
> As a member of this mailing list, your feedback is invaluable both to
> the developers and to the larger FreeTDS community. (That community
> very likely numbers in the tens of thousands, btw.)  Any problems you
> discover with a release candidate is one that can be avoided in the
> actual release.  This is your chance to make a difference.
>
> In particular, we need to know about things we devlopers don't deal with
> ourselves, i.e.:
>
> 1.  Proprietary OSes, big iron and small.
> 2.  Other language bindings, from DBI to PHP and beyond.
> 3.  Behavior changes versus 0.82 that necessitate administrative or
> programming changes.
>
> Notable new features, in reverse chronological order:
>
> 1.  Full Kerberos and SSPI support for passwordless login to
> Microsoft SQL Server from Unix and Windows clients.  Includes Keberos
> delegation option.
>
> 2.  Full support for DB-Library under Win32/64 via NMAKE.EXE.
>
> 3.  Built-in support for UTF-8.
>
> 4.  Support for wide characters in ODBC.
>
> 5.  Support for varchar(max) and varbinary(max).
>
> 6.  Better thread-safety in ODBC.
>
> 7.  Error messages distinguish between connect and login errors.
>
> 8.  Bulk-copy functions in CT-Library.
>
> 9.  Correct handling of query timeouts and cancellations.
>
> Your humble maintainer,
>
> --jkl
>
>
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>

_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
src-dblib-bcp.c-diff-u-kjh.patch (text/plain, 1.3 KB)
--- bcp-orig.c	2011-04-07 03:06:37.000000000 -0500
+++ bcp.c	2011-04-10 05:37:58.003757923 -0500
@@ -627,7 +627,13 @@
 {
 	int i;
 	static const char *const hints[] = {
-		"ORDER", "ROWS_PER_BATCH", "KILOBYTES_PER_BATCH", "TABLOCK", "CHECK_CONSTRAINTS", "FIRE_TRIGGERS", NULL
+		"ORDER",			/* needs value not hints[] */
+                "ROWS_PER_BATCH", 		/* needs value not hints[] */
+                "KILOBYTES_PER_BATCH",		/* needs value not hints[] */
+                "TABLOCK", 			/* hints[] OK */
+                "CHECK_CONSTRAINTS", 		/* hints[] OK */
+                "FIRE_TRIGGERS", 		/* hints[] OK */
+                 NULL
 	};
 
 	tdsdump_log(TDS_DBG_FUNC, "bcp_options(%p, %d, %p, %d)\n", dbproc, option, value, valuelen);
@@ -646,11 +652,11 @@
 
 		for (i = 0; hints[i]; i++) {	/* look up hint */
 			if (strncasecmp((char *) value, hints[i], strlen(hints[i])) == 0) {
-				dbproc->bcpinfo->hint = hints[i];	/* safe: hints[i] is static constant, above */
+				dbproc->bcpinfo->hint = value; 		/* need value not hints[] */
 				return SUCCEED;
 			}
 		}
-		tdsdump_log(TDS_DBG_FUNC, "failed, no such hint\n");
+		tdsdump_log(TDS_DBG_FUNC, "failed, no such hint: \"%s\"\n", (char *) value);
 		break;
 	default:
 		tdsdump_log(TDS_DBG_FUNC, "UNIMPLEMENTED bcp option: %u\n", option);
src-apps-freebcp.c-diff-u-kjh.patch (text/plain, 815 B)
--- freebcp-orig.c	2011-04-07 03:06:37.000000000 -0500
+++ freebcp.c	2011-04-10 06:01:31.466265881 -0500
@@ -167,7 +167,28 @@
 	
 	int ch;
 
-	if (argc < 6) {
+        char * p = NULL ;
+        int  MinArg = 6 ;
+
+        if (( p = getenv( "FREEBCPHOST" )) != (char *) NULL )
+        {
+           pdata->Sflag++;
+           pdata->server = strdup( p );
+           MinArg -- ;
+        }
+        if (( p = getenv( "FREEBCPUSER" )) != (char *) NULL )
+        {
+           pdata->Uflag++ ;
+           pdata->user = strdup( p ) ;
+           MinArg -- ;
+        }
+        if (( p = getenv( "FREEBCPPASS" )) != (char *) NULL )
+        {
+           pdata->Pflag++;
+           pdata->pass = strdup( p );
+           MinArg -- ;
+        }
+        if ( argc < MinArg ) {
 		pusage();
 		return (FALSE);
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.