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
3cf991fa
Commit
3cf991fa
authored
Oct 27, 2011
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the test case for bug 879939 to derived_view.test where it belongs to.
parent
e9c4b7c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
54 deletions
+72
-54
mysql-test/r/derived_view.result
mysql-test/r/derived_view.result
+41
-0
mysql-test/r/subselect4.result
mysql-test/r/subselect4.result
+0
-33
mysql-test/t/derived_view.test
mysql-test/t/derived_view.test
+31
-0
mysql-test/t/subselect4.test
mysql-test/t/subselect4.test
+0
-21
No files found.
mysql-test/r/derived_view.result
View file @
3cf991fa
...
...
@@ -1787,4 +1787,45 @@ DEALLOCATE PREPARE st1;
DROP VIEW v1;
DROP TABLE t1,t2;
SET SESSION optimizer_switch='derived_merge=on';
#
# LP bug #879939: assertion in ha_maria::enable_indexes
# with derived_with_keys=on
#
CREATE TABLE t2 (a varchar(3));
INSERT INTO t2 VALUES ('USA'), ('USA'), ('USA'), ('USA'), ('USA');
CREATE TABLE t1 (a varchar(3), b varchar(35));
INSERT INTO t1 VALUES
('USA','Lansing'), ('USA','Laredo'), ('USA','Las Vegas'),
('USA','Lexington-Fayett'), ('USA','Lincoln'), ('USA','Little Rock'),
('USA','Livonia'), ('USA','Long Beach'), ('USA','Los Angeles'),
('USA','Louisville'), ('USA','Lowell'), ('USA','Lubbock'),
('USA','Macon'), ('USA','Madison'), ('USA','Manchester'),
('USA','McAllen'), ('USA','Memphis'), ('USA','Mesa'),
('USA','Mesquite'), ('USA','Metairie'), ('USA','Miami');
CREATE TABLE t3 (a varchar(35));
INSERT INTO t3 VALUES ('Miami');
SET optimizer_switch = 'derived_with_keys=on';
SET @@tmp_table_size=1024*4;
explain SELECT * FROM (SELECT t1.* FROM t1, t2) AS t JOIN t3 ON t3.a = t.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 system NULL NULL NULL NULL 1
1 SIMPLE t2 ALL NULL NULL NULL NULL 5
1 SIMPLE t1 ALL NULL NULL NULL NULL 21 Using where; Using join buffer (flat, BNL join)
SELECT * FROM (SELECT t1.* FROM t1, t2) AS t JOIN t3 ON t3.a = t.b;
a b a
USA Miami Miami
USA Miami Miami
USA Miami Miami
USA Miami Miami
USA Miami Miami
SET @@tmp_table_size=1024*1024*16;
SELECT * FROM (SELECT t1.* FROM t1, t2) AS t JOIN t3 ON t3.a = t.b;
a b a
USA Miami Miami
USA Miami Miami
USA Miami Miami
USA Miami Miami
USA Miami Miami
SET @@tmp_table_size=default;
drop table t1,t2,t3;
set optimizer_switch=@exit_optimizer_switch;
mysql-test/r/subselect4.result
View file @
3cf991fa
...
...
@@ -2104,38 +2104,5 @@ NULL
deallocate prepare st1;
drop table t1, t2, t3;
set optimizer_switch=@subselect4_tmp;
#
# LP bug #879939: assertion in ha_maria::enable_indexes with derived_with_keys=on
#
CREATE TABLE t2 ( a varchar(3)) ;
INSERT INTO t2 VALUES ('USA'),('USA'),('USA'),('USA'),('USA');
CREATE TABLE t1 ( a varchar(3), b varchar(35)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('USA','Lansing'),('USA','Laredo'),('USA','Las Vegas'),('USA','Lexington-Fayett'),('USA','Lincoln'),('USA','Little Rock'),('USA','Livonia'),('USA','Long Beach'),('USA','Los Angeles'),('USA','Louisville'),('USA','Lowell'),('USA','Lubbock'),('USA','Macon'),('USA','Madison'),('USA','Manchester'),('USA','McAllen'),('USA','Memphis'),('USA','Mesa'),('USA','Mesquite'),('USA','Metairie'),('USA','Miami');
CREATE TABLE t3 ( a varchar(35)) ENGINE=MyISAM;
INSERT INTO t3 VALUES ('Miami');
SET optimizer_switch = 'derived_with_keys=on';
SET @@tmp_table_size=1024*4;
explain SELECT * FROM (SELECT t1.* FROM t1, t2 ) AS alias1 JOIN t3 ON ( t3.a = alias1.b );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1
1 PRIMARY <derived2> ref key0 key0 39 const 10
2 DERIVED t2 ALL NULL NULL NULL NULL 5
2 DERIVED t1 ALL NULL NULL NULL NULL 21 Using join buffer (flat, BNL join)
SELECT * FROM (SELECT t1.* FROM t1, t2 ) AS alias1 JOIN t3 ON ( t3.a = alias1.b );
a b a
USA Miami Miami
USA Miami Miami
USA Miami Miami
USA Miami Miami
USA Miami Miami
SET @@tmp_table_size=1024*1024*16;
SELECT * FROM (SELECT t1.* FROM t1, t2 ) AS alias1 JOIN t3 ON ( t3.a = alias1.b );
a b a
USA Miami Miami
USA Miami Miami
USA Miami Miami
USA Miami Miami
USA Miami Miami
drop table t1,t2,t3;
SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size;
mysql-test/t/derived_view.test
View file @
3cf991fa
...
...
@@ -1190,5 +1190,36 @@ DROP TABLE t1,t2;
SET
SESSION
optimizer_switch
=
'derived_merge=on'
;
--
echo
#
--
echo
# LP bug #879939: assertion in ha_maria::enable_indexes
--
echo
# with derived_with_keys=on
--
echo
#
CREATE
TABLE
t2
(
a
varchar
(
3
));
INSERT
INTO
t2
VALUES
(
'USA'
),
(
'USA'
),
(
'USA'
),
(
'USA'
),
(
'USA'
);
CREATE
TABLE
t1
(
a
varchar
(
3
),
b
varchar
(
35
));
INSERT
INTO
t1
VALUES
(
'USA'
,
'Lansing'
),
(
'USA'
,
'Laredo'
),
(
'USA'
,
'Las Vegas'
),
(
'USA'
,
'Lexington-Fayett'
),
(
'USA'
,
'Lincoln'
),
(
'USA'
,
'Little Rock'
),
(
'USA'
,
'Livonia'
),
(
'USA'
,
'Long Beach'
),
(
'USA'
,
'Los Angeles'
),
(
'USA'
,
'Louisville'
),
(
'USA'
,
'Lowell'
),
(
'USA'
,
'Lubbock'
),
(
'USA'
,
'Macon'
),
(
'USA'
,
'Madison'
),
(
'USA'
,
'Manchester'
),
(
'USA'
,
'McAllen'
),
(
'USA'
,
'Memphis'
),
(
'USA'
,
'Mesa'
),
(
'USA'
,
'Mesquite'
),
(
'USA'
,
'Metairie'
),
(
'USA'
,
'Miami'
);
CREATE
TABLE
t3
(
a
varchar
(
35
));
INSERT
INTO
t3
VALUES
(
'Miami'
);
SET
optimizer_switch
=
'derived_with_keys=on'
;
SET
@@
tmp_table_size
=
1024
*
4
;
explain
SELECT
*
FROM
(
SELECT
t1
.*
FROM
t1
,
t2
)
AS
t
JOIN
t3
ON
t3
.
a
=
t
.
b
;
SELECT
*
FROM
(
SELECT
t1
.*
FROM
t1
,
t2
)
AS
t
JOIN
t3
ON
t3
.
a
=
t
.
b
;
SET
@@
tmp_table_size
=
1024
*
1024
*
16
;
SELECT
*
FROM
(
SELECT
t1
.*
FROM
t1
,
t2
)
AS
t
JOIN
t3
ON
t3
.
a
=
t
.
b
;
SET
@@
tmp_table_size
=
default
;
drop
table
t1
,
t2
,
t3
;
# The following command must be the last one the file
set
optimizer_switch
=@
exit_optimizer_switch
;
mysql-test/t/subselect4.test
View file @
3cf991fa
...
...
@@ -1736,26 +1736,5 @@ drop table t1, t2, t3;
set
optimizer_switch
=@
subselect4_tmp
;
--
echo
#
--
echo
# LP bug #879939: assertion in ha_maria::enable_indexes with derived_with_keys=on
--
echo
#
CREATE
TABLE
t2
(
a
varchar
(
3
))
;
INSERT
INTO
t2
VALUES
(
'USA'
),(
'USA'
),(
'USA'
),(
'USA'
),(
'USA'
);
CREATE
TABLE
t1
(
a
varchar
(
3
),
b
varchar
(
35
))
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
'USA'
,
'Lansing'
),(
'USA'
,
'Laredo'
),(
'USA'
,
'Las Vegas'
),(
'USA'
,
'Lexington-Fayett'
),(
'USA'
,
'Lincoln'
),(
'USA'
,
'Little Rock'
),(
'USA'
,
'Livonia'
),(
'USA'
,
'Long Beach'
),(
'USA'
,
'Los Angeles'
),(
'USA'
,
'Louisville'
),(
'USA'
,
'Lowell'
),(
'USA'
,
'Lubbock'
),(
'USA'
,
'Macon'
),(
'USA'
,
'Madison'
),(
'USA'
,
'Manchester'
),(
'USA'
,
'McAllen'
),(
'USA'
,
'Memphis'
),(
'USA'
,
'Mesa'
),(
'USA'
,
'Mesquite'
),(
'USA'
,
'Metairie'
),(
'USA'
,
'Miami'
);
CREATE
TABLE
t3
(
a
varchar
(
35
))
ENGINE
=
MyISAM
;
INSERT
INTO
t3
VALUES
(
'Miami'
);
SET
optimizer_switch
=
'derived_with_keys=on'
;
SET
@@
tmp_table_size
=
1024
*
4
;
explain
SELECT
*
FROM
(
SELECT
t1
.*
FROM
t1
,
t2
)
AS
alias1
JOIN
t3
ON
(
t3
.
a
=
alias1
.
b
);
SELECT
*
FROM
(
SELECT
t1
.*
FROM
t1
,
t2
)
AS
alias1
JOIN
t3
ON
(
t3
.
a
=
alias1
.
b
);
SET
@@
tmp_table_size
=
1024
*
1024
*
16
;
SELECT
*
FROM
(
SELECT
t1
.*
FROM
t1
,
t2
)
AS
alias1
JOIN
t3
ON
(
t3
.
a
=
alias1
.
b
);
drop
table
t1
,
t2
,
t3
;
SET
optimizer_switch
=
@@
global
.
optimizer_switch
;
set
@@
tmp_table_size
=
@@
global
.
tmp_table_size
;
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