[Rt-devel] Re: Problem (and workaround) with Handle.pm in DBIx::SearchQuery used by RT

Stephen Turner sturner at MIT.EDU
Fri Dec 17 11:46:12 EST 2004


At Tuesday 12/14/2004 04:53 PM, Jesse Vincent wrote:


>Replicating the failure with a tiny DBI script that has the bare minimum
>code.  The current guess is that it's something with our $sth parameter
>binding.

I wasn't able to replicate the failure with a DBI script (included below). 
In fact, the insert worked as expected. I can't come up with an idea for 
why this would behave differently from the web interface.

One other test I did was to type in these URLs directly into the browser:

https://server/Admin/Users/Modify.html?id=new&Name=tester3&Comments=none

https://server/Admin/Users/Modify.html?id=new&Name=tester4

The first one failed, the second succeeded - probably to be expected.

Steve



#!/bin/perl -I $ENV{RT_HOME}/lib

BEGIN {
     die "RT_HOME environment variable is not defined"
         if ! defined $ENV{RT_HOME};
}

use lib $ENV{RT_HOME}."/etc";
use lib $ENV{RT_HOME}."/lib";

use RT::Interface::CLI qw (CleanEnv GetCurrentUser);
use RT::User;
use RT::Interface::Web;

# Do RT API initialization:
CleanEnv();
RT::LoadConfig();
RT::Init();

$RT::Handle->BeginTransaction();

my ($val, $msg) = ();

my $UserObj = new RT::User(RT::SystemUser);
($val, $msg) = $UserObj->Create( Name => 'pedro',
                                     EmailAddress => 'pedro at mets.com',
                                     RealName => 'Pedro Martinez',
                                     );

print "Attempt 1 (no comment): $msg\n";

$UserObj = new RT::User(RT::SystemUser);
($val, $msg) = $UserObj->Create( Name => 'pedro2',
                                  EmailAddress => 'pedro at redsox.com',
                                  RealName => 'Pedro Martinez',
                                  Comments => 'Gone'
                                  );

print "Attempt 2 (comment): $msg\n";

$RT::Handle->Commit();
$RT::Handle->Disconnect();

exit;



More information about the Rt-devel mailing list