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
8750df43
Commit
8750df43
authored
Sep 07, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-20517 Assertion `!is_expensive()' failed in Item::value_depends_on_sql_mode_const_item
parent
39e5b76e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
13 deletions
+32
-13
mysql-test/r/func_misc.result
mysql-test/r/func_misc.result
+9
-0
mysql-test/t/func_misc.test
mysql-test/t/func_misc.test
+6
-0
sql/item_func.cc
sql/item_func.cc
+12
-7
sql/item_func.h
sql/item_func.h
+5
-6
No files found.
mysql-test/r/func_misc.result
View file @
8750df43
...
...
@@ -1557,5 +1557,14 @@ numgtfmt
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-20517 Assertion `!is_expensive()' failed in Item::value_depends_on_sql_mode_const_item
#
SELECT ( 1 LIKE GET_LOCK( 'foo', 0 ) ) - 2;
( 1 LIKE GET_LOCK( 'foo', 0 ) ) - 2
-1
SELECT RELEASE_LOCK('foo');
RELEASE_LOCK('foo')
1
#
# End of 10.2 tests
#
mysql-test/t/func_misc.test
View file @
8750df43
...
...
@@ -1192,6 +1192,12 @@ SELECT * FROM v1 WHERE numgtfmt = NAME_CONST('wnumgtfmt',_utf8'QEDITIONS' COLLA
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-20517 Assertion `!is_expensive()' failed in Item::value_depends_on_sql_mode_const_item
--
echo
#
SELECT
(
1
LIKE
GET_LOCK
(
'foo'
,
0
)
)
-
2
;
SELECT
RELEASE_LOCK
(
'foo'
);
--
echo
#
--
echo
# End of 10.2 tests
...
...
sql/item_func.cc
View file @
8750df43
...
...
@@ -1423,17 +1423,22 @@ bool Item_func_minus::fix_length_and_dec()
{
if
(
Item_num_op
::
fix_length_and_dec
())
return
TRUE
;
m_sql_mode_dependency
=
Item_func
::
value_depends_on_sql_mode
();
if
(
unsigned_flag
)
{
m_sql_mode_dependency
|=
Sql_mode_dependency
(
0
,
MODE_NO_UNSIGNED_SUBTRACTION
);
if
(
current_thd
->
variables
.
sql_mode
&
MODE_NO_UNSIGNED_SUBTRACTION
)
if
((
m_depends_on_sql_mode_no_unsigned_subtraction
=
unsigned_flag
)
&&
(
current_thd
->
variables
.
sql_mode
&
MODE_NO_UNSIGNED_SUBTRACTION
))
unsigned_flag
=
false
;
}
return
FALSE
;
}
Sql_mode_dependency
Item_func_minus
::
value_depends_on_sql_mode
()
const
{
Sql_mode_dependency
dep
=
Item_func_additive_op
::
value_depends_on_sql_mode
();
if
(
m_depends_on_sql_mode_no_unsigned_subtraction
)
dep
|=
Sql_mode_dependency
(
0
,
MODE_NO_UNSIGNED_SUBTRACTION
);
return
dep
;
}
double
Item_func_minus
::
real_op
()
{
double
value
=
args
[
0
]
->
val_real
()
-
args
[
1
]
->
val_real
();
...
...
sql/item_func.h
View file @
8750df43
...
...
@@ -773,16 +773,15 @@ class Item_func_plus :public Item_func_additive_op
class
Item_func_minus
:
public
Item_func_additive_op
{
Sql_mode_dependency
m_sql_mode_dependency
;
bool
m_depends_on_sql_mode_no_unsigned_subtraction
;
public:
Item_func_minus
(
THD
*
thd
,
Item
*
a
,
Item
*
b
)
:
Item_func_additive_op
(
thd
,
a
,
b
)
{}
Item_func_additive_op
(
thd
,
a
,
b
),
m_depends_on_sql_mode_no_unsigned_subtraction
(
false
)
{
}
const
char
*
func_name
()
const
{
return
"-"
;
}
enum
precedence
precedence
()
const
{
return
ADD_PRECEDENCE
;
}
Sql_mode_dependency
value_depends_on_sql_mode
()
const
{
return
m_sql_mode_dependency
;
}
Sql_mode_dependency
value_depends_on_sql_mode
()
const
;
longlong
int_op
();
double
real_op
();
my_decimal
*
decimal_op
(
my_decimal
*
);
...
...
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