-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
engine.Reload()
: read InnoDB tables sizes including FULLTEXT
index volume
#17118
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
95a6bf1
TestShowTablesWithSizes: add table with fulltext key
shlomi-noach dee69a4
complete test
shlomi-noach 452ec2c
adding flavor.baseShowFtsTablesWithSizes()
shlomi-noach bc6316b
Adding TablenameToFilename reimplementation of the MySQL function
shlomi-noach 24ff9e8
(c *Conn) BaseShowFtsTablesWithSizes()
shlomi-noach 59f0f9f
(dbc *Conn) BaseShowFtsTablesWithSizes()
shlomi-noach 86f2078
minor refactor
shlomi-noach 4ac4dd0
Refactor: this isn't about specifically looking for FTS tables, we no…
shlomi-noach 93ab704
no need to return error
shlomi-noach f04958c
use BaseShowInnodbTableSize()
shlomi-noach 1aba77b
minor testing refactor
shlomi-noach 4471468
adding test that validates engine.Reload, and specifically validates …
shlomi-noach 46febdc
adapt unit tests
shlomi-noach d467daf
adapt TestReloadWithSwappedTables
shlomi-noach 80ea72d
adapt TestGetTableForPos
shlomi-noach 2dfba2c
adapt TestHistorian
shlomi-noach 5fc6eea
adapt TestReloadSchema
shlomi-noach 25f4bc5
testing adding, modifying, dropping a view
shlomi-noach a3a4fe0
solve flakiness: add all possible permutations of query
shlomi-noach 08aec12
innodbTablesStats lazy initialization
shlomi-noach d4a3e79
Remove TablesWithSize80 query
shlomi-noach c4066b1
mysql.InnoDBTableSizes instead of mysql.TablesWithSize80
shlomi-noach c5a0678
optimizing parsing
shlomi-noach cbe82ba
adapt test
shlomi-noach 40133a6
remove redundant test
shlomi-noach f634366
TestShowTablesWithSizes: skip test if BaseShowTablesWithSizes is empty
shlomi-noach c9c2b0c
code comment
shlomi-noach 27608c6
adapt TablesWithSize57 to have non-NULL value for CREATE_TIME
shlomi-noach 25949d4
Support for 'legacy' (MySQL 5.7.31 at this time) env for fakesqldb; a…
shlomi-noach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
Copyright 2024 The Vitess Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package charset | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestTablenameToFilename(t *testing.T) { | ||
testCases := []struct { | ||
tablename string | ||
filename string | ||
}{ | ||
{ | ||
tablename: "my_table123", | ||
filename: "my_table123", | ||
}, | ||
{ | ||
tablename: "my-table", | ||
filename: "my@002dtable", | ||
}, | ||
{ | ||
tablename: "my$table", | ||
filename: "my@0024table", | ||
}, | ||
{ | ||
tablename: "myát", | ||
filename: "my@0ht", | ||
}, | ||
{ | ||
tablename: "myÃt", | ||
filename: "my@0jt", | ||
}, | ||
{ | ||
tablename: "myאt", | ||
filename: "my@05d0t", | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
t.Run(tc.tablename, func(t *testing.T) { | ||
filename := TablenameToFilename(tc.tablename) | ||
assert.Equal(t, tc.filename, filename, "original bytes: %x", []byte(tc.tablename)) | ||
}) | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,10 @@ func (mariadbFlavor) baseShowTables() string { | |
return mysqlFlavor{}.baseShowTables() | ||
} | ||
|
||
func (mariadbFlavor) baseShowInnodbTableSizes() string { | ||
return "" | ||
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. Same for this one, I think:
|
||
} | ||
|
||
// baseShowTablesWithSizes is part of the Flavor interface. | ||
func (mariadbFlavor101) baseShowTablesWithSizes() string { | ||
return TablesWithSize56 | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Shouldn't this be:
? I think so...
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.
Just making sure I understand correctly, did you mean that
filePosFlavor. baseShowInnodbTableSizes ()
should return the new query proposed in this PR, as opposed to an empty string? Why, then doesfilePosFlavor.baseShowTablesWithSizes()
return aTablesWithSize56
result as opposed toTablesWithSize80
?In accordance with the rest of
filePosFlavor
behavior, I don't think it should be using8.0
-grade queries?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.
I'm not sure. I don't think file/position is really tied to a version like that. We can leave it like it is.