Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

RE: Need Help on dblib program: msg#00091

db.tds.freetds

Subject: RE: Need Help on dblib program

> From: Steven J. Backus [mailto:backus@xxxxxxxxxxxxx]
> Sent: July 31, 2003 5:08 PM
>
> > What does your log show? Does it stop just before the
> "family" conversion?
>
> The last few lines from the log are:
>
> 15:01:26.158004 dbconvert() srctype = 39 desttype = 47
> 15:01:26.269232 dbconvert() calling tds_convert
> 15:01:26.378415 dbconvert() called tds_convert returned 4
> 15:01:26.491374 dbconvert() outputting 4 bytes character data
> destlen = -2

Well, then we know things went awry before that. We have to look at
tds_convert's input (see my last message) but I'll bet 10:1 it's corrupted.
Why is it four bytes?

A little before the I5 conversion is the dage conversion. Your table has
that as datatype float, 8 bytes, and you're binding it to a C float, 4
bytes. Does anything change if you redefine the age column as datatype
"real" instead?

> Then I do "c" again, another watch point appears:
>
> Old value = 84 'T'
> New value = 0 '\000'
> dbconvert (dbproc=0x807b910, srctype=39, src=0x807d214
> "I64TY", srclen=3, desttype=47,
> dest=0x804763c "I64", destlen=-2) at dblib.c:1907
> 1907 ret = len;
> (gdb) bt
> #0 dbconvert (dbproc=0x807b910, srctype=39, src=0x807d214
> "I64TY", srclen=3, desttype=47,
> dest=0x804763c "I64", destlen=-2) at dblib.c:1907
> #1 0x804a471 in buffer_transfer_bound_data (rowtype=-1,
> compute_id=0, buf=0x807b914,
> dbproc=0x807b910, row_num=2) at dblib.c:449

Oh, boy. We're supposed to believe that assigning "len" to "ret" changes
the value of your bound variable. I'll choose to believe that's not true,
that it's actually the statement prior:

dest[len] = 0;

that's doing the job, as expected. The real question is: what happened to
cause tds_convert() to return 4 when its varchar input was "I64" and srclen
was 3?

> And yet again:
>
> Hardware watchpoint 2: *(DBCHAR *) 134510143
>
> Old value = 0 '\000'
> New value = -33 'ß'
> (gdb) bt
> #0 0xdfae22bf in ?? ()
> #1 0xdfad3339 in ?? ()

This is expected. You're exiting the program. Memory's being freed and
reused on the way out.

The next step is to try changing the age to type real. That will avoid the
8->4 byte conversion, and I think the problem will go away. If not, log the
inputs to dbconvert and tds_convert.

My guess is we're doing something silly with dage, but I don't see what it
is yet.

--jkl
-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any review,
dissemination, distribution or duplication of this communication is strictly
prohibited. If you are not the intended recipient, please contact the sender
immediately by reply e-mail and destroy all copies of the original message.
Please note that we do not accept account orders and/or instructions by e-mail,
and therefore will not be responsible for carrying out such orders and/or
instructions.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation