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
ed39e763
Commit
ed39e763
authored
Apr 23, 2009
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#44367 valgrind warnings with find_in_set() functions
init 'wc' variable
parent
0c65370a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletion
+56
-1
mysql-test/r/func_set.result
mysql-test/r/func_set.result
+43
-0
mysql-test/t/func_set.test
mysql-test/t/func_set.test
+12
-0
sql/item_func.cc
sql/item_func.cc
+1
-1
No files found.
mysql-test/r/func_set.result
View file @
ed39e763
...
...
@@ -103,3 +103,46 @@ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL))
8
End of 5.0 tests
drop table if exists t1;
create table t1 (f1 set('test1','test2','test3') character set utf8 default null)
engine=myisam default charset=latin1;
insert into t1 values (''),(null),(null),(''),(''),('');
select find_in_set(f1,f1) as a from t1,(select find_in_set(f1,f1) as b from t1) a;
a
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
drop table t1;
mysql-test/t/func_set.test
View file @
ed39e763
...
...
@@ -72,3 +72,15 @@ SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
CAST
(
DATE
(
NULL
)
AS
DECIMAL
),
CAST
(
DATE
(
NULL
)
AS
DECIMAL
));
--
echo
End
of
5.0
tests
#
# Bug#44367 valgrind warnings with find_in_set() functions
#
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
create
table
t1
(
f1
set
(
'test1'
,
'test2'
,
'test3'
)
character
set
utf8
default
null
)
engine
=
myisam
default
charset
=
latin1
;
insert
into
t1
values
(
''
),(
null
),(
null
),(
''
),(
''
),(
''
);
select
find_in_set
(
f1
,
f1
)
as
a
from
t1
,(
select
find_in_set
(
f1
,
f1
)
as
b
from
t1
)
a
;
drop
table
t1
;
sql/item_func.cc
View file @
ed39e763
...
...
@@ -2716,7 +2716,7 @@ longlong Item_func_find_in_set::val_int()
int
diff
;
if
((
diff
=
buffer
->
length
()
-
find
->
length
())
>=
0
)
{
my_wc_t
wc
;
my_wc_t
wc
=
0
;
CHARSET_INFO
*
cs
=
cmp_collation
.
collation
;
const
char
*
str_begin
=
buffer
->
ptr
();
const
char
*
str_end
=
buffer
->
ptr
();
...
...
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