diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 10d6d3b..3aec4ba 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -28,7 +28,6 @@ Yii Framework 2 Change Log - Bug #3431: Allow using extended ErrorHandler class from the app namespace (cebe) - Bug #3436: Fixed the issue that `ServiceLocator` still returns the old component after calling `set()` with a new definition (qiangxue) - Bug #3458: Fixed the bug that the image rendered by `CaptchaAction` was using a wrong content type (MDMunir, qiangxue) -- Bug #3469: Fixed the bug that `QueryBuilder::getColumnType()` may drop the provided column precision in certain cases (qiangxue, Ragazzo) - Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark) - Enh #2264: `CookieCollection::has()` will return false for expired or removed cookies (qiangxue) - Enh #2435: `yii\db\IntegrityException` is now thrown on database integrity errors instead of general `yii\db\Exception` (samdark) diff --git a/framework/db/QueryBuilder.php b/framework/db/QueryBuilder.php index 2a3d0e1..1e487c4 100644 --- a/framework/db/QueryBuilder.php +++ b/framework/db/QueryBuilder.php @@ -591,13 +591,7 @@ class QueryBuilder extends \yii\base\Object return $this->typeMap[$type]; } elseif (preg_match('/^(\w+)\((.+?)\)(.*)$/', $type, $matches)) { if (isset($this->typeMap[$matches[1]])) { - $ptype = $this->typeMap[$matches[1]]; - if (strpos($ptype, '(') !== false) { - // replace the precision in $ptype with the actual one - return preg_replace('/\(.+\)/', '(' . $matches[2] . ')', $ptype) . $matches[3]; - } else { - return "{$ptype}({$matches[2]}){$matches[3]}"; - } + return preg_replace('/\(.+\)/', '(' . $matches[2] . ')', $this->typeMap[$matches[1]]) . $matches[3]; } } elseif (preg_match('/^(\w+)\s+/', $type, $matches)) { if (isset($this->typeMap[$matches[1]])) {