From 493dcb83d4cde40249076b60dfecb157f7866b43 Mon Sep 17 00:00:00 2001 From: Slawomir Pajak Date: Thu, 20 Apr 2023 11:43:57 +0200 Subject: [PATCH] Fix comparison documentation for BETWEEN and NULL --- .../src/test/java/io/trino/sql/TestExpressionInterpreter.java | 2 ++ docs/src/main/sphinx/functions/comparison.rst | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/trino-main/src/test/java/io/trino/sql/TestExpressionInterpreter.java b/core/trino-main/src/test/java/io/trino/sql/TestExpressionInterpreter.java index 8e1a721e72c4..a2b6741a6979 100644 --- a/core/trino-main/src/test/java/io/trino/sql/TestExpressionInterpreter.java +++ b/core/trino-main/src/test/java/io/trino/sql/TestExpressionInterpreter.java @@ -396,6 +396,8 @@ public void testBetween() assertOptimizedEquals("NULL BETWEEN 2 AND 4", "NULL"); assertOptimizedEquals("3 BETWEEN NULL AND 4", "NULL"); assertOptimizedEquals("3 BETWEEN 2 AND NULL", "NULL"); + assertOptimizedEquals("2 BETWEEN 3 AND NULL", "false"); + assertOptimizedEquals("8 BETWEEN NULL AND 6", "false"); assertOptimizedEquals("'cc' BETWEEN 'b' AND 'd'", "true"); assertOptimizedEquals("'b' BETWEEN 'cc' AND 'd'", "false"); diff --git a/docs/src/main/sphinx/functions/comparison.rst b/docs/src/main/sphinx/functions/comparison.rst index ebe334708284..886e08630da0 100644 --- a/docs/src/main/sphinx/functions/comparison.rst +++ b/docs/src/main/sphinx/functions/comparison.rst @@ -50,7 +50,7 @@ expression above:: SELECT 2 BETWEEN NULL AND 6; -- null - SELECT 2 BETWEEN 1 AND NULL; -- false + SELECT 2 BETWEEN 3 AND NULL; -- false SELECT 8 BETWEEN NULL AND 6; -- false