int rc =0;
/* Supply data in chunks to server */
if (mysql_stmt_send_long_data(stmt,0, pos, size))
{
fprintf(stderr, "n send_long_data failed");
fprintf(stderr, "n %s", mysql_stmt_error(stmt));
exit(0);
}
// pos += size;
/* Supply the next piece of data */
if (mysql_stmt_send_long_data(stmt,0, pos, size))
{
fprintf(stderr, "n send_long_data failed");
fprintf(stderr, "n %s", mysql_stmt_error(stmt));
exit(0);
}
/* Now, execute the query */
if (mysql_stmt_execute(stmt))
{
fprintf(stderr, "n mysql_stmt_execute failed");
fprintf(stderr, "n %s", mysql_stmt_error(stmt));
exit(0);
}
}
int main()
{
test();
//sleep(1);
return 0;
}
运行结果:










