Frediano Ziglio | 1 Feb 11:36 2010
Picon

Re: Windows authentication on Windows

2010/1/30 James K. Lowden <jklowden <at> freetds.org>:
> Frediano Ziglio wrote:
>> > Did I mention how excellent this is?  The FreeTDS community owes you
>> > a big smooch.
>>
>> Sometimes is strange how a thing that is easy for a person could be so
>> appreciated!
>
>        "It's easy if you know how."
>
>> Well... some updates and some reminds. I think sspi code could be
>> considered completed:
>
> Agreed.  Needs only documentation.  (I'm working on it.)
>
>> As a reminds Kerberos support works since 2007 with empty username and
>> password
>
> Can username/password be NULL?
>

Well... empty not NULL... but for user_name is quite the same... I
don't think any system have a "" username!

> The word "Kerberos" does not appear in the UG.  That's because I have no
> direct experience with it and no one who understands it has documented it.
>

I updated docuementation a bit. Usually the base requirement is to
configure a /etc/krb5.conf file and initialize a ticket with kinit.
(Continue reading)

Srdan Dukic | 2 Feb 02:08 2010
Picon

Re: Unable to bcp file into MS SQL Server 2008

On 31 January 2010 07:38, James K. Lowden <jklowden <at> freetds.org> wrote:
> Srdan Dukic wrote:
>> I've been looking at the freebcp man
>> page[1] but can't really see any option or example of how to specify
>> that any identity fields should be ignored.
>
> This looks like pilot error to me.  The attached script works on my
> server.
>
> To verify, set TDSDUMP and grep the log file for "bcp_control".  You'll
> see several calls; look at the second parameter:
>
> $ grep bcp_control /tmp/freetds.log.9501
> bcp.c:553:bcp_control(0x8053000, 2, 0)
> bcp.c:553:bcp_control(0x8053000, 3, 0)
> bcp.c:553:bcp_control(0x8053000, 1, 10)
> bcp.c:553:bcp_control(0x8053000, 4, 1000)
>
> These values are defined in include/sybdb.h.  If you're inserting values
> in an IDENTITY column from the datafile, you will see bcp_control called
> with a parameter value of 8 (BCPKEEPIDENTITY) and the query "set
> identity_insert %s on" sent to the server.
>
> If you don't see those things in the log file, the server should assign
> values for you.  Your datafile still needs to have something in the column
> -- a placeholder for the parser -- but the server will override it.  As
> you found (and my script demonstrates), file must have a value for the
> column; it can't be NULL.  That's a misfeature of freebcp; there's no
> reason it couldn't discover any identity columns in the target table and
> provide a zero value if the file indicates a NULL.
(Continue reading)

James K. Lowden | 2 Feb 04:18 2010

Re: Windows authentication on Windows

Frediano Ziglio wrote:
> I noted you committed a patch for getopt support under systems
> which don't have getopt however getopt.c is currently under a BSD
> license which is not LGPL compatible leading to licenses problems (for
> instance tsql using such file should output some additional comments
> aboud BSD code). 

You mean this:

 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.

I think all we need to do is add those things to the UG.  Not hard, and
lets us use other parts of NetBSD, too, if we want to.  

I'll do that in time for the release.  

> I updated docuementation a bit. Usually the base requirement is to
> configure a /etc/krb5.conf file and initialize a ticket with kinit.

Thanks.  

Regards, 

--jkl
Michael Mata | 3 Feb 00:56 2010
Picon

Re: Force use of UTF-8 instead of ISO8859-1

On Thu, Jan 28, 2010 at 11:44 AM, Frediano Ziglio <freddy77 <at> gmail.com>wrote:

> 2010/1/28 Michael Mata <michaelvmata <at> gmail.com>:
> > this should be a DSN-less configuration that does not use freetds.conf.
>  Is
> > there a way to set the client charset using this configuration?
>
> Not with 0.82... support for additional attributes was added in CVS HEAD.
>
> freddy77
>

Since we can't specify client charset in a DSN-less configuration, I
reverted to using freetds.conf and I'm still getting str returned instead of
unicode.  My config files are now:

odbcinst.ini

[ODBC]
Trace                   = Yes
TraceFile               = /tmp/unixodbc.log

[FreeTDS]
Driver          = /usr/local/lib/libtdsodbc.so
Setup           = /usr/local/lib/libtdsS.so

freetds.conf

[global]
        text size = 64512
(Continue reading)

Patrick H. Burke | 4 Feb 17:32 2010

second query fails when querying sql server 2008

Hello,

I have FreeTDS installed on a 64 bit CentOS platform, connecting to a MS SQL Server 2008.

Configuration:
                tds version = 8.0

I connect using the following scenarios:

-----------------------------------------------
                Connect to isql
                Select * from sip_acc
                                (55 rows returned)
                Disconnect

-----------------------------------------------

                Connect to isql
                Select 1
                                (1 row returned)
                Select * from sip_acc
                                (0 rows returned)
                Disconnect

                NOTES:  Looking in the freetds.log file I see there are 55 rows returned.
token.c:2175:                rows_affected = 55
-----------------------------------------------

Any recommendations?
Thanks,
(Continue reading)

Patrick H. Burke | 4 Feb 18:45 2010

Re: second query fails when querying sql server 2008

Is there a setting that will force that?

If I connect to a Mysql database (using the standard Mysql odbc driver), I don't get the error.
Thanks,
Pat Burke

From: nitin sayare [mailto:nitinsayare <at> gmail.com]
Sent: Thursday, February 04, 2010 11:09 AM
To: Patrick H. Burke
Subject: Re: [freetds] second query fails when querying sql server 2008

Hi ,

You need to close the cursor.

On Thu, Feb 4, 2010 at 10:02 PM, Patrick H. Burke
<phburke <at> ctimessaging.com<mailto:phburke <at> ctimessaging.com>> wrote:
Hello,

I have FreeTDS installed on a 64 bit CentOS platform, connecting to a MS SQL Server 2008.

Configuration:
               tds version = 8.0

I connect using the following scenarios:

-----------------------------------------------
               Connect to isql
               Select * from sip_acc
                               (55 rows returned)
(Continue reading)

James K. Lowden | 5 Feb 05:35 2010

Re: Force use of UTF-8 instead of ISO8859-1

Michael Mata wrote:
> 
> Since we can't specify client charset in a DSN-less configuration, I
> reverted to using freetds.conf and I'm still getting str returned
> instead of unicode. 

I think I found a bug, but I don't think it's causing what you're seeing. 
It's only preventing me from helping you.  

I created a table as follows:

bsqldb -q -S$S -U$U -P$(password $S $U) <<SQL
create table test_utf8
	( id int IDENTITY
	, name nchar(10) not NULL
	, primary key (id)
	)
insert test_utf8 (name) values ('hallå')
insert test_utf8 (name) values ('adjö')
insert test_utf8 (name) values ('Århus')
go
SQL

(I hope those are readable in your mail client.)  

When I fetch these rows with bsqlodbc, I provoke an error:

$ printf "select * from test_utf8\ngo\n" | bsqlodbc -S$S -U$U -P$(password
$S $U)    
        id  name      
(Continue reading)

Frediano Ziglio | 5 Feb 15:57 2010
Picon

Re: Force use of UTF-8 instead of ISO8859-1

2010/2/5 James K. Lowden <jklowden <at> freetds.org>:
> Michael Mata wrote:
>>
>> Since we can't specify client charset in a DSN-less configuration, I
>> reverted to using freetds.conf and I'm still getting str returned
>> instead of unicode.
>
> I think I found a bug, but I don't think it's causing what you're seeing.
> It's only preventing me from helping you.
>
> I created a table as follows:
>
> bsqldb -q -S$S -U$U -P$(password $S $U) <<SQL
> create table test_utf8
>        ( id int IDENTITY
>        , name nchar(10) not NULL
>        , primary key (id)
>        )
> insert test_utf8 (name) values ('hallå')
> insert test_utf8 (name) values ('adjö')
> insert test_utf8 (name) values ('Århus')
> go
> SQL
>
> (I hope those are readable in your mail client.)
>
> When I fetch these rows with bsqlodbc, I provoke an error:
>
> $ printf "select * from test_utf8\ngo\n" | bsqlodbc -S$S -U$U -P$(password
> $S $U)
(Continue reading)

jklowden | 5 Feb 16:24 2010

Re: Force use of UTF-8 instead of ISO8859-1

On Fri, Feb 05, 2010 at 03:57:03PM +0100, Frediano Ziglio wrote:
> 2010/2/5 James K. Lowden <jklowden <at> freetds.org>:
> > $ printf "select * from test_utf8\ngo\n" | bsqlodbc -S$S -U$U -P$(password
> > $S $U)
> >        id  name
> > ----------  ----------
> > "[FreeTDS][SQL Server]Data truncated"
> >         1  hall
> > "[FreeTDS][SQL Server]Data truncated"
> >         2  adj
> > "[FreeTDS][SQL Server]Data truncated"
> >         3  rhus
> 
> Using nchar(10) "foo" get stored as "foo       " ("foo" followed by 7
> spaces). Using utf-8 encoding a 5 character get stored in 10 nchar but
> if a character is not ascii get encoded in more than 10 characters.
> SQLDescribeCol return 10 characters and you provided 10 character
> buffer which is insufficient to store original data. Now... On
> SQLDescribeCol
> 
>  ColumnSizePtr
> 
>     [Output] Pointer to a buffer in which to return the size (in
> characters) of the column on the data source.
> 
> so is fine to return 10 or we should return that maximum buffer space
> (40 in this case) ?? Or perhaps we should return 0 (undeterminated) ?

SQLDescribeCol is correct.  It returns the logical size, the size as reported by the server.  The column size
is measured in characters, by definition; the server's storage requirements are not the client's
(Continue reading)

Frediano Ziglio | 5 Feb 16:38 2010
Picon

Re: Force use of UTF-8 instead of ISO8859-1

2010/2/5  <jklowden <at> schemamania.org>:
> On Fri, Feb 05, 2010 at 03:57:03PM +0100, Frediano Ziglio wrote:
>> 2010/2/5 James K. Lowden <jklowden <at> freetds.org>:
>> > $ printf "select * from test_utf8\ngo\n" | bsqlodbc -S$S -U$U -P$(password
>> > $S $U)
>> >        id  name
>> > ----------  ----------
>> > "[FreeTDS][SQL Server]Data truncated"
>> >         1  hall
>> > "[FreeTDS][SQL Server]Data truncated"
>> >         2  adj
>> > "[FreeTDS][SQL Server]Data truncated"
>> >         3  rhus
>>
>> Using nchar(10) "foo" get stored as "foo       " ("foo" followed by 7
>> spaces). Using utf-8 encoding a 5 character get stored in 10 nchar but
>> if a character is not ascii get encoded in more than 10 characters.
>> SQLDescribeCol return 10 characters and you provided 10 character
>> buffer which is insufficient to store original data. Now... On
>> SQLDescribeCol
>>
>>  ColumnSizePtr
>>
>>     [Output] Pointer to a buffer in which to return the size (in
>> characters) of the column on the data source.
>>
>> so is fine to return 10 or we should return that maximum buffer space
>> (40 in this case) ?? Or perhaps we should return 0 (undeterminated) ?
>
> SQLDescribeCol is correct.  It returns the logical size, the size as reported by the server.  The
(Continue reading)


Gmane