1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge emurphy@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into  mysql.com:/home/emurphy/src/bk-clean/mysql-5.1-new


sql/mysqld.cc:
  Auto merged
This commit is contained in:
unknown
2006-06-01 13:39:13 -04:00
124 changed files with 2864 additions and 1825 deletions

View File

@ -22,7 +22,7 @@ insert t2 values (5);
commit;
# first COMMIT must be Query_log_event, second - Xid_log_event
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
drop table t1,t2;
@ -44,8 +44,8 @@ while ($1)
commit;
drop table t1;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events in 'master-bin.000001' from 102;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events in 'master-bin.000002' from 102;

View File

@ -30,7 +30,7 @@ insert into t2 select * from t1;
commit;
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
delete from t1;
@ -44,7 +44,7 @@ insert into t2 select * from t1;
rollback;
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
delete from t1;
@ -60,7 +60,7 @@ rollback to savepoint my_savepoint;
commit;
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
delete from t1;
@ -78,7 +78,7 @@ commit;
select a from t1 order by a; # check that savepoints work :)
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
# and when ROLLBACK is not explicit?
@ -100,7 +100,7 @@ connection con2;
# logging has been done, we use a user lock.
select get_lock("a",10);
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
# and when not in a transact1on?
@ -112,7 +112,7 @@ insert into t1 values(9);
insert into t2 select * from t1;
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
# Check that when the query updat1ng the MyISAM table is the first in the
@ -125,13 +125,13 @@ insert into t1 values(10); # first make t1 non-empty
begin;
insert into t2 select * from t1;
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
insert into t1 values(11);
commit;
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
@ -150,7 +150,7 @@ insert into t2 select * from t1;
commit;
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
delete from t1;
@ -163,7 +163,7 @@ insert into t2 select * from t1;
rollback;
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
delete from t1;
@ -179,7 +179,7 @@ rollback to savepoint my_savepoint;
commit;
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
delete from t1;
@ -197,7 +197,7 @@ commit;
select a from t1 order by a; # check that savepoints work :)
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
# Test for BUG#5714, where a MyISAM update in the transaction used to
@ -258,7 +258,7 @@ disconnect con2;
connection con3;
select get_lock("lock1",60);
--replace_column 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
do release_lock("lock1");
drop table t0,t2;

View File

