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
db2b729c
Commit
db2b729c
authored
Apr 26, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix (bug #10176: problem with varchar keys).
parent
50ada0a0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
0 deletions
+40
-0
myisam/mi_key.c
myisam/mi_key.c
+3
-0
mysql-test/include/varchar.inc
mysql-test/include/varchar.inc
+10
-0
mysql-test/r/bdb.result
mysql-test/r/bdb.result
+9
-0
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+9
-0
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+9
-0
No files found.
myisam/mi_key.c
View file @
db2b729c
...
@@ -242,7 +242,10 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
...
@@ -242,7 +242,10 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
{
{
k_length
-=
length
;
k_length
-=
length
;
if
(
keyseg
->
flag
&
(
HA_VAR_LENGTH_PART
|
HA_BLOB_PART
))
if
(
keyseg
->
flag
&
(
HA_VAR_LENGTH_PART
|
HA_BLOB_PART
))
{
k_length
-=
2
;
/* Skip length */
k_length
-=
2
;
/* Skip length */
old
+=
2
;
}
continue
;
/* Found NULL */
continue
;
/* Found NULL */
}
}
}
}
...
...
mysql-test/include/varchar.inc
View file @
db2b729c
...
@@ -226,3 +226,13 @@ create table t1 (v varchar(65530), key(v(10)));
...
@@ -226,3 +226,13 @@ create table t1 (v varchar(65530), key(v(10)));
insert
into
t1
values
(
repeat
(
'a'
,
65530
));
insert
into
t1
values
(
repeat
(
'a'
,
65530
));
select
length
(
v
)
from
t1
where
v
=
repeat
(
'a'
,
65530
);
select
length
(
v
)
from
t1
where
v
=
repeat
(
'a'
,
65530
);
drop
table
t1
;
drop
table
t1
;
#
# Bug #9489: problem with hash indexes
#
create
table
t1
(
a
int
,
b
varchar
(
12
),
key
ba
(
b
,
a
));
insert
into
t1
values
(
1
,
'A'
),
(
20
,
NULL
);
explain
select
*
from
t1
where
a
=
20
and
b
is
null
;
select
*
from
t1
where
a
=
20
and
b
is
null
;
drop
table
t1
;
mysql-test/r/bdb.result
View file @
db2b729c
...
@@ -1858,6 +1858,15 @@ select length(v) from t1 where v=repeat('a',65530);
...
@@ -1858,6 +1858,15 @@ select length(v) from t1 where v=repeat('a',65530);
length(v)
length(v)
65530
65530
drop table t1;
drop table t1;
create table t1(a int, b varchar(12), key ba(b, a));
insert into t1 values (1, 'A'), (20, NULL);
explain select * from t1 where a=20 and b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref ba ba 20 const,const 1 Using where
select * from t1 where a=20 and b is null;
a b
20 NULL
drop table t1;
create table t1 (v varchar(65530), key(v));
create table t1 (v varchar(65530), key(v));
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 255 bytes
...
...
mysql-test/r/innodb.result
View file @
db2b729c
...
@@ -2359,6 +2359,15 @@ select length(v) from t1 where v=repeat('a',65530);
...
@@ -2359,6 +2359,15 @@ select length(v) from t1 where v=repeat('a',65530);
length(v)
length(v)
65530
65530
drop table t1;
drop table t1;
create table t1(a int, b varchar(12), key ba(b, a));
insert into t1 values (1, 'A'), (20, NULL);
explain select * from t1 where a=20 and b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref ba ba 20 const,const 1 Using where; Using index
select * from t1 where a=20 and b is null;
a b
20 NULL
drop table t1;
create table t1 (v varchar(65530), key(v));
create table t1 (v varchar(65530), key(v));
ERROR HY000: Can't create table './test/t1' (errno: 139)
ERROR HY000: Can't create table './test/t1' (errno: 139)
create table t1 (v varchar(65536));
create table t1 (v varchar(65536));
...
...
mysql-test/r/myisam.result
View file @
db2b729c
...
@@ -1157,6 +1157,15 @@ select length(v) from t1 where v=repeat('a',65530);
...
@@ -1157,6 +1157,15 @@ select length(v) from t1 where v=repeat('a',65530);
length(v)
length(v)
65530
65530
drop table t1;
drop table t1;
create table t1(a int, b varchar(12), key ba(b, a));
insert into t1 values (1, 'A'), (20, NULL);
explain select * from t1 where a=20 and b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref ba ba 20 const,const 1 Using where; Using index
select * from t1 where a=20 and b is null;
a b
20 NULL
drop table t1;
create table t1 (v varchar(65530), key(v));
create table t1 (v varchar(65530), key(v));
Warnings:
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
...
...
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