diff --git a/README.md b/README.md index 32640cb..a9064cc 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Supported column types are listed below. Java type mapping refer to [docs](docs/ com.alibaba.database innodb-java-reader - 1.0.6 + 1.0.7 ``` diff --git a/innodb-heatmap/pom.xml b/innodb-heatmap/pom.xml index 17e2734..9f84976 100644 --- a/innodb-heatmap/pom.xml +++ b/innodb-heatmap/pom.xml @@ -8,12 +8,12 @@ com.alibaba.database innodb-java-reader-parent ../pom.xml - 1.0.6 + 1.0.7 com.alibaba.database innodb-heatmap - 1.0.6 + 1.0.7 jar innodb-heatmap innodb-heatmap diff --git a/innodb-java-reader-cli/pom.xml b/innodb-java-reader-cli/pom.xml index ddcacd6..1894d34 100644 --- a/innodb-java-reader-cli/pom.xml +++ b/innodb-java-reader-cli/pom.xml @@ -8,12 +8,12 @@ com.alibaba.database innodb-java-reader-parent ../pom.xml - 1.0.6 + 1.0.7 com.alibaba.database innodb-java-reader-cli - 1.0.6 + 1.0.7 jar innodb-java-reader-cli innodb-java-reader-cli diff --git a/innodb-java-reader-demo/pom.xml b/innodb-java-reader-demo/pom.xml index 6f731c7..c5752cd 100644 --- a/innodb-java-reader-demo/pom.xml +++ b/innodb-java-reader-demo/pom.xml @@ -8,12 +8,12 @@ com.alibaba.database innodb-java-reader-parent ../pom.xml - 1.0.6 + 1.0.7 com.alibaba.database innodb-java-reader-demo - 1.0.6 + 1.0.7 jar innodb-java-reader-demo innodb-java-reader-demo diff --git a/innodb-java-reader/pom.xml b/innodb-java-reader/pom.xml index bf7a405..90dd39d 100644 --- a/innodb-java-reader/pom.xml +++ b/innodb-java-reader/pom.xml @@ -8,12 +8,12 @@ com.alibaba.database innodb-java-reader-parent ../pom.xml - 1.0.6 + 1.0.7 com.alibaba.database innodb-java-reader - 1.0.6 + 1.0.7 jar innodb-java-reader innodb-java-reader diff --git a/innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/column/ColumnFactory.java b/innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/column/ColumnFactory.java index 33af168..e1d87fa 100644 --- a/innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/column/ColumnFactory.java +++ b/innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/column/ColumnFactory.java @@ -714,6 +714,11 @@ public SingleEnumLiteral readFrom(SliceInput input, Column column) { ? input.readUnsignedShort() : (int) input.readByte(); checkPositionIndex(ordinal, enums.size(), "Ordinal " + ordinal + " is out of range for " + enums); + // 0 can not be inserted into table, enum ordinal should start from 1, + // but sometimes this can be inserted successfully with warning message in MySQL. + if (ordinal == 0) { + return new SingleEnumLiteral(ordinal, Symbol.EMPTY); + } return new SingleEnumLiteral(ordinal, enums.get(ordinal - 1)); } diff --git a/pom.xml b/pom.xml index 1996578..9e2844d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 com.alibaba.database innodb-java-reader-parent - 1.0.6 + 1.0.7 innodb-java-reader-parent pom A library and command-line tool to access MySQL InnoDB data file directly in Java