- summary: parsing of empty fi --> parsing of empty fields
Using freetds 0.64, I'm having some discrepancies in how sqsh 2.1 and sqsh 2.1.4 are parsing returned data.
Connecting to a SQL Server DB with the following freetds setup:
[corpusdb03]
host = 128.221.130.139
port = 1433
tds version = 7.0
try domain logins = no
try server logins = no
nt domain = CORP
cross domain login = no
initial block size = 512
swap broken dates = no
swap broken money = no
Using the command:
sqsh -r -b -m vert -S corpusdb03 -U <username> -P <password> -D Patents -C "select * from tblPatInventor where InventorID='1234'"
gives different results depending on whether I use sqsh 2.1 or sqsh 2.1.4. The earlier versions gives the "correct" results:
InventorID: 1234
Greeting: NULL
Address2: NULL
Address3: NULL
Address4: NULL
state: MA
POAddress1: NULL
POAddress2: NULL
POAddress3: NULL
POAddress4: NULL
POCity: NULL
POState: NULL
POZipCode: NULL
POCountry: NULL
Country: US
Language: English
Citizenship: US
Email: NULL
WebSite: NULL
DateCreated: Jul 01 2002 12:00AM
LastUpdate: Aug 22 2002 12:00AM
Remarks: NULL
tStamp: 0x0x00000000001cca9a
(1 row affected)
sqsh 2.1.4 either drops several NULLs, or they're somehow stored as empty fields (?) in the DB:
InventorID: 1234
Greeting: Address2: Address3: Address4: state: MA
POAddress1: POAddress2: POAddress3: POAddress4: POCity: POState: POZipCode: POCountry: NULL
Country: US
Language: English
Citizenship: US
Email: WebSite: DateCreated: Jul 01 2002 12:00AM
LastUpdate: Aug 22 2002 12:00AM
Remarks: tStamp: 0x00000000001cca9a
(1 row affected)
It seems that sqsh 2.1.4 doesn't get a NULL for some fields, so it doesn't print a newline, and the next field (column) gets printed on the same line, instead of on a new line (remember, this is the VERTICAL mode).
Is this a bug in sqsh? Did I compile 2.1.4 wrong? (Someone else compiled 2.1.) Everything else about 2.1.4 seems to work fine, including using "domain" usernames/passwords, which I need for another DB.
Thanks!