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
f385e79a
Commit
f385e79a
authored
Dec 24, 2004
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Plain Diff
4.0 -> 4.1 merge
parents
71da86aa
d1101462
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+7
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+6
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+5
-5
No files found.
mysql-test/r/func_str.result
View file @
f385e79a
...
@@ -691,3 +691,10 @@ select count(*) as total, left(c,10) as reg from t1 group by reg order by reg de
...
@@ -691,3 +691,10 @@ select count(*) as total, left(c,10) as reg from t1 group by reg order by reg de
total reg
total reg
10 2004-12-10
10 2004-12-10
drop table t1;
drop table t1;
select quote(ltrim(concat(' ', 'a')));
quote(ltrim(concat(' ', 'a')))
'a'
select quote(trim(concat(' ', 'a')));
quote(trim(concat(' ', 'a')))
'a'
mysql-test/t/func_str.test
View file @
f385e79a
...
@@ -429,3 +429,9 @@ create table t1 (a int not null primary key, b varchar(40), c datetime);
...
@@ -429,3 +429,9 @@ create table t1 (a int not null primary key, b varchar(40), c datetime);
insert
into
t1
(
a
,
b
,
c
)
values
(
1
,
'Tom'
,
'2004-12-10 12:13:14'
),(
2
,
'ball games'
,
'2004-12-10 12:13:14'
),
(
3
,
'Basil'
,
'2004-12-10 12:13:14'
),
(
4
,
'Dean'
,
'2004-12-10 12:13:14'
),(
5
,
'Ellis'
,
'2004-12-10 12:13:14'
),
(
6
,
'Serg'
,
'2004-12-10 12:13:14'
),
(
7
,
'Sergei'
,
'2004-12-10 12:13:14'
),(
8
,
'Georg'
,
'2004-12-10 12:13:14'
),(
9
,
'Salle'
,
'2004-12-10 12:13:14'
),(
10
,
'Sinisa'
,
'2004-12-10 12:13:14'
);
insert
into
t1
(
a
,
b
,
c
)
values
(
1
,
'Tom'
,
'2004-12-10 12:13:14'
),(
2
,
'ball games'
,
'2004-12-10 12:13:14'
),
(
3
,
'Basil'
,
'2004-12-10 12:13:14'
),
(
4
,
'Dean'
,
'2004-12-10 12:13:14'
),(
5
,
'Ellis'
,
'2004-12-10 12:13:14'
),
(
6
,
'Serg'
,
'2004-12-10 12:13:14'
),
(
7
,
'Sergei'
,
'2004-12-10 12:13:14'
),(
8
,
'Georg'
,
'2004-12-10 12:13:14'
),(
9
,
'Salle'
,
'2004-12-10 12:13:14'
),(
10
,
'Sinisa'
,
'2004-12-10 12:13:14'
);
select
count
(
*
)
as
total
,
left
(
c
,
10
)
as
reg
from
t1
group
by
reg
order
by
reg
desc
limit
0
,
12
;
select
count
(
*
)
as
total
,
left
(
c
,
10
)
as
reg
from
t1
group
by
reg
order
by
reg
desc
limit
0
,
12
;
drop
table
t1
;
drop
table
t1
;
# crashing bug with QUOTE() and LTRIM() or TRIM() fixed
# Bug #7495
#
select
quote
(
ltrim
(
concat
(
' '
,
'a'
)));
select
quote
(
trim
(
concat
(
' '
,
'a'
)));
sql/item_strfunc.cc
View file @
f385e79a
...
@@ -2596,16 +2596,16 @@ String *Item_func_quote::val_str(String *str)
...
@@ -2596,16 +2596,16 @@ String *Item_func_quote::val_str(String *str)
/*
/*
We have to use realloc() instead of alloc() as we want to keep the
We have to use realloc() instead of alloc() as we want to keep the
old result in
str
old result in
arg
*/
*/
if
(
str
->
realloc
(
new_length
))
if
(
arg
->
realloc
(
new_length
))
goto
null
;
goto
null
;
/*
/*
As 'arg' and 'str' may be the same string, we must replace characters
As 'arg' and 'str' may be the same string, we must replace characters
from the end to the beginning
from the end to the beginning
*/
*/
to
=
(
char
*
)
str
->
ptr
()
+
new_length
-
1
;
to
=
(
char
*
)
arg
->
ptr
()
+
new_length
-
1
;
*
to
--=
'\''
;
*
to
--=
'\''
;
for
(
start
=
(
char
*
)
arg
->
ptr
(),
end
=
start
+
arg_length
;
end
--
!=
start
;
to
--
)
for
(
start
=
(
char
*
)
arg
->
ptr
(),
end
=
start
+
arg_length
;
end
--
!=
start
;
to
--
)
{
{
...
@@ -2633,10 +2633,10 @@ String *Item_func_quote::val_str(String *str)
...
@@ -2633,10 +2633,10 @@ String *Item_func_quote::val_str(String *str)
}
}
}
}
*
to
=
'\''
;
*
to
=
'\''
;
str
->
length
(
new_length
);
arg
->
length
(
new_length
);
str
->
set_charset
(
collation
.
collation
);
str
->
set_charset
(
collation
.
collation
);
null_value
=
0
;
null_value
=
0
;
return
str
;
return
arg
;
null:
null:
null_value
=
1
;
null_value
=
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