Re: [svn:dbi] r14993 - dbi/trunk/ex

Tim Bunce <[email protected]>, "H.Merijn Brand" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Thu, Nov 10, 2011 at 09:15:43AM -0800, [email protected] wrote:
> +} elsif ($driver eq 'Unify') {
> +    # Unify does not have varchar
> +    $h->{ChopBlanks} = 1;

Why ChopBlanks? Worth a # comment.

> +    $blob_column_type = 'binary';
> +    $unicode_column_type = 'char';	# or text
> +    $h->{uni_unicode} = 1;	# Available in the upcoming 0.81
> +    $length_fn = 'undefined';	# I don't think Unify has a function like this

You can't ask Unify for the length of a string? Really?

>  sub do_connect {
> -    my ($dsn, $user, $pass, %attr);
> -    if (@ARGV) {
> -        # eg unicode_test.pl "dbi:Pg(AutoCommit=0):host=example.com;port=6000;db=name" user pass
> -        ($dsn, $user, $pass) = @ARGV;
> -    }

Please restore that behaviour. Having people hard-code their own won't
scale well.

> +    $user //= $ENV{DBI_USER} // undef;
> +    $pass //= $ENV{DBI_PASS} // undef;

Please avoid //= etc. The test scripts should be runnable with older perls.

> +    $h->commit if $driver eq 'Unify';

>      return lives_ok {
> +        diag ($sql);
>          my $s = $h->prepare($sql);
>          $s->execute;
> +	$dbd eq "DBD::Unify" and $h->commit;

Better as:

  +    $h->commit if $driver eq 'Unify';

for consistency with the others.

Thanks!

Tim.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.