Open SimplyUnnamed opened 2 years ago
It sounds like a database integrity issue. I think you have titles which are referencing corporation that didn't exist.
Can you give the output of that query ?
SELECT COUNT(*)
FROM corporation_titles
WHERE corporation_id NOT IN (SELECT corporation_id FROM corporation_infos);
ahh, I see.
there are 28 corps missing. this makes sense.
Not necesarrly 28 corp, the upper query is only listing amount of titles tied to an orphan corp. You also can have 28 titles not linked to the same corp.
I had to figure if yes or no that pivot table should have a foreign key. I think character module is using it.
doesn't look like the corporation titles has a foreign key, but it is indexed. This is from an update of a SeAT 3 instance, so maybe there was a migration that disappeared or didn't get run.
But it makes sense that this is because there is missing corps in corporation_infos table as there's not requirements in the CorporationTitles query that the record exists. its just assumed and eager loaded, and the corporation name is accessed regardless.
It is not, this is how the database is currently structured 😊
what was the fix for this?
MariaDB [seat]> SELECT COUNT() -> FROM corporation_titles -> WHERE corporation_id NOT IN (SELECT corporation_id FROM corporation_infos); +----------+ | COUNT() | +----------+ | 1 | +----------+ 1 row in set (0.001 sec)
Problem: Searching title returns Server 500 error,
Issue is dependent on what is search. Ie. I can search for 'Officer' title, but searching 'Director' will throw and error.
Issue also occurs on the initial search with a blank string.