Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

The execute statement throws a warning if a parameter is undef

CUBRID Official Forum » Programming Languages » Perl API » The execute statement throws a warning if a parameter is undef

author
message
[Level:2]stefans

Post subject: The execute statement throws a warning if a parameter is undef

registered: 06/29/2012

IP: *.116.213.202

views: 0

Hi,

I'm using the DBD::cubrid module v9.1.0.0001 and server v9.1.0, here is a short test:

#!/bin/env perl

use strict;
use warnings;
use DBI;

my $dbname = 'sqitch';
my $user   = 'user';
my $pass   = 'pass';

my $dsn = qq{dbi:cubrid:database=$dbname;host=localhost;port=33000};

my $dbh = DBI->connect(
    $dsn, $user, $pass,
    {   AutoCommit  => 1,
        RaiseError  => 1,
        PrintError  => 1,
    }
) or die $DBI::errstr;

my ( $proj, $uri, $puser, $email )
    = ( 'engine', undef, 'Marge Simpson', 'marge@example.com' );

my $sql = <<"SQL";
INSERT INTO projects (project, uri, creator_name, creator_email)
    VALUES (?, ?, ?, ?);
SQL

my $sth= $dbh->prepare($sql) or die $DBI::errstr;
$sth->execute($proj, $uri, $puser, $email) or die $DBI::errstr;

$dbh->disconnect;

The problem is that I get a warning : Use of uninitialized value in subroutine entry at test-cubrid.pl line 30. That is the line with the  execute statement. Again, this is not the behaviour the other drivers have.

Note that if warnings is off the warning is not thrown, obviously, but the desired behaviour is to insert a NULL, and it does, and not throw any warnings, even with warnings set to on.

Thanks,
Stefan

Quote
[Level:3]Esen Sagynov

# Post subject:Re: The execute statement throws a warning if a parameter is undef

profile

registered: 05/31/2011

IP: *.91.139.82

Have reported this issue to http://jira.cubrid.org/browse/APIS-591. We will check the behavior of other drivers and make sure our Perl driver provides similar behavior.

Thank you Stefan for reporting these issues.

Quote




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: