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
a08780df
Commit
a08780df
authored
Jun 24, 2010
by
Ramil Kalimullin
Browse files
Options
Browse Files
Download
Plain Diff
Automerge.
parents
8b9e56b7
9b07b12b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
5 deletions
+34
-5
mysql-test/r/func_like.result
mysql-test/r/func_like.result
+14
-0
mysql-test/t/func_like.test
mysql-test/t/func_like.test
+16
-2
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+4
-3
No files found.
mysql-test/r/func_like.result
View file @
a08780df
...
...
@@ -169,3 +169,17 @@ select 'andre%' like 'andre
select _cp1251'andre%' like convert('andre%' using cp1251) escape '';
_cp1251'andre%' like convert('andre%' using cp1251) escape ''
1
End of 4.1 tests
#
# Bug #54575: crash when joining tables with unique set column
#
CREATE TABLE t1(a SET('a') NOT NULL, UNIQUE KEY(a));
CREATE TABLE t2(b INT PRIMARY KEY);
INSERT INTO t1 VALUES ();
Warnings:
Warning 1364 Field 'a' doesn't have a default value
INSERT INTO t2 VALUES (1), (2), (3);
SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
1
DROP TABLE t1, t2;
End of 5.1 tests
mysql-test/t/func_like.test
View file @
a08780df
...
...
@@ -112,5 +112,19 @@ select 'andre%' like 'andre
#
select
_cp1251
'andre%'
like
convert
(
'andre%'
using
cp1251
)
escape
''
;
#
# End of 4.1 tests
--
echo
End
of
4.1
tests
--
echo
#
--
echo
# Bug #54575: crash when joining tables with unique set column
--
echo
#
CREATE
TABLE
t1
(
a
SET
(
'a'
)
NOT
NULL
,
UNIQUE
KEY
(
a
));
CREATE
TABLE
t2
(
b
INT
PRIMARY
KEY
);
INSERT
INTO
t1
VALUES
();
INSERT
INTO
t2
VALUES
(
1
),
(
2
),
(
3
);
SELECT
1
FROM
t2
JOIN
t1
ON
1
LIKE
a
GROUP
BY
a
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.1
tests
sql/item_cmpfunc.cc
View file @
a08780df
...
...
@@ -4578,13 +4578,14 @@ Item_func::optimize_type Item_func_like::select_optimize() const
if
(
args
[
1
]
->
const_item
())
{
String
*
res2
=
args
[
1
]
->
val_str
((
String
*
)
&
cmp
.
value2
);
const
char
*
ptr2
;
if
(
!
res2
)
if
(
!
res2
||
!
(
ptr2
=
res2
->
ptr
())
)
return
OPTIMIZE_NONE
;
if
(
*
res2
->
ptr
()
!=
wild_many
)
if
(
*
ptr2
!=
wild_many
)
{
if
(
args
[
0
]
->
result_type
()
!=
STRING_RESULT
||
*
res2
->
ptr
()
!=
wild_one
)
if
(
args
[
0
]
->
result_type
()
!=
STRING_RESULT
||
*
ptr2
!=
wild_one
)
return
OPTIMIZE_OP
;
}
}
...
...
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