From 465fb51bec7549c12caf70b737e663f9ed5dbedc Mon Sep 17 00:00:00 2001 From: Aaron Klish Date: Tue, 5 Apr 2022 14:38:13 -0500 Subject: [PATCH] Revert "Update: Make `-` a valid TEXT value type character (#2565)" This reverts commit 588b69f120c8e914da4becc3f8b83b4d8b71d92e. --- .../elide/datastores/aggregation/metadata/enums/ValueType.java | 2 +- .../datastores/aggregation/metadata/enums/ValueTypeTest.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/elide-datastore/elide-datastore-aggregation/src/main/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueType.java b/elide-datastore/elide-datastore-aggregation/src/main/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueType.java index b36ab92159..f952c4d00b 100644 --- a/elide-datastore/elide-datastore-aggregation/src/main/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueType.java +++ b/elide-datastore/elide-datastore-aggregation/src/main/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueType.java @@ -29,7 +29,7 @@ public enum ValueType { INTEGER("^[+-]?\\d+$"), DECIMAL("^[+-]?((\\d+(\\.\\d+)?)|(\\.\\d+))$"), MONEY("^[+-]?((\\d+(\\.\\d+)?)|(\\.\\d+))$"), - TEXT("^[a-zA-Z0-9_-]+$"), //Very restricted to prevent SQL Injection + TEXT("^[a-zA-Z0-9_]+$"), //Very restricted to prevent SQL Injection COORDINATE("^(-?\\d+(\\.\\d+)?)|(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$"), BOOLEAN("^(?i)true|false(?-i)|0|1$"), ID("^[a-zA-Z0-9_]+$"), diff --git a/elide-datastore/elide-datastore-aggregation/src/test/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueTypeTest.java b/elide-datastore/elide-datastore-aggregation/src/test/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueTypeTest.java index 90d8a4df05..d5900888db 100644 --- a/elide-datastore/elide-datastore-aggregation/src/test/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueTypeTest.java +++ b/elide-datastore/elide-datastore-aggregation/src/test/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueTypeTest.java @@ -168,7 +168,6 @@ public void testValidTextValues() { assertTrue(ValueType.TEXT.matches("XYZ")); assertTrue(ValueType.TEXT.matches("123abc")); assertTrue(ValueType.TEXT.matches("___XYZ123abcABC")); - assertTrue(ValueType.TEXT.matches("r2-d2")); } @Test