SET STORAGE_ENGINE = Falcon;
*** Bug #207 ***
DROP TABLE IF EXISTS t1;
DROP PROCEDURE IF EXISTS p;
set @@autocommit=0//
create procedure p ()
begin
declare v int default 0;
declare continue handler for sqlexception begin end;
create table t1 (s1 int unique);
while v < 1000 do
insert into t1 values (v);
update t1 set s1 = s1 * 2;
select distinct v from t1;
set v = v + 1;
end while;
end;
//
call p()//
v
0
v
1
v
2
v
3
v
4
v
5
v
6
v
7
v
8
v
9
v
10
v
11
v
12
v
13
v
14
v
15
v
16
v
17
v
18
v
19
v
20
v
21
v
22
v
23
v
24
v
25
v
26
v
27
v
28
v
29
v
30
v
31
v
32
v
33
v
34
v
35
v
36
v
37
v
38
v
39
v
40
v
41
v
42
v
43
v
44
v
45
v
46
v
47
v
48
v
49
v
50
v
51
v
52
v
53
v
54
v
55
v
56
v
57
v
58
v
59
v
60
v
61
v
62
v
63
v
64
v
65
v
66
v
67
v
68
v
69
v
70
v
71
v
72
v
73
v
74
v
75
v
76
v
77
v
78
v
79
v
80
v
81
v
82
v
83
v
84
v
85
v
86
v
87
v
88
v
89
v
90
v
91
v
92
v
93
v
94
v
95
v
96
v
97
v
98
v
99
v
100
v
101
v
102
v
103
v
104
v
105
v
106
v
107
v
108
v
109
v
110
v
111
v
112
v
113
v
114
v
115
v
116
v
117
v
118
v
119
v
120
v
121
v
122
v
123
v
124
v
125
v
126
v
127
v
128
v
129
v
130
v
131
v
132
v
133
v
134
v
135
v
136
v
137
v
138
v
139
v
140
v
141
v
142
v
143
v
144
v
145
v
146
v
147
v
148
v
149
v
150
v
151
v
152
v
153
v
154
v
155
v
156
v
157
v
158
v
159
v
160
v
161
v
162
v
163
v
164
v
165
v
166
v
167
v
168
v
169
v
170
v
171
v
172
v
173
v
174
v
175
v
176
v
177
v
178
v
179
v
180
v
181
v
182
v
183
v
184
v
185
v
186
v
187
v
188
v
189
v
190
v
191
v
192
v
193
v
194
v
195
v
196
v
197
v
198
v
199
v
200
v
201
v
202
v
203
v
204
v
205
v
206
v
207
v
208
v
209
v
210
v
211
v
212
v
213
v
214
v
215
v
216
v
217
v
218
v
219
v
220
v
221
v
222
v
223
v
224
v
225
v
226
v
227
v
228
v
229
v
230
v
231
v
232
v
233
v
234
v
235
v
236
v
237
v
238
v
239
v
240
v
241
v
242
v
243
v
244
v
245
v
246
v
247
v
248
v
249
v
250
v
251
v
252
v
253
v
254
v
255
v
256
v
257
v
258
v
259
v
260
v
261
v
262
v
263
v
264
v
265
v
266
v
267
v
268
v
269
v
270
v
271
v
272
v
273
v
274
v
275
v
276
v
277
v
278
v
279
v
280
v
281
v
282
v
283
v
284
v
285
v
286
v
287
v
288
v
289
v
290
v
291
v
292
v
293
v
294
v
295
v
296
v
297
v
298
v
299
v
300
v
301
v
302
v
303
v
304
v
305
v
306
v
307
v
308
v
309
v
310
v
311
v
312
v
313
v
314
v
315
v
316
v
317
v
318
v
319
v
320
v
321
v
322
v
323
v
324
v
325
v
326
v
327
v
328
v
329
v
330
v
331
v
332
v
333
v
334
v
335
v
336
v
337
v
338
v
339
v
340
v
341
v
342
v
343
v
344
v
345
v
346
v
347
v
348
v
349
v
350
v
351
v
352
v
353
v
354
v
355
v
356
v
357
v
358
v
359
v
360
v
361
v
362
v
363
v
364
v
365
v
366
v
367
v
368
v
369
v
370
v
371
v
372
v
373
v
374
v
375
v
376
v
377
v
378
v
379
v
380
v
381
v
382
v
383
v
384
v
385
v
386
v
387
v
388
v
389
v
390
v
391
v
392
v
393
v
394
v
395
v
396
v
397
v
398
v
399
v
400
v
401
v
402
v
403
v
404
v
405
v
406
v
407
v
408
v
409
v
410
v
411
v
412
v
413
v
414
v
415
v
416
v
417
v
418
v
419
v
420
v
421
v
422
v
423
v
424
v
425
v
426
v
427
v
428
v
429
v
430
v
431
v
432
v
433
v
434
v
435
v
436
v
437
v
438
v
439
v
440
v
441
v
442
v
443
v
444
v
445
v
446
v
447
v
448
v
449
v
450
v
451
v
452
v
453
v
454
v
455
v
456
v
457
v
458
v
459
v
460
v
461
v
462
v
463
v
464
v
465
v
466
v
467
v
468
v
469
v
470
v
471
v
472
v
473
v
474
v
475
v
476
v
477
v
478
v
479
v
480
v
481
v
482
v
483
v
484
v
485
v
486
v
487
v
488
v
489
v
490
v
491
v
492
v
493
v
494
v
495
v
496
v
497
v
498
v
499
v
500
v
501
v
502
v
503
v
504
v
505
v
506
v
507
v
508
v
509
v
510
v
511
v
512
v
513
v
514
v
515
v
516
v
517
v
518
v
519
v
520
v
521
v
522
v
523
v
524
v
525
v
526
v
527
v
528
v
529
v
530
v
531
v
532
v
533
v
534
v
535
v
536
v
537
v
538
v
539
v
540
v
541
v
542
v
543
v
544
v
545
v
546
v
547
v
548
v
549
v
550
v
551
v
552
v
553
v
554
v
555
v
556
v
557
v
558
v
559
v
560
v
561
v
562
v
563
v
564
v
565
v
566
v
567
v
568
v
569
v
570
v
571
v
572
v
573
v
574
v
575
v
576
v
577
v
578
v
579
v
580
v
581
v
582
v
583
v
584
v
585
v
586
v
587
v
588
v
589
v
590
v
591
v
592
v
593
v
594
v
595
v
596
v
597
v
598
v
599
v
600
v
601
v
602
v
603
v
604
v
605
v
606
v
607
v
608
v
609
v
610
v
611
v
612
v
613
v
614
v
615
v
616
v
617
v
618
v
619
v
620
v
621
v
622
v
623
v
624
v
625
v
626
v
627
v
628
v
629
v
630
v
631
v
632
v
633
v
634
v
635
v
636
v
637
v
638
v
639
v
640
v
641
v
642
v
643
v
644
v
645
v
646
v
647
v
648
v
649
v
650
v
651
v
652
v
653
v
654
v
655
v
656
v
657
v
658
v
659
v
660
v
661
v
662
v
663
v
664
v
665
v
666
v
667
v
668
v
669
v
670
v
671
v
672
v
673
v
674
v
675
v
676
v
677
v
678
v
679
v
680
v
681
v
682
v
683
v
684
v
685
v
686
v
687
v
688
v
689
v
690
v
691
v
692
v
693
v
694
v
695
v
696
v
697
v
698
v
699
v
700
v
701
v
702
v
703
v
704
v
705
v
706
v
707
v
708
v
709
v
710
v
711
v
712
v
713
v
714
v
715
v
716
v
717
v
718
v
719
v
720
v
721
v
722
v
723
v
724
v
725
v
726
v
727
v
728
v
729
v
730
v
731
v
732
v
733
v
734
v
735
v
736
v
737
v
738
v
739
v
740
v
741
v
742
v
743
v
744
v
745
v
746
v
747
v
748
v
749
v
750
v
751
v
752
v
753
v
754
v
755
v
756
v
757
v
758
v
759
v
760
v
761
v
762
v
763
v
764
v
765
v
766
v
767
v
768
v
769
v
770
v
771
v
772
v
773
v
774
v
775
v
776
v
777
v
778
v
779
v
780
v
781
v
782
v
783
v
784
v
785
v
786
v
787
v
788
v
789
v
790
v
791
v
792
v
793
v
794
v
795
v
796
v
797
v
798
v
799
v
800
v
801
v
802
v
803
v
804
v
805
v
806
v
807
v
808
v
809
v
810
v
811
v
812
v
813
v
814
v
815
v
816
v
817
v
818
v
819
v
820
v
821
v
822
v
823
v
824
v
825
v
826
v
827
v
828
v
829
v
830
v
831
v
832
v
833
v
834
v
835
v
836
v
837
v
838
v
839
v
840
v
841
v
842
v
843
v
844
v
845
v
846
v
847
v
848
v
849
v
850
v
851
v
852
v
853
v
854
v
855
v
856
v
857
v
858
v
859
v
860
v
861
v
862
v
863
v
864
v
865
v
866
v
867
v
868
v
869
v
870
v
871
v
872
v
873
v
874
v
875
v
876
v
877
v
878
v
879
v
880
v
881
v
882
v
883
v
884
v
885
v
886
v
887
v
888
v
889
v
890
v
891
v
892
v
893
v
894
v
895
v
896
v
897
v
898
v
899
v
900
v
901
v
902
v
903
v
904
v
905
v
906
v
907
v
908
v
909
v
910
v
911
v
912
v
913
v
914
v
915
v
916
v
917
v
918
v
919
v
920
v
921
v
922
v
923
v
924
v
925
v
926
v
927
v
928
v
929
v
930
v
931
v
932
v
933
v
934
v
935
v
936
v
937
v
938
v
939
v
940
v
941
v
942
v
943
v
944
v
945
v
946
v
947
v
948
v
949
v
950
v
951
v
952
v
953
v
954
v
955
v
956
v
957
v
958
v
959
v
960
v
961
v
962
v
963
v
964
v
965
v
966
v
967
v
968
v
969
v
970
v
971
v
972
v
973
v
974
v
975
v
976
v
977
v
978
v
979
v
980
v
981
v
982
v
983
v
984
v
985
v
986
v
987
v
988
v
989
v
990
v
991
v
992
v
993
v
994
v
995
v
996
v
997
v
998
v
999
Warnings:
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 4
Warning	1264	Out of range value for column 's1' at row 2
Warning	1264	Out of range value for column 's1' at row 3
Warning	1264	Out of range value for column 's1' at row 3
DROP TABLE t1//
DROP PROCEDURE p//
