From abf625775facdb901af89ca8c1ce5113e4c1419e Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Fri, 28 Apr 2017 11:27:47 -0700 Subject: [PATCH] Part 2: instants never matches integers in queries. --- core/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index 65b6b2ba..e83030ab 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -208,6 +208,8 @@ impl SQLValueType for ValueType { /// /// ``` /// use mentat_core::{ValueType, SQLValueType}; + /// assert!(!ValueType::Instant.accommodates_integer(1493399581314)); + /// assert!(!ValueType::Instant.accommodates_integer(1493399581314000)); /// assert!(ValueType::Boolean.accommodates_integer(1)); /// assert!(!ValueType::Boolean.accommodates_integer(-1)); /// assert!(!ValueType::Boolean.accommodates_integer(10)); @@ -216,7 +218,8 @@ impl SQLValueType for ValueType { fn accommodates_integer(&self, int: i64) -> bool { use ValueType::*; match *self { - Instant | Long | Double => true, + Instant => false, // Always use #inst. + Long | Double => true, Ref => int >= 0, Boolean => (int == 0) || (int == 1), ValueType::String => false,