--- a/db.mysql Mon Jul 21 12:54:11 2008 +0000
+++ b/db.mysql Wed Aug 20 14:23:02 2008 +0000
@@ -2,7 +2,7 @@
--
-- Host: schnuffi Database: mail
-- ------------------------------------------------------
--- Server version 5.0.32-Debian_7etch6-log
+-- Server version 5.0.32-Debian_7etch6
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -16,13 +16,27 @@
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
+-- Table structure for table `eht`
+--
+
+DROP TABLE IF EXISTS `eht`;
+CREATE TABLE `eht` (
+ `message_id` bigint(20) default NULL,
+ `mandant` int(11) default NULL,
+ `typ` int(11) default NULL,
+ `vorgang` int(11) default NULL,
+ KEY `message_id` (`message_id`),
+ CONSTRAINT `eht_ibfk_1` FOREIGN KEY (`message_id`) REFERENCES `message` (`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
-- Temporary table structure for view `header`
--
DROP TABLE IF EXISTS `header`;
/*!50001 DROP VIEW IF EXISTS `header`*/;
/*!50001 CREATE TABLE `header` (
- `message_id` int(11),
+ `message_id` bigint(20),
`name` char(255),
`idx` int(11),
`content` text
@@ -45,7 +59,7 @@
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
- `id` int(11) NOT NULL auto_increment,
+ `id` bigint(20) NOT NULL auto_increment,
`content` longtext,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
KEY `id` (`id`)
@@ -57,7 +71,7 @@
DROP TABLE IF EXISTS `message_header`;
CREATE TABLE `message_header` (
- `message_id` int(11) NOT NULL,
+ `message_id` bigint(20) NOT NULL,
`header_field_id` int(11) NOT NULL,
`idx` int(11) default NULL,
`content` text,
@@ -86,4 +100,4 @@
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2008-07-20 21:24:42
+-- Dump completed on 2008-08-20 14:18:22
--- a/mail2db Mon Jul 21 12:54:11 2008 +0000
+++ b/mail2db Wed Aug 20 14:23:02 2008 +0000
@@ -3,6 +3,13 @@
# $Id$
# $URL$
+my ($T0, $T1);
+
+BEGIN {
+ use Time::HiRes qw(gettimeofday tv_interval);
+ $T0 = [ gettimeofday() ];
+}
+
use strict;
use warnings;
use Getopt::Long;
@@ -16,7 +23,7 @@
use Time::HiRes qw(gettimeofday tv_interval);
use if $ENV{DEBUG} => "Data::Dumper";
-my $T0 = [ gettimeofday() ];
+$T1 = [ gettimeofday() ];
my $OUTPUT_CHARSET = "UTF8";
my $DEFAULT_INPUT_CHARSET = "ASCII";
@@ -134,7 +141,7 @@
}
$DBH->commit if not $opt_dry;
- syslog( LOG_NOTICE, "inserted message $msg_id (%.1fs)", tv_interval($T0) );
+ syslog( LOG_NOTICE, "inserted message $msg_id (%.1fs / %.1fs)", tv_interval($T0), tv_interval($T1) );
}
@@ -236,8 +243,8 @@
=head1 SYNOPSIS
mail2db [--dsn=I<data source name>]
- [--dbuser=I<db user>] [--dbpass=I<db pass>]
- [--[no]debug] [-n|--dry] [message]
+[--dbuser=I<db user>] [--dbpass=I<db pass>]
+[--[no]debug] [-n|--dry] [message]
mail2db [-h|--help]
mail2db [-m|--man]
@@ -289,6 +296,9 @@
"DEBUG". Errors are logged as "ERR", and warnings as "WARNING". If standard
input is connected to a terminal, additional logging goes to STDERR.
+Normally just a single line is logged, containing the id of the inserted message
+and two times - the full runtime and the runtime after loading the modules.
+
=head1 DATABASE LAYOUT
Beside having transactions and real support for foreign keys, the