~ubuntu-branches/ubuntu/vivid/drizzle/vivid-proposed

« back to all changes in this revision

Viewing changes to tests/test_tools/randgen/lib/GenTest/Transform/SelectOption.pm

  • Committer: Package Import Robot
  • Author(s): Tobias Frost
  • Date: 2013-08-22 20:18:31 UTC
  • mto: (20.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20130822201831-gn3ozsh7o7wmc5tk
Tags: upstream-7.2.3
ImportĀ upstreamĀ versionĀ 7.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# This program is free software; you can redistribute it and/or modify
 
3
# it under the terms of the GNU General Public License as published by
 
4
# the Free Software Foundation; version 2 of the License.
 
5
#
 
6
# This program is distributed in the hope that it will be useful, but
 
7
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
8
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
9
# General Public License for more details.
 
10
#
 
11
# You should have received a copy of the GNU General Public License
 
12
# along with this program; if not, write to the Free Software
 
13
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
 
14
# USA
 
15
 
 
16
package GenTest::Transform::SelectOption;
 
17
 
 
18
require Exporter;
 
19
@ISA = qw(GenTest GenTest::Transform);
 
20
 
 
21
use strict;
 
22
use lib 'lib';
 
23
 
 
24
use GenTest;
 
25
use GenTest::Transform;
 
26
use GenTest::Constants;
 
27
 
 
28
sub transform {
 
29
        my ($class, $orig_query) = @_;
 
30
 
 
31
        return STATUS_WONT_HANDLE if $orig_query !~ m{SELECT}io;
 
32
        return STATUS_WONT_HANDLE if $orig_query =~ m{SQL_BIG_RESULT|SQL_SMALL_RESULT|SQL_BUFFER_RESULT}io;
 
33
 
 
34
        my $modified_queries = [
 
35
                $orig_query." /* TRANSFORM_OUTCOME_UNORDERED_MATCH */ ",
 
36
                $orig_query." /* TRANSFORM_OUTCOME_UNORDERED_MATCH */ ",
 
37
                $orig_query." /* TRANSFORM_OUTCOME_UNORDERED_MATCH */ "
 
38
        ];
 
39
        
 
40
        $modified_queries->[0] =~ s{SELECT}{SELECT SQL_BIG_RESULT}io;
 
41
        $modified_queries->[1] =~ s{SELECT}{SELECT SQL_SMALL_RESULT}io;
 
42
        $modified_queries->[2] =~ s{SELECT}{SELECT SQL_BUFFER_RESULT}io;
 
43
 
 
44
        return $modified_queries;
 
45
}
 
46
 
 
47
1;