SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 29/11/2016, 12:10 PM   #6021
maddinat0r
Banned
 
Join Date: Jun 2010
Location: Germany
Posts: 845
Reputation: 482
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Manyula View Post
Thanks for your fast response!

I'm using the YSI framework (mainly y_hooks), the streamer, Whirlpool, Pawn.CMD, Sscanf2 and your MySQL plugin. I don't know if it's worth mentioning, but I split up my gamemode into separate modules that I write in separate include files, which is why I'm using y_hooks primarily. The login/register system runs entirely under hooked callbacks.
Can you enable full logging, enable the crashdetect plugin, delete all MySQL logs, reproduce that error/crash and send me the crash message/stacktrace and mysql.log file per PM?
maddinat0r is offline   Reply With Quote
Old 29/11/2016, 12:46 PM   #6022
SwankyPants
Little Clucker
 
SwankyPants's Avatar
 
Join Date: Nov 2016
Location: Denmark +1 gmt
Posts: 16
Reputation: 0
Default Re: [REL] MySQL Plugin (Now on github!)

Great work, i really needed this one to my server!

- Thanks
__________________
"Life is 10% what happens to you and 90% how you react to it."
SwankyPants is offline   Reply With Quote
Old 29/11/2016, 07:58 PM   #6023
Manyula
Huge Clucker
 
Manyula's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 284
Reputation: 47
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by maddinat0r View Post
Can you enable full logging, enable the crashdetect plugin, delete all MySQL logs, reproduce that error/crash and send me the crash message/stacktrace and mysql.log file per PM?
Currently, I sadly can't reproduce the crash. I restarted the server and now it doesn't crash but shuts down. I've been looking through the mysql_log file and found "[DEBUG] allocated 0 bytes for PAWN result".

