~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/srv/srv0start.c

Merge Monty - Updates to pandora-build to support features of gcc 4.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
# include "thr0loc.h"
89
89
# include "os0sync.h" /* for INNODB_RW_LOCKS_USE_ATOMICS */
90
90
# include "zlib.h" /* for ZLIB_VERSION */
91
 
#include "xtrabackup_api.h"
92
91
 
93
92
#include <errno.h>
94
93
#include <unistd.h>
95
94
 
96
 
#include <drizzled/gettext.h> 
97
 
#include <drizzled/errmsg_print.h>
98
 
 
99
95
/** Log sequence number immediately after startup */
100
96
UNIV_INTERN ib_uint64_t srv_start_lsn;
101
97
/** Log sequence number at shutdown */
127
123
/** Files comprising the system tablespace */
128
124
static os_file_t        files[1000];
129
125
 
 
126
/** Mutex protecting the ios count */
 
127
static mutex_t          ios_mutex;
 
128
/** Count of I/O operations in io_handler_thread() */
 
129
static ulint            ios;
 
130
 
130
131
/** io_handler_thread parameters for thread identification */
131
 
static ulint            n[SRV_MAX_N_IO_THREADS + 7];
 
132
static ulint            n[SRV_MAX_N_IO_THREADS + 6];
132
133
/** io_handler_thread identifiers */
133
 
static os_thread_id_t   thread_ids[SRV_MAX_N_IO_THREADS + 7];
 
134
static os_thread_id_t   thread_ids[SRV_MAX_N_IO_THREADS + 6];
134
135
 
135
136
/** We use this mutex to test the return value of pthread_mutex_trylock
136
137
   on successful locking. HP-UX does NOT return 0, though Linux et al do. */
153
154
UNIV_INTERN mysql_pfs_key_t     srv_master_thread_key;
154
155
#endif /* UNIV_PFS_THREAD */
155
156
 
 
157
#ifdef UNIV_PFS_MUTEX
 
158
/* Key to register ios_mutex_key with performance schema */
 
159
UNIV_INTERN mysql_pfs_key_t     ios_mutex_key;
 
160
#endif /* UNIV_PFS_MUTEX */
 
161
 
156
162
/*********************************************************************//**
157
163
Convert a numeric string that optionally ends in G or M, to a number
158
164
containing megabytes.
283
289
                return(FALSE);
284
290
        }
285
291
 
286
 
        srv_data_file_names = static_cast<char **>(malloc(i * sizeof *srv_data_file_names));
287
 
        srv_data_file_sizes = static_cast<ulint *>(malloc(i * sizeof *srv_data_file_sizes));
288
 
        srv_data_file_is_raw_partition = static_cast<ulint *>(malloc(
289
 
                                                                     i * sizeof *srv_data_file_is_raw_partition));
 
292
        srv_data_file_names = malloc(i * sizeof *srv_data_file_names);
 
293
        srv_data_file_sizes = malloc(i * sizeof *srv_data_file_sizes);
 
294
        srv_data_file_is_raw_partition = malloc(
 
295
                i * sizeof *srv_data_file_is_raw_partition);
290
296
 
291
297
        srv_n_data_files = i;
292
298
 
416
422
                return(FALSE);
417
423
        }
418
424
 
419
 
        srv_log_group_home_dirs = static_cast<char **>(malloc(i * sizeof *srv_log_group_home_dirs));
 
425
        srv_log_group_home_dirs = malloc(i * sizeof *srv_log_group_home_dirs);
420
426
 
421
427
        /* Then store the actual values to our array */
422
428
 
465
471
/********************************************************************//**
466
472
I/o-handler thread function.
467
473
@return OS_THREAD_DUMMY_RETURN */
468
 
extern "C"
469
 
os_thread_ret_t
470
 
io_handler_thread(void* arg);
471
 
 
472
 
extern "C"
 
474
static
473
475
os_thread_ret_t
474
476
io_handler_thread(
475
477
/*==============*/
491
493
 
492
494
        while (srv_shutdown_state != SRV_SHUTDOWN_EXIT_THREADS) {
493
495
                fil_aio_wait(segment);
 
496
 
 
497
                mutex_enter(&ios_mutex);
 
498
                ios++;
 
499
                mutex_exit(&ios_mutex);
494
500
        }
495
501
 
 
502
        thr_local_free(os_thread_get_curr_id());
 
503
 
496
504
        /* We count the number of threads in os_thread_exit(). A created
497
505
        thread should always use that to exit and not use return() to exit.
498
506
        The thread actually never comes here because it is exited in an
513
521
void
514
522
srv_normalize_path_for_win(
515
523
/*=======================*/
516
 
        char*   /*str __attribute__((unused))*/)        /*!< in/out: null-terminated
 
524
        char*   str __attribute__((unused)))    /*!< in/out: null-terminated
517
525
                                                character string */
518
526
{
519
527
#ifdef __WIN__
556
564
/*********************************************************************//**
557
565
Creates or opens the log files and closes them.
558
566
@return DB_SUCCESS or error code */
 
567
static
559
568
ulint
560
569
open_or_create_log_file(
561
570
/*====================*/
604
613
                    && os_file_get_last_error(FALSE) != 100
605
614
#endif
606
615
                    ) {
607
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
608
 
                                          "InnoDB: Error in creating or opening %s", name);
 
616
                        fprintf(stderr,
 
617
                                "InnoDB: Error in creating"
 
618
                                " or opening %s\n", name);
609
619
 
610
 
                  return(DB_ERROR);
 
620
                        return(DB_ERROR);
611
621
                }
612
622
 
613
623
                files[i] = os_file_create(innodb_file_log_key, name,
614
624
                                          OS_FILE_OPEN, OS_FILE_AIO,
615
625
                                          OS_LOG_FILE, &ret);
616
626
                if (!ret) {
617
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
618
 
                                          "InnoDB: Error in opening %s.", name);
 
627
                        fprintf(stderr,
 
628
                                "InnoDB: Error in opening %s\n", name);
619
629
 
620
630
                        return(DB_ERROR);
621
631
                }
626
636
                if (size != srv_calc_low32(srv_log_file_size)
627
637
                    || size_high != srv_calc_high32(srv_log_file_size)) {
628
638
 
629
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
630
 
                                          "InnoDB: Error: log file %s is of different size %lu %lu bytes than specified in the .cnf"
631
 
                                          " file %lu %lu bytes!",
632
 
                                          name, (ulong) size_high, (ulong) size,
633
 
                                          (ulong) srv_calc_high32(srv_log_file_size),
634
 
                                          (ulong) srv_calc_low32(srv_log_file_size));
 
639
                        fprintf(stderr,
 
640
                                "InnoDB: Error: log file %s is"
 
641
                                " of different size %lu %lu bytes\n"
 
642
                                "InnoDB: than specified in the .cnf"
 
643
                                " file %lu %lu bytes!\n",
 
644
                                name, (ulong) size_high, (ulong) size,
 
645
                                (ulong) srv_calc_high32(srv_log_file_size),
 
646
                                (ulong) srv_calc_low32(srv_log_file_size));
635
647
 
636
648
                        return(DB_ERROR);
637
649
                }
638
650
        } else {
639
651
                *log_file_created = TRUE;
640
652
 
641
 
                drizzled::errmsg_printf(drizzled::error::INFO,
642
 
                                        "InnoDB: Log file %s did not exist: new to be created",
643
 
                                        name);
 
653
                ut_print_timestamp(stderr);
 
654
 
 
655
                fprintf(stderr,
 
656
                        "  InnoDB: Log file %s did not exist:"
 
657
                        " new to be created\n",
 
658
                        name);
644
659
                if (log_file_has_been_opened) {
645
660
 
646
661
                        return(DB_ERROR);
647
662
                }
648
663
 
649
 
                drizzled::errmsg_printf(drizzled::error::INFO,
650
 
                                        "InnoDB: Setting log file %s size to %lu MB",
651
 
                                        name, (ulong) srv_log_file_size
652
 
                                        >> (20 - UNIV_PAGE_SIZE_SHIFT));
 
664
                fprintf(stderr, "InnoDB: Setting log file %s size to %lu MB\n",
 
665
                        name, (ulong) srv_log_file_size
 
666
                        >> (20 - UNIV_PAGE_SIZE_SHIFT));
653
667
 
654
 
                drizzled::errmsg_printf(drizzled::error::INFO,
655
 
                                        "InnoDB: Database physically writes the file full: wait...\n");
 
668
                fprintf(stderr,
 
669
                        "InnoDB: Database physically writes the file"
 
670
                        " full: wait...\n");
656
671
 
657
672
                ret = os_file_set_size(name, files[i],
658
673
                                       srv_calc_low32(srv_log_file_size),
659
674
                                       srv_calc_high32(srv_log_file_size));
660
675
                if (!ret) {
661
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
662
 
                                          "InnoDB: Error in creating %s: probably out of disk space",
663
 
                                          name);
 
676
                        fprintf(stderr,
 
677
                                "InnoDB: Error in creating %s:"
 
678
                                " probably out of disk space\n",
 
679
                                name);
664
680
 
665
681
                        return(DB_ERROR);
666
682
                }
708
724
/*********************************************************************//**
709
725
Creates or opens database data files and closes them.
710
726
@return DB_SUCCESS or error code */
 
727
static
711
728
ulint
712
729
open_or_create_data_files(
713
730
/*======================*/
736
753
        char    name[10000];
737
754
 
738
755
        if (srv_n_data_files >= 1000) {
739
 
          drizzled::errmsg_printf(drizzled::error::ERROR,
740
 
                                  "InnoDB: can only have < 1000 data files you have defined %lu",
741
 
                                  (ulong) srv_n_data_files);
 
756
                fprintf(stderr, "InnoDB: can only have < 1000 data files\n"
 
757
                        "InnoDB: you have defined %lu\n",
 
758
                        (ulong) srv_n_data_files);
742
759
                return(DB_ERROR);
743
760
        }
744
761
 
783
800
                            && os_file_get_last_error(FALSE) != 100
784
801
#endif
785
802
                            ) {
786
 
                          drizzled::errmsg_printf(drizzled::error::ERROR,
787
 
                                                  "InnoDB: Error in creating or opening %s",
788
 
                                                  name);
 
803
                                fprintf(stderr,
 
804
                                        "InnoDB: Error in creating"
 
805
                                        " or opening %s\n",
 
806
                                        name);
789
807
 
790
808
                                return(DB_ERROR);
791
809
                        }
801
819
                                                  OS_FILE_NORMAL,
802
820
                                                  OS_DATA_FILE, &ret);
803
821
                        if (!ret) {
804
 
                          drizzled::errmsg_printf(drizzled::error::ERROR,
805
 
                                                  "InnoDB: Error in opening %s", name);
 
822
                                fprintf(stderr,
 
823
                                        "InnoDB: Error in opening %s\n", name);
806
824
 
807
825
                                return(DB_ERROR);
808
826
                        }
818
836
                        /* We open the data file */
819
837
 
820
838
                        if (one_created) {
821
 
                          drizzled::errmsg_printf(drizzled::error::ERROR,
822
 
                                        "InnoDB: Error: data files can only be added at the end of a tablespace, but"
823
 
                                        " data file %s existed beforehand.",
824
 
                                        name);
 
839
                                fprintf(stderr,
 
840
                                        "InnoDB: Error: data files can only"
 
841
                                        " be added at the end\n");
 
842
                                fprintf(stderr,
 
843
                                        "InnoDB: of a tablespace, but"
 
844
                                        " data file %s existed beforehand.\n",
 
845
                                        name);
825
846
                                return(DB_ERROR);
826
847
                        }
827
848
 
843
864
                        }
844
865
 
845
866
                        if (!ret) {
846
 
                          drizzled::errmsg_printf(drizzled::error::ERROR,
847
 
                                                  "InnoDB: Error in opening %s", name);
 
867
                                fprintf(stderr,
 
868
                                        "InnoDB: Error in opening %s\n", name);
848
869
                                os_file_get_last_error(TRUE);
849
870
 
850
871
                                return(DB_ERROR);
871
892
                                        && srv_last_file_size_max
872
893
                                        < rounded_size_pages)) {
873
894
 
874
 
                                  drizzled::errmsg_printf(drizzled::error::ERROR,
875
 
                                                          "InnoDB: Error: auto-extending data file %s is of a different size. "
876
 
                                                          "%lu pages (rounded down to MB) than specified in the .cnf file: "
877
 
                                                          "initial %lu pages, max %lu (relevant if non-zero) pages!",
878
 
                                                          name,
879
 
                                                          (ulong) rounded_size_pages,
880
 
                                                          (ulong) srv_data_file_sizes[i],
881
 
                                                          (ulong)
882
 
                                                          srv_last_file_size_max);
 
895
                                        fprintf(stderr,
 
896
                                                "InnoDB: Error: auto-extending"
 
897
                                                " data file %s is"
 
898
                                                " of a different size\n"
 
899
                                                "InnoDB: %lu pages (rounded"
 
900
                                                " down to MB) than specified"
 
901
                                                " in the .cnf file:\n"
 
902
                                                "InnoDB: initial %lu pages,"
 
903
                                                " max %lu (relevant if"
 
904
                                                " non-zero) pages!\n",
 
905
                                                name,
 
906
                                                (ulong) rounded_size_pages,
 
907
                                                (ulong) srv_data_file_sizes[i],
 
908
                                                (ulong)
 
909
                                                srv_last_file_size_max);
883
910
 
884
911
                                        return(DB_ERROR);
885
912
                                }
