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
1743883d
Commit
1743883d
authored
Aug 15, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
parents
6db1b018
22c9663d
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
96 additions
and
33 deletions
+96
-33
mysql-test/r/sp-row.result
mysql-test/r/sp-row.result
+10
-0
mysql-test/suite/compat/oracle/r/sp-row.result
mysql-test/suite/compat/oracle/r/sp-row.result
+11
-0
mysql-test/suite/compat/oracle/t/sp-row.test
mysql-test/suite/compat/oracle/t/sp-row.test
+13
-0
mysql-test/t/sp-row.test
mysql-test/t/sp-row.test
+13
-0
sql/item.cc
sql/item.cc
+0
-30
sql/item.h
sql/item.h
+4
-1
sql/sql_type.cc
sql/sql_type.cc
+32
-0
sql/sql_type.h
sql/sql_type.h
+11
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-1
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+1
-1
No files found.
mysql-test/r/sp-row.result
View file @
1743883d
...
...
@@ -2246,3 +2246,13 @@ b
10
DROP PROCEDURE p1;
DROP TABLE t1;
#
# MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
#
BEGIN NOT ATOMIC
DECLARE a ROW(a INT);
EXPLAIN SELECT 1 INTO a.a;
END;
$$
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
mysql-test/suite/compat/oracle/r/sp-row.result
View file @
1743883d
...
...
@@ -3070,3 +3070,14 @@ b
10
DROP PROCEDURE p1;
DROP TABLE t1;
#
# MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
#
DECLARE
a ROW(a INT);
BEGIN
EXPLAIN SELECT 1 INTO a.a;
END;
$$
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
mysql-test/suite/compat/oracle/t/sp-row.test
View file @
1743883d
...
...
@@ -2375,3 +2375,16 @@ DELIMITER ;$$
CALL
p1
;
DROP
PROCEDURE
p1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
--
echo
#
DELIMITER
$$
;
DECLARE
a
ROW
(
a
INT
);
BEGIN
EXPLAIN
SELECT
1
INTO
a
.
a
;
END
;
$$
DELIMITER
;
$$
mysql-test/t/sp-row.test
View file @
1743883d
...
...
@@ -1471,3 +1471,16 @@ DELIMITER ;$$
CALL
p1
;
DROP
PROCEDURE
p1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
--
echo
#
DELIMITER
$$
;
BEGIN
NOT
ATOMIC
DECLARE
a
ROW
(
a
INT
);
EXPLAIN
SELECT
1
INTO
a
.
a
;
END
;
$$
DELIMITER
;
$$
sql/item.cc
View file @
1743883d
...
...
@@ -109,36 +109,6 @@ void Item::push_note_converted_to_positive_complement(THD *thd)
}
/**
@todo
Make this functions class dependent
*/
bool
Item
::
val_bool
()
{
switch
(
result_type
())
{
case
INT_RESULT
:
return
val_int
()
!=
0
;
case
DECIMAL_RESULT
:
{
my_decimal
decimal_value
;
my_decimal
*
val
=
val_decimal
(
&
decimal_value
);
if
(
val
)
return
!
my_decimal_is_zero
(
val
);
return
0
;
}
case
REAL_RESULT
:
case
STRING_RESULT
:
return
val_real
()
!=
0.0
;
case
ROW_RESULT
:
case
TIME_RESULT
:
DBUG_ASSERT
(
0
);
return
0
;
// Wrong (but safe)
}
return
0
;
// Wrong (but safe)
}
/**
Get date/time/datetime.
Optionally extend TIME result to DATETIME.
...
...
sql/item.h
View file @
1743883d
...
...
@@ -1047,7 +1047,10 @@ class Item: public Value_source,
FALSE value is false or NULL
TRUE value is true (not equal to 0)
*/
virtual
bool
val_bool
();
virtual
bool
val_bool
()
{
return
type_handler
()
->
Item_val_bool
(
this
);
}
virtual
String
*
val_nodeset
(
String
*
)
{
return
0
;
}
/*
...
...
sql/sql_type.cc
View file @
1743883d
...
...
@@ -3077,6 +3077,38 @@ bool Type_handler_geometry::
#endif
/*************************************************************************/
bool
Type_handler_real_result
::
Item_val_bool
(
Item
*
item
)
const
{
return
item
->
val_real
()
!=
0.0
;
}
bool
Type_handler_int_result
::
Item_val_bool
(
Item
*
item
)
const
{
return
item
->
val_int
()
!=
0
;
}
bool
Type_handler_decimal_result
::
Item_val_bool
(
Item
*
item
)
const
{
my_decimal
decimal_value
;
my_decimal
*
val
=
item
->
val_decimal
(
&
decimal_value
);
if
(
val
)
return
!
my_decimal_is_zero
(
val
);
return
false
;
}
bool
Type_handler_temporal_result
::
Item_val_bool
(
Item
*
item
)
const
{
return
item
->
val_real
()
!=
0.0
;
}
bool
Type_handler_string_result
::
Item_val_bool
(
Item
*
item
)
const
{
return
item
->
val_real
()
!=
0.0
;
}
/*************************************************************************/
longlong
Type_handler_real_result
::
...
...
sql/sql_type.h
View file @
1743883d
...
...
@@ -891,6 +891,7 @@ class Type_handler
virtual
bool
Item_sum_variance_fix_length_and_dec
(
Item_sum_variance
*
)
const
=
0
;
virtual
bool
Item_val_bool
(
Item
*
item
)
const
=
0
;
virtual
longlong
Item_val_int_signed_typecast
(
Item
*
item
)
const
=
0
;
virtual
longlong
Item_val_int_unsigned_typecast
(
Item
*
item
)
const
=
0
;
...
...
@@ -1147,6 +1148,11 @@ class Type_handler_row: public Type_handler
DBUG_ASSERT
(
0
);
return
true
;
}
bool
Item_val_bool
(
Item
*
item
)
const
{
DBUG_ASSERT
(
0
);
return
false
;
}
longlong
Item_val_int_signed_typecast
(
Item
*
item
)
const
{
DBUG_ASSERT
(
0
);
...
...
@@ -1352,6 +1358,7 @@ class Type_handler_real_result: public Type_handler_numeric
bool
Item_sum_variance_fix_length_and_dec
(
Item_sum_variance
*
)
const
;
bool
Item_func_signed_fix_length_and_dec
(
Item_func_signed
*
item
)
const
;
bool
Item_func_unsigned_fix_length_and_dec
(
Item_func_unsigned
*
item
)
const
;
bool
Item_val_bool
(
Item
*
item
)
const
;
longlong
Item_val_int_signed_typecast
(
Item
*
item
)
const
;
longlong
Item_val_int_unsigned_typecast
(
Item
*
item
)
const
;
String
*
Item_func_hex_val_str_ascii
(
Item_func_hex
*
item
,
String
*
str
)
const
;
...
...
@@ -1427,6 +1434,7 @@ class Type_handler_decimal_result: public Type_handler_numeric
bool
Item_sum_sum_fix_length_and_dec
(
Item_sum_sum
*
)
const
;
bool
Item_sum_avg_fix_length_and_dec
(
Item_sum_avg
*
)
const
;
bool
Item_sum_variance_fix_length_and_dec
(
Item_sum_variance
*
)
const
;
bool
Item_val_bool
(
Item
*
item
)
const
;
longlong
Item_val_int_signed_typecast
(
Item
*
item
)
const
;
longlong
Item_val_int_unsigned_typecast
(
Item
*
item
)
const
;
String
*
Item_func_hex_val_str_ascii
(
Item_func_hex
*
item
,
String
*
str
)
const
;
...
...
@@ -1494,6 +1502,7 @@ class Type_handler_int_result: public Type_handler_numeric
bool
Item_sum_sum_fix_length_and_dec
(
Item_sum_sum
*
)
const
;
bool
Item_sum_avg_fix_length_and_dec
(
Item_sum_avg
*
)
const
;
bool
Item_sum_variance_fix_length_and_dec
(
Item_sum_variance
*
)
const
;
bool
Item_val_bool
(
Item
*
item
)
const
;
longlong
Item_val_int_signed_typecast
(
Item
*
item
)
const
;
longlong
Item_val_int_unsigned_typecast
(
Item
*
item
)
const
;
String
*
Item_func_hex_val_str_ascii
(
Item_func_hex
*
item
,
String
*
str
)
const
;
...
...
@@ -1564,6 +1573,7 @@ class Type_handler_temporal_result: public Type_handler
bool
Item_sum_sum_fix_length_and_dec
(
Item_sum_sum
*
)
const
;
bool
Item_sum_avg_fix_length_and_dec
(
Item_sum_avg
*
)
const
;
bool
Item_sum_variance_fix_length_and_dec
(
Item_sum_variance
*
)
const
;
bool
Item_val_bool
(
Item
*
item
)
const
;
longlong
Item_val_int_signed_typecast
(
Item
*
item
)
const
;
longlong
Item_val_int_unsigned_typecast
(
Item
*
item
)
const
;
String
*
Item_func_hex_val_str_ascii
(
Item_func_hex
*
item
,
String
*
str
)
const
;
...
...
@@ -1673,6 +1683,7 @@ class Type_handler_string_result: public Type_handler
bool
Item_sum_variance_fix_length_and_dec
(
Item_sum_variance
*
)
const
;
bool
Item_func_signed_fix_length_and_dec
(
Item_func_signed
*
item
)
const
;
bool
Item_func_unsigned_fix_length_and_dec
(
Item_func_unsigned
*
item
)
const
;
bool
Item_val_bool
(
Item
*
item
)
const
;
longlong
Item_val_int_signed_typecast
(
Item
*
item
)
const
;
longlong
Item_val_int_unsigned_typecast
(
Item
*
item
)
const
;
String
*
Item_func_hex_val_str_ascii
(
Item_func_hex
*
item
,
String
*
str
)
const
;
...
...
sql/sql_yacc.yy
View file @
1743883d
...
...
@@ -12156,7 +12156,7 @@ select_outvar:
}
| ident '.' ident
{
if (!($$= Lex->create_outvar(thd, &$1, &$3)))
if (!($$= Lex->create_outvar(thd, &$1, &$3))
&& Lex->result
)
MYSQL_YYABORT;
}
;
...
...
sql/sql_yacc_ora.yy
View file @
1743883d
...
...
@@ -12219,7 +12219,7 @@ select_outvar:
}
| ident '.' ident
{
if (!($$= Lex->create_outvar(thd, &$1, &$3)))
if (!($$= Lex->create_outvar(thd, &$1, &$3))
&& Lex->result
)
MYSQL_YYABORT;
}
;
...
...
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