From fef079e0de2555170c3f327065ca0bbd92ab6cf2 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Tue, 19 Dec 2017 21:23:48 +0100 Subject: [PATCH] Fix EZP-26209: Textline legacy search indexing causes TransactionError --- .../plugins/ezsearchengine/ezsearchengine.php | 3 ++- lib/ezdb/classes/ezdbinterface.php | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/kernel/search/plugins/ezsearchengine/ezsearchengine.php b/kernel/search/plugins/ezsearchengine/ezsearchengine.php index 83b88bf0b71..a3b4b462466 100644 --- a/kernel/search/plugins/ezsearchengine/ezsearchengine.php +++ b/kernel/search/plugins/ezsearchengine/ezsearchengine.php @@ -297,7 +297,8 @@ function indexWords( $contentObject, $indexArray, $wordIDArray, $placement = 0 ) $indexWord = $indexArray[$i]['Word']; $contentClassAttributeID = $indexArray[$i]['ContentClassAttributeID']; $identifier = $indexArray[$i]['identifier']; - $integerValue = $indexArray[$i]['integer_value']; + $integerValue = min( $indexArray[$i]['integer_value'], $db->MAX_INT ); + $integerValue = max( $integerValue, $db->MIN_INT ); $wordID = $wordIDArray[$indexWord]; if ( isset( $indexArray[$i+1] ) ) diff --git a/lib/ezdb/classes/ezdbinterface.php b/lib/ezdb/classes/ezdbinterface.php index 5f7d16c1ccd..9930291074f 100644 --- a/lib/ezdb/classes/ezdbinterface.php +++ b/lib/ezdb/classes/ezdbinterface.php @@ -1809,6 +1809,20 @@ public function countStringSize( $string ) * @var int One of the eZDB::ERROR_HANDLING_* constants */ protected $errorHandling = eZDB::ERROR_HANDLING_STANDARD; + + /** + * Maximal value for int columns + * + * @var int + */ + public $MAX_INT = 2147483647; + + /** + * Minimal value for int columns + * + * @var int + */ + public $MIN_INT = -2147483648; } ?>