Skip to Content.
Sympa Menu

freetds - [freetds] string problem about freeTDS

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Difei Qi <fredericqi AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] string problem about freeTDS
  • Date: Mon, 6 Sep 2010 13:40:44 +0800

hello,
I met a strange problem as following:

I have a table with a nvarchar(20), or text TYPE, just like
create table ttext
(
data nvarchar(20)
--or data text
)

insert into ttext values(NULL);

and then I use freeTDS to get the data out, it give me the value *X* and the
lengh of the value is *3*
*but the real value is NULL ,how could this happen?*
*
*
*And the more stranger things is, when I create a view as following:*
*
*
*
CREATE VIEW vw_ttext
AS
SELECT ISNULL(data,'') AS data FROM ttext

there is no space between '',and then I get the value using the view:

select data from vw_ttext

and the freeTDS cord dump with the error message:

sqlapi: dblib.c:626: dbgetnull: Assertion `!"unknown bindtype"' failed.
/bin/sh: line 1: 17573 Aborted (core dumped) ./sqlapi 1
Press Enter to continue!

not only due to the view, if one column of the real table has the value
just like '', freeTDS will core dump as well.
I don't know what cause this happen?

there exists a lot of columns which data may be just '' and I don't want to
check whether it is in this condition, can you help me? My version is 0.82,
and I have tried your new 0.82.patch, the problem still exists.
Many thanks!

*




Archive powered by MHonArc 2.6.24.

Top of Page