diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-06 14:38:03 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-06 14:38:03 -0300 |
commit | 07a9c082d94ad5603d7c0b7c8320c25ad6d5c755 (patch) | |
tree | ff890169e5b98f3fbb31ea046586032110b94897 /mysql-test/t/partition_innodb.test | |
parent | bf4a5d961d0d3d7df3fbb054146a26ea8c2d711d (diff) | |
download | mariadb-git-07a9c082d94ad5603d7c0b7c8320c25ad6d5c755.tar.gz |
Bug#54783: optimize table crashes with invalid timestamp default
value and NO_ZERO_DATE
The problem was that a older version of the error path for a
failed admin statement relied upon a few error conditions being
met in order to access a table handler, the first one being that
the table object pointer was not NULL. Probably due to chance,
in all cases a table object was closed but the reference wasn't
reset, the other conditions didn't evaluate to true. With the
addition of a new check on the error path, the handler started
being dereferenced whenever it was not reset to NULL, causing
problems for code paths which closed the table but didn't reset
the reference.
The solution is to reset the reference whenever a admin statement
fails and the tables are closed.
Diffstat (limited to 'mysql-test/t/partition_innodb.test')
-rw-r--r-- | mysql-test/t/partition_innodb.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index ccca4df9882..30f5894716c 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -452,3 +452,19 @@ SELECT * FROM t1; COMMIT; DROP TABLE t1; --enable_parsing + +--echo # +--echo # Bug#54783: optimize table crashes with invalid timestamp default value and NO_ZERO_DATE +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a INT, b TIMESTAMP DEFAULT '0000-00-00 00:00:00') + ENGINE=INNODB PARTITION BY LINEAR HASH (a) PARTITIONS 1; +SET @old_mode = @@sql_mode; +SET SESSION sql_mode = 'NO_ZERO_DATE'; +OPTIMIZE TABLE t1; +SET SESSION sql_mode = @old_mode; +DROP TABLE t1; |