diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2011-10-31 15:07:43 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2011-10-31 15:07:43 +0400 |
commit | 57b3fefa03055e579fbcf664ce71b3b41c6b4558 (patch) | |
tree | 052b221ec22f096687f025e7c1ddca55b6c4a592 /mysql-test/r/derived_view.result | |
parent | 3694bb90a47feb463c5a38543650f0f53d1735eb (diff) | |
download | mariadb-git-57b3fefa03055e579fbcf664ce71b3b41c6b4558.tar.gz |
BUG#882994: Crash in QUICK_RANGE_SELECT::reset with derived_with_keys
- The bug was caused by the following scenario:
= a quick select is created with get_quick_select_for_ref. The quick
select refers to temporary (derived) table. It saves table->file, which
refers to a ha_heap object.
= When temp table is populated, ha_heap reaches max. size and is converted
to a ha_myisam. However, quick->file remains pointing to where ha_heap
was.
= Attempt to use the quick select causes crash.
- Fixed by introducing QUICK_SELECT_I::replace_handler(). Note that it will
not work for index_merge quick selects. Which is fine, because these
quick selects are never created for derived tables.
Diffstat (limited to 'mysql-test/r/derived_view.result')
-rw-r--r-- | mysql-test/r/derived_view.result | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index 54955ed1e13..dbf367be372 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -1828,4 +1828,37 @@ USA Miami Miami USA Miami Miami SET @@tmp_table_size=default; drop table t1,t2,t3; +# +# BUG#882994: Crash in QUICK_RANGE_SELECT::reset with derived_with_keys +# +CREATE TABLE t2 ( +pk varchar(33), +col_varchar_key varchar(3) NOT NULL, +col_varchar_nokey varchar(52) NOT NULL); +INSERT INTO t2 VALUES ('NICSpanish','NIC','Spanish'), +('NERHausa','NER','Hausa'),('NGAJoruba','NGA','Joruba'), +('NIUNiue','NIU','Niue'),('NFKEnglish','NFK','English'), +('NORNorwegian','NOR','Norwegian'),('CIVAkan','CIV','Akan'), +('OMNArabic','OMN','Arabic'),('PAKPunjabi','PAK','Punjabi'), +('PLWPalau','PLW','Palau'),('PANSpanish','PAN','Spanish'), +('PNGPapuan Langua','PNG','Papuan Languages'), ('PRYSpanish','PRY','Spanish'), +('PERSpanish','PER','Spanish'), ('PCNPitcairnese','PCN','Pitcairnese'), +('MNPPhilippene La','MNP','Philippene Langu'),('PRTPortuguese','PRT','Portuguese'), +('PRISpanish','PRI','Spanish'),('POLPolish','POL','Polish'),('GNQFang','GNQ','Fang'); +CREATE TABLE t1 ( col_varchar_nokey varchar(52) NOT NULL ) ; +INSERT INTO t1 VALUES ('Chinese'),('English'),('French'),('German'), +('Italian'),('Japanese'),('Korean'),('Polish'),('Portuguese'),('Spanish'), +('Tagalog'),('Vietnamese'); +CREATE TABLE t3 ( col_varchar_key varchar(52)) ; +INSERT INTO t3 VALUES ('United States'); +set @tmp_882994= @@max_heap_table_size; +set max_heap_table_size=1; +SELECT * +FROM t3 JOIN +( SELECT t2.* FROM t1, t2 ) AS alias2 +ON ( alias2.col_varchar_nokey = t3.col_varchar_key ) +ORDER BY CONCAT(alias2.col_varchar_nokey); +col_varchar_key pk col_varchar_key col_varchar_nokey +set max_heap_table_size= @tmp_882994; +drop table t1,t2,t3; set optimizer_switch=@exit_optimizer_switch; |