mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge 11.4 into 11.7
This commit is contained in:
@ -800,58 +800,6 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
3 DERIVED t1 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Using where
|
||||
DROP TABLE t1,t2,h1;
|
||||
DROP VIEW v1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
1600 2400
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
16000 24000
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
48000 72000
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
24000 36000
|
||||
drop table t1;
|
||||
create table t1 (c1 int, index(c1)) engine=heap max_rows=10000;
|
||||
insert into t1 select rand(100000000);
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1 limit 488;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
16000 24000
|
||||
insert into t1 select rand(100000000) from t1 limit 1;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
33024 49024
|
||||
insert into t1 select rand(100000000) from t1 limit 1000;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
49024 73024
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
81024 121024
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
|
@ -549,7 +549,7 @@ CREATE TABLE t1 (
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES (19,5,'h'),(20,5,'h');
|
||||
|
||||
|
||||
CREATE TABLE t2 (col_int_nokey INT);
|
||||
|
||||
INSERT INTO t2 VALUES (1),(2);
|
||||
@ -570,58 +570,6 @@ DROP TABLE t1,t2,h1;
|
||||
DROP VIEW v1;
|
||||
# End of 5.1 tests
|
||||
|
||||
#
|
||||
# Show that MIN_ROWS and MAX_ROWS have an effect on how data_length
|
||||
# and index_length are allocated.
|
||||
# Result is different for 32 / 64 bit machines as pointer lengths are different
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100;
|
||||
insert into t1 values(1);
|
||||
--replace_result 800 1600 1200 2400
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000;
|
||||
insert into t1 values(1);
|
||||
--replace_result 8000 16000 12000 24000
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000;
|
||||
insert into t1 values(1);
|
||||
--replace_result 24000 48000 36000 72000
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000;
|
||||
insert into t1 values(1);
|
||||
--replace_result 12000 24000 18000 36000
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
||||
|
||||
create table t1 (c1 int, index(c1)) engine=heap max_rows=10000;
|
||||
insert into t1 select rand(100000000);
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1 limit 488;
|
||||
--replace_result 8000 16000 12000 24000
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
insert into t1 select rand(100000000) from t1 limit 1;
|
||||
--replace_result 16512 33024 24512 49024
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
insert into t1 select rand(100000000) from t1 limit 1000;
|
||||
--replace_result 24512 49024 36512 73024
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
--replace_result 40512 81024 60512 121024
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# MDEV-5905 Creating tmp. memory table kills the server
|
||||
#
|
||||
|
40
mysql-test/suite/heap/heap_memory_used,32bit.rdiff
Normal file
40
mysql-test/suite/heap/heap_memory_used,32bit.rdiff
Normal file
@ -0,0 +1,40 @@
|
||||
--- suite/heap/heap_memory_used.result
|
||||
+++ suite/heap/heap_memory_used.reject
|
||||
@@ -17,13 +17,13 @@
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
-65504 131040
|
||||
+32736 65504
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
-16352 32736
|
||||
+16352 16352
|
||||
drop table t1;
|
||||
create table t1 (c1 int, index(c1)) engine=heap max_rows=10000;
|
||||
insert into t1 select rand(100000000);
|
||||
@@ -39,17 +39,17 @@
|
||||
insert into t1 select rand(100000000) from t1 limit 488;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
-32704 32704
|
||||
+16352 16352
|
||||
insert into t1 select rand(100000000) from t1 limit 1;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
-32704 32704
|
||||
+16352 16352
|
||||
insert into t1 select rand(100000000) from t1 limit 1000;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
-49056 65408
|
||||
+32704 32704
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
-81760 114464
|
||||
+49056 65408
|
||||
drop table t1;
|
55
mysql-test/suite/heap/heap_memory_used.result
Normal file
55
mysql-test/suite/heap/heap_memory_used.result
Normal file
@ -0,0 +1,55 @@
|
||||
#
|
||||
# Test of heap table memory usage
|
||||
#
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
16352 16352
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
16352 16352
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
65504 131040
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
16352 32736
|
||||
drop table t1;
|
||||
create table t1 (c1 int, index(c1)) engine=heap max_rows=10000;
|
||||
insert into t1 select rand(100000000);
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1 limit 488;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
32704 32704
|
||||
insert into t1 select rand(100000000) from t1 limit 1;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
32704 32704
|
||||
insert into t1 select rand(100000000) from t1 limit 1000;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
49056 65408
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
data_length index_length
|
||||
81760 114464
|
||||
drop table t1;
|
50
mysql-test/suite/heap/heap_memory_used.test
Normal file
50
mysql-test/suite/heap/heap_memory_used.test
Normal file
@ -0,0 +1,50 @@
|
||||
--echo #
|
||||
--echo # Test of heap table memory usage
|
||||
--echo #
|
||||
|
||||
--source include/word_size.inc
|
||||
|
||||
#
|
||||
# Show that MIN_ROWS and MAX_ROWS have an effect on how data_length
|
||||
# and index_length are allocated.
|
||||
# Result is different for 32 / 64 bit machines as pointer lengths are different
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
||||
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000;
|
||||
insert into t1 values(1);
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
||||
|
||||
create table t1 (c1 int, index(c1)) engine=heap max_rows=10000;
|
||||
insert into t1 select rand(100000000);
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
insert into t1 select rand(100000000) from t1 limit 488;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
insert into t1 select rand(100000000) from t1 limit 1;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
insert into t1 select rand(100000000) from t1 limit 1000;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
insert into t1 select rand(100000000) from t1;
|
||||
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
|
||||
drop table t1;
|
Reference in New Issue
Block a user