BoardiesITSolutions / Android-MySQL-Connector

Native MySQL Connector for Android
MIT License
51 stars 15 forks source link

problem in demoapplication, the application closes after establishing the connection and trying to get the resultset #13

Closed Larreineta closed 4 years ago

Larreineta commented 4 years ago

Hello, I have a problem in demoapplication, the application closes after establishing the connection and trying to get the resultset. below the error tracktrace;

2020-02-07 10:31:02.671 30388-30417/com.boardiesitsolutions.demoapplication E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da 2020-02-07 10:31:02.671 30388-30417/com.boardiesitsolutions.demoapplication E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da 2020-02-07 10:31:02.718 30388-30417/com.boardiesitsolutions.demoapplication E/eglCodecCommon: GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1 2020-02-07 10:31:14.051 30388-30420/com.boardiesitsolutions.demoapplication E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3 Process: com.boardiesitsolutions.demoapplication, PID: 30388 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:354) 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:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.IndexOutOfBoundsException at com.BoardiesITSolutions.AndroidMySQLConnector.MySQLIO.shiftCurrentBytePosition(MySQLIO.java:205) at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.processPacketData(COM_QueryResponse.java:88) at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.(COM_QueryResponse.java:23) at com.BoardiesITSolutions.AndroidMySQLConnector.Statement$2.socketDataSent(Statement.java:241) 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:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)

boardy commented 4 years ago

Hi,

Can you give an me a coffee snippet to replicate the item and let me know your MySQL version and Android version and I'll be able to take a look.

Thanks

Chris

On Tue, 11 Feb 2020, 06:23 Larreineta, notifications@github.com wrote:

Hello, I have a problem in demoapplication, the application closes after establishing the connection and trying to get the resultset. below the error tracktrace;

2020-02-07 10:31:02.671 30388-30417/com.boardiesitsolutions.demoapplication E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da 2020-02-07 10:31:02.671 30388-30417/com.boardiesitsolutions.demoapplication E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da 2020-02-07 10:31:02.718 30388-30417/com.boardiesitsolutions.demoapplication E/eglCodecCommon: GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1 2020-02-07 10:31:14.051 30388-30420/com.boardiesitsolutions.demoapplication E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3 https://github.com/BoardiesITSolutions/Android-MySQL-Connector/issues/3 Process: com.boardiesitsolutions.demoapplication, PID: 30388 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:354) 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:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.IndexOutOfBoundsException at com.BoardiesITSolutions.AndroidMySQLConnector.MySQLIO.shiftCurrentBytePosition(MySQLIO.java:205) at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.processPacketData(COM_QueryResponse.java:88) at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.(COM_QueryResponse.java:23) at com.BoardiesITSolutions.AndroidMySQLConnector.Statement$2.socketDataSent(Statement.java:241) 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:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BoardiesITSolutions/Android-MySQL-Connector/issues/13?email_source=notifications&email_token=ABCS2M5CKEKGBYYGQJDHFKDRCI74VA5CNFSM4KS3AYTKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IMOWVMA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCS2M26RSWCOIVW2J3PSJLRCI74VANCNFSM4KS3AYTA .

Larreineta commented 4 years ago

Morning, Thank you very much for your prompt response. I'm using MariaDB 10.4.9, but I have uninstalled Android studio, I will reinstall it now. What version of android do you recommend? I will still run the demo again to give you more information. I take this opportunity to congratulate you on the splendid project you are carrying out by creating this connector. Congratulations.

pd: Sorry for my English.

Larreineta commented 4 years ago

Morning again,

I'm emulating him with api 28.

boardy commented 4 years ago

Hi,

Thanks that's really nice to hear.

Sorry didn't realise you were using the demo app so it should work OK, I wonder if there is some incompatibility currently between MariaDB 10 and the connector.

I'll have a look and let you know, I likely won't be able to check it out until this evening after work though unfortunately.

Thanks

Chris

Larreineta commented 4 years ago

Okay, thank you very much for your attention.

Larreineta commented 4 years ago

good again,

I'm trying out a Hostinger server and it gives me the following exception;

com.BoardiesITSolutions.AndroidMySQLConnector.Exceptions.UnsupportedMySQLServerException: Server Language 0xE0 MySQL Server Version 5.5.0

