Skip to content

Commit

Permalink
SQL: [Docs] Fix doc errors regarding CURRENT_DATE. (#40649)
Browse files Browse the repository at this point in the history
Some parts wrongly refered to CURRENT_TIMESTAMP.

(cherry picked from commit 3dd0384)
  • Loading branch information
matriv committed Mar 30, 2019
1 parent 6fca1a5 commit b6416ba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
8 changes: 7 additions & 1 deletion docs/reference/sql/functions/date-time.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Functions that target date/time.
--------------------------------------------------
CURRENT_DATE
CURRENT_DATE()
CURDATE()
--------------------------------------------------

*Input*: _none_
Expand All @@ -117,7 +118,12 @@ This method always returns the same value for its every occurrence within the sa

["source","sql",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[curDate]
include-tagged::{sql-specs}/docs.csv-spec[currentDate]
--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[currentDateFunction]
--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
Expand Down
18 changes: 14 additions & 4 deletions x-pack/plugin/sql/qa/src/main/resources/docs.csv-spec
Original file line number Diff line number Diff line change
Expand Up @@ -2338,18 +2338,28 @@ SELECT WEEK(CAST('1988-01-05T09:22:10Z' AS TIMESTAMP)) AS week, ISOWEEK(CAST('19


currentDate-Ignore
// tag::curDate
SELECT CURRENT_TIMESTAMP AS result;
// tag::currentDate
SELECT CURRENT_DATE AS result;

result
------------------------
2018-12-12
// end::curDate
// end::currentDate
;

currentDateFunction-Ignore
// tag::currentDateFunction
SELECT CURRENT_DATE() AS result;

result
------------------------
2018-12-12
// end::currentDateFunction
;

curDateFunction-Ignore
// tag::curDateFunction
SELECT CURRENT_TIMESTAMP() AS result;
SELECT CURRENT_DATE() AS result;

result
------------------------
Expand Down

0 comments on commit b6416ba

Please sign in to comment.