protected function checkQueryByPattern($pattern, $sql = null) {
        if (!isset($sql)) {
            $sql = $this->getSql();
        }
        if ($sql === "") {
            return false;
        }
        return preg_match($pattern, $sql) > 0;
    }