boardy commented 4 years ago

Hey,

It looks like they are using a charset that I can't support. If possible you'll need to make sure the MySQL server uses utf8 (that's usually the default) and you shouldn't get the server language error anymore.

Thanks Chris

On Tue, 11 Feb 2020, 11:24 Larreineta, notifications@github.com wrote:

good again,

I'm trying out a Hostinger server and it gives me the following exception;

com.BoardiesITSolutions.AndroidMySQLConnector.Exceptions.UnsupportedMySQLServerException: Server Language 0xE0 MySQL Server Version 5.5.0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BoardiesITSolutions/Android-MySQL-Connector/issues/13?email_source=notifications&email_token=ABCS2M5S7HZZCDNNEAQH6ALRCKDHLA5CNFSM4KS3AYTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELMCG2A#issuecomment-584590184, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCS2M7QGHDDVZ6GPMWSHPTRCKDHLANCNFSM4KS3AYTA .

boardy commented 4 years ago

Hi,

I've taken a look at the MariaDB issue you mentioned it does look like there's some incompatibility for some reason which I'm looking into.

Thanks

Chris

boardy commented 4 years ago

Hi,

I've released 0.32_MySQL8 which fixes the issue you had with MariaDB 10.4.

Any issues then please let me know.

Larreineta commented 4 years ago

Thank you very much for your effort, you are very efficient,😁 I have already received the email with the new version. Tomorrow I will try. I am very grateful !!

Larreineta commented 4 years ago

Good morning,

Now DEMOapplication works perfectly in the Android studio VD, but when I create a debug.apk and run it on a Galaxy S8+ with android 9, it doesn't establish the connection, it saves the connection data but doesn't show the message "Connected to database successfully". Then it closes the application when trying to get a line result or add some lines. And it's the same with a tablet with Android 8.1.

Thank you very much in advance.

Larreineta commented 4 years ago

good again,

I'm trying out a Hostinger server and it gives me the following exception;

com.BoardiesITSolutions.AndroidMySQLConnector.Exceptions.UnsupportedMySQLServerException: Server Language 0xE0 MySQL Server Version 5.5.0

In another parallel test, which I'm doing on a Hostinger server, I keep getting the same error and I'm using utf8_unicode_ci.

boardy commented 4 years ago

That's strange. Instead of using the debug have you tried connecting your device to Android studio and run it directly from Android studio instead of side losing an APK.

Not sure that would make a difference if but could you send me the logcat.

Thanks Chris

On Wed, 12 Feb 2020, 05:39 Larreineta, notifications@github.com wrote:

Good morning,

Now DEMOapplication works perfectly in the Android studio VD, but when I create a debug.apk and run it on a Galaxy S8+ with android 9, it doesn't establish the connection, it saves the connection data but doesn't show the message "Connected to database successfully". Then it closes the application when trying to get a line result or add some lines. And it's the same with a tablet with Android 8.1.

Thank you very much in advance.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BoardiesITSolutions/Android-MySQL-Connector/issues/13?email_source=notifications&email_token=ABCS2M4FRJDXZM4T4XMZ74DRCODSJA5CNFSM4KS3AYTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELPP34Q#issuecomment-585039346, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCS2M2XCWKLCKXVHDLQ633RCODSJANCNFSM4KS3AYTA .

Larreineta commented 4 years ago

Well, I just did, and it gives me a hostname problem. I'll talk to my partner to get the IP for access. from my computer if I can access it with the server address in the log. I'll add the log;

"2020-02-12 09:33:55.077 6103-6134/com.boardiesitsolutions.demoapplication E/SocketSender: java.net.UnknownHostException: Unable to resolve host "Ins-celica.pine.local": No address associated with hostname"

On the other hand, do you have any idea about the language problem on another server (Hostinger)?

Sorry for all the molets generated.

boardy commented 4 years ago

Hi,

I've released 0.33_MySQL8 which should hopefully fix the server language problem you were having. I've not been able to test as it seems to pretty difficult to find MySQL 5.5.0 now, that is a very old version.

Older versions tend to use an older version of TLS which I can't support (due to Java removing it for security reasons). It might be worthwhile running the following query on your server: SHOW GLOBAL VARIABLES LIKE 'tls_version';

It should list TLS 1.1, 1.2 or 1.3, if it only has TLS 1.0 then the connector won't work on this version of MySQL and there won't be anything I can do about that unfortunately.

Thanks

Chris

Larreineta commented 4 years ago

Thank you very much for all the effort you've made. the hostinger server version is:

MySQL server version: 5.5.5-10.2.30-MariaDB

So it's complicated...

Thank you very much for your attention !!

boardy commented 4 years ago

No problem. Are you still having the issue with the hostinger is it the same issue saying it's unsupported.

If so Would it be possible for you create me a login to a test DB and I can try connecting and see what's going on?

Thanks Chris

On Fri, 14 Feb 2020, 07:46 Larreineta, notifications@github.com wrote:

Thank you very much for all the effort you've made. the hostinger server version is:

MySQL server version: 5.5.5-10.2.30-MariaDB

So it's complicated...

Thank you very much for your attention !!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BoardiesITSolutions/Android-MySQL-Connector/issues/13?email_source=notifications&email_token=ABCS2M5SPYESEPWS7KUDZVLRCZD5PA5CNFSM4KS3AYTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELX4IHY#issuecomment-586138655, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCS2MZBOHO7EOWOPKCFT4LRCZD5PANCNFSM4KS3AYTA .

Larreineta commented 4 years ago

Morning Chris,

I just sent you an email to the account " support@boardiesitsolutions.com" with the connection data.

Thank you very much!

boardy commented 4 years ago

Thank you. Got the login details.

I'll have a look tonight after work and let you know.

Thanks Chris

On Fri, 14 Feb 2020, 08:44 Larreineta, notifications@github.com wrote:

Morning Chris,

I just sent you an email to the account " support@boardiesitsolutions.com" with the connection data.

Thank you very much!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BoardiesITSolutions/Android-MySQL-Connector/issues/13?email_source=notifications&email_token=ABCS2M2CHBF2AQQ3L2733XTRCZKVNA5CNFSM4KS3AYTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELYAZZQ#issuecomment-586157286, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCS2M5XGQN6AXB2F6E2UR3RCZKVNANCNFSM4KS3AYTA .

boardy commented 4 years ago

Hi,

Thanks for the credentials to your DB. I think I screwed up the previous release unfortunately so it lost my change for the server language to fix what Hostinger use. Sorry about that.

I've created release 0.34_MySQL8 which appears to work OK with your DB now.

Let me know how you get on.

Thanks

Chris

Larreineta commented 4 years ago

Thanks a lot! Tomorrow I try it and I tell you.

Larreineta commented 4 years ago

Morning, Chris, I've already tried it and it works well, thank you very much. The only thing, that the result gives "java.lang.ArrayIndexOutOfBoundsException: length=4380; index=4380" when I exceed 500 records.

Larreineta commented 4 years ago

log:

Caused by: java.lang.ArrayIndexOutOfBoundsException: length=4380; index=4380 at com.BoardiesITSolutions.AndroidMySQLConnector.MySQLIO.getLenEncodedInt(MySQLIO.java:242) at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.processPacketData(COM_QueryResponse.java:100) at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.(COM_QueryResponse.java:23) at com.BoardiesITSolutions.AndroidMySQLConnector.Statement$2.socketDataSent(Statement.java:241) at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:53) at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:11)

