mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge mysql.com:/home/mydev/mysql-5.0
into mysql.com:/home/mydev/mysql-5.0-5000 sql/sql_insert.cc: Auto merged sql/sql_select.cc: Auto merged
This commit is contained in:
4
mysql-test/include/ndb_default_cluster.inc
Normal file
4
mysql-test/include/ndb_default_cluster.inc
Normal file
@ -0,0 +1,4 @@
|
||||
-- require r/ndb_default_cluster.require
|
||||
disable_query_log;
|
||||
show status like "Ndb_connected_host";
|
||||
enable_query_log;
|
@ -34,13 +34,13 @@ col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
|
||||
col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 ndbcluster 10 Dynamic 0 0 0 0 0 0 1 NULL NULL NULL latin1_swedish_ci NULL number_of_replicas: 2
|
||||
t1 ndbcluster 10 Dynamic 0 0 # # 0 # 1 # # # latin1_swedish_ci NULL #
|
||||
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
||||
insert into t1 values
|
||||
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 ndbcluster 10 Dynamic 9 96 131072 0 0 0 101 NULL NULL NULL latin1_swedish_ci NULL number_of_replicas: 2
|
||||
t1 ndbcluster 10 Dynamic 9 96 # # 0 # 101 # # # latin1_swedish_ci NULL #
|
||||
select * from t1 order by col1;
|
||||
col1 col2 col3 col4 col5 col6 to_be_deleted
|
||||
0 4 3 5 PENDING 1 7
|
||||
@ -60,7 +60,7 @@ change column col2 fourth varchar(30) not null after col3,
|
||||
modify column col6 int not null first;
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 ndbcluster 10 Dynamic 9 152 131072 0 0 0 102 NULL NULL NULL latin1_swedish_ci NULL number_of_replicas: 2
|
||||
t1 ndbcluster 10 Dynamic 9 152 # # 0 # 102 # # # latin1_swedish_ci NULL #
|
||||
select * from t1 order by col1;
|
||||
col6 col1 col3 fourth col4 col4_5 col5 col7 col8
|
||||
1 0 3 4 5 PENDING 0000-00-00 00:00:00
|
||||
@ -75,7 +75,7 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8
|
||||
insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 ndbcluster 10 Dynamic 10 152 131072 0 0 0 103 NULL NULL NULL latin1_swedish_ci NULL number_of_replicas: 2
|
||||
t1 ndbcluster 10 Dynamic 10 152 # # 0 # 103 # # # latin1_swedish_ci NULL #
|
||||
select * from t1 order by col1;
|
||||
col6 col1 col3 fourth col4 col4_5 col5 col7 col8
|
||||
1 0 3 4 5 PENDING 0000-00-00 00:00:00
|
||||
|
@ -144,8 +144,8 @@ Handler_discover 1
|
||||
flush tables;
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL
|
||||
t7 ndbcluster 9 Fixed 1 276 # # # 0 NULL # # NULL # NULL number_of_replicas: 2
|
||||
t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL #
|
||||
t7 ndbcluster 9 Fixed 1 276 # # # 0 NULL # # NULL # NULL #
|
||||
show status like 'handler_discover%';
|
||||
Variable_name Value
|
||||
Handler_discover 2
|
||||
|
2
mysql-test/r/ndb_default_cluster.require
Normal file
2
mysql-test/r/ndb_default_cluster.require
Normal file
@ -0,0 +1,2 @@
|
||||
Variable_name Value
|
||||
Ndb_connected_host localhost
|
@ -612,3 +612,17 @@ a b c
|
||||
3 NULL NULL
|
||||
4 4 NULL
|
||||
drop table t1, t8;
|
||||
create table t1(
|
||||
id integer not null auto_increment,
|
||||
month integer not null,
|
||||
year integer not null,
|
||||
code varchar( 2) not null,
|
||||
primary key ( id),
|
||||
unique idx_t1( month, code, year)
|
||||
) engine=ndb;
|
||||
INSERT INTO t1 (month, year, code) VALUES (4,2004,'12');
|
||||
INSERT INTO t1 (month, year, code) VALUES (5,2004,'12');
|
||||
select * from t1 where code = '12' and month = 4 and year = 2004 ;
|
||||
id month year code
|
||||
1 4 2004 12
|
||||
drop table t1;
|
||||
|
@ -47,10 +47,12 @@ col3 varchar (20) not null,
|
||||
col4 varchar(4) not null,
|
||||
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
|
||||
col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
|
||||
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
|
||||
show table status;
|
||||
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
||||
insert into t1 values
|
||||
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
|
||||
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
|
||||
show table status;
|
||||
select * from t1 order by col1;
|
||||
alter table t1
|
||||
@ -59,9 +61,11 @@ add column col7 varchar(30) not null after col5,
|
||||
add column col8 datetime not null, drop column to_be_deleted,
|
||||
change column col2 fourth varchar(30) not null after col3,
|
||||
modify column col6 int not null first;
|
||||
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
|
||||
show table status;
|
||||
select * from t1 order by col1;
|
||||
insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
|
||||
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
|
||||
show table status;
|
||||
select * from t1 order by col1;
|
||||
delete from t1;
|
||||
|
@ -176,7 +176,7 @@ show status like 'handler_discover%';
|
||||
flush tables;
|
||||
system rm var/master-data/test/t7.frm ;
|
||||
|
||||
--replace_column 7 # 8 # 9 # 12 # 13 # 15 #
|
||||
--replace_column 7 # 8 # 9 # 12 # 13 # 15 # 18 #
|
||||
show table status;
|
||||
show status like 'handler_discover%';
|
||||
|
||||
|
@ -286,3 +286,24 @@ select * from t8 order by a;
|
||||
select * from t1 order by a;
|
||||
drop table t1, t8;
|
||||
|
||||
###############################
|
||||
# Bug 8101
|
||||
#
|
||||
# Unique index not specified in the same order as in table
|
||||
#
|
||||
|
||||
create table t1(
|
||||
id integer not null auto_increment,
|
||||
month integer not null,
|
||||
year integer not null,
|
||||
code varchar( 2) not null,
|
||||
primary key ( id),
|
||||
unique idx_t1( month, code, year)
|
||||
) engine=ndb;
|
||||
|
||||
INSERT INTO t1 (month, year, code) VALUES (4,2004,'12');
|
||||
INSERT INTO t1 (month, year, code) VALUES (5,2004,'12');
|
||||
|
||||
select * from t1 where code = '12' and month = 4 and year = 2004 ;
|
||||
|
||||
drop table t1;
|
||||
|
@ -1,4 +1,5 @@
|
||||
-- source include/have_ndb.inc
|
||||
-- source include/ndb_default_cluster.inc
|
||||
|
||||
--disable_warnings
|
||||
use test;
|
||||
|
Reference in New Issue
Block a user