summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sql_sequence/alter.result
blob: 2b1a9d3fd4000dbc7655d774ebce5db856601b42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
drop table if exists t1;
Warnings:
Note	1051	Unknown table 'test.t1'
#
# Test alter sequence
#
CREATE SEQUENCE t1 nocache engine=myisam;
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
1	1	9223372036854775806	1	1	0	0	0
select next value for t1;
next value for t1
1
alter sequence t1 start=50;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 50 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
2	1	9223372036854775806	50	1	0	0	0
select next value for t1;
next value for t1
2
alter sequence t1 minvalue=-100;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 50 minvalue -100 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
3	-100	9223372036854775806	50	1	0	0	0
alter sequence t1 minvalue=100 start=100;
ERROR HY000: Sequence 'test.t1' has out of range value for options
alter sequence t1 minvalue=100 start=100 restart=100;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 100 minvalue 100 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
100	100	9223372036854775806	100	1	0	0	0
alter sequence t1 maxvalue=500;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 100 minvalue 100 maxvalue 500 increment by 1 nocache nocycle ENGINE=MyISAM
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
100	100	500	100	1	0	0	0
drop sequence t1;
CREATE SEQUENCE t1 engine=myisam;
alter sequence t1 nocache;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
alter sequence t1 cache=100;
flush tables;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 100 nocycle ENGINE=MyISAM
alter sequence t1 nocache;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
flush tables;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
1	1	9223372036854775806	1	1	0	0	0
select next value for t1;
next value for t1
1
select next value for t1;
next value for t1
2
select next value for t1;
next value for t1
3
select next_not_cached_value, cycle_count from t1;
next_not_cached_value	cycle_count
4	0
drop sequence t1;
CREATE SEQUENCE t1 maxvalue=100 engine=myisam;
alter sequence t1 no maxvalue;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
1	1	9223372036854775806	1	1	1000	0	0
alter sequence t1 cycle;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 cycle ENGINE=MyISAM
alter sequence t1 nocycle;
alter sequence t1 start=15 restart minvalue=10 maxvalue=20 cycle;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 15 minvalue 10 maxvalue 20 increment by 1 cache 1000 cycle ENGINE=MyISAM
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
15	10	20	15	1	1000	1	0
select NEXT VALUE for t1 from seq_1_to_10;
NEXT VALUE for t1
15
16
17
18
19
20
10
11
12
13
alter sequence t1 restart with 17 minvalue=10 maxvalue=20 cycle;
select NEXT VALUE for t1 from seq_1_to_10;
NEXT VALUE for t1
17
18
19
20
10
11
12
13
14
15
drop sequence t1;
CREATE SEQUENCE t1 maxvalue=100;
alter sequence t1 increment=-2 start with 50 minvalue=-100;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 50 minvalue -100 maxvalue 100 increment by -2 cache 1000 nocycle ENGINE=MyISAM
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
1	-100	100	50	-2	1000	0	0
select NEXT VALUE for t1 from seq_1_to_10;
NEXT VALUE for t1
1
-1
-3
-5
-7
-9
-11
-13
-15
-17
drop sequence t1;
#
# InnoDB (some things work different with InnoDB)

