Closed Aboshxm2 closed 1 year ago
@JavierLeon9966 linked commit is yours, can you have a look?
I debugged it and it looks like it does fetch the result correctly and it says it has called the callback but the callback does nothing until the next query
Ok, so when var dumping the $handler
it dumped a correct Closure
object but then it crashed when calling it because it says it is null
@JavierLeon9966 any update?
It just seems like a PHP (or pthreads) bug to me. The callback is being called but not executed until the next callback gets called, and forget the previous test, I tested it wrong
So then, should the commit be reverted to atleast get back to a working state? It causes problems that callbacks are not called at the right time
You can use the build before that commit, but this should be left so we don't forget about it and eventually be fixed
You can use the build before that commit, but this should be left so we don't forget about it and eventually be fixed
Any movement on this? Since using an earlier version won't be an option anymore if the support for PHP 8.0 will be dropped soon and the commit dc8c284171ef2fff82ac78e8650ebe22f545dec6 that made the plugin work with PHP 8.1+ was only made after the talked about change.
Here is an update about the situation: https://github.com/poggit/libasynql/pull/92 and it is also fixed in the PM5 port
Describe the bug When you call any libasynql function, let's say
executeSelect
, theonSelect
function will never executed until another libasynql function called. and the second libasynql function well never get it's results until another function is called...Something I noticed is that the bug does not exist in older versions. (before DEV-182 https://github.com/poggit/libasynql/commit/f0d668c9699824bb8d2433421c2401d385099a45)
Sample code https://github.com/Aboshxm2/libasyncql_query_bug
sqlite.sql
Main.php
Expected behavior When I do
/test insert player1 10
, It should display "insert query executed successfully." in the console. but it doesn't. until I send another command/test insert player2 10
Tests 1:
/test insert player1 10
. resaults: nothing.2:
/test insert player1 10
then/test select player1
. resaults:3:
/test insert player1 10
then/test select player1
then/test select player2
resaults:4:
/test insert player1 10
then/test select player2
then/test select player1
resaults:Environment OS: linux PocketMine version: 4.12.2 PHP version: 8.0.17
I am sorry if there any misspelling. English is not my main language.