summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <petr/cps@mysql.com/owlet>2006-08-18 16:48:32 +0400
committerunknown <petr/cps@mysql.com/owlet>2006-08-18 16:48:32 +0400
commit70b73788980a955e5ee4e064c053d83b73b0b295 (patch)
treea37679ea94e429f80d2f30b7b2da16ba90512ff5 /mysql-test
parent5c8c2ab43b73984889fd6c337523b657861793ea (diff)
parentb747f9732b008efc3dfefb4e0344cfa1b9e14e56 (diff)
downloadmariadb-git-70b73788980a955e5ee4e064c053d83b73b0b295.tar.gz
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/cps/mysql/trees/mysql-5.0-virgin sql/examples/ha_tina.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/csv.result10
-rw-r--r--mysql-test/t/csv.test24
2 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index 3c87c1f4b92..f3e91a663b8 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5000,3 +5000,13 @@ insert t1 values (1),(2),(3),(4),(5);
truncate table t1;
affected rows: 0
drop table t1;
+create table bug15205 (val int(11) default null) engine=csv;
+create table bug15205_2 (val int(11) default null) engine=csv;
+select * from bug15205;
+ERROR HY000: Got error 1 from storage engine
+select * from bug15205_2;
+val
+select * from bug15205;
+val
+drop table bug15205;
+drop table bug15205_2;
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index a028f6ced6d..8bd48b7da2c 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1384,3 +1384,27 @@ truncate table t1; -- truncate
--disable_info
drop table t1;
+#
+# Bug #15205 Select from CSV table without the datafile causes crash
+#
+# NOTE: the bug is not deterministic
+
+# The crash happens because the necessary cleanup after an error wasn't
+# performed. Namely, the table share, inserted in the hash during table
+# open, was not deleted from hash. At the same time the share was freed
+# when an error was encountered. Thus, subsequent access to the hash
+# resulted in scanning through deleted memory and we were geting a crash.
+# that's why we need two tables in the bugtest
+
+create table bug15205 (val int(11) default null) engine=csv;
+create table bug15205_2 (val int(11) default null) engine=csv;
+--exec rm $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
+# system error (can't open the datafile)
+--error ER_GET_ERRNO
+select * from bug15205;
+select * from bug15205_2;
+--exec touch $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
+select * from bug15205;
+drop table bug15205;
+drop table bug15205_2;
+