Re: AW: Re: [REL] MySQL Plugin (****** Project) -
maddinat0r - 29.08.2013
Quote:
Originally Posted by Sp3cter
So isn't it slowly ?
|
Yes, but I'd rather decrease performance a bit to increase stability.
Re: [REL] MySQL Plugin (****** Project) -
Kar - 29.08.2013
Why are you guys so crazy about speed? The plugin runs pretty fast already wtf why don't you guys focus on removing crashes and bugs and improve stability (uptime) then bloody performance for once!
Re: [REL] MySQL Plugin (****** Project) -
caoraivoso3 - 29.08.2013
i have a question related to mysql
what this means:
format(query, sizeof(query), "UPDATE `users` SET health = %.1f, X = %.2f, Y = %.2f, Z = %.2f, A = %.2f, interior = %d, vw = %d, skin = %d WHERE `id` = %d",
i dont know what this%1f means?
and another question what row and field is?
Re: [REL] MySQL Plugin (****** Project) -
B-Matt - 29.08.2013
Quote:
Originally Posted by Kar
Why are you guys so crazy about speed? The plugin runs pretty fast already wtf why don't you guys focus on removing crashes and bugs and improve stability (uptime) then bloody performance for once!
|
R33 is much much faster than R31. I ran few tests with caches an speed is awesome.
Re: [REL] MySQL Plugin (****** Project) -
Luis- - 29.08.2013
Quote:
Originally Posted by B-Matt
R33 is much much faster than R31. I ran few tests with caches an speed is awesome.
|
R33 isn't out yet?
AW: [REL] MySQL Plugin (****** Project) -
maddinat0r - 29.08.2013
He is one of my beta testers.
Re: [REL] MySQL Plugin (****** Project) -
Luis- - 29.08.2013
Ah, sorry about that mate!
Re: [REL] MySQL Plugin (****** Project) -
kurta999 - 29.08.2013
Quote:
Originally Posted by caoraivoso3
i have a question related to mysql
what this means:
format(query, sizeof(query), "UPDATE `users` SET health = %.1f, X = %.2f, Y = %.2f, Z = %.2f, A = %.2f, interior = %d, vw = %d, skin = %d WHERE `id` = %d",
i dont know what this%1f means?
and another question what row and field is?
|
Numbers after decimal point.
new Float:asd = 5.123456;
with:
%.1f 5.1
%.2f 5.12
%.4f 5.1234
Re: [REL] MySQL Plugin (****** Project) -
caoraivoso3 - 29.08.2013
thanks
Re: [REL] MySQL Plugin (****** Project) -
Reboma - 29.08.2013
Best MySQL plugin, i use the latest version with the cache functions.
The speed is amazing!
Thank you guys for your hard work on this plugin!
Re: [REL] MySQL Plugin (****** Project) -
caoraivoso3 - 30.08.2013
i use this function and i add a new field to create in mysqldb.
mysql_function_query(g_Handle, "CREATE TABLE IF NOT EXISTS `users` ( \
`id` int(11) NOT NULL AUTO_INCREMENT, \
`name` varchar(24) NOT NULL, \
`pass` varchar(129) NOT NULL, \
`salt` varchar(30) NOT NULL, \
`health` float NOT NULL, \
`X` float NOT NULL, \
`Y` float NOT NULL, \
`Z` float NOT NULL, \
`A` float NOT NULL, \
`interior` int(2) NOT NULL, \
`vw` int(11) NOT NULL, \
`skin` int(3) NOT NULL, \
`Admin` int(6) NOT NULL, \
`Gm` int(6) NOT NULL, \
`Pamoney` int(30) NOT NULL, \
PRIMARY KEY (`id`) \
)", false, "SendQuery", "");
return 1;
}
but i get this two errors:
C:\Users\rui\Documents\garage\gamemodes\tyhrefwdsq .pwn(143) : error 075: input line too long (after substitutions)
C:\Users\rui\Documents\garage\gamemodes\tyhrefwdsq .pwn(144) : error 017: undefined symbol "mysql_function_query"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
what i can do about it?
Re: [REL] MySQL Plugin (****** Project) -
[IZ]Kira - 30.08.2013
Quote:
Originally Posted by caoraivoso3
i use this function and i add a new field to create in mysqldb.
mysql_function_query(g_Handle, "CREATE TABLE IF NOT EXISTS `users` ( \
`id` int(11) NOT NULL AUTO_INCREMENT, \
`name` varchar(24) NOT NULL, \
`pass` varchar(129) NOT NULL, \
`salt` varchar(30) NOT NULL, \
`health` float NOT NULL, \
`X` float NOT NULL, \
`Y` float NOT NULL, \
`Z` float NOT NULL, \
`A` float NOT NULL, \
`interior` int(2) NOT NULL, \
`vw` int(11) NOT NULL, \
`skin` int(3) NOT NULL, \
`Admin` int(6) NOT NULL, \
`Gm` int(6) NOT NULL, \
`Pamoney` int(30) NOT NULL, \
PRIMARY KEY (`id`) \
)", false, "SendQuery", "");
return 1;
}
but i get this two errors:
C:\Users\rui\Documents\garage\gamemodes\tyhrefwdsq .pwn(143) : error 075: input line too long (after substitutions)
C:\Users\rui\Documents\garage\gamemodes\tyhrefwdsq .pwn(144) : error 017: undefined symbol "mysql_function_query"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
what i can do about it?
|
Try this:
Код:
mysql_tquery( 1, "CREATE TABLE IF NOT EXISTS `users` ( \
`id` int(11) NOT NULL AUTO_INCREMENT, \
`name` varchar(24) NOT NULL, \
`pass` varchar(129) NOT NULL, \
`salt` varchar(30) NOT NULL, \
`health` float NOT NULL, \
`X` float NOT NULL, \
`Y` float NOT NULL, \
`Z` float NOT NULL, \
`A` float NOT NULL, \
`interior` int(2) NOT NULL, \
`vw` int(11) NOT NULL, \
`skin` int(3) NOT NULL, \
`Admin` int(6) NOT NULL, \
`Gm` int(6) NOT NULL, \
`Pamoney` int(30) NOT NULL, \
PRIMARY KEY (`id`) )", "", "");
I insert this to my script and all it's ok ...no errors (But U need to have the latest versions of MySQL include/plugin , here -> https://code.******.com/p/sa-mp-mysq...downloads/list )
Quote:
Pawn compiler 6.3.3166 Copyright © 1997-2011, ITB CompuPhase
[Finished in 0.6s]
|
Re: [REL] MySQL Plugin (****** Project) -
caoraivoso3 - 30.08.2013
what you change? please explain i already have the last plugin
Re: [REL] MySQL Plugin (****** Project) -
d711728 - 30.08.2013
Hi!
I ask that when you are expected to appear in the r33?
sorry bad english..
Re: [REL] MySQL Plugin (****** Project) -
Luis- - 30.08.2013
Read the thread..
http://forum.sa-mp.com/showpost.php?...postcount=4158
Re: [REL] MySQL Plugin (****** Project) -
B-Matt - 30.08.2013
Quote:
Originally Posted by caoraivoso3
i use this function and i add a new field to create in mysqldb.
mysql_function_query(g_Handle, "CREATE TABLE IF NOT EXISTS `users` ( \
`id` int(11) NOT NULL AUTO_INCREMENT, \
`name` varchar(24) NOT NULL, \
`pass` varchar(129) NOT NULL, \
`salt` varchar(30) NOT NULL, \
`health` float NOT NULL, \
`X` float NOT NULL, \
`Y` float NOT NULL, \
`Z` float NOT NULL, \
`A` float NOT NULL, \
`interior` int(2) NOT NULL, \
`vw` int(11) NOT NULL, \
`skin` int(3) NOT NULL, \
`Admin` int(6) NOT NULL, \
`Gm` int(6) NOT NULL, \
`Pamoney` int(30) NOT NULL, \
PRIMARY KEY (`id`) \
)", false, "SendQuery", "");
return 1;
}
but i get this two errors:
C:\Users\rui\Documents\garage\gamemodes\tyhrefwdsq .pwn(143) : error 075: input line too long (after substitutions)
C:\Users\rui\Documents\garage\gamemodes\tyhrefwdsq .pwn(144) : error 017: undefined symbol "mysql_function_query"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
what i can do about it?
|
Put it in the mysql_format function and then use the query.
Re: [REL] MySQL Plugin (****** Project) -
caoraivoso3 - 31.08.2013
hey i have another questions to all of us. I am making a house system and i want to make all players that have the house key can enter in the house but i need to create a field to store all the player's sqlid on that field.
How i can do that? thanks if anyone can helpme
Re: [REL] MySQL Plugin (****** Project) -
Kyle - 31.08.2013
Is it possible to speed up mysql_real_escape_string?
It takes 193ms for me for about 600 length string.
I'm using R30.
Re: [REL] MySQL Plugin (****** Project) -
AndreT - 31.08.2013
I think I see a potential problem with the code in
CScripting.cpp.
The memory allocated for the output of the C mysql_real_escape_string must be (2*strlen(input))+1. Assuming that you usually know what you're doing, when you write PAWN code, you do this:
pawn Код:
new src[32];
new dest[64];
mysql_real_escape_string(src, dest); // max_len=sizeof(destination) by default
What the plugin native then does is:
pawn Код:
size_t DestLen = (params[4] <= 0 ? 8192 : params[4]); // DestLen becmes 64 (in our case at least)
// ...
char *StrBuffer = (char *)malloc(DestLen*2+1); // Allocates 64*2+1=129 bytes of memory
memset(StrBuffer, 0, DestLen*2 + 1); // Set it all to zeros (?)
cell StringLen = (cell)mysql_real_escape_string(ConnPtr, StrBuffer, Source, strlen(Source));
StrAmx::SetCString(amx, params[2], StrBuffer, params[4]);
free(StrBuffer);
Also, I think that memset needn't be used here - the C mysql_real_escape_string appends a NULL byte by itself. To allocate 64+1 bytes of memory (aka. what we need here to be on the safe side), it needs to make use of the SourceLen variable (cannot exceed 32 in our example) and double it and add 1 byte for the NULL.
I assume this is not going to make a relevant speed difference, and perhaps the AMX interactions with large arrays is just slow, but using heap allocation (alloca instead of malloc) is a possibility here as well. Once again may not make a relevant speed difference, and may even be dangerous (if you start allocating megabytes!)
Re: [REL] MySQL Plugin (****** Project) -
Misiur - 31.08.2013
Hi guys, last time (R8 ) there were some issues with mysql_format and linux - is this fixed now?