From cf7516bdf16eb7ed020fd4ed5cf033ccaeadcfc6 Mon Sep 17 00:00:00 2001 From: Serge Rodovnichenko Date: Mon, 11 Mar 2019 17:17:15 +0300 Subject: [PATCH] Typecast `smallint` as well as `int`, `bigint` and so on Sometimes in db tables column type defined as `smallint` regarding to `waModel::getMetadata()` result --- wa-system/database/waModel.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wa-system/database/waModel.class.php b/wa-system/database/waModel.class.php index ce9b5e2d5..d73f59c3a 100644 --- a/wa-system/database/waModel.class.php +++ b/wa-system/database/waModel.class.php @@ -504,6 +504,7 @@ protected function castValue($type, $value, $is_null = false) case 'bigint': case 'tinyint': case 'int': + case 'smallint': case 'integer': if (wa_is_int($value)) { return "'".$this->escape($value, 'int')."'";