AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SQL_MakeDbTuple Timeout parameter not respected (https://forums.alliedmods.net/showthread.php?t=319473)

^SmileY 11-02-2019 20:00

SQL_MakeDbTuple Timeout parameter not respected
 
Hi, i'm having troubles with SQL_MakeDbTuple function:

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <sqlx>

new Handle:g_SqlTuple;
new 
Handle:g_SqlConnection;

public 
plugin_init()
{
    
register_plugin("Sqlx test",AMXX_VERSION_STR,"SmileY");
    
    
g_SqlTuple SQL_MakeDbTuple("google.com","root","","test",1); // Any address to test it
    
    
if(g_SqlTuple != Empty_Handle)
    {
        new 
ErrorCode,Error[32];
        
g_SqlConnection SQL_Connect(g_SqlTuple,ErrorCode,Error,charsmax(Error));
        
        if(
g_SqlConnection == Empty_Handle)
        {
            
set_fail_state("[%i] %s",ErrorCode,Error);
        }
    }
}

public 
plugin_end()
{
    
SQL_FreeHandle(g_SqlTuple);
    
SQL_FreeHandle(g_SqlConnection);


This code try to connect to a remote mysql host (In this case with a wrong address to test it!)
The server just do not respect timeout parameter (It respect only from core.ini).

In this test code the server will wait 60 seconds from mysql_timeout (at core.ini), not just 1 second from SQL_MakeDbTuple.

Ps. All crap from console (It is a local test)

Code:

] meta list
Currently loaded plugins:
      description      stat pend  file              vers      src  load  unlod
 [ 1] AMX Mod X        RUN  -    amxmodx_mm.dll    v1.9.0.5  ini  Start ANY 
 [ 2] CStrike          RUN  -    cstrike_amxx.dll  v1.9.0.5  pl1  ANY  ANY 
 [ 3] Ham Sandwich    RUN  -    hamsandwich_amxx  v1.9.0.5  pl1  ANY  ANY 
 [ 4] FakeMeta        RUN  -    fakemeta_amxx.dl  v1.9.0.5  pl1  ANY  ANY 
 [ 5] CSX              RUN  -    csx_amxx.dll      v1.9.0.5  pl1  ANY  ANY 
 [ 6] MySQL            RUN  -    mysql_amxx.dll    v1.9.0.5  pl1  ANY  ANY 
6 plugins, 6 running
] amxx plugins
Currently loaded plugins:
      name                    version    author            file            status 
 [  1] Pug Mod (Anti Flood)    1.9.0.5263  AMXX Dev Team    PugFlood.amxx    running 
 [  2] Pug Mod (Core)          3.0.2      SmileY            PugCore.amxx    running 
 [  3] Pug Mod (Config System  3.0.2      SmileY            PugConfigs.amxx  running 
 [  4] Pug Mod (Menus System)  3.0.2      SmileY            PugMenus.amxx    running 
 [  5] Pug Mod (Ready System)  3.0.2      SmileY            PugReady.amxx    running 
 [  6] Pug Mod (LO3)          3.0.2      SmileY            PugLO3.amxx      running 
 [  7] Pug Mod (Aux)          3.0.2      SmileY            PugAux.amxx      running 
 [  8] Pug Mod (Warmup)        3.0.2      SmileY            PugWarmup.amxx  running 
 [  9] Pug Mod (Manager)      1.9.0.5263  SmileY            PugAdmin.amxx    running 
 [ 10] Pug Mod (Stats)        3.0.2      SmileY            PugStats.amxx    debug   
 [ 11] Logs Parser            1.9.0.5263  SmileY            File.amxx        error   
( 11) Error: [2003] Can't connect to MySQL server o
11 plugins, 10 running
] amxx version
AMX Mod X 1.9.0.5263 (http://www.amxmodx.org)
Authors:
        David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
        Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
        Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
        Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Oct 27 2019 16:23:56
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0a
Build ID: 5263:15a14a0a
Core mode: JIT+ASM32
] meta list
Currently loaded plugins:
      description      stat pend  file              vers      src  load  unlod
 [ 1] AMX Mod X        RUN  -    amxmodx_mm.dll    v1.9.0.5  ini  Start ANY 
 [ 2] CStrike          RUN  -    cstrike_amxx.dll  v1.9.0.5  pl1  ANY  ANY 
 [ 3] Ham Sandwich    RUN  -    hamsandwich_amxx  v1.9.0.5  pl1  ANY  ANY 
 [ 4] FakeMeta        RUN  -    fakemeta_amxx.dl  v1.9.0.5  pl1  ANY  ANY 
 [ 5] CSX              RUN  -    csx_amxx.dll      v1.9.0.5  pl1  ANY  ANY 
 [ 6] MySQL            RUN  -    mysql_amxx.dll    v1.9.0.5  pl1  ANY  ANY 
6 plugins, 6 running


Natsheh 11-03-2019 01:40

Re: SQL_MakeDbTuple Timeout parameter not respected
 
What? timeout will work when a connection got established its length of a connection, during that time you can do some queries.0

Edit: this is actually wrong time out is the time until the server stop trying to connect to the DB, it connection cant be reached.

^SmileY 11-03-2019 13:57

Re: SQL_MakeDbTuple Timeout parameter not respected
 
Quote:

Originally Posted by Natsheh (Post 2671799)
What? timeout will work when a connection got established its length of a connection, during that time you can do some queries.

so why server get's freeze at SQL_Connect? It is a bug or something?


All times are GMT -4. The time now is 02:45.

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