Michael Koch | 15 Dec 18:59 2014
Picon

Problem with FreeTDS 0.91 and Sybase ASA 9

Hello List,

in addition to my last post I have made much more tests. At least under 
Gentoo with FreeTDS 0.91 und unixODBX 2.3.2-r1 I could confirm my 
problems with SQLPrepare.

I turned on trace logging for FreeTDS and unixODBC and take isql todo a 
simple SELECT-Query. isql tries to build the query with SQLPrepare and 
the Sybase ASA9 gives a error value back, that the procedur that it 
tries to create is already existing.

I've made the following log files. I hope anyone has an ideas?

Thanks in advance! Best regards

Michael

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

[ODBC][27626][1418664265.425550][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/__handles.c][460]
                 Exit:[SQL_SUCCESS]
                         Environment = 0x60d830
[ODBC][27626][1418664265.425623][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][375]
                 Entry:
                         Handle Type = 2
                         Input Handle = 0x60d830
[ODBC][27626][1418664265.425664][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][493]
                 Exit:[SQL_SUCCESS]
                         Output Handle = 0x60e130
[ODBC][27626][1418664265.425708][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLConnect.c][3727]
(Continue reading)

m.jablonski | 13 Dec 09:25 2014

problems with UTF-8


Hi everyone,

I have problem with UTF-8.
in config client charset is set to utf-8

Why  charset is changed to cp1250 by freetds ? My sql is send with utf-8.

this is log:

net.c:1057:instance port is 49618
net.c:205:Connecting to 10.5.2.2 port 49618 (TDS version 4.2)
net.c:270:tds_open_socket: connect(2) returned "Operation now in
progress"
net.c:310:tds_open_socket() succeeded
util.c:156:Changed query state from DEAD to IDLE
net.c:741:Sending packet
0000 02 00 02 00 00 00 00 00-62 61 63 6b 75 70 00 00 |........ backup..|
0010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0020 00 00 00 00 00 00 06 73-61 00 00 00 00 00 00 00 |.......s a.......|
0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0040 00 00 00 00 00 02 54 72-75 64 6e 65 68 61 73 6c |......********|
0050 6f 31 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |o1...... ........|
0060 00 00 00 00 0c 39 36 37-00 00 00 00 00 00 00 00 |.....967 ........|
0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0080 00 00 00 03 03 01 06 0a-09 01 00 00 00 00 02 00 |........ ........|
0090 00 00 00 00 50 48 50 20-35 00 00 00 00 00 00 00 |....PHP  5.......|
00a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
00b0 00 00 05 31 30 2e 35 2e-32 2e 32 5c 4f 50 54 49 |...10.5. 2.2\OPTI|
00c0 4d 41 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |MA...... ........|
(Continue reading)

Michael Koch | 8 Dec 14:04 2014
Picon

Problem with SQLPrepare and Sybase ASA 9

Hello all,

In a table which has 3 varchar(...) fields I try to INSERT the following 
statement with the released FreeTDS 0.92:

INSERT INTO dba.michaelstest (dNummer, DateinameBild, Unterschrift) 
VALUES ('00002', 'lalala.bmp', 'abc')

We use:
retcode = SQLPrepare(stmt, "INSERT INTO dba.michaelstest (dNummer, 
DateinameBild, Unterschrift) VALUES ('00002', 'lalala.bmp', 'abc')", 
SQL_NTS);
recode is here SQL_SUCCESS!
then we use:
recode = SQLExecute(stmt);
The recode here is 100 (SQL_NO_DATA).

We also use a Statement with one ? for testing and SQLBindParameter, 
SQLPrepare, SQLExecute, SQLParam, SQLPutData << it always all returned 
SUCCESFULL return code, the right code that is needed.

Form the 1. example (without ?) we geht on Sybase ASA 9.0.2 the 
following Debuglog:

08 12:22:02.394 ** DONE    conn: 1     CONNECT Conn=1
12/08 12:22:02.394 ** REQUEST conn: 1     DO_NOTHING
12/08 12:22:02.427 ** REQUEST conn: 1     STMT_EXECUTE_ANY_IMM "set 
textsize 64512 "
12/08 12:22:02.427 ** DONE    conn: 1     STMT_EXECUTE_ANY_IMM
12/08 12:22:02.459 ** REQUEST conn: 1     STMT_EXECUTE_ANY_IMM "WHILE 
(Continue reading)

