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
9dc05f1f
Commit
9dc05f1f
authored
Nov 05, 2021
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-25610 Assertion `escape != -1' failed in Item_func_like::val_int
parent
322fc4f4
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1123 additions
and
2 deletions
+1123
-2
mysql-test/r/ctype_cp850.result
mysql-test/r/ctype_cp850.result
+1050
-0
mysql-test/r/ctype_cp866.result
mysql-test/r/ctype_cp866.result
+12
-0
mysql-test/t/ctype_cp850.test
mysql-test/t/ctype_cp850.test
+32
-0
mysql-test/t/ctype_cp866.test
mysql-test/t/ctype_cp866.test
+14
-0
sql/item.h
sql/item.h
+13
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+2
-2
No files found.
mysql-test/r/ctype_cp850.result
View file @
9dc05f1f
This diff is collapsed.
Click to expand it.
mysql-test/r/ctype_cp866.result
0 → 100644
View file @
9dc05f1f
#
# Start of 10.2 tests
#
#
# MDEV-25610 Assertion `escape != -1' failed in Item_func_like::val_int
#
SELECT _cp866'' LIKE _cp866'' ESCAPE _cp866 0xFF;
_cp866'' LIKE _cp866'' ESCAPE _cp866 0xFF
1
#
# End of 10.2 tests
#
mysql-test/t/ctype_cp850.test
View file @
9dc05f1f
...
...
@@ -14,3 +14,35 @@ DROP TABLE t1;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
--
echo
#
--
echo
# Start of 10.2 tests
--
echo
#
--
echo
#
--
echo
# MDEV-25610 Assertion `escape != -1' failed in Item_func_like::val_int
--
echo
#
SET
NAMES
cp850
;
SELECT
''
LIKE
''
ESCAPE
_cp850
0xFF
;
DELIMITER
$$
;
BEGIN
NOT
ATOMIC
DECLARE
ch
INT
DEFAULT
0x00
;
DECLARE
query
TEXT
DEFAULT
'SELECT _cp850'''' LIKE _cp850'''' ESCAPE _cp850 0xFF'
;
WHILE
ch
<=
0xFF
DO
SET
@
query
=
REPLACE
(
query
,
'FF'
,
CONV
(
ch
,
10
,
16
));
SELECT
@
query
;
PREPARE
stmt
FROM
@
query
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
SET
ch
=
ch
+
1
;
END
WHILE
;
END
;
$$
DELIMITER
;
$$
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
mysql-test/t/ctype_cp866.test
0 → 100644
View file @
9dc05f1f
--
echo
#
--
echo
# Start of 10.2 tests
--
echo
#
--
echo
#
--
echo
# MDEV-25610 Assertion `escape != -1' failed in Item_func_like::val_int
--
echo
#
SELECT
_cp866
''
LIKE
_cp866
''
ESCAPE
_cp866
0xFF
;
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
sql/item.h
View file @
9dc05f1f
...
...
@@ -6236,6 +6236,19 @@ class Item_iterator_row: public Item_iterator
};
/*
fix_escape_item() sets the out "escape" parameter to:
- native code in case of an 8bit character set
- Unicode code point in case of a multi-byte character set
The value meaning a not-initialized ESCAPE character must not be equal to
any valid value, so must be outside of these ranges:
- -128..+127, not to conflict with a valid 8bit charcter
- 0..0x10FFFF, not to conflict with a valid Unicode code point
The exact value does not matter.
*/
#define ESCAPE_NOT_INITIALIZED -1000
/*
It's used in ::fix_fields() methods of LIKE and JSON_SEARCH
functions to handle the ESCAPE parameter.
...
...
sql/item_cmpfunc.cc
View file @
9dc05f1f
...
...
@@ -5266,7 +5266,7 @@ void Item_func_like::print(String *str, enum_query_type query_type)
longlong
Item_func_like
::
val_int
()
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
escape
!=
-
1
);
DBUG_ASSERT
(
escape
!=
ESCAPE_NOT_INITIALIZED
);
String
*
res
=
args
[
0
]
->
val_str
(
&
cmp_value1
);
if
(
args
[
0
]
->
null_value
)
{
...
...
@@ -5370,7 +5370,7 @@ bool fix_escape_item(THD *thd, Item *escape_item, String *tmp_str,
return
TRUE
;
}
IF_DBUG
(
*
escape
=
-
1
,);
IF_DBUG
(
*
escape
=
ESCAPE_NOT_INITIALIZED
,);
if
(
escape_item
->
const_item
())
{
...
...
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