-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '10.0' of https://github.com/MariaDB/server into 10.0
- Loading branch information
Showing
20 changed files
with
325 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
set global userstat=1; | ||
create table just_a_test(id int,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30)); | ||
insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), | ||
(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), | ||
(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), | ||
(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), | ||
(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); | ||
alter table just_a_test add primary key (id); | ||
alter table just_a_test add key IND_just_a_test_first_name_last_name(first_name,last_name); | ||
alter table just_a_test add key IND_just_a_test_state(state); | ||
select count(*) from just_a_test where first_name='fc' and last_name='lc'; | ||
count(*) | ||
1 | ||
select count(*) from just_a_test where state = 'California'; | ||
count(*) | ||
2 | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ | ||
test just_a_test IND_just_a_test_state 2 | ||
test just_a_test IND_just_a_test_first_name_last_name 1 | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES | ||
test just_a_test 18 5 5 | ||
alter table just_a_test drop key IND_just_a_test_first_name_last_name; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ | ||
test just_a_test IND_just_a_test_state 2 | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES | ||
test just_a_test 23 5 5 | ||
alter table just_a_test drop column state; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES | ||
test just_a_test 28 5 5 | ||
drop table just_a_test; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES | ||
create table just_a_test(id int not null primary key,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30),key(first_name,last_name),key(state)); | ||
insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), | ||
(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), | ||
(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), | ||
(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), | ||
(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); | ||
select count(*) from just_a_test where first_name='fc' and last_name='lc'; | ||
count(*) | ||
1 | ||
select count(*) from just_a_test where state = 'California'; | ||
count(*) | ||
2 | ||
select count(*) from just_a_test where id between 2 and 4; | ||
count(*) | ||
3 | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ | ||
test just_a_test first_name 1 | ||
test just_a_test state 2 | ||
test just_a_test PRIMARY 5 | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES | ||
test just_a_test 8 5 15 | ||
drop table just_a_test; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES | ||
set global userstat=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# | ||
# MDEV-8633: information_schema.index_statistics doesn't delete item when drop table indexes or drop table; | ||
# | ||
set global userstat=1; | ||
create table just_a_test(id int,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30)); | ||
insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), | ||
(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), | ||
(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), | ||
(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), | ||
(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); | ||
alter table just_a_test add primary key (id); | ||
alter table just_a_test add key IND_just_a_test_first_name_last_name(first_name,last_name); | ||
alter table just_a_test add key IND_just_a_test_state(state); | ||
select count(*) from just_a_test where first_name='fc' and last_name='lc'; | ||
select count(*) from just_a_test where state = 'California'; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
alter table just_a_test drop key IND_just_a_test_first_name_last_name; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
alter table just_a_test drop column state; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
drop table just_a_test; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
# | ||
# Test direct drop table | ||
# | ||
create table just_a_test(id int not null primary key,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30),key(first_name,last_name),key(state)); | ||
insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), | ||
(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), | ||
(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), | ||
(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), | ||
(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); | ||
select count(*) from just_a_test where first_name='fc' and last_name='lc'; | ||
select count(*) from just_a_test where state = 'California'; | ||
select count(*) from just_a_test where id between 2 and 4; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
drop table just_a_test; | ||
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; | ||
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; | ||
set global userstat=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.