Describe the bug
Some MySQL versions have text in the version number. When the connector parses the version number
it causes an exception as the number parsing fails with a NumberFormatException
To Reproduce
Steps to reproduce the behavior:
Connect to a database where the version number also contains text. E.g. 5.7.22-log
Expected behavior
Version should be parsed, any non numeric character (except for dots (.) should be removed.
Logcat
06-18 10:27:19.835 13257-13298/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.BoardiesITSolutions.MysqlManager, PID: 13257
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.NumberFormatException: For input string: "22-log"
at java.lang.Integer.parseInt(Integer.java:608)
at java.lang.Integer.parseInt(Integer.java:643)
at com.BoardiesITSolutions.AndroidMySQLConnector.Connection.parseVersionNumber(Connection.java:799)
at com.BoardiesITSolutions.AndroidMySQLConnector.Connection.processWelcomePacket(Connection.java:321)
at com.BoardiesITSolutions.AndroidMySQLConnector.Connection.access$000(Connection.java:37)
at com.BoardiesITSolutions.AndroidMySQLConnector.Connection$1.socketDataSent(Connection.java:283)
at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:53)
at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:11)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Desktop (please complete the following information):
Describe the bug Some MySQL versions have text in the version number. When the connector parses the version number it causes an exception as the number parsing fails with a NumberFormatException
To Reproduce Steps to reproduce the behavior: Connect to a database where the version number also contains text. E.g. 5.7.22-log
Expected behavior Version should be parsed, any non numeric character (except for dots (.) should be removed.
Logcat
Desktop (please complete the following information):