jonhoo / jonhoo/msql-srv

Incorrect handling of server system variables

Open
#53 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
172
Forks
40
PR merge metrics
No merged PRs in 30d

Description

A recent update of `mysql_async` (0.32.2) consolidated multiple server system variable queries into one:
```
let settings: Option = if read_socket || read_max_allowed_packet || read_wait_timeout {
self.query_internal("SELECT @@socket, @@max_allowed_packet, @@wait_timeout")
.await?
} else {
None
};
```
https://github.com/blackbeam/mysql_async/blob/e6bbf7c776374d0067c0164245e9158b5c75f7e7/src/conn/mod.rs#L970

This query is not handled correctly, as the responsible for this accepts only the following query:
```
SELECT @@max_allowed_packet
```
https://github.com/jonhoo/msql-srv/blob/9d85e6b2e94f8bd1b305815a7e0af7326185be03/src/lib.rs#L419

This in turn triggers a bug in `mysql_async`, preventing the creation of a new connection (which is fixed in the next version https://github.com/blackbeam/mysql_async/pull/263). However, the handling of the `max_allowed_packet` in `msql-srv` should probably be corrected or removed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/lib.rs around line 419, where the server handles the max_allowed_packet query, and compare that behavior with the consolidated query issued by mysql_async in the linked connection code. Confirm the server handles the combined system-variable query correctly, and verify that creating a new mysql_async connection no longer fails because of this response.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, rust
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.