Giter Site home page Giter Site logo

sqlitei's Introduction

SQLite-Improved

High-level API for the SA-MP SQLite functions.

sqlitei's People

Contributors

jessyy avatar oscar-broman avatar pt-player avatar southclaws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sqlitei's Issues

bug

atement=@0d47f940 0, iParam=0, DBDataType:iType=5, ... <2 arguments>) at C:\Documents and Settings\Administrador\Desktop\1655\pawno\include\sqlitei.inc:1323
[12:59:38] [debug] #2 00121998 in LoadAccount (playerid=0) at sss/core/player/accounts.pwn:209
[12:59:38] [debug] #3 000bf498 in LoadAccountDelay (playerid=0) at sss/core/player/core.pwn:162
[12:59:38] [debug] #4 000bf330 in public @yj:LoadAccountDelay@_yT (__r=0, playerid=0) at sss/core/player/core.pwn:148
[12:59:38] [LoadAccount] fetching statement result 'stmt_AccountExists'.
[12:59:38] [debug] AMX backtrace:
[12:59:38] [debug] #0 native PrintAmxBacktrace () from crashdetect.so
[12:59:38] [debug] #1 0009ee20 in err (text[]=@0d481624 "[LoadAccount] fetching statement result 'stmt_AccountExists'.") at sss/utils/logging.pwn:108
[12:59:38] [debug] #2 00121aa8 in LoadAccount (playerid=0) at sss/core/player/accounts.pwn:221
[12:59:38] [debug] #3 000bf498 in LoadAccountDelay (playerid=0) at sss/core/player/core.pwn:162
[12:59:38] [debug] #4 000bf330 in public @yj:LoadAccountDelay@_yT (__r=0, playerid=0) at sss/core/player/core.pwn:148
[12:59:38] [PART] [MsA]Kolor4dO (kick: Account load failed)
[12:59:39] INFO: [OnPlayerDisconnect] Removing session data file for [MsA]Kolor4dO
[12:59:39] [LOGOUT] [MsA]Kolor4dO not logged in.

stmt_fetch_row

Here, have a dump:

[09/10/2014 00:14:00] [debug] #0 00020c4c in bool:stmt_fetch_row (&DBStatement:stStatement=@0x0cbab3d8) at E:\Games\Projects\SA-MP\pawno\include\sqlitei.inc:1780
[09/10/2014 00:14:00] [debug] #1 00143c4c in CreateNewSprayTag (Float:x=1118.51099, Float:y=-1540.14001, Float:z=23.66000, Float:rx=0.00000, Float:ry=0.00000, Float:rz=178.46001) at E:\Games\Projects\SA-MP\ScavengeSurvive\gamemodes\SS/Core/World/SprayTag.pwn:148
[09/10/2014 00:14:00] [debug] #2 001a3294 in ?? () at E:\Games\Projects\SA-MP\ScavengeSurvive\gamemodes\ss/World/Zones/LS.pwn:39
[09/10/2014 00:14:00] [debug] #3 0000f21c in public Itter_OnGameModeInit () at E:\Games\Projects\SA-MP\pawno\include\YSI\y_hooks/impl.inc:484
[09/10/2014 00:14:00] [debug] #4 native CallLocalFunction () from samp03svr
[09/10/2014 00:14:00] [debug] #5 0000b338 in public ScriptInit_OnGameModeInit () at E:\Games\Projects\SA-MP\pawno\include\YSI\y_iterate.inc:791
[09/10/2014 00:14:00] [debug] #6 0000735c in public SSCANF_OnGameModeInit () at E:\Games\Projects\SA-MP\pawno\include\YSI\internal..\y_scriptinit.inc:171
[09/10/2014 00:14:00] [debug] #7 00000a08 in public main_OnGameModeInit () at E:\Games\Projects\SA-MP\pawno\include\sscanf2.inc:174
[09/10/2014 00:14:00] [debug] #8 000008dc in public OnGameModeInit () at E:\Games\Projects\SA-MP\ScavengeSurvive\gamemodes\ScavengeSurvive.pwn:76
[09/10/2014 00:14:00] [debug] Native backtrace:
[09/10/2014 00:14:00] [debug] #0 b74b693b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #1 b74af68f in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #2 b74b085c in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #3 b74b0ca6 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #4 b74b658c in ?? () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #5 b77de600 in ?? ()
[09/10/2014 00:14:00] [debug] #6 b74b816c in amx_Exec () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #7 b74b1656 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #8 b74b50f9 in ?? () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #9 b73ff173 in ?? () from plugins/streamer.so
[09/10/2014 00:14:00] [debug] #10 080dc202 in ?? () from ./samp03svr
[09/10/2014 00:14:00] [debug] #11 08093d84 in ?? () from ./samp03svr
[09/10/2014 00:14:00] [debug] #12 b73ff0b5 in ?? () from plugins/streamer.so
[09/10/2014 00:14:00] [debug] #13 b74b239e in ZN11CrashDetect13DoAmxCallbackEiPiS0 () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #14 b74b5398 in ?? () from plugins/crashdetect.so
[09/10/2014 00:14:00] [debug] #15 b74b8cb5 in amx_Exec () from plugins/crashdetect.so

