mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.1. Extended the unique table check by a check of lock data. Merge sub-tables cannot be detected by doing name checks only.
This commit is contained in:
@ -259,21 +259,6 @@ select * from t1;
|
||||
0 1 2
|
||||
0 0 1
|
||||
drop table t1;
|
||||
create table t1 select 1,2,3;
|
||||
create table if not exists t1 select 1,2;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
create table if not exists t1 select 1,2,3,4;
|
||||
ERROR 21S01: Column count doesn't match value count at row 1
|
||||
create table if not exists t1 select 1;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
select * from t1;
|
||||
1 2 3
|
||||
1 2 3
|
||||
0 1 2
|
||||
0 0 1
|
||||
drop table t1;
|
||||
create table t1 (a int not null, b int, primary key (a));
|
||||
insert into t1 values (1,1);
|
||||
create table if not exists t1 select 2;
|
||||
|
@ -722,3 +722,52 @@ SELECT b FROM t2;
|
||||
b
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
insert into t1 values (1);
|
||||
insert into t2 values (2);
|
||||
create table t3 (a int) engine=merge union=(t1, t2) insert_method=first;
|
||||
select * from t3;
|
||||
a
|
||||
1
|
||||
2
|
||||
insert t2 select * from t2;
|
||||
select * from t2;
|
||||
a
|
||||
2
|
||||
2
|
||||
insert t3 select * from t1;
|
||||
select * from t3;
|
||||
a
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
insert t1 select * from t3;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
select * from t2;
|
||||
a
|
||||
2
|
||||
2
|
||||
select * from t3;
|
||||
a
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
check table t1, t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
test.t2 check status OK
|
||||
drop table t1, t2, t3;
|
||||
|
@ -211,13 +211,6 @@ drop table t1;
|
||||
# bug #1434
|
||||
#
|
||||
|
||||
create table t1 select 1,2,3;
|
||||
create table if not exists t1 select 1,2;
|
||||
--error 1136
|
||||
create table if not exists t1 select 1,2,3,4;
|
||||
create table if not exists t1 select 1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
create table t1 select 1,2,3;
|
||||
create table if not exists t1 select 1,2;
|
||||
--error 1136
|
||||
|
@ -355,4 +355,30 @@ INSERT INTO t2 (b) VALUES (1) ON DUPLICATE KEY UPDATE b=3;
|
||||
SELECT b FROM t2;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
#
|
||||
# BUG#5390 - problems with merge tables
|
||||
# Problem #1: INSERT...SELECT
|
||||
#
|
||||
#drop table if exists t1, t2, t3;
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
insert into t1 values (1);
|
||||
insert into t2 values (2);
|
||||
create table t3 (a int) engine=merge union=(t1, t2) insert_method=first;
|
||||
select * from t3;
|
||||
#
|
||||
insert t2 select * from t2;
|
||||
select * from t2;
|
||||
#
|
||||
insert t3 select * from t1;
|
||||
select * from t3;
|
||||
#
|
||||
insert t1 select * from t3;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
select * from t3;
|
||||
check table t1, t2;
|
||||
drop table t1, t2, t3;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
Reference in New Issue
Block a user