diff options
author | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-11-30 17:08:00 +0400 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-11-30 17:08:00 +0400 |
commit | 17b4789405212307be559bc7740bcf0be23fc4cd (patch) | |
tree | e2d1d5118bdd7f792aeb98e95e3673bff9941091 /mysql-test/t/federated.test | |
parent | 72d70ff86ee073797671b096fe78810141bf6749 (diff) | |
download | mariadb-git-17b4789405212307be559bc7740bcf0be23fc4cd.tar.gz |
Bug #32374 crash with filesort when selecting from federated table and view.
filesort() uses file->estimate_rows_upper_bound() call to allocate
internal buffers. If this function returns a value smaller than
a number of row that will be returned later in find_all_keys(),
that can cause server crash.
Fixed by implementing ha_federated::estimate_rows_upper_bound() to
return maximum possible number of rows.
Present estimation for FEDERATED always returns 0 if the linked to the VIEW.
mysql-test/r/federated.result:
Bug #32374 crash with filesort when selecting from federated table and view.
test result
mysql-test/t/federated.test:
Bug #32374 crash with filesort when selecting from federated table and view.
test case
sql/ha_federated.cc:
Bug #32374 crash with filesort when selecting from federated table and view.
ha_federated::estimate_rows_upper_bound() implemented
sql/ha_federated.h:
Bug #32374 crash with filesort when selecting from federated table and view.
ha_federated::estimate_rows_upper_bound() interface
Diffstat (limited to 'mysql-test/t/federated.test')
-rw-r--r-- | mysql-test/t/federated.test | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index cc66a6ab4bc..d4f22650a32 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1686,4 +1686,35 @@ insert into federated.t1 (a) values (1); select * from federated.t2; drop table federated.t1, federated.t2; +# +# Bug #32374 crash with filesort when selecting from federated table and view +# +connection slave; +create table t1 (a varchar(256)); +--disable_warnings +drop view if exists v1; +--enable_warnings +create view v1 as select a from t1; +--disable_query_log +let $n= 100; +while ($n) +{ + insert into t1 values (repeat('a',200)); + dec $n; +} +--enable_query_log + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval create table t1 + (a varchar(256)) engine=federated + connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/v1'; + +select 1 from t1 order by a; +drop table t1; +connection slave; +drop table t1; +drop view v1; + + source include/federated_cleanup.inc; |