Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复PostgreSQL数据库下,添加项目成员和全文搜索时发生的SQL语法兼容性错误 #986

Merged
merged 4 commits into from
Nov 9, 2024

Conversation

iotames
Copy link
Contributor

@iotames iotames commented Oct 14, 2024

问题

  1. 添加项目成员,在账户输入框,输入账户名称,搜索不到用户。
  2. 全文搜索时,查找不到可正常匹配的文章。

排查

数据库使用 PostgreSQL,版本为 v15.8。应为数据库的SQL语法不兼容导致的问题。

  1. 添加项目成员:查看网络请求,发现返回报错:pq: 不支持 LIMIT #,# 语法
  2. 全文搜索:接口 /docs/odoo_dev/search 报错 {"errcode":6002,"message":"搜索结果错误"}

解决

  1. 使用标准的SQL写法,LIMIT 10 OFFSET 0,以代替简写形式的 LIMIT 0,10 SQL语句,使其更具兼容性。
  2. 数据表字段使用双引号代替反引号, 即 OR "release" LIKE ? 代替 OR `release` LIKE ? 语句,使其更具兼容性。

@iotames iotames changed the title FixedBUG: pq: 不支持 LIMIT #,# 语法 修复PostgreSQL数据库下,添加项目成员和全文搜索时发生的SQL语法兼容性错误 Oct 15, 2024
@gsw945 gsw945 merged commit 0000931 into mindoc-org:master Nov 9, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants