Skip to Content.
Sympa Menu

freetds - Re: [freetds] SQLNumResultCols() is wrong (+1)

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: Re: [freetds] SQLNumResultCols() is wrong (+1)
  • Date: Tue, 8 Jan 2008 15:33:50 +0100

>
> Try attached sample, SQLNumResultCols() gives numcols + 1
>
> >> Number of columns in result set: 4
>
> should be:
>
> >> Number of columns in result set: 3
>
>
> Seb
>

>From dump

15:19:50.359222 (net.c:740):Sending packet
0000 03 01 00 5e 00 00 01 00-ff ff 02 00 00 00 00 01 |...^.... ........|
0010 26 04 00 00 00 63 20 00-00 00 09 04 d0 00 00 20 |&....c . ....... |
0020 00 00 00 53 00 45 00 4c-00 45 00 43 00 54 00 20 |...S.E.L .E.C.T. |
0030 00 2a 00 20 00 46 00 52-00 4f 00 4d 00 20 00 74 |.*. .F.R .O.M. .t|
0040 00 31 00 00 01 26 04 04-04 00 00 00 00 01 26 04 |.1...&.. ......&.|
0050 04 04 20 00 00 00 01 26-04 04 00 00 00 00 |.. ....& ......|

15:19:50.359863 (util.c:162):Changed query state from QUERYING to
PENDING
15:19:50.360069 (token.c:495):tds_process_tokens(0x8060c50, 0xbfe02374,
0xbfe02370, 0x100)
15:19:50.360230 (util.c:162):Changed query state from PENDING to READING
15:19:50.360813 (net.c:547):Received header
0000 04 01 00 b8 00 38 01 00- |.....8..|

15:19:50.361031 (net.c:627):Received packet
0000 04 01 00 b8 00 38 01 00-81 04 00 00 00 09 00 26 |.....8.. .......&|
0010 04 01 6b 00 00 00 09 00-af 0a 00 09 04 d0 00 00 |..k..... ........|
0020 01 63 00 00 00 09 00 a7-0a 00 09 04 d0 00 00 02 |.c...... ........|
0030 76 00 63 00 00 00 00 00-38 07 72 00 6f 00 77 00 |v.c..... 8.r.o.w.|
0040 73 00 74 00 61 00 74 00-a4 07 00 01 02 00 74 00 |s.t.a.t. ......t.|

rowstat columns

0050 31 00 a5 0c 00 01 01 00-02 01 00 03 01 00 04 00 |1....... ........|
0060 14 ff 01 00 c1 00 00 00-00 00 79 00 00 00 00 ac |........ ..y.....|

column 4 is hidden :(

>From TODO:

. test and fix: hidden fields (FOR BROWSE select, see flag test on tds)

yes, correctly there is something to do with hidden fields:
- what happen if we bind to an hidden field??
- if we use SQLGetData??
- if we request informations with
SQLDescribeCol/SQLColAttribute(s)/SQLGetDescField??
- as you noted returning # columns hidden fields are not counted (there
is however a setting which is a mssql extension which threat hidden
columns as normal)

0070 0d 00 00 01 38 00 00 00-26 04 04 f0 de bc 0a ac |....8... &.......|
0080 0d 00 00 01 38 00 00 00-26 04 04 04 00 00 00 ac |....8... &.......|
0090 0d 00 00 01 38 00 00 00-26 04 04 04 00 00 00 ac |....8... &.......|
00a0 0d 00 00 01 38 00 00 00-26 04 04 ff ff ff ff fe |....8... &.......|
00b0 00 00 e0 00 00 00 00 00- |........|

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page