oceanbase

Форк
0
/r
/
rename_table2.result 
63 строки · 2.1 Кб
1
drop database if exists hualong;
2
create database hualong;
3
use hualong;
4
drop table if exists r1;
5
drop table if exists r2;
6
create table hualong.r1(c1 int not null primary key, c2 int);
7
create table hualong.r2(a int not null primary key , b int);
8
rename table r1 to r2;
9
ERROR 42S01: Table 'r2' already exists
10
alter table r1 rename to r2;
11
ERROR 42S01: Table 'r2' already exists
12
rename table r1 to r3, r2 to r3;
13
ERROR 42S01: Table 'r3' already exists
14
rename table r1 to r3, r1 to r3;
15
ERROR 42S01: Table 'r3' already exists
16
rename table r1 to r3, r1 to r4;
17
ERROR HY000: File not exist
18
rename table xx to r1;
19
ERROR 42S01: Table 'r1' already exists
20
rename table xx to a.xxx;
21
ERROR 42000: Unknown database 'a'
22
rename table r1 to table1, table1 to r1;
23
rename table r1 to r3, r2 to r1;
24
rename table r3 to r3;
25
ERROR 42S01: Table 'r3' already exists
26
drop database if exists hualong2;
27
create database hualong2;
28
rename table hualong.r1 to hualong2.r1;
29
show tables from hualong;
30
Tables_in_hualong
31
r3
32
show tables from hualong2;
33
Tables_in_hualong2
34
r1
35
create index idx1 on hualong.r3(c1);
36
rename table hualong.r3 to hualong2.r2;
37
show tables from hualong;
38
Tables_in_hualong
39
show tables from hualong2;
40
Tables_in_hualong2
41
r1
42
r2
43
show index from hualong2.r2;
44
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment	Visible	Expression
45
r2	0	PRIMARY	1	c1	A	NULL	NULL	NULL		BTREE	available		YES	NULL
46
r2	1	idx1	1	c1	A	NULL	NULL	NULL		BTREE	available		YES	NULL
47
rename table hualong2.r2 to hualong.r2;
48
show index from hualong.r2;
49
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment	Visible	Expression
50
r2	0	PRIMARY	1	c1	A	NULL	NULL	NULL		BTREE	available		YES	NULL
51
r2	1	idx1	1	c1	A	NULL	NULL	NULL		BTREE	available		YES	NULL
52
show tables from hualong;
53
Tables_in_hualong
54
r2
55
rename table hualong2.r1 to hualong.r1;
56
rename table r1 to tmp, tmp to r1, r2 to tmp;
57
show tables from hualong;
58
Tables_in_hualong
59
r1
60
tmp
61
drop table hualong.r1, hualong.tmp;
62
drop database hualong;
63
drop database hualong2;
64

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.