Add some automatic test to the daily one

Test dump to file and check that dump contains some values.
Fix test for protocol auto discovery checking the right server.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Don't return newline from VMS-specific readline.

readline is documented to return a line without the trailing
newline, but we haven't been doing this in our homegrown version
so would sometimes see doubled newlines in fisql.
Make fisql exit with failure when it fails.

It seems that the Sybase flavor of isql does not do this, but the
Microsoft flavor of isql and its descendants do.  But it's gosh
darn convenient when running fisql from a script to be able to
check whether it succeeded, and it isn't going to cause any trouble
for the interactive user, who is highly unlikely to be looking at
the exit status after running fisql.
alloca for VMS

We are now using alloca, which doesn't exist as a function on VMS,
but it's available as a builtin.
Use is_nullable_type macro in dblib

Avoid to implement same long switch if a macro is already available.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Handle strlcat cases where destination is longer than buffer specified

Documentation state that if string is already longer than passed buffer
nothing should be done so handle this case.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Implement dbalttype in a similar way to dbcoltype

Make it simpler and easy to maintain.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Avoid buffer overflow building command in datacopy

Use tds_strlcat to avoid buffer overflow building the command to create
new table.
Also check that the type is supported by this utility.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Fix check for SYBMSDATE type

Microsoft DATE type is a fixed type as it is always 3 bytes long.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>