Bug #2978 Sub Select Crashing MySql Service
Submitted: 26 Feb 2004 13:05 Modified: 26 Feb 2004 15:06
Reporter: Gary Holyoak Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S1 (Critical)
Version:4.1.1a-alpha-nt OS:Windows (W2K sp4)
Assigned to: CPU Architecture:Any

[26 Feb 2004 13:05] Gary Holyoak
Description:
When attempting to perform the following SQL statement, MySql service crashes causing the following DR. Watson error in the event log.

The application, , generated an application error The error occurred on 02/26/2004 @ 20:19:54.888 The exception generated was c0000005 at address 0000000B (<nosymbols>)

Nothing reported in mysql.err file;

How to repeat:
CREATE TABLE `venue_equipment` (
  `VenueId` int(11) NOT NULL default '0',
  `Id` int(11) NOT NULL default '0',
  `Name` varchar(50) NOT NULL default '',
  `Description` varchar(75) NOT NULL default '',
  `Cost` float(4,2) NOT NULL default '0.00',
  `Basis` enum('R','P','B') NOT NULL default 'R',
  `Disabled` tinyint(1) NOT NULL default '0',
  `InstanceTimeStamp` bigint(20) NOT NULL default '0',
  `InstanceUser` int(11) NOT NULL default '0',
  PRIMARY KEY  (`Id`,`InstanceTimeStamp`),
  UNIQUE KEY `VenueId` (`VenueId`,`Name`,`Id`,`InstanceTimeStamp`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

#
# Dumping data for table `venue_equipment`
#

INSERT INTO `venue_equipment` VALUES (16398, 16408, 'Viideo', 'Video Player', '10.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16398, 16409, 'Staging', 'Full Presentation Staging', '500.00', 'B', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16018, 16416, 'OHP &amp; Screen', 'Overhead Projector &amp; Screen&#039;s', '30.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16018, 16417, 'TV', 'Television', '20.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16018, 16418, 'Slide Projector', 'Slide Projector', '25.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16018, 16419, 'Fax Machine', 'Dedicated Fax Machine', '30.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16018, 16420, 'Conference Phone', 'Conference Phone', '82.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16018, 16421, 'Flip Chart', 'Flip Chart', '15.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16018, 16422, 'Video', 'Video', '20.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16018, 16423, 'PC Projector', 'PC Projector', '250.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (16018, 16424, 'Printer', 'Printer', '50.00', 'R', 0, 0, 0);
INSERT INTO `venue_equipment` VALUES (15360, 16880, 'In House AV', 'Video Role Play, PC Data and Video Projection System', '0.00', 'B', 0, 0, 0);
    
select t1.* from venue_equipment as t1 where t1.VenueId=16018 and t1.Disabled <> 1 and t1.InstanceTimeStamp = ( select t2.InstanceTimeStamp from venue_equipment as t2 where t1.Id = t2.Id and t2.InstanceTimeStamp <=1077823109 order by t2.InstanceTimeStamp Desc Limit 1)

Suggested fix:
Sorry, no idea !
[26 Feb 2004 13:16] MySQL Verification Team
Thank you for the bug report I was able to repeat.
[26 Feb 2004 15:06] MySQL Verification Team
Tested against a server built from the last 4.1 BK tree and the issue was
already fixed:

mysql> select t1.* from venue_equipment as t1 where t1.VenueId=16018 and t1.Disabled <>
    -> 1 and t1.InstanceTimeStamp = ( select t2.InstanceTimeStamp from venue_equipment
    -> as t2 where t1.Id = t2.Id and t2.InstanceTimeStamp <=1077823109 order by
    -> t2.InstanceTimeStamp Desc Limit 1)\G

*************************** 1. row ***************************
          VenueId: 16018
               Id: 16420
             Name: Conference Phone
      Description: Conference Phone
             Cost: 82.00
            Basis: R
         Disabled: 0
InstanceTimeStamp: 0
     InstanceUser: 0
*************************** 2. row ***************************
          VenueId: 16018
               Id: 16419
             Name: Fax Machine
      Description: Dedicated
Fax Machine
             Cost: 30.00
            Basis: R
         Disabled: 0
InstanceTimeStamp: 0
     InstanceUser: 0
*************************** 3. row ***************************
          VenueId: 16018
               Id: 16421
             Name: Flip Chart
      Description: Flip Chart
             Cost: 15.00
            Basis: R
         Disabled: 0
InstanceTimeStamp: 0
     InstanceUser: 0
*************************** 4. row ***************************
          VenueId: 16018
               Id: 16416
             Name: OHP &amp; Screen
      Description: Overhead Projector &amp; Screen&#039;s
             Cost: 30.00
            Basis: R
         Disabled: 0
InstanceTimeStamp: 0
     InstanceUser: 0
*************************** 5. row ***************************
          VenueId: 16018
               Id: 16423
             Name: PC Projector
      Description: PC
Projector
             Cost: 250.00
            Basis: R
         Disabled: 0
InstanceTimeStamp: 0
     InstanceUser: 0
*************************** 6. row ***************************
          VenueId: 16018
               Id: 16424
             Name: Printer
      Description: Printer
             Cost: 50.00
            Basis: R
         Disabled: 0
InstanceTimeStamp: 0
     InstanceUser: 0
*************************** 7. row ***************************
          VenueId: 16018
               Id: 16418
             Name: Slide Projector
      Description: Slide
Projector
             Cost: 25.00
            Basis: R
         Disabled: 0
InstanceTimeStamp: 0
     InstanceUser: 0
*************************** 8. row ***************************
          VenueId: 16018
               Id: 16417
             Name: TV
      Description: Television
             Cost: 20.00
            Basis: R
         Disabled: 0
InstanceTimeStamp: 0
     InstanceUser: 0
*************************** 9. row ***************************
          VenueId: 16018
               Id: 16422
             Name: Video
      Description: Video
             Cost: 20.00
            Basis: R
         Disabled: 0
InstanceTimeStamp: 0
     InstanceUser: 0
9 rows in set (0.07 sec)

mysql> select version();
+-----------------------+
| version()             |
+-----------------------+
| 4.1.2-alpha-max-debug |
+-----------------------+
1 row in set (0.01 sec)

mysql>

Thank you for the bug report.
[27 Feb 2004 1:18] Gary Holyoak
Thanks Miguel,

Where can I get the last 4.1 BK tree as I need to run this code

Also any ideas when 4.1 will be released