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
aaecb549
Commit
aaecb549
authored
Apr 14, 2011
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
5.1 -> 5.5 merge
parents
b71c5d51
3abe56f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
4 deletions
+37
-4
mysql-test/r/func_analyse.result
mysql-test/r/func_analyse.result
+13
-0
mysql-test/t/func_analyse.test
mysql-test/t/func_analyse.test
+12
-0
sql/sql_select.cc
sql/sql_select.cc
+12
-4
No files found.
mysql-test/r/func_analyse.result
View file @
aaecb549
...
...
@@ -135,4 +135,17 @@ SELECT * FROM t1 PROCEDURE ANALYSE();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
test.t1.a e e- 1 2 0 0 1.3333 NULL ENUM('e','e-') NOT NULL
DROP TABLE t1;
#
# Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL
#
CREATE TABLE t1(f1 INT) ENGINE=MYISAM;
CREATE TABLE t2(f2 INT) ENGINE=INNODB;
INSERT INTO t2 VALUES (1);
SELECT DISTINCTROW f1 FROM t1 NATURAL RIGHT OUTER JOIN t2 PROCEDURE ANALYSE();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
test.t1.f1 NULL NULL 0 0 0 1 0.0 0.0 CHAR(0)
SELECT * FROM t2 LIMIT 1 PROCEDURE ANALYSE();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
test.t2.f2 1 1 1 1 0 0 1.0000 0.0000 ENUM('1') NOT NULL
DROP TABLE t1, t2;
End of 5.1 tests
mysql-test/t/func_analyse.test
View file @
aaecb549
#
# Test of procedure analyse
#
--
source
include
/
have_innodb
.
inc
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
...
...
@@ -144,4 +145,15 @@ INSERT INTO t1 VALUES ('e'),('e'),('e-');
SELECT
*
FROM
t1
PROCEDURE
ANALYSE
();
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL
--
echo
#
CREATE
TABLE
t1
(
f1
INT
)
ENGINE
=
MYISAM
;
CREATE
TABLE
t2
(
f2
INT
)
ENGINE
=
INNODB
;
INSERT
INTO
t2
VALUES
(
1
);
SELECT
DISTINCTROW
f1
FROM
t1
NATURAL
RIGHT
OUTER
JOIN
t2
PROCEDURE
ANALYSE
();
SELECT
*
FROM
t2
LIMIT
1
PROCEDURE
ANALYSE
();
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.1
tests
sql/sql_select.cc
View file @
aaecb549
...
...
@@ -1972,7 +1972,11 @@ JOIN::exec()
if
(
!
curr_join
->
sort_and_group
&&
curr_join
->
const_tables
!=
curr_join
->
tables
)
curr_join
->
join_tab
[
curr_join
->
const_tables
].
sorted
=
0
;
if
((
tmp_error
=
do_select
(
curr_join
,
(
List
<
Item
>
*
)
0
,
curr_tmp_table
,
0
)))
Procedure
*
save_proc
=
curr_join
->
procedure
;
tmp_error
=
do_select
(
curr_join
,
(
List
<
Item
>
*
)
0
,
curr_tmp_table
,
0
);
curr_join
->
procedure
=
save_proc
;
if
(
tmp_error
)
{
error
=
tmp_error
;
DBUG_VOID_RETURN
;
...
...
@@ -12620,10 +12624,14 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
}
if
(
join
->
having
&&
join
->
having
->
val_int
()
==
0
)
DBUG_RETURN
(
NESTED_LOOP_OK
);
// Didn't match having
error
=
0
;
if
(
join
->
procedure
)
error
=
join
->
procedure
->
send_row
(
join
->
procedure_fields_list
);
else
if
(
join
->
do_send_rows
)
{
if
(
join
->
procedure
->
send_row
(
join
->
procedure_fields_list
))
DBUG_RETURN
(
NESTED_LOOP_ERROR
);
DBUG_RETURN
(
NESTED_LOOP_OK
);
}
error
=
0
;
if
(
join
->
do_send_rows
)
error
=
join
->
result
->
send_data
(
*
join
->
fields
);
if
(
error
)
DBUG_RETURN
(
NESTED_LOOP_ERROR
);
/* purecov: inspected */
...
...
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