Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

sql: convert dates outside of supported time range to correct date #694

Closed

Commits on Apr 24, 2019

  1. sql: convert dates outside of supported time range to correct date

    According to MySQL, dates should range between 1000-01-01 00:00:00
    and 9999-12-31 23:59:59. This PR changes the behaviour of Convert
    methods of Timestamp and Date types so that values returned by this
    method are always within that range.
    
    It also adds an exposed utility function named `ToSupportedTimeRange`
    that converts a time to the supported time range for clients to use.
    
    The readme now includes instructions for datasource implementors to
    always return their dates within the supported range using the
    provided utility function.
    The reason go-mysql-server does not handle that for data sources by
    default is because there is no obvious place to do so in a generic
    way. Tables should be the ones returning correct values.
    
    Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
    erizocosmico committed Apr 24, 2019
    Configuration menu
    Copy the full SHA
    4c888c4 View commit details
    Browse the repository at this point in the history