Deadlock in SQL - sql

I have multiple python scripts that run in parallel and insert/update 2 tables.
Table 1: Nmap_Scans_Hosts
Table 2: Nmap_Scans_Ports
Both these tables have no PK, only a FK referencing a 3rd table Nmap_Scans.
When the scripts run, I get a deadlock on the tables. The scripts use pymssql and cursors for inserting/updating data.
The statements the scripts run are the following:
update lan.nmap_scans set latest = 0 where latest = 1 and target = '{target}'
INSERT INTO nvlanteam.LAN.Nmap_Scans
UPDATE nvlanteam.LAN.Nmap_Scans_Hosts SET Latest = 0 WHERE Host_Address = '{host_address}' and Tags = '{args.tags}'
INSERT INTO nvlanteam.LAN.Nmap_Scans_Hosts
UPDATE nvlanteam.LAN.Nmap_Scans_Ports SET Latest = 0 WHERE Host_Address = '{host_address}' AND Port is NULL
INSERT INTO nvlanteam.LAN.Nmap_Scans_Ports
update nvlanteam.lan.Nmap_Scans_Ports set Latest = 0 where Host_Address = '{host_address}' and Port = '{port_number}'
INSERT INTO nvlanteam.LAN.Nmap_Scans_Ports
The first 2 statements are only run once per script, while the other 6 are run in a loop for each ip address.
I tried setting pymssql's autocommit = True option but deadlocks still occur. Snapshot isolation is also enabled at database level.
Is there anything inherently wrong with my design? Or is there an option that I could enable that would prevent these deadlocks from occuring? Also, I know SQL Server kills one of the 2 deadlocked processes, but in my case, deadlocks are not resolved by SQL Server until I kill one of the Python processes.
Edit:
Included the DDL for the tables used.
CREATE TABLE nvlanteam.LAN.Nmap_Scans (
Target varchar(MAX) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Hosts_Total int NULL,
Hosts_Up int NULL,
Scan_ID int IDENTITY(0,1) NOT NULL,
Scan_Server varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Scan_Command varchar(MAX) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Scan_Start datetime NULL,
Scan_Finish datetime NULL,
Elapsed int NULL,
Latest bit NULL,
Tags varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT Nmap_Scans_PK PRIMARY KEY (Scan_ID)
);
CREATE TABLE nvlanteam.LAN.Nmap_Scans_Hosts (
Scan_ID int NOT NULL,
Host_Address varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Host_Name varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Region varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Country varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Location varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Division varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Subnet_Name varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CIDR varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Reason varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
RTT float NULL,
Latest bit NULL,
Tags varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
);
-- nvlanteam.LAN.Nmap_Scans_Hosts foreign keys
ALTER TABLE nvlanteam.LAN.Nmap_Scans_Hosts ADD CONSTRAINT Nmap_Scans_Hosts_FK FOREIGN KEY (Scan_ID) REFERENCES nvlanteam.LAN.Nmap_Scans(Scan_ID) ON DELETE CASCADE ON UPDATE CASCADE;
CREATE TABLE nvlanteam.LAN.Nmap_Scans_Ports (
Scan_ID int NULL,
Host_Address varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Port int NULL,
Protocol varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
State varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Reason varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Reason_TTL int NULL,
Service_Name varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Service_Product varchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Service_Version varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Service_Extra_Info varchar(1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Device_Type varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Latest bit NULL
);
-- nvlanteam.LAN.Nmap_Scans_Ports foreign keys
ALTER TABLE nvlanteam.LAN.Nmap_Scans_Ports ADD CONSTRAINT Nmap_Scans_Ports_FK FOREIGN KEY (Scan_ID) REFERENCES nvlanteam.LAN.Nmap_Scans(Scan_ID) ON DELETE CASCADE ON UPDATE CASCADE;

Related

Importing .sql file into SQL Server 2012

I have database with .sql, I want to import that .sql file into SQL Server 2012 using Management Studio.
When I tried to import the data, I'm getting an error:
Msg 156, Level 15, State 1, Line 76
Incorrect syntax near the keyword 'NOT'.
[![enter image description here][1]][1]
CREATE TABLE ct_bookings(
id int NOT NULL,
order_id bigint NOT NULL,
client_id bigint NOT NULL,
order_date date NOT NULL,
booking_date_time datetime NOT NULL,
service_id int NOT NULL,
method_id int NOT NULL,
method_unit_id int NOT NULL,
method_unit_qty int NOT NULL,
method_unit_qty_rate double NOT NULL,
booking_status varchar(10) not null ('A','C','R','CC','CS','CO','MN','RS') NOT NULL COMMENT 'A=active, C=confirm, R=Reject, CC=Cancel by Client, CS=Cancel by service provider,CO=Completed,MN=MARK AS NOSHOW',
`reject_reason` varchar(200) NOT NULL,
`reminder_status` enum('0','1') NOT NULL DEFAULT '0' COMMENT '0=Email Not Sent,1=Email Sent',
`lastmodify` datetime NOT NULL,
`read_status` enum('R','U') NOT NULL DEFAULT 'U'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
How can I solve this issue?
Please help me out. Thanks in advance.
in MySQL:-
CREATE TABLE ct_addon_service_rate(
id int(11) NOT NULL,
addon_service_id int(11) NOT NULL,
unit varchar(20) NOT NULL,
rules VARCHAR(10) NOT NULL CHECK (rules IN('E', 'G')),
rate DOUBLE NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Equals in SQL Server:-
Create TABLE ct_addon_service_rate (
id int NOT NULL,
addon_service_id int NOT NULL,
unit varchar(20) NOT NULL,
rules char(1) not null,
rate FLOAT(25) NOT NULL,
CHECK (rules in ('E', 'G'))
)
Update:-
In MySQL:-
CREATE TABLE ct_bookings(
id int NOT NULL,
order_id bigint NOT NULL,
client_id bigint NOT NULL,
order_date date NOT NULL,
booking_date_time datetime NOT NULL,
service_id int NOT NULL,
method_id int NOT NULL,
method_unit_id int NOT NULL,
method_unit_qty int NOT NULL,
method_unit_qty_rate double NOT NULL,
booking_status varchar(10) not null ('A','C','R','CC','CS','CO','MN','RS') NOT NULL COMMENT 'A=active, C=confirm, R=Reject, CC=Cancel by Client, CS=Cancel by service provider,CO=Completed,MN=MARK AS NOSHOW',
`reject_reason` varchar(200) NOT NULL,
`reminder_status` enum('0','1') NOT NULL DEFAULT '0' COMMENT '0=Email Not Sent,1=Email Sent',
`lastmodify` datetime NOT NULL,
`read_status` enum('R','U') NOT NULL DEFAULT 'U'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Equals in SQL Server:-
CREATE TABLE ct_bookings(
id int NOT NULL,
order_id bigint NOT NULL,
client_id bigint NOT NULL,
order_date date NOT NULL,
booking_date_time datetime NOT NULL,
service_id int NOT NULL,
method_id int NOT NULL,
method_unit_id int NOT NULL,
method_unit_qty int NOT NULL,
method_unit_qty_rate float(25) NOT NULL,
booking_status varchar(10) not null check (booking_status in ('A','C','R','CC','CS','CO','MN','RS')),
/*COMMENT 'A=active, C=confirm, R=Reject, CC=Cancel by Client, CS=Cancel by service provider,CO=Completed,MN=MARK AS NOSHOW', */
reject_reason varchar(200) NOT NULL,
reminder_status char(1)NOT NULL check (reminder_status in ('0','1')) DEFAULT '0', /*COMMENT '0=Email Not Sent,1=Email Sent', */
lastmodify datetime NOT NULL,
read_status char(1) NOT NULL check (read_status in ('R','U')) DEFAULT 'U'
)
Update 2:-
in MySQL:-
CREATE TABLE ct_email_templates (
id int NOT NULL,
email_subject varchar(200) COLLATE Latin1_General_CI_AS NOT NULL,
email_message text COLLATE Latin1_General_CI_AS NOT NULL,
default_message text COLLATE Latin1_General_CI_AS NOT NULL,
email_template_status varchar(10) NOT NULL check(email_template_status in('E','D')) COLLATE Latin1_General_CI_AS,
email_template_type varchar(10) check(email_template_type IN('A','C','R','CC','RS','RM')) COLLATE Latin1_General_CI_AS NOT NULL COMMENT 'A=active, C=confirm, R=Reject, CC=Cancel by Client, RS=Reschedule, RM=Reminder',
user_type` enum('A','C') COLLATE utf8_unicode_ci NOT NULL COMMENT 'A=Admin,C=client'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Equals in SQL Server:-
CREATE TABLE ct_email_templates (
id int NOT NULL,
email_subject varchar(200) COLLATE Latin1_General_CI_AS NOT NULL,
email_message text COLLATE Latin1_General_CI_AS NOT NULL,
default_message text COLLATE Latin1_General_CI_AS NOT NULL,
email_template_status varchar(10) COLLATE Latin1_General_CI_AS NOT NULL check(email_template_status in('E','D')) ,
email_template_type varchar(10) COLLATE Latin1_General_CI_AS check(email_template_type IN('A','C','R','CC','RS','RM')) NOT NULL, /*COMMENT 'A=active, C=confirm, R=Reject, CC=Cancel by Client, RS=Reschedule, RM=Reminder',
user_type` enum('A','C') COLLATE utf8_unicode_ci NOT NULL COMMENT 'A=Admin,C=client' */
)

SQL Server creates tables in wrong database

I want to create a new database and fill it up with some tables. It creates a new database but the tables appear in another database.
The ##DbName contains the name of the database the user gave in, the fact that it is creating a database says the DbName is correct. When executed the database is created but empty, all tables are inserted in another database.
I believe the error lies in the USE [##DbName]
What am I doing wrong?
My SQL statements:
CREATE DATABASE [##DbName]
ON PRIMARY
( NAME = [##DbName],
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\##DbName.mdf',
SIZE = 5 MB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1 MB )
LOG ON
( NAME = [##DbName_log],
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\##DbName_log.ldf',
SIZE = 1 MB,
MAXSIZE = 2097152 MB,
FILEGROWTH = 10 % )
COLLATE Latin1_General_CI_AS
GO
CREATE LOGIN [##DbLogin] WITH PASSWORD=N'##DbPassword', DEFAULT_DATABASE=[##DbName], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [##DbName]
GO
CREATE TABLE [dbo].[Customers]
(
[ID] int IDENTITY(1, 1) NOT NULL,
[CustomerName] varchar(50) COLLATE Latin1_General_CI_AS NOT NULL,
[Address] varchar(50) COLLATE Latin1_General_CI_AS NOT NULL,
[Picture] image NOT NULL,
[Balance] decimal(18, 2) NOT NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[Employee]
(
[ID] int IDENTITY(1, 1) NOT NULL,
[EmployeeName] varchar(50) COLLATE Latin1_General_CI_AS NOT NULL,
[Address] varchar(50) COLLATE Latin1_General_CI_AS NOT NULL,
[Email] varchar(50) COLLATE Latin1_General_CI_AS NOT NULL,
[Phone] varchar(20) COLLATE Latin1_General_CI_AS NOT NULL
)
ON [PRIMARY]
GO
CREATE TABLE [dbo].[Registers]
(
[ID] int IDENTITY(1, 1) NOT NULL,
[RegisterName] varchar(50) COLLATE Latin1_General_CI_AS NOT NULL,
[Device] varchar(50) COLLATE Latin1_General_CI_AS NOT NULL
)
ON [PRIMARY]
GO
CREATE TABLE [dbo].[Errorlog]
(
[RegisterID] int NOT NULL,
[Timestamp] varchar(50) COLLATE Latin1_General_CI_AS NOT NULL,
[Message] varchar(255) COLLATE Latin1_General_CI_AS NOT NULL,
[StackTrace] ntext COLLATE Latin1_General_CI_AS NOT NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[Products]
(
[ID] int IDENTITY(1, 1) NOT NULL,
[ProductName] varchar(50) COLLATE Latin1_General_CI_AS NOT NULL,
[Price] decimal(18, 2) NULL
)
ON [PRIMARY]
GO
CREATE TABLE [dbo].[Register_Employee]
(
[RegisterID] int NOT NULL,
[EmployeeID] int NOT NULL,
[From] varchar(20) COLLATE Latin1_General_CI_AS NOT NULL,
[Until] varchar(20) COLLATE Latin1_General_CI_AS NOT NULL
)
ON [PRIMARY]
GO
CREATE TABLE [dbo].[Sales]
(
[ID] int NOT NULL,
[Timestamp] timestamp NOT NULL,
[CustomerID] int NOT NULL,
[RegisterID] int NOT NULL,
[ProductID] int NOT NULL,
[Amount] int NOT NULL,
[TotalPrice] decimal(18, 2) NOT NULL
)
ON [PRIMARY]
GO

trigger in sql problem

this is my trigger
ALTER trigger [dbo].[addpay]
on [dbo].[pays]
after insert
as
declare #idtutor int
set #idtutor =(select idtutor from inserted)
begin
insert into pays (idtutor,nopay,datex,paythismonth)values (#idtutor,600,GETDATE(),'no')
end
but it doesn't add a new pays after inserted a tutor... i dont watch any bug, mistake, why doesn't it work
my tables
create table Tutor
(
[IdTutor] int primary key identity not null,
[Nombre] varchar(150) not null,
[ApellidoPaterno] varchar (150) not null,
[ApellidoMaterno] varchar (150) not null,
[EstadoCivil] varchar (10) not null,
[FechaNacimiento] varchar(50),
[Municipio] varchar(150) not null,
[Estado] varchar(150) not null,
[Direccion] varchar(250) not null,
[Sexo] varchar (9) not null,
[TelefonoTutor] char(10) not null,
[CelularTutor] char(15) not null,
[EmailTutor] char(50) not null,
[Empresa] varchar(150) not null,
[Ocupacion] varchar(250) not null,
[DireccionEmpresa] varchar (250) not null,
[TelefonoEmpresa] char(10) not null,
[CelularEmpresa] char(15) not null,
[EmailEmpresa] varchar(50) not null
)
create table pays
(
idpay int primary key not null identity,
idtutor int not null,
nopay float,
datex datetime,
paythismonth varchar(2)
)
You need to create the trigger on the table for where you want it to fire when a new record is inserted (Tutor in this case).
Additionally you need to remember that inserts/update statements can affect multiple rows so assigning to scalar variables won't work. The trigger you need is
CREATE TRIGGER YourTrigger
ON [dbo].[Tutor]
AFTER INSERT
AS
BEGIN
SET NOCOUNT ON
INSERT INTO pays
(idtutor,
nopay,
datex,
paythismonth)
SELECT idtutor,
600,
GETDATE(),
'no'
FROM inserted
END
You will also need to drop the other trigger in your question with DROP TRIGGER [dbo].[addpay]

Optimizing MySQL queries / database structure

I have in my MySQL database these two tables:
CREATE TABLE IF NOT EXISTS `articles` (
`id` bigint(20) NOT NULL,
`url` varchar(255) collate utf8_bin NOT NULL,
`img` varchar(255) collate utf8_bin NOT NULL,
`name` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
`url_key` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
`type_code` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
`likes_count` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE IF NOT EXISTS `articles_types` (
`id` int(11) NOT NULL auto_increment,
`code` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
`url_key` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
`name` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`code`),
KEY `type` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
And I'm trying to run this query:
SELECT a.* FROM `articles` a INNER JOIN articles_types at ON at.`code`=a.type ORDER BY p.likes_count DESC LIMIT 1
Which returns 1 row, in 1sec.
The table articles consists of aproximately over 70k rows, articles_types only about 70 rows.
Is there any chance to optimize the structure (maybe engine?) of that tables, or optimize the query itself to make it faster?
You should examine the output of EXPLAIN on your query
It's likely the order by that gets you, so create an index on articles.likes_count

mass replace of values in more tables by a highest value

I have a table with OWN_ID and OWN_Email -
own_id | own_email
-----------------------------------------------
3ace7cf80edd | email#example.com
3acf6af33ff7 | email#example.com
3acda2524e00 | email#example.com
3ad75583c9a7 | spam#example.com
3ad74b018999 | spam#example.com
etc.
the problem is that it should contain only a single ID per Email, also I need to replace all OWN_ID values in another table by highest OWN_ID value of the OWN_Email
sql create:
CREATE TABLE `blahblah.`eventowner` (
`OWN_ID` varchar(12) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
`OWN_Email` varchar(120) COLLATE utf8_czech_ci DEFAULT NULL,
`OwnDateFormat` varchar(16) COLLATE utf8_czech_ci DEFAULT NULL,
`OwnWeekStart` int(11) DEFAULT NULL,
`OwnDayStart` int(11) DEFAULT NULL,
`OwnDayEnd` int(11) DEFAULT NULL,
PRIMARY KEY (`OWN_ID`),
KEY `OwnerEmailIndex` (`OWN_Email`),
KEY `OwnerIndex` (`OWN_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci
CREATE TABLE `blahblah`.`event` (
`EVN_ID` varchar(128) COLLATE utf8_czech_ci DEFAULT NULL,
`EVNGRP_ID` varchar(12) COLLATE utf8_czech_ci DEFAULT NULL,
`EVNOWN_ID` varchar(12) COLLATE utf8_czech_ci DEFAULT NULL,
`EVNRCR_ID` varchar(12) COLLATE utf8_czech_ci DEFAULT NULL,
`Evn_EditCounter` int(11) DEFAULT NULL,
`Evn_Created` int(11) DEFAULT NULL,
`Evn_Modified` int(11) DEFAULT NULL,
`EvnFolder` varchar(128) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnTitle` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnNote` text COLLATE utf8_czech_ci,
`EvnLocation` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnPriority` int(11) DEFAULT NULL,
`EvnComplete` int(11) DEFAULT NULL,
`EvnColor` varchar(2) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnClass` varchar(1) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnShareType` varchar(1) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnTimeFormat` varchar(1) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnType` varchar(127) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnStatus` varchar(1) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnOrganizer` varchar(80) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnContact` varchar(80) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnURL` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnStartDate` int(11) DEFAULT NULL,
`EvnStartTime` int(11) DEFAULT NULL,
`EvnEndDate` int(11) DEFAULT NULL,
`EvnEndTime` int(11) DEFAULT NULL,
`EvnRID` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnUID` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
`EvnExpire` int(11) DEFAULT NULL,
`EvnSequence` int(11) DEFAULT NULL,
`EvnFlags` int(11) DEFAULT NULL,
KEY `EventGroupClassIndex` (`EVNGRP_ID`,`EvnClass`),
KEY `EventGroupFolderIndex` (`EVN_ID`,`EVNGRP_ID`,`EvnFolder`),
KEY `EventRIDIndex` (`EvnRID`),
KEY `EventUIDIndex` (`EvnUID`),
KEY `EventGroupRCRIndex` (`EVN_ID`,`EVNGRP_ID`,`EVNRCR_ID`),
KEY `EventExpireIndex` (`EvnExpire`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci
delete t1 from table t1, table t2
where t1.own_email= t2.own_email
and t1.own_id < t2.own_id
update othertable, table
set othertable.own_id= table.own_id
where othertable.own_email= table.own_email;
Could accomplish this fairly simple using a transaction that nukes the whole table.
BEGIN;
SELECT own_email, max(own_Id) INTO temptable FROM table GROUP BY own_email
TRUNCATE table;
INSERT INTO table SELECT * FROM temptable;
DELETE temptable;
COMMIT;
But, that Isn't the best way -- you can also do it by deleting just the right rows.
DELETE FROM table AS d WHERE EXISTS (
SELECT own_id FROM table AS t
WHERE NOT EXISTS (
SELECT max(own_id) FROM table AS i
GROUP BY own_email
WHERE t.own_email = i.own_email
)
AND d.own_id = t.own_id
AND d.own_email = t.own_email
);
Here we delete all own_ids, that aren't the max(own_id) for an E-mail.
This can be accomplished with NOT IN (understanding the caveat on nulls), or an anti-join on the table being deleted from