db.mysql: preserve field metadata and add streamed results - #28082
db.mysql: preserve field metadata and add streamed results#28082guweigang wants to merge 9 commits into
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32b8f589ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2226b893f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 629a24d0b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Result.fields()so every column reads its ownMYSQL_FIELDmetadataquery_stream()and one-shot preparedprepare_stream()APIsmulti-statement queries
use_result()signature while safely discarding pending resultsWhy
Result.fields()indexed only the field name. The remaining properties were read through thebase pointer, so every result column inherited the first column's type, length, flags, and
character set.
The existing materialized query APIs also provided no way to consume large results in bounded
batches. This adds streaming adapters around
mysql_use_result()and the prepared statementfetch APIs without changing the behavior of
query()or the existing prepared statement APIs.Validation
./vnew fmt -verifyfor all changed V files./vnew check-md vlib/db/mysql/README.mdgit diff --check./vnew -d network -d mysql_test_password=... -silent vlib/db/mysql/result_test.c.v./vnew -d network -d mysql_test_password=... -silent vlib/db/mysql/stream_test.c.v./vnew -silent test vlib/db/mysql/(6 passed)VFLAGS='-gc none -cc gcc': compiler build and both network test files compile;runtime suite skipped because MySQL is not running in the VM