Fix for LP#697622 Assertion `! is_set()' failed when preparing a HANDLER statement

mysql-test/suite/handler/interface.result:
  Test case
mysql-test/suite/handler/interface.test:
  Test case
sql/sql_prepare.cc:
  Fix for LP#697622 Assertion `! is_set()' failed when preparing a HANDLER statement
  Return TRUE if mysql_test_handler_read() fails.
This commit is contained in:
Michael Widenius 2011-01-12 15:55:06 +02:00
parent b32bed74e9
commit a4579c3ef3
3 changed files with 10 additions and 5 deletions

View File

@ -257,3 +257,5 @@ drop table t1;
USE information_schema;
HANDLER COLUMNS OPEN;
ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
PREPARE h_r FROM 'HANDLER t1 READ `PRIMARY` LAST';
ERROR 42S02: Unknown table 't1' in HANDLER

View File

@ -305,3 +305,9 @@ connection default;
USE information_schema;
--error ER_WRONG_USAGE
HANDLER COLUMNS OPEN;
#
# LP#697622 Assertion `! is_set()' failed when preparing a HANDLER statement
#
--error ER_UNKNOWN_TABLE
PREPARE h_r FROM 'HANDLER t1 READ `PRIMARY` LAST';

View File

@ -2004,11 +2004,8 @@ static bool check_prepared_statement(Prepared_statement *stmt)
case SQLCOM_HA_READ:
res= mysql_test_handler_read(stmt, tables);
{
/* Statement and field info has already been sent */
DBUG_RETURN(FALSE);
}
break;
/* Statement and field info has already been sent */
DBUG_RETURN(res == 1 ? TRUE : FALSE);
/*
Note that we don't need to have cases in this list if they are