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
cd7ec53d
Commit
cd7ec53d
authored
Mar 10, 2004
by
ram@gw.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b3036
parents
f75fc89c
8ffd9a91
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+10
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+13
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+1
-1
No files found.
mysql-test/r/func_str.result
View file @
cd7ec53d
...
...
@@ -624,3 +624,13 @@ Note 1003 select high_priority md5(_latin1'hello') AS `md5('hello')`,sha(_latin1
SELECT lpad(12345, 5, "#");
lpad(12345, 5, "#")
12345
create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb');
create table t2 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
insert into t2 values (1,'cccccccccc'), (2,'dddddddddd');
select substring(concat(t1.str, t2.str), 1, 15) "name" from t1, t2
where t2.id=t1.id order by name;
name
aaaaaaaaaaccccc
bbbbbbbbbbddddd
drop table t1, t2;
mysql-test/t/func_str.test
View file @
cd7ec53d
...
...
@@ -360,3 +360,16 @@ explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'moo
#
SELECT
lpad
(
12345
,
5
,
"#"
);
#
# Bug #3089
#
create
table
t1
(
id
int
(
1
),
str
varchar
(
10
))
DEFAULT
CHARSET
=
utf8
;
insert
into
t1
values
(
1
,
'aaaaaaaaaa'
),
(
2
,
'bbbbbbbbbb'
);
create
table
t2
(
id
int
(
1
),
str
varchar
(
10
))
DEFAULT
CHARSET
=
utf8
;
insert
into
t2
values
(
1
,
'cccccccccc'
),
(
2
,
'dddddddddd'
);
select
substring
(
concat
(
t1
.
str
,
t2
.
str
),
1
,
15
)
"name"
from
t1
,
t2
where
t2
.
id
=
t1
.
id
order
by
name
;
drop
table
t1
,
t2
;
sql/item_strfunc.cc
View file @
cd7ec53d
...
...
@@ -1033,7 +1033,7 @@ void Item_func_substr::fix_length_and_dec()
}
if
(
arg_count
==
3
&&
args
[
2
]
->
const_item
())
{
int32
length
=
(
int32
)
args
[
2
]
->
val_int
()
*
default_charset_info
->
mbmaxlen
;
int32
length
=
(
int32
)
args
[
2
]
->
val_int
()
*
collation
.
collation
->
mbmaxlen
;
if
(
length
<=
0
)
max_length
=
0
;
/* purecov: inspected */
else
...
...
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