Commit 3a2574f4 authored by Bjorn Munch's avatar Bjorn Munch

merge from mysql-trunk

parents 0cdedb0d 0b74a911
......@@ -27,8 +27,7 @@ extern char * mysql_unix_port;
CLIENT_TRANSACTIONS | \
CLIENT_PROTOCOL_41 | \
CLIENT_SECURE_CONNECTION | \
CLIENT_MULTI_RESULTS | \
CLIENT_PS_MULTI_RESULTS)
CLIENT_MULTI_RESULTS)
sig_handler my_pipe_sig_handler(int sig);
void read_user_name(char *name);
......
......@@ -104,3 +104,4 @@ EXPORTS
mysql_stmt_attr_get
mysql_stmt_attr_set
mysql_stmt_field_count
mysql_stmt_next_result
......@@ -12,7 +12,6 @@ main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_m
main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically
main.plugin # Bug#47146 Linking problem with example plugin when dtrace enabled
main.plugin_load # Bug#47146
rpl.rpl_get_master_version_and_clock* # Bug#49191 2009-12-01 Daogang rpl_get_master_version_and_clock failed on PB2: COM_REGISTER_SLAVE failed
rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically
......
# include file for checking if variable key_reads is zero
let $key_reads= query_get_value(SHOW STATUS LIKE 'key_reads',Value,1);
--disable_query_log
eval SELECT IF($key_reads = 0, "Yes!", "No!") as 'Zero key reads?';
FLUSH STATUS;
--enable_query_log
# include file for checking if variable key_reads = key_read_requests
let $key_reads= query_get_value(SHOW STATUS LIKE 'key_reads',Value,1);
let $key_r_req= query_get_value(SHOW STATUS LIKE 'key_read_requests',Value,1);
let $key_writes= query_get_value(SHOW STATUS LIKE 'key_writes',Value,1);
let $key_w_req= query_get_value(SHOW STATUS LIKE 'key_write_requests',Value,1);
--disable_query_log
eval SELECT IF($key_reads = $key_r_req, "reads == requests", "reads != requests") as 'reads vs requests';
eval SELECT IF($key_writes = $key_w_req, "writes == requests", "writes != requests") as 'writes vs requests';
--enable_query_log
......@@ -1851,17 +1851,19 @@ sub environment_setup {
}
else
{
$semisync_master_filename = "libsemisync_master.so";
$semisync_slave_filename = "libsemisync_slave.so";
$semisync_master_filename = "semisync_master.so";
$semisync_slave_filename = "semisync_slave.so";
}
my $lib_semisync_master_plugin=
mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_master_filename),
"$basedir/plugin/semisync/.libs/" . $semisync_master_filename,
"$basedir/lib/mysql/plugin/" . $semisync_master_filename);
"$basedir/lib/mysql/plugin/" . $semisync_master_filename,
"$basedir/lib/plugin/" . $semisync_master_filename);
my $lib_semisync_slave_plugin=
mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_slave_filename),
"$basedir/plugin/semisync/.libs/" . $semisync_slave_filename,
"$basedir/lib/mysql/plugin/" . $semisync_slave_filename);
"$basedir/lib/mysql/plugin/" . $semisync_slave_filename,
"$basedir/lib/plugin/" . $semisync_slave_filename);
if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin)
{
$ENV{'SEMISYNC_MASTER_PLUGIN'}= basename($lib_semisync_master_plugin);
......
......@@ -52,9 +52,9 @@ joined DATE NOT NULL
)
PARTITION BY KEY(joined)
PARTITIONS 6;
ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
Got one of the listed errors
ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2;
ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
Got one of the listed errors
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (
......@@ -71,7 +71,7 @@ PARTITION p2 VALUES LESS THAN (1980),
PARTITION p3 VALUES LESS THAN (1990),
PARTITION p4 VALUES LESS THAN MAXVALUE
);
ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
Got one of the listed errors
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (id INT, purchased DATE)
......@@ -82,7 +82,7 @@ PARTITION p0 VALUES LESS THAN (1990),
PARTITION p1 VALUES LESS THAN (2000),
PARTITION p2 VALUES LESS THAN MAXVALUE
);
ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
Got one of the listed errors
drop table t1;
ERROR 42S02: Unknown table 't1'
create table t1 (a varchar(10) charset latin1 collate latin1_bin);
......
......@@ -9,6 +9,30 @@ partition by range columns (a,b,c)
( partition p0 values less than (1, maxvalue, 10),
partition p1 values less than (1, maxvalue, maxvalue));
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
create table t1 (a varchar(5) character set ucs2 collate ucs2_bin)
partition by range columns (a)
(partition p0 values less than (0x0041));
insert into t1 values (0x00410000);
select hex(a) from t1 where a like 'A_';
hex(a)
00410000
explain partitions select hex(a) from t1 where a like 'A_';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
alter table t1 remove partitioning;
select hex(a) from t1 where a like 'A_';
hex(a)
00410000
create index a on t1 (a);
select hex(a) from t1 where a like 'A_';
hex(a)
00410000
insert into t1 values ('A_');
select hex(a) from t1;
hex(a)
00410000
0041005F
drop table t1;
create table t1 (a varchar(1) character set latin1 collate latin1_general_ci)
partition by range columns(a)
( partition p0 values less than ('a'),
......@@ -69,7 +93,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMNS(a)
/*!50500 PARTITION BY LIST COLUMNS(a)
(PARTITION p0 VALUES IN ('''') ENGINE = MyISAM,
PARTITION p1 VALUES IN ('\\') ENGINE = MyISAM,
PARTITION p2 VALUES IN ('\0') ENGINE = MyISAM) */
......@@ -128,7 +152,7 @@ t1 CREATE TABLE `t1` (
`c` varchar(25) DEFAULT NULL,
`d` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE COLUMNS(a,b,c,d)
/*!50500 PARTITION BY RANGE COLUMNS(a,b,c,d)
SUBPARTITION BY HASH (to_seconds(d))
SUBPARTITIONS 4
(PARTITION p0 VALUES LESS THAN (1,'0',MAXVALUE,'1900-01-01') ENGINE = MyISAM,
......@@ -211,7 +235,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMNS(a,b)
/*!50500 PARTITION BY LIST COLUMNS(a,b)
(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
......@@ -245,7 +269,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMNS(a,b)
/*!50500 PARTITION BY LIST COLUMNS(a,b)
(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
......@@ -299,7 +323,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMNS(a)
/*!50500 PARTITION BY LIST COLUMNS(a)
(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
insert into t1 values (1);
......@@ -314,7 +338,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMNS(a)
/*!50500 PARTITION BY LIST COLUMNS(a)
(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
drop table t1;
......@@ -349,7 +373,7 @@ t1 CREATE TABLE `t1` (
`c` varchar(5) DEFAULT NULL,
`d` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE COLUMNS(a,b,c)
/*!50500 PARTITION BY RANGE COLUMNS(a,b,c)
SUBPARTITION BY KEY (c,d)
SUBPARTITIONS 3
(PARTITION p0 VALUES LESS THAN (1,'abc','abc') ENGINE = MyISAM,
......@@ -382,7 +406,7 @@ t1 CREATE TABLE `t1` (
`b` varchar(2) DEFAULT NULL,
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE COLUMNS(a,b,c)
/*!50500 PARTITION BY RANGE COLUMNS(a,b,c)
(PARTITION p0 VALUES LESS THAN (1,'A',1) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (1,'B',1) ENGINE = MyISAM) */
insert into t1 values (1, 'A', 1);
......
This diff is collapsed.
drop table if exists t1, t2;
create table t1 (a int)
partition by range (a)
subpartition by hash(to_seconds(a))
(partition p0 values less than (1));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50500 PARTITION BY RANGE (a)
SUBPARTITION BY HASH (to_seconds(a))
(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM) */
drop table t1;
create table t1 (a int)
partition by range (a)
( partition p0 values less than (NULL),
partition p1 values less than (MAXVALUE));
ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
......@@ -30,6 +43,14 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions select * from t1 where a < '2007-03-07 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50500 PARTITION BY RANGE (TO_SECONDS(a))
(PARTITION p0 VALUES LESS THAN (63340531200) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (63342604800) ENGINE = MyISAM) */
drop table t1;
create table t1 (a date)
partition by range(to_seconds(a))
......@@ -53,6 +74,14 @@ select * from t1 where a <= '2005-01-01';
a
2003-12-30
2004-12-31
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50500 PARTITION BY RANGE (to_seconds(a))
(PARTITION p0 VALUES LESS THAN (63240134400) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (63271756800) ENGINE = MyISAM) */
drop table t1;
create table t1 (a datetime)
partition by range(to_seconds(a))
......@@ -75,6 +104,14 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
select * from t1 where a <= '2005-01-01';
a
2004-01-01 11:59:29
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50500 PARTITION BY RANGE (to_seconds(a))
(PARTITION p0 VALUES LESS THAN (63240177600) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (63271800000) ENGINE = MyISAM) */
drop table t1;
create table t1 (a int, b char(20))
partition by range columns(a,b)
......
......@@ -7,7 +7,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMNS(a)
/*!50500 PARTITION BY LIST COLUMNS(a)
(PARTITION p0 VALUES IN (_cp1250 0x81) ENGINE = MyISAM) */
drop table t1;
create table t1 (a varchar(2) character set cp1250)
......@@ -18,7 +18,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMNS(a)
/*!50500 PARTITION BY LIST COLUMNS(a)
(PARTITION p0 VALUES IN ('€') ENGINE = MyISAM) */
drop table t1;
create table t1 (a varchar(1500), b varchar(1570))
......@@ -45,7 +45,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMNS(a)
/*!50500 PARTITION BY LIST COLUMNS(a)
(PARTITION p0 VALUES IN ('†') ENGINE = MyISAM,
PARTITION p1 VALUES IN ('') ENGINE = MyISAM) */
insert into t1 values ('');
......
......@@ -125,3 +125,11 @@ CREATE TABLE t1 (s1 char(10) character set utf8 collate utf8_maxuserid_ci);
INSERT INTO t1 VALUES ('a'),('b');
SELECT * FROM t1 WHERE s1='a' ORDER BY BINARY s1;
DROP TABLE t1;
#
# Bug#47756 Setting 2byte collation ID with 'set names' crashes the server
#
SET NAMES utf8 COLLATE utf8_test_ci;
SHOW COLLATION LIKE 'utf8_test_ci';
SET NAMES utf8;
......@@ -13,3 +13,4 @@ kill : Bug#37780 2008-12-03 HHunger need some changes to be
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadicallyr
innodb-autoinc : Bug#49267 2009-12-02 test fails on windows because of different case mode
innodb : Bug#49396 2009-12-03 test fails in embedded mode
plugin_load : Bug#42144 2009-12-21 alik plugin_load fails
......@@ -626,9 +626,11 @@ let $wait_condition=
--source include/wait_condition.inc
let $tlwb= `show status like 'Table_locks_waited'`;
unlock tables;
connection waiter;
--reap
connection default;
drop table t1;
disconnect waiter;
connection default;
--disable_query_log
eval SET @tlwa= SUBSTRING_INDEX('$tlwa', ' ', -1);
eval SET @tlwb= SUBSTRING_INDEX('$tlwb', ' ', -1);
......
......@@ -31,7 +31,7 @@ ALTER TABLE t1 ENGINE Memory;
ALTER TABLE t1 ADD (new INT);
DROP TABLE t1;
--error ER_FEATURE_DISABLED
--error ER_FEATURE_DISABLED,ER_OPTION_PREVENTS_STATEMENT
CREATE TABLE t1 (
firstname VARCHAR(25) NOT NULL,
lastname VARCHAR(25) NOT NULL,
......@@ -42,13 +42,13 @@ CREATE TABLE t1 (
PARTITION BY KEY(joined)
PARTITIONS 6;
--error ER_FEATURE_DISABLED
--error ER_FEATURE_DISABLED,ER_OPTION_PREVENTS_STATEMENT
ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2;
--error ER_BAD_TABLE_ERROR
drop table t1;
--error ER_FEATURE_DISABLED
--error ER_FEATURE_DISABLED,ER_OPTION_PREVENTS_STATEMENT
CREATE TABLE t1 (
firstname VARCHAR(25) NOT NULL,
lastname VARCHAR(25) NOT NULL,
......@@ -66,7 +66,7 @@ PARTITION BY RANGE( YEAR(joined) ) (
--error ER_BAD_TABLE_ERROR
drop table t1;
--error ER_FEATURE_DISABLED
--error ER_FEATURE_DISABLED,ER_OPTION_PREVENTS_STATEMENT
CREATE TABLE t1 (id INT, purchased DATE)
PARTITION BY RANGE( YEAR(purchased) )
SUBPARTITION BY HASH( TO_DAYS(purchased) )
......
......@@ -23,6 +23,23 @@ partition by range columns (a,b,c)
( partition p0 values less than (1, maxvalue, 10),
partition p1 values less than (1, maxvalue, maxvalue));
#
# BUG#48737, Search fails with ucs2
#
create table t1 (a varchar(5) character set ucs2 collate ucs2_bin)
partition by range columns (a)
(partition p0 values less than (0x0041));
insert into t1 values (0x00410000);
select hex(a) from t1 where a like 'A_';
explain partitions select hex(a) from t1 where a like 'A_';
alter table t1 remove partitioning;
select hex(a) from t1 where a like 'A_';
create index a on t1 (a);
select hex(a) from t1 where a like 'A_';
insert into t1 values ('A_');
select hex(a) from t1;
drop table t1;
#
# BUG#48161, Delivering too few records using collate syntax with partitions
#
......
This diff is collapsed.
......@@ -9,6 +9,16 @@
drop table if exists t1, t2;
--enable_warnings
#
#BUG#49591, Add proper version number to SHOW CREATE TABLE
#
create table t1 (a int)
partition by range (a)
subpartition by hash(to_seconds(a))
(partition p0 values less than (1));
show create table t1;
drop table t1;
--error ER_NULL_IN_VALUES_LESS_THAN
create table t1 (a int)
partition by range (a)
......@@ -30,6 +40,7 @@ explain partitions select * from t1 where a < '2007-03-08 00:00:01';
explain partitions select * from t1 where a <= '2007-03-08 00:00:00';
explain partitions select * from t1 where a <= '2007-03-07 23:59:59';
explain partitions select * from t1 where a < '2007-03-07 23:59:59';
show create table t1;
drop table t1;
#
# New test cases for new function to_seconds
......@@ -44,6 +55,7 @@ explain partitions select * from t1 where a <= '2003-12-31';
select * from t1 where a <= '2003-12-31';
explain partitions select * from t1 where a <= '2005-01-01';
select * from t1 where a <= '2005-01-01';
show create table t1;
drop table t1;
create table t1 (a datetime)
......@@ -56,6 +68,7 @@ explain partitions select * from t1 where a <= '2004-01-01 11:59.59';
select * from t1 where a <= '2004-01-01 11:59:59';
explain partitions select * from t1 where a <= '2005-01-01';
select * from t1 where a <= '2005-01-01';
show create table t1;
drop table t1;
#
......
......@@ -256,6 +256,9 @@ static int add_collation(CHARSET_INFO *cs)
{
#if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS)
copy_uca_collation(newcs, &my_charset_utf8_unicode_ci);
newcs->ctype= my_charset_utf8_unicode_ci.ctype;
if (init_state_maps(newcs))
return MY_XML_ERROR;
#endif
}
else
......
......@@ -15,9 +15,6 @@
# This is CMakeLists.txt for semi-sync replication plugins
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql
......
......@@ -23,16 +23,16 @@ INCLUDES = -I$(top_srcdir)/include \
noinst_HEADERS = semisync.h semisync_master.h semisync_slave.h
pkgplugin_LTLIBRARIES = libsemisync_master.la libsemisync_slave.la
pkgplugin_LTLIBRARIES = semisync_master.la semisync_slave.la
libsemisync_master_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
libsemisync_master_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_master_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_master_la_SOURCES = semisync.cc semisync_master.cc semisync_master_plugin.cc
semisync_master_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
semisync_master_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
semisync_master_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
semisync_master_la_SOURCES = semisync.cc semisync_master.cc semisync_master_plugin.cc
libsemisync_slave_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
libsemisync_slave_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_slave_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_slave_la_SOURCES = semisync.cc semisync_slave.cc semisync_slave_plugin.cc
semisync_slave_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
semisync_slave_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
semisync_slave_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
semisync_slave_la_SOURCES = semisync.cc semisync_slave.cc semisync_slave_plugin.cc
EXTRA_DIST= CMakeLists.txt plug.in
MYSQL_PLUGIN(semisync,[Semi-synchronous Replication Plugin],
[Semi-synchronous replication plugin.])
MYSQL_PLUGIN_DYNAMIC(semisync, [libsemisync_master.la libsemisync_slave.la])
MYSQL_PLUGIN_DYNAMIC(semisync, [semisync_master.la semisync_slave.la])
......@@ -290,6 +290,11 @@ if [ -d storage/innodb_plugin ]; then
cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \
$DESTDIR/lib/plugin/
fi
if [ -d plugin/semisync ]; then
cp plugin/semisync/$TARGET/semisync_master.dll \
plugin/semisync/$TARGET/semisync_slave.dll \
$DESTDIR/lib/plugin/
fi
if [ x"$TARGET" != x"release" ] ; then
cp libmysql/$TARGET/libmysql.pdb \
......@@ -302,6 +307,11 @@ if [ x"$TARGET" != x"release" ] ; then
cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \
$DESTDIR/lib/plugin/
fi
if [ -d plugin/semisync ]; then
cp plugin/semisync/$TARGET/semisync_master.pdb \
plugin/semisync/$TARGET/semisync_slave.pdb \
$DESTDIR/lib/plugin/
fi
fi
......@@ -328,6 +338,15 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \
storage/innodb_plugin/debug/ha_innodb_plugin.pdb \
$DESTDIR/lib/plugin/debug/
fi
if [ -d plugin/semisync ]; then
cp plugin/semisync/debug/semisync_master.dll \
plugin/semisync/debug/semisync_master.lib \
plugin/semisync/debug/semisync_master.pdb \
plugin/semisync/debug/semisync_slave.dll \
plugin/semisync/debug/semisync_slave.lib \
plugin/semisync/debug/semisync_slave.pdb \
$DESTDIR/lib/plugin/debug/
fi
fi
# ----------------------------------------------------------------------
......
......@@ -894,6 +894,15 @@ public:
(*traverser)(this, arg);
}
/*
This is used to get the most recent version of any function in
an item tree. The version is the version where a MySQL function
was introduced in. So any function which is added should use
this function and set the int_arg to maximum of the input data
and their own version info.
*/
virtual bool intro_version(uchar *int_arg) { return 0; }
virtual bool remove_dependence_processor(uchar * arg) { return 0; }
virtual bool remove_fixed(uchar * arg) { fixed= 0; return 0; }
virtual bool cleanup_processor(uchar *arg);
......
......@@ -91,6 +91,15 @@ public:
enum_monotonicity_info get_monotonicity_info() const;
longlong val_int_endpoint(bool left_endp, bool *incl_endp);
bool check_partition_func_processor(uchar *bool_arg) { return FALSE;}
bool intro_version(uchar *int_arg)
{
int *input_version= (int*)int_arg;
/* This function was introduced in 5.5 */
int output_version= (*input_version, 50500);
*input_version= output_version;
return 0;
}
};
......
......@@ -115,6 +115,42 @@ char *partition_info::create_default_partition_names(uint part_no,
}
/*
Generate a version string for partition expression
This function must be updated every time there is a possibility for
a new function of a higher version number than 5.5.0.
SYNOPSIS
set_show_version_string()
RETURN VALUES
None
*/
void partition_info::set_show_version_string(String *packet)
{
int version= 0;
if (column_list)
packet->append(STRING_WITH_LEN("\n/*!50500"));
else
{
if (part_expr)
part_expr->walk(&Item::intro_version, 0, (uchar*)&version);
if (subpart_expr)
subpart_expr->walk(&Item::intro_version, 0, (uchar*)&version);
if (version == 0)
{
/* No new functions in partition function */
packet->append(STRING_WITH_LEN("\n/*!50100"));
}
else
{
char buf[65];
char *buf_ptr= longlong10_to_str((longlong)version, buf, 10);
packet->append(STRING_WITH_LEN("\n/*!"));
packet->append(buf, (size_t)(buf_ptr - buf));
}
}
}
/*
Create a unique name for the subpartition as part_name'sp''subpart_no'
SYNOPSIS
......
......@@ -302,6 +302,7 @@ public:
bool check_partition_field_length();
bool init_column_part();
bool add_column_list_value(THD *thd, Item *item);
void set_show_version_string(String *packet);
private:
static int list_part_cmp(const void* a, const void* b);
bool set_up_default_partitions(handler *file, HA_CREATE_INFO *info,
......
......@@ -411,8 +411,8 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
thd->variables.character_set_results,
err, strlen(err),
system_charset_info, &error);
length= (uint) (strmake((char*) pos, (char*)converted_err, MYSQL_ERRMSG_SIZE) -
(char*) buff);
length= (uint) (strmake((char*) pos, (char*)converted_err,
MYSQL_ERRMSG_SIZE - 1) - (char*) buff);
err= (char*) buff;
DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) err,
length));
......
......@@ -1497,7 +1497,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
show_table_options,
NULL, NULL))))
{
packet->append(STRING_WITH_LEN("\n/*!50100"));
table->part_info->set_show_version_string(packet);
packet->append(part_syntax, part_syntax_len);
packet->append(STRING_WITH_LEN(" */"));
my_free(part_syntax, MYF(0));
......
......@@ -77,9 +77,12 @@ libarchive_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
ha_archive_la_LIBADD = probes_sh_mysql.o
ha_archive_la_DEPENDENCIES = probes_sh_mysql.o dtrace_shared_files dtrace_providers
CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers dtrace_shared_files
CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers dtrace_shared_files dtrace_sources
DTRACEFILES = libarchive_a-ha_archive.o
DTRACESHAREDFILES = .libs/ha_archive_la-ha_archive.o
# Hack: We "depend" on ".libs/" but have no rule for it,
# but it is created as a byproduct of the ".lo"
DTRACESHAREDDEPEND = ha_archive_la-ha_archive.lo
DTRACEPROVIDER = probes_mysql.d
dtrace_files:
......@@ -93,7 +96,7 @@ probes_mysql.d:
$(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
echo timestamp > dtrace_sources
probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDFILES)
probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDDEPEND)
$(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACESHAREDFILES) -o $@
probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
......
......@@ -164,10 +164,10 @@ int32 initCharsetSupport()
}
VOID(pthread_mutex_init(&textDescMapHashMutex,MY_MUTEX_INIT_FAST));
hash_init(&textDescMapHash, &my_charset_bin, 10, offsetof(TextDescMap, hashKey), sizeof(TextDescMap::hashKey), 0, 0, HASH_UNIQUE);
my_hash_init(&textDescMapHash, &my_charset_bin, 10, offsetof(TextDescMap, hashKey), sizeof(TextDescMap::hashKey), 0, 0, HASH_UNIQUE);
VOID(pthread_mutex_init(&iconvMapHashMutex,MY_MUTEX_INIT_FAST));
hash_init(&iconvMapHash, &my_charset_bin, 10, offsetof(IconvMap, hashKey), sizeof(IconvMap::hashKey), 0, 0, HASH_UNIQUE);
my_hash_init(&iconvMapHash, &my_charset_bin, 10, offsetof(IconvMap, hashKey), sizeof(IconvMap::hashKey), 0, 0, HASH_UNIQUE);
init_alloc_root(&textDescMapMemroot, 2048, 0);
init_alloc_root(&iconvMapMemroot, 256, 0);
......@@ -191,9 +191,9 @@ void doneCharsetSupport()
free_root(&iconvMapMemroot, 0);
pthread_mutex_destroy(&textDescMapHashMutex);
hash_free(&textDescMapHash);
my_hash_free(&textDescMapHash);
pthread_mutex_destroy(&iconvMapHashMutex);
hash_free(&iconvMapHash);
my_hash_free(&iconvMapHash);
free_aligned(QlgCvtTextDescToDesc_sym);
}
......@@ -415,7 +415,7 @@ static int32 convertTextDesc(const int32 inType, const int32 outType, const char
memcpy(hashKey.inDesc, inDescOverride, len);
memset(hashKey.inDesc+len, 0, sizeof(hashKey.inDesc) - len);
if (!(mapping=(TextDescMap *) hash_search(&textDescMapHash,
if (!(mapping=(TextDescMap *) my_hash_search(&textDescMapHash,
(const uchar*)&hashKey,
sizeof(hashKey))))
{
......@@ -748,7 +748,7 @@ int32 getConversion(enum_conversionDirection direction, const CHARSET_INFO* cs,
/* Look for the conversion in the cache and add it if it is not there. */
IconvMap *mapping;
if (!(mapping= (IconvMap *) hash_search(&iconvMapHash,
if (!(mapping= (IconvMap *) my_hash_search(&iconvMapHash,
(const uchar*)&hashKey,
sizeof(hashKey))))
{
......
......@@ -102,7 +102,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex,
Foreign_key* fk = (Foreign_key*)curKey;
char db2LibName[MAX_DB2_SCHEMANAME_LENGTH+1];
if (fk->name)
if (fk->name.str)
{
char db2FKName[MAX_DB2_FILENAME_LENGTH+1];
appendHere.append(STRING_WITH_LEN("CONSTRAINT "));
......@@ -120,7 +120,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex,
appendHere.append('.');
convertMySQLNameToDB2Name(fk->name, db2FKName, sizeof(db2FKName));
convertMySQLNameToDB2Name(fk->name.str, db2FKName, sizeof(db2FKName));
appendHere.append(db2FKName);
}
......@@ -139,7 +139,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex,
}
firstTime = false;
convertMySQLNameToDB2Name(curColumn->field_name, colName, sizeof(colName));
convertMySQLNameToDB2Name(curColumn->field_name.str, colName, sizeof(colName));
appendHere.append(colName);
// DB2 requires that the sort sequence on the child table match the parent table's
......@@ -148,7 +148,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex,
Field** field = fields;
do
{
if (strcmp((*field)->field_name, curColumn->field_name) == 0)
if (strcmp((*field)->field_name, curColumn->field_name.str) == 0)
{
int rc = updateAssociatedSortSequence((*field)->charset(),
fileSortSequenceType,
......@@ -199,7 +199,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex,
}
firstTime = false;
convertMySQLNameToDB2Name(curRef->field_name, colName, sizeof(colName));
convertMySQLNameToDB2Name(curRef->field_name.str, colName, sizeof(colName));
appendHere.append(colName);
}
......
......@@ -284,8 +284,8 @@ static int ibmdb2i_init_func(void *p)
was_ILE_inited = false;
ibmdb2i_hton= (handlerton *)p;
VOID(pthread_mutex_init(&ibmdb2i_mutex,MY_MUTEX_INIT_FAST));
(void) hash_init(&ibmdb2i_open_tables,table_alias_charset,32,0,0,
(hash_get_key) ibmdb2i_get_key,0,0);
(void) my_hash_init(&ibmdb2i_open_tables,table_alias_charset,32,0,0,
(my_hash_get_key) ibmdb2i_get_key,0,0);
ibmdb2i_hton->state= SHOW_OPTION_YES;
ibmdb2i_hton->create= ibmdb2i_create_handler;
......@@ -340,7 +340,7 @@ static int ibmdb2i_done_func(void *p)
doneCharsetSupport();
hash_free(&ibmdb2i_open_tables);
my_hash_free(&ibmdb2i_open_tables);
pthread_mutex_destroy(&ibmdb2i_mutex);
DBUG_RETURN(0);
......@@ -356,7 +356,7 @@ IBMDB2I_SHARE *ha_ibmdb2i::get_share(const char *table_name, TABLE *table)
pthread_mutex_lock(&ibmdb2i_mutex);
length=(uint) strlen(table_name);
if (!(share=(IBMDB2I_SHARE*) hash_search(&ibmdb2i_open_tables,
if (!(share=(IBMDB2I_SHARE*) my_hash_search(&ibmdb2i_open_tables,
(uchar*)table_name,
length)))
{
......@@ -387,7 +387,7 @@ IBMDB2I_SHARE *ha_ibmdb2i::get_share(const char *table_name, TABLE *table)
if (rc)
{
delete share->db2Table;
hash_delete(&ibmdb2i_open_tables, (uchar*) share);
my_hash_delete(&ibmdb2i_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
my_errno = rc;
goto error;
......@@ -420,7 +420,7 @@ int ha_ibmdb2i::free_share(IBMDB2I_SHARE *share)
delete share->db2Table;
db2Table = NULL;
hash_delete(&ibmdb2i_open_tables, (uchar*) share);
my_hash_delete(&ibmdb2i_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex);
my_free(share, MYF(0));
......
......@@ -15,13 +15,6 @@
# This is the CMakeLists for InnoDB Plugin
# TODO: remove the two FLAGS_DEBUG settings when merging into
# 6.0-based trees, like is already the case for other engines in
# those trees.
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Starting at 5.1.38, MySQL CMake files are simplified. But the plugin
# CMakeLists.txt still needs to work with previous versions of MySQL.
IF (MYSQL_VERSION_ID GREATER "50137")
......@@ -93,5 +86,10 @@ IF (MYSQL_VERSION_ID GREATER "50137")
SET_TARGET_PROPERTIES(ha_innobase PROPERTIES OUTPUT_NAME ha_innodb)
ENDIF(LIB_LOCATION)
ELSE (MYSQL_VERSION_ID GREATER "50137")
MYSQL_STORAGE_ENGINE(INNODB_PLUGIN)
IF (NOT SOURCE_SUBLIBS)
ADD_DEFINITIONS(-D_WIN32 -DMYSQL_SERVER)
ADD_LIBRARY(innobase STATIC ${INNOBASE_SOURCES})
# Require mysqld_error.h, which is built as part of the GenError
ADD_DEPENDENCIES(innobase GenError)
ENDIF (NOT SOURCE_SUBLIBS)
ENDIF (MYSQL_VERSION_ID GREATER "50137")
......@@ -41,7 +41,6 @@ my_off_t myisam_max_temp_length= MAX_FILE_SIZE;
ulong myisam_bulk_insert_tree_size=8192*1024;
ulong myisam_data_pointer_size=4;
ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0;
pthread_mutex_t THR_LOCK_myisam_mmap;
static int always_valid(const char *filename __attribute__((unused)))
{
......
......@@ -303,7 +303,7 @@ case "$mode" in
then
mysqld_pid=`cat "$mysqld_pid_file_path"`
if (kill -9 $mysqld_pid 2>/dev/null)
if (kill -0 $mysqld_pid 2>/dev/null)
then
echo $echo_n "Shutting down MySQL"
kill $mysqld_pid
......
......@@ -43,6 +43,12 @@
%{?_with_cluster:%define CLUSTER_BUILD 1}
%{!?_with_cluster:%define CLUSTER_BUILD 0}
# ----------------------------------------------------------------------
# support optional "tcmalloc" stuff (experimental)
# ----------------------------------------------------------------------
%{?malloc_lib_target:%define WITH_TCMALLOC 1}
%{!?malloc_lib_target:%define WITH_TCMALLOC 0}
%if %{STATIC_BUILD}
%define release 0
%else
......@@ -448,7 +454,7 @@ $MBD/libtool --mode=execute install -m 755 \
$RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-debug-%{mysql_version}/sql/mysqld \
$RBR%{_sbindir}/mysqld-debug
%if %{?malloc_lib_target:1}%{!?malloc_lib_target:0}
%if %{WITH_TCMALLOC}
# Even though this is a shared library, put it under /usr/lib/mysql, so it
# doesn't conflict with possible shared lib by the same name in /usr/lib. See
# `mysql_config --variable=pkglibdir` and mysqld_safe for how this is used.
......@@ -709,12 +715,10 @@ fi
%attr(755, root, root) %{_bindir}/resolveip
%attr(755, root, root) %{_libdir}/mysql/plugin/ha_example.so*
%if %{WITHOUT_INNODB_PLUGIN}
%else
%attr(755, root, root) %{_libdir}/mysql/plugin/ha_innodb_plugin.so*
%endif
%attr(755, root, root) %{_libdir}/mysql/plugin/libsemisync_master.so*
%attr(755, root, root) %{_libdir}/mysql/plugin/libsemisync_slave.so*
%if %{?malloc_lib_target:1}%{!?malloc_lib_target:0}
%if %{WITH_TCMALLOC}
%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target}
%endif
......@@ -833,6 +837,7 @@ fi
%{_libdir}/mysql/libmysqlclient.la
%{_libdir}/mysql/libmysqlclient_r.a
%{_libdir}/mysql/libmysqlclient_r.la
%{_libdir}/mysql/libmysqlservices.a
%{_libdir}/mysql/libmystrings.a
%{_libdir}/mysql/libmysys.a
%if %{CLUSTER_BUILD}
......@@ -844,11 +849,10 @@ fi
%{_libdir}/mysql/libz.la
%{_libdir}/mysql/plugin/ha_example.a
%{_libdir}/mysql/plugin/ha_example.la
%if %{WITHOUT_INNODB_PLUGIN}
%else
%{_libdir}/mysql/plugin/ha_innodb_plugin.a
%{_libdir}/mysql/plugin/ha_innodb_plugin.la
%endif
%{_libdir}/mysql/plugin/libsemisync_master.a
%{_libdir}/mysql/plugin/libsemisync_master.la
%{_libdir}/mysql/plugin/libsemisync_slave.a
%{_libdir}/mysql/plugin/libsemisync_slave.la
%files shared
%defattr(-, root, root, 0755)
......@@ -878,6 +882,11 @@ fi
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
* Mon Nov 16 2009 Joerg Bruehe <joerg.bruehe@sun.com>
- Fix some problems with the directives around "tcmalloc" (experimental),
remove erroneous traces of the InnoDB plugin (that is 5.1 only).
* Fri Oct 02 2009 Alexander Nozdrin <alexander.nozdrin@sun.com>
- "mysqlmanager" got removed from version 5.4, all references deleted.
......
......@@ -19154,7 +19154,7 @@ static struct my_tests_st my_tests[]= {
{ "test_wl4166_2", test_wl4166_2 },
{ "test_wl4166_3", test_wl4166_3 },
{ "test_wl4166_4", test_wl4166_4 },
{ "test_wl4435", test_wl4435 },
/* { "test_wl4435", test_wl4435 }, */
{ "test_wl4435_2", test_wl4435_2 },
{ "test_bug38486", test_bug38486 },
{ "test_bug33831", test_bug33831 },
......
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