CREATE TABLE `fspgroup` (
  `variant_id` int(11) NOT NULL,
  `instr2` int(11) unsigned NOT NULL,
  `data_physical_address` bigint(10) unsigned NOT NULL,
  `bit_pos` tinyint(3) unsigned DEFAULT NULL,
  `fspmethod_id` int(11) NOT NULL,
  `pilot_id` int(11) NOT NULL,
  `weight` int(11) unsigned DEFAULT NULL,
  PRIMARY KEY (`pilot_id`),
  KEY `joinresults` (`pilot_id`,`fspmethod_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `fspmethod` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `method` varchar(100) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `method` (`method`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `fsppilot` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `known_outcome` tinyint(4) NOT NULL,
  `variant_id` int(11) NOT NULL,
  `instr2` int(10) unsigned NOT NULL,
  `injection_instr` int(10) unsigned NOT NULL,
  `injection_instr_absolute` bigint(10) unsigned DEFAULT NULL,
  `data_physical_address` bigint(10) unsigned NOT NULL,
  `bit_pos` tinyint(3) unsigned DEFAULT NULL,
  `data_width` int(10) unsigned NOT NULL,
  `fspmethod_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fspmethod_id` (`fspmethod_id`,`variant_id`,`data_physical_address`,`instr2`)
) ENGINE=MyISAM AUTO_INCREMENT=6327 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `objdump` (
  `variant_id` int(11) NOT NULL,
  `instr_address` bigint(11) unsigned NOT NULL,
  `opcode` varchar(32) NOT NULL,
  `disassemble` varchar(64) DEFAULT NULL,
  `comment` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`variant_id`,`instr_address`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `result_GenericExperimentMessage` (
  `pilot_id` int(10) unsigned NOT NULL,
  `inject_bursts` tinyint(4) NOT NULL,
  `inject_single_bit` tinyint(4) NOT NULL,
  `register_injection_mode` enum('OFF','AUTO','FORCE','RANDOMJUMP') DEFAULT NULL,
  `data_physical_address` bigint(20) unsigned NOT NULL,
  `bitoffset` int(10) unsigned NOT NULL,
  `original_value` int(10) unsigned NOT NULL,
  `injection_width` int(10) unsigned NOT NULL,
  `resulttype` enum('OK_MARKER','FAIL_MARKER','DETECTED_MARKER','GROUP1_MARKER','GROUP2_MARKER','GROUP3_MARKER','GROUP4_MARKER','TIMEOUT','TRAP','WRITE_TEXTSEGMENT','ACCESS_OUTERSPACE','SDC','UNKNOWN') NOT NULL,
  `crash_time` bigint(20) unsigned NOT NULL,
  `details` bigint(20) unsigned DEFAULT NULL,
  PRIMARY KEY (`pilot_id`,`data_physical_address`,`bitoffset`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `trace` (
  `variant_id` int(11) NOT NULL,
  `instr1` int(10) unsigned NOT NULL,
  `instr1_absolute` bigint(10) unsigned DEFAULT NULL,
  `instr2` int(10) unsigned NOT NULL,
  `instr2_absolute` bigint(10) unsigned DEFAULT NULL,
  `time1` bigint(10) unsigned NOT NULL,
  `time2` bigint(10) unsigned NOT NULL,
  `data_linear_address` bigint(10) unsigned NOT NULL,
  `data_physical_address` bigint(10) unsigned NOT NULL,
  `width` tinyint(3) unsigned NOT NULL,
  `accesstype` enum('R','W') NOT NULL,
  `cr3` int(10) unsigned NOT NULL,
  PRIMARY KEY (`variant_id`,`data_physical_address`,`instr2`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `variant` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `variant` varchar(100) NOT NULL,
  `benchmark` varchar(100) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `variant` (`variant`,`benchmark`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
