Commit 9661d1ef authored by Alexander Nozdrin's avatar Alexander Nozdrin

Auto-merge from mysql-trunk.

parents 5f359837 9ad6cb15
......@@ -151,7 +151,7 @@ IF(UNIX)
ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
IF(CMAKE_SIZEOF_VOIDP EQUAL 4)
IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
# Solaris x86
SET(CMAKE_C_FLAGS_RELWITHDEBINFO
"-g -xO2 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
......@@ -165,7 +165,7 @@ IF(UNIX)
"-g0 -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
ENDIF()
ELSE()
IF(CMAKE_SIZEOF_VOIDP EQUAL 4)
IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
# Solaris sparc 32 bit
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -xO3 -Xa -xstrconst -mt -xarch=sparc")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g0 -xO3 -noex -mt -xarch=sparc")
......
......@@ -56,7 +56,7 @@ ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501")
ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN")
# Adjust compiler and linker flags
IF(MINGW AND CMAKE_SIZEOF_VOIDP EQUAL 4)
IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4)
# mininal architecture flags, i486 enables GCC atomics
ADD_DEFINITIONS(-march=i486)
ENDIF()
......
This diff is collapsed.
......@@ -21,7 +21,9 @@
# This file is public domain and comes with NO WARRANTY of any kind
target = libmysqlclient_r.la
target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
target_defs = -DDISABLE_MYSQL_PRLOCK_H -DDONT_USE_RAID \
-DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
......
This diff is collapsed.
......@@ -503,3 +503,19 @@ f1 f2-f3
5 0
DROP TABLE t1;
End of 5.0 tests
Bug#50888 valgrind warnings in Field_timestamp::val_str
SET TIMESTAMP=0;
CREATE TABLE t1(a timestamp);
INSERT INTO t1 VALUES ('2008-02-23 09:23:45'), ('2010-03-05 11:08:02');
FLUSH TABLES t1;
SELECT MAX(a) FROM t1;
MAX(a)
2010-03-05 11:08:02
SELECT a FROM t1;
a
2008-02-23 09:23:45
2010-03-05 11:08:02
DROP TABLE t1;
End of Bug#50888
......@@ -25,9 +25,10 @@ wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES
wait/synch/rwlock/sql/LOCK_sys_init_connect YES YES
wait/synch/rwlock/sql/LOCK_sys_init_slave YES YES
wait/synch/rwlock/sql/LOGGER::LOCK_logger YES YES
wait/synch/rwlock/sql/MDL_context::waiting_for_lock YES YES
wait/synch/rwlock/sql/MDL_lock::rwlock YES YES
wait/synch/rwlock/sql/Query_cache_query::lock YES YES
wait/synch/rwlock/sql/THR_LOCK_servers YES YES
wait/synch/rwlock/sql/THR_LOCK_udf YES YES
select * from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/Cond/sql/%'
and name not in (
......
drop table if exists test.user_table;
drop procedure if exists test.user_proc;
drop function if exists test.user_func;
drop event if exists test.user_event;
"Testing mysql_upgrade with TABLE performance_schema.user_table"
create table test.user_table(a int);
use performance_schema;
show tables like "user_table";
Tables_in_performance_schema (user_table)
user_table
ERROR 1644 (HY000) at line 178: Unexpected content found in the performance_schema database.
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists
FATAL ERROR: Upgrade failed
show tables like "user_table";
Tables_in_performance_schema (user_table)
user_table
use test;
drop table test.user_table;
"Testing mysql_upgrade with VIEW performance_schema.user_view"
create view test.user_view as select "Not supposed to be here";
use performance_schema;
show tables like "user_view";
Tables_in_performance_schema (user_view)
user_view
ERROR 1644 (HY000) at line 178: Unexpected content found in the performance_schema database.
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists
FATAL ERROR: Upgrade failed
show tables like "user_view";
Tables_in_performance_schema (user_view)
user_view
use test;
drop view test.user_view;
"Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
create procedure test.user_proc()
select "Not supposed to be here";
update mysql.proc set db='performance_schema' where name='user_proc';
ERROR 1644 (HY000) at line 178: Unexpected content found in the performance_schema database.
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
user_proc
update mysql.proc set db='test' where name='user_proc';
drop procedure test.user_proc;
"Testing mysql_upgrade with FUNCTION performance_schema.user_func"
create function test.user_func() returns integer
return 0;
update mysql.proc set db='performance_schema' where name='user_func';
ERROR 1644 (HY000) at line 178: Unexpected content found in the performance_schema database.
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
user_func
update mysql.proc set db='test' where name='user_func';
drop function test.user_func;
"Testing mysql_upgrade with EVENT performance_schema.user_event"
create event test.user_event on schedule every 1 day do
select "not supposed to be here";
update mysql.event set db='performance_schema' where name='user_event';
ERROR 1644 (HY000) at line 178: Unexpected content found in the performance_schema database.
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists
FATAL ERROR: Upgrade failed
select name from mysql.event where db='performance_schema';
name
user_event
update mysql.event set db='test' where name='user_event';
drop event test.user_event;
# Copyright (C) 2010 Oracle and/or its affiliates. All rights reserved.
#
# 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
# Tests for PERFORMANCE_SCHEMA
# Make sure mysql_upgrade does not destroy data in a 'performance_schema'
# database.
#
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/have_lowercase0.inc
--disable_warnings
drop table if exists test.user_table;
drop procedure if exists test.user_proc;
drop function if exists test.user_func;
drop event if exists test.user_event;
--enable_warnings
--echo "Testing mysql_upgrade with TABLE performance_schema.user_table"
create table test.user_table(a int);
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm
# Make sure the table is visible
use performance_schema;
show tables like "user_table";
--error 1
--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
# Verify that mysql_upgrade complained about the performance_schema
--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
# Make sure the table is still visible
show tables like "user_table";
use test;
--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
drop table test.user_table;
--echo "Testing mysql_upgrade with VIEW performance_schema.user_view"
create view test.user_view as select "Not supposed to be here";
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm
# Make sure the view is visible
use performance_schema;
show tables like "user_view";
--error 1
--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
# Verify that mysql_upgrade complained about the performance_schema
--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
# Make sure the view is still visible
show tables like "user_view";
use test;
--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
drop view test.user_view;
--echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
create procedure test.user_proc()
select "Not supposed to be here";
update mysql.proc set db='performance_schema' where name='user_proc';
--error 1
--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
# Verify that mysql_upgrade complained about the performance_schema
--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
select name from mysql.proc where db='performance_schema';
update mysql.proc set db='test' where name='user_proc';
drop procedure test.user_proc;
--echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func"
create function test.user_func() returns integer
return 0;
update mysql.proc set db='performance_schema' where name='user_func';
--error 1
--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
# Verify that mysql_upgrade complained about the performance_schema
--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
select name from mysql.proc where db='performance_schema';
update mysql.proc set db='test' where name='user_func';
drop function test.user_func;
--echo "Testing mysql_upgrade with EVENT performance_schema.user_event"
create event test.user_event on schedule every 1 day do
select "not supposed to be here";
update mysql.event set db='performance_schema' where name='user_event';
--error 1
--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
# Verify that mysql_upgrade complained about the performance_schema
--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
select name from mysql.event where db='performance_schema';
update mysql.event set db='test' where name='user_event';
drop event test.user_event;
--remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out
--remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
......@@ -346,3 +346,17 @@ SELECT f1,f2-f3 FROM t1;
DROP TABLE t1;
--echo End of 5.0 tests
--echo
--echo Bug#50888 valgrind warnings in Field_timestamp::val_str
--echo
SET TIMESTAMP=0;
CREATE TABLE t1(a timestamp);
INSERT INTO t1 VALUES ('2008-02-23 09:23:45'), ('2010-03-05 11:08:02');
FLUSH TABLES t1;
SELECT MAX(a) FROM t1;
SELECT a FROM t1;
DROP TABLE t1;
--echo End of Bug#50888
# Copyright (C) 2005-2006 MySQL AB
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
......@@ -24,5 +24,10 @@ EXTRA_DIST = fulltext/configure.in
SUBDIRS = @mysql_pg_dirs@
DIST_SUBDIRS = @mysql_pg_distdirs@
# As of 5.5.3-m3, we want to include the plugin files of a debug build in the package
install-exec-hook:
$(mkinstalldirs) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(pkglibdir)/plugin
test ! -d debug || $(TAR) cf - debug | ( cd $(DESTDIR)$(pkglibdir) && $(TAR) xvf - )
# Don't update the files from bitkeeper
%::SCCS/s.%
-- Copyright (C) 2008-2009 Sun Microsystems, Inc
-- Copyright (C) 2008, 2010 Oracle and/or its affiliates. All rights reserved.
--
-- 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
......@@ -100,18 +100,92 @@ CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_b
CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
--
-- PERFORMANCE SCHEMA INSTALLATION
-- Note that this script is also reused by mysql_upgrade,
-- so we have to be very careful here to not destroy any
-- existing database named 'performance_schema' if it
-- can contain user data.
-- In case of downgrade, it's ok to drop unknown tables
-- from a future version, as long as they belong to the
-- performance schema engine.
--
set @have_old_pfs= (select count(*) from information_schema.schemata where schema_name='performance_schema');
SET @l1="SET @broken_tables = (select count(*) from information_schema.tables";
SET @l2=" where engine != \'PERFORMANCE_SCHEMA\' and table_schema=\'performance_schema\')";
SET @cmd=concat(@l1,@l2);
-- Work around for bug#49542
SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_tables = 0');
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
SET @l1="SET @broken_views = (select count(*) from information_schema.views";
SET @l2=" where table_schema='performance_schema')";
SET @cmd=concat(@l1,@l2);
-- Work around for bug#49542
SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_views = 0');
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
SET @broken_routines = (select count(*) from mysql.proc where db='performance_schema');
SET @broken_events = (select count(*) from mysql.event where db='performance_schema');
SET @broken_pfs= (select @broken_tables + @broken_views + @broken_routines + @broken_events);
--
-- The performance schema database.
-- This database is always created, even in --without-perfschema builds,
-- Only drop and create the database if this is safe (no broken_pfs).
-- This database is created, even in --without-perfschema builds,
-- so that the database name is always reserved by the MySQL implementation.
--
set @have_pfs= (select count(engine) from information_schema.engines where engine='PERFORMANCE_SCHEMA' and support != 'NO');
SET @cmd= "DROP DATABASE IF EXISTS performance_schema";
SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
DROP DATABASE IF EXISTS performance_schema;
SET @cmd= "CREATE DATABASE performance_schema character set utf8";
CREATE DATABASE performance_schema character set utf8;
SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
--
-- Unlike 'performance_schema', the 'mysql' database is reserved already,
-- so no user procedure is supposed to be there
--
drop procedure if exists mysql.die;
create procedure mysql.die() signal sqlstate 'HY000' set message_text='Unexpected content found in the performance_schema database.';
--
-- For broken upgrades, SIGNAL the error
--
SET @cmd="call mysql.die()";
SET @str = IF(@broken_pfs > 0, @cmd, 'SET @dummy = 0');
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
drop procedure mysql.die;
--
-- From this point, only create the performance schema tables
-- if the server is build with performance schema
--
set @have_pfs= (select count(engine) from information_schema.engines where engine='PERFORMANCE_SCHEMA' and support != 'NO');
--
-- TABLE COND_INSTANCES
......
......@@ -54,6 +54,8 @@ Usage: $0 [OPTIONS]
--mysqld=FILE Use the specified file as mysqld
--mysqld-version=VERSION Use "mysqld-VERSION" as mysqld
--nice=NICE Set the scheduling priority of mysqld
--plugin-dir=DIR Plugins are under DIR or DIR/VERSION, if
VERSION is given
--skip-kill-mysqld Don't try to kill stray mysqld processes
--syslog Log messages to syslog with 'logger'
--skip-syslog Log messages to error log (default)
......@@ -172,6 +174,7 @@ parse_arguments() {
--basedir=*) MY_BASEDIR_VERSION="$val" ;;
--datadir=*) DATADIR="$val" ;;
--pid-file=*) pid_file="$val" ;;
--plugin-dir=*) PLUGIN_DIR="$val" ;;
--user=*) user="$val"; SET_USER=1 ;;
# these might have been set in a [mysqld_safe] section of my.cnf
......@@ -189,6 +192,7 @@ parse_arguments() {
if test -n "$val"
then
MYSQLD="mysqld-$val"
PLUGIN_VARIANT="/$val"
else
MYSQLD="mysqld"
fi
......@@ -695,8 +699,10 @@ fi
cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"
plugin_dir="${PLUGIN_DIR:-@PLUGINDIR@}${PLUGIN_VARIANT}"
for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
"--datadir=$DATADIR" "$USER_OPTION"
"--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION"
do
cmd="$cmd "`shell_quote_string "$i"`
done
......
......@@ -3122,14 +3122,16 @@ protected:
bool value_cached;
public:
Item_cache():
example(0), used_table_map(0), cached_field(0), cached_field_type(MYSQL_TYPE_STRING),
example(0), used_table_map(0), cached_field(0),
cached_field_type(MYSQL_TYPE_STRING),
value_cached(0)
{
fixed= 1;
null_value= 1;
}
Item_cache(enum_field_types field_type_arg):
example(0), used_table_map(0), cached_field(0), cached_field_type(field_type_arg),
example(0), used_table_map(0), cached_field(0),
cached_field_type(field_type_arg),
value_cached(0)
{
fixed= 1;
......@@ -3233,10 +3235,9 @@ class Item_cache_str: public Item_cache
public:
Item_cache_str(const Item *item) :
Item_cache(), value(0),
Item_cache(item->field_type()), value(0),
is_varbinary(item->type() == FIELD_ITEM &&
((const Item_field *) item)->field->type() ==
MYSQL_TYPE_VARCHAR &&
cached_field_type == MYSQL_TYPE_VARCHAR &&
!((const Item_field *) item)->field->has_charset())
{}
double val_real();
......
This diff is collapsed.
......@@ -628,7 +628,7 @@ private:
important as deadlock detector won't work correctly
otherwise. @sa Comment for MDL_lock::m_rwlock.
*/
rw_pr_lock_t m_waiting_for_lock;
mysql_prlock_t m_waiting_for_lock;
MDL_ticket *m_waiting_for;
uint m_deadlock_weight;
/**
......@@ -652,9 +652,9 @@ private:
void will_wait_for(MDL_ticket *pending_ticket)
{
rw_pr_wrlock(&m_waiting_for_lock);
mysql_prlock_wrlock(&m_waiting_for_lock);
m_waiting_for= pending_ticket;
rw_pr_unlock(&m_waiting_for_lock);
mysql_prlock_unlock(&m_waiting_for_lock);
}
void set_deadlock_weight(uint weight)
......@@ -670,9 +670,9 @@ private:
void stop_waiting()
{
rw_pr_wrlock(&m_waiting_for_lock);
mysql_prlock_wrlock(&m_waiting_for_lock);
m_waiting_for= NULL;
rw_pr_unlock(&m_waiting_for_lock);
mysql_prlock_unlock(&m_waiting_for_lock);
}
void wait_reset()
......
......@@ -196,7 +196,7 @@ ENDIF()
# Removing compiler optimizations for innodb/mem/* files on 64-bit Windows
# due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297
IF (MSVC AND CMAKE_SIZEOF_VOIDP EQUAL 8)
IF (MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c
PROPERTIES COMPILE_FLAGS -Od)
ENDIF()
......
......@@ -746,6 +746,26 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
}
}
char safe_buffer[FN_REFLEN];
const char *safe_filename;
if (len >= FN_REFLEN)
{
/*
The instrumented code uses file names that exceeds FN_REFLEN.
This could be legal for instrumentation on non mysys APIs,
so we support it.
Truncate the file name so that:
- it fits into pfs->m_filename
- it is safe to use mysys apis to normalize the file name.
*/
memcpy(safe_buffer, filename, FN_REFLEN - 2);
safe_buffer[FN_REFLEN - 1]= 0;
safe_filename= safe_buffer;
}
else
safe_filename= filename;
/*
Normalize the file name to avoid duplicates when using aliases:
- absolute or relative paths
......@@ -759,7 +779,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
Ignore errors, the file may not exist.
my_realpath always provide a best effort result in buffer.
*/
(void) my_realpath(buffer, filename, MYF(0));
(void) my_realpath(buffer, safe_filename, MYF(0));
normalized_filename= buffer;
normalized_length= strlen(normalized_filename);
......
......@@ -37,14 +37,25 @@ PFS_file* lookup_file_by_name(const char* name)
uint i;
PFS_file *pfs;
uint len= strlen(name);
size_t dirlen;
const char *filename;
uint filename_length;;
for (i= 0; i < file_max; i++)
{
pfs= & file_array[i];
if (pfs->m_lock.is_populated())
{
if ((len == pfs->m_filename_length) &&
(strncmp(name, pfs->m_filename, pfs->m_filename_length) == 0))
/*
When a file "foo" is instrumented, the name is normalized
to "/path/to/current/directory/foo", so we remove the
directory name here to find it back.
*/
dirlen= dirname_length(pfs->m_filename);
filename= pfs->m_filename + dirlen;
filename_length= pfs->m_filename_length - dirlen;
if ((len == filename_length) &&
(strncmp(name, filename, filename_length) == 0))
return pfs;
}
}
......
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