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
70a3abf2
Commit
70a3abf2
authored
Oct 05, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #5832 SELECT doesn't return records in some cases
parent
48ff8f4d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
1 deletion
+97
-1
mysql-test/r/bdb.result
mysql-test/r/bdb.result
+24
-0
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+24
-0
mysql-test/t/bdb.test
mysql-test/t/bdb.test
+20
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+20
-0
sql/field.cc
sql/field.cc
+9
-1
No files found.
mysql-test/r/bdb.result
View file @
70a3abf2
...
...
@@ -1260,3 +1260,27 @@ a length(a) char_length(a)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 510 255
drop table t1;
SET NAMES latin1;
CREATE TABLE t1 (
id int unsigned NOT NULL auto_increment,
list_id smallint unsigned NOT NULL,
term TEXT NOT NULL,
PRIMARY KEY(id),
INDEX(list_id, term(4))
) ENGINE=BDB CHARSET=utf8;
INSERT INTO t1 SET list_id = 1, term = "letterc";
INSERT INTO t1 SET list_id = 1, term = "letterb";
INSERT INTO t1 SET list_id = 1, term = "lettera";
INSERT INTO t1 SET list_id = 1, term = "letterd";
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterc");
id
1
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb");
id
2
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera");
id
3
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd");
id
4
DROP TABLE t1;
mysql-test/r/ctype_utf8.result
View file @
70a3abf2
...
...
@@ -726,3 +726,27 @@ length(subject)
3
432
DROP TABLE t1;
CREATE TABLE t1 (
id int unsigned NOT NULL auto_increment,
list_id smallint unsigned NOT NULL,
term TEXT NOT NULL,
PRIMARY KEY(id),
INDEX(list_id, term(4))
) ENGINE=MYISAM CHARSET=utf8;
INSERT INTO t1 SET list_id = 1, term = "letterc";
INSERT INTO t1 SET list_id = 1, term = "letterb";
INSERT INTO t1 SET list_id = 1, term = "lettera";
INSERT INTO t1 SET list_id = 1, term = "letterd";
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterc");
id
1
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb");
id
2
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera");
id
3
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd");
id
4
DROP TABLE t1;
mysql-test/t/bdb.test
View file @
70a3abf2
...
...
@@ -909,3 +909,23 @@ insert into t1 values (@a);
select
a
,
length
(
a
),
char_length
(
a
)
from
t1
;
drop
table
t1
;
SET
NAMES
latin1
;
#
# Bug #5832 SELECT doesn't return records in some cases
#
CREATE
TABLE
t1
(
id
int
unsigned
NOT
NULL
auto_increment
,
list_id
smallint
unsigned
NOT
NULL
,
term
TEXT
NOT
NULL
,
PRIMARY
KEY
(
id
),
INDEX
(
list_id
,
term
(
4
))
)
ENGINE
=
BDB
CHARSET
=
utf8
;
INSERT
INTO
t1
SET
list_id
=
1
,
term
=
"letterc"
;
INSERT
INTO
t1
SET
list_id
=
1
,
term
=
"letterb"
;
INSERT
INTO
t1
SET
list_id
=
1
,
term
=
"lettera"
;
INSERT
INTO
t1
SET
list_id
=
1
,
term
=
"letterd"
;
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"letterc"
);
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"letterb"
);
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"lettera"
);
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"letterd"
);
DROP
TABLE
t1
;
mysql-test/t/ctype_utf8.test
View file @
70a3abf2
...
...
@@ -572,3 +572,23 @@ INSERT INTO t1 VALUES ('aaa','bbb');
SELECT
length
(
subject
)
FROM
t1
;
SELECT
length
(
subject
)
FROM
t1
ORDER
BY
1
;
DROP
TABLE
t1
;
#
# Bug #5832 SELECT doesn't return records in some cases
#
CREATE
TABLE
t1
(
id
int
unsigned
NOT
NULL
auto_increment
,
list_id
smallint
unsigned
NOT
NULL
,
term
TEXT
NOT
NULL
,
PRIMARY
KEY
(
id
),
INDEX
(
list_id
,
term
(
4
))
)
ENGINE
=
MYISAM
CHARSET
=
utf8
;
INSERT
INTO
t1
SET
list_id
=
1
,
term
=
"letterc"
;
INSERT
INTO
t1
SET
list_id
=
1
,
term
=
"letterb"
;
INSERT
INTO
t1
SET
list_id
=
1
,
term
=
"lettera"
;
INSERT
INTO
t1
SET
list_id
=
1
,
term
=
"letterd"
;
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"letterc"
);
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"letterb"
);
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"lettera"
);
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"letterd"
);
DROP
TABLE
t1
;
sql/field.cc
View file @
70a3abf2
...
...
@@ -5077,6 +5077,11 @@ void Field_blob::get_key_image(char *buff,uint length,
}
#endif
/*HAVE_SPATIAL*/
get_ptr
(
&
blob
);
uint
char_length
=
length
/
cs
->
mbmaxlen
;
char_length
=
my_charpos
(
cs
,
blob
,
blob
+
length
,
char_length
);
set_if_smaller
(
length
,
char_length
);
if
((
uint32
)
length
>
blob_length
)
{
/*
...
...
@@ -5087,7 +5092,6 @@ void Field_blob::get_key_image(char *buff,uint length,
length
=
(
uint
)
blob_length
;
}
int2store
(
buff
,
length
);
get_ptr
(
&
blob
);
memcpy
(
buff
+
HA_KEY_BLOB_LENGTH
,
blob
,
length
);
}
...
...
@@ -5103,6 +5107,10 @@ int Field_blob::key_cmp(const byte *key_ptr, uint max_key_length)
char
*
blob1
;
uint
blob_length
=
get_length
(
ptr
);
memcpy_fixed
(
&
blob1
,
ptr
+
packlength
,
sizeof
(
char
*
));
CHARSET_INFO
*
cs
=
charset
();
uint
char_length
=
max_key_length
/
cs
->
mbmaxlen
;
char_length
=
my_charpos
(
cs
,
blob1
,
blob1
+
blob_length
,
char_length
);
set_if_smaller
(
blob_length
,
char_length
);
return
Field_blob
::
cmp
(
blob1
,
min
(
blob_length
,
max_key_length
),
(
char
*
)
key_ptr
+
HA_KEY_BLOB_LENGTH
,
uint2korr
(
key_ptr
));
...
...
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