Skip to content

Commit 2c5c20a

Browse files
committed
Error on bulk import validation failures
Signed-off-by: mdouglas47 <mdouglas47@bloomberg.net>
1 parent edc504b commit 2c5c20a

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

db/db_tunables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ REGISTER_TUNABLE("buffers_per_context", NULL, TUNABLE_INTEGER,
111111
NULL);
112112
REGISTER_TUNABLE("bulk_import_validation_werror",
113113
"Treat bulk import input validation warnings as errors. "
114-
"(Default: off)", TUNABLE_BOOLEAN,
114+
"(Default: on)", TUNABLE_BOOLEAN,
115115
&gbl_bulk_import_validation_werror, 0, NULL, NULL, NULL,
116116
NULL);
117117
/*

tests/bulkimport.test/runit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,10 @@ function test_bad_inputs_without_werror() {
321321
# Given
322322
local dst_tbl=foo src_tbl='bad-table'
323323
query_dst_db "create table $dst_tbl(i int)"
324+
set_dst_tunable "bulk_import_validation_werror off"
324325

325-
trap "query_dst_db 'drop table $dst_tbl'" EXIT
326+
trap "set_dst_tunable 'bulk_import_validation_werror on';
327+
query_dst_db 'drop table $dst_tbl'" EXIT
326328

327329
# When
328330
err=$(query_dst_db "replace table $dst_tbl with LOCAL_$SRC_DBNAME.'"$src_tbl"'" 2>&1)
@@ -339,10 +341,8 @@ function test_bad_inputs_with_werror() {
339341
# Given
340342
local dst_tbl=foo src_tbl='bad-table'
341343
query_dst_db "create table $dst_tbl(i int)"
342-
set_dst_tunable "bulk_import_validation_werror on"
343344

344-
trap "set_dst_tunable 'bulk_import_validation_werror off';
345-
query_dst_db 'drop table $dst_tbl'" EXIT
345+
trap "query_dst_db 'drop table $dst_tbl'" EXIT
346346

347347
# When
348348
err=$(query_dst_db "replace table $dst_tbl with LOCAL_$SRC_DBNAME.'"$src_tbl"'" 2>&1)

tests/tunables.test/t00_all_tunables.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
(name='btpf_wndw_max', description='Maximum number of pages read ahead', type='INTEGER', value='1000', read_only='N')
9494
(name='btpf_wndw_min', description='Minimum number of pages read ahead', type='INTEGER', value='100', read_only='N')
9595
(name='buffers_per_context', description='', type='INTEGER', value='255', read_only='Y')
96-
(name='bulk_import_validation_werror', description='Treat bulk import input validation warnings as errors. (Default: off)', type='BOOLEAN', value='OFF', read_only='N')
96+
(name='bulk_import_validation_werror', description='Treat bulk import input validation warnings as errors. (Default: on)', type='BOOLEAN', value='ON', read_only='N')
9797
(name='bulk_sql_mode', description='Enable reading data in bulk when performing a scan (alternative is single-stepping a cursor).', type='BOOLEAN', value='ON', read_only='N')
9898
(name='bulk_sql_rowlocks', description='', type='BOOLEAN', value='ON', read_only='N')
9999
(name='bulk_sql_threshold', description='', type='INTEGER', value='2', read_only='N')

util/import_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <str_util.h>
44
#include <logmsg.h>
55

6-
int gbl_bulk_import_validation_werror = 0;
6+
int gbl_bulk_import_validation_werror = 1;
77

88
enum bulk_import_validation_rc validate_bulk_import_inputs(const char * const dest_tablename, const char * const bulk_import_src_mach,
99
const char * const bulk_import_src_dbname, const char * const bulk_import_src_tablename)

0 commit comments

Comments
 (0)