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
3a8da923
Commit
3a8da923
authored
Dec 09, 2008
by
Patrick Crews
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
46e47185
ed61dee6
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
4 deletions
+95
-4
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+16
-0
mysql-test/r/type_bit.result
mysql-test/r/type_bit.result
+26
-0
mysql-test/t/alter_table.test
mysql-test/t/alter_table.test
+13
-0
mysql-test/t/type_bit.test
mysql-test/t/type_bit.test
+30
-0
sql/sql_select.cc
sql/sql_select.cc
+6
-2
sql/sql_table.cc
sql/sql_table.cc
+4
-2
No files found.
mysql-test/r/alter_table.result
View file @
3a8da923
...
...
@@ -996,6 +996,22 @@ SELECT * FROM t1;
v b
abc 5
DROP TABLE t1;
create table t1 (a tinytext character set latin1);
alter table t1 convert to character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text
) ENGINE=MyISAM DEFAULT CHARSET=utf8
drop table t1;
create table t1 (a mediumtext character set latin1);
alter table t1 convert to character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` longtext
) ENGINE=MyISAM DEFAULT CHARSET=utf8
drop table t1;
End of 5.0 tests
drop table if exists t1, t2, t3;
create table t1 (i int);
...
...
mysql-test/r/type_bit.result
View file @
3a8da923
...
...
@@ -723,6 +723,32 @@ CREATE TABLE IF NOT EXISTS t1 (
f1 bit(2) NOT NULL default b''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
ERROR 42000: Invalid default value for 'f1'
create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
create table t2bit7 (b1 bit(7)) engine=MyISAM;
insert into t1bit7 values (b'1100000');
insert into t1bit7 values (b'1100001');
insert into t1bit7 values (b'1100010');
insert into t2bit7 values (b'1100001');
insert into t2bit7 values (b'1100010');
insert into t2bit7 values (b'1100110');
select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
bin(a1)
1100001
1100010
drop table t1bit7, t2bit7;
create table t1bit7 (a1 bit(15) not null) engine=MyISAM;
create table t2bit7 (b1 bit(15)) engine=MyISAM;
insert into t1bit7 values (b'110000011111111');
insert into t1bit7 values (b'110000111111111');
insert into t1bit7 values (b'110001011111111');
insert into t2bit7 values (b'110000111111111');
insert into t2bit7 values (b'110001011111111');
insert into t2bit7 values (b'110011011111111');
select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
bin(a1)
110000111111111
110001011111111
drop table t1bit7, t2bit7;
End of 5.0 tests
create table t1(a bit(7));
insert into t1 values(0x40);
...
...
mysql-test/t/alter_table.test
View file @
3a8da923
...
...
@@ -751,6 +751,19 @@ ALTER TABLE t1 MODIFY COLUMN v VARCHAR(4);
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
#
# Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types
#
create
table
t1
(
a
tinytext
character
set
latin1
);
alter
table
t1
convert
to
character
set
utf8
;
show
create
table
t1
;
drop
table
t1
;
create
table
t1
(
a
mediumtext
character
set
latin1
);
alter
table
t1
convert
to
character
set
utf8
;
show
create
table
t1
;
drop
table
t1
;
--
echo
End
of
5.0
tests
#
...
...
mysql-test/t/type_bit.test
View file @
3a8da923
...
...
@@ -367,6 +367,36 @@ CREATE TABLE IF NOT EXISTS t1 (
f1
bit
(
2
)
NOT
NULL
default
b
''
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
COLLATE
=
latin1_general_ci
;
#
# Bug#31399 Wrong query result when doing join buffering over BIT fields
#
create
table
t1bit7
(
a1
bit
(
7
)
not
null
)
engine
=
MyISAM
;
create
table
t2bit7
(
b1
bit
(
7
))
engine
=
MyISAM
;
insert
into
t1bit7
values
(
b
'1100000'
);
insert
into
t1bit7
values
(
b
'1100001'
);
insert
into
t1bit7
values
(
b
'1100010'
);
insert
into
t2bit7
values
(
b
'1100001'
);
insert
into
t2bit7
values
(
b
'1100010'
);
insert
into
t2bit7
values
(
b
'1100110'
);
select
bin
(
a1
)
from
t1bit7
,
t2bit7
where
t1bit7
.
a1
=
t2bit7
.
b1
;
drop
table
t1bit7
,
t2bit7
;
create
table
t1bit7
(
a1
bit
(
15
)
not
null
)
engine
=
MyISAM
;
create
table
t2bit7
(
b1
bit
(
15
))
engine
=
MyISAM
;
insert
into
t1bit7
values
(
b
'110000011111111'
);
insert
into
t1bit7
values
(
b
'110000111111111'
);
insert
into
t1bit7
values
(
b
'110001011111111'
);
insert
into
t2bit7
values
(
b
'110000111111111'
);
insert
into
t2bit7
values
(
b
'110001011111111'
);
insert
into
t2bit7
values
(
b
'110011011111111'
);
select
bin
(
a1
)
from
t1bit7
,
t2bit7
where
t1bit7
.
a1
=
t2bit7
.
b1
;
drop
table
t1bit7
,
t2bit7
;
--
echo
End
of
5.0
tests
#
...
...
sql/sql_select.cc
View file @
3a8da923
...
...
@@ -13856,6 +13856,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
length
=
0
;
for
(
i
=
0
;
i
<
table_count
;
i
++
)
{
bool
have_bit_fields
=
FALSE
;
uint
null_fields
=
0
,
used_fields
;
Field
**
f_ptr
,
*
field
;
MY_BITMAP
*
read_set
=
tables
[
i
].
table
->
read_set
;
...
...
@@ -13870,13 +13871,16 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
length
+=
field
->
fill_cache_field
(
copy
);
if
(
copy
->
blob_field
)
(
*
blob_ptr
++
)
=
copy
;
if
(
field
->
maybe_null
())
if
(
field
->
real_
maybe_null
())
null_fields
++
;
if
(
field
->
type
()
==
MYSQL_TYPE_BIT
&&
((
Field_bit
*
)
field
)
->
bit_len
)
have_bit_fields
=
TRUE
;
copy
++
;
}
}
/* Copy null bits from table */
if
(
null_fields
&&
tables
[
i
].
table
->
s
->
null
_fields
)
if
(
null_fields
||
have_bit
_fields
)
{
/* must copy null bits */
copy
->
str
=
tables
[
i
].
table
->
null_flags
;
copy
->
length
=
tables
[
i
].
table
->
s
->
null_bytes
;
...
...
sql/sql_table.cc
View file @
3a8da923
...
...
@@ -3114,7 +3114,9 @@ static bool prepare_blob_field(THD *thd, Create_field *sql_field)
if
((
sql_field
->
flags
&
BLOB_FLAG
)
&&
sql_field
->
length
)
{
if
(
sql_field
->
sql_type
==
MYSQL_TYPE_BLOB
)
if
(
sql_field
->
sql_type
==
FIELD_TYPE_BLOB
||
sql_field
->
sql_type
==
FIELD_TYPE_TINY_BLOB
||
sql_field
->
sql_type
==
FIELD_TYPE_MEDIUM_BLOB
)
{
/* The user has given a length to the blob column */
sql_field
->
sql_type
=
get_blob_type_from_length
(
sql_field
->
length
);
...
...
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