MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:February 12 2010 1:26pm
Subject:bzr commit into mysql-pe branch (svoj:3902)
View as plain text  
#At file:///home/svoj/devel/bzr-mysql/mysql-pe-push/ based on revid:sergey.glukhov@stripped

 3902 Sergey Vojtovich	2010-02-12 [merge]
      Merge fixes for BUG48757, BUG49628, BUG48438 to mysql-pe.

    modified:
      mysql-test/r/archive.result
      mysql-test/r/myisam.result
      mysql-test/t/archive.test
      mysql-test/t/myisam.test
      storage/archive/ha_archive.cc
      storage/myisam/mi_dynrec.c
      storage/myisam/mi_locking.c
=== modified file 'mysql-test/r/archive.result'
--- a/mysql-test/r/archive.result	2010-01-13 06:34:01 +0000
+++ b/mysql-test/r/archive.result	2010-02-12 13:25:31 +0000
@@ -12743,3 +12743,12 @@ Table	Op	Msg_type	Msg_text
 test.t1	repair	Error	Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
 test.t1	repair	error	Corrupt
 DROP TABLE t1;
+#
+# BUG#48757 - missing .ARZ file causes server crash
+#
+CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
+FLUSH TABLE t1;
+SELECT * FROM t1;
+ERROR HY000: Can't find file: 't1' (errno: 2)
+DROP TABLE t1;
+ERROR 42S02: Unknown table 't1'

=== modified file 'mysql-test/r/myisam.result'
--- a/mysql-test/r/myisam.result	2009-12-17 19:44:49 +0000
+++ b/mysql-test/r/myisam.result	2010-02-12 13:25:31 +0000
@@ -1885,6 +1885,19 @@ CHECKSUM TABLE t1 EXTENDED;
 Table	Checksum
 test.t1	467455460
 DROP TABLE t1;
+#
+# BUG#48438 - crash with error in unioned query against merge table and view...
+#
+SET GLOBAL table_open_cache=3;
+CREATE TABLE t1(a INT);
+SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
+1
+SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+TABLE_ROWS	DATA_LENGTH
+0	0
+DROP TABLE t1;
+SET GLOBAL table_open_cache=DEFAULT;
 End of 5.0 tests
 create table t1 (a int not null, key `a` (a) key_block_size=1024);
 show create table t1;
@@ -2326,6 +2339,19 @@ CHECK TABLE t1;
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 DROP TABLE t1;
+#
+# BUG#49628 - corrupt table after legal SQL, LONGTEXT column
+#
+CREATE TABLE t1(a INT, b LONGTEXT, UNIQUE(a));
+REPLACE INTO t1 VALUES
+(1, REPEAT('a', 129015)),(1, NULL),
+(2, NULL),(3, NULL),(4, NULL),(5, NULL),(6, NULL),(7, NULL),
+(1, REPEAT('b', 129016)),(1, NULL),
+(1, REPEAT('c', 129015)),(1, REPEAT('d', 129015));
+CHECK TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+DROP TABLE t1;
 End of 5.1 tests
 #
 # Bug#43600: Incorrect type conversion caused wrong result.

