Description
Hello, Everyone:
There is a bug in your library:
- ENV:
DB: MySQL
SQL:
[iot_cloud]> SELECT iot_m_barrier.car_park_id FROM iot_m_barrier WHERE (iot_m_barrier.kid = 1576108104068099);
CREATE SQL:
car_park_id
varchar(64) NOT NULL DEFAULT '' COMMENT ' park ID ';
EXPLAIN:
The type of field 'car_park_id' is varchar(64), use the default value '' will cause a IndexOutOfBoundsException, the stack trace like this:
14:03:37.527 [vert.x-eventloop-thread-0] ERROR com.github.mauricio.async.db.mysql.MySQLConnection - Transport failure
java.lang.IndexOutOfBoundsException: readerIndex(1) + length(1) exceeds writerIndex(1): UnpooledSlicedByteBuf(ridx: 1, widx: 1, cap: 1/1, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeNoCleanerDirectByteBuf(ridx: 111, widx: 120, cap: 256))
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1405) ~[netty-buffer-4.1.25.Final.jar:4.1.25.Final]
at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:707) ~[netty-buffer-4.1.25.Final.jar:4.1.25.Final]
at io.netty.buffer.AbstractByteBuf.readUnsignedByte(AbstractByteBuf.java:721) ~[netty-buffer-4.1.25.Final.jar:4.1.25.Final]
at io.netty.buffer.SwappedByteBuf.readUnsignedByte(SwappedByteBuf.java:536) ~[netty-buffer-4.1.25.Final.jar:4.1.25.Final]
at com.github.mauricio.async.db.util.ChannelWrapper$.readBinaryLength$extension(ChannelWrapper.scala:52) ~[db-async-common_2.12-0.2.21.jar:0.2.21]
at com.github.mauricio.async.db.mysql.decoder.OkDecoder.decode(OkDecoder.scala:29) ~[mysql-async_2.12-0.2.21.jar:0.2.21]
at com.github.mauricio.async.db.mysql.codec.MySQLFrameDecoder.doDecoding(MySQLFrameDecoder.scala:172) ~[mysql-async_2.12-0.2.21.jar:0.2.21]
at com.github.mauricio.async.db.mysql.codec.MySQLFrameDecoder.handleCommonFlow(MySQLFrameDecoder.scala:157) ~[mysql-async_2.12-0.2.21.jar:0.2.21]
at com.github.mauricio.async.db.mysql.codec.MySQLFrameDecoder.decode(MySQLFrameDecoder.scala:90) ~[mysql-async_2.12-0.2.21.jar:0.2.21]
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489) ~[netty-codec-4.1.25.Final.jar:4.1.25.Final]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428) ~[netty-codec-4.1.25.Final.jar:4.1.25.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) ~[netty-codec-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:582) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461) [netty-transport-4.1.25.Final.jar:4.1.25.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [netty-common-4.1.25.Final.jar:4.1.25.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.25.Final.jar:4.1.25.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]