29.08.2013, 10:38
[Plugin] [REL] MySQL Plugin (Now on github!)
29.08.2013, 10:55
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!
29.08.2013, 11:38
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?
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?
29.08.2013, 11:56
R33 is much much faster than R31. I ran few tests with caches an speed is awesome.
29.08.2013, 12:05
29.08.2013, 12:13
He is one of my beta testers.
29.08.2013, 12:18
Ah, sorry about that mate!
29.08.2013, 12:45
Quote:
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? |
new Float:asd = 5.123456;
with:
%.1f 5.1
%.2f 5.12
%.4f 5.1234
29.08.2013, 14:41
thanks
29.08.2013, 18:54
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!
The speed is amazing!
Thank you guys for your hard work on this plugin!
30.08.2013, 10:17
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?
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?
30.08.2013, 13:20
Quote:
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? |
Код:
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`) )", "", "");
Quote:
Pawn compiler 6.3.3166 Copyright © 1997-2011, ITB CompuPhase [Finished in 0.6s] |
30.08.2013, 14:43
what you change? please explain i already have the last plugin
30.08.2013, 15:10
Hi!
I ask that when you are expected to appear in the r33?
sorry bad english..
I ask that when you are expected to appear in the r33?
sorry bad english..
30.08.2013, 15:18
Read the thread..
http://forum.sa-mp.com/showpost.php?...postcount=4158
http://forum.sa-mp.com/showpost.php?...postcount=4158
30.08.2013, 15:28
Quote:
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? |
31.08.2013, 10:02
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
How i can do that? thanks if anyone can helpme
31.08.2013, 13:19
Is it possible to speed up mysql_real_escape_string?
It takes 193ms for me for about 600 length string.
I'm using R30.
It takes 193ms for me for about 600 length string.
I'm using R30.
31.08.2013, 15:23
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:
What the plugin native then does is:
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!)
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
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);
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!)
31.08.2013, 18:55
Hi guys, last time (R8 ) there were some issues with mysql_format and linux - is this fixed now?
« Next Oldest | Next Newest »
Users browsing this thread: 19 Guest(s)