Skip to content

Commit e04f541

Browse files
svats0001jchrys
authored andcommitted
Changed decode41
1 parent 6cd2ff1 commit e04f541

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/message/server/DefinitionMetadataMessage.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ private static DefinitionMetadataMessage decode41(ByteBuf buf, ConnectionContext
175175

176176
CharCollation collation = context.getClientCollation();
177177
Charset charset = collation.getCharset();
178-
System.out.println("Buffer val: " + buf);
179178
String database = readVarIntSizedString(buf, charset);
180179
String table = readVarIntSizedString(buf, charset);
181180
String originTable = readVarIntSizedString(buf, charset);
@@ -184,8 +183,13 @@ private static DefinitionMetadataMessage decode41(ByteBuf buf, ConnectionContext
184183

185184
String extendTypeInfo = null;
186185
if (context.getCapability().isMariaDb() && context.getCapability().isExtendedTypeInfo()) {
187-
buf.readUnsignedByte();
188-
extendTypeInfo = readVarIntSizedString(buf, charset);
186+
buf.markReaderIndex();
187+
short extendedTypeInfoDataType = buf.readUnsignedByte();
188+
if (extendedTypeInfoDataType == 0 || extendedTypeInfoDataType == 1) {
189+
extendTypeInfo = readVarIntSizedString(buf, charset);
190+
} else {
191+
buf.resetReaderIndex();
192+
}
189193
}
190194

191195
// Skip constant 0x0c encoded by var integer

0 commit comments

Comments
 (0)