This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
DATE_SUB and DATE_ADD functions #663
Comments
erizocosmico
added a commit
to erizocosmico/go-mysql-server
that referenced
this issue
Apr 10, 2019
Fixes src-d#663 This PR introduces a few new features: - Correctly parsing interval expressions. - Allow using the + and - operators to subtract from and add to dates. e.g. `'2019-04-10' - INTERVAL 1 DAY`. - New `DATE_ADD` function, which is essentially the same as `DATE + INTERVAL`. - New `DATE_SUB` function, which is essentially the same as `DATE - INTERVAL`. - Validation rule to ensure intervals are only used in certain specific places, such as DATE_SUB, DATE_ADD, + and -. Using it anywhere else is not valid SQL, but vitess does not catch those errors. Plus, even if it's an expression for convenience, its `Eval` method is a stub and panics, so it should not be used unless it's in an expression that knows how to deal with intervals. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
erizocosmico
added a commit
to erizocosmico/go-mysql-server
that referenced
this issue
Apr 10, 2019
Fixes src-d#663 This PR introduces a few new features: - Correctly parsing interval expressions. - Allow using the + and - operators to subtract from and add to dates. e.g. `'2019-04-10' - INTERVAL 1 DAY`. - New `DATE_ADD` function, which is essentially the same as `DATE + INTERVAL`. - New `DATE_SUB` function, which is essentially the same as `DATE - INTERVAL`. - Validation rule to ensure intervals are only used in certain specific places, such as DATE_SUB, DATE_ADD, + and -. Using it anywhere else is not valid SQL, but vitess does not catch those errors. Plus, even if it's an expression for convenience, its `Eval` method is a stub and panics, so it should not be used unless it's in an expression that knows how to deal with intervals. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
erizocosmico
added a commit
to erizocosmico/go-mysql-server
that referenced
this issue
Apr 10, 2019
Fixes src-d#663 This PR introduces a few new features: - Correctly parsing interval expressions. - Allow using the + and - operators to subtract from and add to dates. e.g. `'2019-04-10' - INTERVAL 1 DAY`. - New `DATE_ADD` function, which is essentially the same as `DATE + INTERVAL`. - New `DATE_SUB` function, which is essentially the same as `DATE - INTERVAL`. - Validation rule to ensure intervals are only used in certain specific places, such as DATE_SUB, DATE_ADD, + and -. Using it anywhere else is not valid SQL, but vitess does not catch those errors. Plus, even if it's an expression for convenience, its `Eval` method is a stub and panics, so it should not be used unless it's in an expression that knows how to deal with intervals. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
erizocosmico
added a commit
to erizocosmico/go-mysql-server
that referenced
this issue
Apr 11, 2019
Fixes src-d#663 This PR introduces a few new features: - Correctly parsing interval expressions. - Allow using the + and - operators to subtract from and add to dates. e.g. `'2019-04-10' - INTERVAL 1 DAY`. - New `DATE_ADD` function, which is essentially the same as `DATE + INTERVAL`. - New `DATE_SUB` function, which is essentially the same as `DATE - INTERVAL`. - Validation rule to ensure intervals are only used in certain specific places, such as DATE_SUB, DATE_ADD, + and -. Using it anywhere else is not valid SQL, but vitess does not catch those errors. Plus, even if it's an expression for convenience, its `Eval` method is a stub and panics, so it should not be used unless it's in an expression that knows how to deal with intervals. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
erizocosmico
added a commit
to erizocosmico/go-mysql-server
that referenced
this issue
Apr 11, 2019
Fixes src-d#663 This PR introduces a few new features: - Correctly parsing interval expressions. - Allow using the + and - operators to subtract from and add to dates. e.g. `'2019-04-10' - INTERVAL 1 DAY`. - New `DATE_ADD` function, which is essentially the same as `DATE + INTERVAL`. - New `DATE_SUB` function, which is essentially the same as `DATE - INTERVAL`. - Validation rule to ensure intervals are only used in certain specific places, such as DATE_SUB, DATE_ADD, + and -. Using it anywhere else is not valid SQL, but vitess does not catch those errors. Plus, even if it's an expression for convenience, its `Eval` method is a stub and panics, so it should not be used unless it's in an expression that knows how to deal with intervals. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
See src-d/gitbase#784
The text was updated successfully, but these errors were encountered: