fetchrow_array() failed: fetch() without execute() ..., with intermittant syntax error

fetchrow_array() failed: fetch() without execute() ..., with intermittant syntax error

am 02.05.2003 12:56:02 von Joel Rees

We have a web system (Perl) that is intermittantly giving this error:

DBD::mysql::st fetchrow_array() failed: fetch() without
execute() at ... webmin

Sometimes it also gives this error

DBD::mysql::st execute failed: You have an error in your
SQL syntax near ') GROUP BY

and so forth.

We've dumped the statement that is being executed and run it from the
command line without errors, but since these errors are intermittant,
that is not surprising.

System information:
Solaris 2.8 -- sparc
perl 5.6.1
MySQL 3.23.45
Apache 1.3.27
Mod-ssl 2.8.11
OpenSSL 0.9.6i

These errors started showing up after upgrading apache and installing
mod-ssl, and after raising the log level on apache. We are not,
therefore sure if they were there before the upgrade.

Does this ring a bell with anyone? I've checked the archives and found
some mention of possible deadlock related problems,

http://marc.theaimsgroup.com/?l=msql-mysql-modules&m=1020265 13407236&w=2

and we're looking into that and other things we have thought of, but we
would appreciate any leads we can get.

--
Joel Rees
http://www.alpsgiken.co.jp


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: fetchrow_array() failed: fetch() without execute() ..., with intermittant syntax error

am 02.05.2003 17:48:13 von Greg Meckes

Sounds as if there might be a Perl syntax error???

This has happened to me as a result from single quotes from the input that aren't parsed
correctly. Also, maybe some vars aren't getting initialized.

Can we see the code?

Greg

--- Joel Rees wrote:
> We have a web system (Perl) that is intermittantly giving this error:
>
> DBD::mysql::st fetchrow_array() failed: fetch() without
> execute() at ... webmin
>
> Sometimes it also gives this error
>
> DBD::mysql::st execute failed: You have an error in your
> SQL syntax near ') GROUP BY
>
> and so forth.
>
> We've dumped the statement that is being executed and run it from the
> command line without errors, but since these errors are intermittant,
> that is not surprising.
>
> System information:
> Solaris 2.8 -- sparc
> perl 5.6.1
> MySQL 3.23.45
> Apache 1.3.27
> Mod-ssl 2.8.11
> OpenSSL 0.9.6i
>
> These errors started showing up after upgrading apache and installing
> mod-ssl, and after raising the log level on apache. We are not,
> therefore sure if they were there before the upgrade.
>
> Does this ring a bell with anyone? I've checked the archives and found
> some mention of possible deadlock related problems,
>
> http://marc.theaimsgroup.com/?l=msql-mysql-modules&m=1020265 13407236&w=2
>
> and we're looking into that and other things we have thought of, but we
> would appreciate any leads we can get.
>
> --
> Joel Rees
> http://www.alpsgiken.co.jp
>
>
> --
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe: http://lists.mysql.com/perl?unsub=gregmeckes@yahoo.com
>


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: fetchrow_array() failed: fetch() without execute() ..., with intermittant syntax error

am 02.05.2003 17:48:13 von Greg Meckes

Sounds as if there might be a Perl syntax error???

This has happened to me as a result from single quotes from the input that aren't parsed
correctly. Also, maybe some vars aren't getting initialized.

Can we see the code?

Greg

--- Joel Rees wrote:
> We have a web system (Perl) that is intermittantly giving this error:
>
> DBD::mysql::st fetchrow_array() failed: fetch() without
> execute() at ... webmin
>
> Sometimes it also gives this error
>
> DBD::mysql::st execute failed: You have an error in your
> SQL syntax near ') GROUP BY
>
> and so forth.
>
> We've dumped the statement that is being executed and run it from the
> command line without errors, but since these errors are intermittant,
> that is not surprising.
>
> System information:
> Solaris 2.8 -- sparc
> perl 5.6.1
> MySQL 3.23.45
> Apache 1.3.27
> Mod-ssl 2.8.11
> OpenSSL 0.9.6i
>
> These errors started showing up after upgrading apache and installing
> mod-ssl, and after raising the log level on apache. We are not,
> therefore sure if they were there before the upgrade.
>
> Does this ring a bell with anyone? I've checked the archives and found
> some mention of possible deadlock related problems,
>
> http://marc.theaimsgroup.com/?l=msql-mysql-modules&m=1020265 13407236&w=2
>
> and we're looking into that and other things we have thought of, but we
> would appreciate any leads we can get.
>
> --
> Joel Rees
> http://www.alpsgiken.co.jp
>
>
> --
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe: http://lists.mysql.com/perl?unsub=gregmeckes@yahoo.com
>


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: fetchrow_array() failed: fetch() without execute() ..., with intermittant syntax error

