More things that don't work with MS Native Client driver

I'm mostly blogging this as a reminder that I've received even more code using Perl and DBD::ODBC via the MS native client driver (not the MS SQL Server ODBC driver which works) which fails in strange ways. This code came to me via Rafael Kitover (@Caelum) and was a cut down demonstration of something dbic does/did? The first example is:
#!/usr/bin/perl

use strict;
use warnings;
use Test::More;
use DBI;

my $dbh = DBI->connect(
    'dbi:ODBC:nativec',
    { RaiseError => 1, PrintError => 0 },
);

$dbh->do(<<"EOF");
CREATE TABLE mssql_insert_test_$$ (
    id int identity,
    nchar_col nchar(3),
    nvarchar_col nvarchar(100)
)
EOF

my $sth = $dbh->prepare(<<"EOF");
INSERT INTO mssql_insert_test_$$
(nchar_col, nvarchar_col)
VALUES
(?, ?)
SELECT SCOPE_IDENTITY()
EOF

$sth->bind_param_array(1, [undef, 'foo']);
$sth->bind_param_array(2, [undef, 'bar']);

$sth->execute_array({ ArrayTupleStatus => \my @tuple_status });

$sth->finish;

my ($nchar_col, $nvarchar_col) = $dbh->selectrow_array(<<"EOF");
SELECT nchar_col, nvarchar_col
FROM mssql_insert_test_$$
With MS SQL Server ODBC Driver the above works. With the Native Client driver it fails because "foo" and "bar" are inserted as "f" and "b". Strangely, if you remove that "select scope_identity" it works! So I think there is a bug in the driver somewhere but then again this code is using execute_array so why is it selecting? execute_array is like a loop over the do method and as far as I know there is nothing to allow a Perl script to fetch the selected identity on each set of tuples. I almost expect an error like "connection is busy with results from another hstmt" as nothing did a fetch between each row inserted. I confirmed that the ODBC calls when running this script to MS SQL Server ODBC Driver and Native Client Driver were the same. The second example is very similar but with a different error:
#!/usr/bin/perl

use strict;
use warnings;
use Test::More;
use Test::Exception;
use DBI;

my $dbh = DBI->connect(
    'dbi:ODBC:nativec',
    { RaiseError => 1, PrintError => 0 },
);

$dbh->do(<<"EOF");
CREATE TABLE mssql_insert_test_$$ (
    id int identity,
    smalldt_col smalldatetime
)
EOF

my $sth = $dbh->prepare(<<"EOT");
SET IDENTITY_INSERT mssql_insert_test_$$ ON
INSERT INTO mssql_insert_test_$$
(id, smalldt_col)
VALUES
(?, ?)
SELECT SCOPE_IDENTITY()
EOT

$sth->bind_param_array(1, [1, 2]);
$sth->bind_param_array(2, [undef, '2011-04-25 09:38:00']);

lives_ok {
    $sth->execute_array({ ArrayTupleStatus => \my @tuple_status });
} 'execute_array with smalldatetime survived';

my ($smalldt_col) = $dbh->selectrow_array(<<"EOF");
SELECT smalldt_col
FROM mssql_insert_test_$$
WHERE id = 2
EOF

is $smalldt_col, '2011-04-25 09:38:00',
    'smalldatetime value roundtrip';

done_testing;

END {
    $dbh->do("DROP TABLE mssql_insert_test_$$");
}
which fails with: DBD::ODBC::st execute_array failed: [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting character string to smalldatetime data type. (SQL-22007) [err was 1 now 2000000000] Here again, if you remove the "SELECT SCOPE_IDENTITY()" the problem goes away.