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
78683672
Commit
78683672
authored
Apr 03, 2013
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge 5.3 -> 5.5
parents
599a1384
763af1a8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
10 deletions
+46
-10
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+10
-0
mysql-test/r/subselect_sj_jcl6.result
mysql-test/r/subselect_sj_jcl6.result
+10
-0
mysql-test/t/subselect_sj.test
mysql-test/t/subselect_sj.test
+9
-0
sql/opt_range.cc
sql/opt_range.cc
+8
-7
sql/opt_range.h
sql/opt_range.h
+3
-3
sql/opt_subselect.cc
sql/opt_subselect.cc
+6
-0
No files found.
mysql-test/r/subselect_sj.result
View file @
78683672
...
...
@@ -2783,6 +2783,16 @@ a b
deallocate prepare stmt;
drop table t1,t2;
#
# MDEV-4335: Unexpected results when selecting on information_schema
#
CREATE TABLE t1 (db VARCHAR(64) DEFAULT NULL);
INSERT INTO t1 VALUES ('mysql'),('information_schema');
SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA);
db
mysql
information_schema
DROP TABLE t1;
#
# MySQL Bug#13340270: assertion table->sort.record_pointers == __null
#
CREATE TABLE t1 (
...
...
mysql-test/r/subselect_sj_jcl6.result
View file @
78683672
...
...
@@ -2797,6 +2797,16 @@ a b
deallocate prepare stmt;
drop table t1,t2;
#
# MDEV-4335: Unexpected results when selecting on information_schema
#
CREATE TABLE t1 (db VARCHAR(64) DEFAULT NULL);
INSERT INTO t1 VALUES ('mysql'),('information_schema');
SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA);
db
information_schema
mysql
DROP TABLE t1;
#
# MySQL Bug#13340270: assertion table->sort.record_pointers == __null
#
CREATE TABLE t1 (
...
...
mysql-test/t/subselect_sj.test
View file @
78683672
...
...
@@ -2481,6 +2481,15 @@ execute stmt;
deallocate
prepare
stmt
;
drop
table
t1
,
t2
;
--
echo
#
--
echo
# MDEV-4335: Unexpected results when selecting on information_schema
--
echo
#
CREATE
TABLE
t1
(
db
VARCHAR
(
64
)
DEFAULT
NULL
);
INSERT
INTO
t1
VALUES
(
'mysql'
),(
'information_schema'
);
SELECT
*
FROM
t1
WHERE
db
IN
(
SELECT
`SCHEMA_NAME`
FROM
information_schema
.
SCHEMATA
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# MySQL Bug#13340270: assertion table->sort.record_pointers == __null
--
echo
#
...
...
sql/opt_range.cc
View file @
78683672
...
...
@@ -1996,7 +1996,7 @@ int QUICK_ROR_INTERSECT_SELECT::init()
1 error
*/
int
QUICK_RANGE_SELECT
::
init_ror_merged_scan
(
bool
reuse_handler
)
int
QUICK_RANGE_SELECT
::
init_ror_merged_scan
(
bool
reuse_handler
,
MEM_ROOT
*
alloc
)
{
handler
*
save_file
=
file
,
*
org_file
;
my_bool
org_key_read
;
...
...
@@ -2024,7 +2024,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
DBUG_RETURN
(
0
);
}
if
(
!
(
file
=
head
->
file
->
clone
(
head
->
s
->
normalized_path
.
str
,
thd
->
mem_root
)))
if
(
!
(
file
=
head
->
file
->
clone
(
head
->
s
->
normalized_path
.
str
,
alloc
)))
{
/*
Manually set the error flag. Note: there seems to be quite a few
...
...
@@ -2125,7 +2125,8 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
0 OK
other error code
*/
int
QUICK_ROR_INTERSECT_SELECT
::
init_ror_merged_scan
(
bool
reuse_handler
)
int
QUICK_ROR_INTERSECT_SELECT
::
init_ror_merged_scan
(
bool
reuse_handler
,
MEM_ROOT
*
alloc
)
{
List_iterator_fast
<
QUICK_SELECT_WITH_RECORD
>
quick_it
(
quick_selects
);
QUICK_SELECT_WITH_RECORD
*
cur
;
...
...
@@ -2142,7 +2143,7 @@ int QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan(bool reuse_handler)
There is no use of this->file. Use it for the first of merged range
selects.
*/
int
error
=
quick
->
init_ror_merged_scan
(
TRUE
);
int
error
=
quick
->
init_ror_merged_scan
(
TRUE
,
alloc
);
if
(
error
)
DBUG_RETURN
(
error
);
quick
->
file
->
extra
(
HA_EXTRA_KEYREAD_PRESERVE_FIELDS
);
...
...
@@ -2154,7 +2155,7 @@ int QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan(bool reuse_handler)
const
MY_BITMAP
*
const
save_read_set
=
quick
->
head
->
read_set
;
const
MY_BITMAP
*
const
save_write_set
=
quick
->
head
->
write_set
;
#endif
if
(
quick
->
init_ror_merged_scan
(
FALSE
))
if
(
quick
->
init_ror_merged_scan
(
FALSE
,
alloc
))
DBUG_RETURN
(
1
);
quick
->
file
->
extra
(
HA_EXTRA_KEYREAD_PRESERVE_FIELDS
);
...
...
@@ -2188,7 +2189,7 @@ int QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan(bool reuse_handler)
int
QUICK_ROR_INTERSECT_SELECT
::
reset
()
{
DBUG_ENTER
(
"QUICK_ROR_INTERSECT_SELECT::reset"
);
if
(
!
scans_inited
&&
init_ror_merged_scan
(
TRUE
))
if
(
!
scans_inited
&&
init_ror_merged_scan
(
TRUE
,
&
alloc
))
DBUG_RETURN
(
1
);
scans_inited
=
TRUE
;
List_iterator_fast
<
QUICK_SELECT_WITH_RECORD
>
it
(
quick_selects
);
...
...
@@ -2324,7 +2325,7 @@ int QUICK_ROR_UNION_SELECT::reset()
List_iterator_fast
<
QUICK_SELECT_I
>
it
(
quick_selects
);
while
((
quick
=
it
++
))
{
if
(
quick
->
init_ror_merged_scan
(
FALSE
))
if
(
quick
->
init_ror_merged_scan
(
FALSE
,
&
alloc
))
DBUG_RETURN
(
1
);
}
scans_inited
=
TRUE
;
...
...
sql/opt_range.h
View file @
78683672
...
...
@@ -323,7 +323,7 @@ class QUICK_SELECT_I
0 Ok
other Error
*/
virtual
int
init_ror_merged_scan
(
bool
reuse_handler
)
virtual
int
init_ror_merged_scan
(
bool
reuse_handler
,
MEM_ROOT
*
alloc
)
{
DBUG_ASSERT
(
0
);
return
1
;
}
/*
...
...
@@ -473,7 +473,7 @@ class QUICK_RANGE_SELECT : public QUICK_SELECT_I
uchar
*
cur_prefix
);
bool
reverse_sorted
()
{
return
0
;
}
bool
unique_key_range
();
int
init_ror_merged_scan
(
bool
reuse_handler
);
int
init_ror_merged_scan
(
bool
reuse_handler
,
MEM_ROOT
*
alloc
);
void
save_last_pos
()
{
file
->
position
(
record
);
}
int
get_type
()
{
return
QS_TYPE_RANGE
;
}
...
...
@@ -722,7 +722,7 @@ class QUICK_ROR_INTERSECT_SELECT : public QUICK_SELECT_I
#ifndef DBUG_OFF
void
dbug_dump
(
int
indent
,
bool
verbose
);
#endif
int
init_ror_merged_scan
(
bool
reuse_handler
);
int
init_ror_merged_scan
(
bool
reuse_handler
,
MEM_ROOT
*
alloc
);
bool
push_quick_back
(
MEM_ROOT
*
alloc
,
QUICK_RANGE_SELECT
*
quick_sel_range
);
class
QUICK_SELECT_WITH_RECORD
:
public
Sql_alloc
...
...
sql/opt_subselect.cc
View file @
78683672
...
...
@@ -1509,6 +1509,9 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
*/
parent_lex
->
leaf_tables
.
concat
(
&
subq_lex
->
leaf_tables
);
if
(
subq_lex
->
options
&
OPTION_SCHEMA_TABLE
)
parent_lex
->
options
|=
OPTION_SCHEMA_TABLE
;
/*
Same as above for next_local chain
(a theory: a next_local chain always starts with ::leaf_tables
...
...
@@ -1725,6 +1728,9 @@ static bool convert_subq_to_jtbm(JOIN *parent_join,
*/
parent_lex
->
leaf_tables
.
push_back
(
jtbm
);
if
(
subq_pred
->
unit
->
first_select
()
->
options
&
OPTION_SCHEMA_TABLE
)
parent_lex
->
options
|=
OPTION_SCHEMA_TABLE
;
/*
Same as above for TABLE_LIST::next_local chain
(a theory: a next_local chain always starts with ::leaf_tables
...
...
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