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
cfc8a2e8
Commit
cfc8a2e8
authored
Feb 07, 2008
by
mattiasj@witty.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge witty.ndb.mysql.com:/Users/mattiasj/clones/mysql-5.1-bug34225
into witty.ndb.mysql.com:/Users/mattiasj/clones/51-topush
parents
8b941ba5
11923a5e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
10 deletions
+42
-10
mysql-test/r/partition_datatype.result
mysql-test/r/partition_datatype.result
+14
-0
mysql-test/t/partition_datatype.test
mysql-test/t/partition_datatype.test
+10
-10
sql/field.cc
sql/field.cc
+17
-0
sql/field.h
sql/field.h
+1
-0
No files found.
mysql-test/r/partition_datatype.result
View file @
cfc8a2e8
drop table if exists t1;
drop table if exists t1;
# test with not null
create table t1 (a bit not null) partition by key (a);
insert into t1 values (b'1');
select hex(a) from t1 where a = b'1';
hex(a)
1
drop table t1;
create table t1 (a tinyint not null) partition by key (a);
create table t1 (a tinyint not null) partition by key (a);
insert into t1 values (2);
insert into t1 values (2);
select * from t1 where a = 2;
select * from t1 where a = 2;
...
@@ -125,6 +132,13 @@ select * from t1 where a = 'y';
...
@@ -125,6 +132,13 @@ select * from t1 where a = 'y';
a
a
y
y
drop table t1;
drop table t1;
# test with null allowed
create table t1 (a bit) partition by key (a);
insert into t1 values (b'1');
select hex(a) from t1 where a = b'1';
hex(a)
1
drop table t1;
create table t1 (a tinyint) partition by key (a);
create table t1 (a tinyint) partition by key (a);
insert into t1 values (2);
insert into t1 values (2);
select * from t1 where a = 2;
select * from t1 where a = 2;
...
...
mysql-test/t/partition_datatype.test
View file @
cfc8a2e8
...
@@ -11,11 +11,11 @@
...
@@ -11,11 +11,11 @@
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
--
enable_warnings
--
enable_warnings
# FIXME: disabled this test because of valgrind error
--
echo
# test with not null
#
create table t1 (a bit not null) partition by key (a);
create
table
t1
(
a
bit
not
null
)
partition
by
key
(
a
);
#
insert into t1 values (b'1');
insert
into
t1
values
(
b
'1'
);
#select *
from t1 where a = b'1';
select
hex
(
a
)
from
t1
where
a
=
b
'1'
;
#
drop table t1;
drop
table
t1
;
create
table
t1
(
a
tinyint
not
null
)
partition
by
key
(
a
);
create
table
t1
(
a
tinyint
not
null
)
partition
by
key
(
a
);
insert
into
t1
values
(
2
);
insert
into
t1
values
(
2
);
select
*
from
t1
where
a
=
2
;
select
*
from
t1
where
a
=
2
;
...
@@ -100,11 +100,11 @@ create table t1 (a set('y','n') not null) partition by key (a);
...
@@ -100,11 +100,11 @@ create table t1 (a set('y','n') not null) partition by key (a);
insert
into
t1
values
(
'y'
);
insert
into
t1
values
(
'y'
);
select
*
from
t1
where
a
=
'y'
;
select
*
from
t1
where
a
=
'y'
;
drop
table
t1
;
drop
table
t1
;
# FIXME: disabled this test because of valgrind error
--
echo
# test with null allowed
#
create table t1 (a bit) partition by key (a);
create
table
t1
(
a
bit
)
partition
by
key
(
a
);
#
insert into t1 values (b'1');
insert
into
t1
values
(
b
'1'
);
#select *
from t1 where a = b'1';
select
hex
(
a
)
from
t1
where
a
=
b
'1'
;
#
drop table t1;
drop
table
t1
;
create
table
t1
(
a
tinyint
)
partition
by
key
(
a
);
create
table
t1
(
a
tinyint
)
partition
by
key
(
a
);
insert
into
t1
values
(
2
);
insert
into
t1
values
(
2
);
select
*
from
t1
where
a
=
2
;
select
*
from
t1
where
a
=
2
;
...
...
sql/field.cc
View file @
cfc8a2e8
...
@@ -8793,6 +8793,23 @@ Field_bit::Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
...
@@ -8793,6 +8793,23 @@ Field_bit::Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
}
}
void
Field_bit
::
hash
(
ulong
*
nr
,
ulong
*
nr2
)
{
if
(
is_null
())
{
*
nr
^=
(
*
nr
<<
1
)
|
1
;
}
else
{
CHARSET_INFO
*
cs
=
&
my_charset_bin
;
longlong
value
=
Field_bit
::
val_int
();
uchar
tmp
[
8
];
mi_int8store
(
tmp
,
value
);
cs
->
coll
->
hash_sort
(
cs
,
tmp
,
8
,
nr
,
nr2
);
}
}
size_t
size_t
Field_bit
::
do_last_null_byte
()
const
Field_bit
::
do_last_null_byte
()
const
{
{
...
...
sql/field.h
View file @
cfc8a2e8
...
@@ -1904,6 +1904,7 @@ public:
...
@@ -1904,6 +1904,7 @@ public:
Field
::
move_field_offset
(
ptr_diff
);
Field
::
move_field_offset
(
ptr_diff
);
bit_ptr
=
ADD_TO_PTR
(
bit_ptr
,
ptr_diff
,
uchar
*
);
bit_ptr
=
ADD_TO_PTR
(
bit_ptr
,
ptr_diff
,
uchar
*
);
}
}
void
hash
(
ulong
*
nr
,
ulong
*
nr2
);
private:
private:
virtual
size_t
do_last_null_byte
()
const
;
virtual
size_t
do_last_null_byte
()
const
;
...
...
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