am 05.05.2003 12:11:26 von Greg Meckes

>> We have a web system (Perl) that is intermittantly giving this
error:
>>
>> DBD::mysql::st fetchrow_array() failed: fetch() without
>> execute() at ... webmin

This error indicates a missing 'execute' statement as in:
$sth = $dbh->prepare("SELECT CATEGORY_ID FROM category") or die $sth->errstr;
$sth->execute or die $sth->errstr;


>> Sometimes it also gives this error
>>
>> DBD::mysql::st execute failed: You have an error in your
>> SQL syntax near ') GROUP BY

This happens when input has single quotes sometimes or it might me something in the code itself.
Without seeing it, this is all I can think of.



--- Joel Rees wrote:
> Greg Meckes wrote
> > Sounds as if there might be a Perl syntax error???
> >
> > This has happened to me as a result from single quotes from the input
> > that aren't parsed
> > correctly. Also, maybe some vars aren't getting initialized.
>
> Well, syntax, initialization, and character escaping we're the first
> things they started looking for. At this point, the team leader is
> pretty sure the escaping is correct.
>
> Unfortunately, the code is live, and they don't have the input that
> causes the errors, so it's hard to make sure the character escaping is
> not causing errors on some input. Right now, they are working on ways
> to log the failing input.
>
> > Can we see the code?
>
> Not at this point. Hopefully we can get it pinned down better shortly,
> but right now we're still bumping around in the dark. (Original authors
> not available etc.) The code they've looked at so far looks fairly
> reasonable, which is why they asked me to check for other issues, such
> as record locking and mutual exclusion.
>
> I'll probably post code and more questions after they get the logging
> in place, but if anyone has more information on the deadlock issues,
> I'd sure appreciate hearing about it.
>
> > --- Joel Rees wrote:
> >> We have a web system (Perl) that is intermittantly giving this error:
> >>
> >> DBD::mysql::st fetchrow_array() failed: fetch() without
> >> execute() at ... webmin
> >>
> >> Sometimes it also gives this error
> >>
> >> DBD::mysql::st execute failed: You have an error in your
> >> SQL syntax near ') GROUP BY
> >>
> >> and so forth.
> >>
> >> We've dumped the statement that is being executed and run it from the
> >> command line without errors, but since these errors are intermittant,
> >> that is not surprising.
> >>
> >> System information:
> >> Solaris 2.8 -- sparc
> >> perl 5.6.1
> >> MySQL 3.23.45
> >> Apache 1.3.27
> >> Mod-ssl 2.8.11
> >> OpenSSL 0.9.6i
> >>
> >> These errors started showing up after upgrading apache and installing
> >> mod-ssl, and after raising the log level on apache. We are not,
> >> therefore sure if they were there before the upgrade.
> >>
> >> Does this ring a bell with anyone? I've checked the archives and found
> >> some mention of possible deadlock related problems,
> >>
> >>
> >> http://marc.theaimsgroup.com/?l=msql-mysql-
> >> modules&m=102026513407236&w=2
> >>
> >> and we're looking into that and other things we have thought of, but
> >> we
> >> would appreciate any leads we can get.
>
> --
> Joel Rees
> http://www.alpsgiken.co.jp
>
>
> --
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe: http://lists.mysql.com/perl?unsub=gregmeckes@yahoo.com
>


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: fetchrow_array() failed: fetch() without execute() ..., with intermittant syntax error

am 05.05.2003 12:11:26 von Greg Meckes

>> We have a web system (Perl) that is intermittantly giving this
error:
>>
>> DBD::mysql::st fetchrow_array() failed: fetch() without
>> execute() at ... webmin

