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

« back to all changes in this revision

Viewing changes to plugin/transaction_log/tests/r/transaction_log_schema.result

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Simple CREATE / DROP test
2
 
Testing simple CREATE SCHEMA 
3
 
CREATE SCHEMA my_test_schema;
4
 
Check transaction_log_entries
5
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
6
 
COUNT(*)
7
 
1
8
 
 
9
 
Check transaction_log_transactions
10
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
11
 
COUNT(*)
12
 
1
13
 
Check transaction log contents
14
 
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
15
 
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
16
 
transaction_context {
17
 
  server_id: 1
18
 
  TRANSACTION_ID
19
 
  START_TIMESTAMP
20
 
  END_TIMESTAMP
21
 
}
22
 
statement {
23
 
  type: CREATE_SCHEMA
24
 
  START_TIMESTAMP
25
 
  END_TIMESTAMP
26
 
  create_schema_statement {
27
 
    schema {
28
 
      name: "my_test_schema"
29
 
      collation: "utf8_general_ci"
30
 
      engine {
31
 
        name: "filesystem"
32
 
      }
33
 
      catalog: "LOCAL"
34
 
      CREATE_TIMESTAMP
35
 
      UPDATE_TIMESTAMP
36
 
      UUID
37
 
      version: 1
38
 
    }
39
 
  }
40
 
}
41
 
segment_id: 1
42
 
end_segment: true
43
 
 
44
 
 
45
 
COMMIT;
46
 
 
47
 
Testing simple DROP SCHEMA
48
 
DROP SCHEMA my_test_schema;
49
 
Check transaction_log_entries
50
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
51
 
COUNT(*)
52
 
2
53
 
 
54
 
Check transaction_log_transactions
55
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
56
 
COUNT(*)
57
 
2
58
 
Check transaction log contents
59
 
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
60
 
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
61
 
transaction_context {
62
 
  server_id: 1
63
 
  TRANSACTION_ID
64
 
  START_TIMESTAMP
65
 
  END_TIMESTAMP
66
 
}
67
 
statement {
68
 
  type: DROP_SCHEMA
69
 
  START_TIMESTAMP
70
 
  END_TIMESTAMP
71
 
  drop_schema_statement {
72
 
    schema_name: "my_test_schema"
73
 
  }
74
 
}
75
 
segment_id: 1
76
 
end_segment: true
77
 
 
78
 
 
79
 
COMMIT;
80
 
 
81
 
SET GLOBAL transaction_log_truncate_debug= true;
82
 
 
83
 
Testing DROP SCHEMA on non-empty schema
84
 
CREATE SCHEMA my_test_schema;
85
 
CREATE TABLE my_test_schema.t1 (a int not null, primary key(a));
86
 
CREATE TABLE my_test_schema.t2 LIKE my_test_schema.t1;
87
 
CREATE TABLE my_test_schema.t3 LIKE my_test_schema.t2;
88
 
We truncate the log to simplify test validation
89
 
we are mainly concerned that we see 4 new entries 
90
 
once we have issued the DROP SCHEMA statement
91
 
SET GLOBAL transaction_log_truncate_debug= true;
92
 
 
93
 
DROP SCHEMA my_test_schema;
94
 
The implied DROP TABLE statements for t1->t3
95
 
do not come in any deterministic order t1 may or may not be first
96
 
,therefore we have to satisfy ourselves that we have 4 items in the log
97
 
after issuing the DROP SCHEMA
98
 
We do check the first entry (OFFSET=0) as this should be the first of 3 DROP TABLE messages
99
 
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',0);
100
 
PRINT_TRANSACTION_MESSAGE('transaction.log',0)
101
 
transaction_context {
102
 
  server_id: 1
103
 
  TRANSACTION_ID
104
 
  START_TIMESTAMP
105
 
  END_TIMESTAMP
106
 
}
107
 
statement {
108
 
  type: DROP_TABLE
109
 
  START_TIMESTAMP
110
 
  END_TIMESTAMP
111
 
  drop_table_statement {
112
 
    table_metadata {
113
 
      schema_name: "my_test_schema"
114
 
      table_name:  TABLE_NAME
115
 
    }
116
 
    if_exists_clause: true
117
 
  }
118
 
}
119
 
segment_id: 1
120
 
end_segment: true
121
 
 
122
 
Check transaction_log_entries
123
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
124
 
COUNT(*)
125
 
4
126
 
 
127
 
Check transaction_log_transactions
128
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
129
 
COUNT(*)
130
 
4
131
 
Check transaction log contents
132
 
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
133
 
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
134
 
transaction_context {
135
 
  server_id: 1
136
 
  TRANSACTION_ID
137
 
  START_TIMESTAMP
138
 
  END_TIMESTAMP
139
 
}
140
 
statement {
141
 
  type: DROP_SCHEMA
142
 
  START_TIMESTAMP
143
 
  END_TIMESTAMP
144
 
  drop_schema_statement {
145
 
    schema_name: "my_test_schema"
146
 
  }
147
 
}
148
 