PHP Code:
[21:38:57] [INFOchanged log level from 'warning, error' to 'debug, info, warning, error'
[21:38:57] [DEBUGmysql_init_options()
[
21:38:57] [INFOOptions instance with id '1' successfully created.
[
21:38:57] [DEBUGmysql_init_options: return value'1'
[21:38:57] [DEBUGmysql_set_option(10)
[
21:38:57] [DEBUGmysql_set_option: return value'1'
[21:38:57] [DEBUGmysql_connect("localhost""many""*****""many"1)
[
21:38:57] [DEBUGCHandleManager::Create(this=0x884ed50host='localhost'user='many'pass='****'db='many'options=0x879cde8)
[
21:38:57] [INFOCreating new connection handle...
[
21:38:57] [DEBUGCConnection::CConnection(this=0x884eef0host='localhost'user='many'passw='****'db='many'options=0x879cde8)
[
21:38:57] [DEBUGCConnection::CConnection - new connection 0x884f050
[21:38:57] [DEBUGCConnection::CConnection(this=0xf50eb008host='localhost'user='many'passw='****'db='many'options=0x879cde8)
[
21:38:57] [DEBUGCConnection::CConnection - new connection 0x88675c0
[21:38:57] [DEBUGCThreadedConnection::CThreadedConnection(this=0xf50eb008connection=0xf50eb008)
[
21:38:57] [DEBUGCConnectionPool::CConnectionPool(size=2this=0x884ed30)
[
21:38:57] [DEBUGCConnection::CConnection(this=0xf4869008host='localhost'user='many'passw='****'db='many'options=0x879cde8)
[
21:38:57] [DEBUGCThreadedConnection::WorkerFunc(this=0xf50eb008connection=0xf50eb008)
[
21:38:57] [DEBUGCConnection::CConnection - new connection 0x886dbb8
[21:38:57] [DEBUGCThreadedConnection::CThreadedConnection(this=0xf4869008connection=0xf4869008)
[
21:38:57] [DEBUGCConnection::CConnection(this=0xf3e7e008host='localhost'user='many'passw='****'db='many'options=0x879cde8)
[
21:38:57] [DEBUGCThreadedConnection::WorkerFunc(this=0xf4869008connection=0xf4869008)
[
21:38:57] [DEBUGCConnection::CConnection - new connection 0x88741b0
[21:38:57] [DEBUGCThreadedConnection::CThreadedConnection(this=0xf3e7e008connection=0xf3e7e008)
[
21:38:57] [DEBUGCThreadedConnection::WorkerFunc(this=0xf3e7e008connection=0xf3e7e008)
[
21:38:57] [INFOConnection handle with id '1' successfully created.
[
21:38:57] [DEBUGCHandleManager::Create - new handle 0x86a97f8
[21:38:57] [DEBUGmysql_connect: return value'1'
[21:38:57] [DEBUGmysql_errno(1)
[
21:38:57] [DEBUGCHandle::GetErrorId(this=0x86a97f8)
[
21:38:57] [DEBUGCConnection::GetError(this=0x884eef0connection=0x884f050)
[
21:38:57] [DEBUGCHandle::GetErrorId - return valuetrueerror id'0'error msg''
[21:38:57] [DEBUGmysql_errno: return value'0'
[21:39:38] [DEBUGmysql_format(10xF5378F04128"SELECT * FROM `accounts` WHERE `Name` = '%e' LIMIT 1")
[
21:39:38] [DEBUGCHandle::EscapeString(this=0x86a97f8src='[AMB]Manyula')
[
21:39:38] [DEBUGCConnection::EscapeString(src='[AMB]Manyula'this=0x884eef0connection=0x884f050)
[
21:39:38] [DEBUGCHandle::EscapeString - return valuetrueescaped string'[AMB]Manyula'
[21:39:38] [DEBUGmysql_format: return value'62'
[21:39:38] [DEBUGmysql_tquery(1"SELECT * FROM `accounts` WHERE `Name` = '[AMB]Manyula' LIMIT 1""OnAccountLoaded""dd")
[
21:39:38] [DEBUGCCallback::Create(amx=0x8811748name='OnAccountLoaded'format='dd'params=0xf5378ee8param_offset=5)
[
21:39:38] [DEBUGCCallback::Create callback index for 'OnAccountLoaded'5
[21:39:38] [DEBUGprocessing specifier 'd' with parameter index 0
[21:39:38] [DEBUGretrieved and pushed value '0'
[21:39:38] [DEBUGprocessing specifier 'd' with parameter index 1
[21:39:38] [DEBUGretrieved and pushed value '1'
[21:39:38] [INFOCallback 'OnAccountLoaded' set up for delayed execution.
[
21:39:38] [DEBUGcreated delayed callback with 2 parameters
[21:39:38] [DEBUGCHandle::Execute(this=0x86a97f8type=1query=0x889401c)
[
21:39:38] [DEBUGCConnection::Execute(query=0x889401cthis=0xf50eb008connection=0x88675c0)
[
21:39:38] [DEBUGCHandle::Execute - return valuetrue
[21:39:38] [DEBUGCQuery::Execute(this=0x889401cconnection=0x88675c0)
[
21:39:38] [DEBUGmysql_tquery: return value'1'
[21:39:38] [INFOquery "SELECT * FROM `accounts` WHERE `Name` = '[AMB]Manyula' LIMIT 1" successfully executed within 0.257 milliseconds
[21:39:38] [DEBUGCResultSet::Create(connection=0x88675c0query_str='SELECT * FROM `accounts` WHERE `Name` = '[AMB]Manyula' LIMIT 1')
[
21:39:38] [DEBUGcreated new resultset '0xf47006a8'
[21:39:38] [DEBUGfetched MySQL result '0xf4700930'
[21:39:38] [DEBUGallocated 0 bytes for PAWN result 
If I find a way to reproduce the crash once more, I'll let you know.
__________________
Manyula is offline   Reply With Quote
Old 04/12/2016, 03:47 PM   #6024
maddinat0r
Banned
 
Join Date: Jun 2010
Location: Germany
Posts: 845
Reputation: 482
Default Re: [REL] MySQL Plugin (Now on github!)

R41-2 has been released.
Changes:
  • all builds from now on prefer the MariaDB C connector
  • log improvements:
    • R41-2 uses the latest log-core version, which supplies call info traces (especially useful when using includes that call plugin functions)
    • several bug fixes

Download as always here: https://github.com/pBlueG/SA-MP-MySQL/releases
maddinat0r is offline   Reply With Quote
Old 04/12/2016, 04:10 PM   #6025
vannesenn
Gangsta
 
vannesenn's Avatar
 
Join Date: Feb 2011
Posts: 607
Reputation: 15
Default Re: [REL] MySQL Plugin (Now on github!)

all builds from now on prefer the MariaDB C connector"

I don't understand what you want to say.
vannesenn is offline   Reply With Quote
Old 04/12/2016, 04:13 PM   #6026
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,831
Reputation: 1401
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by vannesenn View Post
all builds from now on prefer the MariaDB C connector"

I don't understand what you want to say.
libmysql.dll is basically replaced with libmariadb.dll (which is a lot smaller in size from what I see).
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 04/12/2016, 06:08 PM   #6027
MerryDeer
Banned
 
Join Date: Jun 2016
Posts: 723
Reputation: 8
Default Re: [REL] MySQL Plugin (Now on github!)

Can you compile for debian 8 ?
MerryDeer is offline   Reply With Quote
Old 04/12/2016, 08:18 PM   #6028
maddinat0r
Banned
 
Join Date: Jun 2010
Location: Germany
Posts: 845
Reputation: 482
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by MerryDeer View Post
Can you compile for debian 8 ?
Will do that tomorrow.
maddinat0r is offline   Reply With Quote
Old 06/12/2016, 01:57 AM   #6029
RIDE2DAY
Huge Clucker
 
RIDE2DAY's Avatar
 
Join Date: Jul 2015
Location: Modena, Italy
Posts: 213
Reputation: 381
Default Re: [REL] MySQL Plugin (Now on github!)

Good job maddinat0r, I love mysql_connect_file and cache_insert_id. By the way, how can multiple SQL statements be sent with this plugin? Adding a semicolon after each statement?

Should cache_get_result_count and cache_get_row_count be used first as a condition always? Why would they fail? I mean, is there any difference between the following two examples?
PHP Code:
/* Query */
mysql_pquery(sql_handle"SELECT `id`, `password` FROM `player_info` WHERE `name`='RIDE2DAY' LIMIT 1""CheckAccount");

/* CheckAccount Callback */
/* Method #1 */
new results;
if(
cache_get_result_count(results))
{
    
cache_set_result(0);

    new 
rows;
    if(
cache_get_row_count(rows))
    {
        if(
rows)
        {
            
// Log In
        
}
        else
        {
            
            
// Register
        
}
    }
}

/* Method #2 */
cache_set_result(0);

new 
rows;
cache_get_row_count(rows);

if(
rows)
{
    
// Log In
}
else
{
    
    
// Register


Last edited by RIDE2DAY; 06/12/2016 at 02:57 AM.
RIDE2DAY is offline   Reply With Quote
Old 06/12/2016, 06:22 AM   #6030
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 318
Reputation: 37
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by RIDE2DAY View Post
Good job maddinat0r, I love mysql_connect_file and cache_insert_id. By the way, how can multiple SQL statements be sent with this plugin? Adding a semicolon after each statement?

Should cache_get_result_count and cache_get_row_count be used first as a condition always? Why would they fail? I mean, is there any difference between the following two examples?
PHP Code:
/* Query */
mysql_pquery(sql_handle"SELECT `id`, `password` FROM `player_info` WHERE `name`='RIDE2DAY' LIMIT 1""CheckAccount");

/* CheckAccount Callback */
/* Method #1 */
new results;
if(
cache_get_result_count(results))
{
    
cache_set_result(0);

    new 
rows;
    if(
cache_get_row_count(rows))
    {
        if(
rows)
        {
            
// Log In
        
}
        else
        {
            
            
// Register
        
}
    }
}

/* Method #2 */
cache_set_result(0);

new 
rows;
cache_get_row_count(rows);

if(
rows)
{
    
// Log In
}
else
{
    
    
// Register

Code:
/* Query */ 
mysql_pquery(sql_handle, "SELECT `id`, `password` FROM `player_info` WHERE `name`='RIDE2DAY' LIMIT 1", "CheckAccount"); 

/* CheckAccount Callback */ 
/* Method #1 */ 
new results; 
cache_get_result_count(results);
if(results) 
{ 
    new rows; 
    cache_get_row_count(rows);
    if(rows) 
    { 
        // Log In 
    } 
    else 
    { 
        // Register 
    } 
}
Use this.
Max_Andolini is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
****** Project: Glass int3s0 Everything and Nothing 99 26/02/2013 04:22 PM
MySQL Plugin R5 plugin problem dud Scripting Help 12 05/12/2011 06:28 PM
Strikens Mysql vs BlueG's Mysql plugin PrawkC Scripting Help 4 30/09/2011 10:30 AM
[help][plugin] Can't load mysql plugin mariomako Help Archive 8 16/07/2011 02:37 PM
mysql plugin. loading plugin failed ikkentim Help Archive 2 10/02/2011 02:32 PM


All times are GMT. The time now is 05:54 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.