@ -1172,6 +1172,8 @@ sub executable_setup () {
sub environment_setup () {
umask(022);
# --------------------------------------------------------------------------
# We might not use a standard installation directory, like /usr/lib.
# Set LD_LIBRARY_PATH to make sure we find our installed libraries.
@ -2603,7 +2605,6 @@ sub mysqld_arguments ($$$$$$) {
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
mtr_add_arg($args, "%s--core", $prefix);
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
mtr_add_arg($args, "%s--loose-binlog-show-xid=0", $prefix);
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
@ -2749,7 +2750,6 @@ sub mysqld_arguments ($$$$$$) {
mtr_add_arg($args, "%s--sort_buffer=256K", $prefix);
mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix);
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
mtr_add_arg($args, "%s--loose-binlog-show-xid=0", $prefix);
if ( $opt_ssl_supported )
{
@ -3281,7 +3281,7 @@ sub run_mysqltest ($) {
}
my $cmdline_mysql=
"$exe_mysql --host=localhost --user=root --password= " .
"$exe_mysql --no-defaults --host=localhost --user=root --password= " .
"--port=$master->[0]->{'path_myport'} " .
"--socket=$master->[0]->{'path_mysock'}";

View File

@ -1345,7 +1345,6 @@ start_master()
--innodb_data_file_path=ibdata1:128M:autoextend \
--open-files-limit=1024 \
--log-bin-trust-function-creators \
--loose-binlog-show-xid=0 \
$MASTER_40_ARGS \
$SMALL_SERVER \
$MASTER_MYSQLD_BINLOG_OPT \
@ -1369,7 +1368,6 @@ start_master()
--language=$LANGUAGE \
--innodb_data_file_path=ibdata1:128M:autoextend \
--log-bin-trust-function-creators \
--loose-binlog-show-xid=0 \
$MASTER_40_ARGS \
$SMALL_SERVER \
$MASTER_MYSQLD_BINLOG_OPT \
@ -1542,7 +1540,6 @@ start_slave()
--master-retry-count=10 \
-O slave_net_timeout=10 \
--log-bin-trust-function-creators \
--loose-binlog-show-xid=0 \
$SMALL_SERVER \
$SLAVE_MYSQLD_BINLOG_OPT \
$EXTRA_SLAVE_MYSQLD_OPT $EXTRA_SLAVE_OPT \

View File

@ -111,3 +111,32 @@ NULL test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0
NULL test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default
NULL test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default
drop table t1;
create table t1 (a int)
PARTITION BY RANGE (a)
SUBPARTITION BY LINEAR HASH (a)
(PARTITION p0 VALUES LESS THAN (10));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) )
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
table_schema="test" AND table_name="t1";
SUBPARTITION_METHOD
LINEAR HASH
drop table t1;
create table t1 (a int)
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN
(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM)
SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
table_schema = "test" AND table_name = "t1";
PARTITION_DESCRIPTION
10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53
drop table t1;

View File

@ -748,3 +748,11 @@ f1 f2 f3
111111 aaaaaa 1
222222 bbbbbb 2
drop table t1;
CREATE TABLE t1 (a VARCHAR(255) NOT NULL,
CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb;
CREATE TABLE t2(a VARCHAR(255) NOT NULL,
b VARCHAR(255) NOT NULL,
c VARCHAR(255) NOT NULL,
CONSTRAINT pk_b_c_id PRIMARY KEY (b,c),
CONSTRAINT fk_a FOREIGN KEY(a) REFERENCES t1(a))engine=ndb;
drop table t1, t2;

View File

@ -155,3 +155,10 @@ DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
DROP TABLE test.t4;
ALTER TABLESPACE table_space1
DROP DATAFILE './table_space1/datafile.dat'
ENGINE = NDB;
DROP TABLESPACE table_space1
ENGINE = NDB;
DROP LOGFILE GROUP log_group1
ENGINE =NDB;

View File

@ -11,7 +11,7 @@ ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=XYZ;
Warnings:
Error 1266 Using storage engine MyISAM for table 'lg1'
Error 1286 Unknown table engine 'XYZ'
Error 1465 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'

View File

@ -0,0 +1,24 @@
DROP TABLE IF EXISTS t1,t2;
drop database if exists mysqltest;
CREATE TABLE t1 (
pk1 INT NOT NULL PRIMARY KEY,
attr1 INT NOT NULL,
attr2 INT,
attr3 VARCHAR(10),
INDEX i1(attr1)
) ENGINE=ndbcluster;
INSERT INTO t1 VALUES (0,0,0,"zero"),(1,1,1,"one"),(2,2,2,"two");
SELECT * FROM t1 WHERE attr1 = 1;
pk1 attr1 attr2 attr3
1 1 1 one
alter table t1 rename t2;
SELECT * FROM t2 WHERE attr1 = 1;
pk1 attr1 attr2 attr3
1 1 1 one
create database ndbtest;
alter table t2 rename ndbtest.t2;
SELECT * FROM ndbtest.t2 WHERE attr1 = 1;
pk1 attr1 attr2 attr3
1 1 1 one
drop table ndbtest.t2;
drop database ndbtest;

View File

@ -936,4 +936,16 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
drop table t1;
create database db99;
use db99;
create table t1 (a int not null)
engine=archive
partition by list (a)
(partition p0 values in (1), partition p1 values in (2));
insert into t1 values (1), (2);
create index inx on t1 (a);
alter table t1 add partition (partition p2 values in (3));
alter table t1 drop partition p2;
use test;
drop database db99;
End of 5.1 tests

View File

@ -554,3 +554,26 @@ PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
insert into t1 values (10);
ERROR HY000: Table has no partition for value 10
drop table t1;
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
drop table t1;
create table t1 (a int)
partition by hash (rand(a));
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
create table t1 (a int)
partition by hash(CURTIME() + a);
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
create table t1 (a int)
partition by hash (NOW()+a);
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
create table t1 (a int)
partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
ERROR HY000: This partition function is not allowed
create table t1 (a int)
partition by range (a + (select count(*) from t1))
(partition p1 values less than (1));
ERROR HY000: This partition function is not allowed
create table t1 (a char(10))
partition by hash (extractvalue(a,'a'));
ERROR HY000: The PARTITION function returns the wrong type

View File

@ -47,6 +47,10 @@ master-bin.000001 # Table_map 1 # table_id: # (test.t1)
flush logs;
create table t3 (a int)ENGINE=NDB;
start slave;
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
flush logs;
stop slave;
create table t2 (n int)ENGINE=NDB;

View File

@ -24,11 +24,11 @@ ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does n
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_2myisam : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_auto_inc : BUG#17086 2006-02-16 jmiller CR: auto_increment_increment and auto_increment_offset produce duplicate key er
rpl_ndb_commit_afterflush : BUG#19328 2006-05-04 tomas Slave timeout with COM_REGISTER_SLAVE error causing stop
#rpl_ndb_commit_afterflush : BUG#19328 2006-05-04 tomas Slave timeout with COM_REGISTER_SLAVE error causing stop
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked
rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_ndb_log : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
#rpl_ndb_log : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_switch_stm_row_mixed : BUG#18590 2006-03-28 brian
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly

View File

@ -99,3 +99,25 @@ select * from information_schema.partitions where table_schema="test"
and table_name="t1";
drop table t1;
#
# Bug 20161 Partitions: SUBPARTITION METHOD doesn't show LINEAR keyword
#
create table t1 (a int)
PARTITION BY RANGE (a)
SUBPARTITION BY LINEAR HASH (a)
(PARTITION p0 VALUES LESS THAN (10));
SHOW CREATE TABLE t1;
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
table_schema="test" AND table_name="t1";
drop table t1;
create table t1 (a int)
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN
(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53));
SHOW CREATE TABLE t1;
SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
table_schema = "test" AND table_name = "t1";
drop table t1;

View File

@ -713,3 +713,17 @@ select * from t1 order by f1;
select * from t1 order by f2;
select * from t1 order by f3;
drop table t1;
#
# Bug #18483 Cannot create table with FK constraint
# ndb does not support foreign key constraint, it is silently ignored
# in line with other storage engines
#
CREATE TABLE t1 (a VARCHAR(255) NOT NULL,
CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb;
CREATE TABLE t2(a VARCHAR(255) NOT NULL,
b VARCHAR(255) NOT NULL,
c VARCHAR(255) NOT NULL,
CONSTRAINT pk_b_c_id PRIMARY KEY (b,c),
CONSTRAINT fk_a FOREIGN KEY(a) REFERENCES t1(a))engine=ndb;
drop table t1, t2;

View File

@ -160,4 +160,14 @@ DROP TABLE test.t2;
DROP TABLE test.t3;
DROP TABLE test.t4;
ALTER TABLESPACE table_space1
DROP DATAFILE './table_space1/datafile.dat'
ENGINE = NDB;
DROP TABLESPACE table_space1
ENGINE = NDB;
DROP LOGFILE GROUP log_group1
ENGINE =NDB;
#End 5.1 test case

View File

@ -0,0 +1,36 @@
-- source include/have_ndb.inc
-- source include/not_embedded.inc
--disable_warnings
DROP TABLE IF EXISTS t1,t2;
drop database if exists mysqltest;
--enable_warnings
#
# Table rename tests
#
#
# Create a normal table with primary key
#
CREATE TABLE t1 (
pk1 INT NOT NULL PRIMARY KEY,
attr1 INT NOT NULL,
attr2 INT,
attr3 VARCHAR(10),
INDEX i1(attr1)
) ENGINE=ndbcluster;
INSERT INTO t1 VALUES (0,0,0,"zero"),(1,1,1,"one"),(2,2,2,"two");
SELECT * FROM t1 WHERE attr1 = 1;
alter table t1 rename t2;
SELECT * FROM t2 WHERE attr1 = 1;
create database ndbtest;
alter table t2 rename ndbtest.t2;
SELECT * FROM ndbtest.t2 WHERE attr1 = 1;
drop table ndbtest.t2;
drop database ndbtest;
# End of 4.1 tests

View File

@ -1077,4 +1077,21 @@ OPTIMIZE TABLE t1;
drop table t1;
#
# Bug 17310 Partitions: Bugs with archived partitioned tables
#
create database db99;
use db99;
create table t1 (a int not null)
engine=archive
partition by list (a)
(partition p0 values in (1), partition p1 values in (2));
insert into t1 values (1), (2);
--error 0, 1005
create index inx on t1 (a);
alter table t1 add partition (partition p2 values in (3));
alter table t1 drop partition p2;
use test;
drop database db99;
--echo End of 5.1 tests

View File

@ -747,3 +747,31 @@ CREATE TABLE t1(a int)
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
insert into t1 values (10);
drop table t1;
#
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
#
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
drop table t1;
-- error 1064
create table t1 (a int)
partition by hash (rand(a));
-- error 1064
create table t1 (a int)
partition by hash(CURTIME() + a);
-- error 1064
create table t1 (a int)
partition by hash (NOW()+a);
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (a int)
partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (a int)
partition by range (a + (select count(*) from t1))
(partition p1 values less than (1));
-- error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
create table t1 (a char(10))
partition by hash (extractvalue(a,'a'));

View File

@ -15,7 +15,7 @@ enable_query_log;
--system mkdir $MYSQLTEST_VARDIR/tmp/bug14354
disable_query_log;
eval CREATE TABLE t1 (id int) PARTITION BY RANGE(id) (
PARTITION p1 VALUES LESS THAN (20) ENGINE=myiasm
PARTITION p1 VALUES LESS THAN (20) ENGINE=myisam
DATA DIRECTORY="$MYSQLTEST_VARDIR/tmp/bug14354"
INDEX DIRECTORY="$MYSQLTEST_VARDIR/tmp/bug14354");
enable_query_log;