mirror of
https://github.com/MariaDB/server.git
synced 2025-07-08 17:02:21 +03:00
merge mysql-next-mr --> mysql-5.1-rpl-merge
Conflicts: Text conflict in sql/log.cc Text conflict in sql/slave.cc Text conflict in sql/sql_base.cc
This commit is contained in:
@ -101,7 +101,7 @@ enum options_client
|
||||
/**
|
||||
First mysql version supporting the performance schema.
|
||||
*/
|
||||
#define FIRST_PERFORMANCE_SCHEMA_VERSION 50600
|
||||
#define FIRST_PERFORMANCE_SCHEMA_VERSION 50599
|
||||
|
||||
/**
|
||||
Name of the performance schema database.
|
||||
|
@ -72,6 +72,10 @@
|
||||
#define QUERY_SEND_FLAG 1
|
||||
#define QUERY_REAP_FLAG 2
|
||||
|
||||
#ifndef HAVE_SETENV
|
||||
#error implement our portable setenv replacement in mysys
|
||||
#endif
|
||||
|
||||
enum {
|
||||
OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION,
|
||||
OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
|
||||
@ -216,7 +220,6 @@ typedef struct
|
||||
int alloced_len;
|
||||
int int_dirty; /* do not update string if int is updated until first read */
|
||||
int alloced;
|
||||
char *env_s;
|
||||
} VAR;
|
||||
|
||||
/*Perl/shell-like variable registers */
|
||||
@ -1924,13 +1927,20 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
|
||||
+ name_len+1, MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
|
||||
tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0;
|
||||
if (name != NULL)
|
||||
{
|
||||
tmp_var->name= reinterpret_cast<char*>(tmp_var) + sizeof(*tmp_var);
|
||||
memcpy(tmp_var->name, name, name_len);
|
||||
tmp_var->name[name_len]= 0;
|
||||
}
|
||||
else
|
||||
tmp_var->name= NULL;
|
||||
|
||||
tmp_var->alloced = (v == 0);
|
||||
|
||||
if (!(tmp_var->str_val = (char*)my_malloc(val_alloc_len+1, MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
|
||||
memcpy(tmp_var->name, name, name_len);
|
||||
if (val)
|
||||
{
|
||||
memcpy(tmp_var->str_val, val, val_len);
|
||||
@ -1941,7 +1951,6 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
|
||||
tmp_var->alloced_len = val_alloc_len;
|
||||
tmp_var->int_val = (val) ? atoi(val) : 0;
|
||||
tmp_var->int_dirty = 0;
|
||||
tmp_var->env_s = 0;
|
||||
return tmp_var;
|
||||
}
|
||||
|
||||
@ -2069,20 +2078,15 @@ void var_set(const char *var_name, const char *var_name_end,
|
||||
|
||||
if (env_var)
|
||||
{
|
||||
char buf[1024], *old_env_s= v->env_s;
|
||||
if (v->int_dirty)
|
||||
{
|
||||
sprintf(v->str_val, "%d", v->int_val);
|
||||
v->int_dirty= 0;
|
||||
v->str_val_len= strlen(v->str_val);
|
||||
}
|
||||
my_snprintf(buf, sizeof(buf), "%.*s=%.*s",
|
||||
v->name_len, v->name,
|
||||
v->str_val_len, v->str_val);
|
||||
if (!(v->env_s= my_strdup(buf, MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
putenv(v->env_s);
|
||||
my_free(old_env_s, MYF(MY_ALLOW_ZERO_PTR));
|
||||
/* setenv() expects \0-terminated strings */
|
||||
DBUG_ASSERT(v->name[v->name_len] == 0);
|
||||
setenv(v->name, v->str_val, 1);
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
@ -318,9 +318,12 @@ inline ulonglong double2ulonglong(double d)
|
||||
#define strcasecmp stricmp
|
||||
#define strncasecmp strnicmp
|
||||
|
||||
#define HAVE_SNPRINTF /* Gave link error */
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define snprintf _snprintf
|
||||
|
||||
#define HAVE_SETENV 1
|
||||
#define setenv(VAR,VAL,X) _putenv_s(VAR,VAL)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */
|
||||
#define HAVE_ANSI_INCLUDE
|
||||
|
@ -501,7 +501,19 @@ int init_embedded_server(int argc, char **argv, char **groups)
|
||||
*/
|
||||
logger.init_base();
|
||||
|
||||
if (init_common_variables("my", *argcp, *argvp, (const char **)groups))
|
||||
orig_argc= *argcp;
|
||||
orig_argv= *argvp;
|
||||
load_defaults("my", (const char **)groups, argcp, argvp);
|
||||
defaults_argc= *argcp;
|
||||
defaults_argv= *argvp;
|
||||
remaining_argc= argc;
|
||||
remaining_argv= argv;
|
||||
|
||||
/* Must be initialized early for comparison of options name */
|
||||
system_charset_info= &my_charset_utf8_general_ci;
|
||||
sys_var_init();
|
||||
|
||||
if (init_common_variables())
|
||||
{
|
||||
mysql_server_end();
|
||||
return 1;
|
||||
|
20
mysql-test/include/have_perfschema.inc
Normal file
20
mysql-test/include/have_perfschema.inc
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
if (!`SELECT count(*) FROM information_schema.engines WHERE
|
||||
(support = 'YES' OR support = 'DEFAULT') AND
|
||||
engine = 'PERFORMANCE_SCHEMA'`){
|
||||
skip Need performance schema compiled in;
|
||||
}
|
@ -11,7 +11,8 @@ exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help
|
||||
|
||||
perl;
|
||||
@skipvars=qw/basedir open-files-limit general-log-file log
|
||||
log-slow-queries pid-file slow-query-log-file/;
|
||||
log-slow-queries pid-file slow-query-log-file
|
||||
datadir slave-load-tmpdir tmpdir/;
|
||||
@plugins=qw/innodb ndb ndbcluster safemalloc debug temp-pool ssl des-key-file
|
||||
thread-concurrency super-large-pages mutex-deadlock-detector/;
|
||||
@env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_SHAREDIR/;
|
||||
|
@ -3911,7 +3911,7 @@ sub mysqld_arguments ($$$$) {
|
||||
|
||||
if ( $opt_valgrind_mysqld )
|
||||
{
|
||||
mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
|
||||
mtr_add_arg($args, "%s--loose-skip-safemalloc", $prefix);
|
||||
|
||||
if ( $mysql_version_id < 50100 )
|
||||
{
|
||||
@ -5208,7 +5208,6 @@ sub valgrind_arguments {
|
||||
else
|
||||
{
|
||||
mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option
|
||||
mtr_add_arg($args, "--alignment=8");
|
||||
mtr_add_arg($args, "--leak-check=yes");
|
||||
mtr_add_arg($args, "--num-callers=16");
|
||||
mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
|
||||
|
@ -82,5 +82,24 @@ DROP TABLE table_1;
|
||||
DROP TABLE table_2;
|
||||
DROP TABLE table_3;
|
||||
DROP TABLE table_4;
|
||||
|
||||
Bug #50087 Interval arithmetic for Event_queue_element is not portable.
|
||||
|
||||
CREATE TABLE t1(a int);
|
||||
CREATE EVENT e1 ON SCHEDULE EVERY 1 MONTH
|
||||
STARTS NOW() - INTERVAL 1 MONTH
|
||||
ENDS NOW() + INTERVAL 2 MONTH
|
||||
ON COMPLETION PRESERVE
|
||||
DO
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE EVENT e2 ON SCHEDULE EVERY 1 MONTH
|
||||
STARTS NOW()
|
||||
ENDS NOW() + INTERVAL 11 MONTH
|
||||
ON COMPLETION PRESERVE
|
||||
DO
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TABLE t1;
|
||||
DROP EVENT e1;
|
||||
DROP EVENT e2;
|
||||
DROP DATABASE events_test;
|
||||
SET GLOBAL event_scheduler=@event_scheduler;
|
||||
|
@ -1419,19 +1419,19 @@ drop table t1;
|
||||
#
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
set optimizer_switch='index_merge=off,index_merge_union=off';
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
set optimizer_switch='index_merge_union=on';
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
set optimizer_switch='default,index_merge_sort_union=off';
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
set optimizer_switch=4;
|
||||
set optimizer_switch=NULL;
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'NULL'
|
||||
@ -1457,21 +1457,21 @@ set optimizer_switch=default;
|
||||
set optimizer_switch='index_merge=off,index_merge_union=off,default';
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
set optimizer_switch=default;
|
||||
select @@global.optimizer_switch;
|
||||
@@global.optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
set @@global.optimizer_switch=default;
|
||||
select @@global.optimizer_switch;
|
||||
@@global.optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
#
|
||||
# Check index_merge's @@optimizer_switch flags
|
||||
#
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
create table t0 (a int);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1 (a int, b int, c int, filler char(100),
|
||||
@ -1581,5 +1581,5 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
set optimizer_switch=default;
|
||||
show variables like 'optimizer_switch';
|
||||
Variable_name Value
|
||||
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
drop table t0, t1;
|
||||
|
@ -132,7 +132,8 @@ The following options may be given as the first argument:
|
||||
on that value
|
||||
--enable-locking Deprecated option, use --external-locking instead.
|
||||
--engine-condition-pushdown
|
||||
Push supported query conditions to the storage engine
|
||||
Push supported query conditions to the storage engine.
|
||||
Deprecated, use --optimizer-switch instead.
|
||||
(Defaults to on; use --skip-engine-condition-pushdown to disable.)
|
||||
--event-scheduler[=name]
|
||||
Enable the event scheduler. Possible values are ON, OFF,
|
||||
@ -413,8 +414,9 @@ The following options may be given as the first argument:
|
||||
--optimizer-switch=name
|
||||
optimizer_switch=option=val[,option=val...], where option
|
||||
is one of {index_merge, index_merge_union,
|
||||
index_merge_sort_union, index_merge_intersection} and val
|
||||
is one of {on, off, default}
|
||||
index_merge_sort_union, index_merge_intersection,
|
||||
engine_condition_pushdown} and val is one of {on, off,
|
||||
default}
|
||||
--partition[=name] Enable or disable partition plugin. Possible values are
|
||||
ON, OFF, FORCE (don't start if the plugin fails to load).
|
||||
--pid-file=name Pid file used by safe_mysqld
|
||||
@ -748,7 +750,6 @@ completion-type NO_CHAIN
|
||||
concurrent-insert AUTO
|
||||
connect-timeout 10
|
||||
console FALSE
|
||||
datadir MYSQLTEST_VARDIR/install.db/
|
||||
date-format %Y-%m-%d
|
||||
datetime-format %Y-%m-%d %H:%i:%s
|
||||
default-character-set latin1
|
||||
@ -859,7 +860,7 @@ old-passwords FALSE
|
||||
old-style-user-limits FALSE
|
||||
optimizer-prune-level 1
|
||||
optimizer-search-depth 62
|
||||
optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
partition ON
|
||||
plugin-dir MYSQL_LIBDIR/mysql/plugin
|
||||
plugin-load (No default value)
|
||||
@ -902,7 +903,6 @@ skip-show-database FALSE
|
||||
skip-slave-start FALSE
|
||||
slave-compressed-protocol FALSE
|
||||
slave-exec-mode STRICT
|
||||
slave-load-tmpdir MYSQLTEST_VARDIR/tmp/
|
||||
slave-net-timeout 3600
|
||||
slave-skip-errors (No default value)
|
||||
slave-transaction-retries 10
|
||||
@ -931,7 +931,6 @@ thread-stack 262144
|
||||
time-format %H:%i:%s
|
||||
timed-mutexes FALSE
|
||||
tmp-table-size 16777216
|
||||
tmpdir MYSQLTEST_VARDIR/tmp/
|
||||
transaction-alloc-block-size 8192
|
||||
transaction-isolation REPEATABLE-READ
|
||||
transaction-prealloc-size 4096
|
||||
|
@ -132,7 +132,8 @@ The following options may be given as the first argument:
|
||||
on that value
|
||||
--enable-locking Deprecated option, use --external-locking instead.
|
||||
--engine-condition-pushdown
|
||||
Push supported query conditions to the storage engine
|
||||
Push supported query conditions to the storage engine.
|
||||
Deprecated, use --optimizer-switch instead.
|
||||
(Defaults to on; use --skip-engine-condition-pushdown to disable.)
|
||||
--event-scheduler[=name]
|
||||
Enable the event scheduler. Possible values are ON, OFF,
|
||||
@ -413,8 +414,9 @@ The following options may be given as the first argument:
|
||||
--optimizer-switch=name
|
||||
optimizer_switch=option=val[,option=val...], where option
|
||||
is one of {index_merge, index_merge_union,
|
||||
index_merge_sort_union, index_merge_intersection} and val
|
||||
is one of {on, off, default}
|
||||
index_merge_sort_union, index_merge_intersection,
|
||||
engine_condition_pushdown} and val is one of {on, off,
|
||||
default}
|
||||
--partition[=name] Enable or disable partition plugin. Possible values are
|
||||
ON, OFF, FORCE (don't start if the plugin fails to load).
|
||||
--pid-file=name Pid file used by safe_mysqld
|
||||
@ -752,7 +754,6 @@ completion-type NO_CHAIN
|
||||
concurrent-insert AUTO
|
||||
connect-timeout 10
|
||||
console FALSE
|
||||
datadir MYSQLTEST_VARDIR/install.db/
|
||||
date-format %Y-%m-%d
|
||||
datetime-format %Y-%m-%d %H:%i:%s
|
||||
default-character-set latin1
|
||||
@ -863,7 +864,7 @@ old-passwords FALSE
|
||||
old-style-user-limits FALSE
|
||||
optimizer-prune-level 1
|
||||
optimizer-search-depth 62
|
||||
optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
partition ON
|
||||
plugin-dir MYSQL_LIBDIR/plugin
|
||||
plugin-load (No default value)
|
||||
@ -908,7 +909,6 @@ skip-show-database FALSE
|
||||
skip-slave-start FALSE
|
||||
slave-compressed-protocol FALSE
|
||||
slave-exec-mode STRICT
|
||||
slave-load-tmpdir MYSQLTEST_VARDIR/tmp/
|
||||
slave-net-timeout 3600
|
||||
slave-skip-errors (No default value)
|
||||
slave-transaction-retries 10
|
||||
@ -937,7 +937,6 @@ thread-stack 262144
|
||||
time-format %H:%i:%s
|
||||
timed-mutexes FALSE
|
||||
tmp-table-size 16777216
|
||||
tmpdir MYSQLTEST_VARDIR/tmp/
|
||||
transaction-alloc-block-size 8192
|
||||
transaction-isolation REPEATABLE-READ
|
||||
transaction-prealloc-size 4096
|
||||
|
5
mysql-test/r/optimizer_switch_eng_cond_pushdown1.result
Normal file
5
mysql-test/r/optimizer_switch_eng_cond_pushdown1.result
Normal file
@ -0,0 +1,5 @@
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
5
mysql-test/r/optimizer_switch_eng_cond_pushdown2.result
Normal file
5
mysql-test/r/optimizer_switch_eng_cond_pushdown2.result
Normal file
@ -0,0 +1,5 @@
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
@ -964,3 +964,53 @@ Variable_name Value
|
||||
Handler_read_rnd_next 18
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.1 tests
|
||||
#
|
||||
# BUG#48920: COUNT DISTINCT returns 1 for NULL values when in a subquery
|
||||
# in the select list
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
i int(11) DEFAULT NULL,
|
||||
v varchar(1) DEFAULT NULL
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES (8,'v');
|
||||
INSERT INTO t1 VALUES (9,'r');
|
||||
INSERT INTO t1 VALUES (NULL,'y');
|
||||
|
||||
CREATE TABLE t2 (
|
||||
i int(11) DEFAULT NULL,
|
||||
v varchar(1) DEFAULT NULL,
|
||||
KEY i_key (i)
|
||||
);
|
||||
|
||||
INSERT INTO t2 VALUES (NULL,'r');
|
||||
INSERT INTO t2 VALUES (0,'c');
|
||||
INSERT INTO t2 VALUES (0,'o');
|
||||
INSERT INTO t2 VALUES (2,'v');
|
||||
INSERT INTO t2 VALUES (7,'c');
|
||||
|
||||
SELECT i, v, (SELECT COUNT(DISTINCT i)
|
||||
FROM t1
|
||||
WHERE v = t2.v) as subsel
|
||||
FROM t2;
|
||||
i v subsel
|
||||
NULL r 1
|
||||
0 c 0
|
||||
0 o 0
|
||||
2 v 1
|
||||
7 c 0
|
||||
|
||||
EXPLAIN EXTENDED
|
||||
SELECT i, v, (SELECT COUNT(DISTINCT i)
|
||||
FROM t1
|
||||
WHERE v = t2.v) as subsel
|
||||
FROM t2;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.v' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,(select count(distinct `test`.`t1`.`i`) AS `COUNT(DISTINCT i)` from `test`.`t1` where (`test`.`t1`.`v` = `test`.`t2`.`v`)) AS `subsel` from `test`.`t2`
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.6 tests
|
||||
|
@ -51,8 +51,8 @@ CREATE TABLE t3 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NO
|
||||
insert into t3 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f");
|
||||
CREATE TABLE t4 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 bigint unsigned, attr3 tinyint unsigned, attr4 VARCHAR(10) , KEY (attr1)) ENGINE=ndbcluster;
|
||||
insert into t4 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f");
|
||||
set @old_ecpd = @@session.engine_condition_pushdown;
|
||||
set engine_condition_pushdown = off;
|
||||
set @old_optimizer_switch = @@session.optimizer_switch;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
select auto from t1 where
|
||||
string = "aaaa" and
|
||||
vstring = "aaaa" and
|
||||
@ -484,7 +484,7 @@ pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4
|
||||
2 2 9223372036854775804 2 c 2 2 9223372036854775804 2 c
|
||||
3 3 9223372036854775805 3 d 3 3 9223372036854775805 3 d
|
||||
4 4 9223372036854775806 4 e 4 4 9223372036854775806 4 e
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
explain
|
||||
select auto from t1 where
|
||||
string = "aaaa" and
|
||||
@ -1769,12 +1769,12 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
create table t5 (a int primary key auto_increment, b tinytext not null)
|
||||
engine = ndb;
|
||||
insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
|
||||
set engine_condition_pushdown = off;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
select * from t5 where b like '%jo%' order by a;
|
||||
a b
|
||||
1 jonas
|
||||
3 johan
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
explain select * from t5 where b like '%jo%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t5 ALL NULL NULL NULL NULL # Using where
|
||||
@ -1782,7 +1782,7 @@ select * from t5 where b like '%jo%' order by a;
|
||||
a b
|
||||
1 jonas
|
||||
3 johan
|
||||
set engine_condition_pushdown = off;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
select auto from t1 where date_time like '1902-02-02 %' order by auto;
|
||||
auto
|
||||
2
|
||||
@ -1790,7 +1790,7 @@ select auto from t1 where date_time not like '1902-02-02 %' order by auto;
|
||||
auto
|
||||
3
|
||||
4
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
explain select auto from t1 where date_time like '1902-02-02 %';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
|
||||
@ -1808,7 +1808,7 @@ drop table t1;
|
||||
create table t1 (a int, b varchar(3), primary key using hash(a))
|
||||
engine=ndb;
|
||||
insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
|
||||
set engine_condition_pushdown = off;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
select * from t1 where b like 'ab';
|
||||
a b
|
||||
2 ab
|
||||
@ -1821,7 +1821,7 @@ a b
|
||||
select * from t1 where b like 'abc' or b like 'abc';
|
||||
a b
|
||||
3 abc
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
select * from t1 where b like 'ab';
|
||||
a b
|
||||
2 ab
|
||||
@ -1838,7 +1838,7 @@ drop table t1;
|
||||
create table t1 (a int, b char(3), primary key using hash(a))
|
||||
engine=ndb;
|
||||
insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
|
||||
set engine_condition_pushdown = off;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
select * from t1 where b like 'ab';
|
||||
a b
|
||||
2 ab
|
||||
@ -1851,7 +1851,7 @@ a b
|
||||
select * from t1 where b like 'abc' or b like 'abc';
|
||||
a b
|
||||
3 abc
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
select * from t1 where b like 'ab';
|
||||
a b
|
||||
2 ab
|
||||
@ -1868,11 +1868,11 @@ drop table t1;
|
||||
create table t1 ( fname varchar(255), lname varchar(255) )
|
||||
engine=ndbcluster;
|
||||
insert into t1 values ("Young","Foo");
|
||||
set engine_condition_pushdown = 0;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
fname lname
|
||||
Young Foo
|
||||
set engine_condition_pushdown = 1;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
fname lname
|
||||
Young Foo
|
||||
@ -1880,11 +1880,11 @@ insert into t1 values ("aaa", "aaa");
|
||||
insert into t1 values ("bbb", "bbb");
|
||||
insert into t1 values ("ccc", "ccc");
|
||||
insert into t1 values ("ddd", "ddd");
|
||||
set engine_condition_pushdown = 0;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
fname lname
|
||||
Young Foo
|
||||
set engine_condition_pushdown = 1;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
fname lname
|
||||
Young Foo
|
||||
@ -1896,7 +1896,7 @@ insert into t1 values (20,2,200,0+0x2222);
|
||||
insert into t1 values (30,3,300,0+0x3333);
|
||||
insert into t1 values (40,4,400,0+0x4444);
|
||||
insert into t1 values (50,5,500,0+0x5555);
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
select a,b,d from t1
|
||||
where b in (0,1,2,5)
|
||||
order by b;
|
||||
@ -1916,5 +1916,5 @@ a b d
|
||||
50 5 21845
|
||||
Warnings:
|
||||
Warning 4294 Scan filter is too large, discarded
|
||||
set engine_condition_pushdown = @old_ecpd;
|
||||
set optimizer_switch = @old_optimizer_switch;
|
||||
DROP TABLE t1,t2,t3,t4,t5;
|
||||
|
@ -548,7 +548,7 @@ Overlaps(@horiz1, @point2)
|
||||
0
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
|
||||
CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT);
|
||||
CREATE TABLE gis_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g LINESTRING);
|
||||
|
@ -181,8 +181,8 @@ a b c
|
||||
5 5 NULL
|
||||
8 3 NULL
|
||||
9 3 NULL
|
||||
set @old_ecpd = @@session.engine_condition_pushdown;
|
||||
set engine_condition_pushdown = true;
|
||||
set @old_optimizer_switch = @@session.optimizer_switch;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
explain select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range PRIMARY,b PRIMARY 4 NULL 1 Using where with pushed condition
|
||||
@ -191,7 +191,7 @@ a b c
|
||||
3 3 NULL
|
||||
5 5 NULL
|
||||
8 3 NULL
|
||||
set engine_condition_pushdown = @old_ecpd;
|
||||
set optimizer_switch = @old_optimizer_switch;
|
||||
drop table t2;
|
||||
CREATE TABLE t3 (
|
||||
a int unsigned NOT NULL,
|
||||
|
@ -68,8 +68,8 @@ CREATE TABLE t4 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NO
|
||||
|
||||
insert into t4 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f");
|
||||
|
||||
set @old_ecpd = @@session.engine_condition_pushdown;
|
||||
set engine_condition_pushdown = off;
|
||||
set @old_optimizer_switch = @@session.optimizer_switch;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
|
||||
# Test all types and compare operators
|
||||
select auto from t1 where
|
||||
@ -453,7 +453,7 @@ select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5
|
||||
select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
|
||||
select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
|
||||
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
|
||||
# Test all types and compare operators
|
||||
--replace_column 9 #
|
||||
@ -1674,18 +1674,18 @@ select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.a
|
||||
create table t5 (a int primary key auto_increment, b tinytext not null)
|
||||
engine = ndb;
|
||||
insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
|
||||
set engine_condition_pushdown = off;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
select * from t5 where b like '%jo%' order by a;
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
--replace_column 9 #
|
||||
explain select * from t5 where b like '%jo%';
|
||||
select * from t5 where b like '%jo%' order by a;
|
||||
|
||||
# bug#21056 ndb pushdown equal/setValue error on datetime
|
||||
set engine_condition_pushdown = off;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
select auto from t1 where date_time like '1902-02-02 %' order by auto;
|
||||
select auto from t1 where date_time not like '1902-02-02 %' order by auto;
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
--replace_column 9 #
|
||||
explain select auto from t1 where date_time like '1902-02-02 %';
|
||||
select auto from t1 where date_time like '1902-02-02 %' order by auto;
|
||||
@ -1701,12 +1701,12 @@ insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
|
||||
# in TUP the constants 'ab' 'abc' were expected in varchar format
|
||||
# "like" returned error which became "false"
|
||||
# scan filter negates "or" which exposes the bug
|
||||
set engine_condition_pushdown = off;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
select * from t1 where b like 'ab';
|
||||
select * from t1 where b like 'ab' or b like 'ab';
|
||||
select * from t1 where b like 'abc';
|
||||
select * from t1 where b like 'abc' or b like 'abc';
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
select * from t1 where b like 'ab';
|
||||
select * from t1 where b like 'ab' or b like 'ab';
|
||||
select * from t1 where b like 'abc';
|
||||
@ -1719,12 +1719,12 @@ engine=ndb;
|
||||
insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
|
||||
# test that incorrect MySQL behaviour is preserved
|
||||
# 'ab ' LIKE 'ab' is true in MySQL
|
||||
set engine_condition_pushdown = off;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
select * from t1 where b like 'ab';
|
||||
select * from t1 where b like 'ab' or b like 'ab';
|
||||
select * from t1 where b like 'abc';
|
||||
select * from t1 where b like 'abc' or b like 'abc';
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
select * from t1 where b like 'ab';
|
||||
select * from t1 where b like 'ab' or b like 'ab';
|
||||
select * from t1 where b like 'abc';
|
||||
@ -1736,9 +1736,9 @@ create table t1 ( fname varchar(255), lname varchar(255) )
|
||||
engine=ndbcluster;
|
||||
insert into t1 values ("Young","Foo");
|
||||
|
||||
set engine_condition_pushdown = 0;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
set engine_condition_pushdown = 1;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
|
||||
# make sure optimizer does not do some crazy shortcut
|
||||
@ -1747,9 +1747,9 @@ insert into t1 values ("bbb", "bbb");
|
||||
insert into t1 values ("ccc", "ccc");
|
||||
insert into t1 values ("ddd", "ddd");
|
||||
|
||||
set engine_condition_pushdown = 0;
|
||||
set optimizer_switch = "engine_condition_pushdown=off";
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
set engine_condition_pushdown = 1;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
|
||||
# bug#29390 (scan filter is too large, discarded)
|
||||
@ -1766,7 +1766,7 @@ insert into t1 values (30,3,300,0+0x3333);
|
||||
insert into t1 values (40,4,400,0+0x4444);
|
||||
insert into t1 values (50,5,500,0+0x5555);
|
||||
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
|
||||
select a,b,d from t1
|
||||
where b in (0,1,2,5)
|
||||
@ -2050,5 +2050,5 @@ select a,b,d from t1
|
||||
order by b;
|
||||
--enable_query_log
|
||||
|
||||
set engine_condition_pushdown = @old_ecpd;
|
||||
set optimizer_switch = @old_optimizer_switch;
|
||||
DROP TABLE t1,t2,t3,t4,t5;
|
||||
|
@ -1,5 +1,5 @@
|
||||
--source include/have_ndb.inc
|
||||
SET storage_engine=ndbcluster;
|
||||
--source include/gis_generic.inc
|
||||
set engine_condition_pushdown = on;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
--source include/gis_generic.inc
|
||||
|
@ -112,11 +112,11 @@ insert t2 values(1,1,NULL),(2,2,2),(3,3,NULL),(4,4,4),(5,5,NULL),(6,6,6),(7,7,NU
|
||||
select * from t2 where c IS NULL order by a;
|
||||
select * from t2 where b = 3 AND c IS NULL order by a;
|
||||
select * from t2 where (b = 3 OR b = 5) AND c IS NULL order by a;
|
||||
set @old_ecpd = @@session.engine_condition_pushdown;
|
||||
set engine_condition_pushdown = true;
|
||||
set @old_optimizer_switch = @@session.optimizer_switch;
|
||||
set optimizer_switch = "engine_condition_pushdown=on";
|
||||
explain select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a;
|
||||
select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a;
|
||||
set engine_condition_pushdown = @old_ecpd;
|
||||
set optimizer_switch = @old_optimizer_switch;
|
||||
|
||||
drop table t2;
|
||||
|
||||
|
@ -10,7 +10,5 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
rpl_get_master_version_and_clock: # Bug#46931 2009-10-17 joro rpl.rpl_get_master_version_and_clock fails
|
||||
rpl_row_create_table : Bug#45576 2009-12-01 joro rpl_row_create_table fails on PB2
|
||||
rpl_cross_version : BUG#43913 2009-10-22 luis rpl_cross_version fails with symptom in described in bug report
|
||||
rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
|
||||
|
@ -1 +1 @@
|
||||
--replicate-same-server-id --relay-log=slave-relay-bin --secure-file-priv=$MYSQL_TMP_DIR
|
||||
--replicate-same-server-id --relay-log=slave-relay-bin
|
||||
|
@ -1,12 +1,14 @@
|
||||
create table t1 (test_name text);
|
||||
create table t2 (variable_name text);
|
||||
load data infile "MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1;
|
||||
select variable_name as `There should be *no* variables listed below:`
|
||||
from information_schema.global_variables
|
||||
left join t1 on variable_name=test_name where
|
||||
test_name is null
|
||||
union
|
||||
select variable_name from information_schema.session_variables
|
||||
left join t1 on variable_name=test_name where
|
||||
test_name is null;
|
||||
insert into t2 select variable_name from information_schema.global_variables;
|
||||
insert into t2 select variable_name from information_schema.session_variables;
|
||||
update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_");
|
||||
select variable_name as `There should be *no* long test name listed below:` from t2
|
||||
where length(variable_name) > 50;
|
||||
There should be *no* long test name listed below:
|
||||
select variable_name as `There should be *no* variables listed below:` from t2
|
||||
left join t1 on variable_name=test_name where test_name is null;
|
||||
There should be *no* variables listed below:
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
@ -6,19 +6,33 @@ SET @global_start_value = @@global.engine_condition_pushdown;
|
||||
SELECT @global_start_value;
|
||||
@global_start_value
|
||||
1
|
||||
select @old_session_opt_switch:=@@session.optimizer_switch,
|
||||
@old_global_opt_switch:=@@global.optimizer_switch;
|
||||
@old_session_opt_switch:=@@session.optimizer_switch @old_global_opt_switch:=@@global.optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
'#--------------------FN_DYNVARS_028_01------------------------#'
|
||||
SET @@session.engine_condition_pushdown = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SET @@session.engine_condition_pushdown = DEFAULT;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
1
|
||||
SET @@global.engine_condition_pushdown = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SET @@global.engine_condition_pushdown = DEFAULT;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
1
|
||||
'#---------------------FN_DYNVARS_028_02-------------------------#'
|
||||
SET engine_condition_pushdown = 1;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@engine_condition_pushdown;
|
||||
@@engine_condition_pushdown
|
||||
1
|
||||
@ -29,27 +43,39 @@ ERROR 42S02: Unknown table 'local' in field list
|
||||
SELECT global.engine_condition_pushdown;
|
||||
ERROR 42S02: Unknown table 'global' in field list
|
||||
SET session engine_condition_pushdown = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
0
|
||||
SET global engine_condition_pushdown = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
0
|
||||
'#--------------------FN_DYNVARS_028_03------------------------#'
|
||||
SET @@session.engine_condition_pushdown = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
0
|
||||
SET @@session.engine_condition_pushdown = 1;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
1
|
||||
SET @@global.engine_condition_pushdown = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
0
|
||||
SET @@global.engine_condition_pushdown = 1;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
1
|
||||
@ -88,11 +114,17 @@ SET @@global.engine_condition_pushdown =
|
||||
ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of '<27>FF'
|
||||
'#-------------------FN_DYNVARS_028_05----------------------------#'
|
||||
SET @@global.engine_condition_pushdown = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SET @@session.engine_condition_pushdown = 1;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown AS res_is_0;
|
||||
res_is_0
|
||||
0
|
||||
SET @@global.engine_condition_pushdown = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown AS res_is_1;
|
||||
res_is_1
|
||||
1
|
||||
@ -126,43 +158,133 @@ VARIABLE_VALUE
|
||||
ON
|
||||
'#---------------------FN_DYNVARS_028_08-------------------------#'
|
||||
SET @@session.engine_condition_pushdown = OFF;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
0
|
||||
SET @@session.engine_condition_pushdown = ON;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
1
|
||||
SET @@global.engine_condition_pushdown = OFF;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
0
|
||||
SET @@global.engine_condition_pushdown = ON;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
1
|
||||
'#---------------------FN_DYNVARS_028_09----------------------#'
|
||||
SET @@session.engine_condition_pushdown = TRUE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
1
|
||||
SET @@session.engine_condition_pushdown = FALSE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
0
|
||||
SET @@global.engine_condition_pushdown = TRUE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
1
|
||||
SET @@global.engine_condition_pushdown = FALSE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
0
|
||||
Check that @@engine_condition_pushdown influences
|
||||
@@optimizer_switch and vice-versa
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
set @@session.engine_condition_pushdown = TRUE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
set @@session.engine_condition_pushdown = FALSE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
set @@global.engine_condition_pushdown = TRUE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
set @@global.engine_condition_pushdown = FALSE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
set @@session.optimizer_switch = "engine_condition_pushdown=on";
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
set @@session.optimizer_switch = "engine_condition_pushdown=off";
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
set @@global.optimizer_switch = "engine_condition_pushdown=on";
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
set @@global.optimizer_switch = "engine_condition_pushdown=off";
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
SET @@session.engine_condition_pushdown = @session_start_value;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
1
|
||||
SET @@global.engine_condition_pushdown = @global_start_value;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
1
|
||||
set @session.optimizer_switch=@old_session_opt_switch,
|
||||
@@global.optimizer_switch=@old_global_opt_switch;
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
|
||||
1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
|
@ -1,45 +1,45 @@
|
||||
SET @start_global_value = @@global.optimizer_switch;
|
||||
SELECT @start_global_value;
|
||||
@start_global_value
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
select @@global.optimizer_switch;
|
||||
@@global.optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
select @@session.optimizer_switch;
|
||||
@@session.optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
show global variables like 'optimizer_switch';
|
||||
Variable_name Value
|
||||
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
show session variables like 'optimizer_switch';
|
||||
Variable_name Value
|
||||
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
select * from information_schema.global_variables where variable_name='optimizer_switch';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
select * from information_schema.session_variables where variable_name='optimizer_switch';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
set global optimizer_switch=10;
|
||||
select @@global.optimizer_switch;
|
||||
@@global.optimizer_switch
|
||||
index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on
|
||||
index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
set session optimizer_switch=5;
|
||||
select @@session.optimizer_switch;
|
||||
@@session.optimizer_switch
|
||||
index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off
|
||||
index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
|
||||
set global optimizer_switch="index_merge_sort_union=on";
|
||||
select @@global.optimizer_switch;
|
||||
@@global.optimizer_switch
|
||||
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
set session optimizer_switch="index_merge=off";
|
||||
select @@session.optimizer_switch;
|
||||
@@session.optimizer_switch
|
||||
index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off
|
||||
index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
|
||||
set session optimizer_switch="default";
|
||||
select @@session.optimizer_switch;
|
||||
@@session.optimizer_switch
|
||||
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
||||
set global optimizer_switch=1.1;
|
||||
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
|
||||
set global optimizer_switch=1e1;
|
||||
@ -51,4 +51,4 @@ ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar'
|
||||
SET @@global.optimizer_switch = @start_global_value;
|
||||
SELECT @@global.optimizer_switch;
|
||||
@@global.optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
||||
|
23
mysql-test/suite/sys_vars/r/performance_schema_basic.result
Normal file
23
mysql-test/suite/sys_vars/r/performance_schema_basic.result
Normal file
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema;
|
||||
@@global.performance_schema
|
||||
1
|
||||
select @@session.performance_schema;
|
||||
ERROR HY000: Variable 'performance_schema' is a GLOBAL variable
|
||||
show global variables like 'performance_schema';
|
||||
Variable_name Value
|
||||
performance_schema ON
|
||||
show session variables like 'performance_schema';
|
||||
Variable_name Value
|
||||
performance_schema ON
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA ON
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA ON
|
||||
set global performance_schema=1;
|
||||
ERROR HY000: Variable 'performance_schema' is a read only variable
|
||||
set session performance_schema=1;
|
||||
ERROR HY000: Variable 'performance_schema' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_events_waits_history_long_size;
|
||||
@@global.performance_schema_events_waits_history_long_size
|
||||
15000
|
||||
select @@session.performance_schema_events_waits_history_long_size;
|
||||
ERROR HY000: Variable 'performance_schema_events_waits_history_long_size' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_events_waits_history_long_size';
|
||||
Variable_name Value
|
||||
performance_schema_events_waits_history_long_size 15000
|
||||
show session variables like 'performance_schema_events_waits_history_long_size';
|
||||
Variable_name Value
|
||||
performance_schema_events_waits_history_long_size 15000
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_events_waits_history_long_size';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE 15000
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_events_waits_history_long_size';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE 15000
|
||||
set global performance_schema_events_waits_history_long_size=1;
|
||||
ERROR HY000: Variable 'performance_schema_events_waits_history_long_size' is a read only variable
|
||||
set session performance_schema_events_waits_history_long_size=1;
|
||||
ERROR HY000: Variable 'performance_schema_events_waits_history_long_size' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_events_waits_history_size;
|
||||
@@global.performance_schema_events_waits_history_size
|
||||
15
|
||||
select @@session.performance_schema_events_waits_history_size;
|
||||
ERROR HY000: Variable 'performance_schema_events_waits_history_size' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_events_waits_history_size';
|
||||
Variable_name Value
|
||||
performance_schema_events_waits_history_size 15
|
||||
show session variables like 'performance_schema_events_waits_history_size';
|
||||
Variable_name Value
|
||||
performance_schema_events_waits_history_size 15
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_events_waits_history_size';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE 15
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_events_waits_history_size';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE 15
|
||||
set global performance_schema_events_waits_history_size=1;
|
||||
ERROR HY000: Variable 'performance_schema_events_waits_history_size' is a read only variable
|
||||
set session performance_schema_events_waits_history_size=1;
|
||||
ERROR HY000: Variable 'performance_schema_events_waits_history_size' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_cond_classes;
|
||||
@@global.performance_schema_max_cond_classes
|
||||
123
|
||||
select @@session.performance_schema_max_cond_classes;
|
||||
ERROR HY000: Variable 'performance_schema_max_cond_classes' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_cond_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_cond_classes 123
|
||||
show session variables like 'performance_schema_max_cond_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_cond_classes 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_cond_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_COND_CLASSES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_cond_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_COND_CLASSES 123
|
||||
set global performance_schema_max_cond_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_cond_classes' is a read only variable
|
||||
set session performance_schema_max_cond_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_cond_classes' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_cond_instances;
|
||||
@@global.performance_schema_max_cond_instances
|
||||
123
|
||||
select @@session.performance_schema_max_cond_instances;
|
||||
ERROR HY000: Variable 'performance_schema_max_cond_instances' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_cond_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_cond_instances 123
|
||||
show session variables like 'performance_schema_max_cond_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_cond_instances 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_cond_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_COND_INSTANCES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_cond_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_COND_INSTANCES 123
|
||||
set global performance_schema_max_cond_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_cond_instances' is a read only variable
|
||||
set session performance_schema_max_cond_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_cond_instances' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_file_classes;
|
||||
@@global.performance_schema_max_file_classes
|
||||
123
|
||||
select @@session.performance_schema_max_file_classes;
|
||||
ERROR HY000: Variable 'performance_schema_max_file_classes' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_file_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_file_classes 123
|
||||
show session variables like 'performance_schema_max_file_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_file_classes 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_file_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_FILE_CLASSES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_file_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_FILE_CLASSES 123
|
||||
set global performance_schema_max_file_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_file_classes' is a read only variable
|
||||
set session performance_schema_max_file_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_file_classes' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_file_handles;
|
||||
@@global.performance_schema_max_file_handles
|
||||
123
|
||||
select @@session.performance_schema_max_file_handles;
|
||||
ERROR HY000: Variable 'performance_schema_max_file_handles' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_file_handles';
|
||||
Variable_name Value
|
||||
performance_schema_max_file_handles 123
|
||||
show session variables like 'performance_schema_max_file_handles';
|
||||
Variable_name Value
|
||||
performance_schema_max_file_handles 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_file_handles';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_FILE_HANDLES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_file_handles';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_FILE_HANDLES 123
|
||||
set global performance_schema_max_file_handles=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_file_handles' is a read only variable
|
||||
set session performance_schema_max_file_handles=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_file_handles' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_file_instances;
|
||||
@@global.performance_schema_max_file_instances
|
||||
123
|
||||
select @@session.performance_schema_max_file_instances;
|
||||
ERROR HY000: Variable 'performance_schema_max_file_instances' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_file_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_file_instances 123
|
||||
show session variables like 'performance_schema_max_file_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_file_instances 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_file_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_file_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES 123
|
||||
set global performance_schema_max_file_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_file_instances' is a read only variable
|
||||
set session performance_schema_max_file_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_file_instances' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_mutex_classes;
|
||||
@@global.performance_schema_max_mutex_classes
|
||||
123
|
||||
select @@session.performance_schema_max_mutex_classes;
|
||||
ERROR HY000: Variable 'performance_schema_max_mutex_classes' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_mutex_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_mutex_classes 123
|
||||
show session variables like 'performance_schema_max_mutex_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_mutex_classes 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_mutex_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_mutex_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES 123
|
||||
set global performance_schema_max_mutex_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_mutex_classes' is a read only variable
|
||||
set session performance_schema_max_mutex_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_mutex_classes' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_mutex_instances;
|
||||
@@global.performance_schema_max_mutex_instances
|
||||
123
|
||||
select @@session.performance_schema_max_mutex_instances;
|
||||
ERROR HY000: Variable 'performance_schema_max_mutex_instances' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_mutex_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_mutex_instances 123
|
||||
show session variables like 'performance_schema_max_mutex_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_mutex_instances 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_mutex_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_mutex_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES 123
|
||||
set global performance_schema_max_mutex_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_mutex_instances' is a read only variable
|
||||
set session performance_schema_max_mutex_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_mutex_instances' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_rwlock_classes;
|
||||
@@global.performance_schema_max_rwlock_classes
|
||||
123
|
||||
select @@session.performance_schema_max_rwlock_classes;
|
||||
ERROR HY000: Variable 'performance_schema_max_rwlock_classes' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_rwlock_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_rwlock_classes 123
|
||||
show session variables like 'performance_schema_max_rwlock_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_rwlock_classes 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_rwlock_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_rwlock_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES 123
|
||||
set global performance_schema_max_rwlock_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_rwlock_classes' is a read only variable
|
||||
set session performance_schema_max_rwlock_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_rwlock_classes' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_rwlock_instances;
|
||||
@@global.performance_schema_max_rwlock_instances
|
||||
123
|
||||
select @@session.performance_schema_max_rwlock_instances;
|
||||
ERROR HY000: Variable 'performance_schema_max_rwlock_instances' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_rwlock_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_rwlock_instances 123
|
||||
show session variables like 'performance_schema_max_rwlock_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_rwlock_instances 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_rwlock_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_rwlock_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES 123
|
||||
set global performance_schema_max_rwlock_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_rwlock_instances' is a read only variable
|
||||
set session performance_schema_max_rwlock_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_rwlock_instances' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_table_handles;
|
||||
@@global.performance_schema_max_table_handles
|
||||
123
|
||||
select @@session.performance_schema_max_table_handles;
|
||||
ERROR HY000: Variable 'performance_schema_max_table_handles' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_table_handles';
|
||||
Variable_name Value
|
||||
performance_schema_max_table_handles 123
|
||||
show session variables like 'performance_schema_max_table_handles';
|
||||
Variable_name Value
|
||||
performance_schema_max_table_handles 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_table_handles';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_table_handles';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES 123
|
||||
set global performance_schema_max_table_handles=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_table_handles' is a read only variable
|
||||
set session performance_schema_max_table_handles=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_table_handles' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_table_instances;
|
||||
@@global.performance_schema_max_table_instances
|
||||
123
|
||||
select @@session.performance_schema_max_table_instances;
|
||||
ERROR HY000: Variable 'performance_schema_max_table_instances' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_table_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_table_instances 123
|
||||
show session variables like 'performance_schema_max_table_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_table_instances 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_table_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_table_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES 123
|
||||
set global performance_schema_max_table_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_table_instances' is a read only variable
|
||||
set session performance_schema_max_table_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_table_instances' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_thread_classes;
|
||||
@@global.performance_schema_max_thread_classes
|
||||
123
|
||||
select @@session.performance_schema_max_thread_classes;
|
||||
ERROR HY000: Variable 'performance_schema_max_thread_classes' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_thread_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_thread_classes 123
|
||||
show session variables like 'performance_schema_max_thread_classes';
|
||||
Variable_name Value
|
||||
performance_schema_max_thread_classes 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_thread_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_thread_classes';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES 123
|
||||
set global performance_schema_max_thread_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_thread_classes' is a read only variable
|
||||
set session performance_schema_max_thread_classes=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_thread_classes' is a read only variable
|
@ -0,0 +1,23 @@
|
||||
select @@global.performance_schema_max_thread_instances;
|
||||
@@global.performance_schema_max_thread_instances
|
||||
123
|
||||
select @@session.performance_schema_max_thread_instances;
|
||||
ERROR HY000: Variable 'performance_schema_max_thread_instances' is a GLOBAL variable
|
||||
show global variables like 'performance_schema_max_thread_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_thread_instances 123
|
||||
show session variables like 'performance_schema_max_thread_instances';
|
||||
Variable_name Value
|
||||
performance_schema_max_thread_instances 123
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_thread_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES 123
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_thread_instances';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES 123
|
||||
set global performance_schema_max_thread_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_thread_instances' is a read only variable
|
||||
set session performance_schema_max_thread_instances=1;
|
||||
ERROR HY000: Variable 'performance_schema_max_thread_instances' is a read only variable
|
@ -1,3 +1,18 @@
|
||||
# Copyright (C) 2009-2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
|
||||
#
|
||||
@ -20,16 +35,26 @@ perl;
|
||||
EOF
|
||||
|
||||
create table t1 (test_name text);
|
||||
create table t2 (variable_name text);
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval load data infile "$MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1;
|
||||
|
||||
select variable_name as `There should be *no* variables listed below:`
|
||||
from information_schema.global_variables
|
||||
left join t1 on variable_name=test_name where
|
||||
test_name is null
|
||||
union
|
||||
select variable_name from information_schema.session_variables
|
||||
left join t1 on variable_name=test_name where
|
||||
test_name is null;
|
||||
insert into t2 select variable_name from information_schema.global_variables;
|
||||
insert into t2 select variable_name from information_schema.session_variables;
|
||||
|
||||
# Performance schema variables are too long for files named
|
||||
# 'mysql-test/suite/sys_vars/t/' ...
|
||||
# ... 'performance_schema_events_waits_history_long_size_basic-master.opt'
|
||||
# to fit in the tar source distribution (limit in old tar)
|
||||
# Renaming the tests to aliases below.
|
||||
|
||||
update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_");
|
||||
|
||||
select variable_name as `There should be *no* long test name listed below:` from t2
|
||||
where length(variable_name) > 50;
|
||||
|
||||
select variable_name as `There should be *no* variables listed below:` from t2
|
||||
left join t1 on variable_name=test_name where test_name is null;
|
||||
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
@ -40,6 +40,10 @@ SELECT @session_start_value;
|
||||
SET @global_start_value = @@global.engine_condition_pushdown;
|
||||
SELECT @global_start_value;
|
||||
|
||||
# same for optimizer_switch
|
||||
select @old_session_opt_switch:=@@session.optimizer_switch,
|
||||
@old_global_opt_switch:=@@global.optimizer_switch;
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_028_01------------------------#'
|
||||
########################################################################
|
||||
# Display the DEFAULT value of engine_condition_pushdown #
|
||||
@ -204,6 +208,44 @@ SELECT @@global.engine_condition_pushdown;
|
||||
SET @@global.engine_condition_pushdown = FALSE;
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
|
||||
--echo Check that @@engine_condition_pushdown influences
|
||||
--echo @@optimizer_switch and vice-versa
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
set @@session.engine_condition_pushdown = TRUE;
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
set @@session.engine_condition_pushdown = FALSE;
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
set @@global.engine_condition_pushdown = TRUE;
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
set @@global.engine_condition_pushdown = FALSE;
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
set @@session.optimizer_switch = "engine_condition_pushdown=on";
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
set @@session.optimizer_switch = "engine_condition_pushdown=off";
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
set @@global.optimizer_switch = "engine_condition_pushdown=on";
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
set @@global.optimizer_switch = "engine_condition_pushdown=off";
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
|
||||
##############################
|
||||
# Restore initial value #
|
||||
##############################
|
||||
@ -214,6 +256,12 @@ SELECT @@session.engine_condition_pushdown;
|
||||
SET @@global.engine_condition_pushdown = @global_start_value;
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
|
||||
set @session.optimizer_switch=@old_session_opt_switch,
|
||||
@@global.optimizer_switch=@old_global_opt_switch;
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
||||
|
||||
###############################################################
|
||||
# END OF engine_condition_pushdown TESTS #
|
||||
###############################################################
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema
|
47
mysql-test/suite/sys_vars/t/performance_schema_basic.test
Normal file
47
mysql-test/suite/sys_vars/t/performance_schema_basic.test
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema;
|
||||
|
||||
show global variables like 'performance_schema';
|
||||
|
||||
show session variables like 'performance_schema';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-events-waits-history-long-size=15000
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_events_waits_history_long_size;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_events_waits_history_long_size;
|
||||
|
||||
show global variables like 'performance_schema_events_waits_history_long_size';
|
||||
|
||||
show session variables like 'performance_schema_events_waits_history_long_size';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_events_waits_history_long_size';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_events_waits_history_long_size';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_events_waits_history_long_size=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_events_waits_history_long_size=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-events-waits-history-size=15
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_events_waits_history_size;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_events_waits_history_size;
|
||||
|
||||
show global variables like 'performance_schema_events_waits_history_size';
|
||||
|
||||
show session variables like 'performance_schema_events_waits_history_size';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_events_waits_history_size';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_events_waits_history_size';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_events_waits_history_size=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_events_waits_history_size=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-cond-classes=123
|
47
mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic.test
Normal file
47
mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic.test
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_cond_classes;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_cond_classes;
|
||||
|
||||
show global variables like 'performance_schema_max_cond_classes';
|
||||
|
||||
show session variables like 'performance_schema_max_cond_classes';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_cond_classes';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_cond_classes';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_cond_classes=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_cond_classes=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-cond-instances=123
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_cond_instances;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_cond_instances;
|
||||
|
||||
show global variables like 'performance_schema_max_cond_instances';
|
||||
|
||||
show session variables like 'performance_schema_max_cond_instances';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_cond_instances';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_cond_instances';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_cond_instances=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_cond_instances=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-file-classes=123
|
47
mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic.test
Normal file
47
mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic.test
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_file_classes;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_file_classes;
|
||||
|
||||
show global variables like 'performance_schema_max_file_classes';
|
||||
|
||||
show session variables like 'performance_schema_max_file_classes';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_file_classes';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_file_classes';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_file_classes=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_file_classes=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-file-handles=123
|
47
mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic.test
Normal file
47
mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic.test
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_file_handles;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_file_handles;
|
||||
|
||||
show global variables like 'performance_schema_max_file_handles';
|
||||
|
||||
show session variables like 'performance_schema_max_file_handles';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_file_handles';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_file_handles';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_file_handles=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_file_handles=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-file-instances=123
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_file_instances;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_file_instances;
|
||||
|
||||
show global variables like 'performance_schema_max_file_instances';
|
||||
|
||||
show session variables like 'performance_schema_max_file_instances';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_file_instances';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_file_instances';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_file_instances=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_file_instances=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-mutex-classes=123
|
47
mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic.test
Normal file
47
mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic.test
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_mutex_classes;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_mutex_classes;
|
||||
|
||||
show global variables like 'performance_schema_max_mutex_classes';
|
||||
|
||||
show session variables like 'performance_schema_max_mutex_classes';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_mutex_classes';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_mutex_classes';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_mutex_classes=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_mutex_classes=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-mutex-instances=123
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_mutex_instances;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_mutex_instances;
|
||||
|
||||
show global variables like 'performance_schema_max_mutex_instances';
|
||||
|
||||
show session variables like 'performance_schema_max_mutex_instances';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_mutex_instances';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_mutex_instances';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_mutex_instances=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_mutex_instances=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-rwlock-classes=123
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_rwlock_classes;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_rwlock_classes;
|
||||
|
||||
show global variables like 'performance_schema_max_rwlock_classes';
|
||||
|
||||
show session variables like 'performance_schema_max_rwlock_classes';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_rwlock_classes';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_rwlock_classes';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_rwlock_classes=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_rwlock_classes=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-rwlock-instances=123
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_rwlock_instances;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_rwlock_instances;
|
||||
|
||||
show global variables like 'performance_schema_max_rwlock_instances';
|
||||
|
||||
show session variables like 'performance_schema_max_rwlock_instances';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_rwlock_instances';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_rwlock_instances';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_rwlock_instances=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_rwlock_instances=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-table-handles=123
|
47
mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic.test
Normal file
47
mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic.test
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_table_handles;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_table_handles;
|
||||
|
||||
show global variables like 'performance_schema_max_table_handles';
|
||||
|
||||
show session variables like 'performance_schema_max_table_handles';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_table_handles';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_table_handles';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_table_handles=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_table_handles=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-table-instances=123
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_table_instances;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_table_instances;
|
||||
|
||||
show global variables like 'performance_schema_max_table_instances';
|
||||
|
||||
show session variables like 'performance_schema_max_table_instances';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_table_instances';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_table_instances';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_table_instances=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_table_instances=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-thread-classes=123
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_thread_classes;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_thread_classes;
|
||||
|
||||
show global variables like 'performance_schema_max_thread_classes';
|
||||
|
||||
show session variables like 'performance_schema_max_thread_classes';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_thread_classes';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_thread_classes';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_thread_classes=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_thread_classes=1;
|
||||
|
@ -0,0 +1 @@
|
||||
--loose-enable-performance-schema --loose-performance-schema-max-thread-instances=123
|
@ -0,0 +1,47 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
#
|
||||
# Only global
|
||||
#
|
||||
|
||||
select @@global.performance_schema_max_thread_instances;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.performance_schema_max_thread_instances;
|
||||
|
||||
show global variables like 'performance_schema_max_thread_instances';
|
||||
|
||||
show session variables like 'performance_schema_max_thread_instances';
|
||||
|
||||
select * from information_schema.global_variables
|
||||
where variable_name='performance_schema_max_thread_instances';
|
||||
|
||||
select * from information_schema.session_variables
|
||||
where variable_name='performance_schema_max_thread_instances';
|
||||
|
||||
#
|
||||
# Read-only
|
||||
#
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set global performance_schema_max_thread_instances=1;
|
||||
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set session performance_schema_max_thread_instances=1;
|
||||
|
@ -108,6 +108,32 @@ DROP TABLE table_1;
|
||||
DROP TABLE table_2;
|
||||
DROP TABLE table_3;
|
||||
DROP TABLE table_4;
|
||||
|
||||
-- echo
|
||||
-- echo Bug #50087 Interval arithmetic for Event_queue_element is not portable.
|
||||
-- echo
|
||||
|
||||
CREATE TABLE t1(a int);
|
||||
|
||||
CREATE EVENT e1 ON SCHEDULE EVERY 1 MONTH
|
||||
STARTS NOW() - INTERVAL 1 MONTH
|
||||
ENDS NOW() + INTERVAL 2 MONTH
|
||||
ON COMPLETION PRESERVE
|
||||
DO
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
CREATE EVENT e2 ON SCHEDULE EVERY 1 MONTH
|
||||
STARTS NOW()
|
||||
ENDS NOW() + INTERVAL 11 MONTH
|
||||
ON COMPLETION PRESERVE
|
||||
DO
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP EVENT e1;
|
||||
DROP EVENT e2;
|
||||
|
||||
|
||||
DROP DATABASE events_test;
|
||||
SET GLOBAL event_scheduler=@event_scheduler;
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
--optimizer-switch=engine_condition_pushdown=off --engine-condition-pushdown=1
|
5
mysql-test/t/optimizer_switch_eng_cond_pushdown1.test
Normal file
5
mysql-test/t/optimizer_switch_eng_cond_pushdown1.test
Normal file
@ -0,0 +1,5 @@
|
||||
# check how --engine-condition-pushdown and --optimizer-switch
|
||||
# influence each other when used together (last wins).
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
@ -0,0 +1 @@
|
||||
--engine-condition-pushdown=1 --optimizer-switch=engine_condition_pushdown=off
|
5
mysql-test/t/optimizer_switch_eng_cond_pushdown2.test
Normal file
5
mysql-test/t/optimizer_switch_eng_cond_pushdown2.test
Normal file
@ -0,0 +1,5 @@
|
||||
# check how --engine-condition-pushdown and --optimizer-switch
|
||||
# influence each other when used together (last wins).
|
||||
select @@session.engine_condition_pushdown,
|
||||
@@global.engine_condition_pushdown,
|
||||
@@session.optimizer_switch, @@global.optimizer_switch;
|
@ -794,3 +794,50 @@ SHOW STATUS LIKE '%Handler_read_rnd_next';
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
--echo #
|
||||
--echo # BUG#48920: COUNT DISTINCT returns 1 for NULL values when in a subquery
|
||||
--echo # in the select list
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
CREATE TABLE t1 (
|
||||
i int(11) DEFAULT NULL,
|
||||
v varchar(1) DEFAULT NULL
|
||||
);
|
||||
|
||||
--echo
|
||||
INSERT INTO t1 VALUES (8,'v');
|
||||
INSERT INTO t1 VALUES (9,'r');
|
||||
INSERT INTO t1 VALUES (NULL,'y');
|
||||
|
||||
--echo
|
||||
CREATE TABLE t2 (
|
||||
i int(11) DEFAULT NULL,
|
||||
v varchar(1) DEFAULT NULL,
|
||||
KEY i_key (i)
|
||||
);
|
||||
|
||||
--echo
|
||||
INSERT INTO t2 VALUES (NULL,'r');
|
||||
INSERT INTO t2 VALUES (0,'c');
|
||||
INSERT INTO t2 VALUES (0,'o');
|
||||
INSERT INTO t2 VALUES (2,'v');
|
||||
INSERT INTO t2 VALUES (7,'c');
|
||||
|
||||
--echo
|
||||
SELECT i, v, (SELECT COUNT(DISTINCT i)
|
||||
FROM t1
|
||||
WHERE v = t2.v) as subsel
|
||||
FROM t2;
|
||||
|
||||
--echo
|
||||
EXPLAIN EXTENDED
|
||||
SELECT i, v, (SELECT COUNT(DISTINCT i)
|
||||
FROM t1
|
||||
WHERE v = t2.v) as subsel
|
||||
FROM t2;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo End of 5.6 tests
|
||||
|
@ -600,7 +600,7 @@ PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock,
|
||||
key_THR_LOCK_isam, key_THR_LOCK_lock, key_THR_LOCK_malloc,
|
||||
key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net,
|
||||
key_THR_LOCK_open, key_THR_LOCK_threads, key_THR_LOCK_time,
|
||||
key_TMPDIR_mutex;
|
||||
key_TMPDIR_mutex, key_THR_LOCK_myisam_mmap;
|
||||
|
||||
static PSI_mutex_info all_mysys_mutexes[]=
|
||||
{
|
||||
@ -630,7 +630,8 @@ static PSI_mutex_info all_mysys_mutexes[]=
|
||||
{ &key_THR_LOCK_open, "THR_LOCK_open", PSI_FLAG_GLOBAL},
|
||||
{ &key_THR_LOCK_threads, "THR_LOCK_threads", PSI_FLAG_GLOBAL},
|
||||
{ &key_THR_LOCK_time, "THR_LOCK_time", PSI_FLAG_GLOBAL},
|
||||
{ &key_TMPDIR_mutex, "TMPDIR_mutex", PSI_FLAG_GLOBAL}
|
||||
{ &key_TMPDIR_mutex, "TMPDIR_mutex", PSI_FLAG_GLOBAL},
|
||||
{ &key_THR_LOCK_myisam_mmap, "THR_LOCK_myisam_mmap", PSI_FLAG_GLOBAL}
|
||||
};
|
||||
|
||||
PSI_cond_key key_COND_alarm, key_IO_CACHE_SHARE_cond,
|
||||
|
@ -47,7 +47,7 @@ extern PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock,
|
||||
key_THR_LOCK_isam, key_THR_LOCK_lock, key_THR_LOCK_malloc,
|
||||
key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net,
|
||||
key_THR_LOCK_open, key_THR_LOCK_threads, key_THR_LOCK_time,
|
||||
key_TMPDIR_mutex;
|
||||
key_TMPDIR_mutex, key_THR_LOCK_myisam_mmap;
|
||||
|
||||
extern PSI_cond_key key_COND_alarm, key_IO_CACHE_SHARE_cond,
|
||||
key_IO_CACHE_SHARE_cond_writer, key_my_thread_var_suspend,
|
||||
|
@ -39,7 +39,7 @@ struct show_table_authors_st {
|
||||
struct show_table_authors_st show_table_authors[]= {
|
||||
{ "Brian (Krow) Aker", "Seattle, WA, USA",
|
||||
"Architecture, archive, federated, bunch of little stuff :)" },
|
||||
{ "Marc Alff", "Denver, CO, USA", "Signal, Resignal" },
|
||||
{ "Marc Alff", "Denver, CO, USA", "Signal, Resignal, Performance schema" },
|
||||
{ "Venu Anuganti", "", "Client/server protocol (4.1)" },
|
||||
{ "David Axmark", "Uppsala, Sweden",
|
||||
"Small stuff long time ago, Monty ripped it out!" },
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000-2005 MySQL AB
|
||||
/* Copyright (C) 2000-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -107,8 +107,8 @@ bool read_texts(const char *file_name, const char *language,
|
||||
funktpos=0;
|
||||
convert_dirname(lang_path, language, NullS);
|
||||
(void) my_load_path(lang_path, lang_path, lc_messages_dir);
|
||||
if ((file=my_open(fn_format(name,file_name,
|
||||
lang_path, "", 4),
|
||||
if ((file= mysql_file_open(key_file_ERRMSG,
|
||||
fn_format(name, file_name, lang_path, "", 4),
|
||||
O_RDONLY | O_SHARE | O_BINARY,
|
||||
MYF(0))) < 0)
|
||||
{
|
||||
@ -118,7 +118,8 @@ bool read_texts(const char *file_name, const char *language,
|
||||
|
||||
--language=/path/to/english/
|
||||
*/
|
||||
if ((file= my_open(fn_format(name, file_name, lc_messages_dir, "", 4),
|
||||
if ((file= mysql_file_open(key_file_ERRMSG,
|
||||
fn_format(name, file_name, lc_messages_dir, "", 4),
|
||||
O_RDONLY | O_SHARE | O_BINARY,
|
||||
MYF(0))) < 0)
|
||||
goto err;
|
||||
@ -127,7 +128,8 @@ bool read_texts(const char *file_name, const char *language,
|
||||
}
|
||||
|
||||
funktpos=1;
|
||||
if (my_read(file,(uchar*) head,32,MYF(MY_NABP))) goto err;
|
||||
if (mysql_file_read(file, (uchar*) head, 32, MYF(MY_NABP)))
|
||||
goto err;
|
||||
if (head[0] != (uchar) 254 || head[1] != (uchar) 254 ||
|
||||
head[2] != 2 || head[3] != 1)
|
||||
goto err; /* purecov: inspected */
|
||||
@ -143,7 +145,7 @@ Error message file '%s' had only %d error messages,\n\
|
||||
but it should contain at least %d error messages.\n\
|
||||
Check that the above file is the right version for this program!",
|
||||
name,count,error_messages);
|
||||
(void) my_close(file,MYF(MY_WME));
|
||||
(void) mysql_file_close(file, MYF(MY_WME));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
@ -156,21 +158,21 @@ Check that the above file is the right version for this program!",
|
||||
}
|
||||
buff= (uchar*) (*point + count);
|
||||
|
||||
if (my_read(file, buff, (size_t) count*2,MYF(MY_NABP)))
|
||||
if (mysql_file_read(file, buff, (size_t) count*2, MYF(MY_NABP)))
|
||||
goto err;
|
||||
for (i=0, pos= buff ; i< count ; i++)
|
||||
{
|
||||
(*point)[i]= (char*) buff+uint2korr(pos);
|
||||
pos+=2;
|
||||
}
|
||||
if (my_read(file, buff, length, MYF(MY_NABP)))
|
||||
if (mysql_file_read(file, buff, length, MYF(MY_NABP)))
|
||||
goto err;
|
||||
|
||||
for (i=1 ; i < textcount ; i++)
|
||||
{
|
||||
point[i]= *point +uint2korr(head+10+i+i);
|
||||
}
|
||||
(void) my_close(file,MYF(0));
|
||||
(void) mysql_file_close(file, MYF(0));
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
@ -187,7 +189,7 @@ err:
|
||||
}
|
||||
sql_print_error(errmsg, name);
|
||||
if (file != FERR)
|
||||
(void) my_close(file,MYF(MY_WME));
|
||||
(void) mysql_file_close(file, MYF(MY_WME));
|
||||
DBUG_RETURN(1);
|
||||
} /* read_texts */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2001-2003, 2005 MySQL AB
|
||||
/* Copyright (C) 2001-2003, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -43,8 +43,9 @@ load_des_key_file(const char *file_name)
|
||||
DBUG_ENTER("load_des_key_file");
|
||||
DBUG_PRINT("enter",("name: %s",file_name));
|
||||
|
||||
pthread_mutex_lock(&LOCK_des_key_file);
|
||||
if ((file=my_open(file_name,O_RDONLY | O_BINARY ,MYF(MY_WME))) < 0 ||
|
||||
mysql_mutex_lock(&LOCK_des_key_file);
|
||||
if ((file= mysql_file_open(key_file_des_key_file, file_name,
|
||||
O_RDONLY | O_BINARY, MYF(MY_WME))) < 0 ||
|
||||
init_io_cache(&io, file, IO_SIZE*2, READ_CACHE, 0, 0, MYF(MY_WME)))
|
||||
goto error;
|
||||
|
||||
@ -93,10 +94,10 @@ load_des_key_file(const char *file_name)
|
||||
error:
|
||||
if (file >= 0)
|
||||
{
|
||||
my_close(file,MYF(0));
|
||||
mysql_file_close(file, MYF(0));
|
||||
end_io_cache(&io);
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_des_key_file);
|
||||
mysql_mutex_unlock(&LOCK_des_key_file);
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
#endif /* HAVE_OPENSSL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2004 MySQL AB
|
||||
/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -57,7 +57,8 @@ int readfrm(const char *name, uchar **frmdata, size_t *len)
|
||||
*frmdata= NULL; // In case of errors
|
||||
*len= 0;
|
||||
error= 1;
|
||||
if ((file=my_open(fn_format(index_file,name,"",reg_ext,
|
||||
if ((file= mysql_file_open(key_file_frm,
|
||||
fn_format(index_file, name, "", reg_ext,
|
||||
MY_UNPACK_FILENAME|MY_APPEND_EXT),
|
||||
O_RDONLY | O_SHARE,
|
||||
MYF(0))) < 0)
|
||||
@ -65,7 +66,7 @@ int readfrm(const char *name, uchar **frmdata, size_t *len)
|
||||
|
||||
// Get length of file
|
||||
error= 2;
|
||||
if (my_fstat(file, &state, MYF(0)))
|
||||
if (mysql_file_fstat(file, &state, MYF(0)))
|
||||
goto err;
|
||||
read_len= state.st_size;
|
||||
|
||||
@ -82,7 +83,7 @@ int readfrm(const char *name, uchar **frmdata, size_t *len)
|
||||
|
||||
err:
|
||||
if (file > 0)
|
||||
(void) my_close(file,MYF(MY_WME));
|
||||
(void) mysql_file_close(file, MYF(MY_WME));
|
||||
|
||||
err_end: /* Here when no file */
|
||||
DBUG_RETURN (error);
|
||||
@ -112,13 +113,15 @@ int writefrm(const char *name, const uchar *frmdata, size_t len)
|
||||
DBUG_PRINT("enter",("name: '%s' len: %lu ",name, (ulong) len));
|
||||
|
||||
error= 0;
|
||||
if ((file=my_create(fn_format(index_file,name,"",reg_ext,
|
||||
if ((file= mysql_file_create(key_file_frm,
|
||||
fn_format(index_file, name, "", reg_ext,
|
||||
MY_UNPACK_FILENAME | MY_APPEND_EXT),
|
||||
CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0)
|
||||
CREATE_MODE, O_RDWR | O_TRUNC,
|
||||
MYF(MY_WME))) >= 0)
|
||||
{
|
||||
if (my_write(file, frmdata, len,MYF(MY_WME | MY_NABP)))
|
||||
if (mysql_file_write(file, frmdata, len, MYF(MY_WME | MY_NABP)))
|
||||
error= 2;
|
||||
(void) my_close(file,MYF(0));
|
||||
(void) mysql_file_close(file, MYF(0));
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
} /* writefrm */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -834,8 +834,9 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next,
|
||||
}
|
||||
else
|
||||
{
|
||||
long diff_months= (long) (local_now.year - local_start.year)*12 +
|
||||
(local_now.month - local_start.month);
|
||||
long diff_months= ((long) local_now.year - (long) local_start.year)*12 +
|
||||
((long) local_now.month - (long) local_start.month);
|
||||
|
||||
/*
|
||||
Unlike for seconds above, the formula below returns the interval
|
||||
that, when added to the local_start, will give the time in the
|
||||
@ -1402,8 +1403,7 @@ Event_job_data::execute(THD *thd, bool drop)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (check_access(thd, EVENT_ACL, dbname.str,
|
||||
0, 0, 0, is_schema_db(dbname.str)))
|
||||
if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0))
|
||||
{
|
||||
/*
|
||||
This aspect of behavior is defined in the worklog,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -94,16 +94,16 @@ Event_queue::Event_queue()
|
||||
mutex_queue_data_attempting_lock(FALSE),
|
||||
waiting_on_cond(FALSE)
|
||||
{
|
||||
pthread_mutex_init(&LOCK_event_queue, MY_MUTEX_INIT_FAST);
|
||||
pthread_cond_init(&COND_queue_state, NULL);
|
||||
mysql_mutex_init(key_LOCK_event_queue, &LOCK_event_queue, MY_MUTEX_INIT_FAST);
|
||||
mysql_cond_init(key_COND_queue_state, &COND_queue_state, NULL);
|
||||
}
|
||||
|
||||
|
||||
Event_queue::~Event_queue()
|
||||
{
|
||||
deinit_queue();
|
||||
pthread_mutex_destroy(&LOCK_event_queue);
|
||||
pthread_cond_destroy(&COND_queue_state);
|
||||
mysql_mutex_destroy(&LOCK_event_queue);
|
||||
mysql_cond_destroy(&COND_queue_state);
|
||||
}
|
||||
|
||||
|
||||
@ -210,7 +210,7 @@ Event_queue::create_event(THD *thd, Event_queue_element *new_element,
|
||||
LOCK_QUEUE_DATA();
|
||||
*created= (queue_insert_safe(&queue, (uchar *) new_element) == FALSE);
|
||||
dbug_dump_queue(thd->query_start());
|
||||
pthread_cond_broadcast(&COND_queue_state);
|
||||
mysql_cond_broadcast(&COND_queue_state);
|
||||
UNLOCK_QUEUE_DATA();
|
||||
|
||||
DBUG_RETURN(!*created);
|
||||
@ -258,7 +258,7 @@ Event_queue::update_event(THD *thd, LEX_STRING dbname, LEX_STRING name,
|
||||
{
|
||||
DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element));
|
||||
queue_insert_safe(&queue, (uchar *) new_element);
|
||||
pthread_cond_broadcast(&COND_queue_state);
|
||||
mysql_cond_broadcast(&COND_queue_state);
|
||||
}
|
||||
|
||||
dbug_dump_queue(thd->query_start());
|
||||
@ -669,7 +669,7 @@ Event_queue::lock_data(const char *func, uint line)
|
||||
mutex_last_attempted_lock_in_func= func;
|
||||
mutex_last_attempted_lock_at_line= line;
|
||||
mutex_queue_data_attempting_lock= TRUE;
|
||||
pthread_mutex_lock(&LOCK_event_queue);
|
||||
mysql_mutex_lock(&LOCK_event_queue);
|
||||
mutex_last_attempted_lock_in_func= "";
|
||||
mutex_last_attempted_lock_at_line= 0;
|
||||
mutex_queue_data_attempting_lock= FALSE;
|
||||
@ -700,7 +700,7 @@ Event_queue::unlock_data(const char *func, uint line)
|
||||
mutex_last_unlocked_at_line= line;
|
||||
mutex_queue_data_locked= FALSE;
|
||||
mutex_last_unlocked_in_func= func;
|
||||
pthread_mutex_unlock(&LOCK_event_queue);
|
||||
mysql_mutex_unlock(&LOCK_event_queue);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@ -731,9 +731,9 @@ Event_queue::cond_wait(THD *thd, struct timespec *abstime, const char* msg,
|
||||
|
||||
DBUG_PRINT("info", ("pthread_cond_%swait", abstime? "timed":""));
|
||||
if (!abstime)
|
||||
pthread_cond_wait(&COND_queue_state, &LOCK_event_queue);
|
||||
mysql_cond_wait(&COND_queue_state, &LOCK_event_queue);
|
||||
else
|
||||
pthread_cond_timedwait(&COND_queue_state, &LOCK_event_queue, abstime);
|
||||
mysql_cond_timedwait(&COND_queue_state, &LOCK_event_queue, abstime);
|
||||
|
||||
mutex_last_locked_in_func= func;
|
||||
mutex_last_locked_at_line= line;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifndef _EVENT_QUEUE_H_
|
||||
#define _EVENT_QUEUE_H_
|
||||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -25,6 +25,11 @@
|
||||
Queue of events awaiting execution.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
extern PSI_mutex_key key_LOCK_event_queue;
|
||||
extern PSI_cond_key key_COND_queue_state;
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
class Event_basic;
|
||||
class Event_queue_element;
|
||||
class Event_queue_element_for_exec;
|
||||
@ -101,8 +106,8 @@ private:
|
||||
dbug_dump_queue(time_t now);
|
||||
|
||||
/* LOCK_event_queue is the mutex which protects the access to the queue. */
|
||||
pthread_mutex_t LOCK_event_queue;
|
||||
pthread_cond_t COND_queue_state;
|
||||
mysql_mutex_t LOCK_event_queue;
|
||||
mysql_cond_t COND_queue_state;
|
||||
|
||||
/* The sorted queue with the Event_queue_element objects */
|
||||
QUEUE queue;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -163,7 +163,7 @@ deinit_event_thread(THD *thd)
|
||||
|
||||
|
||||
/*
|
||||
Performs pre- pthread_create() initialisation of THD. Do this
|
||||
Performs pre- mysql_thread_create() initialisation of THD. Do this
|
||||
in the thread that will pass THD to the child thread. In the
|
||||
child thread call post_init_event_thread().
|
||||
|
||||
@ -227,6 +227,9 @@ event_scheduler_thread(void *arg)
|
||||
bool res;
|
||||
|
||||
thd->thread_stack= (char *)&thd; // remember where our stack is
|
||||
|
||||
mysql_thread_set_psi_id(thd->thread_id);
|
||||
|
||||
res= post_init_event_thread(thd);
|
||||
|
||||
DBUG_ENTER("event_scheduler_thread");
|
||||
@ -259,6 +262,8 @@ event_worker_thread(void *arg)
|
||||
|
||||
thd= event->thd;
|
||||
|
||||
mysql_thread_set_psi_id(thd->thread_id);
|
||||
|
||||
Event_worker_thread worker_thread;
|
||||
worker_thread.run(thd, event);
|
||||
|
||||
@ -335,16 +340,17 @@ Event_scheduler::Event_scheduler(Event_queue *queue_arg)
|
||||
waiting_on_cond(FALSE),
|
||||
started_events(0)
|
||||
{
|
||||
pthread_mutex_init(&LOCK_scheduler_state, MY_MUTEX_INIT_FAST);
|
||||
pthread_cond_init(&COND_state, NULL);
|
||||
mysql_mutex_init(key_event_scheduler_LOCK_scheduler_state,
|
||||
&LOCK_scheduler_state, MY_MUTEX_INIT_FAST);
|
||||
mysql_cond_init(key_event_scheduler_COND_state, &COND_state, NULL);
|
||||
}
|
||||
|
||||
|
||||
Event_scheduler::~Event_scheduler()
|
||||
{
|
||||
stop(); /* does nothing if not running */
|
||||
pthread_mutex_destroy(&LOCK_scheduler_state);
|
||||
pthread_cond_destroy(&COND_state);
|
||||
mysql_mutex_destroy(&LOCK_scheduler_state);
|
||||
mysql_cond_destroy(&COND_state);
|
||||
}
|
||||
|
||||
|
||||
@ -403,7 +409,8 @@ Event_scheduler::start()
|
||||
DBUG_PRINT("info", ("Setting state go RUNNING"));
|
||||
state= RUNNING;
|
||||
DBUG_PRINT("info", ("Forking new thread for scheduler. THD: 0x%lx", (long) new_thd));
|
||||
if (pthread_create(&th, &connection_attrib, event_scheduler_thread,
|
||||
if (mysql_thread_create(key_thread_event_scheduler,
|
||||
&th, &connection_attrib, event_scheduler_thread,
|
||||
(void*)scheduler_param_value))
|
||||
{
|
||||
DBUG_PRINT("error", ("cannot create a new thread"));
|
||||
@ -487,7 +494,7 @@ Event_scheduler::run(THD *thd)
|
||||
scheduler_thd= NULL;
|
||||
state= INITIALIZED;
|
||||
DBUG_PRINT("info", ("Signalling back to the stopper COND_state"));
|
||||
pthread_cond_signal(&COND_state);
|
||||
mysql_cond_signal(&COND_state);
|
||||
UNLOCK_DATA();
|
||||
|
||||
DBUG_RETURN(res);
|
||||
@ -531,7 +538,8 @@ Event_scheduler::execute_top(Event_queue_element_for_exec *event_name)
|
||||
reasonable level.
|
||||
*/
|
||||
/* Major failure */
|
||||
if ((res= pthread_create(&th, &connection_attrib, event_worker_thread,
|
||||
if ((res= mysql_thread_create(key_thread_event_worker,
|
||||
&th, &connection_attrib, event_worker_thread,
|
||||
event_name)))
|
||||
goto error;
|
||||
|
||||
@ -632,13 +640,13 @@ Event_scheduler::stop()
|
||||
DBUG_PRINT("info", ("Scheduler thread has id %lu",
|
||||
scheduler_thd->thread_id));
|
||||
/* Lock from delete */
|
||||
pthread_mutex_lock(&scheduler_thd->LOCK_thd_data);
|
||||
mysql_mutex_lock(&scheduler_thd->LOCK_thd_data);
|
||||
/* This will wake up the thread if it waits on Queue's conditional */
|
||||
sql_print_information("Event Scheduler: Killing the scheduler thread, "
|
||||
"thread id %lu",
|
||||
scheduler_thd->thread_id);
|
||||
scheduler_thd->awake(THD::KILL_CONNECTION);
|
||||
pthread_mutex_unlock(&scheduler_thd->LOCK_thd_data);
|
||||
mysql_mutex_unlock(&scheduler_thd->LOCK_thd_data);
|
||||
|
||||
/* thd could be 0x0, when shutting down */
|
||||
sql_print_information("Event Scheduler: "
|
||||
@ -693,7 +701,7 @@ Event_scheduler::lock_data(const char *func, uint line)
|
||||
{
|
||||
DBUG_ENTER("Event_scheduler::lock_data");
|
||||
DBUG_PRINT("enter", ("func=%s line=%u", func, line));
|
||||
pthread_mutex_lock(&LOCK_scheduler_state);
|
||||
mysql_mutex_lock(&LOCK_scheduler_state);
|
||||
mutex_last_locked_in_func= func;
|
||||
mutex_last_locked_at_line= line;
|
||||
mutex_scheduler_data_locked= TRUE;
|
||||
@ -719,7 +727,7 @@ Event_scheduler::unlock_data(const char *func, uint line)
|
||||
mutex_last_unlocked_at_line= line;
|
||||
mutex_scheduler_data_locked= FALSE;
|
||||
mutex_last_unlocked_in_func= func;
|
||||
pthread_mutex_unlock(&LOCK_scheduler_state);
|
||||
mysql_mutex_unlock(&LOCK_scheduler_state);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@ -750,9 +758,9 @@ Event_scheduler::cond_wait(THD *thd, struct timespec *abstime, const char* msg,
|
||||
|
||||
DBUG_PRINT("info", ("pthread_cond_%swait", abstime? "timed":""));
|
||||
if (!abstime)
|
||||
pthread_cond_wait(&COND_state, &LOCK_scheduler_state);
|
||||
mysql_cond_wait(&COND_state, &LOCK_scheduler_state);
|
||||
else
|
||||
pthread_cond_timedwait(&COND_state, &LOCK_scheduler_state, abstime);
|
||||
mysql_cond_timedwait(&COND_state, &LOCK_scheduler_state, abstime);
|
||||
if (thd)
|
||||
{
|
||||
/*
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifndef _EVENT_SCHEDULER_H_
|
||||
#define _EVENT_SCHEDULER_H_
|
||||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -115,7 +115,7 @@ private:
|
||||
cond_wait(THD *thd, struct timespec *abstime, const char* msg,
|
||||
const char *func, uint line);
|
||||
|
||||
pthread_mutex_t LOCK_scheduler_state;
|
||||
mysql_mutex_t LOCK_scheduler_state;
|
||||
|
||||
enum enum_state
|
||||
{
|
||||
@ -129,7 +129,7 @@ private:
|
||||
|
||||
THD *scheduler_thd;
|
||||
|
||||
pthread_cond_t COND_state;
|
||||
mysql_cond_t COND_state;
|
||||
|
||||
Event_queue *queue;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -68,7 +68,7 @@ Event_queue *Events::event_queue;
|
||||
Event_scheduler *Events::scheduler;
|
||||
Event_db_repository *Events::db_repository;
|
||||
uint Events::opt_event_scheduler= Events::EVENTS_OFF;
|
||||
pthread_mutex_t Events::LOCK_event_metadata;
|
||||
mysql_mutex_t Events::LOCK_event_metadata;
|
||||
bool Events::check_system_tables_error= FALSE;
|
||||
|
||||
|
||||
@ -319,8 +319,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
|
||||
/* At create, one of them must be set */
|
||||
DBUG_ASSERT(parse_data->expression || parse_data->execute_at);
|
||||
|
||||
if (check_access(thd, EVENT_ACL, parse_data->dbname.str, 0, 0, 0,
|
||||
is_schema_db(parse_data->dbname.str)))
|
||||
if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
if (check_db_dir_existence(parse_data->dbname.str))
|
||||
@ -338,7 +337,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
|
||||
if (thd->is_current_stmt_binlog_format_row())
|
||||
thd->clear_current_stmt_binlog_format_row();
|
||||
|
||||
pthread_mutex_lock(&LOCK_event_metadata);
|
||||
mysql_mutex_lock(&LOCK_event_metadata);
|
||||
|
||||
/* On error conditions my_error() is called so no need to handle here */
|
||||
if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists)))
|
||||
@ -383,7 +382,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
|
||||
ret= write_bin_log(thd, TRUE, log_query.c_ptr(), log_query.length());
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_event_metadata);
|
||||
mysql_mutex_unlock(&LOCK_event_metadata);
|
||||
|
||||
DBUG_RETURN(ret);
|
||||
}
|
||||
@ -430,8 +429,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
|
||||
if (parse_data->check_parse_data(thd) || parse_data->do_not_create)
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
if (check_access(thd, EVENT_ACL, parse_data->dbname.str, 0, 0, 0,
|
||||
is_schema_db(parse_data->dbname.str)))
|
||||
if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
if (new_dbname) /* It's a rename */
|
||||
@ -452,8 +450,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
|
||||
to tell the user that a database doesn't exist if they can not
|
||||
access it.
|
||||
*/
|
||||
if (check_access(thd, EVENT_ACL, new_dbname->str, 0, 0, 0,
|
||||
is_schema_db(new_dbname->str)))
|
||||
if (check_access(thd, EVENT_ACL, new_dbname->str, NULL, NULL, 0, 0))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
/* Check that the target database exists */
|
||||
@ -471,7 +468,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
|
||||
if (thd->is_current_stmt_binlog_format_row())
|
||||
thd->clear_current_stmt_binlog_format_row();
|
||||
|
||||
pthread_mutex_lock(&LOCK_event_metadata);
|
||||
mysql_mutex_lock(&LOCK_event_metadata);
|
||||
|
||||
/* On error conditions my_error() is called so no need to handle here */
|
||||
if (!(ret= db_repository->update_event(thd, parse_data,
|
||||
@ -504,7 +501,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
|
||||
ret= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_event_metadata);
|
||||
mysql_mutex_unlock(&LOCK_event_metadata);
|
||||
|
||||
DBUG_RETURN(ret);
|
||||
}
|
||||
@ -557,8 +554,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
|
||||
if (check_if_system_tables_error())
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
if (check_access(thd, EVENT_ACL, dbname.str, 0, 0, 0,
|
||||
is_schema_db(dbname.str)))
|
||||
if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
/*
|
||||
@ -568,7 +564,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
|
||||
if (thd->is_current_stmt_binlog_format_row())
|
||||
thd->clear_current_stmt_binlog_format_row();
|
||||
|
||||
pthread_mutex_lock(&LOCK_event_metadata);
|
||||
mysql_mutex_lock(&LOCK_event_metadata);
|
||||
/* On error conditions my_error() is called so no need to handle here */
|
||||
if (!(ret= db_repository->drop_event(thd, dbname, name, if_exists)))
|
||||
{
|
||||
@ -578,7 +574,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
|
||||
DBUG_ASSERT(thd->query() && thd->query_length());
|
||||
ret= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_event_metadata);
|
||||
mysql_mutex_unlock(&LOCK_event_metadata);
|
||||
DBUG_RETURN(ret);
|
||||
}
|
||||
|
||||
@ -607,11 +603,11 @@ Events::drop_schema_events(THD *thd, char *db)
|
||||
are damaged, as intended.
|
||||
*/
|
||||
|
||||
pthread_mutex_lock(&LOCK_event_metadata);
|
||||
mysql_mutex_lock(&LOCK_event_metadata);
|
||||
if (event_queue)
|
||||
event_queue->drop_schema_events(thd, db_lex);
|
||||
db_repository->drop_schema_events(thd, db_lex);
|
||||
pthread_mutex_unlock(&LOCK_event_metadata);
|
||||
mysql_mutex_unlock(&LOCK_event_metadata);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -714,8 +710,7 @@ Events::show_create_event(THD *thd, LEX_STRING dbname, LEX_STRING name)
|
||||
if (check_if_system_tables_error())
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
if (check_access(thd, EVENT_ACL, dbname.str, 0, 0, 0,
|
||||
is_schema_db(dbname.str)))
|
||||
if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
/*
|
||||
@ -773,8 +768,9 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
|
||||
if (thd->lex->sql_command == SQLCOM_SHOW_EVENTS)
|
||||
{
|
||||
DBUG_ASSERT(thd->lex->select_lex.db);
|
||||
if (!is_schema_db(thd->lex->select_lex.db) && // There is no events in I_S
|
||||
check_access(thd, EVENT_ACL, thd->lex->select_lex.db, 0, 0, 0, 0))
|
||||
if (!is_infoschema_db(thd->lex->select_lex.db) && // There is no events in I_S
|
||||
check_access(thd, EVENT_ACL, thd->lex->select_lex.db,
|
||||
NULL, NULL, 0, 0))
|
||||
DBUG_RETURN(1);
|
||||
db= thd->lex->select_lex.db;
|
||||
}
|
||||
@ -934,6 +930,51 @@ Events::deinit()
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
PSI_mutex_key key_LOCK_event_metadata, key_LOCK_event_queue,
|
||||
key_event_scheduler_LOCK_scheduler_state;
|
||||
|
||||
static PSI_mutex_info all_events_mutexes[]=
|
||||
{
|
||||
{ &key_LOCK_event_metadata, "LOCK_event_metadata", PSI_FLAG_GLOBAL},
|
||||
{ &key_LOCK_event_queue, "LOCK_event_queue", PSI_FLAG_GLOBAL},
|
||||
{ &key_event_scheduler_LOCK_scheduler_state, "Event_scheduler::LOCK_scheduler_state", PSI_FLAG_GLOBAL}
|
||||
};
|
||||
|
||||
PSI_cond_key key_event_scheduler_COND_state, key_COND_queue_state;
|
||||
|
||||
static PSI_cond_info all_events_conds[]=
|
||||
{
|
||||
{ &key_event_scheduler_COND_state, "Event_scheduler::COND_state", PSI_FLAG_GLOBAL},
|
||||
{ &key_COND_queue_state, "COND_queue_state", PSI_FLAG_GLOBAL},
|
||||
};
|
||||
|
||||
PSI_thread_key key_thread_event_scheduler, key_thread_event_worker;
|
||||
|
||||
static PSI_thread_info all_events_threads[]=
|
||||
{
|
||||
{ &key_thread_event_scheduler, "event_scheduler", PSI_FLAG_GLOBAL},
|
||||
{ &key_thread_event_worker, "event_worker", 0}
|
||||
};
|
||||
|
||||
static void init_events_psi_keys(void)
|
||||
{
|
||||
const char* category= "sql";
|
||||
int count;
|
||||
|
||||
if (PSI_server == NULL)
|
||||
return;
|
||||
|
||||
count= array_elements(all_events_mutexes);
|
||||
PSI_server->register_mutex(category, all_events_mutexes, count);
|
||||
|
||||
count= array_elements(all_events_conds);
|
||||
PSI_server->register_cond(category, all_events_conds, count);
|
||||
|
||||
count= array_elements(all_events_threads);
|
||||
PSI_server->register_thread(category, all_events_threads, count);
|
||||
}
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
/**
|
||||
Inits Events mutexes
|
||||
@ -946,7 +987,12 @@ Events::deinit()
|
||||
void
|
||||
Events::init_mutexes()
|
||||
{
|
||||
pthread_mutex_init(&LOCK_event_metadata, MY_MUTEX_INIT_FAST);
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
init_events_psi_keys();
|
||||
#endif
|
||||
|
||||
mysql_mutex_init(key_LOCK_event_metadata,
|
||||
&LOCK_event_metadata, MY_MUTEX_INIT_FAST);
|
||||
}
|
||||
|
||||
|
||||
@ -960,7 +1006,7 @@ Events::init_mutexes()
|
||||
void
|
||||
Events::destroy_mutexes()
|
||||
{
|
||||
pthread_mutex_destroy(&LOCK_event_metadata);
|
||||
mysql_mutex_destroy(&LOCK_event_metadata);
|
||||
}
|
||||
|
||||
|
||||
@ -982,7 +1028,7 @@ Events::dump_internal_status()
|
||||
puts("LLA = Last Locked At LUA = Last Unlocked At");
|
||||
puts("WOC = Waiting On Condition DL = Data Locked");
|
||||
|
||||
pthread_mutex_lock(&LOCK_event_metadata);
|
||||
mysql_mutex_lock(&LOCK_event_metadata);
|
||||
if (opt_event_scheduler == EVENTS_DISABLED)
|
||||
puts("The Event Scheduler is disabled");
|
||||
else
|
||||
@ -991,7 +1037,7 @@ Events::dump_internal_status()
|
||||
event_queue->dump_internal_status();
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&LOCK_event_metadata);
|
||||
mysql_mutex_unlock(&LOCK_event_metadata);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
11
sql/events.h
11
sql/events.h
@ -1,6 +1,6 @@
|
||||
#ifndef _EVENT_H_
|
||||
#define _EVENT_H_
|
||||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -25,6 +25,13 @@
|
||||
A public interface of Events_Scheduler module.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
extern PSI_mutex_key key_LOCK_event_metadata,
|
||||
key_event_scheduler_LOCK_scheduler_state;
|
||||
extern PSI_cond_key key_event_scheduler_COND_state;
|
||||
extern PSI_thread_key key_thread_event_scheduler, key_thread_event_worker;
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
class Event_parse_data;
|
||||
class Event_db_repository;
|
||||
class Event_queue;
|
||||
@ -77,7 +84,7 @@ public:
|
||||
*/
|
||||
enum enum_opt_event_scheduler { EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED };
|
||||
static uint opt_event_scheduler;
|
||||
static pthread_mutex_t LOCK_event_metadata;
|
||||
static mysql_mutex_t LOCK_event_metadata;
|
||||
static bool check_if_system_tables_error();
|
||||
static bool start();
|
||||
static bool stop();
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -1119,8 +1119,9 @@ uint read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
|
||||
|
||||
if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count)))
|
||||
{
|
||||
if (my_pread(fromfile->file,(uchar*) buffpek->base,
|
||||
(length= rec_length*count),buffpek->file_pos,MYF_RW))
|
||||
if (mysql_file_pread(fromfile->file, (uchar*) buffpek->base,
|
||||
(length= rec_length*count),
|
||||
buffpek->file_pos, MYF_RW))
|
||||
return((uint) -1); /* purecov: inspected */
|
||||
buffpek->key=buffpek->base;
|
||||
buffpek->file_pos+= length; /* New filepos */
|
||||
|
@ -264,7 +264,7 @@ Ndb_cluster_connection* g_ndb_cluster_connection= NULL;
|
||||
uchar g_node_id_map[max_ndb_nodes];
|
||||
|
||||
/// Handler synchronization
|
||||
pthread_mutex_t ndbcluster_mutex;
|
||||
mysql_mutex_t ndbcluster_mutex;
|
||||
|
||||
/// Table lock handling
|
||||
HASH ndbcluster_open_tables;
|
||||
@ -281,9 +281,9 @@ static int ndb_get_table_statistics(ha_ndbcluster*, bool, Ndb*, const NDBTAB *,
|
||||
// Util thread variables
|
||||
pthread_t ndb_util_thread;
|
||||
int ndb_util_thread_running= 0;
|
||||
pthread_mutex_t LOCK_ndb_util_thread;
|
||||
pthread_cond_t COND_ndb_util_thread;
|
||||
pthread_cond_t COND_ndb_util_ready;
|
||||
mysql_mutex_t LOCK_ndb_util_thread;
|
||||
mysql_cond_t COND_ndb_util_thread;
|
||||
mysql_cond_t COND_ndb_util_ready;
|
||||
pthread_handler_t ndb_util_thread_func(void *arg);
|
||||
|
||||
/**
|
||||
@ -4778,11 +4778,11 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
|
||||
thd_ndb->changed_tables.push_back(m_share, &thd->transaction.mem_root);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&m_share->mutex);
|
||||
mysql_mutex_lock(&m_share->mutex);
|
||||
DBUG_PRINT("info", ("Invalidating commit_count"));
|
||||
m_share->commit_count= 0;
|
||||
m_share->commit_count_lock++;
|
||||
pthread_mutex_unlock(&m_share->mutex);
|
||||
mysql_mutex_unlock(&m_share->mutex);
|
||||
}
|
||||
|
||||
if (!--thd_ndb->lock_count)
|
||||
@ -4943,12 +4943,12 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all)
|
||||
List_iterator_fast<NDB_SHARE> it(thd_ndb->changed_tables);
|
||||
while ((share= it++))
|
||||
{
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
DBUG_PRINT("info", ("Invalidate commit_count for %s, share->commit_count: %lu",
|
||||
share->table_name, (ulong) share->commit_count));
|
||||
share->commit_count= 0;
|
||||
share->commit_count_lock++;
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
}
|
||||
thd_ndb->changed_tables.empty();
|
||||
|
||||
@ -5622,7 +5622,7 @@ int ha_ndbcluster::create(const char *name,
|
||||
if (!my_errno)
|
||||
{
|
||||
NDB_SHARE *share= 0;
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
/*
|
||||
First make sure we get a "fresh" share here, not an old trailing one...
|
||||
*/
|
||||
@ -5647,7 +5647,7 @@ int ha_ndbcluster::create(const char *name,
|
||||
DBUG_PRINT("NDB_SHARE", ("%s binlog create use_count: %u",
|
||||
share->key, share->use_count));
|
||||
}
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
|
||||
while (!IS_TMP_PREFIX(m_tabname))
|
||||
{
|
||||
@ -6286,7 +6286,7 @@ retry_temporary_error1:
|
||||
/* the drop table failed for some reason, drop the share anyways */
|
||||
if (share)
|
||||
{
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
if (share->state != NSS_DROPPED)
|
||||
{
|
||||
/*
|
||||
@ -6302,7 +6302,7 @@ retry_temporary_error1:
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u",
|
||||
share->key, share->use_count));
|
||||
free_share(&share, TRUE);
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
}
|
||||
#endif
|
||||
DBUG_RETURN(res);
|
||||
@ -6343,7 +6343,7 @@ retry_temporary_error1:
|
||||
|
||||
if (share)
|
||||
{
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
if (share->state != NSS_DROPPED)
|
||||
{
|
||||
/*
|
||||
@ -6359,7 +6359,7 @@ retry_temporary_error1:
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u",
|
||||
share->key, share->use_count));
|
||||
free_share(&share, TRUE);
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
}
|
||||
#endif
|
||||
DBUG_RETURN(0);
|
||||
@ -7451,7 +7451,7 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
|
||||
/* Call back after cluster connect */
|
||||
static int connect_callback()
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
update_status_variables(g_ndb_cluster_connection);
|
||||
|
||||
uint node_id, i= 0;
|
||||
@ -7460,13 +7460,92 @@ static int connect_callback()
|
||||
while ((node_id= g_ndb_cluster_connection->get_next_node(node_iter)))
|
||||
g_node_id_map[node_id]= i++;
|
||||
|
||||
pthread_cond_signal(&COND_ndb_util_thread);
|
||||
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
mysql_cond_signal(&COND_ndb_util_thread);
|
||||
mysql_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern int ndb_dictionary_is_mysqld;
|
||||
extern pthread_mutex_t LOCK_plugin;
|
||||
extern mysql_mutex_t LOCK_plugin;
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
PSI_mutex_key key_injector_mutex, key_ndb_schema_share_mutex,
|
||||
key_ndb_schema_object_mutex;
|
||||
#endif /* HAVE_NDB_BINLOG */
|
||||
|
||||
PSI_mutex_key key_NDB_SHARE_mutex, key_ndbcluster_mutex,
|
||||
key_LOCK_ndb_util_thread;
|
||||
|
||||
static PSI_mutex_info all_ndbcluster_mutexes[]=
|
||||
{
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
{& key_injector_mutex, "injector_mutex", PSI_FLAG_GLOBAL},
|
||||
{& key_ndb_schema_share_mutex, "ndb_schema_share_mutex", PSI_FLAG_GLOBAL},
|
||||
{& key_ndb_schema_object_mutex, "ndb_schema_object_mutex", PSI_FLAG_GLOBAL},
|
||||
#endif /* HAVE_NDB_BINLOG */
|
||||
{& key_NDB_SHARE_mutex, "NDB_SHARE::mutex", PSI_FLAG_GLOBAL},
|
||||
{& key_ndbcluster_mutex, "ndbcluster_mutex", PSI_FLAG_GLOBAL},
|
||||
{& key_LOCK_ndb_util_thread, "LOCK_ndb_util_thread", PSI_FLAG_GLOBAL}
|
||||
};
|
||||
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
PSI_cond_key key_injector_cond;
|
||||
#endif /* HAVE_NDB_BINLOG */
|
||||
|
||||
PSI_cond_key key_COND_ndb_util_thread, key_COND_ndb_util_ready;
|
||||
|
||||
static PSI_cond_info all_ndbcluster_conds[]=
|
||||
{
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
{& key_injector_cond, "injector_cond", PSI_FLAG_GLOBAL},
|
||||
#endif /* HAVE_NDB_BINLOG */
|
||||
{& key_COND_ndb_util_thread, "COND_ndb_util_thread", PSI_FLAG_GLOBAL},
|
||||
{& key_COND_ndb_util_ready, "COND_ndb_util_ready", PSI_FLAG_GLOBAL}
|
||||
};
|
||||
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
PSI_thread_key key_thread_ndb_binlog;
|
||||
#endif /* HAVE_NDB_BINLOG */
|
||||
PSI_thread_key key_thread_ndb_util;
|
||||
|
||||
static PSI_thread_info all_ndbcluster_threads[]=
|
||||
{
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
{ &key_thread_ndb_binlog, "ndb_binlog", PSI_FLAG_GLOBAL},
|
||||
#endif /* HAVE_NDB_BINLOG */
|
||||
{ &key_thread_ndb_util, "ndb_util", PSI_FLAG_GLOBAL}
|
||||
};
|
||||
|
||||
PSI_file_key key_file_ndb;
|
||||
|
||||
static PSI_file_info all_ndbcluster_files[]=
|
||||
{
|
||||
{ &key_file_ndb, "ndb", 0}
|
||||
};
|
||||
|
||||
void init_ndbcluster_psi_keys()
|
||||
{
|
||||
const char* category= "ndbcluster";
|
||||
int count;
|
||||
|
||||
if (PSI_server == NULL)
|
||||
return;
|
||||
|
||||
count= array_elements(all_ndbcluster_mutexes);
|
||||
PSI_server->register_mutex(category, all_ndbcluster_mutexes, count);
|
||||
|
||||
count= array_elements(all_ndbcluster_conds);
|
||||
PSI_server->register_cond(category, all_ndbcluster_conds, count);
|
||||
|
||||
count= array_elements(all_ndbcluster_threads);
|
||||
PSI_server->register_thread(category, all_ndbcluster_threads, count);
|
||||
|
||||
count= array_elements(all_ndbcluster_files);
|
||||
PSI_server->register_file(category, all_ndbcluster_files, count);
|
||||
}
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
static int ndbcluster_init(void *p)
|
||||
{
|
||||
@ -7476,17 +7555,23 @@ static int ndbcluster_init(void *p)
|
||||
if (ndbcluster_inited)
|
||||
DBUG_RETURN(FALSE);
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
init_ndbcluster_psi_keys();
|
||||
#endif
|
||||
|
||||
/*
|
||||
Below we create new THD's. They'll need LOCK_plugin, but it's taken now by
|
||||
plugin initialization code. Release it to avoid deadlocks. It's safe, as
|
||||
there're no threads that may concurrently access plugin control structures.
|
||||
*/
|
||||
pthread_mutex_unlock(&LOCK_plugin);
|
||||
mysql_mutex_unlock(&LOCK_plugin);
|
||||
|
||||
pthread_mutex_init(&ndbcluster_mutex,MY_MUTEX_INIT_FAST);
|
||||
pthread_mutex_init(&LOCK_ndb_util_thread, MY_MUTEX_INIT_FAST);
|
||||
pthread_cond_init(&COND_ndb_util_thread, NULL);
|
||||
pthread_cond_init(&COND_ndb_util_ready, NULL);
|
||||
mysql_mutex_init(key_ndbcluster_mutex,
|
||||
&ndbcluster_mutex, MY_MUTEX_INIT_FAST);
|
||||
mysql_mutex_init(key_LOCK_ndb_util_thread,
|
||||
&LOCK_ndb_util_thread, MY_MUTEX_INIT_FAST);
|
||||
mysql_cond_init(key_COND_ndb_util_thread, &COND_ndb_util_thread, NULL);
|
||||
mysql_cond_init(key_COND_ndb_util_ready, &COND_ndb_util_ready, NULL);
|
||||
ndb_util_thread_running= -1;
|
||||
ndbcluster_terminating= 0;
|
||||
ndb_dictionary_is_mysqld= 1;
|
||||
@ -7608,35 +7693,36 @@ static int ndbcluster_init(void *p)
|
||||
|
||||
// Create utility thread
|
||||
pthread_t tmp;
|
||||
if (pthread_create(&tmp, &connection_attrib, ndb_util_thread_func, 0))
|
||||
if (mysql_thread_create(key_thread_ndb_util,
|
||||
&tmp, &connection_attrib, ndb_util_thread_func, 0))
|
||||
{
|
||||
DBUG_PRINT("error", ("Could not create ndb utility thread"));
|
||||
my_hash_free(&ndbcluster_open_tables);
|
||||
pthread_mutex_destroy(&ndbcluster_mutex);
|
||||
pthread_mutex_destroy(&LOCK_ndb_util_thread);
|
||||
pthread_cond_destroy(&COND_ndb_util_thread);
|
||||
pthread_cond_destroy(&COND_ndb_util_ready);
|
||||
mysql_mutex_destroy(&ndbcluster_mutex);
|
||||
mysql_mutex_destroy(&LOCK_ndb_util_thread);
|
||||
mysql_cond_destroy(&COND_ndb_util_thread);
|
||||
mysql_cond_destroy(&COND_ndb_util_ready);
|
||||
goto ndbcluster_init_error;
|
||||
}
|
||||
|
||||
/* Wait for the util thread to start */
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
while (ndb_util_thread_running < 0)
|
||||
pthread_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread);
|
||||
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
mysql_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread);
|
||||
mysql_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
|
||||
if (!ndb_util_thread_running)
|
||||
{
|
||||
DBUG_PRINT("error", ("ndb utility thread exited prematurely"));
|
||||
my_hash_free(&ndbcluster_open_tables);
|
||||
pthread_mutex_destroy(&ndbcluster_mutex);
|
||||
pthread_mutex_destroy(&LOCK_ndb_util_thread);
|
||||
pthread_cond_destroy(&COND_ndb_util_thread);
|
||||
pthread_cond_destroy(&COND_ndb_util_ready);
|
||||
mysql_mutex_destroy(&ndbcluster_mutex);
|
||||
mysql_mutex_destroy(&LOCK_ndb_util_thread);
|
||||
mysql_cond_destroy(&COND_ndb_util_thread);
|
||||
mysql_cond_destroy(&COND_ndb_util_ready);
|
||||
goto ndbcluster_init_error;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&LOCK_plugin);
|
||||
mysql_mutex_lock(&LOCK_plugin);
|
||||
|
||||
ndbcluster_inited= 1;
|
||||
DBUG_RETURN(FALSE);
|
||||
@ -7650,7 +7736,7 @@ ndbcluster_init_error:
|
||||
g_ndb_cluster_connection= NULL;
|
||||
ndbcluster_hton->state= SHOW_OPTION_DISABLED; // If we couldn't use handler
|
||||
|
||||
pthread_mutex_lock(&LOCK_plugin);
|
||||
mysql_mutex_lock(&LOCK_plugin);
|
||||
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
@ -7693,17 +7779,17 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type)
|
||||
|
||||
/* wait for util thread to finish */
|
||||
sql_print_information("Stopping Cluster Utility thread");
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
ndbcluster_terminating= 1;
|
||||
pthread_cond_signal(&COND_ndb_util_thread);
|
||||
mysql_cond_signal(&COND_ndb_util_thread);
|
||||
while (ndb_util_thread_running > 0)
|
||||
pthread_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread);
|
||||
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
mysql_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread);
|
||||
mysql_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
|
||||
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
{
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
while (ndbcluster_open_tables.records)
|
||||
{
|
||||
NDB_SHARE *share=
|
||||
@ -7714,7 +7800,7 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type)
|
||||
#endif
|
||||
ndbcluster_real_free_share(&share);
|
||||
}
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
}
|
||||
#endif
|
||||
my_hash_free(&ndbcluster_open_tables);
|
||||
@ -7743,10 +7829,10 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type)
|
||||
// cleanup ndb interface
|
||||
ndb_end_internal();
|
||||
|
||||
pthread_mutex_destroy(&ndbcluster_mutex);
|
||||
pthread_mutex_destroy(&LOCK_ndb_util_thread);
|
||||
pthread_cond_destroy(&COND_ndb_util_thread);
|
||||
pthread_cond_destroy(&COND_ndb_util_ready);
|
||||
mysql_mutex_destroy(&ndbcluster_mutex);
|
||||
mysql_mutex_destroy(&LOCK_ndb_util_thread);
|
||||
mysql_cond_destroy(&COND_ndb_util_thread);
|
||||
mysql_cond_destroy(&COND_ndb_util_ready);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@ -8049,12 +8135,12 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
build_table_filename(name, sizeof(name) - 1,
|
||||
dbname, tabname, "", 0);
|
||||
DBUG_PRINT("enter", ("name: %s", name));
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
if (!(share=(NDB_SHARE*) my_hash_search(&ndbcluster_open_tables,
|
||||
(uchar*) name,
|
||||
strlen(name))))
|
||||
{
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_PRINT("info", ("Table %s not found in ndbcluster_open_tables", name));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
@ -8062,9 +8148,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
share->use_count++;
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary use_count: %u",
|
||||
share->key, share->use_count));
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
if (opt_ndb_cache_check_time > 0)
|
||||
{
|
||||
if (share->commit_count != 0)
|
||||
@ -8075,7 +8161,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
#endif
|
||||
DBUG_PRINT("info", ("Getting commit_count: %s from share",
|
||||
llstr(share->commit_count, buff)));
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
/* ndb_share reference temporary free */
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u",
|
||||
share->key, share->use_count));
|
||||
@ -8092,7 +8178,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
ERR_RETURN(ndb->getNdbError());
|
||||
}
|
||||
uint lock= share->commit_count_lock;
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
|
||||
struct Ndb_statistics stat;
|
||||
{
|
||||
@ -8108,7 +8194,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
if (share->commit_count_lock == lock)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
@ -8124,7 +8210,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
DBUG_PRINT("info", ("Discarding commit_count, comit_count_lock changed"));
|
||||
*commit_count= 0;
|
||||
}
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
/* ndb_share reference temporary free */
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u",
|
||||
share->key, share->use_count));
|
||||
@ -8340,7 +8426,7 @@ static void print_ndbcluster_open_tables()
|
||||
to avoid segmentation faults. There is a risk that the memory for
|
||||
this trailing share leaks.
|
||||
|
||||
Must be called with previous pthread_mutex_lock(&ndbcluster_mutex)
|
||||
Must be called with previous mysql_mutex_lock(&ndbcluster_mutex)
|
||||
*/
|
||||
int handle_trailing_share(NDB_SHARE *share)
|
||||
{
|
||||
@ -8352,7 +8438,7 @@ int handle_trailing_share(NDB_SHARE *share)
|
||||
++share->use_count;
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary use_count: %u",
|
||||
share->key, share->use_count));
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
|
||||
TABLE_LIST table_list;
|
||||
bzero((char*) &table_list,sizeof(table_list));
|
||||
@ -8361,7 +8447,7 @@ int handle_trailing_share(NDB_SHARE *share)
|
||||
mysql_mutex_assert_owner(&LOCK_open);
|
||||
close_cached_tables(thd, &table_list, TRUE, FALSE, FALSE);
|
||||
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
/* ndb_share reference temporary free */
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u",
|
||||
share->key, share->use_count));
|
||||
@ -8452,7 +8538,7 @@ int handle_trailing_share(NDB_SHARE *share)
|
||||
static int rename_share(NDB_SHARE *share, const char *new_key)
|
||||
{
|
||||
NDB_SHARE *tmp;
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
uint new_length= (uint) strlen(new_key);
|
||||
DBUG_PRINT("rename_share", ("old_key: %s old__length: %d",
|
||||
share->key, share->key_length));
|
||||
@ -8490,7 +8576,7 @@ static int rename_share(NDB_SHARE *share, const char *new_key)
|
||||
share->key));
|
||||
}
|
||||
dbug_print_open_tables();
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
return -1;
|
||||
}
|
||||
dbug_print_open_tables();
|
||||
@ -8515,7 +8601,7 @@ static int rename_share(NDB_SHARE *share, const char *new_key)
|
||||
share->old_names= old_key;
|
||||
// ToDo free old_names after ALTER EVENT
|
||||
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -8526,12 +8612,12 @@ static int rename_share(NDB_SHARE *share, const char *new_key)
|
||||
*/
|
||||
NDB_SHARE *ndbcluster_get_share(NDB_SHARE *share)
|
||||
{
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
share->use_count++;
|
||||
|
||||
dbug_print_open_tables();
|
||||
dbug_print_share("ndbcluster_get_share:", share);
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
return share;
|
||||
}
|
||||
|
||||
@ -8548,7 +8634,7 @@ NDB_SHARE *ndbcluster_get_share(NDB_SHARE *share)
|
||||
create_if_not_exists == FALSE:
|
||||
returns 0 if share does not exist
|
||||
|
||||
have_lock == TRUE, pthread_mutex_lock(&ndbcluster_mutex) already taken
|
||||
have_lock == TRUE, mysql_mutex_lock(&ndbcluster_mutex) already taken
|
||||
*/
|
||||
|
||||
NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
|
||||
@ -8561,7 +8647,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
|
||||
DBUG_PRINT("enter", ("key: '%s'", key));
|
||||
|
||||
if (!have_lock)
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
if (!(share= (NDB_SHARE*) my_hash_search(&ndbcluster_open_tables,
|
||||
(uchar*) key,
|
||||
length)))
|
||||
@ -8570,7 +8656,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
|
||||
{
|
||||
DBUG_PRINT("error", ("get_share: %s does not exist", key));
|
||||
if (!have_lock)
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
if ((share= (NDB_SHARE*) my_malloc(sizeof(*share),
|
||||
@ -8592,11 +8678,11 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
|
||||
my_free((uchar*) share, 0);
|
||||
*root_ptr= old_root;
|
||||
if (!have_lock)
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
thr_lock_init(&share->lock);
|
||||
pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST);
|
||||
mysql_mutex_init(key_NDB_SHARE_mutex, &share->mutex, MY_MUTEX_INIT_FAST);
|
||||
share->commit_count= 0;
|
||||
share->commit_count_lock= 0;
|
||||
share->db= share->key + length + 1;
|
||||
@ -8610,7 +8696,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
|
||||
ndbcluster_real_free_share(&share);
|
||||
*root_ptr= old_root;
|
||||
if (!have_lock)
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
#endif
|
||||
@ -8620,7 +8706,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
|
||||
{
|
||||
DBUG_PRINT("error", ("get_share: failed to alloc share"));
|
||||
if (!have_lock)
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
my_error(ER_OUTOFMEMORY, MYF(0), sizeof(*share));
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
@ -8630,7 +8716,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
|
||||
dbug_print_open_tables();
|
||||
dbug_print_share("ndbcluster_get_share:", share);
|
||||
if (!have_lock)
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_RETURN(share);
|
||||
}
|
||||
|
||||
@ -8642,7 +8728,7 @@ void ndbcluster_real_free_share(NDB_SHARE **share)
|
||||
|
||||
my_hash_delete(&ndbcluster_open_tables, (uchar*) *share);
|
||||
thr_lock_delete(&(*share)->lock);
|
||||
pthread_mutex_destroy(&(*share)->mutex);
|
||||
mysql_mutex_destroy(&(*share)->mutex);
|
||||
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
if ((*share)->table)
|
||||
@ -8671,7 +8757,7 @@ void ndbcluster_real_free_share(NDB_SHARE **share)
|
||||
void ndbcluster_free_share(NDB_SHARE **share, bool have_lock)
|
||||
{
|
||||
if (!have_lock)
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
if ((*share)->util_lock == current_thd)
|
||||
(*share)->util_lock= 0;
|
||||
if (!--(*share)->use_count)
|
||||
@ -8684,7 +8770,7 @@ void ndbcluster_free_share(NDB_SHARE **share, bool have_lock)
|
||||
dbug_print_share("ndbcluster_free_share:", *share);
|
||||
}
|
||||
if (!have_lock)
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
}
|
||||
|
||||
|
||||
@ -8844,11 +8930,12 @@ int ha_ndbcluster::write_ndb_file(const char *name)
|
||||
(void)strxnmov(path, FN_REFLEN-1,
|
||||
mysql_data_home,"/",name,ha_ndb_ext,NullS);
|
||||
|
||||
if ((file=my_create(path, CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0)
|
||||
if ((file= mysql_file_create(key_file_ndb, path, CREATE_MODE,
|
||||
O_RDWR | O_TRUNC, MYF(MY_WME))) >= 0)
|
||||
{
|
||||
// It's an empty file
|
||||
error=0;
|
||||
my_close(file,MYF(0));
|
||||
mysql_file_close(file, MYF(0));
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
@ -9401,7 +9488,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
DBUG_ENTER("ndb_util_thread");
|
||||
DBUG_PRINT("enter", ("cache_check_time: %lu", opt_ndb_cache_check_time));
|
||||
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
|
||||
thd= new THD; /* note that contructor of THD uses DBUG_ */
|
||||
if (thd == NULL)
|
||||
@ -9434,45 +9521,45 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
|
||||
/* Signal successful initialization */
|
||||
ndb_util_thread_running= 1;
|
||||
pthread_cond_signal(&COND_ndb_util_ready);
|
||||
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
mysql_cond_signal(&COND_ndb_util_ready);
|
||||
mysql_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
|
||||
/*
|
||||
wait for mysql server to start
|
||||
*/
|
||||
pthread_mutex_lock(&LOCK_server_started);
|
||||
mysql_mutex_lock(&LOCK_server_started);
|
||||
while (!mysqld_server_started)
|
||||
{
|
||||
set_timespec(abstime, 1);
|
||||
pthread_cond_timedwait(&COND_server_started, &LOCK_server_started,
|
||||
mysql_cond_timedwait(&COND_server_started, &LOCK_server_started,
|
||||
&abstime);
|
||||
if (ndbcluster_terminating)
|
||||
{
|
||||
pthread_mutex_unlock(&LOCK_server_started);
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_unlock(&LOCK_server_started);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
goto ndb_util_thread_end;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_server_started);
|
||||
mysql_mutex_unlock(&LOCK_server_started);
|
||||
|
||||
/*
|
||||
Wait for cluster to start
|
||||
*/
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
while (!ndb_cluster_node_id && (ndbcluster_hton->slot != ~(uint)0))
|
||||
{
|
||||
/* ndb not connected yet */
|
||||
pthread_cond_wait(&COND_ndb_util_thread, &LOCK_ndb_util_thread);
|
||||
mysql_cond_wait(&COND_ndb_util_thread, &LOCK_ndb_util_thread);
|
||||
if (ndbcluster_terminating)
|
||||
goto ndb_util_thread_end;
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
|
||||
/* Get thd_ndb for this thread */
|
||||
if (!(thd_ndb= ha_ndbcluster::seize_thd_ndb()))
|
||||
{
|
||||
sql_print_error("Could not allocate Thd_ndb object");
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
goto ndb_util_thread_end;
|
||||
}
|
||||
set_thd_ndb(thd, thd_ndb);
|
||||
@ -9493,14 +9580,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
set_timespec(abstime, 0);
|
||||
for (;;)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
if (!ndbcluster_terminating)
|
||||
pthread_cond_timedwait(&COND_ndb_util_thread,
|
||||
mysql_cond_timedwait(&COND_ndb_util_thread,
|
||||
&LOCK_ndb_util_thread,
|
||||
&abstime);
|
||||
if (ndbcluster_terminating) /* Shutting down server */
|
||||
goto ndb_util_thread_end;
|
||||
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
#ifdef NDB_EXTRA_DEBUG_UTIL_THREAD
|
||||
DBUG_PRINT("ndb_util_thread", ("Started, opt_ndb_cache_check_time: %lu",
|
||||
opt_ndb_cache_check_time));
|
||||
@ -9525,7 +9612,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
|
||||
/* Lock mutex and fill list with pointers to all open tables */
|
||||
NDB_SHARE *share;
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
uint i, open_count, record_count= ndbcluster_open_tables.records;
|
||||
if (share_list_size < record_count)
|
||||
{
|
||||
@ -9534,7 +9621,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
{
|
||||
sql_print_warning("ndb util thread: malloc failure, "
|
||||
"query cache not maintained properly");
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
goto next; // At least do not crash
|
||||
}
|
||||
delete [] share_list;
|
||||
@ -9561,7 +9648,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
/* Store pointer to table */
|
||||
share_list[open_count++]= share;
|
||||
}
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
|
||||
/* Iterate through the open files list */
|
||||
for (i= 0; i < open_count; i++)
|
||||
@ -9586,9 +9673,9 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
|
||||
struct Ndb_statistics stat;
|
||||
uint lock;
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
lock= share->commit_count_lock;
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
{
|
||||
/* Contact NDB to get commit count for table */
|
||||
Ndb* ndb= thd_ndb->ndb;
|
||||
@ -9619,10 +9706,10 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
}
|
||||
}
|
||||
loop_next:
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
if (share->commit_count_lock == lock)
|
||||
share->commit_count= stat.commit_count;
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
|
||||
/* ndb_share reference temporary free */
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u",
|
||||
@ -9652,7 +9739,7 @@ next:
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
|
||||
ndb_util_thread_end:
|
||||
net_end(&thd->net);
|
||||
@ -9664,8 +9751,8 @@ ndb_util_thread_fail:
|
||||
|
||||
/* signal termination */
|
||||
ndb_util_thread_running= 0;
|
||||
pthread_cond_signal(&COND_ndb_util_ready);
|
||||
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
mysql_cond_signal(&COND_ndb_util_ready);
|
||||
mysql_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
DBUG_PRINT("exit", ("ndb_util_thread"));
|
||||
|
||||
DBUG_LEAVE; // Must match DBUG_ENTER()
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef HA_NDBCLUSTER_INCLUDED
|
||||
#define HA_NDBCLUSTER_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -35,6 +35,10 @@
|
||||
|
||||
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
extern PSI_file_key key_file_ndb;
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
|
||||
class Ndb; // Forward declaration
|
||||
class NdbOperation; // Forward declaration
|
||||
@ -102,7 +106,7 @@ typedef struct st_ndbcluster_share {
|
||||
NDB_SHARE_STATE state;
|
||||
MEM_ROOT mem_root;
|
||||
THR_LOCK lock;
|
||||
pthread_mutex_t mutex;
|
||||
mysql_mutex_t mutex;
|
||||
char *key;
|
||||
uint key_length;
|
||||
THD *util_lock;
|
||||
@ -131,9 +135,9 @@ NDB_SHARE_STATE
|
||||
get_ndb_share_state(NDB_SHARE *share)
|
||||
{
|
||||
NDB_SHARE_STATE state;
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
state= share->state;
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
return state;
|
||||
}
|
||||
|
||||
@ -141,19 +145,19 @@ inline
|
||||
void
|
||||
set_ndb_share_state(NDB_SHARE *share, NDB_SHARE_STATE state)
|
||||
{
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
share->state= state;
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
}
|
||||
|
||||
struct Ndb_tuple_id_range_guard {
|
||||
Ndb_tuple_id_range_guard(NDB_SHARE* _share) :
|
||||
share(_share),
|
||||
range(share->tuple_id_range) {
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
}
|
||||
~Ndb_tuple_id_range_guard() {
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
}
|
||||
NDB_SHARE* share;
|
||||
Ndb::TupleIdRange& range;
|
||||
@ -578,6 +582,6 @@ static const char ndbcluster_hton_name[]= "ndbcluster";
|
||||
static const int ndbcluster_hton_name_length=sizeof(ndbcluster_hton_name)-1;
|
||||
extern int ndbcluster_terminating;
|
||||
extern int ndb_util_thread_running;
|
||||
extern pthread_cond_t COND_ndb_util_ready;
|
||||
extern mysql_cond_t COND_ndb_util_ready;
|
||||
|
||||
#endif /* HA_NDBCLUSTER_INCLUDED */
|
||||
|
@ -79,7 +79,7 @@ THD *injector_thd= 0;
|
||||
to enable ndb injector thread receiving events.
|
||||
|
||||
Must therefore always be used with a surrounding
|
||||
pthread_mutex_lock(&injector_mutex), when doing create/dropEventOperation
|
||||
mysql_mutex_lock(&injector_mutex), when doing create/dropEventOperation
|
||||
*/
|
||||
static Ndb *injector_ndb= 0;
|
||||
static Ndb *schema_ndb= 0;
|
||||
@ -106,8 +106,8 @@ static int ndbcluster_binlog_terminating= 0;
|
||||
and injector thread
|
||||
*/
|
||||
pthread_t ndb_binlog_thread;
|
||||
pthread_mutex_t injector_mutex;
|
||||
pthread_cond_t injector_cond;
|
||||
mysql_mutex_t injector_mutex;
|
||||
mysql_cond_t injector_cond;
|
||||
|
||||
/* NDB Injector thread (used for binlog creation) */
|
||||
static ulonglong ndb_latest_applied_binlog_epoch= 0;
|
||||
@ -116,7 +116,7 @@ static ulonglong ndb_latest_received_binlog_epoch= 0;
|
||||
|
||||
NDB_SHARE *ndb_apply_status_share= 0;
|
||||
NDB_SHARE *ndb_schema_share= 0;
|
||||
pthread_mutex_t ndb_schema_share_mutex;
|
||||
mysql_mutex_t ndb_schema_share_mutex;
|
||||
|
||||
extern my_bool opt_log_slave_updates;
|
||||
static my_bool g_ndb_log_slave_updates;
|
||||
@ -124,7 +124,7 @@ static my_bool g_ndb_log_slave_updates;
|
||||
/* Schema object distribution handling */
|
||||
HASH ndb_schema_objects;
|
||||
typedef struct st_ndb_schema_object {
|
||||
pthread_mutex_t mutex;
|
||||
mysql_mutex_t mutex;
|
||||
char *key;
|
||||
uint key_length;
|
||||
uint use_count;
|
||||
@ -642,28 +642,28 @@ static int ndbcluster_binlog_end(THD *thd)
|
||||
however be a likely case as the ndbcluster_binlog_end is supposed to
|
||||
be called before ndb_cluster_end().
|
||||
*/
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_lock(&LOCK_ndb_util_thread);
|
||||
/* Ensure mutex are not freed if ndb_cluster_end is running at same time */
|
||||
ndb_util_thread_running++;
|
||||
ndbcluster_terminating= 1;
|
||||
pthread_cond_signal(&COND_ndb_util_thread);
|
||||
mysql_cond_signal(&COND_ndb_util_thread);
|
||||
while (ndb_util_thread_running > 1)
|
||||
pthread_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread);
|
||||
mysql_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread);
|
||||
ndb_util_thread_running--;
|
||||
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
mysql_mutex_unlock(&LOCK_ndb_util_thread);
|
||||
}
|
||||
|
||||
/* wait for injector thread to finish */
|
||||
ndbcluster_binlog_terminating= 1;
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
while (ndb_binlog_thread_running > 0)
|
||||
pthread_cond_wait(&injector_cond, &injector_mutex);
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_cond_wait(&injector_cond, &injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
|
||||
pthread_mutex_destroy(&injector_mutex);
|
||||
pthread_cond_destroy(&injector_cond);
|
||||
pthread_mutex_destroy(&ndb_schema_share_mutex);
|
||||
mysql_mutex_destroy(&injector_mutex);
|
||||
mysql_cond_destroy(&injector_cond);
|
||||
mysql_mutex_destroy(&ndb_schema_share_mutex);
|
||||
#endif
|
||||
|
||||
DBUG_RETURN(0);
|
||||
@ -743,14 +743,14 @@ void ndbcluster_binlog_init_handlerton()
|
||||
*/
|
||||
static NDB_SHARE *ndbcluster_check_ndb_apply_status_share()
|
||||
{
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
|
||||
void *share= my_hash_search(&ndbcluster_open_tables,
|
||||
(uchar*) NDB_APPLY_TABLE_FILE,
|
||||
sizeof(NDB_APPLY_TABLE_FILE) - 1);
|
||||
DBUG_PRINT("info",("ndbcluster_check_ndb_apply_status_share %s 0x%lx",
|
||||
NDB_APPLY_TABLE_FILE, (long) share));
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
return (NDB_SHARE*) share;
|
||||
}
|
||||
|
||||
@ -761,14 +761,14 @@ static NDB_SHARE *ndbcluster_check_ndb_apply_status_share()
|
||||
*/
|
||||
static NDB_SHARE *ndbcluster_check_ndb_schema_share()
|
||||
{
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
|
||||
void *share= my_hash_search(&ndbcluster_open_tables,
|
||||
(uchar*) NDB_SCHEMA_TABLE_FILE,
|
||||
sizeof(NDB_SCHEMA_TABLE_FILE) - 1);
|
||||
DBUG_PRINT("info",("ndbcluster_check_ndb_schema_share %s 0x%lx",
|
||||
NDB_SCHEMA_TABLE_FILE, (long) share));
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
return (NDB_SHARE*) share;
|
||||
}
|
||||
|
||||
@ -803,7 +803,7 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd)
|
||||
{
|
||||
build_table_filename(buf, sizeof(buf) - 1,
|
||||
NDB_REP_DB, NDB_APPLY_TABLE, reg_ext, 0);
|
||||
my_delete(buf, MYF(0));
|
||||
mysql_file_delete(key_file_frm, buf, MYF(0));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -861,7 +861,7 @@ static int ndbcluster_create_schema_table(THD *thd)
|
||||
{
|
||||
build_table_filename(buf, sizeof(buf) - 1,
|
||||
NDB_REP_DB, NDB_SCHEMA_TABLE, reg_ext, 0);
|
||||
my_delete(buf, MYF(0));
|
||||
mysql_file_delete(key_file_frm, buf, MYF(0));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -929,7 +929,7 @@ int ndbcluster_setup_binlog_table_shares(THD *thd)
|
||||
close_cached_tables(NULL, NULL, TRUE, FALSE, FALSE);
|
||||
mysql_mutex_unlock(&LOCK_open);
|
||||
/* Signal injector thread that all is setup */
|
||||
pthread_cond_signal(&injector_cond);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1240,12 +1240,12 @@ static void ndb_report_waiting(const char *key,
|
||||
{
|
||||
ulonglong ndb_latest_epoch= 0;
|
||||
const char *proc_info= "<no info>";
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
if (injector_ndb)
|
||||
ndb_latest_epoch= injector_ndb->getLatestGCI();
|
||||
if (injector_thd)
|
||||
proc_info= injector_thd->proc_info;
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
sql_print_information("NDB %s:"
|
||||
" waiting max %u sec for %s %s."
|
||||
" epochs: (%u,%u,%u)"
|
||||
@ -1358,15 +1358,15 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
|
||||
bitmap_set_all(&schema_subscribers);
|
||||
|
||||
/* begin protect ndb_schema_share */
|
||||
pthread_mutex_lock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_lock(&ndb_schema_share_mutex);
|
||||
if (ndb_schema_share == 0)
|
||||
{
|
||||
pthread_mutex_unlock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_share_mutex);
|
||||
if (ndb_schema_object)
|
||||
ndb_free_schema_object(&ndb_schema_object, FALSE);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
(void) pthread_mutex_lock(&ndb_schema_share->mutex);
|
||||
mysql_mutex_lock(&ndb_schema_share->mutex);
|
||||
for (i= 0; i < no_storage_nodes; i++)
|
||||
{
|
||||
MY_BITMAP *table_subscribers= &ndb_schema_share->subscriber_bitmap[i];
|
||||
@ -1377,8 +1377,8 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
|
||||
updated= 1;
|
||||
}
|
||||
}
|
||||
(void) pthread_mutex_unlock(&ndb_schema_share->mutex);
|
||||
pthread_mutex_unlock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_share->mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_share_mutex);
|
||||
/* end protect ndb_schema_share */
|
||||
|
||||
if (updated)
|
||||
@ -1398,10 +1398,10 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
|
||||
|
||||
if (ndb_schema_object)
|
||||
{
|
||||
(void) pthread_mutex_lock(&ndb_schema_object->mutex);
|
||||
mysql_mutex_lock(&ndb_schema_object->mutex);
|
||||
memcpy(ndb_schema_object->slock, schema_subscribers.bitmap,
|
||||
sizeof(ndb_schema_object->slock));
|
||||
(void) pthread_mutex_unlock(&ndb_schema_object->mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_object->mutex);
|
||||
}
|
||||
|
||||
DBUG_DUMP("schema_subscribers", (uchar*)schema_subscribers.bitmap,
|
||||
@ -1567,7 +1567,7 @@ end:
|
||||
dict->forceGCPWait();
|
||||
|
||||
int max_timeout= DEFAULT_SYNC_TIMEOUT;
|
||||
(void) pthread_mutex_lock(&ndb_schema_object->mutex);
|
||||
mysql_mutex_lock(&ndb_schema_object->mutex);
|
||||
if (have_lock_open)
|
||||
{
|
||||
mysql_mutex_assert_owner(&LOCK_open);
|
||||
@ -1579,20 +1579,20 @@ end:
|
||||
int i;
|
||||
int no_storage_nodes= g_ndb_cluster_connection->no_db_nodes();
|
||||
set_timespec(abstime, 1);
|
||||
int ret= pthread_cond_timedwait(&injector_cond,
|
||||
int ret= mysql_cond_timedwait(&injector_cond,
|
||||
&ndb_schema_object->mutex,
|
||||
&abstime);
|
||||
if (thd->killed)
|
||||
break;
|
||||
|
||||
/* begin protect ndb_schema_share */
|
||||
pthread_mutex_lock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_lock(&ndb_schema_share_mutex);
|
||||
if (ndb_schema_share == 0)
|
||||
{
|
||||
pthread_mutex_unlock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_share_mutex);
|
||||
break;
|
||||
}
|
||||
(void) pthread_mutex_lock(&ndb_schema_share->mutex);
|
||||
mysql_mutex_lock(&ndb_schema_share->mutex);
|
||||
for (i= 0; i < no_storage_nodes; i++)
|
||||
{
|
||||
/* remove any unsubscribed from schema_subscribers */
|
||||
@ -1600,8 +1600,8 @@ end:
|
||||
if (!bitmap_is_clear_all(tmp))
|
||||
bitmap_intersect(&schema_subscribers, tmp);
|
||||
}
|
||||
(void) pthread_mutex_unlock(&ndb_schema_share->mutex);
|
||||
pthread_mutex_unlock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_share->mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_share_mutex);
|
||||
/* end protect ndb_schema_share */
|
||||
|
||||
/* remove any unsubscribed from ndb_schema_object->slock */
|
||||
@ -1632,7 +1632,7 @@ end:
|
||||
{
|
||||
mysql_mutex_lock(&LOCK_open);
|
||||
}
|
||||
(void) pthread_mutex_unlock(&ndb_schema_object->mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_object->mutex);
|
||||
}
|
||||
|
||||
if (ndb_schema_object)
|
||||
@ -1762,11 +1762,11 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
|
||||
if (is_online_alter_table)
|
||||
{
|
||||
/* Signal ha_ndbcluster::alter_table that drop is done */
|
||||
(void) pthread_cond_signal(&injector_cond);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
(void) pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
if (is_rename_table && !is_remote_change)
|
||||
{
|
||||
DBUG_PRINT("info", ("Detected name change of table %s.%s",
|
||||
@ -1802,10 +1802,10 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
|
||||
// either just us or drop table handling as well
|
||||
|
||||
/* Signal ha_ndbcluster::delete/rename_table that drop is done */
|
||||
(void) pthread_mutex_unlock(&share->mutex);
|
||||
(void) pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
/* ndb_share reference binlog free */
|
||||
DBUG_PRINT("NDB_SHARE", ("%s binlog free use_count: %u",
|
||||
share->key, share->use_count));
|
||||
@ -1831,14 +1831,14 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
|
||||
}
|
||||
else
|
||||
share= 0;
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
|
||||
pOp->setCustomData(0);
|
||||
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
ndb->dropEventOperation(pOp);
|
||||
pOp= 0;
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
|
||||
if (do_close_cached_tables)
|
||||
{
|
||||
@ -2073,7 +2073,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
|
||||
"read only on reconnect.");
|
||||
|
||||
/* begin protect ndb_schema_share */
|
||||
pthread_mutex_lock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_lock(&ndb_schema_share_mutex);
|
||||
/* ndb_share reference binlog extra free */
|
||||
DBUG_PRINT("NDB_SHARE", ("%s binlog extra free use_count: %u",
|
||||
ndb_schema_share->key,
|
||||
@ -2081,7 +2081,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
|
||||
free_share(&ndb_schema_share);
|
||||
ndb_schema_share= 0;
|
||||
ndb_binlog_tables_inited= 0;
|
||||
pthread_mutex_unlock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_share_mutex);
|
||||
/* end protect ndb_schema_share */
|
||||
|
||||
close_cached_tables(NULL, NULL, FALSE, FALSE, FALSE);
|
||||
@ -2093,7 +2093,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
|
||||
{
|
||||
uint8 node_id= g_node_id_map[pOp->getNdbdNodeId()];
|
||||
DBUG_ASSERT(node_id != 0xFF);
|
||||
(void) pthread_mutex_lock(&tmp_share->mutex);
|
||||
mysql_mutex_lock(&tmp_share->mutex);
|
||||
bitmap_clear_all(&tmp_share->subscriber_bitmap[node_id]);
|
||||
DBUG_PRINT("info",("NODE_FAILURE UNSUBSCRIBE[%d]", node_id));
|
||||
if (opt_ndb_extra_logging)
|
||||
@ -2104,8 +2104,8 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
|
||||
tmp_share->subscriber_bitmap[node_id].bitmap[1],
|
||||
tmp_share->subscriber_bitmap[node_id].bitmap[0]);
|
||||
}
|
||||
(void) pthread_mutex_unlock(&tmp_share->mutex);
|
||||
(void) pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_unlock(&tmp_share->mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
break;
|
||||
}
|
||||
case NDBEVENT::TE_SUBSCRIBE:
|
||||
@ -2113,7 +2113,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
|
||||
uint8 node_id= g_node_id_map[pOp->getNdbdNodeId()];
|
||||
uint8 req_id= pOp->getReqNodeId();
|
||||
DBUG_ASSERT(req_id != 0 && node_id != 0xFF);
|
||||
(void) pthread_mutex_lock(&tmp_share->mutex);
|
||||
mysql_mutex_lock(&tmp_share->mutex);
|
||||
bitmap_set_bit(&tmp_share->subscriber_bitmap[node_id], req_id);
|
||||
DBUG_PRINT("info",("SUBSCRIBE[%d] %d", node_id, req_id));
|
||||
if (opt_ndb_extra_logging)
|
||||
@ -2125,8 +2125,8 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
|
||||
tmp_share->subscriber_bitmap[node_id].bitmap[1],
|
||||
tmp_share->subscriber_bitmap[node_id].bitmap[0]);
|
||||
}
|
||||
(void) pthread_mutex_unlock(&tmp_share->mutex);
|
||||
(void) pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_unlock(&tmp_share->mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
break;
|
||||
}
|
||||
case NDBEVENT::TE_UNSUBSCRIBE:
|
||||
@ -2134,7 +2134,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
|
||||
uint8 node_id= g_node_id_map[pOp->getNdbdNodeId()];
|
||||
uint8 req_id= pOp->getReqNodeId();
|
||||
DBUG_ASSERT(req_id != 0 && node_id != 0xFF);
|
||||
(void) pthread_mutex_lock(&tmp_share->mutex);
|
||||
mysql_mutex_lock(&tmp_share->mutex);
|
||||
bitmap_clear_bit(&tmp_share->subscriber_bitmap[node_id], req_id);
|
||||
DBUG_PRINT("info",("UNSUBSCRIBE[%d] %d", node_id, req_id));
|
||||
if (opt_ndb_extra_logging)
|
||||
@ -2146,8 +2146,8 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
|
||||
tmp_share->subscriber_bitmap[node_id].bitmap[1],
|
||||
tmp_share->subscriber_bitmap[node_id].bitmap[0]);
|
||||
}
|
||||
(void) pthread_mutex_unlock(&tmp_share->mutex);
|
||||
(void) pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_unlock(&tmp_share->mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -2187,22 +2187,22 @@ ndb_binlog_thread_handle_schema_event_post_epoch(THD *thd,
|
||||
build_table_filename(key, sizeof(key) - 1, schema->db, schema->name, "", 0);
|
||||
if (schema_type == SOT_CLEAR_SLOCK)
|
||||
{
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
NDB_SCHEMA_OBJECT *ndb_schema_object=
|
||||
(NDB_SCHEMA_OBJECT*) my_hash_search(&ndb_schema_objects,
|
||||
(uchar*) key, strlen(key));
|
||||
if (ndb_schema_object)
|
||||
{
|
||||
pthread_mutex_lock(&ndb_schema_object->mutex);
|
||||
mysql_mutex_lock(&ndb_schema_object->mutex);
|
||||
memcpy(ndb_schema_object->slock, schema->slock,
|
||||
sizeof(ndb_schema_object->slock));
|
||||
DBUG_DUMP("ndb_schema_object->slock_bitmap.bitmap",
|
||||
(uchar*)ndb_schema_object->slock_bitmap.bitmap,
|
||||
no_bytes_in_map(&ndb_schema_object->slock_bitmap));
|
||||
pthread_mutex_unlock(&ndb_schema_object->mutex);
|
||||
pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_unlock(&ndb_schema_object->mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
}
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
continue;
|
||||
}
|
||||
/* ndb_share reference temporary, free below */
|
||||
@ -2463,27 +2463,29 @@ int ndbcluster_binlog_start()
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_init(&injector_mutex, MY_MUTEX_INIT_FAST);
|
||||
pthread_cond_init(&injector_cond, NULL);
|
||||
pthread_mutex_init(&ndb_schema_share_mutex, MY_MUTEX_INIT_FAST);
|
||||
mysql_mutex_init(key_injector_mutex, &injector_mutex, MY_MUTEX_INIT_FAST);
|
||||
mysql_cond_init(key_injector_cond, &injector_cond, NULL);
|
||||
mysql_mutex_init(key_ndb_schema_share_mutex,
|
||||
&ndb_schema_share_mutex, MY_MUTEX_INIT_FAST);
|
||||
|
||||
/* Create injector thread */
|
||||
if (pthread_create(&ndb_binlog_thread, &connection_attrib,
|
||||
if (mysql_thread_create(key_thread_ndb_binlog,
|
||||
&ndb_binlog_thread, &connection_attrib,
|
||||
ndb_binlog_thread_func, 0))
|
||||
{
|
||||
DBUG_PRINT("error", ("Could not create ndb injector thread"));
|
||||
pthread_cond_destroy(&injector_cond);
|
||||
pthread_mutex_destroy(&injector_mutex);
|
||||
mysql_cond_destroy(&injector_cond);
|
||||
mysql_mutex_destroy(&injector_mutex);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
ndbcluster_binlog_inited= 1;
|
||||
|
||||
/* Wait for the injector thread to start */
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
while (!ndb_binlog_thread_running)
|
||||
pthread_cond_wait(&injector_cond, &injector_mutex);
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_cond_wait(&injector_cond, &injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
|
||||
if (ndb_binlog_thread_running < 0)
|
||||
DBUG_RETURN(-1);
|
||||
@ -2573,7 +2575,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
|
||||
DBUG_ASSERT(! IS_NDB_BLOB_PREFIX(table_name));
|
||||
DBUG_ASSERT(strlen(key) == key_len);
|
||||
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
|
||||
/* Handle any trailing share */
|
||||
NDB_SHARE *share= (NDB_SHARE*) my_hash_search(&ndbcluster_open_tables,
|
||||
@ -2585,7 +2587,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
|
||||
share->op != 0 ||
|
||||
share->op_old != 0)
|
||||
{
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_RETURN(0); // replication already setup, or should not
|
||||
}
|
||||
}
|
||||
@ -2595,7 +2597,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
|
||||
if (share->op || share->op_old)
|
||||
{
|
||||
my_errno= HA_ERR_TABLE_EXIST;
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (!share_may_exist || share->connect_count !=
|
||||
@ -2638,10 +2640,10 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
|
||||
if (!do_event_op)
|
||||
{
|
||||
share->flags|= NSF_NO_BINLOG;
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
|
||||
while (share && !IS_TMP_PREFIX(table_name))
|
||||
{
|
||||
@ -2934,14 +2936,14 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
|
||||
int retry_sleep= 100;
|
||||
while (1)
|
||||
{
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
Ndb *ndb= injector_ndb;
|
||||
if (do_ndb_schema_share)
|
||||
ndb= schema_ndb;
|
||||
|
||||
if (ndb == 0)
|
||||
{
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
@ -2966,7 +2968,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
|
||||
ndb->getNdbError().code,
|
||||
ndb->getNdbError().message,
|
||||
"NDB");
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
@ -3016,7 +3018,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
|
||||
op->getNdbError().message,
|
||||
"NDB");
|
||||
ndb->dropEventOperation(op);
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
}
|
||||
@ -3058,7 +3060,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
|
||||
op->getNdbError().code, op->getNdbError().message);
|
||||
}
|
||||
ndb->dropEventOperation(op);
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
if (retries)
|
||||
{
|
||||
my_sleep(retry_sleep);
|
||||
@ -3066,7 +3068,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
|
||||
}
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3080,7 +3082,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
|
||||
ndb_apply_status_share= get_share(share);
|
||||
DBUG_PRINT("NDB_SHARE", ("%s binlog extra use_count: %u",
|
||||
share->key, share->use_count));
|
||||
(void) pthread_cond_signal(&injector_cond);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
}
|
||||
else if (do_ndb_schema_share)
|
||||
{
|
||||
@ -3088,7 +3090,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
|
||||
ndb_schema_share= get_share(share);
|
||||
DBUG_PRINT("NDB_SHARE", ("%s binlog extra use_count: %u",
|
||||
share->key, share->use_count));
|
||||
(void) pthread_cond_signal(&injector_cond);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
}
|
||||
|
||||
DBUG_PRINT("info",("%s share->op: 0x%lx share->use_count: %u",
|
||||
@ -3159,7 +3161,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
|
||||
#define SYNC_DROP_
|
||||
#ifdef SYNC_DROP_
|
||||
thd->proc_info= "Syncing ndb table schema operation and binlog";
|
||||
(void) pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
mysql_mutex_assert_owner(&LOCK_open);
|
||||
mysql_mutex_unlock(&LOCK_open);
|
||||
int max_timeout= DEFAULT_SYNC_TIMEOUT;
|
||||
@ -3167,7 +3169,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
|
||||
{
|
||||
struct timespec abstime;
|
||||
set_timespec(abstime, 1);
|
||||
int ret= pthread_cond_timedwait(&injector_cond,
|
||||
int ret= mysql_cond_timedwait(&injector_cond,
|
||||
&share->mutex,
|
||||
&abstime);
|
||||
if (thd->killed ||
|
||||
@ -3188,12 +3190,12 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
|
||||
}
|
||||
}
|
||||
mysql_mutex_lock(&LOCK_open);
|
||||
(void) pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
#else
|
||||
(void) pthread_mutex_lock(&share->mutex);
|
||||
mysql_mutex_lock(&share->mutex);
|
||||
share->op_old= share->op;
|
||||
share->op= 0;
|
||||
(void) pthread_mutex_unlock(&share->mutex);
|
||||
mysql_mutex_unlock(&share->mutex);
|
||||
#endif
|
||||
thd->proc_info= save_proc_info;
|
||||
|
||||
@ -3561,7 +3563,7 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key,
|
||||
DBUG_PRINT("enter", ("key: '%s'", key));
|
||||
|
||||
if (!have_lock)
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
while (!(ndb_schema_object=
|
||||
(NDB_SCHEMA_OBJECT*) my_hash_search(&ndb_schema_objects,
|
||||
(uchar*) key,
|
||||
@ -3587,7 +3589,7 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key,
|
||||
my_free((uchar*) ndb_schema_object, 0);
|
||||
break;
|
||||
}
|
||||
pthread_mutex_init(&ndb_schema_object->mutex, MY_MUTEX_INIT_FAST);
|
||||
mysql_mutex_init(key_ndb_schema_object_mutex, &ndb_schema_object->mutex, MY_MUTEX_INIT_FAST);
|
||||
bitmap_init(&ndb_schema_object->slock_bitmap, ndb_schema_object->slock,
|
||||
sizeof(ndb_schema_object->slock)*8, FALSE);
|
||||
bitmap_clear_all(&ndb_schema_object->slock_bitmap);
|
||||
@ -3599,7 +3601,7 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key,
|
||||
DBUG_PRINT("info", ("use_count: %d", ndb_schema_object->use_count));
|
||||
}
|
||||
if (!have_lock)
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_RETURN(ndb_schema_object);
|
||||
}
|
||||
|
||||
@ -3610,12 +3612,12 @@ static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object,
|
||||
DBUG_ENTER("ndb_free_schema_object");
|
||||
DBUG_PRINT("enter", ("key: '%s'", (*ndb_schema_object)->key));
|
||||
if (!have_lock)
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
mysql_mutex_lock(&ndbcluster_mutex);
|
||||
if (!--(*ndb_schema_object)->use_count)
|
||||
{
|
||||
DBUG_PRINT("info", ("use_count: %d", (*ndb_schema_object)->use_count));
|
||||
my_hash_delete(&ndb_schema_objects, (uchar*) *ndb_schema_object);
|
||||
pthread_mutex_destroy(&(*ndb_schema_object)->mutex);
|
||||
mysql_mutex_destroy(&(*ndb_schema_object)->mutex);
|
||||
my_free((uchar*) *ndb_schema_object, MYF(0));
|
||||
*ndb_schema_object= 0;
|
||||
}
|
||||
@ -3624,7 +3626,7 @@ static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object,
|
||||
DBUG_PRINT("info", ("use_count: %d", (*ndb_schema_object)->use_count));
|
||||
}
|
||||
if (!have_lock)
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
mysql_mutex_unlock(&ndbcluster_mutex);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@ -3645,7 +3647,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
|
||||
Timer main_timer;
|
||||
#endif
|
||||
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
/*
|
||||
Set up the Thread
|
||||
*/
|
||||
@ -3663,14 +3665,16 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
|
||||
thd->thread_id= thread_id++;
|
||||
pthread_mutex_unlock(&LOCK_thread_count);
|
||||
|
||||
mysql_thread_set_psi_id(thd->thread_id);
|
||||
|
||||
thd->thread_stack= (char*) &thd; /* remember where our stack is */
|
||||
if (thd->store_globals())
|
||||
{
|
||||
thd->cleanup();
|
||||
delete thd;
|
||||
ndb_binlog_thread_running= -1;
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
|
||||
DBUG_LEAVE; // Must match DBUG_ENTER()
|
||||
my_thread_end();
|
||||
@ -3705,8 +3709,8 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
|
||||
{
|
||||
sql_print_error("NDB Binlog: Getting Schema Ndb object failed");
|
||||
ndb_binlog_thread_running= -1;
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
goto err;
|
||||
}
|
||||
|
||||
@ -3716,8 +3720,8 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
|
||||
{
|
||||
sql_print_error("NDB Binlog: Getting Ndb object failed");
|
||||
ndb_binlog_thread_running= -1;
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
goto err;
|
||||
}
|
||||
|
||||
@ -3730,7 +3734,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
|
||||
|
||||
Used by both sql client thread and binlog thread to interact
|
||||
with the storage
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
*/
|
||||
injector_thd= thd;
|
||||
injector_ndb= i_ndb;
|
||||
@ -3745,27 +3749,27 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
|
||||
|
||||
/* Thread start up completed */
|
||||
ndb_binlog_thread_running= 1;
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
pthread_cond_signal(&injector_cond);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
|
||||
/*
|
||||
wait for mysql server to start (so that the binlog is started
|
||||
and thus can receive the first GAP event)
|
||||
*/
|
||||
pthread_mutex_lock(&LOCK_server_started);
|
||||
mysql_mutex_lock(&LOCK_server_started);
|
||||
while (!mysqld_server_started)
|
||||
{
|
||||
struct timespec abstime;
|
||||
set_timespec(abstime, 1);
|
||||
pthread_cond_timedwait(&COND_server_started, &LOCK_server_started,
|
||||
mysql_cond_timedwait(&COND_server_started, &LOCK_server_started,
|
||||
&abstime);
|
||||
if (ndbcluster_terminating)
|
||||
{
|
||||
pthread_mutex_unlock(&LOCK_server_started);
|
||||
mysql_mutex_unlock(&LOCK_server_started);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_server_started);
|
||||
mysql_mutex_unlock(&LOCK_server_started);
|
||||
restart:
|
||||
/*
|
||||
Main NDB Injector loop
|
||||
@ -3808,21 +3812,21 @@ restart:
|
||||
{
|
||||
thd->proc_info= "Waiting for ndbcluster to start";
|
||||
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
while (!ndb_schema_share ||
|
||||
(ndb_binlog_running && !ndb_apply_status_share))
|
||||
{
|
||||
/* ndb not connected yet */
|
||||
struct timespec abstime;
|
||||
set_timespec(abstime, 1);
|
||||
pthread_cond_timedwait(&injector_cond, &injector_mutex, &abstime);
|
||||
mysql_cond_timedwait(&injector_cond, &injector_mutex, &abstime);
|
||||
if (ndbcluster_binlog_terminating)
|
||||
{
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
|
||||
if (thd_ndb == NULL)
|
||||
{
|
||||
@ -4293,13 +4297,13 @@ err:
|
||||
DBUG_PRINT("info",("Shutting down cluster binlog thread"));
|
||||
thd->proc_info= "Shutting down";
|
||||
close_thread_tables(thd);
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
/* don't mess with the injector_ndb anymore from other threads */
|
||||
injector_thd= 0;
|
||||
injector_ndb= 0;
|
||||
p_latest_trans_gci= 0;
|
||||
schema_ndb= 0;
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
thd->db= 0; // as not to try to free memory
|
||||
|
||||
if (ndb_apply_status_share)
|
||||
@ -4314,7 +4318,7 @@ err:
|
||||
if (ndb_schema_share)
|
||||
{
|
||||
/* begin protect ndb_schema_share */
|
||||
pthread_mutex_lock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_lock(&ndb_schema_share_mutex);
|
||||
/* ndb_share reference binlog extra free */
|
||||
DBUG_PRINT("NDB_SHARE", ("%s binlog extra free use_count: %u",
|
||||
ndb_schema_share->key,
|
||||
@ -4322,7 +4326,7 @@ err:
|
||||
free_share(&ndb_schema_share);
|
||||
ndb_schema_share= 0;
|
||||
ndb_binlog_tables_inited= 0;
|
||||
pthread_mutex_unlock(&ndb_schema_share_mutex);
|
||||
mysql_mutex_unlock(&ndb_schema_share_mutex);
|
||||
/* end protect ndb_schema_share */
|
||||
}
|
||||
|
||||
@ -4382,7 +4386,7 @@ err:
|
||||
|
||||
ndb_binlog_thread_running= -1;
|
||||
ndb_binlog_running= FALSE;
|
||||
(void) pthread_cond_signal(&injector_cond);
|
||||
mysql_cond_signal(&injector_cond);
|
||||
|
||||
DBUG_PRINT("exit", ("ndb_binlog_thread"));
|
||||
|
||||
@ -4401,12 +4405,12 @@ ndbcluster_show_status_binlog(THD* thd, stat_print_fn *stat_print,
|
||||
ulonglong ndb_latest_epoch= 0;
|
||||
DBUG_ENTER("ndbcluster_show_status_binlog");
|
||||
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
mysql_mutex_lock(&injector_mutex);
|
||||
if (injector_ndb)
|
||||
{
|
||||
char buff1[22],buff2[22],buff3[22],buff4[22],buff5[22];
|
||||
ndb_latest_epoch= injector_ndb->getLatestGCI();
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
|
||||
buflen=
|
||||
snprintf(buf, sizeof(buf),
|
||||
@ -4426,7 +4430,7 @@ ndbcluster_show_status_binlog(THD* thd, stat_print_fn *stat_print,
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
else
|
||||
pthread_mutex_unlock(&injector_mutex);
|
||||
mysql_mutex_unlock(&injector_mutex);
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef HA_NDBCLUSTER_BINLOG_INCLUDED
|
||||
#define HA_NDBCLUSTER_BINLOG_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -104,16 +104,24 @@ private:
|
||||
};
|
||||
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
extern PSI_mutex_key key_injector_mutex, key_ndb_schema_share_mutex,
|
||||
key_ndb_schema_object_mutex;
|
||||
extern PSI_cond_key key_injector_cond;
|
||||
extern PSI_thread_key key_thread_ndb_binlog;
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
extern pthread_t ndb_binlog_thread;
|
||||
extern pthread_mutex_t injector_mutex;
|
||||
extern pthread_cond_t injector_cond;
|
||||
extern mysql_mutex_t injector_mutex;
|
||||
extern mysql_cond_t injector_cond;
|
||||
|
||||
extern unsigned char g_node_id_map[max_ndb_nodes];
|
||||
extern pthread_t ndb_util_thread;
|
||||
extern pthread_mutex_t LOCK_ndb_util_thread;
|
||||
extern pthread_cond_t COND_ndb_util_thread;
|
||||
extern mysql_mutex_t LOCK_ndb_util_thread;
|
||||
extern mysql_cond_t COND_ndb_util_thread;
|
||||
extern int ndbcluster_util_inited;
|
||||
extern pthread_mutex_t ndbcluster_mutex;
|
||||
extern mysql_mutex_t ndbcluster_mutex;
|
||||
extern HASH ndbcluster_open_tables;
|
||||
extern Ndb_cluster_connection* g_ndb_cluster_connection;
|
||||
extern long ndb_number_of_storage_nodes;
|
||||
|
@ -500,9 +500,9 @@ int ha_partition::create_handler_files(const char *path,
|
||||
strxmov(name, path, ha_par_ext, NullS);
|
||||
strxmov(old_name, old_path, ha_par_ext, NullS);
|
||||
if ((action_flag == CHF_DELETE_FLAG &&
|
||||
my_delete(name, MYF(MY_WME))) ||
|
||||
mysql_file_delete(key_file_partition, name, MYF(MY_WME))) ||
|
||||
(action_flag == CHF_RENAME_FLAG &&
|
||||
my_rename(old_name, name, MYF(MY_WME))))
|
||||
mysql_file_rename(key_file_partition, old_name, name, MYF(MY_WME))))
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
@ -2205,12 +2205,13 @@ bool ha_partition::create_handler_file(const char *name)
|
||||
to be used at open, delete_table and rename_table
|
||||
*/
|
||||
fn_format(file_name, name, "", ha_par_ext, MY_APPEND_EXT);
|
||||
if ((file= my_create(file_name, CREATE_MODE, O_RDWR | O_TRUNC,
|
||||
if ((file= mysql_file_create(key_file_partition,
|
||||
file_name, CREATE_MODE, O_RDWR | O_TRUNC,
|
||||
MYF(MY_WME))) >= 0)
|
||||
{
|
||||
result= my_write(file, (uchar *) file_buffer, tot_len_byte,
|
||||
result= mysql_file_write(file, (uchar *) file_buffer, tot_len_byte,
|
||||
MYF(MY_WME | MY_NABP)) != 0;
|
||||
(void) my_close(file, MYF(0));
|
||||
(void) mysql_file_close(file, MYF(0));
|
||||
}
|
||||
else
|
||||
result= TRUE;
|
||||
@ -2387,17 +2388,18 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
|
||||
DBUG_RETURN(FALSE);
|
||||
fn_format(buff, name, "", ha_par_ext, MY_APPEND_EXT);
|
||||
|
||||
/* Following could be done with my_stat to read in whole file */
|
||||
if ((file= my_open(buff, O_RDONLY | O_SHARE, MYF(0))) < 0)
|
||||
/* Following could be done with mysql_file_stat to read in whole file */
|
||||
if ((file= mysql_file_open(key_file_partition,
|
||||
buff, O_RDONLY | O_SHARE, MYF(0))) < 0)
|
||||
DBUG_RETURN(TRUE);
|
||||
if (my_read(file, (uchar *) & buff[0], 8, MYF(MY_NABP)))
|
||||
if (mysql_file_read(file, (uchar *) &buff[0], 8, MYF(MY_NABP)))
|
||||
goto err1;
|
||||
len_words= uint4korr(buff);
|
||||
len_bytes= 4 * len_words;
|
||||
if (!(file_buffer= (char*) my_malloc(len_bytes, MYF(0))))
|
||||
goto err1;
|
||||
my_seek(file, 0, MY_SEEK_SET, MYF(0));
|
||||
if (my_read(file, (uchar *) file_buffer, len_bytes, MYF(MY_NABP)))
|
||||
mysql_file_seek(file, 0, MY_SEEK_SET, MYF(0));
|
||||
if (mysql_file_read(file, (uchar *) file_buffer, len_bytes, MYF(MY_NABP)))
|
||||
goto err2;
|
||||
|
||||
chksum= 0;
|
||||
@ -2418,7 +2420,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
|
||||
if (len_words != (tot_partition_words + tot_name_words + 4))
|
||||
goto err3;
|
||||
name_buffer_ptr= file_buffer + 16 + 4 * tot_partition_words;
|
||||
(void) my_close(file, MYF(0));
|
||||
(void) mysql_file_close(file, MYF(0));
|
||||
m_file_buffer= file_buffer; // Will be freed in clear_handler_file()
|
||||
m_name_buffer_ptr= name_buffer_ptr;
|
||||
|
||||
@ -2443,7 +2445,7 @@ err3:
|
||||
err2:
|
||||
my_free(file_buffer, MYF(0));
|
||||
err1:
|
||||
(void) my_close(file, MYF(0));
|
||||
(void) mysql_file_close(file, MYF(0));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
@ -2606,7 +2608,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
|
||||
for the same table.
|
||||
*/
|
||||
if (is_not_tmp_table)
|
||||
pthread_mutex_lock(&table_share->mutex);
|
||||
mysql_mutex_lock(&table_share->mutex);
|
||||
if (!table_share->ha_data)
|
||||
{
|
||||
HA_DATA_PARTITION *ha_data;
|
||||
@ -2617,7 +2619,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
|
||||
if (!ha_data)
|
||||
{
|
||||
if (is_not_tmp_table)
|
||||
pthread_mutex_unlock(&table_share->mutex);
|
||||
mysql_mutex_unlock(&table_share->mutex);
|
||||
goto err_handler;
|
||||
}
|
||||
DBUG_PRINT("info", ("table_share->ha_data 0x%p", ha_data));
|
||||
@ -2626,7 +2628,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
|
||||
pthread_mutex_init(&ha_data->mutex, MY_MUTEX_INIT_FAST);
|
||||
}
|
||||
if (is_not_tmp_table)
|
||||
pthread_mutex_unlock(&table_share->mutex);
|
||||
mysql_mutex_unlock(&table_share->mutex);
|
||||
/*
|
||||
Some handlers update statistics as part of the open call. This will in
|
||||
some cases corrupt the statistics of the partition handler and thus
|
||||
@ -6633,7 +6635,7 @@ int ha_partition::indexes_are_disabled(void)
|
||||
|
||||
#ifdef NOT_USED
|
||||
static HASH partition_open_tables;
|
||||
static pthread_mutex_t partition_mutex;
|
||||
static mysql_mutex_t partition_mutex;
|
||||
static int partition_init= 0;
|
||||
|
||||
|
||||
@ -6671,17 +6673,17 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE *table)
|
||||
if (!partition_init)
|
||||
{
|
||||
/* Hijack a mutex for init'ing the storage engine */
|
||||
pthread_mutex_lock(&LOCK_mysql_create_db);
|
||||
mysql_mutex_lock(&LOCK_mysql_create_db);
|
||||
if (!partition_init)
|
||||
{
|
||||
partition_init++;
|
||||
pthread_mutex_init(&partition_mutex, MY_MUTEX_INIT_FAST);
|
||||
mysql_mutex_init(INSTRUMENT_ME, &partition_mutex, MY_MUTEX_INIT_FAST);
|
||||
(void) hash_init(&partition_open_tables, system_charset_info, 32, 0, 0,
|
||||
(hash_get_key) partition_get_key, 0, 0);
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_mysql_create_db);
|
||||
mysql_mutex_unlock(&LOCK_mysql_create_db);
|
||||
}
|
||||
pthread_mutex_lock(&partition_mutex);
|
||||
mysql_mutex_lock(&partition_mutex);
|
||||
length= (uint) strlen(table_name);
|
||||
|
||||
if (!(share= (PARTITION_SHARE *) hash_search(&partition_open_tables,
|
||||
@ -6692,7 +6694,7 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE *table)
|
||||
&share, (uint) sizeof(*share),
|
||||
&tmp_name, (uint) length + 1, NullS)))
|
||||
{
|
||||
pthread_mutex_unlock(&partition_mutex);
|
||||
mysql_mutex_unlock(&partition_mutex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -6703,15 +6705,15 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE *table)
|
||||
if (my_hash_insert(&partition_open_tables, (uchar *) share))
|
||||
goto error;
|
||||
thr_lock_init(&share->lock);
|
||||
pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST);
|
||||
mysql_mutex_init(INSTRUMENT_ME, &share->mutex, MY_MUTEX_INIT_FAST);
|
||||
}
|
||||
share->use_count++;
|
||||
pthread_mutex_unlock(&partition_mutex);
|
||||
mysql_mutex_unlock(&partition_mutex);
|
||||
|
||||
return share;
|
||||
|
||||
error:
|
||||
pthread_mutex_unlock(&partition_mutex);
|
||||
mysql_mutex_unlock(&partition_mutex);
|
||||
my_free((uchar*) share, MYF(0));
|
||||
|
||||
return NULL;
|
||||
@ -6726,15 +6728,15 @@ error:
|
||||
|
||||
static int free_share(PARTITION_SHARE *share)
|
||||
{
|
||||
pthread_mutex_lock(&partition_mutex);
|
||||
mysql_mutex_lock(&partition_mutex);
|
||||
if (!--share->use_count)
|
||||
{
|
||||
hash_delete(&partition_open_tables, (uchar *) share);
|
||||
thr_lock_delete(&share->lock);
|
||||
pthread_mutex_destroy(&share->mutex);
|
||||
mysql_mutex_destroy(&share->mutex);
|
||||
my_free((uchar*) share, MYF(0));
|
||||
}
|
||||
pthread_mutex_unlock(&partition_mutex);
|
||||
mysql_mutex_unlock(&partition_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user