Dennis Luehring | 7 Dec 15:45 2014
Picon
Picon

try to build freetds git with VS2010/nmake

follwing the guide:http://www.freetds.org/userguide/osissues.htm#WINDOWS

changed Nmakefile

from !IF 0 == [dir /b /ad CVS 2>NUL:]
to !IF 0 == [dir /b /ad .git 2>NUL:]

that works but then i've got a problem with

perl src\tds\types.pl misc\types.csv > $ <at> .err
gives error - and every run gives different error?

im using current activeperl

  >perl --version

This is perl 5, version 20, subversion 1 (v5.20.1) built for
MSWin32-x64-multi-thread
(with 1 registered patch, see perl -V for more detail)

1. run
  >perl src\tds\types.pl misc\types.csv > $ <at> .err
no value for type SYBDATE at src\tds\types.pl line 65.

2.run
no value for type SYBMSDATE at src\tds\types.pl line 65.
3.run
no value for type SYBDATETIMN at src\tds\types.pl line 65.
4.run
no value for type SYBVARBINARY at src\tds\types.pl line 65.
(Continue reading)

Alex Derbes | 5 Dec 16:03 2014
Picon

Fwd: FreeTDS on OSX 10.10 losing precision

I have FreeTDS 0.91 installed on Mac OSX 10.10. When Querying a SQLServer
2012 database, columns defined with double precision numbers are truncated
to single precision. I've checked the query with both sqsh and with the
python pymssql driver and get the same result.

Is it possible that I need to set something in my freetds.conf file to
enable double precision math?

Or is it possible that the column definition in the SQL Server database is
being incorrectly marshaled to a single precision number?

Thanks,
--Alex Derbes

The version of FreeTDS came from brew, here is the version information:

freetds: stable 0.91, HEAD

http://www.freetds.org/

/usr/local/Cellar/freetds/0.91_2 (600 files, 10.0M) *

  Built from source

From:
https://github.com/Homebrew/homebrew/blob/master/Library/Formula/freetds.rb
Sebastien FLAESCH | 3 Dec 13:00 2014

Memory leak with 0.92.556 in SQLDescribeCol()

Hi,

I experience a memory with SQLDescribeCol() or SQLNumResultCols(), when using 0.92.556.

Wanted to test a more recent version...

Can someone point me to the instructions to download FreeTDS dev version?

When I take the sources from https://gitorious.org/freetds/freetds, there is no configure script.

The INSTALL file contains instructions to use configure... what am I doing wrong?

Why is the www.freetds.org still showing an old "current" download link (0.92.377)?

Seb
Ramiro Morales | 23 Nov 19:31 2014
Picon

VARCHAR(max) in SP output params with TDS>=7.2 and rpc API

Hi all,

I've found FreeTDS master can't handle the new in TDS 7.2 ability to
handle values longer than 8000 chars.

I've opened a merge request which adds tests that show the failure:

https://gitorious.org/freetds/freetds/merge_requests/32

I tried to modify the RPC parameter handling rpc API code to get this
working by following what can be read at
http://www.freetds.org/tds.html#login7 ('Types' sub-section):

There is a call-out in that table for the XSYBVARBINARY, XSYBVARCHAR
and XSYBNVARCHAR data types that reads:

"* Under TDS 7.2+ these types allow size to be -1, representing
varchar(max), varbinary(max) and nvarchar(max)."

Unfortuately my attemps were unsuccessful. I suspect what is described
there doesn't apply to the RPC SP API.

Any hints on how these data types need to be represented on the wire
are welcome. I'd be willing to try to implement the required changes.

Regards,

PS: My use case is about output parameters, but it's possible input
ones also need work. See https://github.com/pymssql/pymssql/issues/275

(Continue reading)

Angelo Coccimiglio | 3 Dec 17:30 2014
Picon

bcp_done always returns error if no data was inserted

Hello,

I'm new to freetds... running version FREETDS-0_91
Whenever an attempt to bcp data within a C program and there are no 
records
the bcp_done routine returns -1 indicating an error... If there are 
records
available to bcp works fine..

Is there anything I should be looking for or setting up..
Here is part of the log wher bcp_done is called

