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
8186470b
Commit
8186470b
authored
Aug 13, 2004
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctype_utf8.result, ctype_utf8.test, item_strfunc.cc:
LEFT() didn't work well in some cases.
parent
eb5f9437
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+3
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+6
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+5
-3
No files found.
mysql-test/r/ctype_utf8.result
View file @
8186470b
...
...
@@ -93,6 +93,9 @@ 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
select char_length(left(@a:='тест',5)), length(@a), @a;
char_length(left(@a:='тест',5)) length(@a) @a
4 8 тест
create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
show create table t1;
Table Create Table
...
...
mysql-test/t/ctype_utf8.test
View file @
8186470b
...
...
@@ -62,6 +62,12 @@ DROP TABLE t1;
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"
);
#
# LELF() didn't work well with utf8 in some cases too.
#
select
char_length
(
left
(
@
a
:=
'тест'
,
5
)),
length
(
@
a
),
@
a
;
#
# CREATE ... SELECT
#
...
...
sql/item_strfunc.cc
View file @
8186470b
...
...
@@ -977,17 +977,19 @@ String *Item_func_left::val_str(String *str)
DBUG_ASSERT
(
fixed
==
1
);
String
*
res
=
args
[
0
]
->
val_str
(
str
);
long
length
=
(
long
)
args
[
1
]
->
val_int
();
uint
char_pos
;
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
if
(
length
<=
0
)
return
&
my_empty_string
;
if
(
res
->
length
()
<=
(
uint
)
length
)
if
(
res
->
length
()
<=
(
uint
)
length
||
res
->
length
()
<=
(
char_pos
=
res
->
charpos
(
length
)))
return
res
;
if
(
&
str_value
==
res
)
str_value
.
length
(
res
->
charpos
(
length
)
);
str_value
.
length
(
char_pos
);
else
str_value
.
set
(
*
res
,
0
,
res
->
charpos
(
length
)
);
str_value
.
set
(
*
res
,
0
,
char_pos
);
return
&
str_value
;
}
...
...
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