Posts: 352
	Threads: 37
	Joined: Jun 2012
	
	
 
	
	
		I was thinking of a new feature while reading this thread: 
http://forum.sa-mp.com/showthread.ph...09#post3513809
pawn Код:
enum
{
    FIELD_TYPE_INT, // int, tinyint, etc.
    FIELD_TYPE_ARRAY, // varchar, text, etc.
    FIELD_TYPE_FLOAT, // float, double
}
#define FIELD_TYPE_STRING FIELD_TYPE_ARRAY
native cache_get_field_type(field_index, connectionHandle = 1);
native cache_get_field_name_type(const field_name[], connectionHandle = 1); // should be renamed, I couldn't think of a better name
 
	
		
	
 
 
	
	
	
		
	Posts: 361
	Threads: 16
	Joined: Aug 2013
	
	
 
 
	
	
	
		
	Posts: 845
	Threads: 3
	Joined: Jun 2010
	
	
 
	
	
		
Quote:
| 
					Originally Posted by b3nz  The problem is that I can't use newer version than R34, as right now I'm using Windows XP, which doesn't support KERNEL32 library.
 EDIT: pool_size was added in R35, so I can't even use it. :\
 | 
 Okay, try re-downloading and re-installing R34 (re-installing = replacing all files with the new download; don't forget the libmysql.dll!).
Quote:
| 
					Originally Posted by kvann  I was thinking of a new feature while reading this thread: http://forum.sa-mp.com/showthread.ph...09#post3513809 
pawn Код: enum{
 FIELD_TYPE_INT, // int, tinyint, etc.
 FIELD_TYPE_ARRAY, // varchar, text, etc.
 FIELD_TYPE_FLOAT, // float, double
 }
 #define FIELD_TYPE_STRING FIELD_TYPE_ARRAY
 
 native cache_get_field_type(field_index, connectionHandle = 1);
 native cache_get_field_name_type(const field_name[], connectionHandle = 1); // should be renamed, I couldn't think of a better name
 | 
 May I ask what kind of purpose those functions would serve?
	
 
	
	
	
		
	
 
 
	
	
	
		
	Posts: 352
	Threads: 37
	Joined: Jun 2012
	
	
 
	
	
		Nah, it ain't necassary anymore. Forget about it. 
 
	
		
	
 
 
	
	
	
		
	Posts: 2,528
	Threads: 124
	Joined: Jul 2009
	
Reputation: 
0
	 
	
	
		Hm, no idea why I haven't asked about this before: Is there a way for bulk orm operations? Say, send them as a transaction? Would normal tquery with transaction start beforehand suffice?
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 845
	Threads: 3
	Joined: Jun 2010
	
	
 
	
	
		
Quote:
| 
					Originally Posted by Misiur  Hm, no idea why I haven't asked about this before: Is there a way for bulk orm operations? Say, send them as a transaction? Would normal tquery with transaction start beforehand suffice? | 
 All ORM queries use the same direct database connection mysql_tquery uses, thus it should suffice to start/end an transaction through mysql_tquery before/after calling orm_select/orm_update/orm_insert/orm_delete.
	
 
	
	
	
		
	
 
 
	
	
	
		
	Posts: 2,528
	Threads: 124
	Joined: Jul 2009
	
Reputation: 
0
	 
	
	
		Neat! One more question. If I did chain of queries like: tquery -> callback -> multiple pqueries -> ensure all are finished -> tquery, can I be certain the order (not of the multiple pqueries, just this chain) is preserved?
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 845
	Threads: 3
	Joined: Jun 2010
	
	
 
	
	
		
Quote:
| 
					Originally Posted by Misiur  Neat! One more question. If I did chain of queries like: tquery -> callback -> multiple pqueries -> ensure all are finished -> tquery, can I be certain the order (not of the multiple pqueries, just this chain) is preserved? | 
 Yes, that call chain should work just as you stated.
Quote:
| 
					Originally Posted by b3nz  Sorry for a late answer, I totally forgot about it, as this crash seems to be random (not everytime the server is being shut). Nope, it didn't help (but why should it? The last modificate date of each R34 version file is 2013 October, same as it was before). | 
 Because people often tend to ignore replacing the libmysql.dll, because they think it doesn't change between releases (which it does, but not on every release).
Does your crash log change on every crash or is it always the same (always crashing at mysql_close in OnGameModeExit)?
	
 
	
	
	
		
	
 
 
	
	
	
		
	Posts: 845
	Threads: 3
	Joined: Jun 2010
	
	
 
	
	
		Can you try to insert a delay before calling mysql_close? Something like this:
Код:
public OnGameModeExit()
{
    new tc = tickcount();
    while((tickcount() - tc) < 2000)
    { }
    mysql_close();
}
 
	
		
	
 
 
	
	
	
		
	Posts: 47
	Threads: 8
	Joined: Jun 2015
	
Reputation: 
0
	 
	
	
		Seems like setting up a delay before calling the function fixed it. Thanks! I'll post here if anything still goes wrong with the mysql_close.
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 99
	Threads: 12
	Joined: Feb 2012
	
Reputation: 
0
	 
	
	
		Does it close all unclosed connections automatically? Is it necessary to use mysql_close() every time I exit server / make new connection (to the same db)? I have FS using MySQL BlueG to install on server using this too. If server's connection and fs' connection lead at the same database, their handle IDs will be matched, so when fs' connection is closing another's closing too. How can I prevent it?
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 845
	Threads: 3
	Joined: Jun 2010
	
	
 
	
	
		
Quote:
| 
					Originally Posted by kadaradam  Can you please add a more accurate error, warning logging? Because there's not much info in these: 
Код: [11:56:48] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
[20:35:25] [WARNING] CMySQLResult::GetRowData - invalid row ('0') or field index ('0') And also would be cool to add year, month and day to the logging. | 
 R40.
Quote:
| 
					Originally Posted by BRICS  Does it close all unclosed connections automatically? Is it necessary to use mysql_close() every time I exit server / make new connection (to the same db)? I have FS using MySQL BlueG to install on server using this too. If server's connection and fs' connection lead at the same database, their handle IDs will be matched, so when fs' connection is closing another's closing too. How can I prevent it? | 
 The plugin closes all connection on proper server exit.
If you call
Код:
mysql_option(DUPLICATE_CONNECTIONS, true);
 before creating a connection, connections with matching credentials won't be detected as duplicate connections (thus every created connection will be unique).
Quote:
| 
					Originally Posted by Johurt  "Rida" save 1.174e.5  instead of 117415 . Printf  show correct value (117415). I use MySQL R39-3 . It is bug? 
EDIT: This problem only with mysql_format , with format  all ok. | 
 This is not really a bug, but part of the IEEE 754 floating point standard. This is just an other way of representing a number. Try reading in that "weird" float value and check if it outputs the correct float value - it should.
	
 
	
	
	
		
	
 
 
	
	
	
		
	Posts: 1,144
	Threads: 101
	Joined: Apr 2011
	
Reputation: 
0
	 
	
	
		Is there any method of using ORM and MD5? Because my server passwords are md5 and would like to start using ORM.
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 845
	Threads: 3
	Joined: Jun 2010
	
	
 
	
	
		You'd need to hash them on the PAWN-side with a function (there are a lot of plugins here that provide many hash functions). Alternatively you can send your own queries and use orm_apply_cache.
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 607
	Threads: 90
	Joined: Feb 2011
	
Reputation: 
0
	 
	
	
		Why I have poor load time on Windows 10 Pro(using WAMP server)? On Windows Pro 8.1 I didn't had poor load time.