1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]UTIL.C;1:156:Changed 
query state from PENDING to DEAD
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:326:dblib_release_tds_ctx(1)
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:6321:dbfreebuf(5DD490)
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:4984:dberrhandle(0)
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:4984:dberrhandle(0)
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:5003:dbmsghandle(0)
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:5003:dbmsghandle(180298)
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1689:dbresults(5B9F40)
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1695:dbresults: 
dbresults_state is 3
(_DB_RES_NEXT_RESULT)
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]TOKEN.C;1:540:tds_process_tokens(5BA7A0, 
7ACFBA58, 7ACFBA50, 0x6914)
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]TOKEN.C;1:543:tds_process_tokens() 
state is COMPLETED
$1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1716:dbresults() 
tds_process_tokens returned 2 (TDS_NO_MORE_RE?
(Continue reading)

Craig A. Berry | 20 Nov 20:53 2014
Picon

bp with empty char/varchar column broken

The following worked in 0.91 but is broken as of branch-0_92-839-gd788046.  If we bulk out a table with an
empty (but not NULL) char or varchar column that is less than 256 bytes long, 256 spaces get written to the
output file for that column.  Which then causes an overflow error if you try to bulk it back in.

I think it was e30a807 that broke it because in src/dblib/bcp.c:_bcp_exec_out we now pass a minimum of 256
as the destlen argument to dbconvert.  We used to pass -2, instructing dbconvert to null terminate without
copying anything.

I'm not sure what the correct fix is.  We could possibly pass the lesser of source length and destination
length to dbconvert in _bcp_exec_out.  

Here's a reproducer:

$ ./fisql/fisql -Smyserver -Utest
Password:
Changed database context to 'master'.
Changed language setting to us_english.
1>> use tempdb
2>> go
Changed database context to 'tempdb'.
1>> create table testbcp (tmpval varchar(10))
2>> go
1>> insert into testbcp values ('abc')
2>> go
(1 rows affected)
1>> insert into testbcp values ('')
2>> go
(1 rows affected)
1>> exit
$ ./freebcp tempdb.dbo.testbcp out tmp.bcp -Smyserver -Utest -P***** -c
(Continue reading)

Emmanuel Stapf | 15 Nov 10:33 2014

Issue with SQLDescribeCol

Hi,

I've recently been testing the EiffelStore binding to ODBC against a MSSQL database. For
that I'm using unixODBC and freetds. However our code does not work due to the fact that
when calling SQLDescribeCol with almost no arguments to get the length of the column name
it does not return anything.

The code we have looks like:

  rc = SQLDescribeCol(hstmt, (SQLSMALLINT) index, NULL, 0, &indColName, NULL, NULL, NULL,
NULL);

I looked at the code of SQLDescribeCol and found that in very old versions it would update
indColName and in the latest version although there is a comment at line 2009 of odbc.c
that says:

	/* cbColNameMax can be 0 (to retrieve name length) */

but nothing to that effect. Actually if you look at the following diff:

https://gitorious.org/freetds/freetds/commit/5508af66b79f1c6dee70d86f9c673e8b9b1b24ed

you see that the code that used to update pcbColName has disappeared from the current
version.

Am I missing something?

Thanks,
Manu

(Continue reading)

Schulz-Hildebrandt, Heiner | 14 Nov 14:27 2014
Picon

ct-lib bulkcopy rowlevel locking

Hello,
I am using freetds (0.91.102)  ct-lib (64 Bit) on MAC OSX 10.8 and MAC OSX 10.6.8  with Sybase 15.x server and
row-level-locking scheme (on table: my_table)
When I try to insert data into this table with bulk copy, I received the message:
-------------------------------------------
Msg 4845, Level 16, State 1 Server MY_SERVER,Bulk copy failed. Client does not have the capability to bulk
copy into the data-only locked table 'my_table'.
-------------------------------------------
and the command is aborted.

What can I do?

Thanks to anyone willing to help in any way.

________________________________
+++ ?ber 5.000 Ausgaben t?glich +++
Mehr als 100 Medienh?user weltweit produzieren t?glich Zeitungen
und digitale Angebote mit ppi Media L?sungen

+++ Over 5,000 editions daily +++
More than 100 media companies worldwide produce newspapers
and digital products with ppi Media's solutions.

Gmane