Skip to content

Allow version parsing for mariadb 11 and above#1344

Merged
BillyYccc merged 1 commit intoeclipse-vertx:masterfrom
zyclonite:mariadb_version_11_and_up
Aug 20, 2023
Merged

Allow version parsing for mariadb 11 and above#1344
BillyYccc merged 1 commit intoeclipse-vertx:masterfrom
zyclonite:mariadb_version_11_and_up

Conversation

@zyclonite
Copy link
Copy Markdown
Contributor

Motivation:

Since using mariadb version 11.0.2 i always get parsing exceptions copied below
This commit keeps the old parsing intact but falls back to a method similar to mysql if the mariadb version does not have the 5.5.5- prefix

WARN  i.v.m.i.MySQLDatabaseMetadata [vert.x-eventloop-thread-3] - Incorrect parsing server version tokens
java.lang.NumberFormatException: For input string: ""
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:675)
	at java.base/java.lang.Integer.parseInt(Integer.java:781)
	at io.vertx.mysqlclient.impl.MySQLDatabaseMetadata.parse(MySQLDatabaseMetadata.java:57)
	at io.vertx.mysqlclient.impl.codec.InitialHandshakeCommandCodec.handleInitialHandshake(InitialHandshakeCommandCodec.java:74)
	at io.vertx.mysqlclient.impl.codec.InitialHandshakeCommandCodec.decodePayload(InitialHandshakeCommandCodec.java:59)
	at io.vertx.mysqlclient.impl.codec.MySQLDecoder.decodePackets(MySQLDecoder.java:72)
	at io.vertx.mysqlclient.impl.codec.MySQLDecoder.channelRead(MySQLDecoder.java:48)
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1623)

Signed-off-by: Lukas Prettenthaler <rdx@wsn.at>
@BillyYccc BillyYccc added this to the 5.0.0 milestone Aug 17, 2023
@BillyYccc
Copy link
Copy Markdown
Member

can you also make a PR to backport this feature to 4.x branch?

@zyclonite
Copy link
Copy Markdown
Contributor Author

sure, see referenced pr

@BillyYccc BillyYccc merged commit 0f83e41 into eclipse-vertx:master Aug 20, 2023
@BillyYccc
Copy link
Copy Markdown
Member

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants