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

That shouldn't happen on SP3, maybe your missing some libraries.. Have you downloaded Microsoft visual studio or the re-distributable packages or whatever?
Reply

An insert function crashes my server on Linux, and gives that message on terminal:

Code:
*** glibc detected *** ./samp03svr: free(): invalid next size (fast): 0x09e2a620
 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xf751dee2]
plugins/mysql_static.so(_ZN6Native12mysql_formatEP6tagAMXPi+0x42b)[0xf72ee93b]
./samp03svr[0x8093c94]
./samp03svr[0x8095735]
./samp03svr[0x80ae33f]
./samp03svr[0x80b97da]
./samp03svr[0x8071ae8]
./samp03svr[0x8071be2]
./samp03svr[0x807ba00]
./samp03svr[0x80b59ad]
./samp03svr[0x80b5b42]
./samp03svr[0x80b1453]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xf74c14d3]
======= Memory map: ========
08048000-08094000 r-xp 00000000 08:01 263213                             /home/u
ser207/samp03/samp03svr
08094000-08096000 rwxp 0004c000 08:01 263213                             /home/u
ser207/samp03/samp03svr
08096000-08168000 r-xp 0004e000 08:01 263213                             /home/u
ser207/samp03/samp03svr
08168000-0818a000 rw-p 0011f000 08:01 263213                             /home/u
ser207/samp03/samp03svr
0818a000-08195000 rw-p 00000000 00:00 0
09c4c000-09e4d000 rw-p 00000000 00:00 0                                  [heap]
f4000000-f4021000 rw-p 00000000 00:00 0
f4021000-f4100000 ---p 00000000 00:00 0
f413d000-f4142000 r-xp 00000000 08:01 925024                             /lib/i3
86-linux-gnu/libnss_dns-2.15.so
f4142000-f4143000 r--p 00004000 08:01 925024                             /lib/i3
86-linux-gnu/libnss_dns-2.15.so
f4143000-f4144000 rw-p 00005000 08:01 925024                             /lib/i3
86-linux-gnu/libnss_dns-2.15.so
f4154000-f4155000 ---p 00000000 00:00 0
f4155000-f5a9f000 rw-p 00000000 00:00 0
f5aa0000-f5f75000 rw-p 00000000 00:00 0
f5f75000-f5f76000 ---p 00000000 00:00 0
f5f76000-f6872000 rw-p 00000000 00:00 0
f6872000-f68fe000 r-xp 00000000 08:01 263317                             /home/u
ser207/samp03/plugins/streamer.so
f68fe000-f68ff000 rw-p 0008c000 08:01 263317                             /home/u
ser207/samp03/plugins/streamer.so
f68ff000-f6900000 rw-p 00000000 00:00 0
f6900000-f6958000 rw-p 00000000 00:00 0
f6958000-f6a00000 ---p 00000000 00:00 0
f6a13000-f6a26000 r-xp 00000000 08:01 925022                             /lib/i3
86-linux-gnu/libresolv-2.15.so
f6a26000-f6a27000 ---p 00013000 08:01 925022                             /lib/i3
86-linux-gnu/libresolv-2.15.so
f6a27000-f6a28000 r--p 00013000 08:01 925022                             /lib/i3
86-linux-gnu/libresolv-2.15.so
f6a28000-f6a29000 rw-p 00014000 08:01 925022                             /lib/i3
86-linux-gnu/libresolv-2.15.so
f6a29000-f6a52000 rw-p 00000000 00:00 0
f6a52000-f6a61000 r-xp 00000000 08:01 263315                             /home/u
ser207/samp03/plugins/sscanf.so
f6a61000-f6a62000 r--p 0000e000 08:01 263315                             /home/u
ser207/samp03/plugins/sscanf.so
f6a62000-f6a63000 rw-p 0000f000 08:01 263315                             /home/u
ser207/samp03/plugins/sscanf.so
f6a63000-f6a6e000 r-xp 00000000 08:01 925020                             /lib/i3
86-linux-gnu/libnss_files-2.15.so
f6a6e000-f6a6f000 r--p 0000a000 08:01 925020                             /lib/i3
86-linux-gnu/libnss_files-2.15.so
f6a6f000-f6a70000 rw-p 0000b000 08:01 925020                             /lib/i3
86-linux-gnu/libnss_files-2.15.so
f6a75000-f6a7e000 r-xp 00000000 08:01 263319                             /home/u
ser207/samp03/plugins/whirlpool.so
f6a7e000-f6a7f000 rw-p 00008000 08:01 263319                             /home/u
ser207/samp03/plugins/whirlpool.so
f6a80000-f6a81000 ---p 00000000 00:00 0
f6a81000-f7281000 rw-p 00000000 00:00 0
f7281000-f7389000 r-xp 00000000 08:01 263200                             /home/u
ser207/samp03/plugins/mysql_static.so
f7389000-f738a000 r--p 00107000 08:01 263200                             /home/u
ser207/samp03/plugins/mysql_static.so
f738a000-f74a2000 rw-p 00108000 08:01 263200                             /home/u
ser207/samp03/plugins/mysql_static.so
f74a2000-f74a8000 rw-p 00000000 00:00 0
f74a8000-f764b000 r-xp 00000000 08:01 925012                             /lib/i3
86-linux-gnu/libc-2.15.so
f764b000-f764d000 r--p 001a3000 08:01 925012                             /lib/i3
86-linux-gnu/libc-2.15.so
f764d000-f764e000 rw-p 001a5000 08:01 925012                             /lib/i3
86-linux-gnu/libc-2.15.so
f764e000-f7651000 rw-p 00000000 00:00 0
f7651000-f766d000 r-xp 00000000 08:01 925039                             /lib/i3
86-linux-gnu/libgcc_s.so.1
f766d000-f766e000 r--p 0001b000 08:01 925039                             /lib/i3
86-linux-gnu/libgcc_s.so.1
f766e000-f766f000 rw-p 0001c000 08:01 925039                             /lib/i3
86-linux-gnu/libgcc_s.so.1
f766f000-f7699000 r-xp 00000000 08:01 925034                             /lib/i3
86-linux-gnu/libm-2.15.so
f7699000-f769a000 r--p 00029000 08:01 925034                             /lib/i3
86-linux-gnu/libm-2.15.so
f769a000-f769b000 rw-p 0002a000 08:01 925034                             /lib/i3
86-linux-gnu/libm-2.15.so
f769b000-f7773000 r-xp 00000000 08:01 394712                             /usr/li
b/i386-linux-gnu/libstdc++.so.6.0.16
f7773000-f7774000 ---p 000d8000 08:01 394712                             /usr/li
b/i386-linux-gnu/libstdc++.so.6.0.16
f7774000-f7778000 r--p 000d8000 08:01 394712                             /usr/li
b/i386-linux-gnu/libstdc++.so.6.0.16
f7778000-f7779000 rw-p 000dc000 08:01 394712                             /usr/li
b/i386-linux-gnu/libstdc++.so.6.0.16
f7779000-f7781000 rw-p 00000000 00:00 0
f7781000-f7798000 r-xp 00000000 08:01 925030                             /lib/i3
86-linux-gnu/libpthread-2.15.so
f7798000-f7799000 r--p 00016000 08:01 925030                             /lib/i3
86-linux-gnu/libpthread-2.15.so
f7799000-f779a000 rw-p 00017000 08:01 925030                             /lib/i3
86-linux-gnu/libpthread-2.15.so
f779a000-f779c000 rw-p 00000000 00:00 0
f779c000-f779f000 r-xp 00000000 08:01 925042                             /lib/i3
86-linux-gnu/libdl-2.15.so
f779f000-f77a0000 r--p 00002000 08:01 925042                             /lib/i3
86-linux-gnu/libdl-2.15.so
f77a0000-f77a1000 rw-p 00003000 08:01 925042                             /lib/i3
86-linux-gnu/libdl-2.15.so
f77a5000-f77a7000 rw-p 00000000 00:00 0
f77a7000-f77ae000 r-xp 00000000 08:01 925026                             /lib/i3
86-linux-gnu/librt-2.15.so
f77ae000-f77af000 r--p 00006000 08:01 925026                             /lib/i3
86-linux-gnu/librt-2.15.so
f77af000-f77b0000 rw-p 00007000 08:01 925026                             /lib/i3
86-linux-gnu/librt-2.15.so
f77b0000-f77b3000 rw-p 00000000 00:00 0
f77b3000-f77b4000 r-xp 00000000 00:00 0                                  [vdso]
f77b4000-f77d4000 r-xp 00000000 08:01 925036                             /lib/i3
86-linux-gnu/ld-2.15.so
f77d4000-f77d5000 r--p 0001f000 08:01 925036                             /lib/i3
86-linux-gnu/ld-2.15.so
f77d5000-f77d6000 rw-p 00020000 08:01 925036                             /lib/i3
86-linux-gnu/ld-2.15.so
ffee8000-fff09000 rw-p 00000000 00:00 0                                  [stack]
It does not happen in Windows, do you have any clue about what does cause it?

