summaryrefslogtreecommitdiff
path: root/client/mysqltest.c
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-04-04 15:17:00 +0200
committerunknown <msvensson@pilot.blaudden>2007-04-04 15:17:00 +0200
commit5ae0ce281c92da49216ff0a58b49686a74f84b15 (patch)
tree7af6ebdabf59a6034b5eb38a17731234d913c063 /client/mysqltest.c
parente079dbd7ec73f4d05b56743069b0e42685c3c3e7 (diff)
parenta3583bf3b55f97dddba183d288102edd022c8304 (diff)
downloadmariadb-git-5ae0ce281c92da49216ff0a58b49686a74f84b15.tar.gz
Merge pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint client/mysqltest.c: Auto merged mysql-test/t/mysqltest.test: Auto merged mysql-test/r/mysqltest.result: SCCS merged
Diffstat (limited to 'client/mysqltest.c')
-rw-r--r--client/mysqltest.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 568d33f7385..8b3b22bbbbc 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -276,7 +276,7 @@ enum enum_commands {
Q_IF,
Q_DISABLE_PARSING, Q_ENABLE_PARSING,
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
- Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT,
+ Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
Q_UNKNOWN, /* Unknown command. */
@@ -359,6 +359,7 @@ const char *command_names[]=
/* Don't execute any more commands, compare result */
"exit",
+ "skip",
"chmod",
"append_file",
"cat_file",
@@ -1346,6 +1347,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL* mysql = &cur_con->mysql;
+ DYNAMIC_STRING ds_query;
DBUG_ENTER("var_query_set");
LINT_INIT(res);
@@ -1355,13 +1357,17 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
die("Syntax error in query, missing '`'");
++query;
- if (mysql_real_query(mysql, query, (int)(end - query)) ||
+ /* Eval the query, thus replacing all environment variables */
+ init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
+ do_eval(&ds_query, query, end, FALSE);
+
+ if (mysql_real_query(mysql, ds_query.str, ds_query.length) ||
!(res = mysql_store_result(mysql)))
{
- *end = 0;
- die("Error running query '%s': %d %s", query,
+ die("Error running query '%s': %d %s", ds_query.str,
mysql_errno(mysql), mysql_error(mysql));
}
+ dynstr_free(&ds_query);
if ((row = mysql_fetch_row(res)) && row[0])
{
@@ -6277,6 +6283,9 @@ int main(int argc, char **argv)
/* Stop processing any more commands */
abort_flag= 1;
break;
+ case Q_SKIP:
+ abort_not_supported_test("%s", command->first_argument);
+ break;
case Q_RESULT:
die("result, deprecated command");