diff --git a/mysql-test/r/keywords.result b/mysql-test/r/keywords.result index 597983dab7e..e4c83b21138 100644 --- a/mysql-test/r/keywords.result +++ b/mysql-test/r/keywords.result @@ -16,6 +16,19 @@ select events.binlog from events; binlog 1 drop table events; +create table t1 (connection int, b int); +create procedure p1() +begin +declare connection int; +select max(t1.connection) into connection from t1; +select concat("max=",connection) 'p1'; +end| +insert into t1 (connection) values (1); +call p1(); +p1 +max=1 +drop procedure p1; +drop table t1; create procedure p1() begin declare n int default 2; diff --git a/mysql-test/t/keywords.test b/mysql-test/t/keywords.test index 1af4a1354be..afc7fb55d51 100644 --- a/mysql-test/t/keywords.test +++ b/mysql-test/t/keywords.test @@ -20,6 +20,28 @@ drop table events; # End of 4.1 tests + +# +# Bug#12204 - CONNECTION should not be a reserved word +# + +create table t1 (connection int, b int); +delimiter |; +create procedure p1() +begin + declare connection int; + select max(t1.connection) into connection from t1; + select concat("max=",connection) 'p1'; +end| +delimiter ;| +insert into t1 (connection) values (1); +call p1(); +drop procedure p1; +drop table t1; + + +# End of 5.0 tests + # # Bug#19939 "AUTHORS is not a keyword" # diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 853a2761224..de926a1e969 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -46,6 +46,8 @@ pthread_mutexattr_t my_fast_mutexattr; pthread_mutexattr_t my_errorcheck_mutexattr; #endif +uint thd_lib_detected; + #ifdef NPTL_PTHREAD_EXIT_BUG /* see my_pthread.h */ /* diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 424fd98c4fc..aa386dcf09c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9667,6 +9667,7 @@ keyword_sp: | COMPLETION_SYM {} | COMPRESSED_SYM {} | CONCURRENT {} + | CONNECTION_SYM {} | CONSISTENT_SYM {} | CONTRIBUTORS_SYM {} | CUBE_SYM {}