I’m not a database guy, so that looks scary. And if I read it correctly, you then end up with duplicate indices, and have to delete them manually?
Besides, here’s the strange part. Like you found on my site with the previous duplicate, I found a duplicate user RobS in the GUI now. But, just like before, no matter which of them I clicked, I ended up on the profile page of just one of them. I.e.:
- List users named RobS in the GUI. Find two. See that both have different stats.
- Click user #1. See profile and stats belonging to user #2.
- Click user #2. See profile and stats belonging to user #2.
select * from users WHERE username_lower = 'robs';
Returns 1 row: What looks like user #2 (the dates match).
select * from users WHERE username = 'RobS';
Also returns only 1 row: What looks like user #1 (again, the dates match). This user has a different ID from the other one.
Judging by the output, they both had the same username and username_lower, yet only 1 row was returned for each SELECT statement. Is my database in serious trouble?
Would a reindexing fix this?