README "Design notes" says connection and result share one external pointer

Đang mở Phù hợp với người mới
#670 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
72/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
postgresql, r
Lĩnh vực
documentation

Hướng nghiên cứu

Đọc phần “Design notes” trong README.md và so sánh câu cuối với hành vi của kết nối và kết quả được mô tả trong issue, bao gồm R/dbSendQuery_PqConnection.R và src/DbConnection.cpp. Viết lại hoặc xóa câu đó để mô tả chính xác điều gì xảy ra với một kết quả đang mở khi truy vấn mới bắt đầu; hoàn thành khi README không còn khẳng định cả hai đối tượng dùng chung một con trỏ ngoài.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The "Design notes" section of README.md ends with: "and both the connection and result objects point to the same external pointer" (README.md#L84-L87). That is no longer true: a PqResult has its own ptr slot, created by result_create(conn@ptr, ...) in R/dbSendQuery_PqConnection.R, and the C++ connection only remembers its current result (pCurrentResult_ in src/DbConnection.cpp); starting a new query cleans up that result and cancels it if it is incomplete.

Reproducer (needs a running PostgreSQL server):

library(RPostgres)
con <- dbConnect(Postgres())
res <- dbSendQuery(con, "SELECT 1")
identical(con@ptr, res@ptr)
#> [1] FALSE
# expected by the README: TRUE
dbClearResult(res)
dbDisconnect(con)
  • Reword the last sentence of "Design notes", e.g. "and a new query on a connection cancels any result set still open on it" (the wording #607 uses in its new "Goals and non-goals" section), or drop the section in favor of #607's.

Severity: low (documentation only).

Found during the clean review of #607.


Generated by Claude Code

Ngôn ngữ chính
R
Star
345
Fork
81
Merge trung bình
8 giờ 21 phút
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của r-dbi/RPostgres

Tất cả issue của r-dbi/RPostgres

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.