db_connect appends ?connect_timeout=3 to a keyword-form DATABASE_URL, which changes the database's name
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- c, postgresql
调研方向
后缀是在 src/ext_db.c 的 db_connect 路径中追加的,该路径读取 DATABASE_URL。先使用 DATABASE_URL='host=/tmp/sock dbname=app' 复现问题,并在服务器日志中查看被破坏的数据库名称。然后在两种方案中选择:对关键字字符串添加 connect_timeout=3,或者以清晰的错误信息拒绝非 URI 输入。更新 docs/BUILTINS.md 中的数据库章节,并添加一个同时覆盖两种形式的测试。当关键字形式的 URL 能够连接,或以明确的信息失败,并且数据库名称从不被修改时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Found by a consumer's test harness at 54008422 (make server-db), which first gave DATABASE_URL in libpq's keyword form.
What happens
db_connect of null reads DATABASE_URL and appends a timeout to it before connecting (src/ext_db.c): &connect_timeout=3 when the text holds a ?, and ?connect_timeout=3 otherwise. That is right for a URI (postgresql://...). libpq also accepts a keyword string (host=/path dbname=app), and for that form the suffix becomes part of the last value.
Reproduce
With DATABASE_URL='host=/tmp/sock dbname=app':
print of (db_connect of null)
PostgreSQL's log then shows FATAL: database "app?connect_timeout=3" does not exist. The program sees only a failed connection.
Done when
- A keyword-form
DATABASE_URLconnects (the timeout is added asconnect_timeout=3), ordb_connectrefuses aDATABASE_URLthat is not a URI with an error that says so. It no longer changes the database's name. docs/BUILTINS.md, in the database extension's section, says which formsDATABASE_URLtakes.- A test covers both forms.
- 主要语言
- C
- 星标
- 3
- 派生
- 7
- 平均合并
- 3 小时 30 分钟
- 30 天内合并 PR
- 264
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
InauguralSystems/EigenScript 的其他 Issue
-
http_fetch tests: the two no-child rows fail, not skip, where a task's children file does not exist可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area:http kind:gate-defect
难度 2/5 1-3 小时 新手友好度 82/100
InauguralSystems/EigenScript#2397 ·
维护者通常 1 天内回复
-
`http_post`: `headers` text with something after its JSON value now means no headers, without a word未关闭area:http kind:silent-wrong
难度 2/5 1-3 小时 新手友好度 72/100
InauguralSystems/EigenScript#2394 · 1 条评论 ·
维护者通常 1 天内回复
-
area:docs good first issue kind:docs-drift
难度 2/5 1-3 小时 新手友好度 70/100
InauguralSystems/EigenScript#2360 ·
维护者通常 1 天内回复
-
area:http kind:bug
难度 2/5 1-3 小时 新手友好度 62/100
InauguralSystems/EigenScript#2356 · 2 条评论 ·
维护者通常 1 天内回复
-
needs-triage
难度 1/5 1 小时以内 新手友好度 82/100
InauguralSystems/EigenScript#2335 · 1 条评论 ·
维护者通常 1 天内回复
查看 InauguralSystems/EigenScript 的全部 Issue
相似的 Issue
-
Add SECURITY.md未关闭enhancement
难度 1/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
-
modem: ppp: CMUX DLCI receive buffer overruns on large downlink packets可能已有人在做 @pedrohqr 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
zephyrproject-rtos/zephyr#126195 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
ly05010419/MacNativeGames#2271 ·
维护者通常 1 天内回复
-
slice
难度 2/5 1-3 小时 新手友好度 76/100
Life-Framework/Life-Framework#2694 ·
维护者通常 1 天内回复