From 55cc8813c7da6c7bc56537e277e824ac6e216a5e Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Tue, 7 May 2013 19:31:35 -0400 Subject: [PATCH] Fixes issue #171 --- framework/db/QueryBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/db/QueryBuilder.php b/framework/db/QueryBuilder.php index 5c5584e..a4e30ea 100644 --- a/framework/db/QueryBuilder.php +++ b/framework/db/QueryBuilder.php @@ -472,8 +472,8 @@ class QueryBuilder extends \yii\base\Object if (isset($this->typeMap[$type])) { return $this->typeMap[$type]; } elseif (preg_match('/^(\w+)\s+/', $type, $matches)) { - if (isset($this->typeMap[$matches[0]])) { - return preg_replace('/^\w+/', $this->typeMap[$matches[0]], $type); + if (isset($this->typeMap[$matches[1]])) { + return preg_replace('/^\w+/', $this->typeMap[$matches[1]], $type); } } return $type;