-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Image upload error handling refinements.
- Loading branch information
Showing
6 changed files
with
120 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,71 @@ | ||
# ERROR 1170 (42000): BLOB/TEXT column 'localityname' used in key specification without a key length | ||
|
||
# Delaying this change to see if other changes help. | ||
# Problem found: | ||
|
||
2021-07-03 13:00:10,642 ERROR ajp-nio-0.0.0.0-8009-exec-38 org.calacademy.antweb.LoginAction - Connection.process | ||
java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' | ||
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) | ||
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) | ||
at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1198) | ||
at com.mchange.v2.c3p0.impl.NewProxyStatement.executeQuery(NewProxyStatement.java:35) | ||
at org.calacademy.antweb.home.LoginDb.getLoginByName(LoginDb.java:88) | ||
at org.calacademy.antweb.LoginAction.login(LoginAction.java:238) | ||
at org.calacademy.antweb.LoginAction.execute(LoginAction.java:90) | ||
|
||
|
||
|
||
# These have not been executed. Proposed changes below. Wating till not on vacation/with more focused time. | ||
|
||
ALTER TABLE worldants_upload CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE admin_alerts CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE ancillary CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE antwiki_fossil_taxa CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE antwiki_valid_taxa CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE bioregion CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE bioregion_taxon CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE country CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE country_bioregion CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE description_edit CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE description_hist CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE description_homonym CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE event CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE geolocale_taxon CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE geolocale_taxon_dispute CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE image_upload CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE image_uploaded CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE login CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE long_request CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE lookup CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE museum CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE museum_taxon CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE object_hist CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE object_map CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE operation_lock CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE proj_taxon_dispute CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE proj_taxon_log CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE statistics CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE taxon_country CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE taxon_prop CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE team_member CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE un_country CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE upload CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE upload_line CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE user_agent CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
|
||
#These could be pruned: | ||
drop table museumBak; | ||
drop table taxon_prop20170617; | ||
|
||
|
||
# Not base tables, so can't convert. Look at view scrits?': | ||
ALTER TABLE api3_1_specimen CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE api3_specimen CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE darwin_core_2_test CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
ALTER TABLE darwin_core_3 CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_ci'; | ||
|
||
# Maybe change the views? Here are the create statements: | ||
CREATE ALGORITHM=UNDEFINED DEFINER=`antweb`@`localhost` SQL SECURITY DEFINER VIEW `api3_1_specimen` AS select concat(_utf8'CAS:ANTWEB:',`s`.`code`) AS `occurrenceId`,`s`.`code` AS `specimen_code`,`s`.`taxon_name` AS `taxon_name`,`t`.`fossil` AS `fossil`,`t`.`status` AS `taxon_status`,`s`.`ownedby` AS `ownerInstitutionCode`,'CAS' AS `institutionCode`,'AntWeb' AS `dataSource`,`s`.`last_modified` AS `last_modified`,`s`.`kingdom_name` AS `kingdom_name`,`s`.`phylum_name` AS `phylum_name`,`s`.`class_name` AS `class_name`,`s`.`order_name` AS `order_name`,`s`.`family` AS `family`,`s`.`subfamily` AS `subfamily`,(case when (left(`s`.`genus`,1) = '(') then concat(left(`s`.`genus`,1),upper(substr(`s`.`genus`,2,1)),substr(`s`.`genus`,3)) else concat(upper(left(`s`.`genus`,1)),substr(`s`.`genus`,2)) end) AS `genus`,`s`.`subgenus` AS `subgenus`,`s`.`species` AS `species`,`s`.`subspecies` AS `subspecies`,concat(`s`.`genus`,_utf8' ',`s`.`species`) AS `scientific_name`,concat(`s`.`kingdom_name`,_utf8';',`s`.`phylum_name`,_utf8';',`s`.`class_name`,_utf8';',`s`.`order_name`,_utf8';',`s`.`order_name`,_utf8';',`s`.`family`,_utf8';',`s`.`subfamily`) AS `higherClassification`,`s`.`type_status` AS `typeStatus`,`s`.`adm1` AS `adm1`,`s`.`country` AS `country`,`s`.`bioregion` AS `bioregion`,`s`.`museum` AS `museum`,`s`.`decimal_latitude` AS `decimalLatitude`,`s`.`decimal_longitude` AS `decimalLongitude`,`s`.`latlonmaxerror` AS `latlonmaxerror`,`s`.`datedetermined` AS `dateDetermined`,concat(`s`.`habitat`,if(strcmp(`s`.`microhabitat`,''),concat(if(strcmp(`s`.`habitat`,''),_utf8'; ',''),`s`.`microhabitat`),'')) AS `habitats`,`s`.`habitat` AS `habitat`,`s`.`microhabitat` AS `microhabitat`,`s`.`method` AS `samplingMethod`,`s`.`life_stage` AS `lifeStageSex`,`s`.`caste` AS `caste`,`s`.`subcaste` AS `subcaste`,`s`.`medium` AS `medium`,`s`.`datecollectedstart` AS `datecollectedstart`,`s`.`datecollectedend` AS `datecollectedend`,`s`.`collectioncode` AS `collectioncode`,`s`.`determinedby` AS `determinedby`,`s`.`localityname` AS `localityname`,`s`.`localitynotes` AS `localitynotes`,`s`.`specimennotes` AS `specimennotes`,`s`.`collectionnotes` AS `collectionnotes`,`s`.`elevation` AS `minimumElevationInMeters`,`s`.`image_count` AS `image_count`,`s`.`ownedby` AS `ownedby`,`s`.`locatedat` AS `locatedat`,`s`.`collectedby` AS `collectedby`,`s`.`region` AS `region`,`s`.`subregion` AS `subregion` from (`specimen` `s` join `taxon` `t` on((`t`.`taxon_name` = `s`.`taxon_name`))) | ||
CREATE ALGORITHM=UNDEFINED DEFINER=`antweb`@`localhost` SQL SECURITY DEFINER VIEW `api3_specimen` AS select concat(_utf8'CAS:ANTWEB:',`s`.`code`) AS `occurrenceId`,`s`.`code` AS `specimen_code`,`s`.`taxon_name` AS `taxon_name`,`t`.`fossil` AS `fossil`,`t`.`status` AS `taxon_status`,`s`.`ownedby` AS `ownerInstitutionCode`,'preserved specimen' AS `basisOfRecord`,'CAS' AS `institutionCode`,'ANTWEB' AS `collectionCode`,`s`.`code` AS `catalogNumber`,`s`.`last_modified` AS `dcterms:modified`,'ICZN' AS `nomenclaturalCode`,`s`.`kingdom_name` AS `kingdom`,`s`.`phylum_name` AS `phylum`,`s`.`class_name` AS `class`,`s`.`order_name` AS `order`,`s`.`family` AS `family`,`s`.`subfamily` AS `subfamily`,(case when (left(`s`.`genus`,1) = '(') then concat(left(`s`.`genus`,1),upper(substr(`s`.`genus`,2,1)),substr(`s`.`genus`,3)) else concat(upper(left(`s`.`genus`,1)),substr(`s`.`genus`,2)) end) AS `genus`,`s`.`subgenus` AS `subgenus`,`s`.`species` AS `specificEpithet`,`s`.`subspecies` AS `intraspecificEpithet`,concat(`s`.`genus`,_utf8' ',`s`.`species`) AS `scientific_name`,concat(`s`.`kingdom_name`,_utf8';',`s`.`phylum_name`,_utf8';',`s`.`class_name`,_utf8';',`s`.`order_name`,_utf8';',`s`.`order_name`,_utf8';',`s`.`family`,_utf8';',`s`.`subfamily`) AS `higherClassification`,`s`.`type_status` AS `typeStatus`,`s`.`adm1` AS `stateProvince`,`s`.`country` AS `country`,`s`.`bioregion` AS `bioregion`,`s`.`status` AS `status`,`s`.`decimal_latitude` AS `decimalLatitude`,`s`.`decimal_longitude` AS `decimalLongitude`,`s`.`latlonmaxerror` AS `georeferenceRemarks`,`s`.`datedetermined` AS `dateIdentified`,concat(`s`.`habitat`,if(strcmp(`s`.`microhabitat`,''),concat(if(strcmp(`s`.`habitat`,''),_utf8'; ',''),`s`.`microhabitat`),'')) AS `habitats`,`s`.`habitat` AS `habitat`,`s`.`microhabitat` AS `microhabitat`,`s`.`collectedby` AS `recordedBy`,`s`.`method` AS `samplingProtocol`,`s`.`caste` AS `sex`,`s`.`medium` AS `preparations`,`s`.`datecollectedstart` AS `dateCollected`,`s`.`collectioncode` AS `fieldNumber`,`s`.`determinedby` AS `identifiedBy`,`s`.`localityname` AS `locality`,`s`.`localitynotes` AS `locationRemarks`,`s`.`specimennotes` AS `occurrenceRemarks`,`s`.`collectionnotes` AS `fieldNotes`,concat(`s`.`datecollectedstart`,if(strcmp(`s`.`datecollectedend`,''),concat(_utf8'/',`s`.`datecollectedend`),'')) AS `eventDate`,concat(`s`.`datecollectedstartstr`,if(strcmp(`s`.`datecollectedendstr`,''),concat(_utf8'/',`s`.`datecollectedendstr`),'')) AS `verbatimEventDate`,`s`.`elevation` AS `minimumElevationInMeters`,`s`.`bioregion` AS `biogeographicregion`,`s`.`image_count` AS `image_count`,`s`.`museum` AS `museum`,`s`.`ownedby` AS `ownedby`,`s`.`locatedat` AS `locatedat`,`s`.`collectedby` AS `collectedby` from (`specimen` `s` join `taxon` `t` on((`t`.`taxon_name` = `s`.`taxon_name`))) | ||
CREATE ALGORITHM=UNDEFINED DEFINER=`antweb`@`localhost` SQL SECURITY DEFINER VIEW `darwin_core_2_test` AS select concat(_utf8'CAS:ANTWEB:',`specimen`.`code`) AS `occurrenceId`,`specimen`.`ownedby` AS `ownerInstitutionCode`,'preserved specimen' AS `basisOfRecord`,'CAS' AS `institutionCode`,'ANTWEB' AS `collectionCode`,`specimen`.`code` AS `catalogNumber`,`specimen`.`last_modified` AS `dcterms:modified`,'ICZN' AS `nomenclaturalCode`,`specimen`.`kingdom_name` AS `kingdom`,`specimen`.`phylum_name` AS `phylum`,`specimen`.`class_name` AS `class`,`specimen`.`order_name` AS `order`,`specimen`.`family` AS `family`,`specimen`.`subfamily` AS `subfamily`,(case when (left(`specimen`.`genus`,1) = '') then concat(left(`specimen`.`genus`,1),upper(substr(`specimen`.`genus`,2,1)),substr(`specimen`.`genus`,3)) else concat(upper(left(`specimen`.`genus`,1)),substr(`specimen`.`genus`,2)) end) AS `genus`,`specimen`.`subgenus` AS `subgenus`,`specimen`.`species` AS `specificEpithet`,`specimen`.`subspecies` AS `intraspecificEpithet`,concat(`specimen`.`genus`,_utf8' ',`specimen`.`species`) AS `scientific_name`,concat(`specimen`.`kingdom_name`,_utf8';',`specimen`.`phylum_name`,_utf8';',`specimen`.`class_name`,_utf8';',`specimen`.`order_name`,_utf8';',`specimen`.`order_name`,_utf8';',`specimen`.`family`,_utf8';',`specimen`.`subfamily`) AS `higherClassification`,`specimen`.`type_status` AS `typeStatus`,`specimen`.`adm1` AS `stateProvince`,`specimen`.`country` AS `country`,`specimen`.`decimal_latitude` AS `decimalLatitude`,`specimen`.`decimal_longitude` AS `decimalLongitude`,`specimen`.`latlonmaxerror` AS `georeferenceRemarks`,`specimen`.`datedetermined` AS `dateIdentified`,`specimen`.`datecollectedstart` AS `dateCollected`,concat(`specimen`.`habitat`,if(strcmp(`specimen`.`microhabitat`,''),concat(if(strcmp(`specimen`.`habitat`,''),_utf8'; ',''),`specimen`.`microhabitat`),'')) AS `habitat`,`specimen`.`collectedby` AS `recordedBy`,`specimen`.`method` AS `samplingProtocol`,`specimen`.`caste` AS `sex`,`specimen`.`medium` AS `preparations`,`specimen`.`collectioncode` AS `fieldNumber`,`specimen`.`determinedby` AS `identifiedBy`,`specimen`.`localityname` AS `locality`,`specimen`.`localitynotes` AS `locationRemarks`,`specimen`.`specimennotes` AS `occurrenceRemarks`,`specimen`.`collectionnotes` AS `fieldNotes`,concat(`specimen`.`datecollectedstart`,if(strcmp(`specimen`.`datecollectedend`,''),concat(_utf8'/',`specimen`.`datecollectedend`),'')) AS `eventDate`,concat(`specimen`.`datecollectedstartstr`,if(strcmp(`specimen`.`datecollectedendstr`,''),concat(_utf8'/',`specimen`.`datecollectedendstr`),'')) AS `verbatimEventDate`,`specimen`.`elevation` AS `minimumElevationInMeters`,`specimen`.`bioregion` AS `biogeographicregion`,`specimen`.`taxon_name` AS `antweb_taxon_name` from `specimen` | ||
CREATE ALGORITHM=UNDEFINED DEFINER=`antweb`@`localhost` SQL SECURITY DEFINER VIEW `darwin_core_3` AS select concat(_utf8'CAS:ANTWEB:',`s`.`code`) AS `occurrenceId`,`s`.`code` AS `specimen_code`,`s`.`taxon_name` AS `taxon_name`,`t`.`fossil` AS `fossil`,`t`.`status` AS `taxon_status`,`s`.`ownedby` AS `ownerInstitutionCode`,'preserved specimen' AS `basisOfRecord`,'CAS' AS `institutionCode`,'ANTWEB' AS `collectionCode`,`s`.`code` AS `catalogNumber`,`s`.`last_modified` AS `dcterms:modified`,'ICZN' AS `nomenclaturalCode`,`s`.`kingdom_name` AS `kingdom`,`s`.`phylum_name` AS `phylum`,`s`.`class_name` AS `class`,`s`.`order_name` AS `order`,`s`.`family` AS `family`,`s`.`subfamily` AS `subfamily`,(case when (left(`s`.`genus`,1) = '(') then concat(left(`s`.`genus`,1),upper(substr(`s`.`genus`,2,1)),substr(`s`.`genus`,3)) else concat(upper(left(`s`.`genus`,1)),substr(`s`.`genus`,2)) end) AS `genus`,`s`.`subgenus` AS `subgenus`,`s`.`species` AS `specificEpithet`,`s`.`subspecies` AS `intraspecificEpithet`,concat(`s`.`genus`,_utf8' ',`s`.`species`) AS `scientific_name`,concat(`s`.`kingdom_name`,_utf8';',`s`.`phylum_name`,_utf8';',`s`.`class_name`,_utf8';',`s`.`order_name`,_utf8';',`s`.`order_name`,_utf8';',`s`.`family`,_utf8';',`s`.`subfamily`) AS `higherClassification`,`s`.`type_status` AS `typeStatus`,`s`.`adm1` AS `stateProvince`,`s`.`country` AS `country`,`s`.`decimal_latitude` AS `decimalLatitude`,`s`.`decimal_longitude` AS `decimalLongitude`,`s`.`latlonmaxerror` AS `georeferenceRemarks`,`s`.`datedetermined` AS `dateIdentified`,concat(`s`.`habitat`,if(strcmp(`s`.`microhabitat`,''),concat(if(strcmp(`s`.`habitat`,''),_utf8'; ',''),`s`.`microhabitat`),'')) AS `habitat`,`s`.`collectedby` AS `recordedBy`,`s`.`method` AS `samplingProtocol`,`s`.`caste` AS `sex`,`s`.`medium` AS `preparations`,`s`.`datecollectedstart` AS `dateCollected`,`s`.`collectioncode` AS `fieldNumber`,`s`.`determinedby` AS `identifiedBy`,`s`.`localityname` AS `locality`,`s`.`localitynotes` AS `locationRemarks`,`s`.`specimennotes` AS `occurrenceRemarks`,`s`.`collectionnotes` AS `fieldNotes`,concat(`s`.`datecollectedstart`,if(strcmp(`s`.`datecollectedend`,''),concat(_utf8'/',`s`.`datecollectedend`),'')) AS `eventDate`,concat(`s`.`datecollectedstartstr`,if(strcmp(`s`.`datecollectedendstr`,''),concat(_utf8'/',`s`.`datecollectedendstr`),'')) AS `verbatimEventDate`,`s`.`elevation` AS `minimumElevationInMeters`,`s`.`bioregion` AS `biogeographicregion`,`s`.`image_count` AS `image_count`,`s`.`museum` AS `museum`,`s`.`ownedby` AS `ownedby`,`s`.`locatedat` AS `locatedat`,`s`.`collectedby` AS `collectedby` from (`specimen` `s` join `taxon` `t` on((`t`.`taxon_name` = `s`.`taxon_name`))) | ||
|
||
|
||
# create index col_localityname_idx on specimen (localityname); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.