Skip to content

Commit ca538b4

Browse files
committed
Add env BULK_PACKET_SIZE (default 5242880 ( = 5120*1024))
1 parent c48345f commit ca538b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/db_driver.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "sb_ck_pr.h"
4141

4242
/* Query length limit for bulk insert queries */
43-
#define BULK_PACKET_SIZE (5120*1024)
43+
static unsigned int BULK_PACKET_SIZE = 5120*1024;
4444

4545
/* How many rows to insert before COMMITs (used in bulk insert) */
4646
static int ROWS_BEFORE_COMMIT = 1000;
@@ -943,6 +943,8 @@ int db_bulk_insert_init(db_conn_t *con, const char *query, size_t query_len)
943943
return 1;
944944
}
945945

946+
BULK_PACKET_SIZE = atoi(getenv("BULK_PACKET_SIZE")?:"5242880");
947+
946948
/* Allocate query buffer */
947949
if (query_len + 1 > BULK_PACKET_SIZE)
948950
{

0 commit comments

Comments
 (0)