~ubuntu-branches/ubuntu/trusty/drizzle/trusty-proposed

« back to all changes in this revision

Viewing changes to tests/randgen/simpipe.pl

  • Committer: Package Import Robot
  • Author(s): Tobias Frost
  • Date: 2012-03-13 12:09:29 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120313120929-2tj7hvngqltmw1ke
Tags: 2012.01.30-1
* New upstream release. (Closes: #623009)
* Haildb and pbms are no longer part of drizzle.
* Mysql-protocol and unix-socket-protocol are now part of drizzled.
* Add static js plugin (Executes JavaScript) and libv8-dev dependency.
* Enable hardening
* Support for DEB_BUILD_OPTIONS=noopt
* Use dh-autoreconf and add patch autotools.patch to allow
  build-twice-in-a-row
* Removed patch boost-148.patch, no longer needed.
* Added patch fix_spellings.patch
* Removed B-D on libtokyocabinet-dev.
* Added debconf translations. (Closes: #660042, #660625, #660780, #661349,
  #663387, #663115)
* Bump S-V to 3.9.3. Only change is to update debian/copyright (Format: and
  some syntax errors in the file)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use strict;
 
2
 
 
3
$| = 1;
 
4
 
 
5
use lib 'lib';
 
6
use GenTest::SimPipe::Testcase;
 
7
use GenTest::SimPipe::Oracle::FullScan;
 
8
use GenTest;
 
9
use GenTest::Constants;
 
10
use GenTest::Executor::MySQL;
 
11
use DBI;
 
12
use Data::Dumper;
 
13
 
 
14
my $dsn = 'dbi:mysql:port=9306:user=root:host=localhost:database=test';
 
15
my $oracle = GenTest::SimPipe::Oracle::FullScan->new( dsn => $dsn , basedir => '/home/philips/bzr/maria-5.3' );
 
16
 
 
17
my $dbh = DBI->connect($dsn, undef, undef, { mysql_multi_statements => 1, RaiseError => 1 });
 
18
 
 
19
my $query = "
 
20
SELECT alias2.col_datetime_key AS field1 , alias2.pk AS field2
 
21
FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.pk = alias1.col_int_key AND alias2.pk != alias1.col_varchar_key
 
22
GROUP BY field1 , field2
 
23
ORDER BY alias1.col_int_key , field2;";
 
24
 
 
25
$dbh->do("USE test");
 
26
 
 
27
my $test = '/home/philips/bzr/randgen-simpipe/case.test';
 
28
open (Q, $test) or die $!;
 
29
read (Q, my $sql, -s $test);
 
30
 
 
31
$dbh->do($sql);
 
32
my $testcase = GenTest::SimPipe::Testcase->newFromDBH($dbh, [ $query ]);
 
33
 
 
34
my $new_testcase = $testcase->simplify($oracle);
 
35
 
 
36
print $new_testcase->toString();