EDIT: I use R25.
Reply

"- removed natives 'mysql_debug', 'mysql_errno', 'mysql_warning_count',
'mysql_ping"

"- renamed native 'mysql_function_query' to 'mysql_tquery' and removed cache
parameter"

What the hell is this shit? What's the point of the rename and why would you remove those functions?
Reply

I'm wondering ... why at the ****** Code download the "featured" download is for R20, but not for R24/R25 ?
Reply

Quote:
Originally Posted by Calabresi
View Post
An insert function crashes my server on Linux, and gives that message on terminal:

Code:
[...]
It does not happen in Windows, do you have any clue about what does cause it?

EDIT: I use R25.
It seems that a memory error in mysql_format causes this crash. Could you post that mysql_format function from your script where you think it crashes?
Reply

Quote:
Originally Posted by Delta 4
Посмотреть сообщение
which function replaces the mysql_ping?
The function was removed completely. You can use OnQueryError to determine if the connection couldn't be established though. Check the include for a link to common MySQL server/client error codes.
Reply

It loads the plugin

Code:
[21:43:50]  Loading plugin: mysql
[21:43:50]  >> plugin.mysql: Multi-Threading is deactivated due to bad CPU.
[21:43:50]  >> plugin.mysql: R26 successfully loaded.
[21:43:50]   Loaded.
However, when it unloads the plugin:

