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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7ff24eb0
Commit
7ff24eb0
authored
Feb 20, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
longer myisam keys
parent
5c741829
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
54 additions
and
19 deletions
+54
-19
include/myisam.h
include/myisam.h
+1
-1
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+2
-2
mysql-test/r/key.result
mysql-test/r/key.result
+21
-0
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+5
-5
mysql-test/r/type_blob.result
mysql-test/r/type_blob.result
+5
-5
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+1
-1
mysql-test/t/key.test
mysql-test/t/key.test
+13
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+3
-3
mysql-test/t/type_blob.test
mysql-test/t/type_blob.test
+2
-2
sql/ha_myisam.h
sql/ha_myisam.h
+1
-0
No files found.
include/myisam.h
View file @
7ff24eb0
...
@@ -38,7 +38,7 @@ extern "C" {
...
@@ -38,7 +38,7 @@ extern "C" {
/* The following defines can be increased if necessary */
/* The following defines can be increased if necessary */
#define MI_MAX_KEY 32
/* Max allowed keys */
#define MI_MAX_KEY 32
/* Max allowed keys */
#define MI_MAX_KEY_SEG 16
/* Max segments for key */
#define MI_MAX_KEY_SEG 16
/* Max segments for key */
#define MI_MAX_KEY_LENGTH
5
00
#define MI_MAX_KEY_LENGTH
10
00
#define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8)
#define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8)
#define MI_MAX_POSSIBLE_KEY_BUFF (1024+6+6)
/* For myisam_chk */
#define MI_MAX_POSSIBLE_KEY_BUFF (1024+6+6)
/* For myisam_chk */
...
...
mysql-test/r/ctype_utf8.result
View file @
7ff24eb0
...
@@ -167,5 +167,5 @@ select hex(s1) from t1;
...
@@ -167,5 +167,5 @@ select hex(s1) from t1;
hex(s1)
hex(s1)
41
41
drop table t1;
drop table t1;
create table t1 (a
char(160) character set utf8, primary key(a
));
create table t1 (a
text character set utf8, primary key(a(360)
));
ERROR 42000: Specified key was too long; max key length is
255
bytes
ERROR 42000: Specified key was too long; max key length is
1000
bytes
mysql-test/r/key.result
View file @
7ff24eb0
...
@@ -185,3 +185,24 @@ NULL 2
...
@@ -185,3 +185,24 @@ NULL 2
a 1
a 1
a 2
a 2
drop table t1;
drop table t1;
create table t1 (i int, a char(200), b text, unique (a), unique (b(300))) charset utf8;
insert t1 values (1, repeat('a',210), repeat('b', 310));
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert t1 values (2, repeat(0xD0B1,215), repeat(0xD0B1, 310));
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
select i, length(a), length(b), char_length(a), char_length(b) from t1;
i length(a) length(b) char_length(a) char_length(b)
1 200 310 200 310
2 400 620 200 310
select i from t1 where a=repeat(_utf8 'a',200);
i
1
select i from t1 where a=repeat(_utf8 0xD0B1,200);
i
2
select i from t1 where b=repeat(_utf8 'b',310);
i
1
drop table t1;
mysql-test/r/myisam.result
View file @
7ff24eb0
...
@@ -322,11 +322,11 @@ CHECK TABLE t1;
...
@@ -322,11 +322,11 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check status OK
drop table t1;
drop table t1;
CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255),
KEY t1 (a, b, c
));
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
5
00 bytes
ERROR 42000: Specified key was too long; max key length is
10
00 bytes
CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255));
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);
ALTER TABLE t1 ADD INDEX t1 (a, b, c
, d, e
);
ERROR 42000: Specified key was too long; max key length is
5
00 bytes
ERROR 42000: Specified key was too long; max key length is
10
00 bytes
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
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);
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
...
...
mysql-test/r/type_blob.result
View file @
7ff24eb0
...
@@ -346,16 +346,16 @@ HELLO MY 1
...
@@ -346,16 +346,16 @@ HELLO MY 1
a 1
a 1
hello 1
hello 1
drop table t1;
drop table t1;
create table t1 (a text, unique (a(
3
00)));
create table t1 (a text, unique (a(
21
00)));
ERROR 42000: Specified key was too long; max key length is
255
bytes
ERROR 42000: Specified key was too long; max key length is
1000
bytes
create table t1 (a text, key (a(
3
00)));
create table t1 (a text, key (a(
21
00)));
Warnings:
Warnings:
Warning 1071 Specified key was too long; max key length is
255
bytes
Warning 1071 Specified key was too long; max key length is
1000
bytes
show create table t1;
show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
`a` text,
`a` text,
KEY `a` (`a`(
255
))
KEY `a` (`a`(
1000
))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
drop table t1;
CREATE TABLE t1 (
CREATE TABLE t1 (
...
...
mysql-test/t/ctype_utf8.test
View file @
7ff24eb0
...
@@ -104,4 +104,4 @@ drop table t1;
...
@@ -104,4 +104,4 @@ drop table t1;
# UTF8 breaks primary keys for cols > 85 characters
# UTF8 breaks primary keys for cols > 85 characters
#
#
--
error
1071
--
error
1071
create
table
t1
(
a
char
(
160
)
character
set
utf8
,
primary
key
(
a
));
create
table
t1
(
a
text
character
set
utf8
,
primary
key
(
a
(
360
)
));
mysql-test/t/key.test
View file @
7ff24eb0
...
@@ -191,3 +191,16 @@ SELECT * FROM t1;
...
@@ -191,3 +191,16 @@ SELECT * FROM t1;
INSERT
INTO
t1
(
c
)
VALUES
(
'a'
),(
'a'
);
INSERT
INTO
t1
(
c
)
VALUES
(
'a'
),(
'a'
);
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
drop
table
t1
;
drop
table
t1
;
#
# longer keys
#
create
table
t1
(
i
int
,
a
char
(
200
),
b
text
,
unique
(
a
),
unique
(
b
(
300
)))
charset
utf8
;
insert
t1
values
(
1
,
repeat
(
'a'
,
210
),
repeat
(
'b'
,
310
));
insert
t1
values
(
2
,
repeat
(
0xD0B1
,
215
),
repeat
(
0xD0B1
,
310
));
select
i
,
length
(
a
),
length
(
b
),
char_length
(
a
),
char_length
(
b
)
from
t1
;
select
i
from
t1
where
a
=
repeat
(
_utf8
'a'
,
200
);
select
i
from
t1
where
a
=
repeat
(
_utf8
0xD0B1
,
200
);
select
i
from
t1
where
b
=
repeat
(
_utf8
'b'
,
310
);
drop
table
t1
;
mysql-test/t/myisam.test
View file @
7ff24eb0
...
@@ -337,10 +337,10 @@ drop table t1;
...
@@ -337,10 +337,10 @@ drop table t1;
#
#
--
error
1071
--
error
1071
CREATE
TABLE
t1
(
a
varchar
(
255
),
b
varchar
(
255
),
c
varchar
(
255
),
KEY
t1
(
a
,
b
,
c
));
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
));
CREATE
TABLE
t1
(
a
varchar
(
255
),
b
varchar
(
255
),
c
varchar
(
255
));
CREATE
TABLE
t1
(
a
varchar
(
255
),
b
varchar
(
255
),
c
varchar
(
255
)
,
d
varchar
(
255
),
e
varchar
(
255
)
);
--
error
1071
--
error
1071
ALTER
TABLE
t1
ADD
INDEX
t1
(
a
,
b
,
c
);
ALTER
TABLE
t1
ADD
INDEX
t1
(
a
,
b
,
c
,
d
,
e
);
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
#
...
...
mysql-test/t/type_blob.test
View file @
7ff24eb0
...
@@ -122,8 +122,8 @@ select d,count(*) from t1 group by d;
...
@@ -122,8 +122,8 @@ select d,count(*) from t1 group by d;
drop
table
t1
;
drop
table
t1
;
--
error
1071
--
error
1071
create
table
t1
(
a
text
,
unique
(
a
(
3
00
)));
# should give an error
create
table
t1
(
a
text
,
unique
(
a
(
21
00
)));
# should give an error
create
table
t1
(
a
text
,
key
(
a
(
3
00
)));
# key is auto-truncated
create
table
t1
(
a
text
,
key
(
a
(
21
00
)));
# key is auto-truncated
show
create
table
t1
;
show
create
table
t1
;
drop
table
t1
;
drop
table
t1
;
...
...
sql/ha_myisam.h
View file @
7ff24eb0
...
@@ -65,6 +65,7 @@ class ha_myisam: public handler
...
@@ -65,6 +65,7 @@ class ha_myisam: public handler
uint
max_keys
()
const
{
return
MI_MAX_KEY
;
}
uint
max_keys
()
const
{
return
MI_MAX_KEY
;
}
uint
max_key_parts
()
const
{
return
MAX_REF_PARTS
;
}
uint
max_key_parts
()
const
{
return
MAX_REF_PARTS
;
}
uint
max_key_length
()
const
{
return
MI_MAX_KEY_LENGTH
;
}
uint
max_key_length
()
const
{
return
MI_MAX_KEY_LENGTH
;
}
uint
max_key_part_length
()
{
return
MI_MAX_KEY_LENGTH
;
}
uint
checksum
()
const
;
uint
checksum
()
const
;
int
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
);
int
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
);
...
...
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