diff options
author | unknown <msvensson@neptunus.(none)> | 2005-11-03 19:32:19 +0100 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2005-11-03 19:32:19 +0100 |
commit | e012abb17e36eef00edbe63b04f2b39940d8ea57 (patch) | |
tree | 4b0fa2ee16903a9a00e5b2f37859371d89d34910 | |
parent | 0c46f1e7000b6a9e537f6e7b0156b9329458041f (diff) | |
download | mariadb-git-e012abb17e36eef00edbe63b04f2b39940d8ea57.tar.gz |
Reapplying patch
Check for NULLs only if we don't replace column results,
get real results after all checks.
(see bug #14254: func_crypt.test fails on FreeBSD with --ps-protocol).
Remove two FIXME's
client/mysqltest.c:
Reapplying patch, lost during merge
Check for NULLs only if we don't replace column results,
get real results after all checks.
(see bug #14254: func_crypt.test fails on FreeBSD with --ps-protocol).
Remove FIXME comments since it ssemd like the function handles vertical displays and
even wheter the string is terminated or not is not relevant since we only append
as much of it to output as "len" says
-rw-r--r-- | client/mysqltest.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index a2b2b3477eb..89f164b9a47 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3043,8 +3043,6 @@ static void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT* stmt, my_bool *is_null; ulong *length; ulonglong num_rows; - - /* FIXME we don't handle vertical display ..... */ uint col_idx, row_idx; /* Allocate array with bind structs, lengths and NULL flags */ @@ -3088,19 +3086,23 @@ static void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT* stmt, /* Read result from each column */ for (col_idx= 0; col_idx < num_fields; col_idx++) { - /* FIXME is string terminated? */ - const char *val= (const char *)bind[col_idx].buffer; - ulonglong len= *bind[col_idx].length; + const char *val; + ulonglong len; if (col_idx < max_replace_column && replace_column[col_idx]) { val= replace_column[col_idx]; len= strlen(val); } - if (*bind[col_idx].is_null) + else if (*bind[col_idx].is_null) { val= "NULL"; len= 4; } + else + { + val= (const char *) bind[col_idx].buffer; + len= *bind[col_idx].length; + } if (!display_result_vertically) { if (col_idx) /* No tab before first col */ |