Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7c9a8780
Commit
7c9a8780
authored
Feb 28, 2012
by
Michael Widenius
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge
parents
4e031fe7
8bd65762
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
29 deletions
+80
-29
mysql-test/suite/maria/r/maria.result
mysql-test/suite/maria/r/maria.result
+19
-19
mysql-test/suite/maria/r/maria3.result
mysql-test/suite/maria/r/maria3.result
+25
-2
mysql-test/suite/maria/t/maria3.test
mysql-test/suite/maria/t/maria3.test
+20
-1
mysql-test/suite/maria/t/optimize.test
mysql-test/suite/maria/t/optimize.test
+2
-2
storage/maria/ha_maria.cc
storage/maria/ha_maria.cc
+7
-4
storage/maria/ma_key_recover.c
storage/maria/ma_key_recover.c
+1
-1
storage/maria/ma_search.c
storage/maria/ma_search.c
+4
-0
storage/maria/ma_write.c
storage/maria/ma_write.c
+2
-0
No files found.
mysql-test/suite/maria/r/maria.result
View file @
7c9a8780
...
...
@@ -340,14 +340,14 @@ Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), KEY t1 (a, b, c, d, e));
ERROR 42000: Specified key was too long; max key length is 1
208
bytes
ERROR 42000: Specified key was too long; max key length is 1
000
bytes
CREATE TABLE t1 (a varchar(32000), unique key(a));
ERROR 42000: Specified key was too long; max key length is 1
208
bytes
ERROR 42000: Specified key was too long; max key length is 1
000
bytes
CREATE TABLE t1 (a varchar(1), b varchar(1), key (a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b));
ERROR 42000: Too many key parts specified; max 32 parts allowed
CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255));
ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
ERROR 42000: Specified key was too long; max key length is 1
208
bytes
ERROR 42000: Specified key was too long; max key length is 1
000
bytes
DROP TABLE t1;
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
...
...
@@ -1551,7 +1551,7 @@ a b
drop table t1;
create table t1 (v varchar(65530), key(v));
Warnings:
Warning 1071 Specified key was too long; max key length is 1
208
bytes
Warning 1071 Specified key was too long; max key length is 1
000
bytes
drop table if exists t1;
create table t1 (v varchar(65536));
Warnings:
...
...
@@ -1789,34 +1789,34 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a varchar(2048), key `a` (a));
Warnings:
Warning 1071 Specified key was too long; max key length is 1
208
bytes
Warning 1071 Specified key was too long; max key length is 1
000
bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
KEY `a` (`a`(1
208
))
KEY `a` (`a`(1
000
))
)
ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024);
Warnings:
Warning 1071 Specified key was too long; max key length is 1
208
bytes
Warning 1071 Specified key was too long; max key length is 1
000
bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
KEY `a` (`a`(1
208
)) KEY_BLOCK_SIZE=8192
KEY `a` (`a`(1
000
)) KEY_BLOCK_SIZE=8192
)
ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024;
Warnings:
Warning 1071 Specified key was too long; max key length is 1
208
bytes
Warning 1071 Specified key was too long; max key length is 1
000
bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
KEY `b` (`b`(1
208
)) KEY_BLOCK_SIZE=8192
KEY `b` (`b`(1
000
)) KEY_BLOCK_SIZE=8192
)
ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=1024
alter table t1 key_block_size=2048;
show create table t1;
...
...
@@ -1825,7 +1825,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
KEY `b` (`b`(1
208
)) KEY_BLOCK_SIZE=8192
KEY `b` (`b`(1
000
)) KEY_BLOCK_SIZE=8192
)
ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=2048
alter table t1 add c int, add key (c);
show create table t1;
...
...
@@ -1835,7 +1835,7 @@ t1 CREATE TABLE `t1` (
`b` varchar(2048) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
KEY `b` (`b`(1
208
)) KEY_BLOCK_SIZE=8192,
KEY `b` (`b`(1
000
)) KEY_BLOCK_SIZE=8192,
KEY `c` (`c`) KEY_BLOCK_SIZE=8192
)
ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=2048
alter table t1 key_block_size=0;
...
...
@@ -1848,33 +1848,33 @@ t1 CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
KEY `b` (`b`(1
208
)) KEY_BLOCK_SIZE=8192,
KEY `b` (`b`(1
000
)) KEY_BLOCK_SIZE=8192,
KEY `c` (`c`) KEY_BLOCK_SIZE=8192,
KEY `d` (`d`)
)
ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192;
Warnings:
Warning 1071 Specified key was too long; max key length is 1
208
bytes
Warning 1071 Specified key was too long; max key length is 1
000
bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`),
KEY `b` (`b`(1
208
))
KEY `b` (`b`(1
000
))
)
ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=8192
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192;
Warnings:
Warning 1071 Specified key was too long; max key length is 1
208
bytes
Warning 1071 Specified key was too long; max key length is 1
000
bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`),
KEY `b` (`b`(1
208
))
KEY `b` (`b`(1
000
))
)
ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=8192
drop table t1;
create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) key_block_size=16384;
...
...
@@ -1897,12 +1897,12 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000);
Warnings:
Warning 1071 Specified key was too long; max key length is 1
208
bytes
Warning 1071 Specified key was too long; max key length is 1
000
bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
KEY `a` (`a`(1
208
)) KEY_BLOCK_SIZE=8192
KEY `a` (`a`(1
000
)) KEY_BLOCK_SIZE=8192
)
ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a int not null, key `a` (a) key_block_size=1025);
...
...
mysql-test/suite/maria/r/maria3.result
View file @
7c9a8780
...
...
@@ -17,12 +17,12 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000);
Warnings:
Warning 1071 Specified key was too long; max key length is 1
208
bytes
Warning 1071 Specified key was too long; max key length is 1
000
bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
KEY `a` (`a`(1
208
)) KEY_BLOCK_SIZE=8192
KEY `a` (`a`(1
000
)) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a int not null, key `a` (a) key_block_size=1025);
...
...
@@ -645,3 +645,26 @@ a b c d e f g h i j
1 A B C D 1 M H
2 Abcdefghi E F G 2 N H
drop table t1,t2;
CREATE TABLE t1 ( a VARCHAR(800),KEY(a) )
ENGINE=Aria DEFAULT CHARACTER SET latin1;
INSERT INTO t1 VALUES
(REPEAT('abc ',200)), (REPEAT('def ',200)),
(REPEAT('ghi ',200)), (REPEAT('jkl ',200));
INSERT INTO t1 SELECT * FROM t1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
ALTER TABLE t1 MODIFY a VARCHAR(800) CHARSET `ucs2`;
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
Warning 1071 Specified key was too long; max key length is 1000 bytes
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SHOW CREATE table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(800) CHARACTER SET ucs2 DEFAULT NULL,
KEY `a` (`a`(500))
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
DROP TABLE t1;
mysql-test/suite/maria/t/maria3.test
View file @
7c9a8780
...
...
@@ -554,9 +554,28 @@ INSERT INTO t2 VALUES (1,'M','','H'),
SELECT
*
FROM
t1
,
t2
WHERE
a
=
g
ORDER
BY
b
;
drop
table
t1
,
t2
;
# End of 5.1 tests
#
# bug#905716: Assertion `page->size <= share->max_index_block_size'
#
CREATE
TABLE
t1
(
a
VARCHAR
(
800
),
KEY
(
a
)
)
ENGINE
=
Aria
DEFAULT
CHARACTER
SET
latin1
;
INSERT
INTO
t1
VALUES
(
REPEAT
(
'abc '
,
200
)),
(
REPEAT
(
'def '
,
200
)),
(
REPEAT
(
'ghi '
,
200
)),
(
REPEAT
(
'jkl '
,
200
));
INSERT
INTO
t1
SELECT
*
FROM
t1
;
# check table is not needed to reproduce the problem,
# but shows that by this time the table appears to be okay.
CHECK
TABLE
t1
;
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
800
)
CHARSET
`ucs2`
;
CHECK
TABLE
t1
;
SHOW
CREATE
table
t1
;
DROP
TABLE
t1
;
# End of 5.2 tests
--
disable_result_log
--
disable_query_log
eval
set
global
storage_engine
=
$default_engine
,
...
...
mysql-test/suite/maria/t/optimize.test
View file @
7c9a8780
This diff is collapsed.
Click to expand it.
storage/maria/ha_maria.cc
View file @
7c9a8780
...
...
@@ -888,8 +888,11 @@ double ha_maria::scan_time()
splitting algorithms depends on this. (With only one key on a page
we also can't use any compression, which may make the index file much
larger)
We use HA_MAX_KEY_BUFF as this is a stack restriction imposed by the
handler interface.
We use HA_MAX_KEY_LENGTH as this is a stack restriction imposed by the
handler interface. If we want to increase this, we have also to
increase HA_MARIA_KEY_BUFF and MARIA_MAX_KEY_BUFF as the buffer needs
to take be able to store the extra lenght bytes that is part of the stored
key.
We also need to reserve place for a record pointer (8) and 3 bytes
per key segment to store the length of the segment + possible null bytes.
...
...
@@ -900,7 +903,7 @@ double ha_maria::scan_time()
uint
ha_maria
::
max_supported_key_length
()
const
{
uint
tmp
=
(
maria_max_key_length
()
-
8
-
HA_MAX_KEY_SEG
*
3
);
return
min
(
HA_MAX_KEY_
BUFF
,
tmp
);
return
min
(
HA_MAX_KEY_
LENGTH
,
tmp
);
}
...
...
@@ -2948,7 +2951,7 @@ void ha_maria::get_auto_increment(ulonglong offset, ulonglong increment,
{
ulonglong
nr
;
int
error
;
uchar
key
[
HA_MAX_KEY_LENGTH
];
uchar
key
[
MARIA_MAX_KEY_BUFF
];
if
(
!
table
->
s
->
next_number_key_offset
)
{
// Autoincrement at key-start
...
...
storage/maria/ma_key_recover.c
View file @
7c9a8780
...
...
@@ -1107,7 +1107,7 @@ uint _ma_apply_redo_index(MARIA_HA *info,
DBUG_PRINT
(
"redo"
,
(
"org_page_length: %u new_page_length: %u"
,
uint2korr
(
header
),
uint2korr
(
header
+
2
)));
DBUG_ASSERT
(
uint2korr
(
header
)
==
page_length
);
new_page_length
=
uint2korr
(
header
+
2
);
new_page_length
=
min
(
uint2korr
(
header
+
2
),
max_page_size
);
header
+=
4
;
break
;
case
KEY_OP_MAX_PAGELENGTH
:
...
...
storage/maria/ma_search.c
View file @
7c9a8780
...
...
@@ -1383,6 +1383,10 @@ uint _ma_get_binary_pack_key(MARIA_KEY *int_key, uint page_flag, uint nod_flag,
memcpy
(
key
,
from
,
length
+
nod_flag
);
*
page_pos
=
from
+
length
+
nod_flag
;
#ifdef USEFUL_FOR_DEBUGGING
DBUG_DUMP
(
"key"
,
int_key
->
data
,
(
uint
)
(
int_key
->
data_length
+
int_key
->
ref_length
));
#endif
DBUG_RETURN
(
int_key
->
data_length
+
int_key
->
ref_length
);
}
...
...
storage/maria/ma_write.c
View file @
7c9a8780
...
...
@@ -715,6 +715,8 @@ static int w_search(register MARIA_HA *info, uint32 comp_flag, MARIA_KEY *key,
{
error
=
_ma_insert
(
info
,
key
,
&
page
,
keypos
,
keybuff
,
father_page
,
father_keypos
,
insert_last
);
if
(
error
<
0
)
goto
err
;
page_mark_changed
(
info
,
&
page
);
if
(
_ma_write_keypage
(
&
page
,
PAGECACHE_LOCK_LEFT_WRITELOCKED
,
DFLT_INIT_HITS
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment