Re: Why is selectrow_hashref complaining about a fetch without execute?

"David E. Wheeler" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Jul 16, 2015, at 6:40 AM, Tim Bunce <[email protected]> wrote:

> Well, this contains lots more light! ...
> 
>>> -> dbd_st_execute for 03fdf4e0
>>>> parse_params statement 
>>>        SELECT c.change_id ...
> 
>>> Binding parameters: SELECT c.change_id
> 
>>>        --> do_error
>>> Out of sort memory, consider increasing server sort buffer size error 1038 recorded: Out of sort memory, consider increasing server sort buffer size
>>>        <-- do_error
>>> <- dbd_st_execute returning imp_sth->row_num 18446744073709551615
>>>    !! ERROR: 1038 'Out of sort memory, consider increasing server sort buffer size' (err#0)
>>>    <- execute= ( -1 ) [1 items] at /usr/lib/perl5/DBI.pm line 1632 via  at /usr/local/share/perl/5.18.2/App/Sqitch/Role/DBIEngine.pm line 149
> 
> So execute failed. Note the crazy row_num. Execute seems to have
> returned -1, which is a true value.
> 
>>>    !! The ERROR '1038' was CLEARED by call to fetchrow_hashref method
>>>    -> fetchrow_hashref for DBD::mysql::st (DBI::st=HASH(0x42cfcc0)~0x4231cf8) thr#2603010
> 
> Then the higher-level code called fetchrow_hashref, which cleared the
> error recorded by execute().

FWIW, the database handle is created like this:

        my $dbh = DBI->connect($uri->dbi_dsn, scalar $self->username, $pass, {
            PrintError           => 0,
            RaiseError           => 0,
            AutoCommit           => 1,
            mysql_enable_utf8    => 1,
            mysql_auto_reconnect => 0,
            mysql_use_result     => 0, # Prevent "Commands out of sync" error.
            HandleError          => sub {
                my ($err, $dbh) = @_;
                $@ = $err;
                @_ = ($dbh->state || 'DEV' => $dbh->errstr);
                goto &hurl;
            },

Context: https://github.com/theory/sqitch/blob/master/lib/App/Sqitch/Engine/mysql.pm#L59

So I’m a little confused as to why the execute failure was ignored. Is this an issue with DBD::mysql?

I assume the OP’s server could use some tuning. Seems pretty weird, though.

Thanks,

David
smime.p7s (application/pkcs7-signature, 4 KB) - not displayed
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.