仅向 mysql 插入查询时“超出锁定等待超时”

仅向 mysql 插入查询时“超出锁定等待超时”

我尝试简单的插入-该表中没有其他插入,并且我只看到“LOCK WAIT”事务。

trx 状态

insert into `events` (`flow_id`, `status_id`, `event_id`,
     `event_type`, `updated_at`, `created_at`)
  values (38, 29, 13246969, 'App\\Models\\Hehe',
     '2021-04-06 12:29:53', '2021-04-06 12:29:53')

CREATE TABLE `events` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `event_id` int(10) unsigned DEFAULT NULL,
  `flow_id` int(10) unsigned DEFAULT NULL,
  `parameters` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `time` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `event_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status_id` int(10) unsigned DEFAULT NULL,
  `place_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `events_flow_id_foreign` (`flow_id`),
  KEY `events_position_id_foreign` (`event_id`),
  KEY `events_event_type_event_id_index` (`event_type`,`event_id`),
  KEY `events_status_id_foreign` (`status_id`),
  KEY `events_place_id_foreign` (`place_id`),
  KEY `events_created_at_index` (`created_at`),
  KEY `events_deleted_at_index` (`deleted_at`),
  KEY `events_time_index` (`time`),
  KEY `events_event_type_flow_id_created_at_index` (`event_type`,`flow_id`,`created_at`),
  KEY `events_flow_status_deleted_index` (`flow_id`,`status_id`,`deleted_at`),
  KEY `events_id_status_type_del_ids` (`event_id`,`status_id`,`event_type`,`deleted_at`),
  KEY `events_type_status_idx` (`event_type`,`status_id`),
  KEY `events_status_deleted_type_idx` (`status_id`,`deleted_at`,`event_type`),
  KEY `events_status_type_created` (`status_id`,`event_type`,`created_at`),
  KEY `events_e_id_e_type_e_del_idx` (`event_id`,`event_type`,`deleted_at`),
  CONSTRAINT `events_flow_id_foreign` FOREIGN KEY (`flow_id`) REFERENCES `flows` (`id`),
  CONSTRAINT `events_place_id_foreign` FOREIGN KEY (`place_id`) REFERENCES `places` (`id`),
  CONSTRAINT `events_status_id_foreign` FOREIGN KEY (`status_id`) REFERENCES `statuses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37170294
     DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

相关内容