Skip to content

Commit dc553b9

Browse files
committed
fix: Invalid Date: Incorrect MySQL minutes granularity
1 parent 35366aa commit dc553b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/cubejs-schema-compiler/adapter/MysqlQuery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const GRANULARITY_TO_INTERVAL = {
77
day: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT00:00:00.000')`,
88
week: (date) => `DATE_FORMAT(date_add('1900-01-01', interval TIMESTAMPDIFF(WEEK, '1900-01-01', ${date}) WEEK), '%Y-%m-%dT00:00:00.000')`,
99
hour: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:00:00.000')`,
10-
minute: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:%M:00.000')`,
11-
second: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:%M:%S.000')`,
10+
minute: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:%i:00.000')`,
11+
second: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:%i:%S.000')`,
1212
month: (date) => `DATE_FORMAT(${date}, '%Y-%m-01T00:00:00.000')`,
1313
year: (date) => `DATE_FORMAT(${date}, '%Y-01-01T00:00:00.000')`
1414
};

0 commit comments

Comments
 (0)