CREATE SEQUENCE t1 cache 10 engine=innodb;
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
1	1	9223372036854775806	1	1	10	0	0
select next value for t1;
next value for t1
1
alter sequence t1 start=100;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 100 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 10 nocycle ENGINE=InnoDB
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
11	1	9223372036854775806	100	1	10	0	0
select next value for t1;
next value for t1
11
drop sequence t1;
#
# ALTER TABLE
#
CREATE SEQUENCE t1 engine=innodb;
select next value for t1;
next value for t1
1
alter table t1 rename t2;
select next value for t2;
next value for t2
1001
rename table t2 to t1;
select next value for t1;
next value for t1
2001
alter table t1 comment="foo";
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB COMMENT='foo'
alter table t1 engine=myisam;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM COMMENT='foo'
alter table t1 engine=innodb;
show create sequence t1;
Table	Create Table
t1	CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB COMMENT='foo'
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
3001	1	9223372036854775806	1	1	1000	0	0
drop sequence t1;
CREATE SEQUENCE t1 engine=myisam;
alter sequence t1 minvalue=100;
ERROR HY000: Sequence 'test.t1' has out of range value for options
drop sequence t1;
CREATE SEQUENCE t1 engine=myisam;
alter sequence t1 minvalue=25 maxvalue=20;
ERROR HY000: Sequence 'test.t1' has out of range value for options
drop sequence t1;
create table t1 (a int);
alter sequence t1 minvalue=100;
ERROR 42S02: 'test.t1' is not a SEQUENCE
drop table t1;
alter sequence if exists t1 minvalue=100;
ERROR 42S02: Unknown SEQUENCE: 't1'
alter sequence t1 minvalue=100;
ERROR 42S02: Unknown SEQUENCE: 't1'
create sequence t1;
alter sequence t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
drop sequence t1;
CREATE SEQUENCE t1 maxvalue=100;
alter sequence t1 increment=-2 start with 50;
select next value for t1;
next value for t1
1
select next value for t1;
ERROR HY000: Sequence 'test.t1' has run out
select * from t1;
next_not_cached_value	minimum_value	maximum_value	start_value	increment	cache_size	cycle_option	cycle_count
0	1	100	50	-2	1000	0	0
alter sequence t1 restart;
select next value for t1;
next value for t1
50
alter sequence t1 restart with 90;
select next value for t1;
next value for t1
90
drop sequence t1;
CREATE SEQUENCE t1 engine=innodb;
ALTER IGNORE TABLE t1 ADD CHECK (start_value < minimum_value);
ERROR HY000: Sequence 'test.t1' table structure is invalid (Sequence tables cannot have any constraints)
DROP SEQUENCE t1;
CREATE SEQUENCE s;
ALTER TABLE s ORDER BY cache_size;
ERROR HY000: Sequence 'test.s' table structure is invalid (ORDER BY)
SELECT NEXTVAL(s);
NEXTVAL(s)
1
DROP SEQUENCE s;
#
# MDEV-28152 Features for sequence
#
create sequence s maxvalue 12345;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 12345 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 123456789012345678901234;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
drop sequence s;
create sequence s as tinyint;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as tinyint start with 1 minvalue 1 maxvalue 126 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` tinyint(5) NOT NULL,
  `minimum_value` tinyint(5) NOT NULL,
  `maximum_value` tinyint(5) NOT NULL,
  `start_value` tinyint(5) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
alter sequence s as int;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int start with 1 minvalue 1 maxvalue 126 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` int(12) NOT NULL,
  `minimum_value` int(12) NOT NULL,
  `maximum_value` int(12) NOT NULL,
  `start_value` int(12) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
alter sequence s maxvalue 12345;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int start with 1 minvalue 1 maxvalue 12345 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` int(12) NOT NULL,
  `minimum_value` int(12) NOT NULL,
  `maximum_value` int(12) NOT NULL,
  `start_value` int(12) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
drop sequence s;
create sequence s;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` bigint(21) NOT NULL,
  `minimum_value` bigint(21) NOT NULL,
  `maximum_value` bigint(21) NOT NULL,
  `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
alter sequence s maxvalue 123;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` bigint(21) NOT NULL,
  `minimum_value` bigint(21) NOT NULL,
  `maximum_value` bigint(21) NOT NULL,
  `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
alter sequence s as tinyint;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as tinyint start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` tinyint(5) NOT NULL,
  `minimum_value` tinyint(5) NOT NULL,
  `maximum_value` tinyint(5) NOT NULL,
  `start_value` tinyint(5) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
drop sequence s;
create sequence s as int;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int start with 1 minvalue 1 maxvalue 2147483646 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` int(12) NOT NULL,
  `minimum_value` int(12) NOT NULL,
  `maximum_value` int(12) NOT NULL,
  `start_value` int(12) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
alter sequence s as tinyint;
ERROR 22003: Out of range value for column 'maximum_value' at row 1
alter sequence s maxvalue 126;
alter sequence s as tinyint;
drop sequence s;
create sequence s as tinyint;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as tinyint start with 1 minvalue 1 maxvalue 126 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` tinyint(5) NOT NULL,
  `minimum_value` tinyint(5) NOT NULL,
  `maximum_value` tinyint(5) NOT NULL,
  `start_value` tinyint(5) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
