Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-730

LP:1025254 - Aria: Corrupt tables when storing data with COMPRESS()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Incomplete
    • None
    • None
    • None

    Description

      OS: Windows 32/64 bit

      We store our PDF files along with some other data in following table:

      CREATE TABLE `belegliste` (
      	`belegart` ENUM('Angebot','Kostenvoranschlag','Auftragsbestätigung','Lieferschein','Rechnung','Gutschrift') NOT NULL DEFAULT 'Angebot' COMMENT 'Belegart: 1 => Angebot, 2 => Kostenvoranschlag, 3 => Auftragsbestätigung, 4 => Lieferschein, 5 => Rechnung, 6 => Gutschrift',
      	`belegnummer` MEDIUMINT(10) UNSIGNED NOT NULL COMMENT 'Belegnummer.',
      	`positionen` SMALLINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Anzahl der Positionen auf dem Beleg',
      	`form_anschrift` TEXT NULL COMMENT 'Speichert den Bereich Adresse ab.',
      	`datum` DATE NULL DEFAULT NULL COMMENT 'Belegdatum.',
      	`kundennummer` INT(10) UNSIGNED NULL DEFAULT NULL,
      	`nettobetrag` DECIMAL(10,2) NULL DEFAULT NULL COMMENT 'Nettobetrag',
      	`mwstsatz` TINYINT(3) UNSIGNED NULL DEFAULT '19' COMMENT 'MwSt-Satz',
      	`bruttobetrag` DECIMAL(10,2) NULL DEFAULT NULL,
      	`zahlungsziel` TINYINT(3) UNSIGNED NULL DEFAULT NULL COMMENT 'Zahlungsziel in Tagen',
      	`datevnummer` INT(10) UNSIGNED NULL DEFAULT NULL COMMENT 'DATEV-Nummer für die FiBu',
      	`techniknummer` MEDIUMINT(8) UNSIGNED NULL DEFAULT NULL,
      	`berichtsnummer` MEDIUMINT(8) UNSIGNED ZEROFILL NULL DEFAULT NULL COMMENT 'RepairClient Techniknummer',
      	`status` ENUM('normal','storniert','KVA bestätigt','KVA nicht bestätigt','on hold') NOT NULL DEFAULT 'normal' COMMENT 'Status für Storno, KVA bestätigt etc.',
      	`statusdatum` DATE NULL DEFAULT NULL COMMENT 'Datum der Änderung, Bestätigung',
      	`pdf` MEDIUMBLOB NULL COMMENT 'enthält Beleg als PDF',
      	`listenkopf` VARCHAR(1024) NULL DEFAULT NULL,
      	PRIMARY KEY (`belegart`, `belegnummer`),
      	INDEX `positionen` (`positionen`),
      	INDEX `kundennummer` (`kundennummer`),
      	INDEX `datevnummer` (`datevnummer`),
      	INDEX `techniknummer` (`techniknummer`),
      	INDEX `datum` (`datum`),
      	INDEX `berichtsnummer` (`berichtsnummer`)
      )
      COMMENT='Liste aller Belege (1=Angebot, 2=KVA, 3=AB, 4=LS, 5=RE. 6=Gu'
      COLLATE='utf8_general_ci'
      ENGINE=Aria
      CHECKSUM=1;

      The PDF itself is stored in `pdf` MEDIUMBLOB via COMPRESS(). Uncompressed PDF is about 30 to 70KB in size. The respective program first reserves a number with first doing an INSERT with `belegnummer` and `belegart` (with rest of the fields ZERO or 0), generating the PDF and storing it via UPDATE.

      In various situations, we weren't able to do any updates on the table until I did a REPAIR table. Switching the table definition to MyISAM doesn't cause this issue.

      The issue arises randomly, so I can't provide you any files.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nbrnhardt nbrnhardt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.