-
Notifications
You must be signed in to change notification settings - Fork 136
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
fix(stmt): evict & unbound schema stmt query #1006
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/cc @baurine @breeswish PTAL, Thanks~ |
if schemaName != "" { | ||
query.Where("schema_name = ?", schemaName) | ||
} | ||
if digest == "" { |
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.
So frontend will pass digest=""
to the backend, even if the digest from the backend is null?
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.
Go: 🤧
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.
Yeah, there are two things we need to improve:
- Define a new structure. Embed
sql.NullString
to scan NULL value from db and customize the MashallJSON/UnmashallJSON interface to serde null value - The get request is not easy to carry null, we can use undefined to not pass this parameter
But I don't think that's going to help here. I reverted the code, LOL.
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.
Because is null
and = ''
are always two different patterns.
// the evicted record's digest will be empty string | ||
const evictTips = 'Others(Aggregates all the evicted statements)' | ||
data.forEach((d) => { | ||
if (d.digest !== '') { | ||
return | ||
} | ||
d.digest = evictTips | ||
d.digest_text = evictTips | ||
}) | ||
|
||
setStatements(data) | ||
cacheMgr?.set(cacheKey, data) |
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.
Could you provide a screen shot about how it looks like for "Others" in the list page and in the detail page? Also maybe it is better to display this row as:
(Others) (gray)
tooltip: All of other dropped SQL statements
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.
Yeah, I need to refine it, hold on.
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.
Should we show the detail page when user click evicted data? There's nothing to display.
Conflicts: ui/lib/apps/Statement/utils/useStatementTableController.ts
* fix(stmt): evict & unbound schema stmt query * tweak(ui): evict stmt tips * refine * refine * chore: make lint happy
* fix(stmt): evict & unbound schema stmt query * tweak(ui): evict stmt tips * refine * refine * chore: make lint happy
Another issue that can cause blank detail page is #982. PTAL, thanks~