This error indicates a missing 'execute' statement as in:
$sth = $dbh->prepare("SELECT CATEGORY_ID FROM category") or die $sth->errstr;
$sth->execute or die $sth->errstr;


>> Sometimes it also gives this error
>>
>> DBD::mysql::st execute failed: You have an error in your
>> SQL syntax near ') GROUP BY

This happens when input has single quotes sometimes or it might me something in the code itself.
Without seeing it, this is all I can think of.



--- Joel Rees wrote:
> Greg Meckes wrote
> > Sounds as if there might be a Perl syntax error???
> >
> > This has happened to me as a result from single quotes from the input
> > that aren't parsed
> > correctly. Also, maybe some vars aren't getting initialized.
>
> Well, syntax, initialization, and character escaping we're the first
> things they started looking for. At this point, the team leader is
> pretty sure the escaping is correct.
>
> Unfortunately, the code is live, and they don't have the input that
> causes the errors, so it's hard to make sure the character escaping is
> not causing errors on some input. Right now, they are working on ways
> to log the failing input.
>
> > Can we see the code?
>
> Not at this point. Hopefully we can get it pinned down better shortly,
> but right now we're still bumping around in the dark. (Original authors
> not available etc.) The code they've looked at so far looks fairly
> reasonable, which is why they asked me to check for other issues, such
> as record locking and mutual exclusion.
>
> I'll probably post code and more questions after they get the logging
> in place, but if anyone has more information on the deadlock issues,
> I'd sure appreciate hearing about it.
>
> > --- Joel Rees wrote:
> >> We have a web system (Perl) that is intermittantly giving this error:
> >>
> >> DBD::mysql::st fetchrow_array() failed: fetch() without
> >> execute() at ... webmin
> >>
> >> Sometimes it also gives this error
> >>
> >> DBD::mysql::st execute failed: You have an error in your
> >> SQL syntax near ') GROUP BY
> >>
> >> and so forth.
> >>
> >> We've dumped the statement that is being executed and run it from the
> >> command line without errors, but since these errors are intermittant,
> >> that is not surprising.
> >>
> >> System information:
> >> Solaris 2.8 -- sparc
> >> perl 5.6.1
> >> MySQL 3.23.45
> >> Apache 1.3.27
> >> Mod-ssl 2.8.11
> >> OpenSSL 0.9.6i
> >>
> >> These errors started showing up after upgrading apache and installing
> >> mod-ssl, and after raising the log level on apache. We are not,
> >> therefore sure if they were there before the upgrade.
> >>
> >> Does this ring a bell with anyone? I've checked the archives and found
> >> some mention of possible deadlock related problems,
> >>
> >>
> >> http://marc.theaimsgroup.com/?l=msql-mysql-
> >> modules&m=102026513407236&w=2
> >>
> >> and we're looking into that and other things we have thought of, but
> >> we
> >> would appreciate any leads we can get.
>
> --
> Joel Rees
> http://www.alpsgiken.co.jp
>
>
> --
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe: http://lists.mysql.com/perl?unsub=gregmeckes@yahoo.com
>


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: fetchrow_array() failed: fetch() without execute() ..., with intermittant syntax error

am 05.05.2003 14:14:35 von Jay Lawrence

Are you using place holders when preparing your statements? It is not
uncommon to forget to escape one of the criteria terms. Presumably this
is based on some sort of a lookup section of your site. Supply a term
with a single quote in your web interface to see if it causes the
search error again.

However when you are constructing queries it is safer and reliable (and
less work) to construct them thusly

