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
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. :\ |
I was thinking of a new feature while reading this thread: http://forum.sa-mp.com/showthread.ph...09#post3513809
pawn Код:
|
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?
|
Okay, try re-downloading and re-installing R34 (re-installing = replacing all files with the new download; don't forget the libmysql.dll!).
|
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?
|
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).
|
[01:00:34] [debug] Server crashed while executing bcrpg_main.amx [01:00:34] [debug] AMX backtrace: [01:00:34] [debug] #0 native mysql_close () from mysql.dll [01:00:34] [debug] #1 00073fd8 in ?? (... <1073741823 arguments>) at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\gamemodes\bcrpg_main.pwn:84 [01:00:34] [debug] #2 0000b640 in public ScriptInit_OnGameModeExit () at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30 [01:00:34] [debug] #3 00001114 in public OnGameModeExit () at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\pawno\include\YSI\..\YSI_Coding\..\YSI_Internal\..\YSI_Server\y_scriptinit.inc:213 [01:00:35] [debug] Native backtrace: [01:00:35] [debug] #0 72632074 in ?? () from samp-server.exe [01:00:35] [debug] #1 010979d4 in ?? () from LIBMYSQL.dll [00:23:27] [debug] Server crashed while executing bcrpg_main.amx [00:23:27] [debug] AMX backtrace: [00:23:27] [debug] #0 native mysql_close () from mysql.dll [00:23:27] [debug] #1 0007e504 in ?? (... <1073741823 arguments>) at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\gamemodes\bcrpg_main.pwn:84 [00:23:27] [debug] #2 00015d4c in public ScriptInit_OnGameModeExit () at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30 [00:23:27] [debug] #3 0000b820 in public FIXES_OnGameModeExit () at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\pawno\include\YSI\..\YSI_Coding\..\YSI_Internal\..\YSI_Server\y_scriptinit.inc:213 [00:23:27] [debug] #4 00004370 in public OnGameModeExit () at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\pawno\include\fixes.inc:3419 [00:23:28] [debug] Native backtrace: [00:23:28] [debug] #0 72632074 in ?? () from samp-server.exe [00:23:28] [debug] #1 010979d4 in ?? () from LIBMYSQL.dll [14:24:30] [debug] Server crashed while executing bcrpg_main.amx [14:24:30] [debug] AMX backtrace: [14:24:30] [debug] #0 native mysql_close () from mysql.dll [14:24:30] [debug] #1 0007d950 in ?? (... <1073741823 arguments>) at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\gamemodes\bcrpg_main.pwn:85 [14:24:30] [debug] #2 00015d4c in public ScriptInit_OnGameModeExit () at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30 [14:24:30] [debug] #3 0000b820 in public FIXES_OnGameModeExit () at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\pawno\include\YSI\..\YSI_Coding\..\YSI_Internal\..\YSI_Server\y_scriptinit.inc:213 [14:24:30] [debug] #4 00004370 in public OnGameModeExit () at C:\Documents and Settings\Administrator\Desktop\misc\boneCounty rpg\pawno\include\fixes.inc:3419 [14:24:31] [debug] Native backtrace: [14:24:31] [debug] #0 72632074 in ?? () from samp-server.exe [14:24:31] [debug] #1 010979d4 in ?? () from LIBMYSQL.dll
public OnGameModeExit() { new tc = tickcount(); while((tickcount() - tc) < 2000) { } mysql_close(); }
[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')
"UPDATE `%e` SET `Health` = '%.1f', `Rida` = '%.1f', `Fuel` = '%d', `Color1` = '%d', `Color2` = '%d' WHERE `Owner` = '%e' |
[20:05:26] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `vehicles` SET `Health` = '1000.0', `Rida` = '1.174e.5', ", callback: "(null)", format: "(null)" |
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') |
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?
|
mysql_option(DUPLICATE_CONNECTIONS, true);
"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. |