You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{# MSSQL cannot CAST datetime2 strings with more than 7 decimal places #}
60
61
{% set start_timestamp_mssql = start_timestamp[0:27] %}
62
+
61
63
{%-set period_filter -%}
62
-
(CAST({{ timestamp_field }} AS DATETIME2) >= DATEADD({{ period }}, DATEDIFF({{ period }}, 0, DATEADD({{ period }}, {{ offset }}, CAST('{{ start_timestamp_mssql }}'AS DATETIME2))), 0) AND
63
-
CAST({{ timestamp_field }} AS DATETIME2) < DATEADD({{ period }}, 1, DATEADD({{ period }}, {{ offset }}, CAST('{{ start_timestamp_mssql }}'AS DATETIME2)))
64
-
AND (CAST({{ timestamp_field }} AS DATETIME2) >= CAST('{{ start_timestamp_mssql }}'AS DATETIME2)))
64
+
(
65
+
CAST({{ timestamp_field }} AS DATETIME2) >= DATEADD({{ period }}, DATEDIFF({{ period }}, 0, DATEADD({{ period }}, {{ offset }}, CAST('{{ start_timestamp_mssql }}'AS DATETIME2))), 0)
66
+
AND CAST({{ timestamp_field }} AS DATETIME2) < DATEADD({{ period }}, 1, DATEADD({{ period }}, {{ offset }}, CAST('{{ start_timestamp_mssql }}'AS DATETIME2)))
67
+
AND (CAST({{ timestamp_field }} AS DATETIME2) >= CAST('{{ start_timestamp_mssql }}'AS DATETIME2))
{%- if execute and hash | lower not in available_hash_algorithms %}
11
-
{%- do exceptions.warn("Configured hash ('{}') not recognised. Must be one of: {} (case insensitive)".format(hash | lower, available_hash_algorithms | join(', '))) -%}
11
+
{%- do exceptions.warn("Configured hash ('{}') not recognised. Must be one of: {} (case insensitive). Defaulting to MD5 hashing.".format(hash | lower, available_hash_algorithms | join(', '))) -%}
12
12
{%- endif -%}
13
13
14
14
{%- if hash | lower=='md5'-%}
15
15
{%- do return(automate_dv.hash_alg_md5()) -%}
16
16
{%- elif hash | lower=='sha'-%}
17
17
{%- do return(automate_dv.hash_alg_sha256()) -%}
18
+
{%- elif hash | lower=='sha1'-%}
19
+
{%- do return(automate_dv.hash_alg_sha1()) -%}
18
20
{%- else -%}
19
21
{%- do return(automate_dv.hash_alg_md5()) -%}
20
22
{%- endif -%}
@@ -102,3 +104,43 @@
102
104
{% do return('UPPER(SHA2([HASH_STRING_PLACEHOLDER], 256))') %}
0 commit comments