[Commits] Rev 3091: Fixed bug lp:826377 "Aria DB Format: Reading specific table from dump causes Wrong bytesec" in lp:maria/5.1

Michael Widenius monty at askmonty.org
Mon Aug 15 20:38:22 EEST 2011


At lp:maria/5.1

------------------------------------------------------------
revno: 3091
revision-id: monty at askmonty.org-20110815173821-zbfrvyjijkstj8v4
parent: monty at askmonty.org-20110812124056-hmm2u9a4hta0hbuz
fixes bug(s): https://launchpad.net/bugs/826377
committer: Michael Widenius <monty at askmonty.org>
branch nick: maria-5.1
timestamp: Mon 2011-08-15 20:38:21 +0300
message:
  Fixed bug lp:826377 "Aria DB Format: Reading specific table from dump causes Wrong bytesec"
  The bug was that when using bulk insert combined with lock table, we intitalized the io cache with the wrong file position.
  This fixed a bug where MariaDB could not read in a table dump done with mysqldump.
-------------- next part --------------
=== added file 'mysql-test/suite/maria/r/locking.result'
--- a/mysql-test/suite/maria/r/locking.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/maria/r/locking.result	2011-08-15 17:38:21 +0000
@@ -0,0 +1,31 @@
+drop table if exists t1;
+CREATE TABLE t1 (
+`Vorgangsnr` int(10) unsigned NOT NULL AUTO_INCREMENT,
+`Datum_Eingang` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Erfassungs-/Buchungsdatum',
+`Warennummer` varchar(20) DEFAULT NULL,
+`BenutzerID` int(10) unsigned DEFAULT NULL,
+`Vermerke_Versand` varchar(1024) DEFAULT NULL,
+`Zubeh?r` varchar(250) DEFAULT NULL,
+`Datum_Annahme` varchar(12) DEFAULT NULL,
+`K_Lieferscheinnummer` int(10) unsigned DEFAULT NULL,
+`RMANr` int(10) unsigned DEFAULT '0',
+`K_Bestelldaten` varchar(1024) DEFAULT NULL COMMENT 'Bestellnr, Datum, Auftraggeber',
+PRIMARY KEY (`Vorgangsnr`),
+KEY `Datum_Eingang` (`Datum_Eingang`)
+) ENGINE=Aria AUTO_INCREMENT=250 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
+alter table t1 disable keys;
+lock tables t1 write;
+INSERT INTO t1 (Datum_Eingang, BenutzerID, Zubeh?r, Datum_Annahme) VALUES ('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006');
+INSERT INTO t1 (Datum_Eingang, BenutzerID, Zubeh?r, Datum_Annahme) VALUES ('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006');
+unlock tables;
+select count(*) from t1;
+count(*)
+88
+check table t1 extended;
+Table   Op      Msg_type        Msg_text
+test.t1 check   status  OK
+alter table t1 enable keys;
+check table t1 extended;
+Table   Op      Msg_type        Msg_text
+test.t1 check   status  OK
+drop table t1;

=== added file 'mysql-test/suite/maria/t/locking.test'
--- a/mysql-test/suite/maria/t/locking.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/maria/t/locking.test	2011-08-15 17:38:21 +0000
@@ -0,0 +1,43 @@
+#
+# Aria bugs that has to do with locking
+#
+--source include/have_maria.inc
+
+disable_warnings;
+drop table if exists t1;
+enable_warnings;
+
+#
+# Test generating data with insert select
+#
+
+CREATE TABLE t1 (
+  `Vorgangsnr` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `Datum_Eingang` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Erfassungs-/Buchungsdatum',
+  `Warennummer` varchar(20) DEFAULT NULL,
+  `BenutzerID` int(10) unsigned DEFAULT NULL,
+  `Vermerke_Versand` varchar(1024) DEFAULT NULL,
+  `Zubeh?r` varchar(250) DEFAULT NULL,
+  `Datum_Annahme` varchar(12) DEFAULT NULL,
+  `K_Lieferscheinnummer` int(10) unsigned DEFAULT NULL,
+  `RMANr` int(10) unsigned DEFAULT '0',
+  `K_Bestelldaten` varchar(1024) DEFAULT NULL COMMENT 'Bestellnr, Datum, Auftraggeber',
+  PRIMARY KEY (`Vorgangsnr`),
+  KEY `Datum_Eingang` (`Datum_Eingang`)
+) ENGINE=Aria AUTO_INCREMENT=250 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
+
+alter table t1 disable keys;
+lock tables t1 write;
+
+let $loop=2;
+while ($loop)
+{
+  INSERT INTO t1 (Datum_Eingang, BenutzerID, Zubeh?r, Datum_Annahme) VALUES ('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006'),('2006-06-21 00:00:00', 713, 'ohne Zubeh?r', '21.06.2006');
+  dec $loop;
+}
+unlock tables;
+select count(*) from t1;
+check table t1 extended;
+alter table t1 enable keys;
+check table t1 extended;
+drop table t1;

=== modified file 'storage/maria/ma_extra.c'
--- a/storage/maria/ma_extra.c	2011-02-10 18:33:51 +0000
+++ b/storage/maria/ma_extra.c	2011-08-15 17:38:21 +0000
@@ -143,7 +143,7 @@ int maria_extra(MARIA_HA *info, enum ha_
           (READ_CACHE_USED | WRITE_CACHE_USED | OPT_NO_ROWS)) &&
         !share->state.header.uniques)
       if (!(init_io_cache(&info->rec_cache, info->dfile.file, cache_size,
-                         WRITE_CACHE,share->state.state.data_file_length,
+                          WRITE_CACHE, info->state->data_file_length,
                           (pbool) (info->lock_type != F_UNLCK),
                           MYF(share->write_flag & MY_WAIT_IF_FULL))))
       {



More information about the commits mailing list