-
-
Notifications
You must be signed in to change notification settings - Fork 69
optimize cast logic #2892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize cast logic #2892
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,7 +90,18 @@ func NewCast(sourceType Type, targetType Type) Cast { | |
| if len(sourceType) == 0 && len(targetType) == 0 { | ||
| return NullCast | ||
| } | ||
| return Cast(NewId(Section_Cast, string(sourceType), string(targetType))) | ||
|
|
||
| return Cast( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| string( | ||
| []byte{ | ||
| uint8(Section_Cast), | ||
| 2, | ||
| uint8(len(sourceType)), | ||
| uint8(len(targetType)), | ||
| }) + | ||
| string(sourceType) + | ||
| string(targetType), | ||
| ) | ||
| } | ||
|
|
||
| // NewCheck returns a new Check. This wrapper must not be returned to the client. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What failed: The system preserves raw cast ID bytes in storage, but semantic decode uses wrapped uint8 segment lengths, so cast identity is corrupted and lookup paths such as CastIDToTableName cannot reliably resolve the original cast.
Impact · Steps · Stub / mock · Analysis · Why this is likely a bug
Relevant code
core/id/id_wrappers.go:89-105core/id/id.go:102-113core/casts/collection.go:700-706Evidence Package
Copy prompt for an agent