8000 [mysql] exception on selecting with 10 columns · Issue #80 · mauricio/postgresql-async · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
[mysql] exception on selecting with 10 columns #80
Closed
@solar

Description

@solar

mysql-async 0.2.11 with mariadb 10.0.7 on centos 6.5

create table test_10 (
    id int primary key not null,
    c2 text not null, c3 text not null, c4 text not null,
    c5 text not null, c6 text not null, c7 text not null,
    c8 text not null, c9 text not null, c10 text not null
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

create table test_9 (
    id int primary key not null,
    c2 text not null, c3 text not null, c4 text not null,
    c5 text not null, c6 text not null, c7 text not null,
    c8 text not null, c9 text not null
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

create table test_11 (
    id int primary key not null,
    c2 text not null, c3 text not null, c4 text not null,
    c5 text not null, c6 text not null, c7 text not null,
    c8 text not null, c9 text not null, c10 text not null,
    c11 text not null
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
val con = new MySQLConnection(new Configuration(...))
Await.ready(con.connect, 3.seconds)

def test(query: String) {
  println(Await.result(con.sendQuery(query), 3.seconds))
}

// ok
test("select * from test_9")
test("select * from test_11")
test("select id, c2 from test_10")

// ng
test("select * from test_10")
// or test("select id, c2, c3, c4, c5, c6, c7, c8, c9, c10 from test_11")
output:
QueryResult{rows -> 0,status -> null}
QueryResult{rows -> 0,status -> null}
QueryResult{rows -> 0,status -> null}
[error] (run-main-1) java.lang.IndexOutOfBoundsException: readerIndex(1) + length(1) exceeds writerIndex(1): SlicedByteBuf(ridx: 1, widx: 1, cap: 1/1, unwrapped: UnpooledUnsafeDirectByteBuf(ridx: 5, widx: 585, cap: 8192))
java.lang.IndexOutOfBoundsException: readerIndex(1) + length(1) exceeds writerIndex(1): SlicedByteBuf(ridx: 1, widx: 1, cap: 1/1, unwrapped: UnpooledUnsafeDirectByteBuf(ridx: 5, widx: 585, cap: 8192))
        at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1161)
        at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:563)
        at io.netty.buffer.SwappedByteBuf.readByte(SwappedByteBuf.java:435)
        at com.github.mauricio.async.db.util.ByteBufferUtils$.readCString(ByteBufferUtils.scala:53)
        at com.github.mauricio.async.db.mysql.decoder.HandshakeV10Decoder.decode(HandshakeV10Decoder.scala:37)
        at com.github.mauricio.async.db.mysql.codec.MySQLFrameDecoder.decode(MySQLFrameDecoder.scala:147)
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:139)
        at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338)
        at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
        at java.lang.Thread.run(Thread.java:744)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0