[Plugin] MySQL & PostgreSQL Plugin
#41

Quote:
Originally Posted by dnee
Посмотреть сообщение
You forgot

Add in mysql.inc
Код:
#define LOG_DEBUG                        1
#define LOG_INFO                        2
#define LOG_WARNING                        3
#define LOG_ERROR                        4

native MySQL:mysql_debug(debug_level);
I've changed to LOG level 3 [LOG_WARNING]
Код:
OnGameModeInit()
{
mysql_debug(LOG_WARNING);
}
Oh yes, I forgot completely.
Reply
#42

My server had 100-150k Line of Coding, 20-200 Peak users.

Dan.. Plug-ins seem used more cpu than BlugG (R6)
I think may be plugin had memory or cpu leak?

PS. No crash detected, No warning. Good work keep up!

Reply
#43

Is there a way to turn logging completely off?
Reply
#44

Quote:
Originally Posted by BrandyPenguin
Посмотреть сообщение
Is there a way to turn logging completely off?
mysql_debug(5);
Reply
#45

Quote:
Originally Posted by dnee
Посмотреть сообщение
mysql_debug(5);
To me it's logical if it would be 0 - but it's not in include?
Reply
#46

Quote:
Originally Posted by dnee
Посмотреть сообщение
My server had 100-150k Line of Coding, 20-200 Peak users.

Dan.. Plug-ins seem used more cpu than BlugG (R6)
I think may be plugin had memory or cpu leak?

PS. No crash detected, No warning. Good work keep up!

I'll try fixing that. Can you post logs and fragments of code? Are you using threaded or non-threaded queries? Are you freeing the result?

Quote:
Originally Posted by Bicentric
Посмотреть сообщение
This is interesting, what would be really cool if you decided to release a PostgreSQL plugin in the future! There already has been demand for one which you may have seen already:

https://sampforum.blast.hk/showthread.php?tid=413650
I'm planning on adding PostgreSQL as soon as MySQL is stable.
Reply
#47

Quote:
Originally Posted by Dan..
View Post
No new natives were added.
Then at-least change the documentation title to v0.6
Reply
#48

Quote:
Originally Posted by Dzines4SAMP
View Post
Then at-least change the documentation title to v0.6
I updated it.

--

Plugin updated to v1.0!
Reply
#49

You have an error in the documentation:

Code:
mysql_escape_string

Pings the MySQL server.

Syntax

mysql_escape_string(handle, src[], dest[], dest_len)

handle	<MySQL > The MySQL handle used for escaping the string.
src	< [] > The source of the unescaped string.
dest	< [] > The destination where the escaped string will be stored.
dest_len	 The capacity of the destination.

Returns

The length of the escaped string.

Remarks

Estimated stack usage

1 cells
Reply
#50

Quote:
Originally Posted by Gigi-The-Beast
View Post
You have an error in the documentation:

Code:
mysql_escape_string

Pings the MySQL server.

Syntax

mysql_escape_string(handle, src[], dest[], dest_len)

handle	<MySQL > The MySQL handle used for escaping the string.
src	< [] > The source of the unescaped string.
dest	< [] > The destination where the escaped string will be stored.
dest_len	 The capacity of the destination.

Returns

The length of the escaped string.

Remarks

Estimated stack usage

1 cells
Thank you!
Reply
#51

Update download links please.
Reply
#52

Quote:
Originally Posted by Richard_Gere
View Post
Update download links please.
Oh sorry, will do!
Reply
#53

best mysql plugin ever.
Reply
#54

Quote:
Originally Posted by Yiin
View Post
best mysql plugin ever.
Next update will make this best SQL plugin ever (it will support both, MySQL and PostgreSQL). I can't say any ETA, but I hope it will be soon.
Reply
#55

Quote:
Originally Posted by Dan..
View Post
Next update will make this best SQL plugin ever (it will support both, MySQL and PostgreSQL). I can't say any ETA, but I hope it will be soon.
PostgreSQL, finally! As I was waiting for this for a long time)
Reply
#56

Nice work Dan.
I'll try it.

Can you make more error messages, you know, like our friend said, ex.: "the db %s doesnt exist", etc.

This plugin is awesome, please, keep working and dont give up. =)
Reply
#57

Dan can u please update ur outdated example pwn thx
Reply
#58

Quote:
Originally Posted by ******
Посмотреть сообщение
Are you aware that the binaries in the first post don't match the include?

Edit: If anyone wants an updated example script using the newest plugin version (the one with "sql" not "mysql" function names, that currently you have to compile yourself):

https://github.com/Y-Less/YSI-Includ...sers/Dan10.inc

Edit 2: I keep getting a syntax error when I run this query through the plugin:

Код:
SELECT @Y:=MAX(yid) FROM y_users_preload;INSERT INTO y_users_preload VALUES(DEFAULT, @Y + 1, 'Alex', '9BD7575A156544838F2BD3A3DC2FAAADED4D88250B65EF82D6CFC5BE9179BBD8EF13000685376268DF705F6FC2F4FFC5254AF8D1ED3FD99B49B89FB9AF651D91', 'EN', 0, 1368148884);SELECT (@Y + 1);
However, it runs perfectly when done in phpMyAdmin (same SQL user). For reference, I'm copying that straight out of the debug logs in my server where it says what query is being run, and pasting it straight in to my control panel. Any clue why this is?
I've kept updating the plugin and the include is up-to-date relative to latest binary from master branch. Use the .inc file provided with .so or .dll file.

That query is not working fine because there are multiple queries and just the first one is executed. I will enable execution of multipe queries in the next version (I hope).

I suggest you make the `yid` primary key and use auto-increment attribute. http://dev.mysql.com/doc/refman/5.0/...increment.html

You can recieve the insert ID using mysql_insert_id.
Reply
#59

hmmmmmmmm ****** i just wanted dan to use his new functions together with his updates so it would be easier to understand
Reply
#60

Quote:
Originally Posted by ******
Посмотреть сообщение
Ok, I've written a few multi-query strings I'll have to check. Unfortunately I can't make yid unique as multiple names can be associated with the same account.
I've already added multiple result sets in v2.0. However, I won't release 2.0 until I finish PostgreSQL support.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)