Skip to content

Commit

Permalink
Fixed bug with handling of null values in relaxed mode, exposed by ha…
Browse files Browse the repository at this point in the history
…relba#126

Also fix unrelated tests
  • Loading branch information
harelba committed Nov 3, 2016
1 parent f6dcb5e commit e4f8044
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/q
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,8 @@ class TableCreator(object):
if self.mode == 'relaxed':
if actual_col_count > expected_col_count:
xxx = col_vals[:expected_col_count - 1] + \
[self.input_delimiter.join(
col_vals[expected_col_count - 1:])]
[self.input_delimiter.join([v if v is not None else '' for v in
col_vals[expected_col_count - 1:]])]
return xxx
else:
return col_vals
Expand Down
4 changes: 2 additions & 2 deletions test/test-suite
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ class SqlTests(AbstractQTestCase):
self.assertEquals(o[4],' `float_number` - float')

# Check column types detected when actual detection is disabled
cmd = '../bin/q -A -d , -H --disable-column-type-detection "select * from %s"' % (tmpfile.name)
cmd = '../bin/q -A -d , -H --as-text "select * from %s"' % (tmpfile.name)

retcode, o, e = run_command(cmd)

Expand Down Expand Up @@ -1748,7 +1748,7 @@ class SqlTests(AbstractQTestCase):
self.assertEquals(o[3],"regular text 4,-123,-123,122.2");

# Get actual data without detection
cmd = '../bin/q -d , -H --disable-column-type-detection "select * from %s"' % (tmpfile.name)
cmd = '../bin/q -d , -H --as-text "select * from %s"' % (tmpfile.name)

retcode, o, e = run_command(cmd)

Expand Down

0 comments on commit e4f8044

Please sign in to comment.