diff options
author | ramil@mysql.com <> | 2005-10-31 16:28:45 +0400 |
---|---|---|
committer | ramil@mysql.com <> | 2005-10-31 16:28:45 +0400 |
commit | afbd0fafd3aeab18c5a15c0699bba69aca28b74d (patch) | |
tree | 151628cc6eca16b14943cfc6e9708b4143d7ddca /client/mysqltest.c | |
parent | 5150bd8f9f96377edb8658a3d19de1f5a91324ac (diff) | |
download | mariadb-git-afbd0fafd3aeab18c5a15c0699bba69aca28b74d.tar.gz |
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).
Diffstat (limited to 'client/mysqltest.c')
-rw-r--r-- | client/mysqltest.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 35408368a73..d10ad054798 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3272,19 +3272,24 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags) /* 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 + { + /* FIXME is string terminated? */ + val= (const char *) bind[col_idx].buffer; + len= *bind[col_idx].length; + } if (!display_result_vertically) { if (col_idx) /* No tab before first col */ |