3512 sayantan.dutta@stripped 2011-10-19 [merge]
upmerge 11754855 5.5 => trunk
modified:
client/mysqltest.cc
mysql-test/r/mysqltest.result
mysql-test/t/mysqltest.test
3511 Jorgen Loland 2011-10-19 [merge]
Automerge opt-team -> trunk
modified:
mysql-test/r/innodb_icp_all.result
mysql-test/r/myisam_icp_all.result
mysql-test/suite/opt_trace/r/filesort_pq.result
mysql-test/suite/opt_trace/r/general2_no_prot.result
mysql-test/suite/opt_trace/r/general2_ps_prot.result
mysql-test/suite/opt_trace/r/general_no_prot_all.result
mysql-test/suite/opt_trace/r/general_no_prot_none.result
mysql-test/suite/opt_trace/r/general_ps_prot_all.result
mysql-test/suite/opt_trace/r/general_ps_prot_none.result
mysql-test/suite/opt_trace/r/subquery_no_prot.result
mysql-test/suite/opt_trace/r/subquery_ps_prot.result
sql/filesort.cc
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2011-09-30 13:27:12 +0000
+++ b/client/mysqltest.cc 2011-10-19 07:29:57 +0000
@@ -4822,6 +4822,7 @@ void do_get_errcodes(struct st_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");
@@ -4841,6 +4842,17 @@ void do_get_errcodes(struct st_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;
@@ -4915,7 +4927,7 @@ void do_get_errcodes(struct st_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 != ',')
=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result 2011-09-15 12:19:58 +0000
+++ b/mysql-test/r/mysqltest.result 2011-10-19 07:29:57 +0000
@@ -661,6 +661,17 @@ a D
1 1
1 4
drop table t1;
+create table t2 ( a char(10));
+garbage;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+garbage;
+Got one of the listed errors
+garbage;
+Got one of the listed errors
+insert into t1 values ("Abcd");
+Got one of the listed errors
+garbage;
+drop table t2;
create table t1 ( f1 char(10));
insert into t1 values ("Abcd");
select * from t1;
=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test 2011-09-15 12:19:58 +0000
+++ b/mysql-test/t/mysqltest.test 2011-10-19 07:29:57 +0000
@@ -2055,6 +2055,31 @@ insert into t1 values (2,4);
select * from t1;
drop table t1;
+#-------------------------------------------------------------------------
+# BUG #11754855 : Passing variable to --error
+#-------------------------------------------------------------------------
+create table t2 ( a char(10));
+let $errno1=0;
+let $errno2=ER_PARSE_ERROR;
+let $errno3=ER_NO_SUCH_TABLE;
+--error $errno2
+garbage;
+
+--error $errno2,$errno3
+garbage;
+
+--error $errno2,ER_NO_SUCH_TABLE
+garbage;
+
+--error ER_NO_SUCH_TABLE,$errno2
+insert into t1 values ("Abcd");
+
+--error $errno1,ER_PARSE_ERROR
+garbage;
+
+drop table t2;
+
+
# ----------------------------------------------------------------------------
# Tests of send
# ----------------------------------------------------------------------------
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (sayantan.dutta:3511 to 3512) | sayantan.dutta | 19 Oct |