summaryrefslogtreecommitdiff
path: root/client/mysqltest.c
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2003-08-22 04:07:40 +0300
committermonty@narttu.mysql.fi <>2003-08-22 04:07:40 +0300
commitefa85aad49be43ef3cdf8f631b43e9a87d0189b4 (patch)
tree69f51d9d40e937b7da442d9523c0a0a66d5ba847 /client/mysqltest.c
parent423b1b7c4aa19fe991f65e60bdbf07ba4d9c46fc (diff)
downloadmariadb-git-efa85aad49be43ef3cdf8f631b43e9a87d0189b4.tar.gz
Move test that uses many tables (in query_cache.test) to separate test so that we can get it 'skipped' instead of 'failed' on system where we can't open many files.
Diffstat (limited to 'client/mysqltest.c')
-rw-r--r--client/mysqltest.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index f5afa0fa0df..7a5712cc597 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -42,7 +42,7 @@
**********************************************************************/
-#define MTEST_VERSION "1.27"
+#define MTEST_VERSION "1.28"
#include <my_global.h>
#include <mysql_embed.h>
@@ -845,7 +845,28 @@ int var_query_set(VAR* v, const char* p, const char** p_end)
}
if ((row = mysql_fetch_row(res)) && row[0])
- eval_expr(v, row[0], 0);
+ {
+ /*
+ Concatenate all row results with tab in between to allow us to work
+ with results from many columns (for example from SHOW VARIABLES)
+ */
+ DYNAMIC_STRING result;
+ uint i;
+ ulong *lengths;
+ char *end;
+
+ init_dynamic_string(&result, "", 16384, 65536);
+ lengths= mysql_fetch_lengths(res);
+ for (i=0; i < mysql_num_fields(res); i++)
+ {
+ if (row[0])
+ dynstr_append_mem(&result, row[i], lengths[i]);
+ dynstr_append_mem(&result, "\t", 1);
+ }
+ end= result.str + result.length-1;
+ eval_expr(v, result.str, (const char**) &end);
+ dynstr_free(&result);
+ }
else
eval_expr(v, "", 0);
@@ -902,8 +923,6 @@ int eval_expr(VAR* v, const char* p, const char** p_end)
return 0;
}
- if (p_end)
- *p_end = 0;
die("Invalid expr: %s", p);
return 1;
}
@@ -1197,7 +1216,7 @@ static char *get_string(char **to_ptr, char **from_ptr,
VAR *var=var_get(start, &end, 0, 1);
if (var && to == (char*) end+1)
{
- DBUG_PRINT("info",("var: %s -> %s", start, var->str_val));
+ DBUG_PRINT("info",("var: '%s' -> '%s'", start, var->str_val));
DBUG_RETURN(var->str_val); /* return found variable value */
}
}