889
916
 
890
917
                        if (rounded_size_pages != srv_data_file_sizes[i]) {
891
918
 
892
 
                          drizzled::errmsg_printf(drizzled::error::ERROR,
893
 
                                        "InnoDB: Error: data file %s is of a different size. "
894
 
                                        "%lu pages (rounded down to MB). "
895
 
                                        "Than specified in the .cnf file %lu pages!",
 
919
                                fprintf(stderr,
 
920
                                        "InnoDB: Error: data file %s"
 
921
                                        " is of a different size\n"
 
922
                                        "InnoDB: %lu pages"
 
923
                                        " (rounded down to MB)\n"
 
924
                                        "InnoDB: than specified"
 
925
                                        " in the .cnf file %lu pages!\n",
896
926
                                        name,
897
927
                                        (ulong) rounded_size_pages,
898
928
                                        (ulong) srv_data_file_sizes[i]);
914
944
                        one_created = TRUE;
915
945
 
916
946
                        if (i > 0) {
917
 
                                drizzled::errmsg_printf(drizzled::error::INFO,
918
 
                                        "  InnoDB: Data file %s did not exist: new to be created",
 
947
                                ut_print_timestamp(stderr);
 
948
                                fprintf(stderr,
 
949
                                        "  InnoDB: Data file %s did not"
 
950
                                        " exist: new to be created\n",
919
951
                                        name);
920
952
                        } else {
921
 
                          drizzled::errmsg_printf(drizzled::error::INFO,
922
 
                                        "InnoDB: The first specified data file %s did not exist. A new database to be created!", name);
 
953
                                fprintf(stderr,
 
954
                                        "InnoDB: The first specified"
 
955
                                        " data file %s did not exist:\n"
 
956
                                        "InnoDB: a new database"
 
957
                                        " to be created!\n", name);
923
958
                                *create_new_db = TRUE;
924
959
                        }
925
960
 
926
 
                        drizzled::errmsg_printf(drizzled::error::INFO,
927
 
                                                "  InnoDB: Setting file %s size to %lu MB",
928
 
                                                name, (ulong) (srv_data_file_sizes[i]
929
 
                                                         >> (20 - UNIV_PAGE_SIZE_SHIFT)));
 
961
                        ut_print_timestamp(stderr);
 
962
                        fprintf(stderr,
 
963
                                "  InnoDB: Setting file %s size to %lu MB\n",
 
964
                                name,
 
965
                                (ulong) (srv_data_file_sizes[i]
 
966
                                         >> (20 - UNIV_PAGE_SIZE_SHIFT)));
930
967
 
931
 
                        drizzled::errmsg_printf(drizzled::error::INFO,
932
 
                                "InnoDB: Database physically writes the file full: wait...");
 
968
                        fprintf(stderr,
 
969
                                "InnoDB: Database physically writes the"
 
970
                                " file full: wait...\n");
933
971
 
934
972
                        ret = os_file_set_size(
935
973
                                name, files[i],
937
975
                                srv_calc_high32(srv_data_file_sizes[i]));
938
976
 
939
977
                        if (!ret) {
940
 
                          drizzled::errmsg_printf(drizzled::error::ERROR,
941
 
                                                  "InnoDB: Error in creating %s: probably out of disk space", name);
 
978
                                fprintf(stderr,
 
979
                                        "InnoDB: Error in creating %s:"
 
980
                                        " probably out of disk space\n", name);
942
981
 
943
982
                                return(DB_ERROR);
944
983
                        }
960
999
                                srv_data_file_is_raw_partition[i] != 0);
961
1000
        }
962
1001
 
 
1002
        ios = 0;
 
1003
 
 
1004
        mutex_create(ios_mutex_key, &ios_mutex, SYNC_NO_ORDER_CHECK);
 
1005
 
963
1006
        return(DB_SUCCESS);
964
1007
}
965
1008
 
1002
1045
        on Mac OS X 10.3 or later. */
1003
1046
        struct utsname utsname;
1004
1047
        if (uname(&utsname)) {
1005
 
                fputs(_("InnoDB: cannot determine Mac OS X version!\n"), stderr);
 
1048
                fputs("InnoDB: cannot determine Mac OS X version!\n", stderr);
1006
1049
        } else {
1007
1050
                srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0;
1008
1051
        }
1009
1052
        if (!srv_have_fullfsync) {
1010
 
                fputs(_("InnoDB: On Mac OS X, fsync() may be"
1011
 
                        " broken on internal drives,\n"
1012
 
                        "InnoDB: making transactions unsafe!\n"), stderr);
 
1053
                fputs("InnoDB: On Mac OS X, fsync() may be"
 
1054
                      " broken on internal drives,\n"
 
1055
                      "InnoDB: making transactions unsafe!\n", stderr);
1013
1056
        }
1014
1057
# endif /* F_FULLFSYNC */
1015
1058
#endif /* HAVE_DARWIN_THREADS */
1016
1059
 
1017
1060
        if (sizeof(ulint) != sizeof(void*)) {
1018
 
          drizzled::errmsg_printf(drizzled::error::WARN,
1019
 
                        _("InnoDB: Error: size of InnoDB's ulint is %lu, but size of void* is %lu. "
1020
 
                          "The sizes should be the same so that on a 64-bit platform you can. Allocate more than 4 GB of memory."),
 
1061
                fprintf(stderr,
 
1062
                        "InnoDB: Error: size of InnoDB's ulint is %lu,"
 
1063
                        " but size of void* is %lu.\n"
 
1064
                        "InnoDB: The sizes should be the same"
 
1065
                        " so that on a 64-bit platform you can\n"
 
1066
                        "InnoDB: allocate more than 4 GB of memory.",
1021
1067
                        (ulong)sizeof(ulint), (ulong)sizeof(void*));
1022
1068
        }
1023
1069
 
1027
1073
        innodb_file_per_table) until this function has returned. */
1028
1074
        srv_file_per_table = FALSE;
1029
1075
#ifdef UNIV_DEBUG
1030
 
        drizzled::errmsg_printf(drizzled::error::INFO,
1031
 
                                _("InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n"));
 
1076
        fprintf(stderr,
 
1077
                "InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
1032
1078
#endif
1033
1079
 
1034
1080
#ifdef UNIV_IBUF_DEBUG
1035
 
        drizzled::errmsg_printf(drizzled::error::INFO,
1036
 
                _("InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
 
1081
        fprintf(stderr,
 
1082
                "InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
1037
1083
# ifdef UNIV_IBUF_COUNT_DEBUG
1038
 
                  "InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!\n"
1039
 
                  "InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n"
 
1084
                "InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!\n"
 
1085
                "InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n"
1040
1086
# endif
1041
 
                ));
 
1087
                );
1042
1088
#endif
1043
1089
 
1044
1090
#ifdef UNIV_SYNC_DEBUG
1045
 
        drizzled::errmsg_printf(drizzled::error::INFO,
1046
 
                                _("InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n"));
 
1091
        fprintf(stderr,
 
1092
                "InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
1047
1093
#endif
1048
1094
 
1049
1095
#ifdef UNIV_SEARCH_DEBUG
1050
 
        drizzled::errmsg_printf(drizzled::error::INFO,
1051
 
                                _("InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n"));
 
1096
        fprintf(stderr,
 
1097
                "InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
1052
1098
#endif
1053
1099
 
1054
1100
#ifdef UNIV_LOG_LSN_DEBUG
1055
 
        drizzled::errmsg_printf(drizzled::error::INFO,
1056
 
                                _("InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n"));
 
1101
        fprintf(stderr,
 
1102
                "InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n");
1057
1103
#endif /* UNIV_LOG_LSN_DEBUG */
1058
1104
#ifdef UNIV_MEM_DEBUG
1059
 
        drizzled::errmsg_printf(drizzled::error::INFO,
1060
 
                                _("InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n"));
 
1105
        fprintf(stderr,
 
1106
                "InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
1061
1107
#endif
1062
1108
 
1063
 
        if (UNIV_LIKELY(srv_use_sys_malloc))
1064
 
        {
1065
 
          drizzled::errmsg_printf(drizzled::error::INFO, _("InnoDB: The InnoDB memory heap is disabled\n"));
 
1109
        if (UNIV_LIKELY(srv_use_sys_malloc)) {
 
1110
                fprintf(stderr,
 
1111
                        "InnoDB: The InnoDB memory heap is disabled\n");
1066
1112
        }
1067
1113
 
1068
 
        drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: " IB_ATOMICS_STARTUP_MSG
1069
 
                "\nInnoDB: Compressed tables use zlib " ZLIB_VERSION
 
1114
        fputs("InnoDB: " IB_ATOMICS_STARTUP_MSG
 
1115
              "\nInnoDB: Compressed tables use zlib " ZLIB_VERSION
1070
1116
#ifdef UNIV_ZIP_DEBUG
1071
1117
              " with validation"
1072
1118
#endif /* UNIV_ZIP_DEBUG */
1073
1119
#ifdef UNIV_ZIP_COPY
1074
1120
              " and extra copying"
1075
1121
#endif /* UNIV_ZIP_COPY */
1076
 
              " ");
 
1122
              "\n" , stderr);
1077
1123
 
1078
1124
 
1079
1125
        /* Since InnoDB does not currently clean up all its internal data
1082
1128
        second time during the process lifetime. */
1083
1129
 
1084
1130
        if (srv_start_has_been_called) {
1085
 
          drizzled::errmsg_printf(drizzled::error::ERROR,
1086
 
                        "InnoDB: Error: startup called second time during the process lifetime.\n");
 
1131
                fprintf(stderr,
 
1132
                        "InnoDB: Error: startup called second time"
 
1133
                        " during the process lifetime.\n"
 
1134
                        "InnoDB: In the MySQL Embedded Server Library"
 
1135
                        " you cannot call server_init()\n"
 
1136
                        "InnoDB: more than once during"
 
1137
                        " the process lifetime.\n");
1087
1138
        }
1088
1139
 
1089
1140
        srv_start_has_been_called = TRUE;
1125
1176
#elif defined(LINUX_NATIVE_AIO)
1126
1177
 
1127
1178
        if (srv_use_native_aio) {
1128
 
                drizzled::errmsg_printf(drizzled::error::INFO,
1129
 
                                        _("InnoDB: Using Linux native AIO"));
 
1179
                ut_print_timestamp(stderr);
 
1180
                fprintf(stderr,
 
1181
                        "  InnoDB: Using Linux native AIO\n");
1130
1182
        }
1131
1183
#else
1132
1184
        /* Currently native AIO is supported only on windows and linux
1152
1204
        } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {
1153
1205
                srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
1154
1206
 
1155
 
        } else if (0 == ut_strcmp(srv_file_flush_method_str, "ALL_O_DIRECT")) {
1156
 
                srv_unix_file_flush_method = SRV_UNIX_ALL_O_DIRECT;
1157
 
 
1158
1207
        } else if (0 == ut_strcmp(srv_file_flush_method_str, "littlesync")) {
1159
1208
                srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
1160
1209
 
1174
1223
                srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
1175
1224
#endif
1176
1225
        } else {
1177
 
          drizzled::errmsg_printf(drizzled::error::ERROR,
1178
 
                                  "InnoDB: Unrecognized value %s for innodb_flush_method",
1179
 
                                  srv_file_flush_method_str);
 
1226
                fprintf(stderr,
 
1227
                        "InnoDB: Unrecognized value %s for"
 
1228
                        " innodb_flush_method\n",
 
1229
                        srv_file_flush_method_str);
1180
1230
                return(DB_ERROR);
1181
1231
        }
1182
1232
 
1216
1266
                     &srv_monitor_file_mutex, SYNC_NO_ORDER_CHECK);
1217
1267
 
1218
1268
        if (srv_innodb_status) {
1219
 
          srv_monitor_file_name = static_cast<char *>(mem_alloc(
 
1269
                srv_monitor_file_name = mem_alloc(
1220
1270
                        strlen(fil_path_to_mysql_datadir)
1221
 
                        + 20 + sizeof "/innodb_status."));
 
1271
                        + 20 + sizeof "/innodb_status.");
1222
1272
                sprintf(srv_monitor_file_name, "%s/innodb_status.%lu",
1223
1273
                        fil_path_to_mysql_datadir, os_proc_get_number());
1224
1274
                srv_monitor_file = fopen(srv_monitor_file_name, "w+");
1225
1275
                if (!srv_monitor_file) {
1226
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
1227
 
                                          "InnoDB: unable to create %s: %s\n", srv_monitor_file_name, strerror(errno));
 
1276
                        fprintf(stderr, "InnoDB: unable to create %s: %s\n",
 
1277
                                srv_monitor_file_name, strerror(errno));
1228
1278
                        return(DB_ERROR);
1229
1279
                }
1230
1280
        } else {
1278
1328
                 srv_max_n_open_files);
1279
1329
 
1280
1330
        /* Print time to initialize the buffer pool */
 
1331
        ut_print_timestamp(stderr);
 
1332
        fprintf(stderr,
 
1333
                "  InnoDB: Initializing buffer pool, size =");
1281
1334
 
1282
1335
        if (srv_buf_pool_size >= 1024 * 1024 * 1024) {
1283
 
          drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: Initializing buffer pool, size = %.1fG",
1284
 
                                  ((double) srv_buf_pool_size) / (1024 * 1024 * 1024));
 
1336
                fprintf(stderr,
 
1337
                        " %.1fG\n",
 
1338
                        ((double) srv_buf_pool_size) / (1024 * 1024 * 1024));
1285
1339
        } else {
1286
 
          drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: Initializing buffer pool, size = %.1fM",
1287
 
                                  ((double) srv_buf_pool_size) / (1024 * 1024));
 
1340
                fprintf(stderr,
 
1341
                        " %.1fM\n",
 
1342
                        ((double) srv_buf_pool_size) / (1024 * 1024));
1288
1343
        }
1289
1344
 
1290
1345
        err = buf_pool_init(srv_buf_pool_size, srv_buf_pool_instances);
1291
1346
 
1292
 
        drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: Completed initialization of buffer pool");
 
1347
        ut_print_timestamp(stderr);
 
1348
        fprintf(stderr,
 
1349
                "  InnoDB: Completed initialization of buffer pool\n");
1293
1350
 
1294
1351
        if (err != DB_SUCCESS) {
1295
 
          drizzled::errmsg_printf(drizzled::error::ERROR, "InnoDB: Fatal error: cannot allocate the memory for the buffer pool");
 
1352
                fprintf(stderr,
 
1353
                        "InnoDB: Fatal error: cannot allocate the memory"
 
1354
                        " for the buffer pool\n");
1296
1355
 
1297
 
          return(DB_ERROR);
 
1356
                return(DB_ERROR);
1298
1357
        }
1299
1358
 
1300
1359
#ifdef UNIV_DEBUG
1303
1362
 
1304
1363
        if (srv_buf_pool_size <= 5 * 1024 * 1024) {
1305
1364
 
1306
 
          drizzled::errmsg_printf(drizzled::error::WARN, "InnoDB: Warning: Small buffer pool size "
1307
 
                                  "(%luM), the flst_validate() debug function "
1308
 
                                  "can cause a deadlock if the buffer pool fills up.\n",
1309
 
                                  srv_buf_pool_size / 1024 / 1024);
 
1365
                fprintf(stderr, "InnoDB: Warning: Small buffer pool size "
 
1366
                        "(%luM), the flst_validate() debug function "
 
1367
                        "can cause a deadlock if the buffer pool fills up.\n",
 
1368
                        srv_buf_pool_size / 1024 / 1024);
1310
1369
        }
1311
1370
#endif
1312
1371
 
1325
1384
 
1326
1385
#ifdef UNIV_LOG_ARCHIVE
1327
1386
        if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) {
1328
 
          drizzled::errmsg_printf(drizzled::error::ERROR,
1329
 
                                  "InnoDB: Error: you must set the log group home dir in my.cnf the same as log arch dir.");
 
1387
                fprintf(stderr,
 
1388
                        "InnoDB: Error: you must set the log group"
 
1389
                        " home dir in my.cnf the\n"
 
1390
                        "InnoDB: same as log arch dir.\n");
1330
1391
 
1331
1392
                return(DB_ERROR);
1332
1393
        }
1333
1394
#endif /* UNIV_LOG_ARCHIVE */
1334
1395
 
1335
 
        if (sizeof(ulint) == 4
1336
 
            && srv_n_log_files * srv_log_file_size
1337
 
            >= (1UL << (32 - UNIV_PAGE_SIZE_SHIFT))) {
1338
 
                drizzled::errmsg_printf(drizzled::error::ERROR,
1339
 
                                  "InnoDB: Error: combined size of log files must be < 4 GB on 32-bit systems\n");
 
1396
        if (srv_n_log_files * srv_log_file_size >= 262144) {
 
1397
                fprintf(stderr,
 
1398
                        "InnoDB: Error: combined size of log files"
 
1399
                        " must be < 4 GB\n");
1340
1400
 
1341
1401
                return(DB_ERROR);
1342
1402
        }
1345
1405
 
1346
1406
        for (i = 0; i < srv_n_data_files; i++) {
1347
1407
#ifndef __WIN__
1348
 
                if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= (1UL << (32 - UNIV_PAGE_SIZE_SHIFT))) {
1349
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
1350
 
                                          "InnoDB: Error: file size must be < 4 GB with this MySQL binary and operating system combination,"
1351
 
                                          " in some OS's < 2 GB\n");
 
1408
                if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
 
1409
                        fprintf(stderr,
 
1410
                                "InnoDB: Error: file size must be < 4 GB"
 
1411
                                " with this MySQL binary\n"
 
1412
                                "InnoDB: and operating system combination,"
 
1413
                                " in some OS's < 2 GB\n");
1352
1414
 
1353
1415
                        return(DB_ERROR);
1354
1416
                }
1357
1419
        }
