#!/usr/bin/perl

use DBI;
use strict;

main: {
	my $dbh = DBI->connect (
		"dbi:mysql:test",
		"test","",
		{ RaiseError => 1, PrintError => 0 }
 	);

	print "DBI::VERSION=$DBI::VERSION\n";
	print "DBD::mysql::VERSION=$DBD::mysql::VERSION\n";

	eval {
		$dbh->do ("create table mtest ( foo varchar(32) )");
		print "Table created\n";
	};

	my $var1 = "2002052310:12:13";
	my $var2 = "2002052310:12:13";
	
	if ( $var1 > $var2 ) {
	  # Note the arithmetic operator. Correct is "gt",
	  # but it shouldn't matter, because it's a nop
	  # anyway (but obviously it isn't ;)
	}
	
	print "DBI->do\n";
	$dbh->do ("insert into mtest values (?)", {}, $var1);
	print "DBI->do was successful\n";
	
	print "DBI->prepare/execute\n";
	my $sth = $dbh->prepare ("insert into mtest values (?)");
	$sth->execute ( $var1 );
	$sth->finish;
	
	END { $dbh->disconnect if $dbh }
}
