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
06de76ae
Commit
06de76ae
authored
Jan 19, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
field length convertion (bytes->chars) should be done with rounding UP.
parent
62e9ab45
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+11
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+12
-0
sql/field.cc
sql/field.cc
+3
-3
No files found.
mysql-test/r/ctype_utf8.result
View file @
06de76ae
drop table if exists t1;
set names utf8;
select left(_utf8 0xD0B0D0B1D0B2,1);
left(_utf8 0xD0B0D0B1D0B2,1)
...
...
@@ -68,3 +69,13 @@ this is a test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b
create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` char(4) character set utf8 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
2004-01-19
drop table t1;
mysql-test/t/ctype_utf8.test
View file @
06de76ae
...
...
@@ -2,6 +2,9 @@
# Tests with the utf8 character set
#
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
set
names
utf8
;
select
left
(
_utf8
0xD0B0D0B1D0B2
,
1
);
...
...
@@ -41,3 +44,12 @@ select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%');
#
select
insert
(
'txs'
,
2
,
1
,
'hi'
),
insert
(
'is '
,
4
,
0
,
'a'
),
insert
(
'txxxxt'
,
2
,
4
,
'es'
);
select
insert
(
"aa"
,
100
,
1
,
"b"
),
insert
(
"aa"
,
1
,
3
,
"b"
);
#
# CREATE ... SELECT
#
create
table
t1
select
date_format
(
"2004-01-19 10:10:10"
,
"%Y-%m-%d"
);
show
create
table
t1
;
select
*
from
t1
;
drop
table
t1
;
sql/field.cc
View file @
06de76ae
...
...
@@ -5611,16 +5611,16 @@ create_field::create_field(Field *old_field,Field *orig_field)
case
3
:
sql_type
=
FIELD_TYPE_MEDIUM_BLOB
;
break
;
default:
sql_type
=
FIELD_TYPE_LONG_BLOB
;
break
;
}
length
/=
charset
->
mbmaxlen
;
// QQ: Probably not needed
length
=
(
length
+
charset
->
mbmaxlen
-
1
)
/
charset
->
mbmaxlen
;
// QQ: Probably not needed
break
;
case
FIELD_TYPE_STRING
:
case
FIELD_TYPE_VAR_STRING
:
length
/=
charset
->
mbmaxlen
;
length
=
(
length
+
charset
->
mbmaxlen
-
1
)
/
charset
->
mbmaxlen
;
break
;
default:
break
;
}
decimals
=
old_field
->
decimals
();
if
(
sql_type
==
FIELD_TYPE_STRING
)
{
...
...
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