Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
-
all
Description
static int test_conc69(MYSQL *my)
|
{
|
int rc;
|
MYSQL_RES *res;
|
MYSQL_ROW row;
|
MYSQL *mysql= mysql_init(NULL);
|
|
rc= mysql_options(mysql, MYSQL_OPT_COMPRESS, (void *)1);
|
check_mysql_rc(rc, my);
|
|
rc= mysql_query(my, "SET @save:=@@max_allowed_packet");
|
check_mysql_rc(rc, my);
|
rc= mysql_query(my, "SET GLOBAL max_allowed_packet=1024 * 1024 * 21");
|
check_mysql_rc(rc, my);
|
|
if (!mysql_real_connect(mysql, hostname, username,
|
password, schema, port, socketname, 0))
|
{
|
diag("Error: %s", mysql_error(mysql));
|
return FAIL;
|
}
|
|
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
check_mysql_rc(rc, mysql);
|
|
rc= mysql_query(mysql, "CREATE TABLE t1 (a LONGBLOB)");
|
check_mysql_rc(rc, mysql);
|
|
rc= mysql_query(mysql, "INSERT INTO t1 VALUES (REPEAT('A', 1024 * 1024 * 20))");
|
check_mysql_rc(rc, mysql);
|
|
rc= mysql_query(mysql, "SELECT a FROM t1");
|
check_mysql_rc(rc, mysql);
|
|
if (!(res= mysql_store_result(mysql)))
|
{
|
diag("Error: %s", mysql_error(mysql));
|
return FAIL;
|
}
|
|
row= mysql_fetch_row(res);
|
FAIL_IF(strlen(row[0]) != 1024 * 1024 * 20, "Wrong length");
|
mysql_free_result(res);
|
|
rc= mysql_query(my, "SET GLOBAL max_allowed_packet=@save");
|
check_mysql_rc(rc, my);
|
return OK;
|
}
|