← 输入框|github.com|刷新
Skip to content

[Bug] SQLServer中,使用正则匹配,语法错误 #822

Open

Description

@zdf321

APIJSON Version/APIJSON 版本号

8.0.0.3

Database Type & Version/数据库类型及版本号

SqlServer2022

Environment/环境信息

- JDK/基础库:17
- OS/系统:windows11

APIAuto Screenshots/APIAuto 请求与结果完整截屏

https://img.picui.cn/free/2025/05/06/68196cf5c01d7.png

Current Behavior/问题描述

SqlServer中的正则查询不支持REGEXP关键字

Expected Behavior/期望结果

Any additional comments?/其它补充说明?

Activity

  1. TommyLemon commented on May 10, 2025

    @TommyLemon
    Member
  2. henriquejsza commented on Sep 1, 2026

    @henriquejsza
    Contributor

    Following your suggestion, I plan to use REGEXP_LIKE in the isSQLServer path. Microsoft documents it as requiring SQL Server 2025 and compatibility level 170, so SQL Server 2022 cannot use it. My proposal is to generate REGEXP_LIKE when supported and return a clear error suggesting key$ on older versions instead of generating invalid SQL. Does that sound right? I will open the PR after confirmation.

  3. TommyLemon commented on Sep 3, 2026

    @TommyLemon
    Member

    Following your suggestion, I plan to use REGEXP_LIKE in the isSQLServer path. Microsoft documents it as requiring SQL Server 2025 and compatibility level 170, so SQL Server 2022 cannot use it. My proposal is to generate REGEXP_LIKE when supported and return a clear error suggesting key$ on older versions instead of generating invalid SQL. Does that sound right? I will open the PR after confirmation.

    @henriquejsza It's right, thank you. Looking forward to your PR~
    By the way, you may use gainDBVersionNums for comparing the versions of SQLServer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions