mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
358327618d
- Added --disable_query_log ; begin ; .... commit; --enable_query_log around all while loops that does insert
627 lines
49 KiB
Text
627 lines
49 KiB
Text
---- Partitioning and char data type
|
||
create table t1 (a char(255) not null, primary key(a)) engine='MyISAM'
|
||
partition by key (a) (
|
||
partition pa1 max_rows=20 min_rows=2,
|
||
partition pa2 max_rows=30 min_rows=3,
|
||
partition pa3 max_rows=30 min_rows=4,
|
||
partition pa4 max_rows=40 min_rows=2);
|
||
show create table t1;
|
||
Table Create Table
|
||
t1 CREATE TABLE `t1` (
|
||
`a` char(255) NOT NULL,
|
||
PRIMARY KEY (`a`)
|
||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||
/*!50100 PARTITION BY KEY (a)
|
||
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
|
||
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
|
||
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
|
||
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
|
||
insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64));
|
||
select * from t1;
|
||
a
|
||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||
b
|
||
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||
select * from t1 where a='b';
|
||
a
|
||
b
|
||
update t1 set a='bb' where a='b';
|
||
delete from t1 where a='bb';
|
||
select * from t1;
|
||
a
|
||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||
drop table t1;
|
||
create table t2 (a char(255) not null, primary key(a)) engine='MyISAM'
|
||
partition by key (a) partitions 27;
|
||
show create table t2;
|
||
Table Create Table
|
||
t2 CREATE TABLE `t2` (
|
||
`a` char(255) NOT NULL,
|
||
PRIMARY KEY (`a`)
|
||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||
/*!50100 PARTITION BY KEY (a)
|
||
PARTITIONS 27 */
|
||
26 inserts;
|
||
select count(*) from t2;
|
||
count(*)
|
||
26
|
||
select * from t2;
|
||
a
|
||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
|
||
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
|
||
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
|
||
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
|
||
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
|
||
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
|
||
lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
|
||
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
|
||
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
|
||
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
|
||
ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
|
||
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
|
||
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
|
||
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||
ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
|
||
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
|
||
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
|
||
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
|
||
drop table t2;
|
||
---- Partitioning and binary data type
|
||
create table t1 (a binary(255) not null, primary key(a)) engine='MyISAM'
|
||
partition by key (a) (
|
||
partition pa1 max_rows=20 min_rows=2,
|
||
partition pa2 max_rows=30 min_rows=3,
|
||
partition pa3 max_rows=30 min_rows=4,
|
||
partition pa4 max_rows=40 min_rows=2);
|
||
show create table t1;
|
||
Table Create Table
|
||
t1 CREATE TABLE `t1` (
|
||
`a` binary(255) NOT NULL,
|
||
PRIMARY KEY (`a`)
|
||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||
/*!50100 PARTITION BY KEY (a)
|
||
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
|
||
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
|
||
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
|
||
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
|
||
insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64));
|
||
select hex(a) from t1;
|
||
hex(a)
|
||
616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||
616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161
|
||
620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||
626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||
select a from t1 where substr(a,1,2)='b\0';
|
||
a
|
||
b |