Commit cc4f9565 authored by Matija Obreza's avatar Matija Obreza

mariadb: CREATE TABLE .. SELECT.. kills the server

parent f3d71771
......@@ -1896,19 +1896,20 @@ databaseChangeLog:
sql: >-
update accession_historic a inner join taxonomy2 t on t.id=a.taxonomyId2 set a.genus = t.genus;
- changeSet:
id: 1531221360983-37a
author: mobreza (generated)
comment: Move duplicates to accession_historic
changes:
- sql:
sql: >-
drop table if exists t_accessiondup;
create table t_accessiondup select min(id) minId from accession group by instituteId, genus, acceNumb having count(*) > 1;
insert into accession_historic (id, acceNumb, seqNo, acqDate, acqSrc, available, duplSiteStr, inSGSV, inTrust, instCode, mlsStat, origCty, sampStat, storageStr, orgCtyId, instituteId, taxonomyId2, taxGenus, historic, createdDate, lastModifiedDate, createdBy, lastModifiedBy, version, acceurl, cropName, cropId, doi, active, genus, ancest, donorCode, donorName, donorNumb, names, otherIds)
select id, acceNumb, seqNo, acqDate, acqSrc, available, duplSiteStr, inSGSV, inTrust, instCode, mlsStat, origCty, sampStat, storageStr, orgCtyId, instituteId, taxonomyId2, taxGenus, historic, createdDate, lastModifiedDate, createdBy, lastModifiedBy, version, acceurl, cropName, cropId, doi, active, genus, ancest, donorCode, donorName, donorNumb, names, otherIds from accession where id in (select minId from t_accessiondup);
delete from accession where id in (select minId from t_accessiondup);
drop table t_accessiondup;
# BUG: This kills mariadb when running as non-root in cluster mode
# - changeSet:
# id: 1531221360983-37a
# author: mobreza (generated)
# comment: Move duplicates to accession_historic
# changes:
# - sql:
# sql: >-
# drop table if exists t_accessiondup;
# create table t_accessiondup select min(id) minId from accession group by instituteId, genus, acceNumb having count(*) > 1;
# insert into accession_historic (id, acceNumb, seqNo, acqDate, acqSrc, available, duplSiteStr, inSGSV, inTrust, instCode, mlsStat, origCty, sampStat, storageStr, orgCtyId, instituteId, taxonomyId2, taxGenus, historic, createdDate, lastModifiedDate, createdBy, lastModifiedBy, version, acceurl, cropName, cropId, doi, active, genus, ancest, donorCode, donorName, donorNumb, names, otherIds)
# select id, acceNumb, seqNo, acqDate, acqSrc, available, duplSiteStr, inSGSV, inTrust, instCode, mlsStat, origCty, sampStat, storageStr, orgCtyId, instituteId, taxonomyId2, taxGenus, historic, createdDate, lastModifiedDate, createdBy, lastModifiedBy, version, acceurl, cropName, cropId, doi, active, genus, ancest, donorCode, donorName, donorNumb, names, otherIds from accession where id in (select minId from t_accessiondup);
# delete from accession where id in (select minId from t_accessiondup);
# drop table t_accessiondup;
- changeSet:
id: 1531221360983-37b1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment