我用mysql:
使用Xcode 3.2.1(我出于某种原因在雪豹上)我将请求传递给mysql_query(),如下所示。
// mysql request
request = [NSString stringWithFormat:@"UPDATE consult SET summary='%@', pheno='%@' WHERE idConsult=%@", sum, phe, idc];
if (mysql_query(mysqlCnx,[request UTF8String])) {
db_finish_with_error(mysqlCnx);
}
当请求大小超过4MB时,我得到一个带有以下堆栈跟踪的SIGPIPE:
#0 0x7fff896d791e in sendto
#1 0x100065a92 in vio_write
#2 0x10004d2a2 in net_write_packet
#3 0x10004d3ac in net_write_buff
#4 0x10004d6e2 in net_write_command
#5 0x100048e3c in cli_advanced_command
#6 0x100046bdd in mysql_real_query
#7 0x1000093f9 in -[ConsultList mysqlUpdateResumePhenoFields:] at ConsultList.m:163
4#8 0x10000a565 in -[ConsultList okConsult:] at ConsultList.m:367
任何已知问题?
答案 0 :(得分:1)
以下是解决方案:
/etc/my.cnf
[mysqld]
max_allowed_packet=120M
as root :
chown 644 /etc/my.cnf
mysql> set global max_allowed_packet = 125829120;
Query OK, 0 rows affected (0,00 sec)
mysql> show variables like 'max_allowed_packet';
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 125829120 | << 120MB !
+--------------------+-----------+