List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:November 17 2010 12:28pm
Subject:bzr push into mysql-5.1-mtr branch (bjorn.munch:2949 to 2950) Bug#58087
View as plain text  
 2950 Bjorn Munch	2010-11-15
      Bug #58087 mysqltest re-evaluates 'let' expressions infinitely
      Results from query is sent for evaluation
      Break recursion by asking for ` to be ignored

    modified:
      client/mysqltest.cc
      mysql-test/r/mysqltest.result
      mysql-test/t/mysqltest.test
 2949 Bjorn Munch	2010-11-14 [merge]
      merge from 5.1 up to rev 3471

    added:
      mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test
      mysql-test/include/not_blackhole.inc
      mysql-test/r/partition_not_blackhole.result
      mysql-test/std_data/parts/t1_blackhole.frm
      mysql-test/std_data/parts/t1_blackhole.par
      mysql-test/suite/binlog/r/binlog_mixed_load_data.result
      mysql-test/suite/binlog/t/binlog_mixed_load_data.test
      mysql-test/suite/rpl/r/rpl_stm_create_if_not_exists.result
      mysql-test/suite/rpl/t/rpl_stm_create_if_not_exists.test
      mysql-test/t/partition_not_blackhole-master.opt
      mysql-test/t/partition_not_blackhole.test
    modified:
      README
      client/mysqltest.cc
      configure.in
      include/Makefile.am
      mysql-test/collections/default.experimental
      mysql-test/extra/rpl_tests/rpl_loaddata.test
      mysql-test/include/rpl_diff_tables.inc
      mysql-test/r/delete.result
      mysql-test/r/func_group.result
      mysql-test/r/func_sapdb.result
      mysql-test/r/func_time.result
      mysql-test/r/gis.result
      mysql-test/r/insert.result
      mysql-test/r/join.result
      mysql-test/r/partition_range.result
      mysql-test/r/range.result
      mysql-test/r/subselect4.result
      mysql-test/r/timezone2.result
      mysql-test/r/trigger.result
      mysql-test/r/user_var.result
      mysql-test/suite/binlog/t/binlog_killed_simulate.test
      mysql-test/suite/binlog/t/binlog_stm_blackhole.test
      mysql-test/suite/innodb/r/innodb-autoinc.result
      mysql-test/suite/innodb/r/innodb_mysql.result
      mysql-test/suite/innodb/t/innodb-autoinc.test
      mysql-test/suite/innodb/t/innodb_mysql.test
      mysql-test/suite/innodb_plugin/r/innodb-autoinc.result
      mysql-test/suite/innodb_plugin/t/innodb-autoinc-44030.test
      mysql-test/suite/innodb_plugin/t/innodb-autoinc.test
      mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
      mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
      mysql-test/suite/rpl/r/rpl_row_create_table.result
      mysql-test/suite/rpl/t/disabled.def
      mysql-test/suite/rpl/t/rpl_create_if_not_exists.test
      mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
      mysql-test/suite/rpl/t/rpl_loaddata_map.test
      mysql-test/suite/rpl/t/rpl_row_create_table.test
      mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
      mysql-test/suite/rpl/t/rpl_stm_log.test
      mysql-test/t/delete.test
      mysql-test/t/func_group.test
      mysql-test/t/func_time.test
      mysql-test/t/gis.test
      mysql-test/t/insert.test
      mysql-test/t/join.test
      mysql-test/t/mysqlbinlog.test
      mysql-test/t/partition_range.test
      mysql-test/t/range.test
      mysql-test/t/subselect4.test
      mysql-test/t/timezone2.test
      mysql-test/t/user_var.test
      mysys/my_getopt.c
      scripts/make_win_bin_dist
      sql/field.cc
      sql/ha_partition.cc
      sql/item_cmpfunc.cc
      sql/item_func.cc
      sql/item_func.h
      sql/item_geofunc.h
      sql/item_sum.cc
      sql/item_sum.h
      sql/item_timefunc.h
      sql/log.cc
      sql/mysqld.cc
      sql/opt_range.cc
      sql/spatial.cc
      sql/sql_class.h
      sql/sql_insert.cc
      sql/sql_lex.h
      sql/sql_load.cc
      sql/sql_parse.cc
      sql/sql_plugin.cc
      sql/sql_select.cc
      sql/sql_select.h
      sql/sql_show.cc
      sql/sql_string.h
      sql/sql_update.cc
      sql/sql_yacc.yy
      sql/tztime.cc
      storage/innobase/dict/dict0dict.c
      storage/innobase/dict/dict0load.c
      storage/innobase/fil/fil0fil.c
      storage/innobase/fsp/fsp0fsp.c
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/db0err.h
      storage/innobase/include/dict0dict.h
      storage/innobase/include/dict0dict.ic
      storage/innobase/include/dict0load.h
      storage/innobase/include/dict0mem.h
      storage/innobase/include/fil0fil.h
      storage/innobase/include/que0que.h
      storage/innobase/include/univ.i
      storage/innobase/row/row0mysql.c
      storage/innodb_plugin/ChangeLog
      storage/innodb_plugin/btr/btr0cur.c
      storage/innodb_plugin/btr/btr0sea.c
      storage/innodb_plugin/dict/dict0dict.c
      storage/innodb_plugin/dict/dict0load.c
      storage/innodb_plugin/ha/ha0ha.c
      storage/innodb_plugin/handler/ha_innodb.cc
      storage/innodb_plugin/include/btr0cur.h
      storage/innodb_plugin/include/btr0sea.h
      storage/innodb_plugin/include/db0err.h
      storage/innodb_plugin/include/dict0dict.h
      storage/innodb_plugin/include/dict0dict.ic
      storage/innodb_plugin/include/dict0load.h
      storage/innodb_plugin/include/dict0mem.h
      storage/innodb_plugin/include/ha0ha.h
      storage/innodb_plugin/include/que0que.h
      storage/innodb_plugin/include/univ.i
      storage/innodb_plugin/include/ut0mem.h
      storage/innodb_plugin/row/row0merge.c
      storage/innodb_plugin/row/row0mysql.c
      storage/innodb_plugin/row/row0sel.c
      storage/innodb_plugin/row/row0upd.c
      storage/innodb_plugin/trx/trx0undo.c
      storage/innodb_plugin/ut/ut0mem.c
      support-files/my-innodb-heavy-4G.cnf.sh
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-11-14 11:23:51 +0000
+++ b/client/mysqltest.cc	2010-11-15 13:23:02 +0000
@@ -471,7 +471,7 @@ VAR* var_init(VAR* v, const char *name,
 void var_free(void* v);
 VAR* var_get(const char *var_name, const char** var_name_end,
              my_bool raw, my_bool ignore_not_existing);
-void eval_expr(VAR* v, const char *p, const char** p_end);
+void eval_expr(VAR* v, const char *p, const char** p_end, bool backtick= true);
 my_bool match_delimiter(int c, const char *delim, uint length);
 void dump_result_to_reject_file(char *buf, int size);
 void dump_warning_messages();
@@ -2233,7 +2233,8 @@ void var_query_set(VAR *var, const char
       dynstr_append_mem(&result, "\t", 1);
     }
     end= result.str + result.length-1;
-    eval_expr(var, result.str, (const char**) &end);
+    /* Evaluation should not recurse via backtick */
+    eval_expr(var, result.str, (const char**) &end, false);
     dynstr_free(&result);
   }
   else
@@ -2389,7 +2390,7 @@ void var_copy(VAR *dest, VAR *src)
 }
 
 
-void eval_expr(VAR *v, const char *p, const char **p_end)
+void eval_expr(VAR *v, const char *p, const char **p_end, bool backtick)
 {
 
   DBUG_ENTER("eval_expr");
@@ -2414,7 +2415,7 @@ void eval_expr(VAR *v, const char *p, co
     DBUG_VOID_RETURN;
   }
 
-  if (*p == '`')
+  if (*p == '`' && backtick)
   {
     var_query_set(v, p, p_end);
     DBUG_VOID_RETURN;

=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result	2010-09-22 08:57:10 +0000
+++ b/mysql-test/r/mysqltest.result	2010-11-15 13:23:02 +0000
@@ -308,6 +308,10 @@ var3 two columns with same name
 var4 from query that returns NULL
 var5 from query that returns no row
 failing query in let
+create table t1 (a varchar(100));
+insert into t1 values ('`select 42`');
+`select 42`
+drop table t1;
 mysqltest: At line 1: Error running query 'failing query': 1064 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 'failing query' at line 1
 mysqltest: At line 1: Missing required argument 'filename' to command 'source'
 mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2

=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test	2010-10-19 11:56:30 +0000
+++ b/mysql-test/t/mysqltest.test	2010-11-15 13:23:02 +0000
@@ -854,6 +854,13 @@ let $var2= `failing query`;
 echo $var2;
 EOF
 
+create table t1 (a varchar(100));
+insert into t1 values ('`select 42`');
+let $a= `select * from t1`;
+# This should output `select 42`, not evaluate it again to 42
+echo $a;
+drop table t1;
+
 --error 1
 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/let.sql 2>&1
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-mtr branch (bjorn.munch:2949 to 2950) Bug#58087Bjorn Munch17 Nov