From 23d266497b245f0d0659539a64ad6745405e1146 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 10 Dec 2015 11:26:28 +0100 Subject: [PATCH] Made the SQL storage more flexible with INTEGER_32, by allowing to retrieve INTEGER_64 and convert to INTEGER_32 if value can be converted to integer 32. --- .../implementation/store/cms_storage_store_sql.e | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/library/persistence/implementation/store/cms_storage_store_sql.e b/library/persistence/implementation/store/cms_storage_store_sql.e index 0684964..aec4408 100644 --- a/library/persistence/implementation/store/cms_storage_store_sql.e +++ b/library/persistence/implementation/store/cms_storage_store_sql.e @@ -152,6 +152,7 @@ feature -- Query -- Retrieved value at `a_index' position in `item'. local l_item: like sql_item + i64: INTEGER_64 do l_item := sql_item (a_index) if attached {INTEGER_32} l_item as i then @@ -159,7 +160,18 @@ feature -- Query elseif attached {INTEGER_32_REF} l_item as l_value then Result := l_value.item else - check is_integer_32: False end + if attached {INTEGER_64} l_item as i then + i64 := i + elseif attached {INTEGER_64_REF} l_item as l_value then + i64 := l_value.item + else + check is_integer_32: False end + end + if i64 <= {INTEGER_32}.max_value then + Result := i64.to_integer_32 + else + check is_integer_32: False end + end end end