Strange results when using SELECT in a function #5
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Limework/skript-db#5
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I get
<none>
on the first run and the correct value on the second run of my script, which is very strange. Maybe you can tell me what's happening here.A broadcast within the function will always display the correct value on the first run.
With first run and second run I mean entering the command "/test".
Versions:
The script:
Table Structure (Screenshot):
https://i.imgur.com/p9Vh15W.png
How can this happen? How to fix?
it is because you cannot use delayed effects in return functions, execute is delayed
Why execution is delayed here?
Thank you for your quick reply.
Same question:
it is delayed to not lag the server, the queries are ran on separate thread
in future version I will make "synchronous execute" to also be asynchronous, but converting the current code to async, thus avoiding delay, so maybe that'll be able to solve the issue partially
So that means for now I am unable to use return values that come from SELECT statements in a skript function?
yes, that's the case with all similar add-ons, a workaround is skript-reflect's delayed effect
And what about this situation:
Can it happen that when I send two EXECUTE commands one right after the other, the result of the second event is not displayed correctly to me?
Example:
Could the SELECT result then be empty the first time because the INSERT INTO wasn't fast enough for the SELECT to receive the new value?
Regarding skript-reflect's delayed effect: it may be inconsistent as well, or not? Because you never know how long to wait?
it should be consistent and shouldn't have any issues, mysql should handle it well
you know how long to wait, wait until a value is returned (which is when the code continues after EXECUTE)
Could you by any chance post an example of such a skript-reflect "delay" syntax?
sadly I do not have an example, but if I remember correctly, you just type:
delay the effect
or something like thatI am closing this issue as this is intended and not a bug