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
d471c968
Commit
d471c968
authored
Aug 13, 2004
by
paul@ice.snake.net
Browse files
Options
Browse Files
Download
Plain Diff
Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1
into ice.snake.net:/Volumes/ice2/MySQL/bk/mysql-4.1
parents
50f77014
1c8b328e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
3 deletions
+51
-3
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+23
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+16
-0
sql/field.cc
sql/field.cc
+4
-0
sql/sql_parse.cc
sql/sql_parse.cc
+8
-3
No files found.
mysql-test/r/ctype_utf8.result
View file @
d471c968
drop table if exists t1;
drop table if exists t2;
set names utf8;
select left(_utf8 0xD0B0D0B1D0B2,1);
left(_utf8 0xD0B0D0B1D0B2,1)
...
...
@@ -246,6 +247,28 @@ select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
ALTER TABLE t1 ADD COLUMN b CHAR(20);
DROP TABLE t1;
set names utf8;
create table t1 (a enum('aaaa','проба') character set utf8);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('aaaa','проба') character set utf8 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('проба');
select * from t1;
a
проба
create table t2 select ifnull(a,a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`ifnull(a,a)` char(5) character set utf8 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t2;
ifnull(a,a)
проба
drop table t1;
drop table t2;
create table t1 (c varchar(30) character set utf8, unique(c(10)));
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
...
...
mysql-test/t/ctype_utf8.test
View file @
d471c968
...
...
@@ -4,6 +4,7 @@
--
disable_warnings
drop
table
if
exists
t1
;
drop
table
if
exists
t2
;
--
enable_warnings
set
names
utf8
;
...
...
@@ -172,6 +173,20 @@ CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
ALTER
TABLE
t1
ADD
COLUMN
b
CHAR
(
20
);
DROP
TABLE
t1
;
# Customer Support Center issue # 3299
# ENUM and SET multibyte fields computed their length wronly
# when converted into a char field
set
names
utf8
;
create
table
t1
(
a
enum
(
'aaaa'
,
'проба'
)
character
set
utf8
);
show
create
table
t1
;
insert
into
t1
values
(
'проба'
);
select
*
from
t1
;
create
table
t2
select
ifnull
(
a
,
a
)
from
t1
;
show
create
table
t2
;
select
*
from
t2
;
drop
table
t1
;
drop
table
t2
;
#
# Bug 4521: unique key prefix interacts poorly with utf8
# Check keys with prefix compression
...
...
@@ -220,3 +235,4 @@ insert into t1 values ('ꪪꪪ');
--
error
1062
insert
into
t1
values
(
'ꪪꪪꪪ'
);
drop
table
t1
;
sql/field.cc
View file @
d471c968
...
...
@@ -5667,6 +5667,10 @@ void create_field::create_length_to_internal_length(void)
pack_length
=
calc_pack_length
(
sql_type
==
FIELD_TYPE_VAR_STRING
?
FIELD_TYPE_STRING
:
sql_type
,
length
);
break
;
case
MYSQL_TYPE_ENUM
:
case
MYSQL_TYPE_SET
:
length
*=
charset
->
mbmaxlen
;
break
;
default:
/* do nothing */
break
;
...
...
sql/sql_parse.cc
View file @
d471c968
...
...
@@ -4381,7 +4381,10 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
new_field
->
length
=
0
;
for
(
const
char
**
pos
=
interval
->
type_names
;
*
pos
;
pos
++
)
{
new_field
->
length
+=
(
uint
)
strip_sp
((
char
*
)
*
pos
)
+
1
;
uint
length
=
(
uint
)
strip_sp
((
char
*
)
*
pos
)
+
1
;
CHARSET_INFO
*
cs
=
thd
->
variables
.
character_set_client
;
length
=
cs
->
cset
->
numchars
(
cs
,
*
pos
,
*
pos
+
length
);
new_field
->
length
+=
length
;
}
new_field
->
length
--
;
set_if_smaller
(
new_field
->
length
,
MAX_FIELD_WIDTH
-
1
);
...
...
@@ -4412,6 +4415,8 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
for
(
const
char
**
pos
=
interval
->
type_names
+
1
;
*
pos
;
pos
++
)
{
uint
length
=
(
uint
)
strip_sp
((
char
*
)
*
pos
);
CHARSET_INFO
*
cs
=
thd
->
variables
.
character_set_client
;
length
=
cs
->
cset
->
numchars
(
cs
,
*
pos
,
*
pos
+
length
);
set_if_bigger
(
new_field
->
length
,
length
);
}
set_if_smaller
(
new_field
->
length
,
MAX_FIELD_WIDTH
-
1
);
...
...
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