my $sth = $dbh->prepare("select category_id from category where title
= ?");
$sth->execute( $title_search_term );

Then there is no escaping issue. It is also much more portable at that
point.

When you are explicitly escaping SQL terms how are you doing it? By a
regular expression or by $dbh->quote() ?

Hope that helps
Jay


On Monday, May 5, 2003, at 06:11 AM, Greg Meckes wrote:

>>> We have a web system (Perl) that is intermittantly giving this
> error:
>>>
>>> DBD::mysql::st fetchrow_array() failed: fetch() without
>>> execute() at ... webmin
>
> This error indicates a missing 'execute' statement as in:
> $sth = $dbh->prepare("SELECT CATEGORY_ID FROM category") or die
> $sth->errstr;
> $sth->execute or die $sth->errstr;
>
>
>>> Sometimes it also gives this error
>>>
>>> DBD::mysql::st execute failed: You have an error in your
>>> SQL syntax near ') GROUP BY
>
> This happens when input has single quotes sometimes or it might me
> something in the code itself.
> Without seeing it, this is all I can think of.
>
>
>
> --- Joel Rees wrote:
>> Greg Meckes wrote
>>> Sounds as if there might be a Perl syntax error???
>>>
>>> This has happened to me as a result from single quotes from the input
>>> that aren't parsed
>>> correctly. Also, maybe some vars aren't getting initialized.
>>
>> Well, syntax, initialization, and character escaping we're the first
>> things they started looking for. At this point, the team leader is
>> pretty sure the escaping is correct.
>>
>> Unfortunately, the code is live, and they don't have the input that
>> causes the errors, so it's hard to make sure the character escaping is
>> not causing errors on some input. Right now, they are working on ways
>> to log the failing input.
>>
>>> Can we see the code?
>>
>> Not at this point. Hopefully we can get it pinned down better shortly,
>> but right now we're still bumping around in the dark. (Original
>> authors
>> not available etc.) The code they've looked at so far looks fairly
>> reasonable, which is why they asked me to check for other issues, such
>> as record locking and mutual exclusion.
>>
>> I'll probably post code and more questions after they get the logging
>> in place, but if anyone has more information on the deadlock issues,
>> I'd sure appreciate hearing about it.
>>
>>> --- Joel Rees wrote:
>>>> We have a web system (Perl) that is intermittantly giving this
>>>> error:
>>>>
>>>> DBD::mysql::st fetchrow_array() failed: fetch() without
>>>> execute() at ... webmin
>>>>
>>>> Sometimes it also gives this error
>>>>
>>>> DBD::mysql::st execute failed: You have an error in your
>>>> SQL syntax near ') GROUP BY
>>>>
>>>> and so forth.
>>>>
>>>> We've dumped the statement that is being executed and run it from
>>>> the
>>>> command line without errors, but since these errors are
>>>> intermittant,
>>>> that is not surprising.
>>>>
>>>> System information:
>>>> Solaris 2.8 -- sparc
>>>> perl 5.6.1
>>>> MySQL 3.23.45
>>>> Apache 1.3.27
>>>> Mod-ssl 2.8.11
>>>> OpenSSL 0.9.6i
>>>>
>>>> These errors started showing up after upgrading apache and
>>>> installing
>>>> mod-ssl, and after raising the log level on apache. We are not,
>>>> therefore sure if they were there before the upgrade.
>>>>
>>>> Does this ring a bell with anyone? I've checked the archives and
>>>> found
>>>> some mention of possible deadlock related problems,
>>>>
>>>>
>>>> http://marc.theaimsgroup.com/?l=msql-mysql-
>>>> modules&m=102026513407236&w=2
>>>>
>>>> and we're looking into that and other things we have thought of, but
>>>> we
>>>> would appreciate any leads we can get.
>>
>> --
>> Joel Rees
>> http://www.alpsgiken.co.jp
>>
>>
>> --
>> MySQL Perl Mailing List
>> For list archives: http://lists.mysql.com/perl
>> To unsubscribe:
>> http://lists.mysql.com/perl?unsub=gregmeckes@yahoo.com
>>
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> --
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe: http://lists.mysql.com/perl?unsub=Jay@lawrence.net
>
>
>
----
Infonium Inc.
Open Source Information Management
http://www.infonium.ca/


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: fetchrow_array() failed: fetch() without execute() ..., with intermittant syntax error

am 05.05.2003 14:14:35 von Jay Lawrence

Are you using place holders when preparing your statements? It is not
uncommon to forget to escape one of the criteria terms. Presumably this
is based on some sort of a lookup section of your site. Supply a term
with a single quote in your web interface to see if it causes the
search error again.

However when you are constructing queries it is safer and reliable (and
less work) to construct them thusly

