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

hi all, i am changing my gamemode to the new system orm( i guess it is faster) but when i put the new version i see that this function
mysql_insert_id()
doesn't exists.
We have something similar? it gets the AUTO_INCREMENT id
Reply

Quote:
Originally Posted by caoraivoso3
Посмотреть сообщение
hi all, i am changing my gamemode to the new system orm( i guess it is faster) but when i put the new version i see that this function
mysql_insert_id()
doesn't exists.
We have something similar? it gets the AUTO_INCREMENT id
pawn Код:
cache_insert_id();
Read through the include
Reply

Hi, it's me again. After my update to R39-2 I noticed another problem: the plugin's performance on startup is very bad from localhost. Loading 66 rows with cache takes up to 12 seconds. This is the same for the other loading processes. My server even hangs because of it, going from OnPlayerConnect to OnPlayerRequestClass takes 102 (!!!) seconds. It worked like a charm before, when I was using R17.

I'm pretty sure I'm doing something wrong here. My OS is Windows 7 32-bit, I'm only using threaded queries (pqueries) in my script.
Reply

Quote:
Originally Posted by Danny
Посмотреть сообщение
Hi, it's me again. After my update to R39-2 I noticed another problem: the plugin's performance on startup is very bad from localhost. Loading 66 rows with cache takes up to 12 seconds. This is the same for the other loading processes. My server even hangs because of it, going from OnPlayerConnect to OnPlayerRequestClass takes 102 (!!!) seconds. It worked like a charm before, when I was using R17.

I'm pretty sure I'm doing something wrong here. My OS is Windows 7 32-bit, I'm only using threaded queries (pqueries) in my script.
Could you turn on mysql_log(LOG_ALL) and post the entire mysql_log.txt? It contains exact query execution times.
Reply

Quote:
Originally Posted by Mellnik
Посмотреть сообщение
Could you turn on mysql_log(LOG_ALL) and post the entire mysql_log.txt? It contains exact query execution times.
Sure, here you go: http://tny.cz/f9a692ad
Amount of rows: http://puu.sh/a2fNj/ade97206a3.png

Unfortunately this isn't the log which caused a 102-second server hang. I deleted that one accidentally. But still you can see here loading takes up to one and a half minute. I have never experience that with the old plugin version and I read some replies of people toying with huge amounts of data to test the plugin, and they were all able to get a much better load time out of it.

The hang appears to be random: this afternoon I could reproduce it ~10 times, but when I tried it an hour or so ago I couldn't after 5 attempts.

EDIT: The 230-sized table in the puush link is one we don't use, sorry for including it on the screenshot.
Reply

i have errors:

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3z-R3, ©2005-2014 SA-MP Team

[18:37:34] filterscripts = ""  (string)
[18:37:34] 
[18:37:34] Server Plugins
[18:37:34] --------------
[18:37:34]  Loading plugin: streamer
[18:37:34] 

*** Streamer Plugin v2.7.2 by Incognito loaded ***

[18:37:34]   Loaded.
[18:37:34]  Loading plugin: Whirlpool
[18:37:34]  
[18:37:34]  ==================
[18:37:34]  
[18:37:34]   Whirlpool loaded
[18:37:34]  
[18:37:34]  ==================
[18:37:34]  
[18:37:34]   Loaded.
[18:37:34]  Loading plugin: sscanf
[18:37:34] 

[18:37:34]  ===============================

[18:37:34]       sscanf plugin loaded.     

[18:37:34]          Version:  2.8.1        

[18:37:34]    © 2012 Alex "******" Cole  

[18:37:34]  ===============================

[18:37:34]   Loaded.
[18:37:34]  Loading plugin: mysql
[18:37:34]   Failed.
[18:37:34]  Loading plugin: nativechecker
[18:37:34]   Loaded.
[18:37:34]  Loaded 4 plugins.

[18:37:34] 
[18:37:34] Filterscripts
[18:37:34] ---------------
[18:37:34]   Loaded 0 filterscripts.