boardy commented 4 years ago

Hey,

That's good news, we're getting somewhere :).

I'll take a look tonight as to why 500+ records causes a problem and let you know.

Thanks

boardy commented 4 years ago

Hey,

I've identified an issue, which seems to be similar to your's but just want to double check I haven't found something else on top of your issue.

Does it fail for you everytime you fetch 500+ results, or does it sometimes work?

When I've tested myself, I have around 2000 records in a DB and it returns them OK the first time, then its a bit hit and miss on the second time, sometimes it works and then fails on the 3rd time and sometimes fails on the 2nd time getting the same data. So that's a bit odd, is that what you are seeing as well?

Thanks

Chris

Larreineta commented 4 years ago

Hello, It has failed me at the first, but tomorrow I will test to give you a more specific answer. thank you very much for your efforts.

boardy commented 4 years ago

Hmmm, that's strange, maybe there's two separate issues going on. It seems like the issue I found is some sort of timing issue.

It might be useful to know what kind of table it is, e.g. number of columns, type of data in each column etc.

Thanks

Chris

Larreineta commented 4 years ago

First I tried a table with about 20 fields. but seeing the problem, I reduced it to only two fields, an integer id and a String. But it also failed me.

boardy commented 4 years ago

That's the same i'm using an is field as an int and field string.