alter sequence s as int maxvalue 123;
ERROR 42000: This version of MariaDB doesn't yet support 'ALTER SEQUENCE with both AS <type> and something else.'
drop sequence s;
create sequence s as smallint;
select next value for s;
next value for s
1
alter sequence s as int;
select next value for s;
next value for s
1001
drop sequence s;
create sequence s as tinyint;
select next value for s;
next value for s
1
alter sequence s cache 100;
select next value for s;
ERROR HY000: Sequence 'test.s' has run out
drop sequence s;
create sequence s as int;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int start with 1 minvalue 1 maxvalue 2147483646 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` int(12) NOT NULL,
  `minimum_value` int(12) NOT NULL,
  `maximum_value` int(12) NOT NULL,
  `start_value` int(12) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
alter sequence s as int unsigned;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int unsigned start with 1 minvalue 1 maxvalue 2147483646 increment by 1 cache 1000 nocycle ENGINE=MyISAM
show create table s;
Table	Create Table
s	CREATE TABLE `s` (
  `next_not_cached_value` int(12) unsigned NOT NULL,
  `minimum_value` int(12) unsigned NOT NULL,
  `maximum_value` int(12) unsigned NOT NULL,
  `start_value` int(12) unsigned NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=MyISAM SEQUENCE=1
drop sequence s;
create sequence s as tinyint;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as tinyint start with 1 minvalue 1 maxvalue 126 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 126;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as tinyint start with 1 minvalue 1 maxvalue 126 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 63;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as tinyint start with 1 minvalue 1 maxvalue 63 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
ERROR HY000: Sequence 'test.s' has run out
drop sequence s;
create sequence s as tinyint unsigned;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as tinyint unsigned start with 1 minvalue 1 maxvalue 254 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 254;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as tinyint unsigned start with 1 minvalue 1 maxvalue 254 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 120;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as tinyint unsigned start with 1 minvalue 1 maxvalue 120 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
ERROR HY000: Sequence 'test.s' has run out
drop sequence s;
create sequence s as smallint;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as smallint start with 1 minvalue 1 maxvalue 32766 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 32766;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as smallint start with 1 minvalue 1 maxvalue 32766 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 16030;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as smallint start with 1 minvalue 1 maxvalue 16030 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1001
drop sequence s;
create sequence s as smallint unsigned;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as smallint unsigned start with 1 minvalue 1 maxvalue 65534 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 65534;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as smallint unsigned start with 1 minvalue 1 maxvalue 65534 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 32000;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as smallint unsigned start with 1 minvalue 1 maxvalue 32000 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1001
drop sequence s;
create sequence s as mediumint;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as mediumint start with 1 minvalue 1 maxvalue 8388606 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 8388606;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as mediumint start with 1 minvalue 1 maxvalue 8388606 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 4223212;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as mediumint start with 1 minvalue 1 maxvalue 4223212 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1001
drop sequence s;
create sequence s as mediumint unsigned;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as mediumint unsigned start with 1 minvalue 1 maxvalue 16777214 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 16777214;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as mediumint unsigned start with 1 minvalue 1 maxvalue 16777214 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 8389231;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as mediumint unsigned start with 1 minvalue 1 maxvalue 8389231 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1001
drop sequence s;
create sequence s as int;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int start with 1 minvalue 1 maxvalue 2147483646 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 2147483646;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int start with 1 minvalue 1 maxvalue 2147483646 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 1234567890;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int start with 1 minvalue 1 maxvalue 1234567890 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1001
drop sequence s;
create sequence s as int unsigned;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int unsigned start with 1 minvalue 1 maxvalue 4294967294 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 4294967294;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int unsigned start with 1 minvalue 1 maxvalue 4294967294 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 2123834923;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as int unsigned start with 1 minvalue 1 maxvalue 2123834923 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1001
drop sequence s;
create sequence s as bigint;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 9223372036854775806;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 4683883928492758294;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 4683883928492758294 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1001
drop sequence s;
create sequence s as bigint unsigned;
alter sequence s maxvalue 123456789012345678901;
Warnings:
Note	1292	Truncated incorrect INTEGER value: 'MAXVALUE'
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as bigint unsigned start with 1 minvalue 1 maxvalue 18446744073709551614 increment by 1 cache 1000 nocycle ENGINE=MyISAM
alter sequence s maxvalue 18446744073709551614;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as bigint unsigned start with 1 minvalue 1 maxvalue 18446744073709551614 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1
alter sequence s maxvalue 9432738420582397432;
show create sequence s;
Table	Create Table
s	CREATE SEQUENCE `s` as bigint unsigned start with 1 minvalue 1 maxvalue 9432738420582397432 increment by 1 cache 1000 nocycle ENGINE=MyISAM
select next value for s;
next value for s
1001
drop sequence s;