[18:37:34]    Error: Function not registered: 'mysql_log'
[18:37:34]    Error: Function not registered: 'mysql_connect'
[18:37:34]    Error: Function not registered: 'mysql_errno'
[18:37:34]    Error: Function not registered: 'mysql_tquery'
[18:37:34]    Error: Function not registered: 'mysql_format'
[18:37:34]    Error: Function not registered: 'cache_get_field_content_int'
[18:37:34]    Error: Function not registered: 'cache_get_field_content_float'
[18:37:34]    Error: Function not registered: 'cache_get_data'
[18:37:34]    Error: Function not registered: 'cache_get_field_content'
[18:37:34]    Error: Function not registered: 'cache_get_row_count'
[18:37:34] Script[gamemodes/gamemode.amx]: Run time error 19: "File or function is not found"
[18:37:34] Number of vehicle models: 0
Reply

Quote:
Originally Posted by iLegendary
Посмотреть сообщение
i have errors:

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3z-R3, ©2005-2014 SA-MP Team

[18:37:34] filterscripts = ""  (string)
[18:37:34] 
[18:37:34] Server Plugins
[18:37:34] --------------
[18:37:34]  Loading plugin: streamer
[18:37:34] 

*** Streamer Plugin v2.7.2 by Incognito loaded ***

[18:37:34]   Loaded.
[18:37:34]  Loading plugin: Whirlpool
[18:37:34]  
[18:37:34]  ==================
[18:37:34]  
[18:37:34]   Whirlpool loaded
[18:37:34]  
[18:37:34]  ==================
[18:37:34]  
[18:37:34]   Loaded.
[18:37:34]  Loading plugin: sscanf
[18:37:34] 

[18:37:34]  ===============================

[18:37:34]       sscanf plugin loaded.     

[18:37:34]          Version:  2.8.1        

[18:37:34]    © 2012 Alex "******" Cole  

[18:37:34]  ===============================

[18:37:34]   Loaded.
[18:37:34]  Loading plugin: mysql
[18:37:34]   Failed.
[18:37:34]  Loading plugin: nativechecker
[18:37:34]   Loaded.
[18:37:34]  Loaded 4 plugins.

[18:37:34] 
[18:37:34] Filterscripts
[18:37:34] ---------------
[18:37:34]   Loaded 0 filterscripts.

[18:37:34]    Error: Function not registered: 'mysql_log'
[18:37:34]    Error: Function not registered: 'mysql_connect'
[18:37:34]    Error: Function not registered: 'mysql_errno'
[18:37:34]    Error: Function not registered: 'mysql_tquery'
[18:37:34]    Error: Function not registered: 'mysql_format'
[18:37:34]    Error: Function not registered: 'cache_get_field_content_int'
[18:37:34]    Error: Function not registered: 'cache_get_field_content_float'
[18:37:34]    Error: Function not registered: 'cache_get_data'
[18:37:34]    Error: Function not registered: 'cache_get_field_content'
[18:37:34]    Error: Function not registered: 'cache_get_row_count'
[18:37:34] Script[gamemodes/gamemode.amx]: Run time error 19: "File or function is not found"
[18:37:34] Number of vehicle models: 0
The plugin failed to load: http://forum.sa-mp.com/showpost.php?...postcount=4921
Reply

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I've got already test, and doesn't work !
Reply

Quote:
Originally Posted by iLegendary
Посмотреть сообщение
i have errors:

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3z-R3, ©2005-2014 SA-MP Team

[18:37:34] filterscripts = ""  (string)
[18:37:34] 
[18:37:34] Server Plugins
[18:37:34] --------------
[18:37:34]  Loading plugin: streamer
[18:37:34] 

*** Streamer Plugin v2.7.2 by Incognito loaded ***

[18:37:34]   Loaded.
[18:37:34]  Loading plugin: Whirlpool
[18:37:34]  
[18:37:34]  ==================
[18:37:34]  
[18:37:34]   Whirlpool loaded
[18:37:34]  
[18:37:34]  ==================
[18:37:34]  
[18:37:34]   Loaded.
[18:37:34]  Loading plugin: sscanf
[18:37:34] 

[18:37:34]  ===============================

[18:37:34]       sscanf plugin loaded.     

