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

Quote:
Originally Posted by DeathKing
View Post
Code:
[23:02:05]  Loading plugin: mysql
[23:02:05]  >> plugin.mysql: Multi-Threading is deactivated due to bad CPU.
[23:02:05]  >> plugin.mysql: R26 successfully loaded.
[23:02:05]   Loaded.
how am i suppose to multi thread any other ways?
Multi-Threading is just to improve the speed of queries, it isn't obligatory to have it enabled, the speed is still good without it. You should read above, Pain123 said that Multi-Threading is enabled when you have 3+ cores at CPU.

EDIT: Didn't saw Pain123's reply, I didn't refreshed this page few minutes. xD
Reply

Code:
[23:02:05]  >> plugin.mysql: Multi-Threading is deactivated due to bad CPU.
A 2 core CPU isn't always bad, so you can have the error message as "Incompatible CPU for Multi-threading (3 cores and above required)".

Anyways, it isn't required, just saying.
Reply

Yep, I'll change the message.
Has anyone any other suggestions? R27 has now y_inline support, but only this as feature seems quite boring.
A preview:
pawn Code:
public OnPlayerConnect(playerid) {
    inline Test2(d1, d2) {
        new
                Rows,
                Fields;
        cache_get_data(Rows, Fields, SQL);
        printf("Rows: %d; Fields: %d", Rows, Fields);
    }

    mysql_tquery_inline(SQL, Query, using inline Test2, "dd", 22, 42);
    return 1;
}
Reply

Any idea why this wouldn't be working at all. Not been paying a attention of updates since R20.

Code:
mysql_function_query(dbHandle, "SELECT * FROM properties", true, "LoadProp", "", "");
Code has came to a complete halt. Doesn't even work, ju took a somewhat big leap from r20 to r26.

I don't need to go any further, as LoadProp is not called.
Reply

Are any errors or warnings logged?
Reply

Quote:
Originally Posted by Pain123
View Post
Yep, I'll change the message.
Has anyone any other suggestions? R27 has now y_inline support, but only this as feature seems quite boring.
A preview:
pawn Code:
public OnPlayerConnect(playerid) {
    inline Test2(d1, d2) {
        new
                Rows,
                Fields;
        cache_get_data(Rows, Fields, SQL);
        printf("Rows: %d; Fields: %d", Rows, Fields);
    }

    mysql_tquery_inline(SQL, Query, using inline Test2, "dd", 22, 42);
    return 1;
}
This looks like non-threaded, will it benefit performance in any way? Or just be easier to use?
Reply

Quote:
Originally Posted by Richie©
View Post
This looks like non-threaded, will it benefit performance in any way? Or just be easier to use?
It isn't, I thought it was too.

Basically it just allows the callback to be put in the function where you call the query.
Reply

Quote:
Originally Posted by KyleSmith
View Post
It isn't, I thought it was too.

Basically it just allows the callback to be put in the function where you call the query.
Its called exactly from inline is used?
Reply

This might look like a noob-question but I get the error error 017: undefined symbol "mysql_query_callback" and in the include there's this define which uses the mysql_function_query() function which leads to the question - what causes this error?
Reply

I removed that define is a previous revision, what version are you using? (R8, R14, ...)
And why don't you just use mysql_function_query?
Reply

I cant load it, it says This application has failed to start because LIBMYSQL.dll was not found. PLEASE HELP?
Reply

libmysql.dll is located on the exact same page from which you've downloaded the plugin. You can find it at the end of the first post, too.
Reply

I'm using mysql r7 and the server crashes when using mysql_ping(), mysql_format() and mysql_stats().

Also, when I restart my server there are a lot of players connecting in less than one minute (200-300) so there are a lot of queryes that are executed (to check passwords, bans and stuff). When that happens, sometimes the players get the login box twice (the login box appears at the end of a query), some don't get it at all. That only happens after the server starts and there are a lot of players connecting so I think that there's a problem with the plugin and not with my gamemode .
I'm planning to use a timer and let x number of players connect every minute and have the rest of them wait for a minute or two if this problem can't be solved by upgrading to mysql r8.

Is mysql R8 solving any of those problems?
Is mysql R8 as stable as mysql R7?
Reply

Why not upgrading to R26? It seems pretty stable and has AFAIK no bugs in it. It's also way faster than R7 or R8.
Reply

Is it MySQL R8 or MySQL R7 REV 26? Pretty confused.
Reply

Quote:
Originally Posted by Riddy
View Post
Is it MySQL R8 or MySQL R7 REV 26? Pretty confused.
When I was developing this plugin I got rid of the Rx REVy naiming because it was confusing. The latest version of this plugin is "sa-mp-mysql-plugin r26".
Reply

Upgraded to r26 today. Same problem.

Quote:

when I restart my server there are a lot of players connecting in less than one minute (200-300) so there are a lot of queryes that are executed (to check passwords, bans and stuff). When that happens, sometimes the players get the login box twice (the login box appears at the end of a query), some don't get it at all. That only happens after the server starts and there are a lot of players connecting so I think that there's a problem with the plugin and not with my gamemode.

Reply

Quote:
Originally Posted by im
View Post
Upgraded to r26 today. Same problem.
I tried to reproduce this with sending a big query 1000 times and fetching the result with 2 different methods. Every time the callback was called once. If this would be a problem with the plugin there would be far more complaints. So it's likely a problem with your gamemode or server (maybe huge lags? 200-300 players shouldn't cause a too big lag). Try optimizing your gamemode, like sending only one query per player to load data, for example
PHP Code:
SELECT a.*, b.* FROM players AS ainventory AS b WHERE a.ID b.PID AND a.ID '3' 
instead of multiple queries to load data out of different tables.
Reply

When i use "AS" in a query in which var will be the result?
Reply

pawn Code:
cache_get_field_content_int(0, "ID");
will give you the ID of field 'a.ID'. If there is a field in table b with the same name you will always get only one result (most likely the one from the first table, in our example this would be 'players'). The only solution is to rename the field directly in the table or to use an alias in the query:
PHP Code:
SELECT a.ID AS IDab.ID AS IDb FROM ... 
Reply


Forum Jump:


Users browsing this thread: 13 Guest(s)