1358
1420
 
1359
1421
        if (sum_of_new_sizes < 10485760 / UNIV_PAGE_SIZE) {
1360
 
          drizzled::errmsg_printf(drizzled::error::ERROR, "InnoDB: Error: tablespace size must be at least 10 MB");
 
1422
                fprintf(stderr,
 
1423
                        "InnoDB: Error: tablespace size must be"
 
1424
                        " at least 10 MB\n");
1361
1425
 
1362
1426
                return(DB_ERROR);
1363
1427
        }
1369
1433
                                        &min_flushed_lsn, &max_flushed_lsn,
1370
1434
                                        &sum_of_new_sizes);
1371
1435
        if (err != DB_SUCCESS) {
1372
 
          drizzled::errmsg_printf(drizzled::error::ERROR,
1373
 
                                  "InnoDB: Could not open or create data files.\n"
1374
 
                                  "InnoDB: If you tried to add new data files, and it failed here,\n"
1375
 
                                  "InnoDB: you should now edit innodb_data_file_path in my.cnf back\n"
1376
 
                                  "InnoDB: to what it was, and remove the new ibdata files InnoDB created\n"
1377
 
                                  "InnoDB: in this failed attempt. InnoDB only wrote those files full of\n"
1378
 
                                  "InnoDB: zeros, but did not yet use them in any way. But be careful: do not\n"
1379
 
                                  "InnoDB: remove old data files which contain your precious data!\n");
 
1436
                fprintf(stderr,
 
1437
                        "InnoDB: Could not open or create data files.\n"
 
1438
                        "InnoDB: If you tried to add new data files,"
 
1439
                        " and it failed here,\n"
 
1440
                        "InnoDB: you should now edit innodb_data_file_path"
 
1441
                        " in my.cnf back\n"
 
1442
                        "InnoDB: to what it was, and remove the"
 
1443
                        " new ibdata files InnoDB created\n"
 
1444
                        "InnoDB: in this failed attempt. InnoDB only wrote"
 
1445
                        " those files full of\n"
 
1446
                        "InnoDB: zeros, but did not yet use them in any way."
 
1447
                        " But be careful: do not\n"
 
1448
                        "InnoDB: remove old data files"
 
1449
                        " which contain your precious data!\n");
1380
1450
 
1381
1451
                return((int) err);
1382
1452
        }
1401
1471
                }
1402
1472
                if ((log_opened && create_new_db)
1403
1473
                    || (log_opened && log_created)) {
1404
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
1405
 
                                "InnoDB: Error: all log files must be created at the same time.\n"
1406
 
                                "InnoDB: All log files must be created also in database creation.\n"
1407
 
                                "InnoDB: If you want bigger or smaller log files, shut down the\n"
1408
 
                                "InnoDB: database and make sure there were no errors in shutdown.\n"
1409
 
                                "InnoDB: Then delete the existing log files. Edit the .cnf file\n"
 
1474
                        fprintf(stderr,
 
1475
                                "InnoDB: Error: all log files must be"
 
1476
                                " created at the same time.\n"
 
1477
                                "InnoDB: All log files must be"
 
1478
                                " created also in database creation.\n"
 
1479
                                "InnoDB: If you want bigger or smaller"
 
1480
                                " log files, shut down the\n"
 
1481
                                "InnoDB: database and make sure there"
 
1482
                                " were no errors in shutdown.\n"
 
1483
                                "InnoDB: Then delete the existing log files."
 
1484
                                " Edit the .cnf file\n"
1410
1485
                                "InnoDB: and start the database again.\n");
1411
1486
 
1412
1487
                        return(DB_ERROR);
1428
1503
                    || max_arch_log_no != min_arch_log_no
1429
1504
#endif /* UNIV_LOG_ARCHIVE */
1430
1505
                    ) {
1431
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
1432
 
                                "InnoDB: Cannot initialize created log files because\n"
1433
 
                                "InnoDB: data files were not in sync with each other\n"
 
1506
                        fprintf(stderr,
 
1507
                                "InnoDB: Cannot initialize created"
 
1508
                                " log files because\n"
 
1509
                                "InnoDB: data files were not in sync"
 
1510
                                " with each other\n"
1434
1511
                                "InnoDB: or the data files are corrupt.\n");
1435
1512
 
1436
1513
                        return(DB_ERROR);
1437
1514
                }
1438
1515
 
1439
1516
                if (max_flushed_lsn < (ib_uint64_t) 1000) {
1440
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
1441
 
                                "InnoDB: Cannot initialize created log files because\n"
1442
 
                                "InnoDB: data files are corrupt, or new data files were\n"
1443
 
                                "InnoDB: created when the database was started previous\n"
1444
 
                                "InnoDB: time but the database was not shut down\n"
1445
 
                                "InnoDB: normally after that.\n");
 
1517
                        fprintf(stderr,
 
1518
                                "InnoDB: Cannot initialize created"
 
1519
                                " log files because\n"
 
1520
                                "InnoDB: data files are corrupt,"
 
1521
                                " or new data files were\n"
 
1522
                                "InnoDB: created when the database"
 
1523
                                " was started previous\n"
 
1524
                                "InnoDB: time but the database"
 
1525
                                " was not shut down\n"
 
1526
                                "InnoDB: normally after that.\n");
1446
1527
 
1447
1528
                        return(DB_ERROR);
1448
1529
                }
1481
1562
 
1482
1563
#ifdef UNIV_LOG_ARCHIVE
1483
1564
        } else if (srv_archive_recovery) {
1484
 
          drizzled::errmsg_printf(drizzled::error::INFO,
1485
 
                                  "InnoDB: Starting archive recovery from a backup...");
 
1565
                fprintf(stderr,
 
1566
                        "InnoDB: Starting archive"
 
1567
                        " recovery from a backup...\n");
1486
1568
                err = recv_recovery_from_archive_start(
1487
1569
                        min_flushed_lsn, srv_archive_recovery_limit_lsn,
1488
1570
                        min_arch_log_no);
1562
1644
                are initialized in trx_sys_init_at_db_start(). */
1563
1645
 
1564
1646
                recv_recovery_from_checkpoint_finish();
1565
 
 
1566
 
                if (srv_apply_log_only)
1567
 
                  goto skip_processes;
1568
 
 
1569
1647
                if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
1570
1648
                        /* The following call is necessary for the insert
1571
1649
                        buffer to work with multiple tablespaces. We must
1670
1748
        os_thread_create(&srv_monitor_thread, NULL,
1671
1749
                         thread_ids + 4 + SRV_MAX_N_IO_THREADS);
1672
1750
 
1673
 
        /* Create the thread which automaticaly dumps/restore buffer pool */
1674
 
        os_thread_create(&srv_LRU_dump_restore_thread, NULL,
1675
 
                         thread_ids + 5 + SRV_MAX_N_IO_THREADS);
1676
 
 
1677
1751
        srv_is_being_started = FALSE;
1678
1752
 
1679
1753
        err = dict_create_or_check_foreign_constraint_tables();
1711
1785
        if (!srv_auto_extend_last_data_file
1712
1786
            && sum_of_data_file_sizes != tablespace_size_in_header) {
1713
1787
 
1714
 
          drizzled::errmsg_printf(drizzled::error::ERROR,
1715
 
                                  "InnoDB: Error: tablespace size stored in header is %lu pages, but the sum of data file sizes is %lu pages.",
1716
 
                                  (ulong) tablespace_size_in_header,
1717
 
                                  (ulong) sum_of_data_file_sizes);
 
1788
                fprintf(stderr,
 
1789
                        "InnoDB: Error: tablespace size"
 
1790
                        " stored in header is %lu pages, but\n"
 
1791
                        "InnoDB: the sum of data file sizes is %lu pages\n",
 
1792
                        (ulong) tablespace_size_in_header,
 
1793
                        (ulong) sum_of_data_file_sizes);
1718
1794
 
1719
1795
                if (srv_force_recovery == 0
1720
1796
                    && sum_of_data_file_sizes < tablespace_size_in_header) {
1721
1797
                        /* This is a fatal error, the tail of a tablespace is
1722
1798
                        missing */
1723
1799
 
1724
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
1725
 
                                          "InnoDB: Cannot start InnoDB. The tail of the system tablespace is "
1726
 
                                          "missing. Have you edited innodb_data_file_path in my.cnf in an "
1727
 
                                          "inappropriate way, removing ibdata files from there? "
1728
 
                                          "You can set innodb_force_recovery=1 in my.cnf to force "
1729
 
                                          "a startup if you are trying to recover a badly corrupt database.");
 
1800
                        fprintf(stderr,
 
1801
                                "InnoDB: Cannot start InnoDB."
 
1802
                                " The tail of the system tablespace is\n"
 
1803
                                "InnoDB: missing. Have you edited"
 
1804
                                " innodb_data_file_path in my.cnf in an\n"
 
1805
                                "InnoDB: inappropriate way, removing"
 
1806
                                " ibdata files from there?\n"
 
1807
                                "InnoDB: You can set innodb_force_recovery=1"
 
1808
                                " in my.cnf to force\n"
 
1809
                                "InnoDB: a startup if you are trying"
 
1810
                                " to recover a badly corrupt database.\n");
1730
1811
 
1731
1812
                        return(DB_ERROR);
1732
1813
                }
1735
1816
        if (srv_auto_extend_last_data_file
1736
1817
            && sum_of_data_file_sizes < tablespace_size_in_header) {
1737
1818
 
1738
 
          drizzled::errmsg_printf(drizzled::error::ERROR,
1739
 
                                  "InnoDB: Error: tablespace size stored in header is %lu pages, but the sum of data file sizes"
1740
 
                                  " is only %lu pages\n",
1741
 
                                  (ulong) tablespace_size_in_header,
1742
 
                                  (ulong) sum_of_data_file_sizes);
 
1819
                fprintf(stderr,
 
1820
                        "InnoDB: Error: tablespace size stored in header"
 
1821
                        " is %lu pages, but\n"
 
1822
                        "InnoDB: the sum of data file sizes"
 
1823
                        " is only %lu pages\n",
 
1824
                        (ulong) tablespace_size_in_header,
 
1825
                        (ulong) sum_of_data_file_sizes);
1743
1826
 
1744
1827
                if (srv_force_recovery == 0) {
1745
1828
 
1746
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
1747
 
                                "InnoDB: Cannot start InnoDB. The tail of the system tablespace is "
1748
 
                                "missing. Have you edited innodb_data_file_path in my.cnf in an "
1749
 
                                "inappropriate way, removing ibdata files from there? "
1750
 
                                "You can set innodb_force_recovery=1 in my.cnf to force "
1751
 
                                "a startup if you are trying to recover a badly corrupt database.\n");
 
1829
                        fprintf(stderr,
 
1830
                                "InnoDB: Cannot start InnoDB. The tail of"
 
1831
                                " the system tablespace is\n"
 
1832
                                "InnoDB: missing. Have you edited"
 
1833
                                " innodb_data_file_path in my.cnf in an\n"
 
1834
                                "InnoDB: inappropriate way, removing"
 
1835
                                " ibdata files from there?\n"
 
1836
                                "InnoDB: You can set innodb_force_recovery=1"
 
1837
                                " in my.cnf to force\n"
 
1838
                                "InnoDB: a startup if you are trying to"
 
1839
                                " recover a badly corrupt database.\n");
1752
1840
 
1753
1841
                        return(DB_ERROR);
1754
1842
                }
1758
1846
        os_fast_mutex_init(&srv_os_test_mutex);
1759
1847
 
1760
1848
        if (0 != os_fast_mutex_trylock(&srv_os_test_mutex)) {
1761
 
          drizzled::errmsg_printf(drizzled::error::ERROR,
1762
 
                        "InnoDB: Error: pthread_mutex_trylock returns an unexpected value on success! Cannot continue.\n");
 
1849
                fprintf(stderr,
 
1850
                        "InnoDB: Error: pthread_mutex_trylock returns"
 
1851
                        " an unexpected value on\n"
 
1852
                        "InnoDB: success! Cannot continue.\n");
1763
1853
                exit(1);
1764
1854
        }
1765
1855
 
1772
1862
        os_fast_mutex_free(&srv_os_test_mutex);
1773
1863
 
1774
1864
        if (srv_print_verbose_log) {
1775
 
                drizzled::errmsg_printf(drizzled::error::INFO,
1776
 
                                        "InnoDB %s started; log sequence number %"PRIu64"\n",
1777
 
                                        INNODB_VERSION_STR, srv_start_lsn);
 
1865
                ut_print_timestamp(stderr);
 
1866
                fprintf(stderr,
 
1867
                        "  InnoDB %s started; "
 
1868
                        "log sequence number %"PRIu64"\n",
 
1869
                        INNODB_VERSION_STR, srv_start_lsn);
1778
1870
        }
1779
1871
 
1780
1872
        if (srv_force_recovery > 0) {
1781
 
          drizzled::errmsg_printf(drizzled::error::ERROR,
1782
 
                                  "InnoDB: !!! innodb_force_recovery is set to %lu !!!\n",
1783
 
                                  (ulong) srv_force_recovery);
 
1873
                fprintf(stderr,
 
1874
                        "InnoDB: !!! innodb_force_recovery"
 
1875
                        " is set to %lu !!!\n",
 
1876
                        (ulong) srv_force_recovery);
1784
1877
        }
1785
1878
 
 
1879
        fflush(stderr);
 
1880
 
1786
1881
        if (trx_doublewrite_must_reset_space_ids) {
1787
1882
                /* Actually, we did not change the undo log format between
1788
1883
                4.0 and 4.1.1, and we would not need to run purge to
1797
1892
                4.1.1. It is essential that the insert buffer is emptied
1798
1893
                here! */
1799
1894
 
1800
 
          drizzled::errmsg_printf(drizzled::error::INFO,
1801
 
                                  "InnoDB: You are upgrading to an InnoDB version which allows multiple. "
1802
 
                                  "tablespaces. Wait that purge and insert buffer merge run to completion...");
 
1895
                fprintf(stderr,
 
1896
                        "InnoDB: You are upgrading to an"
 
1897
                        " InnoDB version which allows multiple\n"
 
1898
                        "InnoDB: tablespaces. Wait that purge"
 
1899
                        " and insert buffer merge run to\n"
 
1900
                        "InnoDB: completion...\n");
1803
1901
                for (;;) {
1804
1902
                        os_thread_sleep(1000000);
1805
1903
 
1811
1909
                                break;
1812
1910
                        }
1813
1911
                }
1814
 
                drizzled::errmsg_printf(drizzled::error::INFO,
1815
 
                                        "InnoDB: Full purge and insert buffer merge completed.");
 
1912
                fprintf(stderr,
 
1913
                        "InnoDB: Full purge and insert buffer merge"
 
1914
                        " completed.\n");
1816
1915
 
1817
1916
                trx_sys_mark_upgraded_to_multiple_tablespaces();
1818
1917
 
1819
 
                drizzled::errmsg_printf(drizzled::error::INFO,
1820
 
                                        "InnoDB: You have now successfully upgraded"
1821
 
                                        " to the multiple tablespaces\n"
1822
 
                                        "InnoDB: format. You should NOT DOWNGRADE"
1823
 
                                        " to an earlier version of\n"
1824
 
                                        "InnoDB: InnoDB! But if you absolutely need to"
1825
 
                                        " downgrade, see\n"
1826
 
                                        "InnoDB: " REFMAN "multiple-tablespaces.html\n"
1827
 
                                        "InnoDB: for instructions.\n");
 
1918
                fprintf(stderr,
 
1919
                        "InnoDB: You have now successfully upgraded"
 
1920
                        " to the multiple tablespaces\n"
 
1921
                        "InnoDB: format. You should NOT DOWNGRADE"
 
1922
                        " to an earlier version of\n"
 
1923
                        "InnoDB: InnoDB! But if you absolutely need to"
 
1924
                        " downgrade, see\n"
 
1925
                        "InnoDB: " REFMAN "multiple-tablespaces.html\n"
 
1926
                        "InnoDB: for instructions.\n");
1828
1927
        }
1829
1928
 
1830
1929
        if (srv_force_recovery == 0) {
1836
1935
                ibuf_update_max_tablespace_id();
1837
1936
        }
1838
1937
 
1839
 
skip_processes:
1840
1938
        srv_file_per_table = srv_file_per_table_original_value;
1841
1939
 
1842
1940
        srv_was_started = TRUE;
1855
1953
        ulint   i;
1856
1954
        if (!srv_was_started) {
1857
1955
                if (srv_is_being_started) {
1858
 
                  drizzled::errmsg_printf(drizzled::error::ERROR,
1859
 
                                "InnoDB: Warning: shutting down a not properly started or created database!");
 
1956
                        ut_print_timestamp(stderr);
 
1957
                        fprintf(stderr,
 
1958
                                "  InnoDB: Warning: shutting down"
 
1959
                                " a not properly started\n"
 
1960
                                "InnoDB: or created database!\n");
1860
1961
                }
1861
1962
 
1862
1963
                return(DB_SUCCESS);
1869
1970
 
1870
1971
 
1871
1972
        if (srv_fast_shutdown == 2) {
1872
 
                drizzled::errmsg_printf(drizzled::error::INFO,
1873
 
                                        "InnoDB: MySQL has requested a very fast shutdown without flushing "
1874
 
                                        "the InnoDB buffer pool to data files. At the next mysqld startup "
1875
 
                                        "InnoDB will do a crash recovery!");
 
1973
                ut_print_timestamp(stderr);
 
1974
                fprintf(stderr,
 
1975
                        "  InnoDB: MySQL has requested a very fast shutdown"
 
1976
                        " without flushing "
 
1977
                        "the InnoDB buffer pool to data files."
 
1978
                        " At the next mysqld startup "
 
1979
                        "InnoDB will do a crash recovery!\n");
1876
1980
        }
1877
1981
 
1878
1982
        logs_empty_and_mark_files_at_shutdown();
1879
1983
 
1880
1984
        if (srv_conc_n_threads != 0) {
1881
 
          drizzled::errmsg_printf(drizzled::error::WARN,
1882
 
                                  "InnoDB: Warning: query counter shows %ld queries still InnoDB: inside InnoDB at shutdown.",
1883
 
                                  srv_conc_n_threads);
 
1985
                fprintf(stderr,
 
1986
                        "InnoDB: Warning: query counter shows %ld queries"
 
1987
                        " still\n"
 
1988
                        "InnoDB: inside InnoDB at shutdown\n",
 
1989
                        srv_conc_n_threads);
1884
1990
        }
1885
1991
 
1886
1992
        /* 2. Make all threads created by InnoDB to exit */
1943
2049
        }
1944
2050
 
1945
2051
        if (i == 1000) {
1946
 
          drizzled::errmsg_printf(drizzled::error::WARN,
1947
 
                        "InnoDB: Warning: %lu threads created by InnoDB had not exited at shutdown!",
 
2052
                fprintf(stderr,
 
2053
                        "InnoDB: Warning: %lu threads created by InnoDB"
 
2054
                        " had not exited at shutdown!\n",
1948
2055
                        (ulong) os_thread_count);
1949
2056
        }
1950
2057
 
2010
2117
            || os_event_count != 0
2011
2118
            || os_mutex_count != 0
2012
2119
            || os_fast_mutex_count != 0) {
2013
 
          drizzled::errmsg_printf(drizzled::error::WARN,
2014
 
                                  "InnoDB: Warning: some resources were not cleaned up in shutdown:\n"
2015
 
                                  "InnoDB: threads %lu, events %lu, os_mutexes %lu, os_fast_mutexes %lu\n",
2016
 
                                  (ulong) os_thread_count, (ulong) os_event_count,
2017
 
                                  (ulong) os_mutex_count, (ulong) os_fast_mutex_count);
 
2120
                fprintf(stderr,
 
2121
                        "InnoDB: Warning: some resources were not"
 
2122
                        " cleaned up in shutdown:\n"
 
2123
                        "InnoDB: threads %lu, events %lu,"
 
2124
                        " os_mutexes %lu, os_fast_mutexes %lu\n",
 
2125
                        (ulong) os_thread_count, (ulong) os_event_count,
 
2126
                        (ulong) os_mutex_count, (ulong) os_fast_mutex_count);
2018
2127
        }
2019
2128
 
2020
2129
        if (dict_foreign_err_file) {
2025
2134
        }
2026
2135
 
2027
2136
        if (srv_print_verbose_log) {
2028
 
                drizzled::errmsg_printf(drizzled::error::INFO,
2029
 
                                        "InnoDB: Shutdown completed log sequence number %"PRIu64,
2030
 
                                        srv_shutdown_lsn);
 
2137
                ut_print_timestamp(stderr);
 
2138
                fprintf(stderr,
 
2139
                        "  InnoDB: Shutdown completed;"
 
2140
                        " log sequence number %"PRIu64"\n",
 
2141
                        srv_shutdown_lsn);
2031
2142
        }
2032
2143
 
2033
2144
        srv_was_started = FALSE;