Commit b3ecd245 authored by unknown's avatar unknown

Merge XtraDB from Percona-Server 5.1.52-11.6 into MariaDB 5.1

revid:oleg.tsarev@percona.com-20101118145125-wjhjrb5jwhi0g7sj
parents b16c3892 b0d3898d
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SELECT SLEEP(0.31);
SELECT SLEEP(0.32);
SELECT SLEEP(0.33);
SELECT SLEEP(0.34);
SELECT SLEEP(0.35);
SELECT SLEEP(0.36);
SELECT SLEEP(0.37);
SELECT SLEEP(0.38);
SELECT SLEEP(0.39);
SELECT SLEEP(0.40);
SELECT SLEEP(1.1);
SELECT SLEEP(1.2);
SELECT SLEEP(1.3);
SELECT SLEEP(1.5);
SELECT SLEEP(1.4);
SELECT SLEEP(0.5);
SELECT SLEEP(2.1);
SELECT SLEEP(2.3);
SELECT SLEEP(2.5);
show variables like 'innodb_buffer_pool_shm%';
Variable_name Value
innodb_buffer_pool_shm_key 123456
show variables like 'innodb_buffer_pool_shm%';
Variable_name Value
innodb_buffer_pool_shm_key 123456
--source include/have_innodb.inc
show variables like 'innodb_buffer_pool_shm%';
#clean shutdown (restart_mysqld.inc is not clean if over 10 sec...)
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait
EOF
shutdown_server 120;
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
restart
EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
show variables like 'innodb_buffer_pool_shm%';
--sleep 1
--system ipcrm -M 123456
SET @old_max_connections = @@max_connections;
SET @old_log_warnings = @@log_warnings;
SET GLOBAL max_connections=2;
SET GLOBAL LOG_WARNINGS = 0;
connect(localhost,root,,test,port,socket);
ERROR HY000: Too many connections
SET GLOBAL LOG_WARNINGS = 1;
connect(localhost,root,,test,port,socket);
ERROR HY000: Too many connections
SET GLOBAL LOG_WARNINGS = 0;
connect(localhost,root,,test,port,socket);
ERROR HY000: Too many connections
SET GLOBAL max_connections = @old_max_connections;
SET GLOBAL log_warnings = @old_log_warnings;
1
--source include/not_embedded.inc
connect (main,localhost,root,,);
connection main;
SET @old_max_connections = @@max_connections;
SET @old_log_warnings = @@log_warnings;
SET GLOBAL max_connections=2;
let $port=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'port'`;
let $socket=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'socket'`;
SET GLOBAL LOG_WARNINGS = 0;
--connect (conn0,localhost,root,,)
connection conn0;
replace_result $port port $socket socket;
--error 1040
--connect(conn1,localhost,root,,)
disconnect conn0;
SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
connection main;
SET GLOBAL LOG_WARNINGS = 1;
--connect (conn1,localhost,root,,)
replace_result $port port $socket socket;
--error 1040
--connect (conn0,localhost,root,,)
disconnect conn1;
SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
connection main;
SET GLOBAL LOG_WARNINGS = 0;
--connect (conn0,localhost,root,,)
replace_result $port port $socket socket;
--error 1040
--connect(conn1,localhost,root,,)
disconnect conn0;
SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
connection main;
SET GLOBAL max_connections = @old_max_connections;
SET GLOBAL log_warnings = @old_log_warnings;
let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!`select LENGTH('$log_error_')`)
{
# MySQL Server on windows is started with --console and thus
# does not know the location of its .err log, use default location
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
}
# Assign env variable LOG_ERROR
let LOG_ERROR=$log_error_;
let cmd=cat $log_error | grep "Too many connections" | wc -l;
exec $cmd;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT);
SELECT * from t;
id
SELECT * from t;
id
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
Warnings:
Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 2
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 10
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
INSERT INTO t VALUES(0);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0
INSERT INTO t VALUES(1);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
3
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 2
FLUSH QUERY_RESPONSE_TIME;
INSERT INTO t VALUES(0);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0
INSERT INTO t VALUES(1);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
3
DROP TABLE IF EXISTS t;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
--source include/master-slave.inc
connection master;
-- disable_warnings
DROP TABLE IF EXISTS t;
-- enable_warnings
CREATE TABLE t(id INT);
SELECT * from t;
sync_slave_with_master;
connection slave;
SELECT * from t;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
connection master;
INSERT INTO t VALUES(0);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
INSERT INTO t VALUES(1);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
sync_slave_with_master;
connection slave;
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
connection master;
INSERT INTO t VALUES(0);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
INSERT INTO t VALUES(1);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
sync_slave_with_master;
connection slave;
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
connection master;
DROP TABLE IF EXISTS t;
sync_slave_with_master;
connection slave;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
source include/have_innodb.inc;
delimiter /;
CREATE FUNCTION test_f()
RETURNS CHAR(30) DETERMINISTIC
BEGIN
DECLARE first VARCHAR(5);
DECLARE second VARCHAR(5);
DECLARE result VARCHAR(20);
SELECT SLEEP(1.11) INTO first;
SET first= 'Hello';
SET second=', ';
SET result= CONCAT(first,second);
SET result= CONCAT(result,'world!');
RETURN result;
END/
delimiter ;/
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
source include/percona_query_response_time_show.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
SELECT test_f();
SELECT test_f();
SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
DROP FUNCTION test_f;
\ No newline at end of file
source include/have_innodb.inc;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
source include/percona_query_response_time_show.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
......@@ -36,12 +36,10 @@ delayed_insert_limit Value
delayed_insert_timeout Value
delayed_queue_size Value
div_precision_increment Value
enable_query_response_time_stats Value
engine_condition_pushdown Value
error_count Value
event_scheduler Value
expire_logs_days Value
fast_index_creation Value
flush Value
flush_time Value
foreign_key_checks Value
......@@ -80,8 +78,6 @@ innodb_additional_mem_pool_size Value
innodb_auto_lru_dump Value
innodb_autoextend_increment Value
innodb_autoinc_lock_mode Value
innodb_buffer_pool_shm_checksum Value
innodb_buffer_pool_shm_key Value
innodb_buffer_pool_size Value
innodb_change_buffering Value
innodb_checkpoint_age_target Value
......@@ -250,7 +246,6 @@ query_cache_strip_comments Value
query_cache_type Value
query_cache_wlock_invalidate Value
query_prealloc_size Value
query_response_time_range_base Value
rand_seed1 Value
rand_seed2 Value
range_alloc_block_size Value
......
-- source include/not_windows.inc
source include/have_innodb.inc;
SELECT sleep(2);
set log_slow_verbosity=innodb;
SELECT sleep(2);
let $MYSQLD_DATADIR= `select @@datadir`;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-log_slow_verbosity.log | grep -c "No InnoDB statistics available for this query";
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
exec echo '$cmd';
exec $cmd;
SELECT sleep(1);
sleep(1)
0
SELECT sleep(6);
sleep(6)
0
SELECT sleep(10);
sleep(10)
0
set long_query_time=8;
SELECT sleep(1);
sleep(1)
0
SELECT sleep(6);
sleep(6)
0
SELECT sleep(12);
sleep(12)
0
cat MYSQLD_DATADIR/percona_slow_query_log-long_query_time.log | grep -c Query_time
3
source include/not_windows.inc;
source include/have_innodb.inc;
SELECT sleep(1);
SELECT sleep(6);
SELECT sleep(10);
set long_query_time=8;
SELECT sleep(1);
SELECT sleep(6);
SELECT sleep(12);
let $MYSQLD_DATADIR= `select @@datadir`;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-long_query_time.log | grep -c Query_time;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
exec echo '$cmd';
exec $cmd;
source include/not_windows.inc;
source include/have_innodb.inc;
SELECT sleep(2);
set global slow_query_log_microseconds_timestamp=ON;
SELECT sleep(2);
set global slow_query_log_microseconds_timestamp=OFF;
let $MYSQLD_DATADIR= `select @@datadir`;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+';
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
exec echo "$cmd";
exec $cmd;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+';
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
exec echo "$cmd";
exec $cmd;
drop table if exists t1;
create table t (a int not null);
insert into t values (1),(2),(3);
SELECT SQL_NO_FCACHE SLEEP(0);
SLEEP(0)
0
SELECT /*!40001 SQL_NO_CACHE */ /*!50084 SQL_NO_FCACHE */ * FROM t;
a
1
2
3
DROP TABLE t;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t (a int not null);
insert into t values (1),(2),(3);
SELECT SQL_NO_FCACHE SLEEP(0);
SELECT /*!40001 SQL_NO_CACHE */ /*!50084 SQL_NO_FCACHE */ * FROM t;
DROP TABLE t;
\ No newline at end of file
--disable_ps_protocol
set global query_cache_strip_comments=ON;
-- source include/percona_query_cache_with_comments_begin.inc
-- source include/percona_query_cache_with_comments.inc
......
......@@ -8,5 +8,5 @@ sleep(2)
0
set global use_global_log_slow_control=none;
set global log_slow_verbosity=microtime;
cat MYSQLD_DATADIR/percona_slow_query_log-control_global_slow.log | grep -c "No InnoDB statistics available for this query"
cat var/mysqld.1/data/percona_slow_query_log-control_global_slow.log | grep "No InnoDB statistics available for this query" | wc -l
1
--source include/not_windows.inc
source include/have_innodb.inc;
SELECT sleep(2);
set global log_slow_verbosity=innodb;
......@@ -7,8 +5,6 @@ set global use_global_log_slow_control="log_slow_verbosity,long_query_time";
SELECT sleep(2);
set global use_global_log_slow_control=none;
set global log_slow_verbosity=microtime;
let $MYSQLD_DATADIR= `select @@datadir`;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-control_global_slow.log | grep -c "No InnoDB statistics available for this query";
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
exec echo '$cmd';
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-control_global_slow.log | grep "No InnoDB statistics available for this query" | wc -l;
echo $cmd;
exec $cmd;
......@@ -21,5 +21,5 @@ SELECT sleep(2);
sleep(2)
0
drop table if exists t;
cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time
cat var/mysqld.1/data/percona_slow_query_log-log_slow_filter.log | grep Query_time | wc -l
2
-- source include/not_windows.inc
source include/have_innodb.inc;
SET GLOBAL SLOW_QUERY_LOG=OFF;
......@@ -28,8 +26,6 @@ SELECT sleep(2);
drop table if exists t;
--enable_warnings
let $MYSQLD_DATADIR= `select @@datadir`;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
exec echo '$cmd';
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-log_slow_filter.log | grep Query_time | wc -l;
echo $cmd;
exec $cmd;
......@@ -5,5 +5,5 @@ set log_slow_verbosity=innodb;
SELECT sleep(2);
sleep(2)
0
cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_verbosity.log | grep -c "No InnoDB statistics available for this query"
cat var/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log | grep "No InnoDB statistics available for this query" | wc -l
1
source include/have_innodb.inc;
SELECT sleep(2);
set log_slow_verbosity=innodb;
SELECT sleep(2);
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log | grep "No InnoDB statistics available for this query" | wc -l;
echo $cmd;
exec $cmd;
--slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=3
--slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=2
\ No newline at end of file
SELECT sleep(1);
sleep(1)
0
SELECT sleep(3);
sleep(3)
0
SELECT sleep(5);
sleep(5)
0
set long_query_time=4;
SELECT sleep(1);
sleep(1)
0
SELECT sleep(3);
sleep(3)
0
SELECT sleep(5);
sleep(5)
0
set long_query_time=2;
cat var/mysqld.1/data/percona_slow_query_log-long_query_time.log | grep Query_time | wc -l
3
source include/have_innodb.inc;
SELECT sleep(1);
SELECT sleep(3);
SELECT sleep(5);
set long_query_time=4;
SELECT sleep(1);
SELECT sleep(3);
SELECT sleep(5);
set long_query_time=2;
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-long_query_time.log | grep Query_time | wc -l;
echo $cmd;
exec $cmd;
......@@ -6,7 +6,7 @@ SELECT sleep(2);
sleep(2)
0
set global slow_query_log_microseconds_timestamp=OFF;
cat MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+'
cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+' | wc -l
1
cat MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+'
cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+' | wc -l
2
source include/have_innodb.inc;
SELECT sleep(2);
set global slow_query_log_microseconds_timestamp=ON;
SELECT sleep(2);
set global slow_query_log_microseconds_timestamp=OFF;
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+' | wc -l;
echo $cmd;
exec $cmd;
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+' | wc -l;
echo $cmd;
exec $cmd;
......@@ -21,5 +21,5 @@ SELECT sleep(2);
sleep(2)
0
drop table if exists t;
cat MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time
cat var/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log | grep Query_time | wc -l
2
source include/not_windows.inc;
source include/have_innodb.inc;
SET GLOBAL SLOW_QUERY_LOG=OFF;
......@@ -27,8 +26,6 @@ SELECT sleep(2);
drop table if exists t;
--enable_warnings
let $MYSQLD_DATADIR= `select @@datadir`;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
exec echo '$cmd';
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log | grep Query_time | wc -l;
echo $cmd;
exec $cmd;
source include/have_innodb.inc;
source include/master-slave.inc;
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
connection master;
-- disable_warnings
......
......@@ -11,8 +11,6 @@ CREATE TABLE t(id INT);
# Start slave replication
START SLAVE;
INSERT INTO t VALUES (1);
# Read information about master binlog
# Sync(1) slave thread
# Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
Variable_name Value
......@@ -22,14 +20,10 @@ show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements ON
INSERT INTO t VALUES (2);
# Read information about master binlog
# Sync slave(2) thread
# Restart slave
STOP SLAVE;
START SLAVE;
INSERT INTO t VALUES (3);
# Read information about master binlog
# Sync(3) slave thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
......@@ -50,8 +44,6 @@ show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time OFF
INSERT INTO t VALUES (4);
# Read information about master binlog
# Sync slave(4) thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
......@@ -72,8 +64,6 @@ show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time ON
INSERT INTO t VALUES (5);
# Read information about master binlog
# Sync slave(5) thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
......@@ -99,5 +89,3 @@ set global use_global_long_query_time=0;
1
set global log_slow_slave_statements=OFF;
DROP TABLE t;
# Read information about master binlog
# Sync slave(6) thread
-- source include/not_windows.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- echo # Activate master-slave replication
-- source include/master-slave.inc
......@@ -21,14 +20,8 @@ START SLAVE;
#-- echo # Make insert(1) on master
connection master;
INSERT INTO t VALUES (1);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync(1) slave thread
sync_slave_with_master;
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON;
......@@ -37,13 +30,8 @@ show variables like 'log_slow_slave_statements';
#-- echo # Make insert(2) on master
connection master;
INSERT INTO t VALUES (2);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(2) thread
sync_slave_with_master;
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Restart slave
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
......@@ -53,13 +41,8 @@ START SLAVE;
#-- echo # Make insert(3) on master
connection master;
INSERT INTO t VALUES (3);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync(3) slave thread
sync_slave_with_master;
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
......@@ -71,13 +54,8 @@ show global variables like 'use_global_long_query_time';
#-- echo # Make insert(4) on master
connection master;
INSERT INTO t VALUES (4);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(4) thread
sync_slave_with_master;
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
......@@ -88,16 +66,9 @@ show global variables like 'use_global_long_query_time';
#-- echo # Make insert(5) on master
connection master;
let $MASTER_DATADIR= `select @@datadir`;
INSERT INTO t VALUES (5);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(5) thread
sync_slave_with_master;
connection slave;
let $SLAVE_DATADIR= `select @@datadir`;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
......@@ -107,7 +78,7 @@ set global use_global_long_query_time=0;
-- echo # Analyse master slow_query_log
let $i=5;
let $k=1;
let $cmd=cat ./$MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep;
let $cmd=cat ./var/mysqld.1/data/percona_log_slow_slave_statements-master.log | grep;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
......@@ -119,7 +90,7 @@ while($i)
-- echo # Analyse slave slow_query_log
let $i=5;
let $k=1;
let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep;
let $cmd=cat ./var/mysqld.2/data/percona_log_slow_slave_statements-slave.log | grep;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
......@@ -132,10 +103,5 @@ set global log_slow_slave_statements=OFF;
connection master;
DROP TABLE t;
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(6) thread
sync_slave_with_master;
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- source include/not_windows.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- echo # Activate master-slave replication
-- source include/master-slave.inc
......@@ -114,7 +113,6 @@ START SLAVE;
#-- echo # Make insert(7) on master
connection master;
let $MASTER_DATADIR= `select @@datadir`;
INSERT INTO t VALUES (7);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
......@@ -122,16 +120,15 @@ let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(7) thread
connection slave;
let $SLAVE_DATADIR= `select @@datadir`;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Analyse master slow_query_log
let $i=7;
let $k=1;
let $cmd=cat $MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep -c;
let $cmd=cat ./var/mysqld.1/data/percona_log_slow_slave_statements-master.log | grep;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
exec $current_cmd;
dec $i;
inc $k;
......@@ -140,10 +137,10 @@ while($i)
-- echo # Analyse slave slow_query_log
let $i=7;
let $k=1;
let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep -c;
let $cmd=cat ./var/mysqld.2/data/percona_log_slow_slave_statements-slave.log | grep;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
exec $current_cmd;
dec $i;
inc $k;
......
--slow-query-log-file=percona_slow_query_log-use_global_long_query_time.log --long-query-time=2
\ No newline at end of file
--slow-query-log-file=percona_slow_query_log-use_global_long_query_time.log --long-query-time=2 --use_global_log_slow_control=long_query_time --use_global_long_query_time=1
\ No newline at end of file
......@@ -20,7 +20,7 @@ sleep(5)
0
set global long_query_time=2;
set global use_global_long_query_time=0;
cat MYSQLD_DATADIR/percona_slow_query_log-use_global_long_query_time.log | grep -c Query_time
cat var/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log | grep Query_time | wc -l
3
show global variables like 'use_global_log_slow_control';
Variable_name Value
......@@ -56,4 +56,4 @@ use_global_log_slow_control log_slow_filter
show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time OFF
set global use_global_log_slow_control = none;
set global use_global_log_slow_control = long_query_time;
source include/not_windows.inc;
source include/have_innodb.inc;
SELECT sleep(1);
......@@ -15,10 +14,8 @@ SELECT sleep(5);
set global long_query_time=2;
set global use_global_long_query_time=0;
let $MYSQLD_DATADIR= `select @@datadir`;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-use_global_long_query_time.log | grep -c Query_time;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
exec echo '$cmd';
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log | grep Query_time | wc -l;
echo $cmd;
exec $cmd;
show global variables like 'use_global_log_slow_control';
......@@ -40,4 +37,4 @@ set global use_global_long_query_time = OFF;
show global variables like 'use_global_log_slow_control';
show global variables like 'use_global_long_query_time';
set global use_global_log_slow_control = none;
set global use_global_log_slow_control = long_query_time;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT);
INSERT INTO t SELECT SLEEP(5);
STOP SLAVE;
select count(*) from t;
count(*)
0
SHOW SLAVE STATUS NOLOCK;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
host user port 1 master-bin.000001 276 slave-relay-bin.000003 422 master-bin.000001 No No 0 0 276 577 None 0 No NULL No 0 0
select count(*) from t;
count(*)
0
START SLAVE;
Warnings:
Note 1592 Statement may not be safe to log in statement format.
DROP TABLE t;
--source include/master-slave.inc
connection master;
-- disable_warnings
DROP TABLE IF EXISTS t;
-- enable_warnings
CREATE TABLE t(id INT);
sync_slave_with_master;
connection master;
send INSERT INTO t SELECT SLEEP(5);
sleep 1;
connection slave;
send STOP SLAVE;
connection slave1;
select count(*) from t;
replace_column 2 host 3 user 4 port;
SHOW SLAVE STATUS NOLOCK;
select count(*) from t;
connection slave;
reap;
--source include/wait_for_slave_to_stop.inc
START SLAVE;
--source include/wait_for_slave_to_start.inc
connection master;
reap;
DROP TABLE t;
sync_slave_with_master;
2010-10-11 The InnoDB Team
* row/row0sel.c
Fix Bug #57345 btr_pcur_store_position abort for load with
concurrent lock/unlock tables
2010-10-06 The InnoDB Team
* row/row0mysql.c, innodb_bug57255.result, innodb_bug57255.test
Fix Bug #Cascade Delete results in "Got error -1 from storage engine"
2010-09-27 The InnoDB Team
* row/row0sel.c, innodb_bug56716.result, innodb_bug56716.test:
Fix Bug #56716 InnoDB locks a record gap without locking the table
2010-09-06 The InnoDB Team
* dict/dict0load.c, innodb_bug53756.test innodb_bug53756.result
Fix Bug #53756 ALTER TABLE ADD PRIMARY KEY affects crash recovery
2010-08-24 The InnoDB Team
* handler/ha_innodb.c, dict/dict0dict.c:
......@@ -27,7 +45,6 @@
* handler/ha_innodb.cc
Fix Bug #55382 Assignment with SELECT expressions takes unexpected
S locks in READ COMMITTED
>>>>>>> MERGE-SOURCE
2010-07-27 The InnoDB Team
......
......@@ -1925,7 +1925,6 @@ btr_page_split_and_insert(
buf_block_t* left_block;
buf_block_t* right_block;
buf_block_t* insert_block;
page_t* insert_page;
page_cur_t* page_cursor;
rec_t* first_rec;
byte* buf = 0; /* remove warning */
......@@ -2183,8 +2182,6 @@ insert_empty:
insert_block = right_block;
}
insert_page = buf_block_get_frame(insert_block);
/* 7. Reposition the cursor for insert and try insertion */
page_cursor = btr_cur_get_page_cur(cursor);
......@@ -2196,8 +2193,12 @@ insert_empty:
#ifdef UNIV_ZIP_DEBUG
{
page_t* insert_page
= buf_block_get_frame(insert_block);
page_zip_des_t* insert_page_zip
= buf_block_get_page_zip(insert_block);
ut_a(!insert_page_zip
|| page_zip_validate(insert_page_zip, insert_page));
}
......@@ -2590,7 +2591,6 @@ btr_compress(
ulint n_recs;
ulint max_ins_size;
ulint max_ins_size_reorg;
ulint level;
block = btr_cur_get_block(cursor);
page = btr_cur_get_page(cursor);
......@@ -2600,7 +2600,6 @@ btr_compress(
ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
level = btr_page_get_level(page, mtr);
space = dict_index_get_space(index);
zip_size = dict_table_zip_size(index->table);
......
......@@ -2013,7 +2013,6 @@ btr_cur_optimistic_update(
page_t* page;
page_zip_des_t* page_zip;
rec_t* rec;
rec_t* orig_rec;
ulint max_size;
ulint new_rec_size;
ulint old_rec_size;
......@@ -2027,7 +2026,7 @@ btr_cur_optimistic_update(
block = btr_cur_get_block(cursor);
page = buf_block_get_frame(block);
orig_rec = rec = btr_cur_get_rec(cursor);
rec = btr_cur_get_rec(cursor);
index = cursor->index;
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
......@@ -4673,12 +4672,17 @@ btr_free_externally_stored_field(
}
for (;;) {
#ifdef UNIV_SYNC_DEBUG
buf_block_t* rec_block;
#endif /* UNIV_SYNC_DEBUG */
buf_block_t* ext_block;
mtr_start(&mtr);
rec_block = buf_page_get(page_get_space_id(
#ifdef UNIV_SYNC_DEBUG
rec_block =
#endif /* UNIV_SYNC_DEBUG */
buf_page_get(page_get_space_id(
page_align(field_ref)),
rec_zip_size,
page_get_page_no(
......
......@@ -467,7 +467,6 @@ btr_pcur_move_backward_from_page(
mtr_t* mtr) /*!< in: mtr */
{
ulint prev_page_no;
ulint space;
page_t* page;
buf_block_t* prev_block;
ulint latch_mode;
......@@ -503,7 +502,6 @@ btr_pcur_move_backward_from_page(
page = btr_pcur_get_page(cursor);
prev_page_no = btr_page_get_prev(page, mtr);
space = buf_block_get_space(btr_pcur_get_block(cursor));
if (prev_page_no == FIL_NULL) {
} else if (btr_pcur_is_before_first_on_page(cursor)) {
......
......@@ -1620,7 +1620,6 @@ btr_search_update_hash_on_delete(
rec_t* rec;
ulint fold;
dulint index_id;
ibool found;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
mem_heap_t* heap = NULL;
rec_offs_init(offsets_);
......@@ -1653,7 +1652,7 @@ btr_search_update_hash_on_delete(
}
rw_lock_x_lock(&btr_search_latch);
found = ha_search_and_delete_if_found(table, fold, rec);
ha_search_and_delete_if_found(table, fold, rec);
rw_lock_x_unlock(&btr_search_latch);
}
......
This diff is collapsed.
......@@ -129,11 +129,16 @@ buf_flush_delete_from_flush_rbt(
buf_page_t* bpage) /*!< in: bpage to be removed. */
{
#ifdef UNIV_DEBUG
ibool ret = FALSE;
#endif /* UNIV_DEBUG */
//ut_ad(buf_pool_mutex_own());
ut_ad(mutex_own(&flush_list_mutex));
ret = rbt_delete(buf_pool->flush_rbt, &bpage);
#ifdef UNIV_DEBUG
ret =
#endif /* UNIV_DEBUG */
rbt_delete(buf_pool->flush_rbt, &bpage);
ut_ad(ret);
}
......@@ -1303,7 +1308,6 @@ buf_flush_batch(
buf_page_t* bpage;
buf_page_t* prev_bpage = NULL;
ulint page_count = 0;
ulint old_page_count;
ulint space;
ulint offset;
ulint remaining = 0;
......@@ -1396,15 +1400,9 @@ flush_next:
mutex_exit(&LRU_list_mutex);
}
old_page_count = page_count;
/* Try to flush also all the neighbors */
page_count += buf_flush_try_neighbors(
space, offset, flush_type, srv_flush_neighbor_pages);
/* fprintf(stderr,
"Flush type %lu, page no %lu, neighb %lu\n",
flush_type, offset,
page_count - old_page_count); */
//buf_pool_mutex_enter();
if (flush_type == BUF_FLUSH_LRU) {
......
......@@ -693,7 +693,6 @@ dict_create_index_tree_step(
{
dict_index_t* index;
dict_table_t* sys_indexes;
dict_table_t* table;
dtuple_t* search_tuple;
ulint zip_size;
btr_pcur_t pcur;
......@@ -702,7 +701,6 @@ dict_create_index_tree_step(
ut_ad(mutex_own(&(dict_sys->mutex)));
index = node->index;
table = node->table;
sys_indexes = dict_sys->sys_indexes;
......
......@@ -4791,7 +4791,6 @@ dict_index_print_low(
{
ib_int64_t n_vals;
ulint i;
const char* type_string;
ut_ad(mutex_own(&(dict_sys->mutex)));
......@@ -4806,14 +4805,6 @@ dict_index_print_low(
dict_index_stat_mutex_exit(index);
if (dict_index_is_clust(index)) {
type_string = "clustered index";
} else if (dict_index_is_unique(index)) {
type_string = "unique index";
} else {
type_string = "secondary index";
}
fprintf(stderr,
" INDEX: name %s, id %lu %lu, fields %lu/%lu,"
" uniq %lu, type %lu\n"
......
......@@ -384,18 +384,13 @@ eval_notfound(
/*==========*/
func_node_t* func_node) /*!< in: function node */
{
que_node_t* arg1;
que_node_t* arg2;
sym_node_t* cursor;
sel_node_t* sel_node;
ibool ibool_val;
arg1 = func_node->args;
arg2 = que_node_get_next(arg1);
ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);
cursor = arg1;
cursor = func_node->args;
ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL);
......
......@@ -127,70 +127,6 @@ hash_create(
return(table);
}
/*************************************************************//**
*/
UNIV_INTERN
ulint
hash_create_needed(
/*===============*/
ulint n)
{
ulint prime;
ulint offset;
prime = ut_find_prime(n);
offset = (sizeof(hash_table_t) + 7) / 8;
offset *= 8;
return(offset + sizeof(hash_cell_t) * prime);
}
UNIV_INTERN
void
hash_create_init(
/*=============*/
hash_table_t* table,
ulint n)
{
ulint prime;
ulint offset;
prime = ut_find_prime(n);
offset = (sizeof(hash_table_t) + 7) / 8;
offset *= 8;
table->array = (hash_cell_t*)(((byte*)table) + offset);
table->n_cells = prime;
# if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
table->adaptive = FALSE;
# endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
table->n_mutexes = 0;
table->mutexes = NULL;
table->heaps = NULL;
table->heap = NULL;
ut_d(table->magic_n = HASH_TABLE_MAGIC_N);
/* Initialize the cell array */
hash_table_clear(table);
}
UNIV_INTERN
void
hash_create_reuse(
/*==============*/
hash_table_t* table)
{
ulint offset;
offset = (sizeof(hash_table_t) + 7) / 8;
offset *= 8;
table->array = (hash_cell_t*)(((byte*)table) + offset);
ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
}
/*************************************************************//**
Frees a hash table. */
UNIV_INTERN
......
......@@ -194,7 +194,6 @@ static my_bool innobase_rollback_on_timeout = FALSE;
static my_bool innobase_create_status_file = FALSE;
static my_bool innobase_stats_on_metadata = TRUE;
static my_bool innobase_use_sys_stats_table = FALSE;
static my_bool innobase_buffer_pool_shm_checksum = TRUE;
static char* internal_innobase_data_file_path = NULL;
......@@ -2427,7 +2426,6 @@ innobase_change_buffering_inited_ok:
srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
srv_use_checksums = (ibool) innobase_use_checksums;
srv_fast_checksum = (ibool) innobase_fast_checksum;
srv_buffer_pool_shm_checksum = (ibool) innobase_buffer_pool_shm_checksum;
#ifdef HAVE_LARGE_PAGES
if ((os_use_large_pages = (ibool) my_use_large_pages))
......@@ -7418,7 +7416,6 @@ innobase_drop_database(
ulint len = 0;
trx_t* trx;
char* ptr;
int error;
char* namebuf;
THD* thd = current_thd;
......@@ -7461,7 +7458,7 @@ innobase_drop_database(
#else
trx = innobase_trx_allocate(thd);
#endif
error = row_drop_database_for_mysql(namebuf, trx);
row_drop_database_for_mysql(namebuf, trx);
my_free(namebuf, MYF(0));
/* Flush the log to reduce probability that the .frm files and
......@@ -9330,12 +9327,9 @@ innodb_show_status(
mutex_exit(&srv_monitor_file_mutex);
bool result = FALSE;
stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
STRING_WITH_LEN(""), str, flen);
if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
STRING_WITH_LEN(""), str, flen)) {
result= TRUE;
}
my_free(str, MYF(0));
DBUG_RETURN(FALSE);
......@@ -11383,16 +11377,6 @@ static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L);
static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, srv_buffer_pool_shm_key,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"[experimental] The key value of shared memory segment for the buffer pool. 0 (default) disables the feature.",
NULL, NULL, 0, 0, INT_MAX32, 0);
static MYSQL_SYSVAR_BOOL(buffer_pool_shm_checksum, innobase_buffer_pool_shm_checksum,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Enable buffer_pool_shm checksum validation (enabled by default).",
NULL, NULL, TRUE);
static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
PLUGIN_VAR_RQCMDARG,
"Helps in performance tuning in heavily concurrent environments.",
......@@ -11658,8 +11642,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(additional_mem_pool_size),
MYSQL_SYSVAR(autoextend_increment),
MYSQL_SYSVAR(buffer_pool_size),
MYSQL_SYSVAR(buffer_pool_shm_key),
MYSQL_SYSVAR(buffer_pool_shm_checksum),
MYSQL_SYSVAR(checksums),
MYSQL_SYSVAR(fast_checksum),
MYSQL_SYSVAR(commit_concurrency),
......
......@@ -1876,6 +1876,7 @@ trx_i_s_common_fill_table(
deadlock occurs between the mysqld server and mysql client,
see http://bugs.mysql.com/29900 ; when that bug is resolved
we can enable the DBUG_RETURN(ret) above */
ret++; // silence a gcc46 warning
DBUG_RETURN(0);
#endif
}
......
......@@ -47,6 +47,5 @@ struct innodb_enhancement {
{"innodb_fast_checksum","Using the checksum on 32bit-unit calculation","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_files_extend","allow >4GB transaction log files, and can vary universal page size of datafiles","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_sys_tables_sys_indexes","Expose InnoDB SYS_TABLES and SYS_INDEXES schema tables","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_buffer_pool_shm","Put buffer pool contents to shared memory segment and reuse it at clean restart [experimental]","","http://www.percona.com/docs/wiki/percona-xtradb"},
{NULL, NULL, NULL, NULL}
};
......@@ -36,7 +36,6 @@ Created 11/5/1995 Heikki Tuuri
#include "ut0rbt.h"
#ifndef UNIV_HOTBACKUP
#include "os0proc.h"
#include "srv0srv.h"
/** @name Modes for buf_page_get_gen */
/* @{ */
......@@ -1302,10 +1301,7 @@ struct buf_block_struct{
/**********************************************************************//**
Compute the hash fold value for blocks in buf_pool->zip_hash. */
/* @{ */
/* the fold should be relative when srv_buffer_pool_shm_key is enabled */
#define BUF_POOL_ZIP_FOLD_PTR(ptr) (!srv_buffer_pool_shm_key\
?((ulint) (ptr) / UNIV_PAGE_SIZE)\
:((ulint) ((byte*)ptr - (byte*)(buf_pool->chunks->blocks->frame)) / UNIV_PAGE_SIZE))
#define BUF_POOL_ZIP_FOLD_PTR(ptr) ((ulint) (ptr) / UNIV_PAGE_SIZE)
#define BUF_POOL_ZIP_FOLD(b) BUF_POOL_ZIP_FOLD_PTR((b)->frame)
#define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b))
/* @} */
......
......@@ -49,28 +49,6 @@ hash_table_t*
hash_create(
/*========*/
ulint n); /*!< in: number of array cells */
/*************************************************************//**
*/
UNIV_INTERN
ulint
hash_create_needed(
/*===============*/
ulint n);
UNIV_INTERN
void
hash_create_init(
/*=============*/
hash_table_t* table,
ulint n);
UNIV_INTERN
void
hash_create_reuse(
/*==============*/
hash_table_t* table);
#ifndef UNIV_HOTBACKUP
/*************************************************************//**
Creates a mutex array to protect a hash table. */
......@@ -350,33 +328,6 @@ do {\
}\
} while (0)
/********************************************************************//**
Align nodes with moving location.*/
#define HASH_OFFSET(TABLE, NODE_TYPE, PTR_NAME, FADDR, FOFFSET, BOFFSET) \
do {\
ulint i2222;\
ulint cell_count2222;\
\
cell_count2222 = hash_get_n_cells(TABLE);\
\
for (i2222 = 0; i2222 < cell_count2222; i2222++) {\
NODE_TYPE* node2222;\
\
if ((TABLE)->array[i2222].node) \
(TABLE)->array[i2222].node = (void*)((byte*)(TABLE)->array[i2222].node \
+ (((TABLE)->array[i2222].node > (void*)FADDR)?FOFFSET:BOFFSET));\
node2222 = HASH_GET_FIRST((TABLE), i2222);\
\
while (node2222) {\
if (node2222->PTR_NAME) \
node2222->PTR_NAME = (void*)((byte*)(node2222->PTR_NAME) \
+ ((((void*)node2222->PTR_NAME) > (void*)FADDR)?FOFFSET:BOFFSET));\
\
node2222 = node2222->PTR_NAME;\
}\
}\
} while (0)
/************************************************************//**
Gets the mutex index for a fold value in a hash table.
@return mutex number */
......
......@@ -32,11 +32,6 @@ Created 9/30/1995 Heikki Tuuri
#ifdef UNIV_LINUX
#include <sys/ipc.h>
#include <sys/shm.h>
#else
# if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
#include <sys/ipc.h>
#include <sys/shm.h>
# endif
#endif
typedef void* os_process_t;
......@@ -75,29 +70,6 @@ os_mem_free_large(
ulint size); /*!< in: size returned by
os_mem_alloc_large() */
/****************************************************************//**
Allocates or attaches and reuses shared memory segment.
The content is not cleared automatically.
@return allocated memory */
UNIV_INTERN
void*
os_shm_alloc(
/*=========*/
ulint* n, /*!< in/out: number of bytes */
uint key,
ibool* is_new);
/****************************************************************//**
Detach shared memory segment. */
UNIV_INTERN
void
os_shm_free(
/*========*/
void *ptr, /*!< in: pointer returned by
os_shm_alloc() */
ulint size); /*!< in: size returned by
os_shm_alloc() */
#ifndef UNIV_NONINL
#include "os0proc.ic"
#endif
......
......@@ -330,7 +330,7 @@ amount of increment. */
Returns the old value of *ptr, atomically sets *ptr to new_val */
# define os_atomic_test_and_set_byte(ptr, new_val) \
__sync_lock_test_and_set(ptr, new_val)
__sync_lock_test_and_set(ptr, (byte) new_val)
#elif defined(HAVE_IB_SOLARIS_ATOMICS)
......
......@@ -159,10 +159,6 @@ extern ulint srv_buf_pool_curr_size; /*!< current size in bytes */
extern ulint srv_mem_pool_size;
extern ulint srv_lock_table_size;
extern uint srv_buffer_pool_shm_key;
extern ibool srv_buffer_pool_shm_is_reused;
extern ibool srv_buffer_pool_shm_checksum;
extern ibool srv_thread_concurrency_timer_based;
extern ulint srv_n_file_io_threads;
......
......@@ -46,8 +46,8 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 1
#define INNODB_VERSION_MINOR 0
#define INNODB_VERSION_BUGFIX 12
#define PERCONA_INNODB_VERSION 12.1
#define INNODB_VERSION_BUGFIX 13
#define PERCONA_INNODB_VERSION 11.6
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
......
......@@ -257,48 +257,5 @@ do { \
ut_a(ut_list_node_313 == NULL); \
} while (0)
/********************************************************************//**
Align nodes with moving location.
@param NAME the name of the list
@param TYPE node type
@param BASE base node (not a pointer to it)
@param OFFSET offset moved */
#define UT_LIST_OFFSET(NAME, TYPE, BASE, FADDR, FOFFSET, BOFFSET) \
do { \
ulint ut_list_i_313; \
TYPE* ut_list_node_313; \
\
if ((BASE).start) \
(BASE).start = (void*)((byte*)((BASE).start) \
+ (((void*)((BASE).start) > (void*)FADDR)?FOFFSET:BOFFSET));\
if ((BASE).end) \
(BASE).end = (void*)((byte*)((BASE).end) \
+ (((void*)((BASE).end) > (void*)FADDR)?FOFFSET:BOFFSET));\
\
ut_list_node_313 = (BASE).start; \
\
for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) { \
ut_a(ut_list_node_313); \
if ((ut_list_node_313->NAME).prev) \
(ut_list_node_313->NAME).prev = (void*)((byte*)((ut_list_node_313->NAME).prev)\
+ (((void*)((ut_list_node_313->NAME).prev) > (void*)FADDR)?FOFFSET:BOFFSET));\
if ((ut_list_node_313->NAME).next) \
(ut_list_node_313->NAME).next = (void*)((byte*)((ut_list_node_313->NAME).next)\
+ (((void*)((ut_list_node_313->NAME).next)> (void*)FADDR)?FOFFSET:BOFFSET));\
ut_list_node_313 = (ut_list_node_313->NAME).next; \
} \
\
ut_a(ut_list_node_313 == NULL); \
\
ut_list_node_313 = (BASE).end; \
\
for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) { \
ut_a(ut_list_node_313); \
ut_list_node_313 = (ut_list_node_313->NAME).prev; \
} \
\
ut_a(ut_list_node_313 == NULL); \
} while (0)
#endif
......@@ -85,9 +85,6 @@ ut_rnd_gen_ulint(void)
/*==================*/
{
ulint rnd;
ulint n_bits;
n_bits = 8 * sizeof(ulint);
ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
......
......@@ -567,10 +567,8 @@ recv_synchronize_groups(
ib_uint64_t start_lsn;
ib_uint64_t end_lsn;
ib_uint64_t recovered_lsn;
ib_uint64_t limit_lsn;
recovered_lsn = recv_sys->recovered_lsn;
limit_lsn = recv_sys->limit_lsn;
/* Read the last recovered log block to the recovery system buffer:
the block is always incomplete */
......@@ -2901,7 +2899,6 @@ recv_init_crash_recovery(void)
/*==========================*/
{
ut_a(!recv_needed_recovery);
ut_a(!srv_buffer_pool_shm_is_reused);
recv_needed_recovery = TRUE;
......@@ -2964,7 +2961,9 @@ recv_recovery_from_checkpoint_start_func(
ib_uint64_t old_scanned_lsn;
ib_uint64_t group_scanned_lsn;
ib_uint64_t contiguous_lsn;
#ifdef UNIV_LOG_ARCHIVE
ib_uint64_t archived_lsn;
#endif /* UNIV_LOG_ARCHIVE */
byte* buf;
byte* log_hdr_buf;
byte log_hdr_buf_base[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE];
......@@ -3022,7 +3021,9 @@ recv_recovery_from_checkpoint_start_func(
checkpoint_lsn = mach_read_ull(buf + LOG_CHECKPOINT_LSN);
checkpoint_no = mach_read_ull(buf + LOG_CHECKPOINT_NO);
#ifdef UNIV_LOG_ARCHIVE
archived_lsn = mach_read_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN);
#endif /* UNIV_LOG_ARCHIVE */
/* Read the first log file header to print a note if this is
a recovery from a restored InnoDB Hot Backup */
......
......@@ -1407,8 +1407,6 @@ try_again:
int create_flag;
ibool retry;
const char* mode_str = NULL;
const char* type_str = NULL;
const char* purpose_str = NULL;
try_again:
ut_a(name);
......@@ -1428,26 +1426,9 @@ try_again:
ut_error;
}
if (type == OS_LOG_FILE) {
type_str = "LOG";
} else if (type == OS_DATA_FILE) {
type_str = "DATA";
} else {
ut_error;
}
ut_a(type == OS_LOG_FILE || type == OS_DATA_FILE);
ut_a(purpose == OS_FILE_AIO || purpose == OS_FILE_NORMAL);
if (purpose == OS_FILE_AIO) {
purpose_str = "AIO";
} else if (purpose == OS_FILE_NORMAL) {
purpose_str = "NORMAL";
} else {
ut_error;
}
#if 0
fprintf(stderr, "Opening file %s, mode %s, type %s, purpose %s\n",
name, mode_str, type_str, purpose_str);
#endif
#ifdef O_SYNC
/* We let O_SYNC only affect log files; note that we map O_DSYNC to
O_SYNC because the datasync options seemed to corrupt files in 2001
......
......@@ -229,173 +229,3 @@ os_mem_free_large(
}
#endif
}
/****************************************************************//**
Allocates or attaches and reuses shared memory segment.
The content is not cleared automatically.
@return allocated memory */
UNIV_INTERN
void*
os_shm_alloc(
/*=========*/
ulint* n, /*!< in/out: number of bytes */
uint key,
ibool* is_new)
{
void* ptr;
#if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
ulint size;
int shmid;
*is_new = FALSE;
fprintf(stderr,
"InnoDB: The shared memory segment containing the buffer pool is: key %#x (%d).\n",
key, key);
# if defined HAVE_LARGE_PAGES && defined UNIV_LINUX
if (!os_use_large_pages || !os_large_page_size) {
goto skip;
}
/* Align block size to os_large_page_size */
ut_ad(ut_is_2pow(os_large_page_size));
size = ut_2pow_round(*n + (os_large_page_size - 1),
os_large_page_size);
shmid = shmget((key_t)key, (size_t)size,
IPC_CREAT | IPC_EXCL | SHM_HUGETLB | SHM_R | SHM_W);
if (shmid < 0) {
if (errno == EEXIST) {
fprintf(stderr,
"InnoDB: HugeTLB: The shared memory segment exists.\n");
shmid = shmget((key_t)key, (size_t)size,
SHM_HUGETLB | SHM_R | SHM_W);
if (shmid < 0) {
fprintf(stderr,
"InnoDB: HugeTLB: Warning: Failed to allocate %lu bytes. (reuse) errno %d\n",
size, errno);
goto skip;
} else {
fprintf(stderr,
"InnoDB: HugeTLB: The existent shared memory segment is used.\n");
}
} else {
fprintf(stderr,
"InnoDB: HugeTLB: Warning: Failed to allocate %lu bytes. (new) errno %d\n",
size, errno);
goto skip;
}
} else {
*is_new = TRUE;
fprintf(stderr,
"InnoDB: HugeTLB: A new shared memory segment has been created .\n");
}
ptr = shmat(shmid, NULL, 0);
if (ptr == (void *)-1) {
fprintf(stderr,
"InnoDB: HugeTLB: Warning: Failed to attach shared memory segment, errno %d\n",
errno);
ptr = NULL;
}
if (ptr) {
*n = size;
os_fast_mutex_lock(&ut_list_mutex);
ut_total_allocated_memory += size;
os_fast_mutex_unlock(&ut_list_mutex);
UNIV_MEM_ALLOC(ptr, size);
return(ptr);
}
skip:
*is_new = FALSE;
# endif /* HAVE_LARGE_PAGES && defined UNIV_LINUX */
# ifdef HAVE_GETPAGESIZE
size = getpagesize();
# else
size = UNIV_PAGE_SIZE;
# endif
/* Align block size to system page size */
ut_ad(ut_is_2pow(size));
size = *n = ut_2pow_round(*n + (size - 1), size);
shmid = shmget((key_t)key, (size_t)size,
IPC_CREAT | IPC_EXCL | SHM_R | SHM_W);
if (shmid < 0) {
if (errno == EEXIST) {
fprintf(stderr,
"InnoDB: A shared memory segment containing the buffer pool seems to already exist.\n");
shmid = shmget((key_t)key, (size_t)size,
SHM_R | SHM_W);
if (shmid < 0) {
fprintf(stderr,
"InnoDB: Warning: Failed to allocate %lu bytes. (reuse) errno %d\n",
size, errno);
ptr = NULL;
goto end;
} else {
fprintf(stderr,
"InnoDB: The existent shared memory segment is used.\n");
}
} else {
fprintf(stderr,
"InnoDB: Warning: Failed to allocate %lu bytes. (new) errno %d\n",
size, errno);
ptr = NULL;
goto end;
}
} else {
*is_new = TRUE;
fprintf(stderr,
"InnoDB: A new shared memory segment has been created.\n");
}
ptr = shmat(shmid, NULL, 0);
if (ptr == (void *)-1) {
fprintf(stderr,
"InnoDB: Warning: Failed to attach shared memory segment, errno %d\n",
errno);
ptr = NULL;
}
if (ptr) {
*n = size;
os_fast_mutex_lock(&ut_list_mutex);
ut_total_allocated_memory += size;
os_fast_mutex_unlock(&ut_list_mutex);
UNIV_MEM_ALLOC(ptr, size);
}
end:
#else /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
fprintf(stderr, "InnoDB: shared memory segment is not supported.\n");
ptr = NULL;
#endif /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
return(ptr);
}
/****************************************************************//**
Detach shared memory segment. */
UNIV_INTERN
void
os_shm_free(
/*========*/
void *ptr, /*!< in: pointer returned by
os_shm_alloc() */
ulint size) /*!< in: size returned by
os_shm_alloc() */
{
os_fast_mutex_lock(&ut_list_mutex);
ut_a(ut_total_allocated_memory >= size);
os_fast_mutex_unlock(&ut_list_mutex);
#if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
if (!shmdt(ptr)) {
os_fast_mutex_lock(&ut_list_mutex);
ut_a(ut_total_allocated_memory >= size);
ut_total_allocated_memory -= size;
os_fast_mutex_unlock(&ut_list_mutex);
UNIV_MEM_FREE(ptr, size);
}
#else /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
fprintf(stderr, "InnoDB: shared memory segment is not supported.\n");
#endif /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
}
......@@ -1298,18 +1298,13 @@ que_run_threads_low(
que_thr_t* thr) /*!< in: query thread */
{
que_thr_t* next_thr;
ulint cumul_resource;
ulint loop_count;
ut_ad(thr->state == QUE_THR_RUNNING);
ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS);
ut_ad(!mutex_own(&kernel_mutex));
/* cumul_resource counts how much resources the OS thread (NOT the
query thread) has spent in this function */
loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
cumul_resource = 0;
loop:
/* Check that there is enough space in the log to accommodate
possible log entries by this query step; if the operation can touch
......
......@@ -1444,7 +1444,12 @@ run_again:
srv_n_rows_updated++;
}
row_update_statistics_if_needed(prebuilt->table);
/* We update table statistics only if it is a DELETE or UPDATE
that changes indexed columns, UPDATEs that change only non-indexed
columns would not affect statistics. */
if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
row_update_statistics_if_needed(prebuilt->table);
}
trx->op_info = "";
......@@ -1599,6 +1604,9 @@ row_update_cascade_for_mysql(
trx = thr_get_trx(thr);
/* Increment fk_cascade_depth to record the recursive call depth on
a single update/delete that affects multiple tables chained
together with foreign key relations. */
thr->fk_cascade_depth++;
if (thr->fk_cascade_depth > FK_MAX_CASCADE_DEL) {
......@@ -1610,6 +1618,12 @@ run_again:
row_upd_step(thr);
/* The recursive call for cascading update/delete happens
in above row_upd_step(), reset the counter once we come
out of the recursive call, so it does not accumulate for
different row deletes */
thr->fk_cascade_depth = 0;
err = trx->error_state;
/* Note that the cascade node is a subnode of another InnoDB
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment