summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <sayantan.dutta@oracle.com>2011-10-19 12:53:52 +0530
committerunknown <sayantan.dutta@oracle.com>2011-10-19 12:53:52 +0530
commit434dd8635e3517869be37ee61bcaae1f1694aba1 (patch)
treea356496214e8fad1cffb7c401d20d3d1e567334b /client
parent06f57a7021f471f0b895b853551522812c3a1368 (diff)
downloadmariadb-git-434dd8635e3517869be37ee61bcaae1f1694aba1.tar.gz
Bug #11754855 46528: NEED A WAY TO PASS A VARIABLE TO MTR COMMANDS
modified function do_get_error in mysqltest.cc to handle multiple variable passed added test case to mysqltest.test to verify handling to multiple errors passed
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 915c6e4d495..f0184e5297b 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -4839,6 +4839,7 @@ void do_get_errcodes(struct st_command *command)
struct st_match_err *to= saved_expected_errors.err;
char *p= command->first_argument;
uint count= 0;
+ char *next;
DBUG_ENTER("do_get_errcodes");
@@ -4858,6 +4859,17 @@ void do_get_errcodes(struct st_command *command)
while (*end && *end != ',' && *end != ' ')
end++;
+ next=end;
+
+ /* code to handle variables passed to mysqltest */
+ if( *p == '$')
+ {
+ const char* fin;
+ VAR *var = var_get(p,&fin,0,0);
+ p=var->str_val;
+ end=p+var->str_val_len;
+ }
+
if (*p == 'S')
{
char *to_ptr= to->code.sqlstate;
@@ -4932,7 +4944,7 @@ void do_get_errcodes(struct st_command *command)
die("Too many errorcodes specified");
/* Set pointer to the end of the last error code */
- p= end;
+ p= next;
/* Find next ',' */
while (*p && *p != ',')