my $sth = $dbh->prepare("select category_id from category where title
= ?");
$sth->execute( $title_search_term );

Then there is no escaping issue. It is also much more portable at that
point.

When you are explicitly escaping SQL terms how are you doing it? By a
regular expression or by $dbh->quote() ?

Hope that helps
Jay


On Monday, May 5, 2003, at 06:11 AM, Greg Meckes wrote:

>>> We have a web system (Perl) that is intermittantly giving this
> error:
>>>
>>> DBD::mysql::st fetchrow_array() failed: fetch() without
>>> execute() at ... webmin
>
> This error indicates a missing 'execute' statement as in:
> $sth = $dbh->prepare("SELECT CATEGORY_ID FROM category") or die
> $sth->errstr;
> $sth->execute or die $sth->errstr;
>
>
>>> Sometimes it also gives this error
>>>
>>> DBD::mysql::st execute failed: You have an error in your
>>> SQL syntax near ') GROUP BY
>
> This happens when input has single quotes sometimes or it might me
> something in the code itself.
> Without seeing it, this is all I can think of.
>
>
>
> --- Joel Rees wrote:
>> Greg Meckes wrote
>>> Sounds as if there might be a Perl syntax error???
>>>
>>> This has happened to me as a result from single quotes from the input
>>> that aren't parsed
>>> correctly. Also, maybe some vars aren't getting initialized.
>>
>> Well, syntax, initialization, and character escaping we're the first
>> things they started looking for. At this point, the team leader is
>> pretty sure the escaping is correct.
>>
>> Unfortunately, the code is live, and they don't have the input that
>> causes the errors, so it's hard to make sure the character escaping is
>> not causing errors on some input. Right now, they are working on ways
>> to log the failing input.
>>
>>> Can we see the code?
>>
>> Not at this point. Hopefully we can get it pinned down better shortly,
>> but right now we're still bumping around in the dark. (Original
>> authors
>> not available etc.) The code they've looked at so far looks fairly
>> reasonable, which is why they asked me to check for other issues, such
>> as record locking and mutual exclusion.
>>
>> I'll probably post code and more questions after they get the logging
>> in place, but if anyone has more information on the deadlock issues,
>> I'd sure appreciate hearing about it.
>>
>>> --- Joel Rees wrote:
>>>> We have a web system (Perl) that is intermittantly giving this
>>>> error:
>>>>
>>>> DBD::mysql::st fetchrow_array() failed: fetch() without
>>>> execute() at ... webmin
>>>>
>>>> Sometimes it also gives this error
>>>>
>>>> DBD::mysql::st execute failed: You have an error in your
>>>> SQL syntax near ') GROUP BY
>>>>
>>>> and so forth.
>>>>
>>>> We've dumped the statement that is being executed and run it from
>>>> the
>>>> command line without errors, but since these errors are
>>>> intermittant,
>>>> that is not surprising.
>>>>
>>>> System information:
>>>> Solaris 2.8 -- sparc
>>>> perl 5.6.1
>>>> MySQL 3.23.45
>>>> Apache 1.3.27
>>>> Mod-ssl 2.8.11
>>>> OpenSSL 0.9.6i
>>>>
>>>> These errors started showing up after upgrading apache and
>>>> installing
>>>> mod-ssl, and after raising the log level on apache. We are not,
>>>> therefore sure if they were there before the upgrade.
>>>>
>>>> Does this ring a bell with anyone? I've checked the archives and
>>>> found
>>>> some mention of possible deadlock related problems,
>>>>
>>>>
>>>> http://marc.theaimsgroup.com/?l=msql-mysql-
>>>> modules&m=102026513407236&w=2
>>>>
>>>> and we're looking into that and other things we have thought of, but
>>>> we
>>>> would appreciate any leads we can get.
>>
>> --
>> Joel Rees
>> http://www.alpsgiken.co.jp
>>
>>
>> --
>> MySQL Perl Mailing List
>> For list archives: http://lists.mysql.com/perl
>> To unsubscribe:
>> http://lists.mysql.com/perl?unsub=gregmeckes@yahoo.com
>>
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> --
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe: http://lists.mysql.com/perl?unsub=Jay@lawrence.net
>
>
>
----
Infonium Inc.
Open Source Information Management
http://www.infonium.ca/


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org