Skip to Content.
Sympa Menu

freetds - Re: [freetds] php mssql_connect() without section name in freetds.conf

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "jezekj AT centrum.cz" <jezekj AT centrum.cz>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] php mssql_connect() without section name in freetds.conf
  • Date: Sat, 06 Feb 2016 14:29:12 +0100

Sorry I was wrong. Port is not space delimited, but comma delimited. Please
try "10.98.97.96,62220". Maybe it will help.

JJ

5. února 2016 17:49:14 CET, "Muresanu A.V. (Andrei Valentin)"
<andrei.muresanu AT ing.ro> napsal:
>Doesn't work. It's the same as not mentioning the port at all. Tries on
>port 4000 instead:
>
>20009: "Unable to connect: Adaptive Server is unavailable or does not
>exist"
>
>log.c:196:Starting log file for FreeTDS 0.91
> on 2016-02-05 18:46:24 with debug flags 0x4fff.
>iconv.c:330:tds_iconv_open(0x2b9bfd0, UTF-8)
>iconv.c:187:local name for ISO-8859-1 is ISO-8859-1
>iconv.c:187:local name for UTF-8 is UTF-8
>iconv.c:187:local name for UCS-2LE is UCS-2LE
>iconv.c:187:local name for UCS-2BE is UCS-2BE
>iconv.c:349:setting up conversions for client charset "UTF-8"
>iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion
>iconv.c:391:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion
>iconv.c:394:tds_iconv_open: done
>net.c:205:Connecting to 10.98.97.95 port 4000 (TDS version 7.1)
>net.c:270:tds_open_socket: connect(2) returned "Operation now in
>progress"
>net.c:316:tds_open_socket() failed
>util.c:331:tdserror(0x2a89fa0, 0x2b9bfd0, 20009, 115)
>dblib.c:7906:dbperror(0x2b9b5f0, 20009, 115)
>dblib.c:7958:20009: "Unable to connect: Adaptive Server is unavailable
>or does not exist"
>dblib.c:7979:"Unable to connect: Adaptive Server is unavailable or does
>not exist", client returns 2 (INT_CANCEL)
>util.c:361:tdserror: client library returned TDS_INT_CANCEL(2)
>util.c:384:tdserror: returning TDS_INT_CANCEL(2)
>dblib.c:1424:dbclose(0x2b9b5f0)
>dblib.c:258:dblib_del_connection(0x7fe324a6b1a0, 0x2b9bfd0)
>mem.c:615:tds_free_all_results()
>dblib.c:305:dblib_release_tds_ctx(1)
>dblib.c:5859:dbfreebuf(0x2b9b5f0)
>dblib.c:724:dbloginfree(0x2b9b020)
>dblib.c:1493:dbexit(void)
>dblib.c:305:dblib_release_tds_ctx(1)
>
>-----Original Message-----
>From: FreeTDS [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
>jezekj AT centrum.cz
>Sent: Friday, February 05, 2016 6:19 PM
>To: FreeTDS Development Group
>Subject: Re: [freetds] php mssql_connect() without section name in
>freetds.conf
>
>Not sure, but in old Sybase times port has been delimited by space.
>i.e. "10.98.97.96 62220". Maybe I'm totally wrong here, but give it a
>try.
>
>JJ
>
>5. února 2016 10:27:12 CET, "Muresanu A.V. (Andrei Valentin)"
><andrei.muresanu AT ing.ro> napsal:
>>Hi,
>>
>>anybody have any idea with the following ?
>>
>>Does not work, gives 'Unknown host machine name'. Even with tds
>version
>>= 7.0... 7.1, 8, etc..:
>>
>>$link = mssql_connect("10.98.97.96:62220", 'user', 'pass');
>>
>>Works because there is a section in freetds.conf named 'dasdswh':
>>
>>$link = mssql_connect('dasdswh', 'user', 'pass');
>>
>>$ php -v
>>PHP 5.5.21 (cli) (built: Jun 10 2015 05:26:44) Copyright (c) 1997-2014
>
>>The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend
>>Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by
>
>>Zend Technologies
>>
>>Trace log:
>>
>>16:55:35.585240 15567 (log.c:196):Starting log file for FreeTDS 0.91
>> on 2016-02-04 16:55:35 with debug flags 0xffff.
>>16:55:35.585295 15567 (iconv.c:330):tds_iconv_open(0x2569f10, UTF-8)
>>16:55:35.585508 15567 (iconv.c:187):local name for ISO-8859-1 is
>>ISO-8859-1
>>16:55:35.585528 15567 (iconv.c:187):local name for UTF-8 is UTF-8
>>16:55:35.585542 15567 (iconv.c:187):local name for UCS-2LE is UCS-2LE
>>16:55:35.585560 15567 (iconv.c:187):local name for UCS-2BE is UCS-2BE
>>16:55:35.585578 15567 (iconv.c:349):setting up conversions for client
>>charset "UTF-8"
>>16:55:35.585590 15567 (iconv.c:351):preparing iconv for "UTF-8" <->
>>"UCS-2LE" conversion
>>16:55:35.585610 15567 (iconv.c:391):preparing iconv for "ISO-8859-1"
>><-> "UCS-2LE" conversion
>>16:55:35.585635 15567 (iconv.c:394):tds_iconv_open: done
>>16:55:35.585647 15567 (util.c:331):tdserror(0x245d490, 0x2569f10,
>>20013, 0)
>>16:55:35.585666 15567 (dblib.c:7906):dbperror(0x2569530, 20013, 0)
>>16:55:35.585681 15567 (dblib.c:7958):20013: "Unknown host machine
>name"
>>16:55:35.585717 15567 (dblib.c:7979):"Unknown host machine name",
>>client returns 2 (INT_CANCEL)
>>16:55:35.585734 15567 (util.c:361):tdserror: client library returned
>>TDS_INT_CANCEL(2)
>>16:55:35.585751 15567 (util.c:384):tdserror: returning
>>TDS_INT_CANCEL(2)
>>16:55:35.585766 15567 (login.c:417):IP address pointer is empty
>>16:55:35.585776 15567 (login.c:419):Server 10.98.97.96:62220 not
>found!
>>16:55:35.585795 15567 (dblib.c:1424):dbclose(0x2569530)
>>16:55:35.585815 15567
>>(dblib.c:258):dblib_del_connection(0x7f78f16cd800, 0x2569f10)
>>16:55:35.585862 15567 (mem.c:615):tds_free_all_results()
>>16:55:35.585890 15567 (dblib.c:305):dblib_release_tds_ctx(1)
>>16:55:35.585909 15567 (dblib.c:5859):dbfreebuf(0x2569530)
>>16:55:35.592809 15567 (dblib.c:724):dbloginfree(0x2569510)
>>16:55:35.594342 15567 (dblib.c:1493):dbexit(void)
>>16:55:35.594378 15567 (dblib.c:305):dblib_release_tds_ctx(1)
>>
>>----------------------------------------------------------------
>>ATTENTION:
>>The information in this e-mail is confidential and only meant for the
>>intended recipient. If you are not the intended recipient , don't use
>>or disclose it in anyway. Please let the sender know and delete the
>>message immediately.
>>-----------------------------------------------------------------------
>>-------------------------------
>>
>>
>>_______________________________________________
>>FreeTDS mailing list
>>FreeTDS AT lists.ibiblio.org
>>http://lists.ibiblio.org/mailman/listinfo/freetds
>
>--
>Odesláno z mého telefonu s Androidem pomocí pošty K-9 Mail. Omluvte
>prosím moji stručnost.
>_______________________________________________
>FreeTDS mailing list
>FreeTDS AT lists.ibiblio.org
>http://lists.ibiblio.org/mailman/listinfo/freetds
>
>------------------------------------------------------------------------------------------------------
>ATTENTION:
>The information in this e-mail is confidential and only meant for the
>intended recipient. If you are not the intended recipient , don't use
>or disclose it in anyway. Please let the sender know and delete the
>message immediately.
>------------------------------------------------------------------------------------------------------
>
>_______________________________________________
>FreeTDS mailing list
>FreeTDS AT lists.ibiblio.org
>http://lists.ibiblio.org/mailman/listinfo/freetds

--
Odesláno z mého telefonu s Androidem pomocí pošty K-9 Mail. Omluvte prosím
moji stručnost.
>From freddy77 AT gmail.com Sun Feb 7 07:50:26 2016
Return-Path: <freddy77 AT gmail.com>
X-Original-To: freetds AT lists.ibiblio.org
Delivered-To: freetds AT lists.ibiblio.org
Received: by lists.ibiblio.org (Postfix, from userid 20217)
id AB4DF1FE5; Sun, 7 Feb 2016 07:50:26 -0500 (EST)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
mailman1.ibiblio.org
X-Spam-Level:
X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW autolearn=ham
version=3.3.1
Received: from mail-vk0-f51.google.com (mail-vk0-f51.google.com
[209.85.213.51])
by lists.ibiblio.org (Postfix) with ESMTP id 357D71FCE
for <freetds AT lists.ibiblio.org>; Sun, 7 Feb 2016 07:50:21 -0500 (EST)
Received: by mail-vk0-f51.google.com with SMTP id c3so34614763vkb.3
for <freetds AT lists.ibiblio.org>; Sun, 07 Feb 2016 04:50:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type:content-transfer-encoding;
bh=A/hRewt7jURkAO51aAIBp28BhT3A9rXN75g26RI8ySo=;
b=xEH6KC1U2qInU+zK+zMTFyTmBuJ0qw3ZFSOeMtoI9veUk8IWVFqVel37D5MRPbGxiD
aTpnYzCllrFCeSLULTjuGO5XoE4W+CDnRKrqmXX734dKTIp0lUnP5RWuaCqxR2JRMCW3
yXQIvgShNPYwi/oyH2+yz2piswsic91dICPSx/3dQH0IHQ3YOLvlE/WUbSseMq3qimzH
jOLrrk4HHLeyYHCIU9/jhb1wJsIAuKDvCIJ8W3qgV0Rp6MiGYG5XoEUUcMSokAl/7JG9
AEErW0PZmSMJgLU4rJkXf9zQLorvKCKYOSKf2RvexZCQUPlaTGF7fUfNAc28g0kVOz6q
omeA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type:content-transfer-encoding;
bh=A/hRewt7jURkAO51aAIBp28BhT3A9rXN75g26RI8ySo=;
b=V2TodyTGZovDILc0Jdl1oUnEjFi5s2FFoJZ+bT8rE1cdIzd5Hn5kRVwsl752oZYBvC
XaJfhYAzSL9lb6Dp0Z+e+ObG0OQBk+Jh7ssaQgBdIxvsEUz5ReRpJWN44b2onzWJrVkN
hnAopnxh0Sid8I4XmtpKzgGU8z7ZaoqrLCpM/eXrrSxnfVHNERiFjQxpO2a6nIrMKq2Q
aSbaIycv5mq87/aQLbz6ZSwGHa3dWND/NUim5pNlet2dmA9G73lKQ0M+2AhCYcPHabij
+9vXRV0haCm8SNwaJZv5t1XwkVuECpl7pV6VvbUpfXeLixHXuyQNfcA6Lix0FC05P4ar
+dHA==
X-Gm-Message-State:
AG10YOQ6JufYqqmuOW3BHU+chCoUQONOL97nkAaoQPP6o2DTuCMzisWWs0TQYqBjCr/U4q4HvjI3oi3A6NSpJA==
MIME-Version: 1.0
X-Received: by 10.31.164.78 with SMTP id n75mr16414053vke.14.1454849421607;
Sun, 07 Feb 2016 04:50:21 -0800 (PST)
Received: by 10.31.51.77 with HTTP; Sun, 7 Feb 2016 04:50:21 -0800 (PST)
In-Reply-To: <772DB680-422D-403B-8C8C-DC35998401AD AT capps.com>
References: <772DB680-422D-403B-8C8C-DC35998401AD AT capps.com>
Date: Sun, 7 Feb 2016 12:50:21 +0000
Message-ID:
<CAHt6W4fVqM_Mwq5n2wA=NmcaUkFL1tx=YOkZeWBP1t2NuqeXZA AT mail.gmail.com>
From: Frediano Ziglio <freddy77 AT gmail.com>
To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: [freetds] compute rows
X-BeenThere: freetds AT lists.ibiblio.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: FreeTDS Development Group <freetds.lists.ibiblio.org>
List-Unsubscribe: <http://lists.ibiblio.org/mailman/options/freetds>,
<mailto:freetds-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/freetds/>
List-Post: <mailto:freetds AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/freetds>,
<mailto:freetds-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Feb 2016 12:50:26 -0000

2016-02-06 9:33 GMT+00:00 John Kendall <john AT capps.com>:
> I am having trouble with the output of compute rows. I found the followi=
ng exchange from 2007 between jkl and Michael Peppler that summarizes what =
I'm experiencing in 2016:
>
> https://lists.ibiblio.org/sympa/arc/freetds/2007q1/020954.html
>
> To summarize, sqsh (and other tools linked to freetds) do not produce usa=
ble output for compute rows. Michael Peppler says that sqsh acts correctly=
when linked to sybase libs. I have an old copy of isql that handles compu=
te statements in a very predictable way, for example:
>
> select col1=3D1, col2=3D1, col3=3D1 into tempdb..tab
> insert tempdb..tab select 2,2,2
> insert tempdb..tab select 3,3,3
> go
> select * from tempdb..tab compute sum(col1), avg(col1), min(col1), count(=
col1), avg(col2), max(col3), min(col3)
> go
> col1 col2 col3
> ----------- ----------- -----------
> 1 1 1
> 2 2 2
> 3 3 3
> sum
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 6
> avg avg
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 2 2
> min min
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> 1 1
> count
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 3
> max
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 3
>
> (4 rows affected)
>
>
> sqsh, linked to freetds, produces:
>
> col1 col2 col3
> ----------- ----------- -----------
> 1 1 1
> 2 2 2
> 3 3 3
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 6
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 2
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 1
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 3 2 3
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 1
>
> (4 rows affected)
>
>
> Note how sqsh doesn't label the aggregate columns, and it combined count,=
avg and max into one row, while not combining the two min rows. Pretty us=
eless.
>
> I no longer have access to sybase libs, so I cannot test sqsh linked to t=
hem.
> Just for comparison, fisql has a different set of problems:
>
> col1 col2 col3
> ----------- ----------- -----------
> 1 1 1
> 2 2 2
> 3 3 3
> sum avg min count avg max m=
in
> ----------- ----------- ----------- ----------- ----------- ----------- -=
----------
> 6 2 1 3 2 3 1
>
> (4 rows affected)
>
> Micheal's theory was that an API call in CTlib wasn't quite right, such a=
s ct_describe() or ct_compute_info().
> Any ideas anyone?
> Thanks,
> John
>

Weird request. MS is trying to remove (if not already) support for COMPUTE.
Probably the better way is to looks at the dumps (TDSDUMPs), and see
what functions
return. Then looks at documentation and callers (fisql, sqsh) and try
to understand what's
wrong.

Frediano




Archive powered by MHonArc 2.6.24.

Top of Page