summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-02 18:24:27 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-02 18:24:27 +0000
commit571fb052a6712e5cd387fe1705fae778f5af7cf3 (patch)
treefda1ef205ae1e814de56b8ab22d802e2ed02df65
parent665680682b57d01415afb478b67d0c7c61d21119 (diff)
downloadhercules-571fb052a6712e5cd387fe1705fae778f5af7cf3.tar.gz
hercules-571fb052a6712e5cd387fe1705fae778f5af7cf3.tar.bz2
hercules-571fb052a6712e5cd387fe1705fae778f5af7cf3.tar.xz
hercules-571fb052a6712e5cd387fe1705fae778f5af7cf3.zip
speedup of SQL logs
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@437 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt2
-rw-r--r--src/char_sql/char.c8
-rw-r--r--src/char_sql/int_party.c2
-rw-r--r--src/char_sql/inter.c2
-rw-r--r--src/login_sql/login.c12
-rw-r--r--src/map/log.c20
-rw-r--r--src/map/mail.c4
7 files changed, 26 insertions, 24 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 7adfcb4a2..34fdd401f 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,7 @@
Date Added
12/2
+ * Changed all LOGS inserts to INSERT DELAYED (MySQL has this feature and cache unimportant queries, then
+ executes them at once together = 10x faster) [Lupus]
* Skill Updates [celest]
- Modified Weapon Refine - should only +1 every time.
- Updated Berserk, Chase Walk, Slim Pitcher
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index c23c45bdb..d018390cb 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -1011,7 +1011,7 @@ int make_new_char_sql(int fd, unsigned char *dat) {
}
// char.log to charlog
- sprintf(tmp_sql,"INSERT INTO `%s` (`time`, `char_msg`,`account_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
+ sprintf(tmp_sql,"INSERT DELAYED INTO `%s` (`time`, `char_msg`,`account_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
"VALUES (NOW(), '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
charlog_db,"make new char error", sd->account_id, dat[30], dat, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[33], dat[31]);
//query
@@ -1024,7 +1024,7 @@ int make_new_char_sql(int fd, unsigned char *dat) {
}
// char.log to charlog
- sprintf(tmp_sql,"INSERT INTO `%s`(`time`, `char_msg`,`account_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
+ sprintf(tmp_sql,"INSERT DELAYED INTO `%s`(`time`, `char_msg`,`account_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
"VALUES (NOW(), '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
charlog_db,"make new char", sd->account_id, dat[30], dat, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[33], dat[31]);
//query
@@ -1939,7 +1939,7 @@ int parse_frommap(int fd) {
case 0x2b16:
if (RFIFOREST(fd) < 6 || RFIFOREST(fd) < RFIFOW(fd,8))
return 0;
- sprintf(tmp_sql, "INSERT INTO `ragsrvinfo` SET `index`='%d',`name`='%s',`exp`='%d',`jexp`='%d',`drop`='%d',`motd`='%s'",
+ sprintf(tmp_sql, "INSERT DELAYED INTO `ragsrvinfo` SET `index`='%d',`name`='%s',`exp`='%d',`jexp`='%d',`drop`='%d',`motd`='%s'",
fd, server_name, RFIFOW(fd,2), RFIFOW(fd,4), RFIFOW(fd,6), RFIFOP(fd,10));
if (mysql_query(&mysql_handle, tmp_sql)) {
printf("DB server Error - %s\n", mysql_error(&mysql_handle));
@@ -2185,7 +2185,7 @@ int parse_char(int fd) {
break;
}
- sprintf(tmp_sql,"INSERT INTO `%s`(`time`, `account_id`,`char_num`,`name`) VALUES (NOW(), '%d', '%d', '%s')",
+ sprintf(tmp_sql,"INSERT DELAYED INTO `%s`(`time`, `account_id`,`char_num`,`name`) VALUES (NOW(), '%d', '%d', '%s')",
charlog_db, sd->account_id, RFIFOB(fd, 2), char_dat[0].name);
//query
if(mysql_query(&mysql_handle, tmp_sql)) {
diff --git a/src/char_sql/int_party.c b/src/char_sql/int_party.c
index b5950d3a1..297481453 100644
--- a/src/char_sql/int_party.c
+++ b/src/char_sql/int_party.c
@@ -120,7 +120,7 @@ int inter_party_tosql(int party_id,struct party *p)
int i = 0;
while (i<MAX_PARTY&&((p->member[i].account_id>0&&p->member[i].leader==0)||(p->member[i].account_id<0))) i++;
if (i<MAX_PARTY) leader_id = p->member[i].account_id;
- sprintf(tmp_sql,"INSERT INTO `%s` (`party_id`, `name`, `exp`, `item`, `leader_id`) VALUES ('%d', '%s', '%d', '%d', '%d')",
+ sprintf(tmp_sql,"INSERT DELAYED INTO `%s` (`party_id`, `name`, `exp`, `item`, `leader_id`) VALUES ('%d', '%s', '%d', '%d', '%d')",
party_db, party_id, t_name, p->exp, p->item,leader_id);
if(mysql_query(&mysql_handle, tmp_sql) ) {
printf("DB server Error (inset/update `party`)- %s\n", mysql_error(&mysql_handle) );
diff --git a/src/char_sql/inter.c b/src/char_sql/inter.c
index 9c10cf6c5..52d688dce 100644
--- a/src/char_sql/inter.c
+++ b/src/char_sql/inter.c
@@ -241,7 +241,7 @@ int inter_log(char *fmt,...)
va_start(ap,fmt);
vsprintf(str,fmt,ap);
- sprintf(tmp_sql,"INSERT INTO `%s` (`time`, `log`) VALUES (NOW(), '%s')",interlog_db, jstrescapecpy(temp_str,str));
+ sprintf(tmp_sql,"INSERT DELAYED INTO `%s` (`time`, `log`) VALUES (NOW(), '%s')",interlog_db, jstrescapecpy(temp_str,str));
if(mysql_query(&mysql_handle, tmp_sql) ) {
printf("DB server Error (insert `interlog`)- %s\n", mysql_error(&mysql_handle) );
}
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 1863913fc..6e967ec72 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -294,7 +294,7 @@ int mmo_auth_sqldb_init(void) {
printf("connect success!\n");
}
- sprintf(tmpsql, "INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '', 'lserver', '100','login server started')", loginlog_db);
+ sprintf(tmpsql, "INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '', 'lserver', '100','login server started')", loginlog_db);
//query
if (mysql_query(&mysql_handle, tmpsql)) {
@@ -319,7 +319,7 @@ void mmo_db_close(void) {
int i, fd;
//set log.
- sprintf(tmpsql,"INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '', 'lserver','100', 'login server shutdown')", loginlog_db);
+ sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '', 'lserver','100', 'login server shutdown')", loginlog_db);
//query
if (mysql_query(&mysql_handle, tmpsql)) {
@@ -1119,7 +1119,7 @@ int parse_login(int fd) {
if (atoi(sql_row[0]) >0) {
// ip ban ok.
printf ("packet from banned ip : %d.%d.%d.%d" RETCODE, p[0], p[1], p[2], p[3]);
- sprintf(tmpsql,"INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', 'unknown','-3', 'ip banned')", loginlog_db, p[0], p[1], p[2], p[3]);
+ sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', 'unknown','-3', 'ip banned')", loginlog_db, p[0], p[1], p[2], p[3]);
// query
if(mysql_query(&mysql_handle, tmpsql)) {
@@ -1186,7 +1186,7 @@ int parse_login(int fd) {
WFIFOSET(fd,3);
} else {
if (p[0] != 127) {
- sprintf(tmpsql,"INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s','100', 'login ok')", loginlog_db, p[0], p[1], p[2], p[3], t_uid);
+ sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s','100', 'login ok')", loginlog_db, p[0], p[1], p[2], p[3], t_uid);
//query
if(mysql_query(&mysql_handle, tmpsql)) {
printf("DB server Error - %s\n", mysql_error(&mysql_handle));
@@ -1241,7 +1241,7 @@ int parse_login(int fd) {
} else {
char tmp_sql[512];
char error[64];
- sprintf(tmp_sql,"INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s', '%d','login failed : %%s')", loginlog_db, p[0], p[1], p[2], p[3], t_uid, result);
+ sprintf(tmp_sql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s', '%d','login failed : %%s')", loginlog_db, p[0], p[1], p[2], p[3], t_uid, result);
switch((result + 1)) {
case -2: //-3 = Account Banned
sprintf(tmpsql,tmp_sql,"Account banned.");
@@ -1374,7 +1374,7 @@ int parse_login(int fd) {
return 0;
{
unsigned char* server_name;
- sprintf(tmpsql,"INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s@%s','100', 'charserver - %s@%d.%d.%d.%d:%d')", loginlog_db, p[0], p[1], p[2], p[3], RFIFOP(fd, 2),RFIFOP(fd, 60),RFIFOP(fd, 60), RFIFOB(fd, 54), RFIFOB(fd, 55), RFIFOB(fd, 56), RFIFOB(fd, 57), RFIFOW(fd, 58));
+ sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s@%s','100', 'charserver - %s@%d.%d.%d.%d:%d')", loginlog_db, p[0], p[1], p[2], p[3], RFIFOP(fd, 2),RFIFOP(fd, 60),RFIFOP(fd, 60), RFIFOB(fd, 54), RFIFOB(fd, 55), RFIFOB(fd, 56), RFIFOB(fd, 57), RFIFOW(fd, 58));
//query
if(mysql_query(&mysql_handle, tmpsql)) {
diff --git a/src/map/log.c b/src/map/log.c
index 86c5a41a2..e6274b6f7 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -19,7 +19,7 @@ int log_branch(struct map_session_data *sd)
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql, "INSERT INTO `%s` (`branch_date`, `account_id`, `char_id`, `char_name`, `map`) VALUES (NOW(), '%d', '%d', '%s', '%s')", log_config.log_branch_db, sd->status.account_id, sd->status.char_id, sd->status.name, sd->mapname);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`branch_date`, `account_id`, `char_id`, `char_name`, `map`) VALUES (NOW(), '%d', '%d', '%s', '%s')", log_config.log_branch_db, sd->status.account_id, sd->status.char_id, sd->status.name, sd->mapname);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
@@ -48,7 +48,7 @@ int log_drop(struct map_session_data *sd, int monster_id, int *log_drop)
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql, "INSERT INTO `%s` (`drop_date`, `kill_char_id`, `monster_id`, `item1`, `item2`, `item3`, `item4`, `item5`, `item6`, `item7`, `item8`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s') ", log_config.log_drop_db, sd->status.char_id, monster_id, log_drop[0], log_drop[1], log_drop[2], log_drop[3], log_drop[4], log_drop[5], log_drop[6], log_drop[7], sd->mapname);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`drop_date`, `kill_char_id`, `monster_id`, `item1`, `item2`, `item3`, `item4`, `item5`, `item6`, `item7`, `item8`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s') ", log_config.log_drop_db, sd->status.char_id, monster_id, log_drop[0], log_drop[1], log_drop[2], log_drop[3], log_drop[4], log_drop[5], log_drop[6], log_drop[7], sd->mapname);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
@@ -78,7 +78,7 @@ int log_mvpdrop(struct map_session_data *sd, int monster_id, int *log_mvp)
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql, "INSERT INTO `%s` (`mvp_date`, `kill_char_id`, `monster_id`, `prize`, `mvpexp`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%s') ", log_config.log_mvpdrop_db, sd->status.char_id, monster_id, log_mvp[0], log_mvp[1], sd->mapname);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`mvp_date`, `kill_char_id`, `monster_id`, `prize`, `mvpexp`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%s') ", log_config.log_mvpdrop_db, sd->status.char_id, monster_id, log_mvp[0], log_mvp[1], sd->mapname);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
@@ -106,7 +106,7 @@ int log_present(struct map_session_data *sd, int source_type, int nameid)
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql, "INSERT INTO `%s` (`present_date`, `src_id`, `account_id`, `char_id`, `char_name`, `nameid`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%s', '%d', '%s') ", log_config.log_present_db, source_type, sd->status.account_id, sd->status.char_id, sd->status.name, nameid, sd->mapname);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`present_date`, `src_id`, `account_id`, `char_id`, `char_name`, `nameid`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%s', '%d', '%s') ", log_config.log_present_db, source_type, sd->status.account_id, sd->status.char_id, sd->status.name, nameid, sd->mapname);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
@@ -134,7 +134,7 @@ int log_produce(struct map_session_data *sd, int nameid, int slot1, int slot2, i
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql, "INSERT INTO `%s` (`produce_date`, `account_id`, `char_id`, `char_name`, `nameid`, `slot1`, `slot2`, `slot3`, `map`, `success`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%s', '%d') ", log_config.log_produce_db, sd->status.account_id, sd->status.char_id, sd->status.name, nameid, slot1, slot2, slot3, sd->mapname, success);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`produce_date`, `account_id`, `char_id`, `char_name`, `nameid`, `slot1`, `slot2`, `slot3`, `map`, `success`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%s', '%d') ", log_config.log_produce_db, sd->status.account_id, sd->status.char_id, sd->status.name, nameid, slot1, slot2, slot3, sd->mapname, success);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
@@ -176,7 +176,7 @@ int log_refine(struct map_session_data *sd, int n, int success)
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql, "INSERT INTO `%s` (`refine_date`, `account_id`, `char_id`, `char_name`, `nameid`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`, `success`, `item_level`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d')", log_config.log_refine_db, sd->status.account_id, sd->status.char_id, sd->status.name, sd->status.inventory[n].nameid, sd->status.inventory[n].refine, log_card[0], log_card[1], log_card[2], log_card[3], sd->mapname, success, item_level);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`refine_date`, `account_id`, `char_id`, `char_name`, `nameid`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`, `success`, `item_level`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d')", log_config.log_refine_db, sd->status.account_id, sd->status.char_id, sd->status.name, sd->status.inventory[n].nameid, sd->status.inventory[n].refine, log_card[0], log_card[1], log_card[2], log_card[3], sd->mapname, success, item_level);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
@@ -222,7 +222,7 @@ int log_trade(struct map_session_data *sd, struct map_session_data *target_sd, i
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql, "INSERT INTO `%s` (`trade_date`, `src_account_id`, `src_char_id`, `src_char_name`, `des_account_id`, `des_char_id`, `des_char_name`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s')", log_config.log_trade_db, sd->status.account_id, sd->status.char_id, sd->status.name, target_sd->status.account_id, target_sd->status.char_id, target_sd->status.name, log_nameid, log_amount, log_refine, log_card[0], log_card[1], log_card[2], log_card[3], sd->mapname);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`trade_date`, `src_account_id`, `src_char_id`, `src_char_name`, `des_account_id`, `des_char_id`, `des_char_name`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s')", log_config.log_trade_db, sd->status.account_id, sd->status.char_id, sd->status.name, target_sd->status.account_id, target_sd->status.char_id, target_sd->status.name, log_nameid, log_amount, log_refine, log_card[0], log_card[1], log_card[2], log_card[3], sd->mapname);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
@@ -265,7 +265,7 @@ int log_vend(struct map_session_data *sd,struct map_session_data *vsd,int n,int
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql, "INSERT INTO `%s` (`vend_date`, `vend_account_id`, `vend_char_id`, `vend_char_name`, `buy_account_id`, `buy_char_id`, `buy_char_name`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`, `zeny`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%d')", log_config.log_vend_db, sd->status.account_id, sd->status.char_id, sd->status.name, vsd->status.account_id, vsd->status.char_id, vsd->status.name, log_nameid, log_amount, log_refine, log_card[0], log_card[1], log_card[2], log_card[3], sd->mapname, zeny);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`vend_date`, `vend_account_id`, `vend_char_id`, `vend_char_name`, `buy_account_id`, `buy_char_id`, `buy_char_name`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`, `zeny`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%d')", log_config.log_vend_db, sd->status.account_id, sd->status.char_id, sd->status.name, vsd->status.account_id, vsd->status.char_id, vsd->status.name, log_nameid, log_amount, log_refine, log_card[0], log_card[1], log_card[2], log_card[3], sd->mapname, zeny);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
@@ -293,7 +293,7 @@ int log_zeny(struct map_session_data *sd, struct map_session_data *target_sd,int
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql,"INSERT INTO `%s` (`trade_date`, `src_account_id`, `src_char_id`, `src_char_name`, `des_account_id`, `des_char_id`, `des_char_name`, `map`, `zeny`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%s', '%s', '%d')", log_config.log_trade_db, sd->status.account_id, sd->status.char_id, sd->status.name, target_sd->status.account_id, target_sd->status.char_id, target_sd->status.name, sd->mapname, sd->deal_zeny);
+ sprintf(tmp_sql,"INSERT DELAYED INTO `%s` (`trade_date`, `src_account_id`, `src_char_id`, `src_char_name`, `des_account_id`, `des_char_id`, `des_char_name`, `map`, `zeny`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%d', '%s', '%s', '%d')", log_config.log_trade_db, sd->status.account_id, sd->status.char_id, sd->status.name, target_sd->status.account_id, target_sd->status.char_id, target_sd->status.name, sd->mapname, sd->deal_zeny);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
@@ -321,7 +321,7 @@ int log_atcommand(struct map_session_data *sd, const char *message)
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- sprintf(tmp_sql, "INSERT INTO `%s` (`atcommand_date`, `account_id`, `char_id`, `char_name`, `map`, `command`) VALUES(NOW(), '%d', '%d', '%s', '%s', '%s') ", log_config.log_gm_db, sd->status.account_id, sd->status.char_id, sd->status.name, sd->mapname, message);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`atcommand_date`, `account_id`, `char_id`, `char_name`, `map`, `command`) VALUES(NOW(), '%d', '%d', '%s', '%s', '%s') ", log_config.log_gm_db, sd->status.account_id, sd->status.char_id, sd->status.name, sd->mapname, message);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
diff --git a/src/map/mail.c b/src/map/mail.c
index 019f6303d..5e102755d 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -244,11 +244,11 @@ int mail_send(struct map_session_data *sd, char *name, char *message, int flag)
while ((mail_row = mysql_fetch_row(mail_res))) {
if(strcmp(name,"*")==0) {
- sprintf(tmp_msql, "INSERT INTO `%s` (`to_account_id`,`from_account_id`,`from_char_name`,`message`,`priority`)"
+ sprintf(tmp_msql, "INSERT DELAYED INTO `%s` (`to_account_id`,`from_account_id`,`from_char_name`,`message`,`priority`)"
" VALUES ('%d', '%d', '%s', '%s', '%d')",mail_db, atoi(mail_row[0]), sd->status.account_id, sd->status.name, message, flag);
}
else {
- sprintf(tmp_msql, "INSERT INTO `%s` (`to_account_id`,`to_char_name`,`from_account_id`,`from_char_name`,`message`,`priority`)"
+ sprintf(tmp_msql, "INSERT DELAYED INTO `%s` (`to_account_id`,`to_char_name`,`from_account_id`,`from_char_name`,`message`,`priority`)"
" VALUES ('%d', '%s', '%d', '%s', '%s', '%d')",mail_db, atoi(mail_row[0]), mail_row[1], sd->status.account_id, sd->status.name, message, flag);
if(pc_isGM(sd) < 80)
sd->mail_counter=5;