Skip to content

Commit

Permalink
Use tds_get_conversion_type in dblib _get_printable_size
Browse files Browse the repository at this point in the history
Avoids to handle nullable types.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
  • Loading branch information
freddy77 committed Sep 21, 2015
1 parent f8f1805 commit 5a84363
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/dblib/dblib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3569,18 +3569,7 @@ dbprrow(DBPROCESS * dbproc)
static int
_get_printable_size(TDSCOLUMN * colinfo)
{
switch (colinfo->column_type) {
case SYBINTN:
switch (colinfo->column_size) {
case 1:
return 3;
case 2:
return 6;
case 4:
return 11;
case 8:
return 21;
}
switch (tds_get_conversion_type(colinfo->column_type, colinfo->column_size)) {
case SYBINT1:
return 3;
case SYBINT2:
Expand Down Expand Up @@ -3609,7 +3598,6 @@ _get_printable_size(TDSCOLUMN * colinfo)
return 12;
case SYBDATETIME:
case SYBDATETIME4:
case SYBDATETIMN:
return 26;
case SYBTIME:
return 15;
Expand All @@ -3618,7 +3606,6 @@ _get_printable_size(TDSCOLUMN * colinfo)
case SYBUNIQUE:
return 36;
case SYBBIT:
case SYBBITN:
return 1;
/* FIX ME -- not all types present */
default:
Expand Down

0 comments on commit 5a84363

Please sign in to comment.