[18:37:34]          Version:  2.8.1        

[18:37:34]    © 2012 Alex "******" Cole  

[18:37:34]  ===============================

[18:37:34]   Loaded.
[18:37:34]  Loading plugin: mysql
[18:37:34]   Failed.
[18:37:34]  Loading plugin: nativechecker
[18:37:34]   Loaded.
[18:37:34]  Loaded 4 plugins.

[18:37:34] 
[18:37:34] Filterscripts
[18:37:34] ---------------
[18:37:34]   Loaded 0 filterscripts.

[18:37:34]    Error: Function not registered: 'mysql_log'
[18:37:34]    Error: Function not registered: 'mysql_connect'
[18:37:34]    Error: Function not registered: 'mysql_errno'
[18:37:34]    Error: Function not registered: 'mysql_tquery'
[18:37:34]    Error: Function not registered: 'mysql_format'
[18:37:34]    Error: Function not registered: 'cache_get_field_content_int'
[18:37:34]    Error: Function not registered: 'cache_get_field_content_float'
[18:37:34]    Error: Function not registered: 'cache_get_data'
[18:37:34]    Error: Function not registered: 'cache_get_field_content'
[18:37:34]    Error: Function not registered: 'cache_get_row_count'
[18:37:34] Script[gamemodes/gamemode.amx]: Run time error 19: "File or function is not found"
[18:37:34] Number of vehicle models: 0
same error
Reply

Many people have this error and no solution given by the FAQ works..
Reply

I have the same problem but my plugin (mysql.dll) is loaded .

i have the last a_mysql (R39-2) include and mysql R7 plugin
Quote:

[13:21:08] Server Plugins
[13:21:08] --------------
[13:21:08] Loading plugin: mysql.dll
[13:21:08]

> MySQL plugin R7 successfully loaded.

[13:21:08] Loaded.
[13:21:08] Loading plugin: nativechecker
[13:21:08] Loaded.
[13:21:08] Loaded 2 plugins.

[13:21:08]
[13:21:08] Filterscripts
[13:21:08] ---------------
[13:21:08] Loaded 0 filterscripts.

[13:21:08] Error: Function not registered: 'mysql_tquery'
[13:21:08] Error: Function not registered: 'cache_insert_id'
[13:21:08] Error: Function not registered: 'cache_get_row_int'
[13:21:08] Error: Function not registered: 'cache_affected_rows'
[13:21:08] Error: Function not registered: 'cache_get_row_float'
[13:21:08] Error: Function not registered: 'cache_get_field_content_int'
[13:21:08] Error: Function not registered: 'mysql_log'
[13:21:08] Script[gamemodes/wallace.amx]: Run time error 19: "File or function is not found"
[13:21:08] Number of vehicle models: 0
[13:21:21] --- Server Shutting Down.
[13:21:21]

Reply

r39 inlude, r7 plugin, how the hell is that going to work?

go Github and check the latest release.

https://github.com/pBlueG/SA-MP-MySQL/releases
Reply

@Patrick_ : This is not an acceptable solution.

I mean, if he hadn't have the good include version, this would be a compiler error message, and thus not a run time error message.
Reply

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
@Patrick_ : This is not an acceptable solution.

I mean, if he hadn't have the good include version, this would be a compiler error message, and thus not a run time error message.
wat?

Quote:
Originally Posted by [Mr]Wallace
Посмотреть сообщение
I have the same problem but my plugin (mysql.dll) is loaded .

i have the last a_mysql (R39-2) include and mysql R7 plugin
Don't you see your mistake there?
Reply

Quote:
Originally Posted by iLegendary
Посмотреть сообщение
Many people have this error and no solution given by the FAQ works..
Many people (in our case exactly 2) also underestimate the solution with redistributables and don't install them or just place some .dll's randomly downloaded from some shady dll-sites and place them somewhere to make things work.
So if you really correctly installed those 3 x86 (32 bit) redistributables and it still don't works, make sure that
  • your Windows is up2date
  • you are using the correct libmysql.dll
  • you never "installed" (placed manually) some .dll's you downloaded from the internet
