SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/01/2010, 05:49 PM   #21
StrickenKid
Gangsta
 
Join Date: Feb 2009
Posts: 773
Reputation: 41
Default Re: [REL] SA:MP MySQL Plugin 1.0

Quote:
Originally Posted by Dreft
Ok, i turned off mysql_log() which was printing that all row and crash gone I wish that you fix this problem :P

Thanks for plugin again, it will change old G-Stylezz plugin for sure
Ah ok, so it's with the log feature, I will see what's wrong with it when I get back home, I'm on iPhone ATM.
StrickenKid is offline   Reply With Quote
Old 24/01/2010, 06:59 PM   #22
pliva_sb
Big Clucker
 
pliva_sb's Avatar
 
Join Date: Mar 2009
Location: Croatia
Posts: 121
Reputation: 1
Default Re: [REL] SA:MP MySQL Plugin 1.0

Nice work Ethan...
pliva_sb is offline   Reply With Quote
Old 24/01/2010, 07:35 PM   #23
Dreftas
Gangsta
 
Join Date: May 2008
Posts: 639
Reputation: 0
Default Re: [REL] SA:MP MySQL Plugin 1.0

Erm...
Code:
stock ConfigRace()
{
	new CpCfgStr[4][56];
	sInfo[MaxRaces] = -1;
	for(new cfg = 0; cfg < 50; cfg++)
	{
		format(query,sizeof(query),"SELECT * FROM races WHERE raceid = %d",cfg);
		mysql_query(query);
		mysql_store_result();
		
		if(mysql_num_rows() != 0)
		{
			mysql_fetch_row(line);
			
			mysql_get_field("name",sql);
			format(rInfo[cfg][Name],128,"%s",sql);
			
			mysql_get_field("minx",sql);
			rInfo[cfg][minX] = floatstr(sql);
			
			mysql_get_field("maxx",sql);
			rInfo[cfg][maxX] = floatstr(sql);
			
			mysql_get_field("miny",sql);
			rInfo[cfg][minY] = floatstr(sql);
			
			mysql_get_field("maxy",sql);
			rInfo[cfg][maxY] = floatstr(sql);
			
			mysql_get_field("Z", sql);
			rInfo[cfg][spawnZ] = floatstr(sql);
			
			for(new ccfg = 1; ccfg < 26; ccfg++)
			{
				format(CpCfgStr[0],56,"cp%d_x",ccfg);
				format(CpCfgStr[1],56,"cp%d_y",ccfg);
				format(CpCfgStr[2],56,"cp%d_z",ccfg);
				format(CpCfgStr[3],56,"cp%d_param",ccfg);
				
				mysql_get_field(CpCfgStr[0], sql);
				rCP[cfg][ccfg][Xr] = floatstr(sql);
				
				mysql_get_field(CpCfgStr[1], sql);
				rCP[cfg][ccfg][Yr] = floatstr(sql);
				
				mysql_get_field(CpCfgStr[2], sql);
				rCP[cfg][ccfg][Zr] = floatstr(sql);
				
				mysql_get_field(CpCfgStr[3], rCP[cfg][ccfg][option]);
			}
			sInfo[MaxRaces]++;
		}
		mysql_free_result();
	}
	return 1;
}

As you can see i have mysql_free_result() at the end, but it doesn't free RAM memory usage. I started this ConfigRace() function 500 times and it increased my samp-server.exe by ~20MB. Is mysql_free_result() bugged in this plugin like in another two?

P.S. I have mysql_get_field...
Code:
#define mysql_get_field(%1,%2) mysql_fetch_field(%1,%2)
Dreftas is offline   Reply With Quote
Old 24/01/2010, 07:38 PM   #24
MenaceX^
High-roller
 
Join Date: Aug 2008
Posts: 3,780
Reputation: 13
Default Re: [REL] SA:MP MySQL Plugin 1.0

#define mysql_get_field(%1,%2) mysql_fetch_field(%1,%2)
What's that for?
MenaceX^ is offline   Reply With Quote
Old 24/01/2010, 07:49 PM   #25
Dreftas
Gangsta
 
Join Date: May 2008
Posts: 639
Reputation: 0
Default Re: [REL] SA:MP MySQL Plugin 1.0

Quote:
Originally Posted by MenaceX^
#define mysql_get_field(%1,%2) mysql_fetch_field(%1,%2)
What's that for?
Everywhere i have mysql_get_field and I every time write mysql_get_field so instead of writing mysql_fetch_field i make that define and use mysql_get_field but problem not there. What about that memory usage and free_result() ?
Dreftas is offline   Reply With Quote
Old 24/01/2010, 07:53 PM   #26
MenaceX^
High-roller
 
Join Date: Aug 2008
Posts: 3,780
Reputation: 13
Default Re: [REL] SA:MP MySQL Plugin 1.0

I've no idea.
You'll have to wait for Ethan.


Ethan:
Will you make the mysql_next_field?
MenaceX^ is offline   Reply With Quote
Old 24/01/2010, 08:10 PM   #27
StrickenKid
Gangsta
 
Join Date: Feb 2009
Posts: 773
Reputation: 41
Default Re: [REL] SA:MP MySQL Plugin 1.0

Ah, ok, I have fixed it, it was a small memory leak. I will post it in a sec.
StrickenKid is offline   Reply With Quote
Old 24/01/2010, 08:15 PM   #28
Toney
Big Clucker
 
Join Date: Oct 2009
Posts: 117
Reputation: 0
Default Re: [REL] SA:MP MySQL Plugin 1.0

StrickenKid - <__Ǝthan__> very good thanks for your plugin!
Toney is offline   Reply With Quote
Old 24/01/2010, 08:36 PM   #29
Cr0ssFir3
Big Clucker
 
Cr0ssFir3's Avatar
 
Join Date: Oct 2007
Posts: 99
Reputation: 0
Default Re: [REL] SA:MP MySQL Plugin 1.0

Keep up the great work.

I see we have a new MySQL plugin more stable and with a creator who is interested in his proper working order and that fixes the flaws that are noted by the rest of the community.

Again congratulations.


I will use this!!!
Cr0ssFir3 is offline   Reply With Quote
Old 24/01/2010, 08:51 PM   #30
Dreftas
Gangsta
 
Join Date: May 2008
Posts: 639
Reputation: 0
Default Re: [REL] SA:MP MySQL Plugin 1.0.1

Whoa! Cool! mysql_Free_result() works Thx
Dreftas 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
[Plugin] [REL] MySQL Plugin (Now on github!) BlueG Plugin Development 6140 18/03/2018 10:36 AM
Best MySQL Plugin? Antonio [G-RP] Help Archive 3 10/01/2011 01:31 AM
Best MySQL plugin? DRIFT_HUNTER Help Archive 2 07/12/2010 03:43 PM
Which MySQL plugin? Whois. Help Archive 0 07/04/2010 11:55 AM
Mysql Plugin Help Jbosh123 Help Archive 0 04/09/2009 11:35 AM


All times are GMT. The time now is 11:56 AM.


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