AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Can Someone Reproduce this SQL issue?? (https://forums.alliedmods.net/showthread.php?t=298636)

scorpius2k1 06-18-2017 13:21

Can Someone Reproduce this SQL issue??
 
Edit: after further discussion on SourcePawn's GitHub, this is actually a compiler bug.
https://github.com/alliedmodders/sourcepawn/issues/122

...

I am using the latest SourceMod, Linux Server, Half-Life 2: DM. I am simply trying to create a database, and it does, but for some reason, if I use a timer, and then call StrEqual...it makes a SECOND empty database with whatever name is in the first field of "StrEqual"

Here is an image from FTP showing the two files being made:
http://imgur.com/GFSrYC2l.png

The code below will reproduce it...

PHP Code:

#include <sourcemod>

new Handle:g_hDB INVALID_HANDLE;

public 
OnPluginStart()
{
    
InitDB();
    
CreateTimer(3.0wtf_is_going_on);
}

stock Action:wtf_is_going_on(Handle:timer)
{
    if(
StrEqual("it_makes_an_empty_database_with_whatever_is_here""")) {}
}

stock InitDB()
{
    new 
String:error[255];
    
g_hDB SQLite_UseDatabase("my_database"errorsizeof(error));



Miu 06-18-2017 13:51

Re: Can Someone Reproduce this SQL issue??
 
cba to start a server and try running that, but I compiled it with spcomp 1.8.0.5967 and then fed that to Lysis, and it gives me back https://pastebin.com/raw/Ti5CwMq0, which is pretty funny. not sure what went wrong there, but you should def file a bug on the issues page.

scorpius2k1 06-18-2017 15:14

Re: Can Someone Reproduce this SQL issue??
 
Quote:

Originally Posted by Miu (Post 2529668)
cba to start a server and try running that, but I compiled it with spcomp 1.8.0.5967 and then fed that to Lysis, and it gives me back https://pastebin.com/raw/Ti5CwMq0, which is pretty funny. not sure what went wrong there, but you should def file a bug on the issues page.

Thank you for verifying it wasn't just my end, appreciate it! I did as suggested and submitted and issue report on the SM GitHub

https://github.com/alliedmodders/sourcepawn/issues/122

Hopefully some light will be shed on this very strange problem :bacon!::bacon!:

scorpius2k1 06-18-2017 19:45

Re: Can Someone Reproduce this SQL issue??
 
Issue is solved.

simply needed to change the timer from a stock action to a public action

:3

PHP Code:

public Action:wtf_is_going_on(Handle:timer

    if(
StrEqual("it_makes_an_empty_database_with_whatever_is_here""")) {} 



Very weird that it would cause that kind of an "issue", but that fixed it perfectly


Edit: after further discussion on SourcePawn's GitHub, this is actually a compiler bug.
https://github.com/alliedmodders/sourcepawn/issues/122

.


All times are GMT -4. The time now is 12:58.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.