Update query

Hi. I can not understand why the update request is not running.
Code:
new DBStatement:stmt = db_prepare(connection_db, "UPDATE users SET ``ip_last_entery= ? \ WHEREuser_name` = ?");`
`
stmt_bind_value(stmt, 0, DB::TYPE_STRING, player_info[playerid][pIP]);
stmt_bind_value(stmt, 1, DB::TYPE_STRING, player_info[playerid][pName]);
stmt_execute(stmt);
stmt_close(stmt); `
`
Debug:
`[21:45:42] SQLitei Debug: (db_prepare=0) Preparing statement with 2 params: UPDATE `users` SET `ip_last_entery` = ?, WHERE `user_name` = ?
[21:45:42] SQLitei Debug: (stmt_bind_value:0) Inserted new value for parameter 0 at 38: '127.0.0.1'
[21:45:42] SQLitei Debug: (stmt_bind_value:0) Inserted new value for parameter 1 at 71: 'continue'
[21:45:42] SQLitei Debug: (stmt_execute:0) Executing statement.
[21:45:42] SQLitei Debug: (db_query) Running query: UPDATE `users` SET `ip_last_entery` = '127.0.0.1', WHERE `user_name` = 'continue'
[21:45:42] SQLitei Debug: (stmt_close:0) Closed statement. `
The request is correct. Without syntax errors (it is executed in SQLite). But through SA-MP (SQLitei) does not work. I will be very happy if you tell me what the problem is

Crashdetect error when using statement in a callback called remotely from a filterscript

I use a filterscript to call rcon commands such as whitelisting, which uses sqlitei. Whenever I use the command, a crash report appears on the log:

[debug] Run time error 4: "Array index out of bounds"
[debug]  Accessing element at negative index -4
[debug] AMX backtrace:
[debug] #0 00000008 in public OnRconCommand (cmd[]=@0x00000065 "") at E:\Games\Projects\SA-MP\Blank\filterscripts\test.pwn:5

It doesn't appear to cause any issue, but there's a possibility it might do.

Test gamemode:

#include <a_samp>
#include <sqlitei>


new
DB:             gDatabase,
DBStatement:    gStatement;

main()
{
    gDatabase = db_open_persistent("test.db");

    db_query(gDatabase, "CREATE TABLE IF NOT EXISTS list ( name TEXT )");

    gStatement = db_prepare(gDatabase, "INSERT INTO list VALUES(?)");
}

forward insert(string[]);
public insert(string[])
{
    stmt_bind_value(gStatement, 0, DB::TYPE_STRING, string, 24);

    if(stmt_execute(gStatement, true, false))
    {
        stmt_free_result(gStatement);
        return 1;
    }

    return 0;
}

Test Filterscript:

#define FILTERSCRIPT

#include <a_samp>

public OnRconCommand(cmd[])
{
    new ret = CallRemoteFunction("insert", "s", cmd);

    printf("Return: %d", ret);
}

After using this, all other database select+fetch operations seem to fail and return this:

SQLitei Warning: (stmt_fetch_row) Statement has no result.

Pawn Compile shutdown

if (iTagOf3 == tagof(DBDataType:)) { // this line crashing pawn
	iStaticArgs = 3;
} else {
	`bAutoRelease = _bAutoRelease;`
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.