fix(sessions): use LONGTEXT for MySQL message storage - #4910
Draft
rioyu123 wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request changes the
message_datacolumn toLONGTEXTfor newly created MySQL and MariaDB message tables. Other dialects retainTEXT; serialization, session identifiers, transactions, and public APIs are unchanged. Existing tables are not migrated.MySQL-family
TEXTstorage is too small for some serialized session items. In a live example, Chinese/emoji content serialized to 1,200,028 bytes: strict mode rejected theTEXTinsert with error 1406, while non-strict mode logged truncation and stored 65,535 bytes of invalid JSON that the SDK could not return as the original item. ALONGTEXTcolumn preserved the full item through SDK add/get/pop in both modes.Draft dependency: current
maincannot automatically create these MySQL/MariaDB tables because thesession_idcolumns use an unboundedString. #4741, an open PR from another contributor, proposes fixing that separate problem. This PR contains none of its changes and does not independently restore automatic table creation. It is open as a draft to discuss the column-capacity change while the schema-creation work is reviewed. Users who already manage their ownLONGTEXTschema do not need this patch.Before marking this ready, I will refresh against the accepted schema-creation baseline, verify the combined automatic-create and large-item path, and finish the final review and verification gates.
Test plan
tests/extensions/memory/test_sqlalchemy_session.py: 47 passed, including four new column-compilation cases for MySQL, MariaDB, PostgreSQL, and SQLite.git diff --checkpassed.SQLAlchemySession(create_tables=False): small-item controls passed; strictTEXTraised error 1406; non-strictTEXTproduced truncated, invalid JSON;LONGTEXTpreserved the complete 1,200,028-byte serialized value and exact SDK get/pop results in both modes.session_id; fix(sessions): support MySQL and MariaDB schema creation #4741's schema plus the proposed column type compiles for both MySQL and MariaDB. This was a disposable metadata composition check, not a combined-source live automatic-creation test.Issue number
N/A. Related schema-creation work: #4741.
Checks
.agents/skills/code-change-verification/scripts/run.sh/reviewbefore submitting this PR