Skip to Content.
Sympa Menu

freetds - [freetds] tsql patch

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] tsql patch
  • Date: Thu, 20 Sep 2007 16:38:12 +0200

I don't know if this patch should be applied.
This patch permit empty lines in batch. Allowing empty lines keep
consistency in error results.
Consider this batch

1> select 1
2>
3> raiserror('hello',16,1)

Without the patch error is detected at line 2 while is at line 3.

diff -u -1 -0 -r1.106 tsql.c
--- src/apps/tsql.c 17 Sep 2007 10:15:22 -0000 1.106
+++ src/apps/tsql.c 20 Sep 2007 14:25:08 -0000
@@ -715,21 +715,21 @@
free(go_line);
}

/* skip leading whitespace */
if (s2)
free(s2);
s2 = strdup(s); /* copy to mangle with strtok() */
cmd = strtok(s2, " \t");

if (!cmd)
- continue;
+ cmd = "";

if (!strcasecmp(cmd, "exit") || !strcasecmp(cmd, "quit")
|| !strcasecmp(cmd, "bye"))
break;
if (!strcasecmp(cmd, "version")) {
tds_version(tds, mybuf);
printf("using TDS version %s\n", mybuf);
line = 0;
mybuf[0] = '\0';
buflen = 0;
continue;

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page