Donate Share

ShellSQL

Tracker: Bugs

5 shsql returns values when should be null - ID: 1455019
Last Update: Comment added ( jfouse )

Given the following test setup:

create table shtest (
a int,
b int
);
insert into shtest values (0, null);
insert into shtest values (1, 1);
insert into shtest values (2, null);
insert into shtest values (3, null);
insert into shtest values (4, 4);
insert into shtest values (5, null);

The command:

shsql $HANDLE "select * from shtest";

...returns the following:

"0" ""
"1" "1"
"2" "1"
"3" "1"
"4" "4"
"5" "4"

So what's happening is that when it encounters a null
in the second column AFTER having previously returned a
value in that column, it's simply returning the value
it had for that column in the previous row for EVERY
row until it has a new value. More to the point, some
value isn't getting zeroed out in the loop.

I'm currently using ms-sql, so connecting through
freetds. I have not yet had an opportunity to test
against other data sources. Nor do I have the time
now, though I'm curious to try, to work through
debugging this. If I manage, I will submit a patch,
but I'm not sure how soon I'll be able to do that.


Joel Fouse ( jfouse ) - 2006-03-21 00:14

5

Closed

Works For Me

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2006-03-24 12:52
Sender: jfouse

Logged In: YES
user_id=456585

Okay, I read the fine manual again (or more to the point,
README.freetds), and see that this is a known issue. As I
was able to patch freetds per instructions and resolve the
issue, I'll close the bug. However, for what it's worth, I
find it interesting that freetds's own command-line sql
client, tsql, does not exhibit the problem behavior without
the patch. Does tsql not use the ct lib?


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2006-03-24 12:52 jfouse
resolution_id None 2006-03-24 12:52 jfouse
close_date - 2006-03-24 12:52 jfouse