Which version of Windows are you using btw?


Quote:
Originally Posted by S4t3K
Посмотреть сообщение
@Patrick_ : This is not an acceptable solution.

I mean, if he hadn't have the good include version, this would be a compiler error message, and thus not a run time error message.
This is the only solution. Do you really think you can't compile a script with a higher-version include and run that script with a lower-version plugin? Well of course you can do that, just like MrWallace.
Reply

Window 7 Family Prenium SP1 (x64)
Reply

Suggestion for future version:

pawn Код:
native mysql_query_file(connectionHandle, file[], callback[] = "", format[] = "", {Float,_}:...);
native mysql_tquery_file(connectionHandle, file[], callback[] = "", format[] = "", {Float,_}:...);
native mysql_pquery_file(connectionHandle, file[], callback[] = "", format[] = "", {Float,_}:...);
That functions would read queries from the file and then fire it. It's scriptable of course, but currently I have to buffer every statement (query) in the file and then fire it one by one. Plus, you can dynamically allocate and release the memory where the query is stored in the plugin. I'm currently using it to set up the database if tables aren't created already.

It's nothing important, but if you run out of ideas, why not?
Reply

Quote:
Originally Posted by iLegendary
Посмотреть сообщение
Window 7 Family Prenium SP1 (x64)
And you are sure you followed all points I mentioned? I honestly can't see any other reason apart from wrong dll-management and missing redistributables. You could also try starting the server in compatibility mode with administrator rights.

Quote:
Originally Posted by Pupak
Посмотреть сообщение
Suggestion for future version:

pawn Код:
native mysql_query_file(connectionHandle, file[], callback[] = "", format[] = "", {Float,_}:...);
native mysql_tquery_file(connectionHandle, file[], callback[] = "", format[] = "", {Float,_}:...);
native mysql_pquery_file(connectionHandle, file[], callback[] = "", format[] = "", {Float,_}:...);
That functions would read queries from the file and then fire it. It's scriptable of course, but currently I have to buffer every statement (query) in the file and then fire it one by one. Plus, you can dynamically allocate and release the memory where the query is stored in the plugin. I'm currently using it to set up the database if tables aren't created already.

It's nothing important, but if you run out of ideas, why not?
I'll think about it, but it's a nice idea (so it's likely that I will implement this in R40).
Reply

Ok, i fixed problem : i reinstall my window 7, i fixed mscvp100 and other, and i reinstall one per one redistributables
Reply

I'm sorry for 'bumping' my question, but can anybody help me out with this? I'm kinda on a schedule.

Quote:
Originally Posted by Danny
Посмотреть сообщение
Hi, it's me again. After my update to R39-2 I noticed another problem: the plugin's performance on startup is very bad from localhost. Loading 66 rows with cache takes up to 12 seconds. This is the same for the other loading processes. My server even hangs because of it, going from OnPlayerConnect to OnPlayerRequestClass takes 102 (!!!) seconds. It worked like a charm before, when I was using R17.

I'm pretty sure I'm doing something wrong here. My OS is Windows 7 32-bit, I'm only using threaded queries (pqueries) in my script.
Quote:
Originally Posted by Danny
Посмотреть сообщение
Sure, here you go: http://tny.cz/f9a692ad
Amount of rows: http://puu.sh/a2fNj/ade97206a3.png

Unfortunately this isn't the log which caused a 102-second server hang. I deleted that one accidentally. But still you can see here loading takes up to one and a half minute. I have never experience that with the old plugin version and I read some replies of people toying with huge amounts of data to test the plugin, and they were all able to get a much better load time out of it.

The hang appears to be random: this afternoon I could reproduce it ~10 times, but when I tried it an hour or so ago I couldn't after 5 attempts.

EDIT: The 230-sized table in the puush link is one we don't use, sorry for including it on the screenshot.
In the meantime I've been able again to reproduce the hang-issues. With some optimisations (replacing cache_get_row by cache_get_row_int/float in some places) I succeeded in reducing the hang time from > 100 to 81 seconds. But the issue hasn't been solved yet: I never had issues like this with the old plugin.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)