Re: [Sqlrelay-discussion] Complex Queries Cause Mysql Connection to segfault
Brought to you by:
mused
|
From: David M. <dav...@fi...> - 2007-03-22 15:12:56
|
I wonder if this is a mysql bug?
If the line:
if ((queryresult=mysql_stmt_execute(stmt))) {
is where it's crashing, the only possibility is that mysql_stmt_execute
is crashing. Aside from a bug insidy mysql_stmt_execute, the only thing
that could cause a crash is if "stmt" is messed up somehow.
I'll take a look at the code that initializes stmt. It's possible that
I'm doing something wrong there.
Dave
dav...@fi...
On Mon, 2007-03-19 at 18:11 -0500, Chris Coyle wrote:
> I've run into a some situations where complex queries in a certain
> sequence cause the connection handler to segfault which results in a
> cursor error from the listener.
>
> Mysql Version: mysql-5.0.x-max
> SQLRelay Version: 0.38 - 0.39 (from cvs) (++ autoreconnect patch)
> Pertinent mysql settings: "wait_timeout = 10"
>
> sql to generate table schema from mysqldump (sans comments):
> DROP TABLE IF EXISTS `sqlrelay`;
> CREATE TABLE `sqlrelay` (
> `var1` varchar(25) default NULL,
> `var2` varchar(25) default NULL,
> `var3` varchar(25) default NULL,
> `var4` varchar(25) default NULL
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
> LOCK TABLES `sqlrelay` WRITE;
> INSERT INTO `sqlrelay` VALUES
> ('one','two','three','four'),('one','two','three','four'),('one','two','three','four');
> UNLOCK TABLES;
>
> testsql.sql
> ----
> SELECT var1, var2, var3, COALESCE(var4,'whatever') as var4 FROM
> test_sqlrelay.sqlrelay ORDER BY var1 ASC LIMIT 0,70;
> select count(*) as numResults from test_sqlrelay.sqlrelay limit 10;
>
> testsql.sh
> ----
> #!/bin/sh
> for I in `seq 10`; do
> /usr/local/sqlrelay/bin/sqlrsh -id <mysql> testsql.sql
> echo -e "[ $I ]\n"
> sleep 10
> done
>
> Running this script with that sql on a freshly started sqlrelay
> instance (it seems to vary otherwise) will result in a segfault and
> cursor error on the second pass.
>
> In gdb I was able to track it down to:
> -- mysqlconnection.C:437 --
> if ((queryresult=mysql_stmt_execute(stmt))) {
>
> Now here's where it gets weird. If you do reverse the statements in
> testsql.sql (do the select count() first) then this error does NOT
> occur.
>
> There are other examples where I've found this behavior, but they're
> far more sporadic.
>
> I'll continue to try to track this further on my end, but if you need
> any further details, please let me know.
>
> Thanks for your time,
>
> - Chris
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Sqlrelay-discussion mailing list
> Sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
>
|