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

I have a table that has 1030 rows in it that doesn't seem to load on my Linux box. It won't even return any rows. However, all of the other MySQL stuff seems to work completely fine so I don't see what the problem is. Loading the table on a 15 second timer seemed to do the trick, but why would I have to do that when I didn't have to do that in the past? Could it be due to the multithreading..?

Quote:

Loading plugin: mysql.so
[17:36:36] >> plugin.mysql: running on 1 thread.
[17:36:36] >> plugin.mysql: R31 successfully loaded.
[17:36:36]

Reply

How can i check that connection is alive in version R31? There is no mysql_ping function.
And what does this function?:
pawn Код:
mysql_tquery(connectionHandle, query[], callback[], format[], {Float,_}:...);
Reply

mysql_tquery(connectionHandle, query[], callback[], format[], {Float,_}:...);

is like mysql_function_query and mysql_tquery hasn't the parameter bool: .

Ex:

pawn Код:
new Query[ 256 ];
format( Query, sizeof Query, "SELECT `Name` FROM `Users` WHERE `Id` = %d", GetPlayerId( playerid ) );
mysql_tquery( 1, Query, "", "" );
And mysql_ping was removed . You can go at OnQueryError and add this:

pawn Код:
switch( errorid )
{
     case 2006: print( "Couldn't connect to database" );
}
Reply

But tquery allow to read data using cache functions ?
Reply

Quote:
Originally Posted by QuaTTrO
Посмотреть сообщение
But tquery allow to read data using cache functions ?
It is exactly like mysql_function_query, but the bool:cache parameter has been removed. Just transform it. (the MySQL include also has an wrapper for mysql_function_query)
Reply

I'm running the dynamic version of R31. My MySQL server version is 5.1.69.
Reply

When r33 will be released ?
Reply

Quote:
Originally Posted by Sp3cter
Посмотреть сообщение
When r33 will be released ?
Quote:
Originally Posted by Pain123
Посмотреть сообщение
It [...] depends on when the tutorial for the ORM system will be done and how long one of my beta testers needs to test new beta versions because of an evil bug.
4char
Reply

Great job
Reply

So im in the process of updating the MySQL plugin from r7 to the newest version r31 currently running centos 5.9 and i keep getting this error...

Код:
[16:13:40]   Failed (/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by plugins/mysql_static.so))
That error is from the static build, i also have libstdc++.so.6 installed...


What should i do from here?

I also tried the dynamic(not the static build one) and i get.....
Код:
[16:51:05]   Failed (/usr/lib/libmysqlclient_r.so.16: version `libmysqlclient_16' not found (required by plugins/mysql.so))
I assume there is something wrong since that is white in the ls command results.
Reply

Quote:
Originally Posted by Kar
Посмотреть сообщение
Which version is this?

I have this issue also, the rows would return -1 so thats how I know how to fix it, try my fix. Yes it only happens on linux.

pawn Код:
if(rows == -1) {
        printf("[System: LoadHousesFromDatabase:: FAILED] - Reattempting");
        LoadHousesFromDatabase();
    }
    else { // Passed, do stuff now
        CalculateMillLevy();
        CheckHouseLastVisits();
    }
I had same problem with R31, it wouldnt load vehicles (900+ rows) or count number of accounts, sometimes. This was very annoying as i had to restart server. I didnt care to apply this fix, i just downgraded to R26.
Reply

I've installed R31, but it tells me: undefined symbol "mysql_ping"

Why does it? It didn't do this before.
Reply

Hello!

Someone would write an example R31 PLUGIN:
native cache_affected_rows (connectionHandle = 1);
native cache_insert_id (connectionHandle = 1);

Use these two functions?
I always return a value of zero.
I tried this way:

format (string, sizeof (string), "% d blalala, cache_affected_rows (connectionHandle = 1)


Sorry bad, English..
Reply

Pain, is it possible to run a query before the server exits?


--
Quote:
Originally Posted by .Mento
Посмотреть сообщение
I've installed R31, but it tells me: undefined symbol "mysql_ping"

Why does it? It didn't do this before.
I THINK this function was removed.
Reply

@Prodigy: If the connection to the MySQL server doesn't even exist, how do you expect to run a query? What would be the point...?

@.Mento: Yes, mysql_ping has been removed. Take a look at some of the examples in the previous pages of using mysql_errno to determine if the connection to the MySQL server succeeded or not.

@d711728: You're pretty much doing it correctly. This would be the correct way:

pawn Код:
format(string, sizeof(string), "%d rows were affected.", cache_affected_rows());
Reply

Okey,thx.
Reply

Maybe I found a little bug while using y_inline on your plugin.

Using a string in "mysql_tquery_inline(1,Query,using inline EditRaceInline,"iis",playerid,id,racename);" (string -> racename) and calling it in the inline func "inline EditRaceInline(pid,edit_id,string:namerace[])" will output only the first letter of the string.

Exampe: sardupdate as racename will output in Inline as "s".

So, is it a bug?
Reply

I've tried to run a R-31 compiled gamemode, it compiles it without a problem but when I startup samp server.exe I'm getting this error:


Reply

Quote:
Originally Posted by x96664
Посмотреть сообщение
I've tried to run a R-31 compiled gamemode, it compiles it without a problem but when I startup samp server.exe I'm getting this error:


You need Visual C++ Redistributable

http://www.microsoft.com/en-us/downl....aspx?id=30679
Reply

Edit: Problem solved! (I forgot to install one of these).
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)