What device are you testing on, is it the emulator, if so can you let me know how much ram it has. If you're testing on a device if you can let me know the name and model I should be able to find the spec and replicate it as much as I can in an emulator.

Just wondering whether you're specific problem is device memory related.

Thanks

Chris

On Mon, 17 Feb 2020, 18:39 Larreineta, notifications@github.com wrote:

First I tried a table with about 20 fields. but seeing the problem, I reduced it to only two fields, an integer id and a String. But it also failed me.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BoardiesITSolutions/Android-MySQL-Connector/issues/13?email_source=notifications&email_token=ABCS2M3NR4CCH3L3CPOBBCLRDLKULA5CNFSM4KS3AYTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL7K4SY#issuecomment-587116107, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCS2MYEYH5B67BPNJSW5KLRDLKULANCNFSM4KS3AYTA .

Larreineta commented 4 years ago

Morning, Chris,

I have been emulating with the Pixel 2 api28 model with 1.5GB memory. I have tried with a new 4GB Ram device and it also gives me error. Then on my mobile phone, a Samsung Galaxy S8+, and it also gives me error.

The maximum number of records I've ever had is 600.

boardy commented 4 years ago

Hmm OK. Leave it with me and I'll see what I can figure out. I have a feeling it might not be a quick fix unfortunately like the other little issues you found but I'll keep you updated.

Thanks

Chris

Larreineta commented 4 years ago

OK! Don't worry, you've done too much!!, take it easy. Thank you!!

boardy commented 4 years ago

Hi. Just to let you know I haven't forgotten, I'm still looking into it.

Its proving to be a bit tricky to track down unfortunately. Sometimes it works fine without any issues, sometimes it'll crash because the response data I got from MySQL is 2 bytes shorter than I expected, and sometimes it'll crash because the response data I got from MySQL is 100 bytes shorter than I expected, so its a tad intermittent.

Thanks Chris

Larreineta commented 4 years ago

okay! Quiet, thank you very much for your work!

boardy commented 4 years ago

Hi, I think I've finally got there.

I've pushed tag 0.36_MySQL8. Looks to be working OK now, I've tested with 3000 records in the DB and they all got returned without any issues, so fingers crossed :).

Sorry for the delay in getting this resolved.

Let me know how you get on.

Thanks

Chris

cuplesoft commented 4 years ago

Hi,

I have error after SELECT and no results in table:

Caused by: java.lang.IndexOutOfBoundsException at com.BoardiesITSolutions.AndroidMySQLConnector.MySQLIO.shiftCurrentBytePosition(MySQLIO.java:317) at com.BoardiesITSolutions.AndroidMySQLConnector.MySQLIO.getLenEncodedInt(MySQLIO.java:388) at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.processPacketData(COM_QueryResponse.java:177) at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.<init>(COM_QueryResponse.java:28) at com.BoardiesITSolutions.AndroidMySQLConnector.Statement$2.socketDataSent(Statement.java:227) at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:56) at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:12)

boardy commented 4 years ago

Hi. What tag version are you using as this been fixed in 0.36_MySQL8. If your having trouble with this particular version can you raise this as a new version and let me know your MySQL version.

cuplesoft commented 4 years ago

My MySQL version is 10.4.7-MariaDB and i using latest version 0.36_MySQL8. If SELECT statement expect one or more records - everything is ok, but if result is empty then i have exception as above.

boardy commented 4 years ago

Ah OK, that's strange, can you raise this as a new issue though please as this isn't related to this particular issue.

boardy commented 4 years ago

Hi Larreineta,

Just to let you know that 0.37_MySQL8 has been pushed which fixes the issue above with the empty resultset.

Thanks

Chris

Larreineta commented 4 years ago

thanks!

I had not been given the case of a result without records. But now I won't have that problem, jeje otherwise it works very well. Thank you very much for your effort!!

boardy commented 4 years ago

No problem, glad your other problem is sorted now too.

Thanks Chris