Loading include/my_pthread.h +9 −23 Original line number Diff line number Diff line Loading @@ -30,25 +30,6 @@ extern "C" { #define EXTERNC #endif /* __cplusplus */ /* BUG#24507: Race conditions inside current NPTL pthread_exit() implementation. If macro NPTL_PTHREAD_EXIT_HACK is defined then a hack described in the bug report will be implemented inside my_thread_global_init() in my_thr_init.c. This amounts to spawning a dummy thread which does nothing but executes pthread_exit(0). This bug is fixed in version 2.5 of glibc library. TODO: Remove this code when fixed versions of glibc6 are in common use. */ #if defined(TARGET_OS_LINUX) && defined(HAVE_NPTL) && \ defined(__GLIBC__) && ( __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 5 ) #define NPTL_PTHREAD_EXIT_BUG 1 #endif #if defined(__WIN__) || defined(OS2) #ifdef OS2 Loading Loading @@ -199,7 +180,7 @@ extern int pthread_mutex_destroy (pthread_mutex_t *); #define pthread_mutex_unlock(A) LeaveCriticalSection(A) #define pthread_mutex_destroy(A) DeleteCriticalSection(A) #define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) #define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(ESRCH) #endif /* OS2 */ /* Dummy defines for easier code */ Loading Loading @@ -463,14 +444,14 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #define pthread_attr_setdetachstate(A,B) pthread_dummy(0) #define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(ESRCH) #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #endif #ifdef HAVE_DARWIN5_THREADS #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(ESRCH) #define pthread_condattr_init(A) pthread_dummy(0) #define pthread_condattr_destroy(A) pthread_dummy(0) #undef pthread_detach_this_thread Loading @@ -490,7 +471,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #ifndef pthread_sigmask #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #endif #define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(ESRCH) #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ Loading Loading @@ -717,6 +698,11 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr; #define MY_MUTEX_INIT_ERRCHK NULL #endif #ifndef ESRCH /* Define it to something */ #define ESRCH 1 #endif extern my_bool my_thread_global_init(void); extern void my_thread_global_end(void); extern my_bool my_thread_init(void); Loading mysql-test/r/handler.result +7 −0 Original line number Diff line number Diff line Loading @@ -482,3 +482,10 @@ ERROR 42S02: Table 'test.t1' doesn't exist drop table if exists t1; Warnings: Note 1051 Unknown table 't1' drop table if exists t1; create table t1 (a int) ENGINE=MEMORY; --> client 2 handler t1 open; ERROR HY000: Table storage engine for 't1' doesn't have this option --> client 1 drop table t1; mysql-test/r/query_cache.result +29 −0 Original line number Diff line number Diff line Loading @@ -1621,6 +1621,35 @@ a (select count(*) from t2) 3 0 4 0 drop table t1,t2; DROP DATABASE IF EXISTS bug30269; FLUSH STATUS; CREATE DATABASE bug30269; USE bug30269; CREATE TABLE test1 (id int, name varchar(23)); CREATE VIEW view1 AS SELECT * FROM test1; INSERT INTO test1 VALUES (5, 'testit'); GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost'; GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost'; set global query_cache_size= 81920; USE bug30269; show status like 'Qcache_queries_in_cache'; Variable_name Value Qcache_queries_in_cache 0 # Select statement not stored in query cache because of column privileges. SELECT id FROM test1 WHERE id>2; id 5 show status like 'Qcache_queries_in_cache'; Variable_name Value Qcache_queries_in_cache 0 SELECT id FROM view1 WHERE id>2; id 5 show status like 'Qcache_queries_in_cache'; Variable_name Value Qcache_queries_in_cache 1 DROP DATABASE bug30269; DROP USER 'bug30269'@'localhost'; set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; Loading mysql-test/r/view_query_cache.result→mysql-test/r/query_cache_with_views.result +0 −0 File moved. View file mysql-test/t/handler.test +14 −0 Original line number Diff line number Diff line Loading @@ -427,3 +427,17 @@ select * from t1; # Just to be sure and not confuse the next test case writer. drop table if exists t1; # # Bug#25856 - HANDLER table OPEN in one connection lock DROP TABLE in another one # --disable_warnings drop table if exists t1; --enable_warnings create table t1 (a int) ENGINE=MEMORY; --echo --> client 2 connection con2; --error 1031 handler t1 open; --echo --> client 1 connection default; drop table t1; Loading
include/my_pthread.h +9 −23 Original line number Diff line number Diff line Loading @@ -30,25 +30,6 @@ extern "C" { #define EXTERNC #endif /* __cplusplus */ /* BUG#24507: Race conditions inside current NPTL pthread_exit() implementation. If macro NPTL_PTHREAD_EXIT_HACK is defined then a hack described in the bug report will be implemented inside my_thread_global_init() in my_thr_init.c. This amounts to spawning a dummy thread which does nothing but executes pthread_exit(0). This bug is fixed in version 2.5 of glibc library. TODO: Remove this code when fixed versions of glibc6 are in common use. */ #if defined(TARGET_OS_LINUX) && defined(HAVE_NPTL) && \ defined(__GLIBC__) && ( __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 5 ) #define NPTL_PTHREAD_EXIT_BUG 1 #endif #if defined(__WIN__) || defined(OS2) #ifdef OS2 Loading Loading @@ -199,7 +180,7 @@ extern int pthread_mutex_destroy (pthread_mutex_t *); #define pthread_mutex_unlock(A) LeaveCriticalSection(A) #define pthread_mutex_destroy(A) DeleteCriticalSection(A) #define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) #define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(ESRCH) #endif /* OS2 */ /* Dummy defines for easier code */ Loading Loading @@ -463,14 +444,14 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #define pthread_attr_setdetachstate(A,B) pthread_dummy(0) #define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(ESRCH) #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #endif #ifdef HAVE_DARWIN5_THREADS #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(ESRCH) #define pthread_condattr_init(A) pthread_dummy(0) #define pthread_condattr_destroy(A) pthread_dummy(0) #undef pthread_detach_this_thread Loading @@ -490,7 +471,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #ifndef pthread_sigmask #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #endif #define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(ESRCH) #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ Loading Loading @@ -717,6 +698,11 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr; #define MY_MUTEX_INIT_ERRCHK NULL #endif #ifndef ESRCH /* Define it to something */ #define ESRCH 1 #endif extern my_bool my_thread_global_init(void); extern void my_thread_global_end(void); extern my_bool my_thread_init(void); Loading
mysql-test/r/handler.result +7 −0 Original line number Diff line number Diff line Loading @@ -482,3 +482,10 @@ ERROR 42S02: Table 'test.t1' doesn't exist drop table if exists t1; Warnings: Note 1051 Unknown table 't1' drop table if exists t1; create table t1 (a int) ENGINE=MEMORY; --> client 2 handler t1 open; ERROR HY000: Table storage engine for 't1' doesn't have this option --> client 1 drop table t1;
mysql-test/r/query_cache.result +29 −0 Original line number Diff line number Diff line Loading @@ -1621,6 +1621,35 @@ a (select count(*) from t2) 3 0 4 0 drop table t1,t2; DROP DATABASE IF EXISTS bug30269; FLUSH STATUS; CREATE DATABASE bug30269; USE bug30269; CREATE TABLE test1 (id int, name varchar(23)); CREATE VIEW view1 AS SELECT * FROM test1; INSERT INTO test1 VALUES (5, 'testit'); GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost'; GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost'; set global query_cache_size= 81920; USE bug30269; show status like 'Qcache_queries_in_cache'; Variable_name Value Qcache_queries_in_cache 0 # Select statement not stored in query cache because of column privileges. SELECT id FROM test1 WHERE id>2; id 5 show status like 'Qcache_queries_in_cache'; Variable_name Value Qcache_queries_in_cache 0 SELECT id FROM view1 WHERE id>2; id 5 show status like 'Qcache_queries_in_cache'; Variable_name Value Qcache_queries_in_cache 1 DROP DATABASE bug30269; DROP USER 'bug30269'@'localhost'; set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; Loading
mysql-test/r/view_query_cache.result→mysql-test/r/query_cache_with_views.result +0 −0 File moved. View file
mysql-test/t/handler.test +14 −0 Original line number Diff line number Diff line Loading @@ -427,3 +427,17 @@ select * from t1; # Just to be sure and not confuse the next test case writer. drop table if exists t1; # # Bug#25856 - HANDLER table OPEN in one connection lock DROP TABLE in another one # --disable_warnings drop table if exists t1; --enable_warnings create table t1 (a int) ENGINE=MEMORY; --echo --> client 2 connection con2; --error 1031 handler t1 open; --echo --> client 1 connection default; drop table t1;