~ubuntu-branches/ubuntu/trusty/drizzle/trusty-updates

« back to all changes in this revision

Viewing changes to tests/kewpie/randgen/conf/transactions/transactions.yy

  • Committer: Package Import Robot
  • Author(s): Tobias Frost
  • Date: 2012-04-04 15:12:07 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120404151207-xwsgn1xegslle4p0
Tags: 1:7.1.32-rc-1
* New upstream release.
* Plugin-filtered-replicator upstream removed and will no longer be built.
* Updating d/*install files to accommodate upstream changes from drizzle7
  to drizzle
* Added symlink in libdrizzledmessage-dev to library
* libdrizzle: soname-bump
* Rename package drizzle-plugin-performance-dictionary to shorten package name
  (due to linitan warning package-has-long-file-name)
* Debian/control: removed unused substitution variable ${shlibs:Depends} for
  -dbg and -dev packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2008-2010 Sun Microsystems, Inc. All rights reserved.
 
2
# Use is subject to license terms.
 
3
#
 
4
# This program is free software; you can redistribute it and/or modify
 
5
# it under the terms of the GNU General Public License as published by
 
6
# the Free Software Foundation; version 2 of the License.
 
7
#
 
8
# This program is distributed in the hope that it will be useful, but
 
9
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
11
# General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
 
16
# USA
 
17
 
 
18
#
 
19
# This test performs zero-sum queries, that is, queries after which the average value of all integers in the table remains the same.
 
20
# Some queries move values within a single row, others between rows and some insert new values or delete existing ones.
 
21
#
 
22
# The values in the first 10 rows are updated so that values from one row may move into another row. This makes those rows unsuitable for random
 
23
# insertions and deletions.
 
24
#
 
25
# Rows beyond the 10th are just inserted and delted randomly because each row in that part of the table is self-contained
 
26
#
 
27
 
 
28
query_init:
 
29
        SET AUTOCOMMIT=OFF ; START TRANSACTION ;
 
30
 
 
31
query:
 
32
        START TRANSACTION ; body ; commit_rollback ;
 
33
 
 
34
body:
 
35
        update_all |
 
36
        update_multi |
 
37
        update_one |
 
38
        update_between |
 
39
#       update_two |    # Not fully consistent
 
40
        update_limit |  # Broken in Falcon
 
41
        update_in |
 
42
        insert_one |    # Broken with Falcon
 
43
        insert_multi |  # Broken with Falcon
 
44
        insert_select | # Broken with Falcon
 
45
        insert_delete | # Broken with Falcon
 
46
#       insert_update | # Not fully consistent
 
47
        replace |       # Broken in Falcon
 
48
        delete_one | 
 
49
        delete_multi 
 
50
;
 
51
 
 
52
commit_rollback:
 
53
        COMMIT |
 
54
        SAVEPOINT A |
 
55
        ROLLBACK TO SAVEPOINT A |
 
56
        ROLLBACK
 
57
;
 
58
 
 
59
update_all:
 
60
        UPDATE _table SET update_both ;
 
61
 
 
62
update_multi:
 
63
        UPDATE _table SET update_both WHERE key_nokey_pk > _digit ;
 
64
 
 
65
update_one:
 
66
        UPDATE _table SET update_both WHERE `pk` = value ;
 
67
 
 
68
update_between:
 
69
        SET @var = half_digit ; UPDATE _table SET update_both WHERE `pk` >= @var AND `pk` <= @var + 1 |
 
70
        SET @var = half_digit ; UPDATE _table SET update_both WHERE `pk` BETWEEN @var AND @var + 1 ;
 
71
        
 
72
update_two:
 
73
        UPDATE _table SET `col_int_key` = `col_int_key` - 10 WHERE `pk` = small ; UPDATE _table SET `col_int_key` = `col_int_key` + 10 WHERE `pk` = big ;
 
74
 
 
75
update_limit:
 
76
        UPDATE _table SET update_one_half + IF(`pk` % 2 = 1 , 20, -20) WHERE `pk` >= half_digit ORDER BY `pk` ASC LIMIT 2 ;
 
77
 
 
78
update_in:
 
79
        UPDATE _table SET update_one_half  + IF(`pk` % 2 = 1 , 30, -30) WHERE `pk` IN ( even_odd ) ;
 
80
 
 
81
insert_one:
 
82
        INSERT INTO _table ( `pk` , `col_int_key` , `col_int`) VALUES ( NULL , 100 , 100 ) |
 
83
        INSERT INTO _table ( `pk` ) VALUES ( NULL ) ; ROLLBACK ;
 
84
 
 
85
insert_multi:
 
86
        INSERT INTO _table ( `pk` , `col_int_key` , `col_int`) VALUES ( NULL , 100 , 100 ) , ( NULL , 100 , 100 ) |
 
87
        INSERT INTO _table ( `pk` ) VALUES ( NULL ) , ( NULL ) , ( NULL ) ; ROLLBACK ;
 
88
 
 
89
insert_select:
 
90
        INSERT INTO _table ( `col_int_key` , `col_int` ) SELECT `col_int` , `col_int_key` FROM _table WHERE `pk` > 10 LIMIT _digit ;
 
91
 
 
92
insert_delete:
 
93
        INSERT INTO _table[invariant] ( `pk` , `col_int_key` , `col_int` ) VALUES ( NULL , 50 , 60 ) ; DELETE FROM _table[invariant] WHERE `pk` = @@LAST_INSERT_ID ;
 
94
 
 
95
insert_update:
 
96
        INSERT INTO _table ( `pk` , `col_int_key` , `col_int` ) VALUES ( NULL, 170 , 180 ) ; UPDATE _table SET `col_int_key` = `col_int_key` - 80 , `col_int` = `col_int` - 70 WHERE `pk` = _digit ;
 
97
 
 
98
replace:
 
99
        REPLACE INTO _table ( `pk` , `col_int_key` , `col_int` ) VALUES ( NULL, 100 , 100 ) |
 
100
        REPLACE INTO _table ( `pk` ) VALUES ( _digit ) ; ROLLBACK ;
 
101
 
 
102
delete_one:
 
103
        DELETE FROM _table WHERE `pk` = _tinyint_unsigned AND `pk` > 10;
 
104
 
 
105
delete_multi:
 
106
        DELETE FROM _table WHERE `pk` > _tinyint_unsigned AND `pk` > 10 LIMIT _digit ;
 
107
 
 
108
update_both:
 
109
        `col_int_key` = `col_int_key` - 20, `col_int` = `col_int` + 20 |
 
110
        `col_int` = `col_int` + 30, `col_int_key` = `col_int_key` - 30 ;
 
111
 
 
112
update_one_half:
 
113
        `col_int_key` = `col_int_key` |
 
114
        `col_int` = `col_int` ;
 
115
 
 
116
key_nokey_pk:
 
117
        `col_int_key` | `col_int` | `pk` ;
 
118
 
 
119
value:
 
120
        _digit;
 
121
 
 
122
half_digit:
 
123
        1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ;
 
124
 
 
125
even_odd:
 
126
        odd , even | even , odd ;
 
127
 
 
128
odd:
 
129
        1 | 3 | 5 | 7 | 9 ;
 
130
 
 
131
even:
 
132
        2 | 4 | 6 | 8 ;
 
133
 
 
134
small:
 
135
        1 | 2 | 3 | 4 ;
 
136
 
 
137
big:
 
138
        5 | 6 | 7 | 8 | 9 ;
 
139
 
 
140
_digit:
 
141
        1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;