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
72c473ec
Commit
72c473ec
authored
Feb 05, 2005
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/psergey/mysql-4.1-bug7816
into mysql.com:/home/psergey/mysql-5.0-bug7716
parents
d017a604
38339e1c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
0 deletions
+50
-0
mysql-test/r/func_misc.result
mysql-test/r/func_misc.result
+21
-0
mysql-test/t/func_misc.test
mysql-test/t/func_misc.test
+15
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+4
-0
sql/sql_string.h
sql/sql_string.h
+10
-0
No files found.
mysql-test/r/func_misc.result
View file @
72c473ec
...
@@ -28,3 +28,24 @@ length(format('nan', 2)) > 0
...
@@ -28,3 +28,24 @@ length(format('nan', 2)) > 0
select concat("$",format(2500,2));
select concat("$",format(2500,2));
concat("$",format(2500,2))
concat("$",format(2500,2))
$2,500.00
$2,500.00
create table t1 ( a timestamp );
insert into t1 values ( '2004-01-06 12:34' );
select a from t1 where left(a+0,6) in ( left(20040106,6) );
a
2004-01-06 12:34:00
select a from t1 where left(a+0,6) = ( left(20040106,6) );
a
2004-01-06 12:34:00
select a from t1 where right(a+0,6) in ( right(20040106123400,6) );
a
2004-01-06 12:34:00
select a from t1 where right(a+0,6) = ( right(20040106123400,6) );
a
2004-01-06 12:34:00
select a from t1 where mid(a+0,6,3) in ( mid(20040106123400,6,3) );
a
2004-01-06 12:34:00
select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) );
a
2004-01-06 12:34:00
drop table t1;
mysql-test/t/func_misc.test
View file @
72c473ec
...
@@ -23,3 +23,18 @@ select length(format('nan', 2)) > 0;
...
@@ -23,3 +23,18 @@ select length(format('nan', 2)) > 0;
# Test for bug #628
# Test for bug #628
#
#
select
concat
(
"$"
,
format
(
2500
,
2
));
select
concat
(
"$"
,
format
(
2500
,
2
));
# Test for BUG#7716
create
table
t1
(
a
timestamp
);
insert
into
t1
values
(
'2004-01-06 12:34'
);
select
a
from
t1
where
left
(
a
+
0
,
6
)
in
(
left
(
20040106
,
6
)
);
select
a
from
t1
where
left
(
a
+
0
,
6
)
=
(
left
(
20040106
,
6
)
);
select
a
from
t1
where
right
(
a
+
0
,
6
)
in
(
right
(
20040106123400
,
6
)
);
select
a
from
t1
where
right
(
a
+
0
,
6
)
=
(
right
(
20040106123400
,
6
)
);
select
a
from
t1
where
mid
(
a
+
0
,
6
,
3
)
in
(
mid
(
20040106123400
,
6
,
3
)
);
select
a
from
t1
where
mid
(
a
+
0
,
6
,
3
)
=
(
mid
(
20040106123400
,
6
,
3
)
);
drop
table
t1
;
sql/item_cmpfunc.cc
View file @
72c473ec
...
@@ -1530,7 +1530,11 @@ void in_string::set(uint pos,Item *item)
...
@@ -1530,7 +1530,11 @@ void in_string::set(uint pos,Item *item)
String
*
str
=
((
String
*
)
base
)
+
pos
;
String
*
str
=
((
String
*
)
base
)
+
pos
;
String
*
res
=
item
->
val_str
(
str
);
String
*
res
=
item
->
val_str
(
str
);
if
(
res
&&
res
!=
str
)
if
(
res
&&
res
!=
str
)
{
if
(
res
->
uses_buffer_owned_by
(
str
))
res
->
copy
();
*
str
=
*
res
;
*
str
=
*
res
;
}
if
(
!
str
->
charset
())
if
(
!
str
->
charset
())
{
{
CHARSET_INFO
*
cs
;
CHARSET_INFO
*
cs
;
...
...
sql/sql_string.h
View file @
72c473ec
...
@@ -210,6 +210,11 @@ public:
...
@@ -210,6 +210,11 @@ public:
{
{
if
(
&
s
!=
this
)
if
(
&
s
!=
this
)
{
{
/*
It is forbidden to do assignments like
some_string = substring_of_that_string
*/
DBUG_ASSERT
(
!
s
.
uses_buffer_owned_by
(
this
));
free
();
free
();
Ptr
=
s
.
Ptr
;
str_length
=
s
.
str_length
;
Alloced_length
=
s
.
Alloced_length
;
Ptr
=
s
.
Ptr
;
str_length
=
s
.
str_length
;
Alloced_length
=
s
.
Alloced_length
;
alloced
=
0
;
alloced
=
0
;
...
@@ -343,4 +348,9 @@ public:
...
@@ -343,4 +348,9 @@ public:
/* Swap two string objects. Efficient way to exchange data without memcpy. */
/* Swap two string objects. Efficient way to exchange data without memcpy. */
void
swap
(
String
&
s
);
void
swap
(
String
&
s
);
inline
bool
uses_buffer_owned_by
(
const
String
*
s
)
const
{
return
(
s
->
alloced
&&
Ptr
>=
s
->
Ptr
&&
Ptr
<
s
->
Ptr
+
s
->
str_length
);
}
};
};
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