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

Fix a crash with a special case of dbgenerated() #3515

Merged
merged 2 commits into from
Dec 15, 2022

Commits on Dec 15, 2022

  1. Fix a crash with a special case of dbgenerated()

    This bug is triggered by the following combination of _things_:
    
    - MySQL
    - Use of `dbgenerated()` (a deliberatly empty one)
    - Native type of `Time`
    
    If you have this in the PSL, pushing twice will panic.
    
    What happens is two things: we think the value `time(0)` from the
    database is diffed as a different value what is `Time` in the PSL.
    This is unneeded drift and should not happen.
    
    The second issue is when the change is adding a `dbgenerated()` to a
    field, which is not really done by the users due to it not being very
    useful (and a legacy structure). Now, our MySQL rendering does not
    think somebody would _add_ a `dbgenerated()` to the PSL. But, if you
    combine it with thinking `db.Time` and `time(0)` are different,
    getting another migration from the second push... Now we hit the
    `unreachable()` and crash.
    Julius de Bruijn committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    8383268 View commit details
    Browse the repository at this point in the history
  2. review fixes

    Julius de Bruijn committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    b032738 View commit details
    Browse the repository at this point in the history