diff --git a/library/think/db/builder/Mysql.php b/library/think/db/builder/Mysql.php index 465e9485..94f82b83 100644 --- a/library/think/db/builder/Mysql.php +++ b/library/think/db/builder/Mysql.php @@ -105,7 +105,8 @@ class Mysql extends Builder $table = $options['alias'][$table]; } } - if ($strict || !preg_match('/[,\'\"\*\(\)`.\s]/', $key)) { + + if ('*' != $key && ($strict || !preg_match('/[,\'\"\*\(\)`.\s]/', $key))) { $key = '`' . $key . '`'; } if (isset($table)) { diff --git a/library/think/db/builder/Sqlsrv.php b/library/think/db/builder/Sqlsrv.php index b97886ac..e904827a 100644 --- a/library/think/db/builder/Sqlsrv.php +++ b/library/think/db/builder/Sqlsrv.php @@ -92,7 +92,7 @@ class Sqlsrv extends Builder $table = $options['alias'][$table]; } } - if ($strict || !preg_match('/[,\'\"\*\(\)\[.\s]/', $key)) { + if ('*' != $key && ($strict || !preg_match('/[,\'\"\*\(\)\[.\s]/', $key))) { $key = '[' . $key . ']'; } if (isset($table)) {