Skip to content

Commit 2e26d04

Browse files
committed
fix templates
1 parent 2ca6c7a commit 2e26d04

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/cubejs-schema-compiler/src/adapter/MysqlQuery.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ export class MysqlQuery extends BaseQuery {
213213
' FROM date_series\n' +
214214
' WHERE DATE_ADD(date_from, INTERVAL {{ granularity }}) <= TIMESTAMP({{ end }})\n' +
215215
')\n' +
216-
'SELECT CAST(date_from AS TIMESTAMP) AS date_from,\n' +
217-
' CAST(DATE_SUB(DATE_ADD(date_from, INTERVAL {{ granularity }}), INTERVAL 1000 MICROSECOND) AS TIMESTAMP) AS date_to\n' +
216+
'SELECT CAST(date_from AS DATETIME) AS date_from,\n' +
217+
' CAST(DATE_SUB(DATE_ADD(date_from, INTERVAL {{ granularity }}), INTERVAL 1000 MICROSECOND) AS DATETIME) AS date_to\n' +
218218
'FROM date_series';
219219

220220
templates.statements.generated_time_series_with_cte_range_source =
@@ -227,8 +227,8 @@ export class MysqlQuery extends BaseQuery {
227227
' FROM date_series\n' +
228228
' WHERE DATE_ADD(date_from, INTERVAL {{ granularity }}) <= max_date\n' +
229229
')\n' +
230-
'SELECT CAST(date_from AS TIMESTAMP) AS date_from,\n' +
231-
' CAST(DATE_SUB(DATE_ADD(date_from, INTERVAL {{ granularity }}), INTERVAL 1000 MICROSECOND) AS TIMESTAMP) AS date_to\n' +
230+
'SELECT CAST(date_from AS DATETIME) AS date_from,\n' +
231+
' CAST(DATE_SUB(DATE_ADD(date_from, INTERVAL {{ granularity }}), INTERVAL 1000 MICROSECOND) AS DATETIME) AS date_to\n' +
232232
'FROM date_series';
233233

234234
return templates;

0 commit comments

Comments
 (0)