Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Rust-dataplane] SHOW SESSION_STATES current-db non-string/null must be ignored like Go

Đang mở Phù hợp với người mới
#1,366 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, rust
Lĩnh vực
backend, databases

Hướng nghiên cứu

Đọc rust/crates/session-core/src/internal_client.rs tại validate_session_states và so sánh cách xử lý với pkg/proxy/backend/backend_conn_mgr.go tại updateAuthInfoFromSessionStates. Kiểm tra hành vi trạng thái phiên đối với các giá trị current-db là chuỗi, null và không phải chuỗi. Hoàn thành khi Rust bỏ qua các giá trị không phải chuỗi và tiếp tục với current_database chưa được đặt, giống như Go.

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

Mô tả

migration:bb7133-tiproxy

Migrated from bb7133/tiproxy#202. Original author: wjhuang2016; created: 2026-09-02T12:43:43Z; source body SHA-256: c506916b5151c54bfa1d4417fbf969b7c18e8542b1e45540bfcecd11e919ad74.

Rust dataplane rewrite parity/functional RED
  • Snapshot commit: 60efdf5e6e8226423df85033534ad748ccb129db
  • Run: run.tiproxy-rust-dataplane.session-states-current-db-type.20260902.RED
Problem

Go updateAuthInfoFromSessionStates only applies current-db when type assertion to string succeeds; null/number is ignored. Rust validate_session_states rejects non-string values as MalformedSessionStates.

Claim

when SHOW SESSION_STATES returns current-db:null or current-db:, Rust must treat it as no authoritative database and continue, matching Go.

Source anchors
  • pkg/proxy/backend/backend_conn_mgr.go:729-739 updateAuthInfoFromSessionStates type assertion
  • rust/crates/session-core/src/internal_client.rs:757-769 validate_session_states rejects non-string
Boundary
  • Before: Rust rejects the whole snapshot as MalformedSessionStates
  • After: Go ignores non-string current-db and proceeds with current_database None
Local evidence
  • run.tiproxy-rust-dataplane.session-states-current-db-type.20260902.RED
Ngôn ngữ chính
Go
Star
73
Fork
40
Merge trung bình
15 giờ 43 phút
Pull request đã merge (30 ngày)
9

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 pingcap/tiproxy

Tất cả issue của pingcap/tiproxy

Issue tương tự

Thêm issue về Go

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.