From 252193b459cfebf4dfe6d9cbfd041f3f5aa698db Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Mon, 14 Mar 2022 10:48:41 -0700 Subject: [PATCH 1/2] Sample change to fix the issue of +TZ causing oracle sql exceptions --- .../commands/FunctionDatetimeValue.java | 40 ++++++++++++------- .../testDateTimeValueWithTimeZone.xml | 29 ++++++++++++++ .../com/force/formula/impl/formulatests.xml | 5 +++ .../testDateTimeValueWithTimeZone.xml | 21 ++++++++++ 4 files changed, 81 insertions(+), 14 deletions(-) create mode 100644 impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml create mode 100644 oracle-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml diff --git a/impl/src/main/java/com/force/formula/commands/FunctionDatetimeValue.java b/impl/src/main/java/com/force/formula/commands/FunctionDatetimeValue.java index 2032620f..6bed6dde 100644 --- a/impl/src/main/java/com/force/formula/commands/FunctionDatetimeValue.java +++ b/impl/src/main/java/com/force/formula/commands/FunctionDatetimeValue.java @@ -2,7 +2,7 @@ import java.lang.reflect.Type; import java.math.BigDecimal; -import java.text.ParseException; +import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Deque; @@ -60,7 +60,7 @@ public SQLPair getSQL(FormulaAST node, FormulaContext context, String[] args, St FormulaAST child = (FormulaAST)node.getFirstChild(); if (child != null && child.isLiteral() && child.getDataType() == String.class) { - if (OperatorDatetimeValueFormulaCommand.isValidDateTime(ConstantString.getStringValue(child, true))) { + if (OperatorDatetimeValueFormulaCommand.isValidDateTime(ConstantString.getStringValue(child, true), true)) { // no guard needed guard = SQLPair.generateGuard(guards, null); } else { @@ -133,7 +133,7 @@ public void execute(FormulaRuntimeContext context, Deque stack) throws F value = new FormulaDateTime((Date)input); } else { try { - value = parseDateTime(checkStringType(input)); + value = parseDateTime(checkStringType(input), false); } catch (FormulaDateException ex) { FormulaEngine.getHooks().handleFormulaDateException(ex); } @@ -143,9 +143,14 @@ public void execute(FormulaRuntimeContext context, Deque stack) throws F stack.push(value); } - protected static boolean isValidDateTime(String datetime) { + /** + * @return whether datetime is a valid value + * @param datetime the string of the format "yyyy-MM-dd HH:mm:ss" + * @param strict whether to be "strict" and only allow whitespace after parsing + */ + protected static boolean isValidDateTime(String datetime, boolean strict) { try { - parseDateTime(datetime); + parseDateTime(datetime, strict); return true; } catch (FormulaDateException x) { return false; @@ -153,20 +158,27 @@ protected static boolean isValidDateTime(String datetime) { } private static Pattern DATE_PATTERN = Pattern.compile("\\d{4}-.*"); - protected static FormulaDateTime parseDateTime(String input) throws FormulaDateException { + /** + * @param input the date time to parse + * @param strict means that only whitespace is allowed at the end of the date format string + * @return the DateTime of the parsed value + * @throws FormulaDateException + */ + protected static FormulaDateTime parseDateTime(String input, boolean strict) throws FormulaDateException { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); dateFormat.setLenient(false); dateFormat.setTimeZone(BaseLocalizer.GMT_TZ); - try { - // Do a pre-check for 4-digit year (setLenient does not require this) - if (!DATE_PATTERN.matcher(input).matches()) { - throw new FormulaDateException("Invalid year for DATEVALUE function"); - } - return new FormulaDateTime(dateFormat.parse(input)); + + // Do a pre-check for 4-digit year (setLenient does not require this) + if (!DATE_PATTERN.matcher(input).matches()) { + throw new FormulaDateException("Invalid year for DATEVALUE function"); } - catch (ParseException x) { - throw new FormulaDateException(x); + ParsePosition p = new ParsePosition(0); + Date ret = dateFormat.parse(input, p); + if (ret == null || p.getErrorIndex() != -1 || (strict && !input.substring(p.getIndex()).isBlank())) { + throw new FormulaDateException("Invalid date format: " + input); } + return new FormulaDateTime(ret); } } diff --git a/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml b/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml new file mode 100644 index 00000000..259790be --- /dev/null +++ b/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml @@ -0,0 +1,29 @@ + + + + + NULL + 0=0 + + + NULL + 0=0 + + new Date("2021-08-12 03:26:09+1100" + ' GMT') + new Date("2021-08-12 03:26:09+1100" + ' GMT') + new Date("2021-08-12 03:26:09+1100" + ' GMT') + new Date("2021-08-12 03:26:09+1100" + ' GMT') + + + No data + Thu Aug 12 03:26:09 GMT 2021 + null + Error: Cannot convert 'NaN'(language: Java, type: java.lang.Double) to Java type 'long' using Value.asLong(): Invalid or lossy primitive coercion. You can ensure that the value can be converted using Value.fitsInLong(). + Error: Cannot convert 'NaN'(language: Java, type: java.lang.Double) to Java type 'long' using Value.asLong(): Invalid or lossy primitive coercion. You can ensure that the value can be converted using Value.fitsInLong(). + Thu Aug 12 03:26:09 GMT 2021 + null + Error: Cannot convert 'NaN'(language: Java, type: java.lang.Double) to Java type 'long' using Value.asLong(): Invalid or lossy primitive coercion. You can ensure that the value can be converted using Value.fitsInLong(). + Error: Cannot convert 'NaN'(language: Java, type: java.lang.Double) to Java type 'long' using Value.asLong(): Invalid or lossy primitive coercion. You can ensure that the value can be converted using Value.fitsInLong(). + + + diff --git a/impl/src/test/resources/com/force/formula/impl/formulatests.xml b/impl/src/test/resources/com/force/formula/impl/formulatests.xml index c2f9c8c2..c972110f 100644 --- a/impl/src/test/resources/com/force/formula/impl/formulatests.xml +++ b/impl/src/test/resources/com/force/formula/impl/formulatests.xml @@ -19,6 +19,11 @@ author: Srikanth Yendluri/Doug Chasman labelName="testDateTimeValueWithValidString" dataType="DateOnly" eval="formula,template" scale="2" precision="12" code="DATETIMEVALUE("2005-11-15 17:00:00 ")"> + + + + + + NULL + 0=0 + + + NULL + 0=0 + + + + No data + Thu Aug 12 03:26:09 GMT 2021 + null + Thu Aug 12 03:26:09 GMT 2021 + null + + + From d67c0339fc20aaeaf576129fc77e362160946392 Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Wed, 16 Mar 2022 10:53:26 -0700 Subject: [PATCH 2/2] Postgres parses like JDK, so leave it for backwards compat Instead of NULL for invalid dates, use timestamp conversion to prevent errors in mssql. Mark javascript as being invalid as well --- .../commands/FunctionDatetimeValue.java | 24 ++++++++++++------- .../testDateTimeValueWithInvalidString.xml | 4 ++-- .../testDateTimeValueWithTimeZone.xml | 12 +++++----- ...tIfErrorDateTimeValueWithInvalidString.xml | 4 ++-- .../com/force/formula/impl/formulatests.xml | 4 +++- .../testDateTimeValueWithInvalidString.xml | 4 ++-- .../MySQL/testDateTimeValueWithTimeZone.xml | 20 ++++++++++++++++ ...tIfErrorDateTimeValueWithInvalidString.xml | 4 ++-- .../testDateTimeValueWithInvalidString.xml | 4 ++-- .../testDateTimeValueWithTimeZone.xml | 5 ++-- ...tIfErrorDateTimeValueWithInvalidString.xml | 4 ++-- .../testDateTimeValueWithInvalidString.xml | 8 +++---- .../testDateTimeValueWithTimeZone.xml | 20 ++++++++++++++++ ...tIfErrorDateTimeValueWithInvalidString.xml | 4 ++-- 14 files changed, 84 insertions(+), 37 deletions(-) create mode 100644 mysql-test/src/test/goldfiles/FormulaFields/MySQL/testDateTimeValueWithTimeZone.xml create mode 100644 sqlserver-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml diff --git a/impl/src/main/java/com/force/formula/commands/FunctionDatetimeValue.java b/impl/src/main/java/com/force/formula/commands/FunctionDatetimeValue.java index 6bed6dde..c7bd2606 100644 --- a/impl/src/main/java/com/force/formula/commands/FunctionDatetimeValue.java +++ b/impl/src/main/java/com/force/formula/commands/FunctionDatetimeValue.java @@ -19,6 +19,7 @@ import com.force.formula.FormulaProperties; import com.force.formula.FormulaRuntimeContext; import com.force.formula.impl.FormulaAST; +import com.force.formula.impl.FormulaSqlHooks; import com.force.formula.impl.IllegalArgumentTypeException; import com.force.formula.impl.JsValue; import com.force.formula.impl.TableAliasRegistry; @@ -56,17 +57,19 @@ public SQLPair getSQL(FormulaAST node, FormulaContext context, String[] args, St sql = args[0]; guard = SQLPair.generateGuard(guards, null); } else { - sql = String.format(getSqlHooks(context).sqlToTimestampIso(), args[0]); + FormulaSqlHooks hooks = getSqlHooks(context); + sql = String.format(hooks.sqlToTimestampIso(), args[0]); FormulaAST child = (FormulaAST)node.getFirstChild(); if (child != null && child.isLiteral() && child.getDataType() == String.class) { - if (OperatorDatetimeValueFormulaCommand.isValidDateTime(ConstantString.getStringValue(child, true), true)) { + boolean noExtraChars = !hooks.isPostgresStyle(); // Postgres works like JDK, so allow it. + if (OperatorDatetimeValueFormulaCommand.isValidDateTime(ConstantString.getStringValue(child, true), noExtraChars)) { // no guard needed guard = SQLPair.generateGuard(guards, null); } else { // we know it's false guard = SQLPair.generateGuard(guards, "0=0"); - sql = "NULL"; + sql = hooks.sqlNullToDate(); } } else { // Guard protects against malformed dates as strings @@ -146,11 +149,11 @@ public void execute(FormulaRuntimeContext context, Deque stack) throws F /** * @return whether datetime is a valid value * @param datetime the string of the format "yyyy-MM-dd HH:mm:ss" - * @param strict whether to be "strict" and only allow whitespace after parsing + * @param forSqlGeneration whether to be "strict" and only allow whitespace after parsing for sql generation */ - protected static boolean isValidDateTime(String datetime, boolean strict) { + protected static boolean isValidDateTime(String datetime, boolean forSqlGeneration) { try { - parseDateTime(datetime, strict); + parseDateTime(datetime, forSqlGeneration); return true; } catch (FormulaDateException x) { return false; @@ -160,11 +163,11 @@ protected static boolean isValidDateTime(String datetime, boolean strict) { private static Pattern DATE_PATTERN = Pattern.compile("\\d{4}-.*"); /** * @param input the date time to parse - * @param strict means that only whitespace is allowed at the end of the date format string + * @param forSqlGeneration means that only whitespace is allowed at the end of the date format string, as is required for oracle * @return the DateTime of the parsed value * @throws FormulaDateException */ - protected static FormulaDateTime parseDateTime(String input, boolean strict) throws FormulaDateException { + protected static FormulaDateTime parseDateTime(String input, boolean forSqlGeneration) throws FormulaDateException { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); dateFormat.setLenient(false); dateFormat.setTimeZone(BaseLocalizer.GMT_TZ); @@ -175,7 +178,10 @@ protected static FormulaDateTime parseDateTime(String input, boolean strict) thr } ParsePosition p = new ParsePosition(0); Date ret = dateFormat.parse(input, p); - if (ret == null || p.getErrorIndex() != -1 || (strict && !input.substring(p.getIndex()).isBlank())) { + // JDK's Date Format (and postgres) ignores characters past the date format, but Oracle and javascript do not. + // So for non-literal values, we don't allow extra characters, but for literal values we do, but only + // in Java. We don't know if we're generating SQL or JS at this point, so we allow it for backwards compatibilty. + if (ret == null || p.getErrorIndex() != -1 || (forSqlGeneration && !input.substring(p.getIndex()).isBlank())) { throw new FormulaDateException("Invalid date format: " + input); } return new FormulaDateTime(ret); diff --git a/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml b/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml index 96f0c5ef..2ca9fcbe 100644 --- a/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml +++ b/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml @@ -2,11 +2,11 @@ - NULL + CAST(NULL AS DATE) 0=0 - NULL + CAST(NULL AS DATE) 0=0 new Date("sample " + ' GMT') diff --git a/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml b/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml index 259790be..54829b30 100644 --- a/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml +++ b/impl/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml @@ -2,12 +2,12 @@ - NULL - 0=0 + TO_TIMESTAMP('2021-08-12 03:26:09+1100', 'YYYY-MM-DD HH24:MI:SS') + null - NULL - 0=0 + TO_TIMESTAMP('2021-08-12 03:26:09+1100', 'YYYY-MM-DD HH24:MI:SS') + null new Date("2021-08-12 03:26:09+1100" + ' GMT') new Date("2021-08-12 03:26:09+1100" + ' GMT') @@ -17,11 +17,11 @@ No data Thu Aug 12 03:26:09 GMT 2021 - null + 2021-08-12 03:26:09.0 Error: Cannot convert 'NaN'(language: Java, type: java.lang.Double) to Java type 'long' using Value.asLong(): Invalid or lossy primitive coercion. You can ensure that the value can be converted using Value.fitsInLong(). Error: Cannot convert 'NaN'(language: Java, type: java.lang.Double) to Java type 'long' using Value.asLong(): Invalid or lossy primitive coercion. You can ensure that the value can be converted using Value.fitsInLong(). Thu Aug 12 03:26:09 GMT 2021 - null + 2021-08-12 03:26:09.0 Error: Cannot convert 'NaN'(language: Java, type: java.lang.Double) to Java type 'long' using Value.asLong(): Invalid or lossy primitive coercion. You can ensure that the value can be converted using Value.fitsInLong(). Error: Cannot convert 'NaN'(language: Java, type: java.lang.Double) to Java type 'long' using Value.asLong(): Invalid or lossy primitive coercion. You can ensure that the value can be converted using Value.fitsInLong(). diff --git a/impl/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml b/impl/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml index ba44f89f..72141ebf 100644 --- a/impl/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml +++ b/impl/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml @@ -2,11 +2,11 @@ - CASE WHEN 0=0 THEN TO_TIMESTAMP('2005-11-15 17:00:00 ', 'YYYY-MM-DD HH24:MI:SS') ELSE NULL END + CASE WHEN 0=0 THEN TO_TIMESTAMP('2005-11-15 17:00:00 ', 'YYYY-MM-DD HH24:MI:SS') ELSE CAST(NULL AS DATE) END null - CASE WHEN 0=0 THEN TO_TIMESTAMP('2005-11-15 17:00:00 ', 'YYYY-MM-DD HH24:MI:SS') ELSE NULL END + CASE WHEN 0=0 THEN TO_TIMESTAMP('2005-11-15 17:00:00 ', 'YYYY-MM-DD HH24:MI:SS') ELSE CAST(NULL AS DATE) END null (Object.prototype.toString.call(new Date("sample " + ' GMT')) !== '[object Date]') || isNaN(new Date("sample " + ' GMT').getTime())?new Date("2005-11-15 17:00:00 " + ' GMT'):new Date("sample " + ' GMT') diff --git a/impl/src/test/resources/com/force/formula/impl/formulatests.xml b/impl/src/test/resources/com/force/formula/impl/formulatests.xml index c972110f..335c66e4 100644 --- a/impl/src/test/resources/com/force/formula/impl/formulatests.xml +++ b/impl/src/test/resources/com/force/formula/impl/formulatests.xml @@ -20,7 +20,9 @@ author: Srikanth Yendluri/Doug Chasman scale="2" precision="12" code="DATETIMEVALUE("2005-11-15 17:00:00 ")"> - diff --git a/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testDateTimeValueWithInvalidString.xml b/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testDateTimeValueWithInvalidString.xml index 0e691850..8586bafe 100644 --- a/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testDateTimeValueWithInvalidString.xml +++ b/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testDateTimeValueWithInvalidString.xml @@ -2,11 +2,11 @@ - NULL + CAST(NULL AS DATE) 0=0 - NULL + CAST(NULL AS DATE) 0=0 diff --git a/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testDateTimeValueWithTimeZone.xml b/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testDateTimeValueWithTimeZone.xml new file mode 100644 index 00000000..d7584495 --- /dev/null +++ b/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testDateTimeValueWithTimeZone.xml @@ -0,0 +1,20 @@ + + + + + CAST(NULL AS DATE) + 0=0 + + + CAST(NULL AS DATE) + 0=0 + + + No data + Thu Aug 12 03:26:09 GMT 2021 + null + Thu Aug 12 03:26:09 GMT 2021 + null + + + diff --git a/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testIfErrorDateTimeValueWithInvalidString.xml b/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testIfErrorDateTimeValueWithInvalidString.xml index fb86b38d..ae8933f8 100644 --- a/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testIfErrorDateTimeValueWithInvalidString.xml +++ b/mysql-test/src/test/goldfiles/FormulaFields/MySQL/testIfErrorDateTimeValueWithInvalidString.xml @@ -2,11 +2,11 @@ - CASE WHEN 0=0 THEN TIMESTAMP('2005-11-15 17:00:00 ') ELSE NULL END + CASE WHEN 0=0 THEN TIMESTAMP('2005-11-15 17:00:00 ') ELSE CAST(NULL AS DATE) END null - CASE WHEN 0=0 THEN TIMESTAMP('2005-11-15 17:00:00 ') ELSE NULL END + CASE WHEN 0=0 THEN TIMESTAMP('2005-11-15 17:00:00 ') ELSE CAST(NULL AS DATE) END null diff --git a/oracle-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml b/oracle-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml index 0e691850..94f90170 100644 --- a/oracle-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml +++ b/oracle-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml @@ -2,11 +2,11 @@ - NULL + TO_DATE(NULL) 0=0 - NULL + TO_DATE(NULL) 0=0 diff --git a/oracle-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml b/oracle-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml index 9920c942..367efd63 100644 --- a/oracle-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml +++ b/oracle-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml @@ -2,15 +2,14 @@ - NULL + TO_DATE(NULL) 0=0 - NULL + TO_DATE(NULL) 0=0 - No data Thu Aug 12 03:26:09 GMT 2021 null diff --git a/oracle-test/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml b/oracle-test/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml index 8de7f9a3..4384b851 100644 --- a/oracle-test/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml +++ b/oracle-test/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml @@ -2,11 +2,11 @@ - CASE WHEN 0=0 THEN TO_DATE('2005-11-15 17:00:00 ', 'YYYY-MM-DD HH24:MI:SS') ELSE NULL END + CASE WHEN 0=0 THEN TO_DATE('2005-11-15 17:00:00 ', 'YYYY-MM-DD HH24:MI:SS') ELSE TO_DATE(NULL) END null - CASE WHEN 0=0 THEN TO_DATE('2005-11-15 17:00:00 ', 'YYYY-MM-DD HH24:MI:SS') ELSE NULL END + CASE WHEN 0=0 THEN TO_DATE('2005-11-15 17:00:00 ', 'YYYY-MM-DD HH24:MI:SS') ELSE TO_DATE(NULL) END null diff --git a/sqlserver-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml b/sqlserver-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml index a3e621ad..3f6303fa 100644 --- a/sqlserver-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml +++ b/sqlserver-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithInvalidString.xml @@ -2,19 +2,19 @@ - NULL + CONVERT(DATETIME,NULL) 0=0 - NULL + CONVERT(DATETIME,NULL) 0=0 No data Error: com.force.formula.FormulaDateException - Error: At least one of the result expressions in a CASE specification must be an expression other than the NULL constant. + null Error: com.force.formula.FormulaDateException - Error: At least one of the result expressions in a CASE specification must be an expression other than the NULL constant. + null diff --git a/sqlserver-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml b/sqlserver-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml new file mode 100644 index 00000000..3af7bde5 --- /dev/null +++ b/sqlserver-test/src/test/goldfiles/FormulaFields/testDateTimeValueWithTimeZone.xml @@ -0,0 +1,20 @@ + + + + + CONVERT(DATETIME,NULL) + 0=0 + + + CONVERT(DATETIME,NULL) + 0=0 + + + No data + Thu Aug 12 03:26:09 GMT 2021 + null + Thu Aug 12 03:26:09 GMT 2021 + null + + + diff --git a/sqlserver-test/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml b/sqlserver-test/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml index 5f62eb5e..e4991b7d 100644 --- a/sqlserver-test/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml +++ b/sqlserver-test/src/test/goldfiles/FormulaFields/testIfErrorDateTimeValueWithInvalidString.xml @@ -2,11 +2,11 @@ - CASE WHEN 0=0 THEN CONVERT(DATETIME, '2005-11-15 17:00:00 ') ELSE NULL END + CASE WHEN 0=0 THEN CONVERT(DATETIME, '2005-11-15 17:00:00 ') ELSE CONVERT(DATETIME,NULL) END null - CASE WHEN 0=0 THEN CONVERT(DATETIME, '2005-11-15 17:00:00 ') ELSE NULL END + CASE WHEN 0=0 THEN CONVERT(DATETIME, '2005-11-15 17:00:00 ') ELSE CONVERT(DATETIME,NULL) END null