SphereServer BugTracker - SphereServer
View Issue Details
0001743SphereServerexecutable - genericpublic03-05-10 14:2323-08-10 21:58
Marlek 
 
normalminoralways
closedunable to reproduce 
0.56c Nightly 
 
Not Available
None
None
0001743: AExecute not working for SQL Inserts
AExecute isn't working for SQL Inserts.
Sphere Version is nightly r1272, only the NetworkOutThread Flag is activated.

No Problem with:
DB.EXECUTE "INSERT INTO skari_pagesys ('ident') VALUES ('0400dd813');"

Using the following Helper functions:
[FUNCTION f_execute_mysql]
IF (<DB.AEXECUTE f_execute_callback, <ARGV[0]>> == 0)
    SERV.LOG Failed to queque async Database command.
ELSE
    SERV.LOG Quequed async Database command.
ENDIF
RETURN

[FUNCTION f_execute_callback]
IF (<ARGN2> == 0)
    SERV.LOG Async Database action failed:
    SERV.LOG <ARGS>
ELSE
    SERV.LOG Async Database action succeeded:
    SERV.LOG <ARGS>
ENDIF
RETURN

And doing:
f_execute_mysql "INSERT INTO skari_pagesys ('ident') VALUES ('0400dd813');"

Will result in:
14:16:(functions.scp,6)Quequed async Database command.
14:16:(functions.scp,12)Async Database action failed:
14:16:(functions.scp,13)INSERT INTO skari_pagesys ('ident') VALUES ('0400dd813');
Nothing will be added to Database.

Doing:
f_execute_mysql "DELETE FROM skari_pagesys WHERE ident = '0400dd813';"

Will result in:
13:50:CRITICAL:Exception, in AsyncDatabaseHelper::tick
But it will be removed correctly from Database.
No tags attached.
Issue History
03-05-10 14:23MarlekNew Issue
03-05-10 14:23MarlekNightly Version => Not Available
03-05-10 14:23MarlekExperimental Flags => None
03-05-10 14:23MarlekOption Flags => None
03-05-10 14:26MarlekNote Added: 0000459
03-05-10 14:27MarlekIssue Monitored: Marlek
03-05-10 20:58MrSugarCubeStatusnew => closed
03-05-10 20:58MrSugarCubeNote Added: 0000460
03-05-10 20:58MrSugarCubeResolutionopen => unable to reproduce
03-05-10 21:39MarlekStatusclosed => feedback
03-05-10 21:39MarlekResolutionunable to reproduce => reopened
03-05-10 21:39MarlekNote Added: 0000461
03-05-10 21:43MarlekNote Edited: 0000461
03-05-10 21:49MarlekNote Edited: 0000461
03-05-10 22:01IncanusIssue Monitored: Incanus
15-05-10 17:58MrSugarCubeNote Added: 0000469
23-08-10 21:58MrSugarCubeStatusfeedback => closed
23-08-10 21:58MrSugarCubeNote Added: 0000590
23-08-10 21:58MrSugarCubeResolutionreopened => unable to reproduce

Notes
(0000459)
Marlek   
03-05-10 14:26   
The data was manually added to database to test the "DELETE FROM..." it was not added though AEXECUTE.
(0000460)
MrSugarCube   
03-05-10 20:58   
I can't seem to reproduce the problem here. I used the following script:

[FUNCTION f_testexecute]
LOCAL.X = <R1,10000>
F_EXECUTE_MYSQL "INSERT INTO test.testdata (`col1`) VALUES ('<dLOCAL.X>');"
F_EXECUTE_MYSQL "DELETE FROM test.testdata WHERE col1 = '<dLOCAL.X>';"
RETURN


and received the following output:
19:53:(test_scripts.scp,630)Quequed async Database command.
19:53:(test_scripts.scp,630)Quequed async Database command.
19:53:(test_scripts.scp,639)Async Database action succeeded:
19:53:(test_scripts.scp,640)INSERT INTO test.testdata (`col1`) VALUES ('5961')
19:53:(test_scripts.scp,639)Async Database action succeeded:
19:53:(test_scripts.scp,640)DELETE FROM test.testdata WHERE col1 = '5961'
(0000461)
Marlek   
03-05-10 21:39   
(edited on: 03-05-10 21:49)
Which sphere rev/OS are you using?
Do i need to activate some settings/experimental flags?
Our database server is another physical machine than our game system...?

Still doesnt work with your function, while DB.EXECUTE works fine:
21:42:(database_functions.scp,11)Quequed async Database command.
21:42:(database_functions.scp,11)Quequed async Database command.
21:42:32:'technik' commands 'f_testexecute'=1
21:42:(database_functions.scp,17)Async Database action failed:
21:42:(database_functions.scp,18)INSERT INTO skariatain_net.test (`col1`) VALUES ('7597');
21:42:(database_functions.scp,17)Async Database action failed:
21:42:(database_functions.scp,18)DELETE FROM skariatain_net.test WHERE col1 = '7597';

(0000469)
MrSugarCube   
15-05-10 17:58   
I've tested it with #1269, #1278, and #1280, on both Windows XP (SP3) and
Ubuntu (8.04). The database server (MySQL 5.0.24a) is on the same physical machine for me (although the linux build was running on a VM, to simulate a remote connection).

There aren't any flags you need to enable, the only relevant settings are the MySQL settings (make sure you have connected using DB.CONNECT, check with <DB.CONNECTED>)
(0000590)
MrSugarCube   
23-08-10 21:58   
I've tested some more and cannot reproduce the issue.

The only way that I can produce the same log output is if the database hasn't been connected to (via DB.CONNECT).