Comments (4)
Good catch!
Just as the javadoc explains:
Get secondary key root page number.
Find clustered index root page and calculate sk page number based on it. Note that if table has ever been altered to add or remove indices, the secondary key root page number may be incorrect, and cause error.
MySQL will set FULLTEXT KEY, UNIQUE KEY ahead of normal KEY, but in SHOW CREATE TABLE command, the FULLTEXT KEY goes to the end, so here the workaround is to add the delta of fulltext key count.
More standard way would be to look up root page number by: SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES; before 5.7 or SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEXES; after 8.0
Currently sk root page number will be calculated per above. To locate the exact page number, the system tablespace is the where to find, but now the framework is not able to read system table to retrieve the information. So that's why the class name is Workaround
. PR is welcomed.
BTW, The command to query by sk:
java -jar /Users/xu/IdeaProjects/innodb-java-reader-ali-github/innodb-java-reader-cli/target/innodb-java-reader-cli.jar \
-ibd-file-path /usr/local/mysql/data/test/issue.ibd \
-create-table-sql-file-path issue.sql \
-showheader -c query-by-sk -args ">=;0;<;0" -skname idx_name
from innodb-java-reader.
Got it, Thank you!!! @neoremind
from innodb-java-reader.
@xiaoma20082008 I have delivered a new release, you can specify secondary key root page number if necessary, please refer to https://github.com/alibaba/innodb-java-reader/blob/master/docs/FAQ.md#1-how-to-specify-secondary-key-root-page-number. Any questions, feel free to let me know.
from innodb-java-reader.
LGTM! Thank you!
from innodb-java-reader.
Related Issues (14)
- 多页面查找的示例 HOT 3
- Sdi Page not support? HOT 3
- 提示 index header is unreadable HOT 3
- Make InnodbReaderBootstrap easy to integrated HOT 1
- dynamic格式 HOT 1
- 支持 json 类型 HOT 1
- Support UNIQUE KEY without a name in create table syntax
- Missing quotation of field values HOT 2
- .ReaderException: Table definition not found for table 可能是什么原因 HOT 1
- 您好请问,解析ibd文件时候如何能获取删除数据的delete-marked标记 HOT 1
- [PR is welcomed] Support compressed page
- [PR is welcomed] Support MySQL 8.0 newly introduced LOB page type
- [Question] Is there possible to construct Innodb file using Java in parallel ? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from innodb-java-reader.