Bug #19161 View Causes crashes
Submitted: 18 Apr 2006 11:03 Modified: 18 Apr 2006 11:25
Reporter: David Hammink Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.19 OS:Linux (Fedora 5 64 bit)
Assigned to: CPU Architecture:Any

[18 Apr 2006 11:03] David Hammink
Description:
SELECT * FROM vCurServiceAndNumber causes a crash

060418 12:54:27060418 12:54:27 [ERROR] The calling thread is holding the adaptive search, latch though calling innobase_query_caching_of_table_permitted.
TRANSACTION 0 2950196, ACTIVE 0 sec, process no 6830, OS thread id 1159264592, thread declared inside InnoDB 364
mysql tables in use 2, locked 0
, holds adaptive hash latch
MySQL thread id 63, query id 17904 localhost root Sending data
SELECT * FROM v_CurServiceAndNumber
060418 12:54:27InnoDB: Assertion failure in thread 1159264592 in file ha_innodb.cc line 985
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html
InnoDB: about forcing recovery.
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=1073741824
read_buffer_size=2093056
max_used_connections=11
max_connections=75
threads_connected=4
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 3659475 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Number of processes running now: 0
060418 12:54:27  mysqld restarted
060418 12:54:28  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.

Tables involved

select `S`.`ServiceID` AS `ServiceID`,`SE`.`CountryID` AS `CountryID`,`SE`.`ServiceTypeID` AS `ServiceTypeID`,`SE`.`RedirectID` AS `RedirectID`,`SE`.`PreviousID` AS `PreviousID`,`SE`.`Created` AS `Created`,`SE`.`Active` AS `Active`,`SN`.`PrefixID` AS `PrefixID`,`SN`.`MachineID` AS `MachineID`,`SN`.`DDI` AS `DDI`,`SN`.`PremiumRateNumber` AS `PremiumRateNumber`,`SN`.`GeographicNumber` AS `GeographicNumber`,`SN`.`TerminationID` AS `TerminationID`,`SN`.`SecurityCode` AS `SecurityCode`,`SN`.`LanguageID` AS `LanguageID`,`SE`.`ServiceStatusID` AS `ServiceStatusID`,`SE`.`ServiceStatusFixed` AS `ServiceStatusFixed`,`SN`.`PremiumRateID` AS `PremiumRateID` 
from ((`TP5v003`.`vCurrentDDI` `S` 
left join `TP5v003`.`tblService` `SE` on((`S`.`ServiceID` = `SE`.`ServiceID`))) 
left join `TP5v003`.`tblServiceNumber` `SN` on((`S`.`ServiceID` = `SN`.`ServiceID`)))

How to repeat:
default-strorage-engine = MyISAM

Some Tables are Myisam and some InnoDb on this view
View Algorithm=TEMPTABLE

Suggested fix:
I have solved it in the mean time.
default-storage-engine=innodb should be set.
It seems to me that if I have MyIsam as default engine in a hybrid surrounding we get these errors
[18 Apr 2006 11:22] David Hammink
Rejoiced to early

Again a Crash. I had alterred one table (vCurrentDDI) from MyISAM to InnoDB. The view crashed.
I dropped the view and created it again. And it works
[18 Apr 2006 11:25] Heikki Tuuri
Duplicate of http://bugs.mysql.com/bug.php?id=15758

Fixed in 5.0.21.
[18 Apr 2006 12:04] Heikki Tuuri
A workaround is not to use the query cache.