[Plugin] [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by robanswe
Посмотреть сообщение
It's not an bug... Sa-mp is single thread so it can only do one thing at the time... So if mysql_query takes 20ms to execute it will stop the server for 20ms. The time it takes for mysql_query to execute depends on the mysql servers load and the ping to the mysql server. But yes using mysql_query_callback would fix that problem.
Thanks
Reply

Hello, if I have help. First of all do not speak English, and this is a big problem, so I use the ****** translator.

Well my question is whether Joomla! Server 1.7.11-Orion I used for testing on localhost, and how do I configure it, then try to throw a example and gives me error in an entry to start the server.


I appreciate the help possible.
Reply

Debug.txt

This means that if I connected to the database correctly?

Quote:

[13:36:35] CMySQLHandler::~CMySQLHandler() - deconstructor called.

[13:36:35] CMySQLHandler::FreeResult() - The result is already empty.

[13:36:35] CMySQLHandler:isconnect() - Connection was closed.

[13:36:38]

[13:36:38] ---------------------------

[13:36:38] MySQL Debugging activated (11/14/11)

[13:36:38] ---------------------------

[13:36:38]

[13:36:38] >> mysql_connect( )

[13:36:38] CMySQLHandler::CMySQLHandler() - constructor called.

[13:36:38] CMySQLHandler::CMySQLHandler() - Connecting to "127.0.0.1" | DB: "Joomla15" | Username: "root" ...

[13:36:38] CMySQLHandler::Connect() - Connection was successful.

[13:36:38] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.

Reply

mysql_format does not work with negative numbers?
Reply

I have a problem with mysql_fetch_field_row (mysql_get_field). In all queries
when I try to use this function more than one time I get segmentation fault.
I've already found thread about the same problem, but there is no solution found.

OS: Ubuntu 10.10 x64 [also tried on Ubuntu 10.10 x32]
MySQL version: 5.1.54-1ubuntu4
Server version: 0.3d RC9
Plugin version: R6-2


Query:
Код:
SELECT `id`, `column1`, `column2` FROM `table` WHERE `column3`=0
PAWN code:
pawn Код:
mysql_query("SELECT `id`, `column1`, `column2` FROM `table` WHERE `column3`=0");
mysql_store_result();
while(mysql_retrieve_row())
{
    mysql_get_field("column1",tmp);
    if(strval(tmp) > 0)
    {
        mysql_get_field("id",tmp);     
        // some stuff      
        mysql_get_field("column2",tmp);
    }
}
mysql_free_result();
Debug.txt:
Код:
[10:28:54] ---------------------------
[10:28:54] MySQL Debugging activated (11/20/11)
[10:28:54] ---------------------------
[10:28:54]
[10:28:54] >> mysql_set_charset( Connection handle: 1 )
[10:28:54] >> mysql_query( Connection handle: 1 )
[10:28:54] CMySQLHandler::Query(SET NAMES 'cp1251') - Successfully executed.
[10:28:54] >> mysql_query( Connection handle: 1 )
[10:28:54] CMySQLHandler::Query(UPDATE `table2` SET `somecolumn` = 0) - Successfully executed.
[10:28:54] >> mysql_query( Connection handle: 1 )
[10:28:54] CMySQLHandler::Query(SELECT `id`, `column1`, `column2` FROM `table` WHERE `column3`=0) - Successfully executed.
[10:28:54] >> mysql_store_result( Connection handle: 1 )
[10:28:54] CMySQLHandler::StoreResult() - Result was stored.
[10:28:54] >> mysql_retrieve_row( Connection handle: 1 )
[10:28:54] >> mysql_fetch_field_row( Connection handle: 1 )
[10:28:54] CMySQLHandler::FetchField("column1") - 1309637542
[10:28:54] >> mysql_fetch_field_row( Connection handle: 1 )
There is nothing significant in server_log.txt. Server just crashes with message "Segmentation fault" in shell.

Does anyone know how to solve it? Thanks in advance.

P.S. Also tried to use mysql-client libraries from Mow's post, but it stills segfaulting.
Reply

It appears that mysql_close crashes the server, I have used it under gamemodeexit.
Reply

Quote:
Originally Posted by hclj
Посмотреть сообщение
mysql_format does not work with negative numbers?
Yeah, I've reported it several months ago. Seems like it was never patched up.
Reply

On my Linux server it donґt works.
On My Windows Server it Works?
Ubuntu 6
Reply

This crashes the server. I used another plugin by blue g and it worked fine. i got vps and im using the r-6 debian 5 plugin

code is here

Код:
if(strlen(params) == 0 || strlen(params) > 24) return IRC_GroupSay(gGroupID,IRC_ADMIN, "4 Enter a valid User..");
	new escname[200], msg[256], query[256];
    mysql_real_escape_string(params, escname);
    format(query, sizeof(query), "SELECT * FROM `bans` WHERE  `name` = '%s'  LIMIT 1 ", escname);
	mysql_query(query);
    mysql_store_result();
    if (mysql_num_rows() == 0) return IRC_GroupSay(gGroupID,IRC_ADMIN,"1 Sorry, This user is not found in bans list.");
    new banner[64], reason[256], bandate[64], index, line[50], buffer[149], banl[64], result[200];

    if (mysql_retrieve_row())
    {
        mysql_fetch_field_row(banner,"banner");
        mysql_fetch_field_row(reason,"reason");
        mysql_fetch_field_row(banl,"banlength");
        mysql_fetch_field_row(bandate,"bandate");
    }

//// REST NOT SHOWN (DOESN'T CAUSE CRASH)
Reply

When i try to connect on my server and register an account , the server don`t show me the box where to write password etc....
Can someone give me a mysql dump without any user or a test user etc... please


What do to?

p.s at compile i don`t get any errors/warns
Reply

Sorry, but please fix the mysql_ping() crash.

Thanks!

Код:
[2011/11/28 16:31:04] --- Crashdetect v3.6.6 loaded
[2011/11/28 16:31:04] Loaded debug info from 'filterscripts\*******.amx'
[2011/11/28 16:31:04] Loaded debug info from 'gamemodes\nmss.amx'
[2011/11/28 16:42:05] Server crash caused by native mysql_ping() called at line 36304 in 'C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\gamemodes\nmss.pwn'
[2011/11/28 16:42:05] Call stack (most recent call first):
[2011/11/28 16:42:05]   File 'C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\gamemodes\nmss.pwn', line 36289
[2011/11/28 16:42:05]     CallFlag()
Reply

Same problem here!!! PLEASE FIX mysql_ping(). Server is crashing randomly.
Reply

Quote:
Originally Posted by Saurik
Посмотреть сообщение
This crashes the server. I used another plugin by blue g and it worked fine. i got vps and im using the r-6 debian 5 plugin

code is here

Код:
if(strlen(params) == 0 || strlen(params) > 24) return IRC_GroupSay(gGroupID,IRC_ADMIN, "4 Enter a valid User..");
	new escname[200], msg[256], query[256];
    mysql_real_escape_string(params, escname);
    format(query, sizeof(query), "SELECT * FROM `bans` WHERE  `name` = '%s'  LIMIT 1 ", escname);
	mysql_query(query);
    mysql_store_result();
    if (mysql_num_rows() == 0) return IRC_GroupSay(gGroupID,IRC_ADMIN,"1 Sorry, This user is not found in bans list.");
    new banner[64], reason[256], bandate[64], index, line[50], buffer[149], banl[64], result[200];

    if (mysql_retrieve_row())
    {
        mysql_fetch_field_row(banner,"banner");
        mysql_fetch_field_row(reason,"reason");
        mysql_fetch_field_row(banl,"banlength");
        mysql_fetch_field_row(bandate,"bandate");
    }

//// REST NOT SHOWN (DOESN'T CAUSE CRASH)
What Debug.txt say about that?
Reply

Hey Guy's,

i didn't want to read through all the sites here so i don't know if someone had this problem before but when i try to compile my GM the compiler crashes without any error. Do you know why?



Prio
Reply

Quote:
Originally Posted by Prio
Посмотреть сообщение
Hey Guy's,

i didn't want to read through all the sites here so i don't know if someone had this problem before but when i try to compile my GM the compiler crashes without any error. Do you know why?



Prio
This isn't the correct topic to post this...


I'm having trouble. I'd like to use this plugin on Debian 6.0, but there isn't a plugin for that yet. Is it possible to add this, or not ?
Reply

Sure it is because the Mysql plugin is the reason.
Reply

Quote:
Originally Posted by Prio
Посмотреть сообщение
Sure it is because the Mysql plugin is the reason.
No, the plugin has nothing to do with your compiler. You've probably forgot to close something, check for missing { and }
Reply

i get the following error when i try to compile the plugin (OS: Debian 6, MySQL Version: 5.1.49-3):

samp@Debian-60-squeeze-64-minimal:~/gsql/mysql_rel$ make
gcc -c -O3 -w -DLINUX -Wall -I../SDK/amx/ ../SDK/amx/*.c
g++ -c -O3 -w -DLINUX -Wall -I../SDK/amx/ ../SDK/*.cpp
g++ -c -O3 -w -DLINUX -Wall -I../SDK/amx/ main.cpp
g++ -c -O3 -w -DLINUX -Wall -I../SDK/amx/ source/*.cpp
g++ -O2 -fshort-wchar -shared -o "../mysql.so" *.o -L/usr/lib/mysql -lmysqlclient_r -lpthread
/usr/bin/ld: CAmxString.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
CAmxString.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [all] Error 1
Reply

Quote:
Originally Posted by Mischi
Посмотреть сообщение
i get the following error when i try to compile the plugin (OS: Debian 6, MySQL Version: 5.1.49-3):

samp@Debian-60-squeeze-64-minimal:~/gsql/mysql_rel$ make
gcc -c -O3 -w -DLINUX -Wall -I../SDK/amx/ ../SDK/amx/*.c
g++ -c -O3 -w -DLINUX -Wall -I../SDK/amx/ ../SDK/*.cpp
g++ -c -O3 -w -DLINUX -Wall -I../SDK/amx/ main.cpp
g++ -c -O3 -w -DLINUX -Wall -I../SDK/amx/ source/*.cpp
g++ -O2 -fshort-wchar -shared -o "../mysql.so" *.o -L/usr/lib/mysql -lmysqlclient_r -lpthread
/usr/bin/ld: CAmxString.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
CAmxString.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [all] Error 1
You use 64 bit Debian 6.0 ? You need to compile with 32 bit system
Reply

Try if anything from here is useful: http://www.egaming.ro/MySQL/
Reply


Forum Jump:


Users browsing this thread: 28 Guest(s)