Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with migration from deprecating exact_time_int #1218

Open
BoomShotKapow opened this issue Aug 27, 2024 · 2 comments
Open

Issue with migration from deprecating exact_time_int #1218

BoomShotKapow opened this issue Aug 27, 2024 · 2 comments

Comments

@BoomShotKapow
Copy link
Contributor

BoomShotKapow commented Aug 27, 2024

After the deprecation of exact_time_int, the migration case DeprecateExactTimeInt will reset the player's time to the last value of exact_time_int in the database. This value is not updated anymore in the newer versions and it's fine for all new records that have it assigned to 0. But, it's a problem for the existing records before the deprecation, because if the record is improved on after the deprecration, the exact_time_int value isn't updated anymore.

FormatEx(query, sizeof(query), "UPDATE %splayertimes SET time = (1.0 + (exact_time_int & 0x7FFFFF) * pow(2.0, -23)) * POWER(2.0, (exact_time_int & 0x7f800000) / 0x800000 - 127) WHERE exact_time_int != 0;", gS_SQLPrefix);

That line is problematic due to this deprecation, so if you don't backup your database before that's executed (assuming you have records in your database from before the deprecation), then they'll all be set back to the old time and will not reflect the actual record time that's in a replay for example.

@BoomShotKapow BoomShotKapow changed the title Issue with deprecating exact_time_int Issue with migration from deprecating exact_time_int Aug 28, 2024
@rtldg
Copy link
Collaborator

rtldg commented Aug 28, 2024

Hmm. I was originally going to remove the exact_time_int column and then I didn't in case there were migration troubles. And then I didn't account for this. Probably can & should remove the column now.

@rtldg
Copy link
Collaborator

rtldg commented Sep 5, 2024

I think SET time = MIN(time, <exact_time_int thing here>) would be right for the migration so I'll test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants