1set global innodb_file_per_table=on; 2# Verify that 'TRUNCATE TABLE' statement works fine and the size 3# of .ibd file is equal to the initial size after truncation. 4drop table if exists t1,t2,t3,t4,t6; 5Warnings: 6Note 1051 Unknown table 'test.t1' 7Note 1051 Unknown table 'test.t2' 8Note 1051 Unknown table 'test.t3' 9Note 1051 Unknown table 'test.t4' 10Note 1051 Unknown table 'test.t6' 11create table t1(c1 int not null, 12c2 int not null, 13c3 char(255) not null, 14c4 text(500) not null, 15c5 blob(500) not null, 16c6 varchar(500) not null, 17c7 varchar(500) not null, 18c8 datetime, 19c9 decimal(5,3), 20primary key (c1), 21index (c3,c4(50),c5(50)), 22index (c2)) 23engine=innodb row_format=redundant; 24create table t2(c1 int not null, 25c2 int not null, 26c3 char(255) not null, 27c4 text(500) not null, 28c5 blob(500) not null, 29c6 varchar(500) not null, 30c7 varchar(500) not null, 31c8 datetime, 32c9 decimal(5,3), 33primary key (c1), 34index (c3,c4(50),c5(50)), 35index (c2)) 36engine=innodb row_format=compact; 37create table t3(c1 int not null, 38c2 int not null, 39c3 char(255) not null, 40c4 text(500) not null, 41c5 blob(500) not null, 42c6 varchar(500) not null, 43c7 varchar(500) not null, 44c8 datetime, 45c9 decimal(5,3), 46primary key (c1), 47index (c3,c4(50),c5(50)), 48index (c2)) 49engine=innodb row_format=compressed key_block_size=4; 50create table t4(c1 int not null, 51c2 int not null, 52c3 char(255) not null, 53c4 text(500) not null, 54c5 blob(500) not null, 55c6 varchar(500) not null, 56c7 varchar(500) not null, 57c8 datetime, 58c9 decimal(5,3), 59primary key (c1), 60index (c3,c4(50),c5(50)), 61index (c2)) 62engine=innodb row_format=dynamic; 63create temporary table t5(c1 int not null, 64c2 int not null, 65c3 char(255) not null, 66c4 text(500) not null, 67c5 blob(500) not null, 68c6 varchar(500) not null, 69c7 varchar(500) not null, 70c8 datetime, 71c9 decimal(5,3), 72primary key (c1), 73index (c3,c4(50),c5(50)), 74index (c2)) 75engine=innodb; 76create table t6 ( a int ) engine = innodb; 77insert into t6 values (50),(100),(150); 78select count(*) from t1; 79count(*) 803 81select count(*) from t2; 82count(*) 833 84select count(*) from t3; 85count(*) 863 87select count(*) from t4; 88count(*) 893 90select count(*) from t5; 91count(*) 923 93select count(*) from t6; 94count(*) 953 96set session debug="+d,ib_trunc_crash_during_drop_index_temp_table"; 97"---debug ib_trunc_crash_during_drop_index_temp_table point---" 98# Write file to make mysql-test-run.pl expect crash and restart 99# Run the crashing query 100truncate table t5; 101ERROR HY000: Lost connection to MySQL server during query 102# Restart the MySQL server 103select count(*) from t1; 104count(*) 1053 106select count(*) from t2; 107count(*) 1083 109select count(*) from t3; 110count(*) 1113 112select count(*) from t4; 113count(*) 1143 115select count(*) from t5; 116ERROR 42S02: Table 'test.t5' doesn't exist 117select count(*) from t6; 118count(*) 1193 120set session debug="+d,ib_trunc_crash_on_drop_of_sec_index"; 121"---debug ib_trunc_crash_on_drop_of_sec_index point---" 122# Write file to make mysql-test-run.pl expect crash and restart 123# Run the crashing query 124truncate table t1; 125ERROR HY000: Lost connection to MySQL server during query 126# Restart the MySQL server 127select count(*) from t1; 128count(*) 1290 130select count(*) from t2; 131count(*) 1323 133select count(*) from t3; 134count(*) 1353 136select count(*) from t4; 137count(*) 1383 139select count(*) from t5; 140ERROR 42S02: Table 'test.t5' doesn't exist 141select count(*) from t6; 142count(*) 1433 144set session debug="+d,ib_trunc_crash_on_drop_of_sec_index"; 145"---debug ib_trunc_crash_on_drop_of_sec_index point---" 146# Write file to make mysql-test-run.pl expect crash and restart 147# Run the crashing query 148truncate table t2; 149ERROR HY000: Lost connection to MySQL server during query 150# Restart the MySQL server 151select count(*) from t1; 152count(*) 1530 154select count(*) from t2; 155count(*) 1560 157select count(*) from t3; 158count(*) 1593 160select count(*) from t4; 161count(*) 1623 163select count(*) from t5; 164ERROR 42S02: Table 'test.t5' doesn't exist 165select count(*) from t6; 166count(*) 1673 168set session debug="+d,ib_trunc_crash_on_drop_of_sec_index"; 169"---debug ib_trunc_crash_on_drop_of_sec_index point---" 170# Write file to make mysql-test-run.pl expect crash and restart 171# Run the crashing query 172truncate table t3; 173ERROR HY000: Lost connection to MySQL server during query 174# Restart the MySQL server 175select count(*) from t1; 176count(*) 1770 178select count(*) from t2; 179count(*) 1800 181select count(*) from t3; 182count(*) 1830 184select count(*) from t4; 185count(*) 1863 187select count(*) from t5; 188ERROR 42S02: Table 'test.t5' doesn't exist 189select count(*) from t6; 190count(*) 1913 192set session debug="+d,ib_trunc_crash_on_drop_of_sec_index"; 193"---debug ib_trunc_crash_on_drop_of_sec_index point---" 194# Write file to make mysql-test-run.pl expect crash and restart 195# Run the crashing query 196truncate table t4; 197ERROR HY000: Lost connection to MySQL server during query 198# Restart the MySQL server 199select count(*) from t1; 200count(*) 2010 202select count(*) from t2; 203count(*) 2040 205select count(*) from t3; 206count(*) 2070 208select count(*) from t4; 209count(*) 2100 211select count(*) from t5; 212ERROR 42S02: Table 'test.t5' doesn't exist 213select count(*) from t6; 214count(*) 2153 216drop table t1, t2, t3, t4, t6; 217create table t1(c1 int not null, 218c2 int not null, 219c3 char(255) not null, 220c4 text(500) not null, 221c5 blob(500) not null, 222c6 varchar(500) not null, 223c7 varchar(500) not null, 224c8 datetime, 225c9 decimal(5,3), 226primary key (c1), 227index (c3,c4(50),c5(50)), 228index (c2)) 229engine=innodb row_format=redundant; 230create table t2(c1 int not null, 231c2 int not null, 232c3 char(255) not null, 233c4 text(500) not null, 234c5 blob(500) not null, 235c6 varchar(500) not null, 236c7 varchar(500) not null, 237c8 datetime, 238c9 decimal(5,3), 239primary key (c1), 240index (c3,c4(50),c5(50)), 241index (c2)) 242engine=innodb row_format=compact; 243create table t3(c1 int not null, 244c2 int not null, 245c3 char(255) not null, 246c4 text(500) not null, 247c5 blob(500) not null, 248c6 varchar(500) not null, 249c7 varchar(500) not null, 250c8 datetime, 251c9 decimal(5,3), 252primary key (c1), 253index (c3,c4(50),c5(50)), 254index (c2)) 255engine=innodb row_format=compressed key_block_size=4; 256create table t4(c1 int not null, 257c2 int not null, 258c3 char(255) not null, 259c4 text(500) not null, 260c5 blob(500) not null, 261c6 varchar(500) not null, 262c7 varchar(500) not null, 263c8 datetime, 264c9 decimal(5,3), 265primary key (c1), 266index (c3,c4(50),c5(50)), 267index (c2)) 268engine=innodb row_format=dynamic; 269create temporary table t5(c1 int not null, 270c2 int not null, 271c3 char(255) not null, 272c4 text(500) not null, 273c5 blob(500) not null, 274c6 varchar(500) not null, 275c7 varchar(500) not null, 276c8 datetime, 277c9 decimal(5,3), 278primary key (c1), 279index (c3,c4(50),c5(50)), 280index (c2)) 281engine=innodb; 282create table t6 ( a int ) engine = innodb; 283insert into t6 values (50),(100),(150); 284select count(*) from t1; 285count(*) 2863 287select count(*) from t2; 288count(*) 2893 290select count(*) from t3; 291count(*) 2923 293select count(*) from t4; 294count(*) 2953 296select count(*) from t5; 297count(*) 2983 299select count(*) from t6; 300count(*) 3013 302set session debug="+d,ib_trunc_crash_drop_reinit_done_create_to_start"; 303"---debug ib_trunc_crash_drop_reinit_done_create_to_start---" 304# Write file to make mysql-test-run.pl expect crash and restart 305# Run the crashing query 306truncate table t5; 307ERROR HY000: Lost connection to MySQL server during query 308# Restart the MySQL server 309select count(*) from t1; 310count(*) 3113 312select count(*) from t2; 313count(*) 3143 315select count(*) from t3; 316count(*) 3173 318select count(*) from t4; 319count(*) 3203 321select count(*) from t5; 322ERROR 42S02: Table 'test.t5' doesn't exist 323select count(*) from t6; 324count(*) 3253 326set session debug="+d,ib_trunc_crash_on_create_of_sec_index"; 327"---debug ib_trunc_crash_on_create_of_sec_index---" 328# Write file to make mysql-test-run.pl expect crash and restart 329# Run the crashing query 330truncate table t1; 331ERROR HY000: Lost connection to MySQL server during query 332# Restart the MySQL server 333select count(*) from t1; 334count(*) 3350 336select count(*) from t2; 337count(*) 3383 339select count(*) from t3; 340count(*) 3413 342select count(*) from t4; 343count(*) 3443 345select count(*) from t5; 346ERROR 42S02: Table 'test.t5' doesn't exist 347select count(*) from t6; 348count(*) 3493 350set session debug="+d,ib_trunc_crash_on_create_of_sec_index"; 351"---debug ib_trunc_crash_on_create_of_sec_index---" 352# Write file to make mysql-test-run.pl expect crash and restart 353# Run the crashing query 354truncate table t2; 355ERROR HY000: Lost connection to MySQL server during query 356# Restart the MySQL server 357select count(*) from t1; 358count(*) 3590 360select count(*) from t2; 361count(*) 3620 363select count(*) from t3; 364count(*) 3653 366select count(*) from t4; 367count(*) 3683 369select count(*) from t5; 370ERROR 42S02: Table 'test.t5' doesn't exist 371select count(*) from t6; 372count(*) 3733 374set session debug="+d,ib_trunc_crash_on_create_of_sec_index"; 375"---debug ib_trunc_crash_on_create_of_sec_index---" 376# Write file to make mysql-test-run.pl expect crash and restart 377# Run the crashing query 378truncate table t3; 379ERROR HY000: Lost connection to MySQL server during query 380# Restart the MySQL server 381select count(*) from t1; 382count(*) 3830 384select count(*) from t2; 385count(*) 3860 387select count(*) from t3; 388count(*) 3890 390select count(*) from t4; 391count(*) 3923 393select count(*) from t5; 394ERROR 42S02: Table 'test.t5' doesn't exist 395select count(*) from t6; 396count(*) 3973 398set session debug="+d,ib_trunc_crash_on_create_of_sec_index"; 399"---debug ib_trunc_crash_on_create_of_sec_index---" 400# Write file to make mysql-test-run.pl expect crash and restart 401# Run the crashing query 402truncate table t4; 403ERROR HY000: Lost connection to MySQL server during query 404# Restart the MySQL server 405select count(*) from t1; 406count(*) 4070 408select count(*) from t2; 409count(*) 4100 411select count(*) from t3; 412count(*) 4130 414select count(*) from t4; 415count(*) 4160 417select count(*) from t5; 418ERROR 42S02: Table 'test.t5' doesn't exist 419select count(*) from t6; 420count(*) 4213 422drop table t1, t2, t3, t4, t6; 423create table t1(c1 int not null, 424c2 int not null, 425c3 char(255) not null, 426c4 text(500) not null, 427c5 blob(500) not null, 428c6 varchar(500) not null, 429c7 varchar(500) not null, 430c8 datetime, 431c9 decimal(5,3), 432primary key (c1), 433index (c3,c4(50),c5(50)), 434index (c2)) 435engine=innodb row_format=redundant; 436create table t2(c1 int not null, 437c2 int not null, 438c3 char(255) not null, 439c4 text(500) not null, 440c5 blob(500) not null, 441c6 varchar(500) not null, 442c7 varchar(500) not null, 443c8 datetime, 444c9 decimal(5,3), 445primary key (c1), 446index (c3,c4(50),c5(50)), 447index (c2)) 448engine=innodb row_format=compact; 449create table t3(c1 int not null, 450c2 int not null, 451c3 char(255) not null, 452c4 text(500) not null, 453c5 blob(500) not null, 454c6 varchar(500) not null, 455c7 varchar(500) not null, 456c8 datetime, 457c9 decimal(5,3), 458primary key (c1), 459index (c3,c4(50),c5(50)), 460index (c2)) 461engine=innodb row_format=compressed key_block_size=4; 462create table t4(c1 int not null, 463c2 int not null, 464c3 char(255) not null, 465c4 text(500) not null, 466c5 blob(500) not null, 467c6 varchar(500) not null, 468c7 varchar(500) not null, 469c8 datetime, 470c9 decimal(5,3), 471primary key (c1), 472index (c3,c4(50),c5(50)), 473index (c2)) 474engine=innodb row_format=dynamic; 475create temporary table t5(c1 int not null, 476c2 int not null, 477c3 char(255) not null, 478c4 text(500) not null, 479c5 blob(500) not null, 480c6 varchar(500) not null, 481c7 varchar(500) not null, 482c8 datetime, 483c9 decimal(5,3), 484primary key (c1), 485index (c3,c4(50),c5(50)), 486index (c2)) 487engine=innodb; 488create table t6 ( a int ) engine = innodb; 489insert into t6 values (50),(100),(150); 490select count(*) from t1; 491count(*) 4923 493select count(*) from t2; 494count(*) 4953 496select count(*) from t3; 497count(*) 4983 499select count(*) from t4; 500count(*) 5013 502select count(*) from t5; 503count(*) 5043 505select count(*) from t6; 506count(*) 5073 508set session debug="+d,ib_trunc_crash_before_log_removal"; 509"---debug ib_trunc_crash_before_log_removal point---" 510# Write file to make mysql-test-run.pl expect crash and restart 511# Run the crashing query 512truncate table t1; 513ERROR HY000: Lost connection to MySQL server during query 514# Restart the MySQL server 515select count(*) from t1; 516count(*) 5170 518select count(*) from t2; 519count(*) 5203 521select count(*) from t3; 522count(*) 5233 524select count(*) from t4; 525count(*) 5263 527select count(*) from t5; 528ERROR 42S02: Table 'test.t5' doesn't exist 529select count(*) from t6; 530count(*) 5313 532set session debug="+d,ib_trunc_crash_before_log_removal"; 533"---debug ib_trunc_crash_before_log_removal point---" 534# Write file to make mysql-test-run.pl expect crash and restart 535# Run the crashing query 536truncate table t2; 537ERROR HY000: Lost connection to MySQL server during query 538# Restart the MySQL server 539select count(*) from t1; 540count(*) 5410 542select count(*) from t2; 543count(*) 5440 545select count(*) from t3; 546count(*) 5473 548select count(*) from t4; 549count(*) 5503 551select count(*) from t5; 552ERROR 42S02: Table 'test.t5' doesn't exist 553select count(*) from t6; 554count(*) 5553 556set session debug="+d,ib_trunc_crash_before_log_removal"; 557"---debug ib_trunc_crash_before_log_removal point---" 558# Write file to make mysql-test-run.pl expect crash and restart 559# Run the crashing query 560truncate table t3; 561ERROR HY000: Lost connection to MySQL server during query 562# Restart the MySQL server 563select count(*) from t1; 564count(*) 5650 566select count(*) from t2; 567count(*) 5680 569select count(*) from t3; 570count(*) 5710 572select count(*) from t4; 573count(*) 5743 575select count(*) from t5; 576ERROR 42S02: Table 'test.t5' doesn't exist 577select count(*) from t6; 578count(*) 5793 580set session debug="+d,ib_trunc_crash_before_log_removal"; 581"---debug ib_trunc_crash_before_log_removal point---" 582# Write file to make mysql-test-run.pl expect crash and restart 583# Run the crashing query 584truncate table t4; 585ERROR HY000: Lost connection to MySQL server during query 586# Restart the MySQL server 587select count(*) from t1; 588count(*) 5890 590select count(*) from t2; 591count(*) 5920 593select count(*) from t3; 594count(*) 5950 596select count(*) from t4; 597count(*) 5980 599select count(*) from t5; 600ERROR 42S02: Table 'test.t5' doesn't exist 601select count(*) from t6; 602count(*) 6033 604drop table t1, t2, t3, t4, t6; 605create table t1(c1 int not null, 606c2 int not null, 607c3 char(255) not null, 608c4 text(500) not null, 609c5 blob(500) not null, 610c6 varchar(500) not null, 611c7 varchar(500) not null, 612c8 datetime, 613c9 decimal(5,3), 614primary key (c1), 615index (c3,c4(50),c5(50)), 616index (c2)) 617engine=innodb row_format=redundant; 618create table t2(c1 int not null, 619c2 int not null, 620c3 char(255) not null, 621c4 text(500) not null, 622c5 blob(500) not null, 623c6 varchar(500) not null, 624c7 varchar(500) not null, 625c8 datetime, 626c9 decimal(5,3), 627primary key (c1), 628index (c3,c4(50),c5(50)), 629index (c2)) 630engine=innodb row_format=compact; 631create table t3(c1 int not null, 632c2 int not null, 633c3 char(255) not null, 634c4 text(500) not null, 635c5 blob(500) not null, 636c6 varchar(500) not null, 637c7 varchar(500) not null, 638c8 datetime, 639c9 decimal(5,3), 640primary key (c1), 641index (c3,c4(50),c5(50)), 642index (c2)) 643engine=innodb row_format=compressed key_block_size=4; 644create table t4(c1 int not null, 645c2 int not null, 646c3 char(255) not null, 647c4 text(500) not null, 648c5 blob(500) not null, 649c6 varchar(500) not null, 650c7 varchar(500) not null, 651c8 datetime, 652c9 decimal(5,3), 653primary key (c1), 654index (c3,c4(50),c5(50)), 655index (c2)) 656engine=innodb row_format=dynamic; 657create temporary table t5(c1 int not null, 658c2 int not null, 659c3 char(255) not null, 660c4 text(500) not null, 661c5 blob(500) not null, 662c6 varchar(500) not null, 663c7 varchar(500) not null, 664c8 datetime, 665c9 decimal(5,3), 666primary key (c1), 667index (c3,c4(50),c5(50)), 668index (c2)) 669engine=innodb; 670create table t6 ( a int ) engine = innodb; 671insert into t6 values (50),(100),(150); 672select count(*) from t1; 673count(*) 6743 675select count(*) from t2; 676count(*) 6773 678select count(*) from t3; 679count(*) 6803 681select count(*) from t4; 682count(*) 6833 684select count(*) from t5; 685count(*) 6863 687select count(*) from t6; 688count(*) 6893 690set session debug="+d,ib_trunc_crash_after_truncate_done"; 691"---debug ib_trunc_crash_after_truncate_done point---" 692# Write file to make mysql-test-run.pl expect crash and restart 693# Run the crashing query 694truncate table t1; 695ERROR HY000: Lost connection to MySQL server during query 696# Restart the MySQL server 697select count(*) from t1; 698count(*) 6990 700select count(*) from t2; 701count(*) 7023 703select count(*) from t3; 704count(*) 7053 706select count(*) from t4; 707count(*) 7083 709select count(*) from t5; 710ERROR 42S02: Table 'test.t5' doesn't exist 711select count(*) from t6; 712count(*) 7133 714set session debug="+d,ib_trunc_crash_after_truncate_done"; 715"---debug ib_trunc_crash_after_truncate_done point---" 716# Write file to make mysql-test-run.pl expect crash and restart 717# Run the crashing query 718truncate table t2; 719ERROR HY000: Lost connection to MySQL server during query 720# Restart the MySQL server 721select count(*) from t1; 722count(*) 7230 724select count(*) from t2; 725count(*) 7260 727select count(*) from t3; 728count(*) 7293 730select count(*) from t4; 731count(*) 7323 733select count(*) from t5; 734ERROR 42S02: Table 'test.t5' doesn't exist 735select count(*) from t6; 736count(*) 7373 738set session debug="+d,ib_trunc_crash_after_truncate_done"; 739"---debug ib_trunc_crash_after_truncate_done point---" 740# Write file to make mysql-test-run.pl expect crash and restart 741# Run the crashing query 742truncate table t3; 743ERROR HY000: Lost connection to MySQL server during query 744# Restart the MySQL server 745select count(*) from t1; 746count(*) 7470 748select count(*) from t2; 749count(*) 7500 751select count(*) from t3; 752count(*) 7530 754select count(*) from t4; 755count(*) 7563 757select count(*) from t5; 758ERROR 42S02: Table 'test.t5' doesn't exist 759select count(*) from t6; 760count(*) 7613 762set session debug="+d,ib_trunc_crash_after_truncate_done"; 763"---debug ib_trunc_crash_after_truncate_done point---" 764# Write file to make mysql-test-run.pl expect crash and restart 765# Run the crashing query 766truncate table t4; 767ERROR HY000: Lost connection to MySQL server during query 768# Restart the MySQL server 769select count(*) from t1; 770count(*) 7710 772select count(*) from t2; 773count(*) 7740 775select count(*) from t3; 776count(*) 7770 778select count(*) from t4; 779count(*) 7800 781select count(*) from t5; 782ERROR 42S02: Table 'test.t5' doesn't exist 783select count(*) from t6; 784count(*) 7853 786drop table t1, t2, t3, t4, t6; 787create table t1(c1 int not null, 788c2 int not null, 789c3 char(255) not null, 790c4 text(500) not null, 791c5 blob(500) not null, 792c6 varchar(500) not null, 793c7 varchar(500) not null, 794c8 datetime, 795c9 decimal(5,3), 796primary key (c1), 797index (c3,c4(50),c5(50)), 798index (c2)) 799engine=innodb row_format=redundant; 800create table t2(c1 int not null, 801c2 int not null, 802c3 char(255) not null, 803c4 text(500) not null, 804c5 blob(500) not null, 805c6 varchar(500) not null, 806c7 varchar(500) not null, 807c8 datetime, 808c9 decimal(5,3), 809primary key (c1), 810index (c3,c4(50),c5(50)), 811index (c2)) 812engine=innodb row_format=compact; 813create table t3(c1 int not null, 814c2 int not null, 815c3 char(255) not null, 816c4 text(500) not null, 817c5 blob(500) not null, 818c6 varchar(500) not null, 819c7 varchar(500) not null, 820c8 datetime, 821c9 decimal(5,3), 822primary key (c1), 823index (c3,c4(50),c5(50)), 824index (c2)) 825engine=innodb row_format=compressed key_block_size=4; 826create table t4(c1 int not null, 827c2 int not null, 828c3 char(255) not null, 829c4 text(500) not null, 830c5 blob(500) not null, 831c6 varchar(500) not null, 832c7 varchar(500) not null, 833c8 datetime, 834c9 decimal(5,3), 835primary key (c1), 836index (c3,c4(50),c5(50)), 837index (c2)) 838engine=innodb row_format=dynamic; 839create temporary table t5(c1 int not null, 840c2 int not null, 841c3 char(255) not null, 842c4 text(500) not null, 843c5 blob(500) not null, 844c6 varchar(500) not null, 845c7 varchar(500) not null, 846c8 datetime, 847c9 decimal(5,3), 848primary key (c1), 849index (c3,c4(50),c5(50)), 850index (c2)) 851engine=innodb; 852create table t6 ( a int ) engine = innodb; 853insert into t6 values (50),(100),(150); 854select count(*) from t1; 855count(*) 8563 857select count(*) from t2; 858count(*) 8593 860select count(*) from t3; 861count(*) 8623 863select count(*) from t4; 864count(*) 8653 866select count(*) from t5; 867count(*) 8683 869select count(*) from t6; 870count(*) 8713 872set session debug="+d,ib_trunc_crash_after_truncate_done"; 873"---debug ib_trunc_crash_after_truncate_done point---" 874# Write file to make mysql-test-run.pl expect crash and restart 875# Run the crashing query 876truncate table t1; 877ERROR HY000: Lost connection to MySQL server during query 878# Restart the MySQL server 879select count(*) from t1; 880count(*) 8810 882select count(*) from t2; 883count(*) 8843 885select count(*) from t3; 886count(*) 8873 888select count(*) from t4; 889count(*) 8903 891select count(*) from t5; 892ERROR 42S02: Table 'test.t5' doesn't exist 893select count(*) from t6; 894count(*) 8953 896set session debug="+d,ib_trunc_crash_after_truncate_done"; 897"---debug ib_trunc_crash_after_truncate_done point---" 898# Write file to make mysql-test-run.pl expect crash and restart 899# Run the crashing query 900truncate table t2; 901ERROR HY000: Lost connection to MySQL server during query 902# Restart the MySQL server 903select count(*) from t1; 904count(*) 9050 906select count(*) from t2; 907count(*) 9080 909select count(*) from t3; 910count(*) 9113 912select count(*) from t4; 913count(*) 9143 915select count(*) from t5; 916ERROR 42S02: Table 'test.t5' doesn't exist 917select count(*) from t6; 918count(*) 9193 920set session debug="+d,ib_trunc_crash_after_truncate_done"; 921"---debug ib_trunc_crash_after_truncate_done point---" 922# Write file to make mysql-test-run.pl expect crash and restart 923# Run the crashing query 924truncate table t3; 925ERROR HY000: Lost connection to MySQL server during query 926# Restart the MySQL server 927select count(*) from t1; 928count(*) 9290 930select count(*) from t2; 931count(*) 9320 933select count(*) from t3; 934count(*) 9350 936select count(*) from t4; 937count(*) 9383 939select count(*) from t5; 940ERROR 42S02: Table 'test.t5' doesn't exist 941select count(*) from t6; 942count(*) 9433 944set session debug="+d,ib_trunc_crash_after_truncate_done"; 945"---debug ib_trunc_crash_after_truncate_done point---" 946# Write file to make mysql-test-run.pl expect crash and restart 947# Run the crashing query 948truncate table t4; 949ERROR HY000: Lost connection to MySQL server during query 950# Restart the MySQL server 951select count(*) from t1; 952count(*) 9530 954select count(*) from t2; 955count(*) 9560 957select count(*) from t3; 958count(*) 9590 960select count(*) from t4; 961count(*) 9620 963select count(*) from t5; 964ERROR 42S02: Table 'test.t5' doesn't exist 965select count(*) from t6; 966count(*) 9673 968drop table t1, t2, t3, t4, t6; 969create table t1(c1 int not null, 970c2 int not null, 971c3 char(255) not null, 972c4 text(500) not null, 973c5 blob(500) not null, 974c6 varchar(500) not null, 975c7 varchar(500) not null, 976c8 datetime, 977c9 decimal(5,3), 978primary key (c1), 979index (c3,c4(50),c5(50)), 980index (c2)) 981engine=innodb row_format=redundant; 982create table t2(c1 int not null, 983c2 int not null, 984c3 char(255) not null, 985c4 text(500) not null, 986c5 blob(500) not null, 987c6 varchar(500) not null, 988c7 varchar(500) not null, 989c8 datetime, 990c9 decimal(5,3), 991primary key (c1), 992index (c3,c4(50),c5(50)), 993index (c2)) 994engine=innodb row_format=compact; 995create table t3(c1 int not null, 996c2 int not null, 997c3 char(255) not null, 998c4 text(500) not null, 999c5 blob(500) not null, 1000c6 varchar(500) not null, 1001c7 varchar(500) not null, 1002c8 datetime, 1003c9 decimal(5,3), 1004primary key (c1), 1005index (c3,c4(50),c5(50)), 1006index (c2)) 1007engine=innodb row_format=compressed key_block_size=4; 1008create table t4(c1 int not null, 1009c2 int not null, 1010c3 char(255) not null, 1011c4 text(500) not null, 1012c5 blob(500) not null, 1013c6 varchar(500) not null, 1014c7 varchar(500) not null, 1015c8 datetime, 1016c9 decimal(5,3), 1017primary key (c1), 1018index (c3,c4(50),c5(50)), 1019index (c2)) 1020engine=innodb row_format=dynamic; 1021create temporary table t5(c1 int not null, 1022c2 int not null, 1023c3 char(255) not null, 1024c4 text(500) not null, 1025c5 blob(500) not null, 1026c6 varchar(500) not null, 1027c7 varchar(500) not null, 1028c8 datetime, 1029c9 decimal(5,3), 1030primary key (c1), 1031index (c3,c4(50),c5(50)), 1032index (c2)) 1033engine=innodb; 1034create table t6 ( a int ) engine = innodb; 1035insert into t6 values (50),(100),(150); 1036select count(*) from t1; 1037count(*) 10383 1039select count(*) from t2; 1040count(*) 10413 1042select count(*) from t3; 1043count(*) 10443 1045select count(*) from t4; 1046count(*) 10473 1048select count(*) from t5; 1049count(*) 10503 1051select count(*) from t6; 1052count(*) 10533 1054set session debug="+d,ib_trunc_crash_after_redo_log_write_complete"; 1055"---debug ib_trunc_crash_after_redo_log_write_complete point---" 1056# Write file to make mysql-test-run.pl expect crash and restart 1057# Run the crashing query 1058truncate table t1; 1059ERROR HY000: Lost connection to MySQL server during query 1060# Restart the MySQL server 1061select count(*) from t1; 1062count(*) 10630 1064select count(*) from t2; 1065count(*) 10663 1067select count(*) from t3; 1068count(*) 10693 1070select count(*) from t4; 1071count(*) 10723 1073select count(*) from t5; 1074ERROR 42S02: Table 'test.t5' doesn't exist 1075select count(*) from t6; 1076count(*) 10773 1078set session debug="+d,ib_trunc_crash_after_redo_log_write_complete"; 1079"---debug ib_trunc_crash_after_redo_log_write_complete point---" 1080# Write file to make mysql-test-run.pl expect crash and restart 1081# Run the crashing query 1082truncate table t2; 1083ERROR HY000: Lost connection to MySQL server during query 1084# Restart the MySQL server 1085select count(*) from t1; 1086count(*) 10870 1088select count(*) from t2; 1089count(*) 10900 1091select count(*) from t3; 1092count(*) 10933 1094select count(*) from t4; 1095count(*) 10963 1097select count(*) from t5; 1098ERROR 42S02: Table 'test.t5' doesn't exist 1099select count(*) from t6; 1100count(*) 11013 1102set session debug="+d,ib_trunc_crash_after_redo_log_write_complete"; 1103"---debug ib_trunc_crash_after_redo_log_write_complete point---" 1104# Write file to make mysql-test-run.pl expect crash and restart 1105# Run the crashing query 1106truncate table t3; 1107ERROR HY000: Lost connection to MySQL server during query 1108# Restart the MySQL server 1109select count(*) from t1; 1110count(*) 11110 1112select count(*) from t2; 1113count(*) 11140 1115select count(*) from t3; 1116count(*) 11170 1118select count(*) from t4; 1119count(*) 11203 1121select count(*) from t5; 1122ERROR 42S02: Table 'test.t5' doesn't exist 1123select count(*) from t6; 1124count(*) 11253 1126set session debug="+d,ib_trunc_crash_after_redo_log_write_complete"; 1127"---debug ib_trunc_crash_after_redo_log_write_complete point---" 1128# Write file to make mysql-test-run.pl expect crash and restart 1129# Run the crashing query 1130truncate table t4; 1131ERROR HY000: Lost connection to MySQL server during query 1132# Restart the MySQL server 1133select count(*) from t1; 1134count(*) 11350 1136select count(*) from t2; 1137count(*) 11380 1139select count(*) from t3; 1140count(*) 11410 1142select count(*) from t4; 1143count(*) 11440 1145select count(*) from t5; 1146ERROR 42S02: Table 'test.t5' doesn't exist 1147select count(*) from t6; 1148count(*) 11493 1150drop table t1, t2, t3, t4, t6; 1151