=== modified file 'mysql-test/t/archive.test'
--- a/mysql-test/t/archive.test	2010-01-13 06:34:01 +0000
+++ b/mysql-test/t/archive.test	2010-02-12 13:25:31 +0000
@@ -1660,3 +1660,14 @@ INSERT INTO t1 (col1, col2) VALUES (1, "
 REPAIR TABLE t1;
 DROP TABLE t1;
 remove_file $MYSQLD_DATADIR/test/t1.ARM;
+
+--echo #
+--echo # BUG#48757 - missing .ARZ file causes server crash
+--echo #
+CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
+FLUSH TABLE t1;
+--remove_file $MYSQLD_DATADIR/test/t1.ARZ
+--error ER_FILE_NOT_FOUND
+SELECT * FROM t1;
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1;

=== modified file 'mysql-test/t/myisam.test'
--- a/mysql-test/t/myisam.test	2009-12-17 19:44:49 +0000
+++ b/mysql-test/t/myisam.test	2010-02-12 13:25:31 +0000
@@ -1215,6 +1215,17 @@ CHECKSUM TABLE t1 EXTENDED;
 DROP TABLE t1;
 
 
+--echo #
+--echo # BUG#48438 - crash with error in unioned query against merge table and view...
+--echo #
+SET GLOBAL table_open_cache=3;
+CREATE TABLE t1(a INT);
+SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
+SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+  WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+DROP TABLE t1;
+SET GLOBAL table_open_cache=DEFAULT;
+
 --echo End of 5.0 tests
 
 
@@ -1579,6 +1590,19 @@ SET myisam_sort_buffer_size=@@global.myi
 CHECK TABLE t1;
 DROP TABLE t1;
 
+
+--echo #
+--echo # BUG#49628 - corrupt table after legal SQL, LONGTEXT column
+--echo #
+CREATE TABLE t1(a INT, b LONGTEXT, UNIQUE(a));
+REPLACE INTO t1 VALUES
+(1, REPEAT('a', 129015)),(1, NULL),
+(2, NULL),(3, NULL),(4, NULL),(5, NULL),(6, NULL),(7, NULL),
+(1, REPEAT('b', 129016)),(1, NULL),
+(1, REPEAT('c', 129015)),(1, REPEAT('d', 129015));
+CHECK TABLE t1;
+DROP TABLE t1;
+
 --echo End of 5.1 tests
 
 --echo #

=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc	2010-01-21 00:37:05 +0000
+++ b/storage/archive/ha_archive.cc	2010-02-12 13:25:31 +0000
@@ -335,10 +335,10 @@ ARCHIVE_SHARE *ha_archive::get_share(con
     if (!(azopen(&archive_tmp, share->data_file_name, O_RDONLY|O_BINARY,
                  AZ_METHOD_BLOCK)))
     {
+      *rc= my_errno ? my_errno : -1;
       pthread_mutex_destroy(&share->mutex);
-      free(share);
+      my_free(share, MYF(0));
       pthread_mutex_unlock(&archive_mutex);
-      *rc= HA_ERR_CRASHED_ON_REPAIR;
       DBUG_RETURN(NULL);
     }
     stats.auto_increment_value= archive_tmp.auto_increment + 1;
@@ -507,16 +507,18 @@ int ha_archive::open(const char *name, i
     For now we have to refuse to open such table to avoid
     potential data loss.
   */
-  if ((rc == HA_ERR_CRASHED_ON_USAGE && !(open_options & HA_OPEN_FOR_REPAIR))
-      ||  rc == HA_ERR_TABLE_NEEDS_UPGRADE)
+  switch (rc)
   {
-    /* purecov: begin inspected */
+  case 0:
+    break;
+  case HA_ERR_CRASHED_ON_USAGE:
+    if (open_options & HA_OPEN_FOR_REPAIR)
+      break;
+    /* fall through */
+  case HA_ERR_TABLE_NEEDS_UPGRADE:
     free_share();
-    DBUG_RETURN(rc);
-    /* purecov: end */    
-  }
-  else if (rc == HA_ERR_OUT_OF_MEM)
-  {
+    /* fall through */
+  default:
     DBUG_RETURN(rc);
   }
 

=== modified file 'storage/myisam/mi_dynrec.c'
--- a/storage/myisam/mi_dynrec.c	2009-12-09 07:44:39 +0000
+++ b/storage/myisam/mi_dynrec.c	2010-02-12 13:25:31 +0000
@@ -946,8 +946,16 @@ static int update_dynamic_record(MI_INFO
   }
 
   if (block_info.next_filepos != HA_OFFSET_ERROR)
+  {
+    /*
+      delete_dynamic_record() may change data file position.
+      IO cache must be notified as it may still have cached
+      data, which has to be flushed later.
+    */
+    info->rec_cache.seek_not_done= 1;
     if (delete_dynamic_record(info,block_info.next_filepos,1))
       goto err;
+  }
   DBUG_RETURN(0);
 err:
   DBUG_RETURN(1);

=== modified file 'storage/myisam/mi_locking.c'
--- a/storage/myisam/mi_locking.c	2009-12-11 06:07:07 +0000
+++ b/storage/myisam/mi_locking.c	2010-02-12 13:25:31 +0000
@@ -316,8 +316,8 @@ void mi_update_status(void* param)
 			    (long) info->s->state.state.data_file_length));
 #endif
     info->s->state.state= *info->state;
-    info->state= &info->s->state.state;
   }
+  info->state= &info->s->state.state;
   info->append_insert_at_end= 0;
 
   /*


Attachment: [text/bzr-bundle] bzr/svoj@sun.com-20100212132531-vy91vo9iub0tk203.bundle
Thread
bzr commit into mysql-pe branch (svoj:3902)Sergey Vojtovich12 Feb