Code:
[21:43:52] plugin.mysql: Unloading plugin...
[21:43:52] [debug] Server crashed due to an unknown error
[21:43:52] [debug] System backtrace:
[21:43:52] [debug] #0 00e436d0 in ?? () from D:\[0.3x] SA-MP Server\plugins\mysql.dll
[21:43:52] [debug] #1 00e51093 in Unload () from D:\[0.3x] SA-MP Server\plugins\mysql.dll
[21:43:52] [debug] #2 5d8b53ec in ?? () from D:\[0.3x] SA-MP Server\samp-server.exe
On R26 Windows. Any ideas?
Reply

Quote:
Originally Posted by _Zeus
View Post
[...]
On R26 Windows. Any ideas?
Whops, sorry, there was a small detail I forgot. It's fixed now. However, this crash shouldn't affect the server much.
Reply

Quote:
Originally Posted by RealCop228
View Post
The function was removed completely. You can use OnQueryError to determine if the connection couldn't be established though. Check the include for a link to common MySQL server/client error codes.
Ok, i'll take a look to that, thanks
Reply

pawn Code:
public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
{
    switch(errorid)
    {
        case 2006:
        {
            print("Plugin cannot connect to MySql database");
        }
    }
    return 1;
}
Reply

ThomasTailor93 apreciated the help
Reply

I like this!
R26 worked and i didnt have to do anything in script exept compile with new include.
Loading server data in my server is now 2-300ms, from 5-800ms on R20. (linux, not the static)

But whats the difference between mysql_static and the normal?
Reply

Quote:
Originally Posted by Richie©
View Post
I like this!
R26 worked and i didnt have to do anything in script exept compile with new include.
Loading server data in my server is now 2-300ms, from 5-800ms on R20. (linux, not the static)

But whats the difference between mysql_static and the normal?
If I'm correct the mysql_static version has the libraries inside it so the dedicated server doesn't need them installed.
Reply

Function mysql_ping was removed ?
Reply

Quote:
Originally Posted by gabyk
View Post
Function mysql_ping was removed ?
Yes, and on the previous page is an example of how to check if a connection is dead.
Reply

Quote:
Originally Posted by KyleSmith
View Post
If I'm correct the mysql_static version has the libraries inside it so the dedicated server doesn't need them installed.
Like libmsqclient15.so? (If coreectly spelled)
Which one is better to use?
Reply

AFAIK the dynamic version is faster than the static, but the static is more comfortabler (plug and play lol).
The plugin uses the libmysqlclient.so.16 shared/dynamic library on Linux.
And just a general remember: Feel free to post any suggestions to this plugin.
Reply

Quote:
Originally Posted by Pain123
View Post
AFAIK the dynamic version is faster than the static, but the static is more comfortabler (plug and play lol).
The plugin uses the libmysqlclient.so.16 shared/dynamic library on Linux.
And just a general remember: Feel free to post any suggestions to this plugin.
Even though it currently isn't possible and I know you ported away from them after R6.

But I would love to be able to access query data instantly without threading. Like Pre R7, I have some fields in which OnGameModeInit requires to initiate the gamemode, but I'm having to use filing system as currently it doesn't allow it.

Dan's MySQL plugin does though
Reply

I won't add unthreaded queries. BlueG would kill me, others would start a flame war. If you really need them you have to use a other MySQL plugin.
Reply

Is there any chance to get the sizeof() thing fixed in string functions?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)