segment_id: 1
149
 
end_segment: true
150
 
 
151
 
 
152
 
COMMIT;
153
 
 
154
 
SET GLOBAL transaction_log_truncate_debug= true;
155
 
 
156
 
Testing simple CREATE SCHEMA
157
 
CREATE SCHEMA my_test_schema;
158
 
USE my_test_schema;
159
 
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b CHAR(50), PRIMARY KEY(a));
160
 
ALTER SCHEMA my_test_schema COLLATE utf8_turkish_ci;
161
 
SHOW CREATE TABLE t1;
162
 
Table   Create Table
163
 
t1      CREATE TABLE `t1` (
164
 
  `a` INT NOT NULL AUTO_INCREMENT,
165
 
  `b` VARCHAR(50) COLLATE utf8_general_ci DEFAULT NULL,
166
 
  PRIMARY KEY (`a`)
167
 
) ENGINE=InnoDB COLLATE = utf8_general_ci
168
 
Check transaction_log_entries
169
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
170
 
COUNT(*)
171
 
3
172
 
 
173
 
Check transaction_log_transactions
174
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
175
 
COUNT(*)
176
 
3
177
 
Check transaction log contents
178
 
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
179
 
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
180
 
transaction_context {
181
 
  server_id: 1
182
 
  TRANSACTION_ID
183
 
  START_TIMESTAMP
184
 
  END_TIMESTAMP
185
 
}
186
 
statement {
187
 
  type: ALTER_SCHEMA
188
 
  START_TIMESTAMP
189
 
  END_TIMESTAMP
190
 
  alter_schema_statement {
191
 
    before {
192
 
      name: "my_test_schema"
193
 
      collation: "utf8_general_ci"
194
 
      engine {
195
 
        name: "filesystem"
196
 
      }
197
 
      catalog: "LOCAL"
198
 
      CREATE_TIMESTAMP
199
 
      UPDATE_TIMESTAMP
200
 
      UUID
201
 
      version: 1
202
 
    }
203
 
    after {
204
 
      name: "my_test_schema"
205
 
      collation: "utf8_turkish_ci"
206
 
      engine {
207
 
        name: "filesystem"
208
 
      }
209
 
      catalog: "LOCAL"
210
 
      CREATE_TIMESTAMP
211
 
      UPDATE_TIMESTAMP
212
 
      UUID
213
 
      version: 2
214
 
    }
215
 
  }
216
 
}
217
 
segment_id: 1
218
 
end_segment: true
219
 
 
220
 
 
221
 
COMMIT;
222
 
 
223
 
CREATE TABLE t2 LIKE t1;
224
 
Check transaction_log_entries
225
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
226
 
COUNT(*)
227
 
4
228
 
 
229
 
Check transaction_log_transactions
230
 
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
231
 
COUNT(*)
232
 
4
233
 
Check transaction log contents
234
 
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
235
 
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
236
 
transaction_context {
237
 
  server_id: 1
238
 
  TRANSACTION_ID
239
 
  START_TIMESTAMP
240
 
  END_TIMESTAMP
241
 
}
242
 
statement {
243
 
  type: CREATE_TABLE
244
 
  START_TIMESTAMP
245
 
  END_TIMESTAMP
246
 
  create_table_statement {
247
 
    table {
248
 
      name: "t2"
249
 
      engine {
250
 
        name: "InnoDB"
251
 
      }
252
 
      field {
253
 
        name: "a"
254
 
        type: INTEGER
255
 
        constraints {
256
 
          is_notnull: true
257
 
        }
258
 
        numeric_options {
259
 
          is_autoincrement: true
260
 
        }
261
 
      }
262
 
      field {
263
 
        name: "b"
264
 
        type: VARCHAR
265
 
        options {
266
 
          default_null: true
267
 
        }
268
 
        string_options {
269
 
          length: 50
270
 
          collation_id: 45
271
 
          collation: "utf8_general_ci"
272
 
        }
273
 
      }
274
 
      indexes {
275
 
        name: "PRIMARY"
276
 
        is_primary: true
277
 
        is_unique: true
278
 
        type: UNKNOWN_INDEX
279
 
        key_length: 4
280
 
        index_part {
281
 
          fieldnr: 0
282
 
          compare_length: 4
283
 
        }
284
 
        options {
285
 
        }
286
 
      }
287
 
      type: STANDARD
288
 
      schema: "my_test_schema"
289
 
      options {
290
 
        has_user_set_auto_increment_value: false
291
 
        collation: "utf8_general_ci"
292
 
        collation_id: 45
293
 
      }
294
 
      CREATE_TIMESTAMP
295
 
      UPDATE_TIMESTAMP
296
 
      catalog: "LOCAL"
297
 
      UUID
298
 
      version: 1
299
 
    }
300
 
  }
301
 
}
302
 
segment_id: 1
303
 
end_segment: true
304
 
 
305
 
 
306
 
COMMIT;
307
 
 
308
 
DROP SCHEMA my_test_schema;
309
 
SET GLOBAL transaction_log_truncate_debug= true;
310