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
50ada0a0
Commit
50ada0a0
authored
Apr 21, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix (Bug #9489: Problem with BIT_OR and MySQL 5.0.3)
parent
564eb3dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
heap/hp_hash.c
heap/hp_hash.c
+11
-0
mysql-test/r/type_varchar.result
mysql-test/r/type_varchar.result
+10
-1
mysql-test/t/type_varchar.test
mysql-test/t/type_varchar.test
+13
-1
No files found.
heap/hp_hash.c
View file @
50ada0a0
...
...
@@ -255,6 +255,9 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
if
(
*
pos
)
/* Found null */
{
nr
^=
(
nr
<<
1
)
|
1
;
/* Add key pack length (2) to key for VARCHAR segments */
if
(
seg
->
type
==
HA_KEYTYPE_VARTEXT1
)
key
+=
2
;
continue
;
}
pos
++
;
...
...
@@ -390,6 +393,9 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
if
(
*
pos
)
{
nr
^=
(
nr
<<
1
)
|
1
;
/* Add key pack length (2) to key for VARCHAR segments */
if
(
seg
->
type
==
HA_KEYTYPE_VARTEXT1
)
key
+=
2
;
continue
;
}
pos
++
;
...
...
@@ -584,7 +590,12 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
if
(
found_null
!=
(
int
)
*
key
++
)
return
1
;
if
(
found_null
)
{
/* Add key pack length (2) to key for VARCHAR segments */
if
(
seg
->
type
==
HA_KEYTYPE_VARTEXT1
)
key
+=
2
;
continue
;
}
}
if
(
seg
->
type
==
HA_KEYTYPE_TEXT
)
{
...
...
mysql-test/r/type_varchar.result
View file @
50ada0a0
drop table if exists t1;
drop table if exists t1
, t2
;
create table t1 (v varchar(30), c char(3), e enum('abc','def','ghi'), t text);
truncate table vchar;
show create table t1;
...
...
@@ -383,3 +383,12 @@ select * from t1;
pkcol othercol
test somethingelse
drop table t1;
create table t1 (a int, b varchar(12));
insert into t1 values (1, 'A'), (22, NULL);
create table t2 (a int);
insert into t2 values (22), (22);
select t1.a, t1.b, min(t1.b) from t1 inner join t2 ON t2.a = t1.a
group by t1.b, t1.a;
a b min(t1.b)
22 NULL NULL
drop table t1, t2;
mysql-test/t/type_varchar.test
View file @
50ada0a0
--
disable_warnings
drop
table
if
exists
t1
;
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
create
table
t1
(
v
varchar
(
30
),
c
char
(
3
),
e
enum
(
'abc'
,
'def'
,
'ghi'
),
t
text
);
...
...
@@ -106,3 +106,15 @@ insert into t1 values ('test', 'something');
update
t1
set
othercol
=
'somethingelse'
where
pkcol
=
'test'
;
select
*
from
t1
;
drop
table
t1
;
#
# Bug #9489: problems with key handling
#
create
table
t1
(
a
int
,
b
varchar
(
12
));
insert
into
t1
values
(
1
,
'A'
),
(
22
,
NULL
);
create
table
t2
(
a
int
);
insert
into
t2
values
(
22
),
(
22
);
select
t1
.
a
,
t1
.
b
,
min
(
t1
.
b
)
from
t1
inner
join
t2
ON
t2
.
a
=
t1
.
a
group
by
t1
.
b
,
t1
.
a
;
drop
table
t1
,
t2
;
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