~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Stewart Smith
  • Date: 2011-01-21 01:09:12 UTC
  • mfrom: (2099 staging)
  • mto: (2099.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2100.
  • Revision ID: stewart@flamingspork.com-20110121010912-x5ogi8rm08nortxp
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
uint32_t server_id;
255
255
uint64_t table_cache_size;
256
256
size_t table_def_size;
257
 
uint64_t max_connect_errors;
258
257
uint32_t global_thread_id= 1UL;
259
258
pid_t current_pid;
260
259
 
394
393
  return vm;
395
394
}
396
395
 
 
396
fs::path& getFullDataHome()
 
397
{
 
398
  return full_data_home;
 
399
}
 
400
 
397
401
fs::path& getDataHome()
398
402
{
399
403
  return data_home;
597
601
  initgroups((char*) user, user_info_arg->pw_gid);
598
602
  if (setgid(user_info_arg->pw_gid) == -1)
599
603
  {
600
 
    sql_perror(N_("Set process group ID failed"));
 
604
    sql_perror(_("Set process group ID failed"));
601
605
    unireg_abort(1);
602
606
  }
603
607
  if (setuid(user_info_arg->pw_uid) == -1)
604
608
  {
605
 
    sql_perror(N_("Set process user ID failed"));
 
609
    sql_perror(_("Set process user ID failed"));
606
610
    unireg_abort(1);
607
611
  }
608
612
}
614
618
{
615
619
  if ((chroot(path) == -1) || !chdir("/"))
616
620
  {
617
 
    sql_perror(N_("Process chroot failed"));
 
621
    sql_perror(_("Process chroot failed"));
618
622
    unireg_abort(1);
619
623
  }
620
624
}
734
738
  global_system_variables.auto_increment_increment= 1;
735
739
  if (in_auto_increment_increment < 1 || in_auto_increment_increment > UINT64_MAX)
736
740
  {
737
 
    cout << N_("Error: Invalid Value for auto_increment_increment");
 
741
    cout << _("Error: Invalid Value for auto_increment_increment");
738
742
    exit(-1);
739
743
  }
740
744
  global_system_variables.auto_increment_increment= in_auto_increment_increment;
745
749
  global_system_variables.auto_increment_offset= 1;
746
750
  if (in_auto_increment_offset < 1 || in_auto_increment_offset > UINT64_MAX)
747
751
  {
748
 
    cout << N_("Error: Invalid Value for auto_increment_offset");
 
752
    cout << _("Error: Invalid Value for auto_increment_offset");
749
753
    exit(-1);
750
754
  }
751
755
  global_system_variables.auto_increment_offset= in_auto_increment_offset;
756
760
  global_system_variables.completion_type= 0;
757
761
  if (in_completion_type > 2)
758
762
  {
759
 
    cout << N_("Error: Invalid Value for completion_type");
 
763
    cout << _("Error: Invalid Value for completion_type");
760
764
    exit(-1);
761
765
  }
762
766
  global_system_variables.completion_type= in_completion_type;
768
772
  global_system_variables.div_precincrement= 4;
769
773
  if (in_div_precincrement > DECIMAL_MAX_SCALE)
770
774
  {
771
 
    cout << N_("Error: Invalid Value for div-precision-increment");
 
775
    cout << _("Error: Invalid Value for div-precision-increment");
772
776
    exit(-1);
773
777
  }
774
778
  global_system_variables.div_precincrement= in_div_precincrement;
779
783
  global_system_variables.group_concat_max_len= 1024;
780
784
  if (in_group_concat_max_len > ULONG_MAX || in_group_concat_max_len < 4)
781
785
  {
782
 
    cout << N_("Error: Invalid Value for group_concat_max_len");
 
786
    cout << _("Error: Invalid Value for group_concat_max_len");
783
787
    exit(-1);
784
788
  }
785
789
  global_system_variables.group_concat_max_len= in_group_concat_max_len;
790
794
  global_system_variables.join_buff_size= (128*1024L);
791
795
  if (in_join_buffer_size < IO_SIZE*2 || in_join_buffer_size > ULONG_MAX)
792
796
  {
793
 
    cout << N_("Error: Invalid Value for join_buffer_size");
 
797
    cout << _("Error: Invalid Value for join_buffer_size");
794
798
    exit(-1);
795
799
  }
796
800
  in_join_buffer_size-= in_join_buffer_size % IO_SIZE;
802
806
  global_system_variables.max_allowed_packet= (64*1024*1024L);
803
807
  if (in_max_allowed_packet < 1024 || in_max_allowed_packet > 1024*1024L*1024L)
804
808
  {
805
 
    cout << N_("Error: Invalid Value for max_allowed_packet");
 
809
    cout << _("Error: Invalid Value for max_allowed_packet");
806
810
    exit(-1);
807
811
  }
808
812
  in_max_allowed_packet-= in_max_allowed_packet % 1024;
809
813
  global_system_variables.max_allowed_packet= in_max_allowed_packet;
810
814
}
811
815
 
812
 
static void check_limits_mce(uint64_t in_max_connect_errors)
813
 
{
814
 
  max_connect_errors= MAX_CONNECT_ERRORS;
815
 
  if (in_max_connect_errors < 1 || in_max_connect_errors > ULONG_MAX)
816
 
  {
817
 
    cout << N_("Error: Invalid Value for max_connect_errors");
818
 
    exit(-1);
819
 
  }
820
 
  max_connect_errors= in_max_connect_errors;
821
 
}
822
 
 
823
816
static void check_limits_max_err_cnt(uint64_t in_max_error_count)
824
817
{
825
818
  global_system_variables.max_error_count= DEFAULT_ERROR_COUNT;
826
819
  if (in_max_error_count > 65535)
827
820
  {
828
 
    cout << N_("Error: Invalid Value for max_error_count");
 
821
    cout << _("Error: Invalid Value for max_error_count");
829
822
    exit(-1);
830
823
  }
831
824
  global_system_variables.max_error_count= in_max_error_count;
836
829
  global_system_variables.max_heap_table_size= (16*1024*1024L);
837
830
  if (in_max_heap_table_size < 16384 || in_max_heap_table_size > MAX_MEM_TABLE_SIZE)
838
831
  {
839
 
    cout << N_("Error: Invalid Value for max_heap_table_size");
 
832
    cout << _("Error: Invalid Value for max_heap_table_size");
840
833
    exit(-1);
841
834
  }
842
835
  in_max_heap_table_size-= in_max_heap_table_size % 1024;
848
841
  global_system_variables.min_examined_row_limit= 0;
849
842
  if (in_min_examined_row_limit > ULONG_MAX)
850
843
  {
851
 
    cout << N_("Error: Invalid Value for min_examined_row_limit");
 
844
    cout << _("Error: Invalid Value for min_examined_row_limit");
852
845
    exit(-1);
853
846
  }
854
847
  global_system_variables.min_examined_row_limit= in_min_examined_row_limit;
859
852
  global_system_variables.max_join_size= INT32_MAX;
860
853
  if ((uint64_t)in_max_join_size < 1 || (uint64_t)in_max_join_size > INT32_MAX)
861
854
  {
862
 
    cout << N_("Error: Invalid Value for max_join_size");
 
855
    cout << _("Error: Invalid Value for max_join_size");
863
856
    exit(-1);
864
857
  }
865
858
  global_system_variables.max_join_size= in_max_join_size;
870
863
  global_system_variables.max_length_for_sort_data= 1024;
871
864
  if (in_max_length_for_sort_data < 4 || in_max_length_for_sort_data > 8192*1024L)
872
865
  {
873
 
    cout << N_("Error: Invalid Value for max_length_for_sort_data");
 
866
    cout << _("Error: Invalid Value for max_length_for_sort_data");
874
867
    exit(-1);
875
868
  }
876
869
  global_system_variables.max_length_for_sort_data= in_max_length_for_sort_data;
881
874
  global_system_variables.max_seeks_for_key= ULONG_MAX;
882
875
  if (in_max_seeks_for_key < 1 || in_max_seeks_for_key > ULONG_MAX)
883
876
  {
884
 
    cout << N_("Error: Invalid Value for max_seeks_for_key");
 
877
    cout << _("Error: Invalid Value for max_seeks_for_key");
885
878
    exit(-1);
886
879
  }
887
880
  global_system_variables.max_seeks_for_key= in_max_seeks_for_key;
892
885
  global_system_variables.max_sort_length= 1024;
893
886
  if ((int64_t)in_max_sort_length < 4 || (int64_t)in_max_sort_length > 8192*1024L)
894
887
  {
895
 
    cout << N_("Error: Invalid Value for max_sort_length");
 
888
    cout << _("Error: Invalid Value for max_sort_length");
896
889
    exit(-1);
897
890
  }
898
891
  global_system_variables.max_sort_length= in_max_sort_length;
903
896
  global_system_variables.optimizer_search_depth= 0;
904
897
  if (in_optimizer_search_depth > MAX_TABLES + 2)
905
898
  {
906
 
    cout << N_("Error: Invalid Value for optimizer_search_depth");
 
899
    cout << _("Error: Invalid Value for optimizer_search_depth");
907
900
    exit(-1);
908
901
  }
909
902
  global_system_variables.optimizer_search_depth= in_optimizer_search_depth;
914
907
  global_system_variables.preload_buff_size= (32*1024L);
915
908
  if (in_preload_buff_size < 1024 || in_preload_buff_size > 1024*1024*1024L)
916
909
  {
917
 
    cout << N_("Error: Invalid Value for preload_buff_size");
 
910
    cout << _("Error: Invalid Value for preload_buff_size");
918
911
    exit(-1);
919
912
  }
920
913
  global_system_variables.preload_buff_size= in_preload_buff_size;
925
918
  global_system_variables.query_alloc_block_size= QUERY_ALLOC_BLOCK_SIZE;
926
919
  if (in_query_alloc_block_size < 1024)
927
920
  {
928
 
    cout << N_("Error: Invalid Value for query_alloc_block_size");
 
921
    cout << _("Error: Invalid Value for query_alloc_block_size");
929
922
    exit(-1);
930
923
  }
931
924
  in_query_alloc_block_size-= in_query_alloc_block_size % 1024;
937
930
  global_system_variables.query_prealloc_size= QUERY_ALLOC_PREALLOC_SIZE;
938
931
  if (in_query_prealloc_size < QUERY_ALLOC_PREALLOC_SIZE)
939
932
  {
940
 
    cout << N_("Error: Invalid Value for query_prealloc_size");
 
933
    cout << _("Error: Invalid Value for query_prealloc_size");
941
934
    exit(-1);
942
935
  }
943
936
  in_query_prealloc_size-= in_query_prealloc_size % 1024;
949
942
  global_system_variables.range_alloc_block_size= RANGE_ALLOC_BLOCK_SIZE;
950
943
  if (in_range_alloc_block_size < RANGE_ALLOC_BLOCK_SIZE)
951
944
  {
952
 
    cout << N_("Error: Invalid Value for range_alloc_block_size");
 
945
    cout << _("Error: Invalid Value for range_alloc_block_size");
953
946
    exit(-1);
954
947
  }
955
948
  in_range_alloc_block_size-= in_range_alloc_block_size % 1024;
961
954
  global_system_variables.read_buff_size= (128*1024L);
962
955
  if (in_read_buff_size < IO_SIZE*2 || in_read_buff_size > INT32_MAX)
963
956
  {
964
 
    cout << N_("Error: Invalid Value for read_buff_size");
 
957
    cout << _("Error: Invalid Value for read_buff_size");
965
958
    exit(-1);
966
959
  }
967
960
  in_read_buff_size-= in_read_buff_size % IO_SIZE;
973
966
  global_system_variables.read_rnd_buff_size= (256*1024L);
974
967
  if (in_read_rnd_buff_size < 64 || in_read_rnd_buff_size > UINT32_MAX)
975
968
  {
976
 
    cout << N_("Error: Invalid Value for read_rnd_buff_size");
 
969
    cout << _("Error: Invalid Value for read_rnd_buff_size");
977
970
    exit(-1);
978
971
  }
979
972
  global_system_variables.read_rnd_buff_size= in_read_rnd_buff_size;
984
977
  global_system_variables.sortbuff_size= MAX_SORT_MEMORY;
985
978
  if ((uint32_t)in_sortbuff_size < MIN_SORT_MEMORY)
986
979
  {
987
 
    cout << N_("Error: Invalid Value for sort_buff_size");
 
980
    cout << _("Error: Invalid Value for sort_buff_size");
988
981
    exit(-1);
989
982
  }
990
983
  global_system_variables.sortbuff_size= in_sortbuff_size;
995
988
  table_def_size= 128;
996
989
  if (in_table_def_size < 1 || in_table_def_size > 512*1024L)
997
990
  {
998
 
    cout << N_("Error: Invalid Value for table_def_size");
 
991
    cout << _("Error: Invalid Value for table_def_size");
999
992
    exit(-1);
1000
993
  }
1001
994
  table_def_size= in_table_def_size;
1006
999
  table_cache_size= TABLE_OPEN_CACHE_DEFAULT;
1007
1000
  if (in_table_cache_size < TABLE_OPEN_CACHE_MIN || in_table_cache_size > 512*1024L)
1008
1001
  {
1009
 
    cout << N_("Error: Invalid Value for table_cache_size");
 
1002
    cout << _("Error: Invalid Value for table_cache_size");
1010
1003
    exit(-1);
1011
1004
  }
1012
1005
  table_cache_size= in_table_cache_size;
1017
1010
  table_lock_wait_timeout= 50;
1018
1011
  if (in_table_lock_wait_timeout < 1 || in_table_lock_wait_timeout > 1024*1024*1024)
1019
1012
  {
1020
 
    cout << N_("Error: Invalid Value for table_lock_wait_timeout");
 
1013
    cout << _("Error: Invalid Value for table_lock_wait_timeout");
1021
1014
    exit(-1);
1022
1015
  }
1023
1016
  table_lock_wait_timeout= in_table_lock_wait_timeout;
1033
1026
  global_system_variables.tmp_table_size= 16*1024*1024L;
1034
1027
  if (in_tmp_table_size < 1024 || in_tmp_table_size > MAX_MEM_TABLE_SIZE)
1035
1028
  {
1036
 
    cout << N_("Error: Invalid Value for table_lock_wait_timeout");
 
1029
    cout << _("Error: Invalid Value for table_lock_wait_timeout");
1037
1030
    exit(-1);
1038
1031
  }
1039
1032
  global_system_variables.tmp_table_size= in_tmp_table_size;
1044
1037
  global_system_variables.transaction_message_threshold= 1024*1024;
1045
1038
  if ((int64_t) in_transaction_message_threshold < 128*1024 || (int64_t)in_transaction_message_threshold > 1024*1024)
1046
1039
  {
1047
 
    cout << N_("Error: Invalid Value for transaction_message_threshold valid values are between 131072 - 1048576 bytes");
 
1040
    cout << _("Error: Invalid Value for transaction_message_threshold valid values are between 131072 - 1048576 bytes");
1048
1041
    exit(-1);
1049
1042
  }
1050
1043
  global_system_variables.transaction_message_threshold= in_transaction_message_threshold;
1158
1151
 
1159
1152
  config_options.add_options()
1160
1153
  ("help,?", po::value<bool>(&opt_help)->default_value(false)->zero_tokens(),
1161
 
  N_("Display this help and exit."))
 
1154
  _("Display this help and exit."))
1162
1155
  ("no-defaults", po::value<bool>()->default_value(false)->zero_tokens(),
1163
 
  N_("Configuration file defaults are not used if no-defaults is set"))
 
1156
  _("Configuration file defaults are not used if no-defaults is set"))
1164
1157
  ("defaults-file", po::value<vector<string> >()->composing()->notifier(&compose_defaults_file_list),
1165
 
   N_("Configuration file to use"))
 
1158
  _("Configuration file to use"))
1166
1159
  ("config-dir", po::value<fs::path>(&system_config_dir),
1167
 
   N_("Base location for config files"))
 
1160
  _("Base location for config files"))
1168
1161
  ("plugin-dir", po::value<fs::path>(&plugin_dir)->notifier(&notify_plugin_dir),
1169
 
  N_("Directory for plugins."))
 
1162
  _("Directory for plugins."))
1170
1163
  ;
1171
1164
 
1172
1165
  plugin_load_options.add_options()
1173
1166
  ("plugin-add", po::value<vector<string> >()->composing()->notifier(&compose_plugin_add),
1174
 
  N_("Optional comma separated list of plugins to load at startup in addition "
 
1167
  _("Optional comma separated list of plugins to load at startup in addition "
1175
1168
     "to the default list of plugins. "
1176
1169
     "[for example: --plugin_add=crc32,logger_gearman]"))    
1177
1170
  ("plugin-remove", po::value<vector<string> >()->composing()->notifier(&compose_plugin_remove),
1178
 
  N_("Optional comma separated list of plugins to not load at startup. Effectively "
 
1171
  _("Optional comma separated list of plugins to not load at startup. Effectively "
1179
1172
     "removes a plugin from the list of plugins to be loaded. "
1180
1173
     "[for example: --plugin_remove=crc32,logger_gearman]"))
1181
1174
  ("plugin-load", po::value<string>()->notifier(&notify_plugin_load)->default_value(PANDORA_PLUGIN_LIST),
1182
 
  N_("Optional comma separated list of plugins to load at starup instead of "
 
1175
  _("Optional comma separated list of plugins to load at starup instead of "
1183
1176
     "the default plugin load list. "
1184
1177
     "[for example: --plugin_load=crc32,logger_gearman]"))
1185
1178
  ;
1186
1179
 
1187
1180
  long_options.add_options()
1188
1181
  ("auto-increment-increment", po::value<uint64_t>(&global_system_variables.auto_increment_increment)->default_value(1)->notifier(&check_limits_aii),
1189
 
  N_("Auto-increment columns are incremented by this"))
 
1182
  _("Auto-increment columns are incremented by this"))
1190
1183
  ("auto-increment-offset", po::value<uint64_t>(&global_system_variables.auto_increment_offset)->default_value(1)->notifier(&check_limits_aio),
1191
 
  N_("Offset added to Auto-increment columns. Used when auto-increment-increment != 1"))
 
1184
  _("Offset added to Auto-increment columns. Used when auto-increment-increment != 1"))
1192
1185
  ("basedir,b", po::value<fs::path>(&basedir),
1193
 
  N_("Path to installation directory. All paths are usually resolved "
 
1186
  _("Path to installation directory. All paths are usually resolved "
1194
1187
     "relative to this."))
1195
1188
  ("chroot,r", po::value<string>(),
1196
 
  N_("Chroot drizzled daemon during startup."))
 
1189
  _("Chroot drizzled daemon during startup."))
1197
1190
  ("collation-server", po::value<string>(),
1198
 
  N_("Set the default collation."))      
 
1191
  _("Set the default collation."))      
1199
1192
  ("completion-type", po::value<uint32_t>(&global_system_variables.completion_type)->default_value(0)->notifier(&check_limits_completion_type),
1200
 
  N_("Default completion type."))
1201
 
  ("core-file",  N_("Write core on errors."))
 
1193
  _("Default completion type."))
 
1194
  ("core-file",  _("Write core on errors."))
1202
1195
  ("datadir", po::value<fs::path>(&data_home),
1203
 
  N_("Path to the database root."))
 
1196
  _("Path to the database root."))
1204
1197
  ("default-storage-engine", po::value<string>(),
1205
 
  N_("Set the default storage engine for tables."))
 
1198
  _("Set the default storage engine for tables."))
1206
1199
  ("default-time-zone", po::value<string>(),
1207
 
  N_("Set the default time zone."))
 
1200
  _("Set the default time zone."))
1208
1201
  ("exit-info,T", po::value<long>(),
1209
 
  N_("Used for debugging;  Use at your own risk!"))
 
1202
  _("Used for debugging;  Use at your own risk!"))
1210
1203
  ("gdb", po::value<bool>(&opt_debugging)->default_value(false)->zero_tokens(),
1211
 
  N_("Set up signals usable for debugging"))
 
1204
  _("Set up signals usable for debugging"))
1212
1205
  ("lc-time-name", po::value<string>(),
1213
 
  N_("Set the language used for the month names and the days of the week."))
 
1206
  _("Set the language used for the month names and the days of the week."))
1214
1207
  ("log-warnings,W", po::value<bool>(&global_system_variables.log_warnings)->default_value(false)->zero_tokens(),
1215
 
  N_("Log some not critical warnings to the log file."))  
 
1208
  _("Log some not critical warnings to the log file."))  
1216
1209
  ("pid-file", po::value<fs::path>(&pid_file),
1217
 
  N_("Pid file used by drizzled."))
 
1210
  _("Pid file used by drizzled."))
1218
1211
  ("port-open-timeout", po::value<uint32_t>(&drizzled_bind_timeout)->default_value(0),
1219
 
  N_("Maximum time in seconds to wait for the port to become free. "))
 
1212
  _("Maximum time in seconds to wait for the port to become free. "))
1220
1213
  ("replicate-query", po::value<bool>(&global_system_variables.replicate_query)->default_value(false)->zero_tokens(),
1221
 
  N_("Include the SQL query in replicated protobuf messages."))
 
1214
  _("Include the SQL query in replicated protobuf messages."))
1222
1215
  ("secure-file-priv", po::value<fs::path>(&secure_file_priv)->notifier(expand_secure_file_priv),
1223
 
  N_("Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files "
 
1216
  _("Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files "
1224
1217
     "within specified directory"))
1225
1218
  ("server-id", po::value<uint32_t>(&server_id)->default_value(0),
1226
 
  N_("Uniquely identifies the server instance in the community of "
 
1219
  _("Uniquely identifies the server instance in the community of "
1227
1220
     "replication partners."))
1228
1221
  ("skip-stack-trace",  
1229
 
  N_("Don't print a stack trace on failure."))
 
1222
  _("Don't print a stack trace on failure."))
1230
1223
  ("symbolic-links,s", po::value<bool>(&internal::my_use_symdir)->default_value(IF_PURIFY(false,true))->zero_tokens(),
1231
 
  N_("Enable symbolic link support."))
 
1224
  _("Enable symbolic link support."))
1232
1225
  ("timed-mutexes", po::value<bool>(&internal::timed_mutexes)->default_value(false)->zero_tokens(),
1233
 
  N_("Specify whether to time mutexes (only InnoDB mutexes are currently "
 
1226
  _("Specify whether to time mutexes (only InnoDB mutexes are currently "
1234
1227
     "supported)")) 
1235
1228
  ("tmpdir,t", po::value<string>(),
1236
 
  N_("Path for temporary files."))
 
1229
  _("Path for temporary files."))
1237
1230
  ("transaction-isolation", po::value<string>(),
1238
 
  N_("Default transaction isolation level."))
 
1231
  _("Default transaction isolation level."))
1239
1232
  ("transaction-message-threshold", po::value<size_t>(&global_system_variables.transaction_message_threshold)->default_value(1024*1024)->notifier(&check_limits_transaction_message_threshold),
1240
 
  N_("Max message size written to transaction log, valid values 131072 - 1048576 bytes."))
 
1233
  _("Max message size written to transaction log, valid values 131072 - 1048576 bytes."))
1241
1234
  ("user,u", po::value<string>(),
1242
 
  N_("Run drizzled daemon as user."))  
 
1235
  _("Run drizzled daemon as user."))  
1243
1236
  ("version,V", 
1244
 
  N_("Output version information and exit."))
 
1237
  _("Output version information and exit."))
1245
1238
  ("back-log", po::value<back_log_constraints>(&back_log),
1246
 
  N_("The number of outstanding connection requests Drizzle can have. This "
 
1239
  _("The number of outstanding connection requests Drizzle can have. This "
1247
1240
     "comes into play when the main Drizzle thread gets very many connection "
1248
1241
     "requests in a very short time."))
1249
1242
  ("bulk-insert-buffer-size", 
1250
1243
  po::value<uint64_t>(&global_system_variables.bulk_insert_buff_size)->default_value(8192*1024),
1251
 
  N_("Size of tree cache used in bulk insert optimization. Note that this is "
 
1244
  _("Size of tree cache used in bulk insert optimization. Note that this is "
1252
1245
     "a limit per thread!"))
1253
1246
  ("div-precision-increment",  po::value<uint32_t>(&global_system_variables.div_precincrement)->default_value(4)->notifier(&check_limits_dpi),
1254
 
  N_("Precision of the result of '/' operator will be increased on that "
 
1247
  _("Precision of the result of '/' operator will be increased on that "
1255
1248
     "value."))
1256
1249
  ("group-concat-max-len", po::value<uint64_t>(&global_system_variables.group_concat_max_len)->default_value(1024)->notifier(&check_limits_gcml),
1257
 
  N_("The maximum length of the result of function  group_concat."))
 
1250
  _("The maximum length of the result of function  group_concat."))
1258
1251
  ("join-buffer-size", po::value<uint64_t>(&global_system_variables.join_buff_size)->default_value(128*1024L)->notifier(&check_limits_join_buffer_size),
1259
 
  N_("The size of the buffer that is used for full joins."))
 
1252
  _("The size of the buffer that is used for full joins."))
1260
1253
  ("join-heap-threshold",
1261
1254
  po::value<uint64_t>()->default_value(0),
1262
 
  N_("A global cap on the amount of memory that can be allocated by session join buffers (0 means unlimited)"))
 
1255
  _("A global cap on the amount of memory that can be allocated by session join buffers (0 means unlimited)"))
1263
1256
  ("max-allowed-packet", po::value<uint32_t>(&global_system_variables.max_allowed_packet)->default_value(64*1024*1024L)->notifier(&check_limits_map),
1264
 
  N_("Max packetlength to send/receive from to server."))
1265
 
  ("max-connect-errors", po::value<uint64_t>(&max_connect_errors)->default_value(MAX_CONNECT_ERRORS)->notifier(&check_limits_mce),
1266
 
  N_("If there is more than this number of interrupted connections from a "
1267
 
     "host this host will be blocked from further connections."))
 
1257
  _("Max packetlength to send/receive from to server."))
1268
1258
  ("max-error-count", po::value<uint64_t>(&global_system_variables.max_error_count)->default_value(DEFAULT_ERROR_COUNT)->notifier(&check_limits_max_err_cnt),
1269
 
  N_("Max number of errors/warnings to store for a statement."))
 
1259
  _("Max number of errors/warnings to store for a statement."))
1270
1260
  ("max-heap-table-size", po::value<uint64_t>(&global_system_variables.max_heap_table_size)->default_value(16*1024*1024L)->notifier(&check_limits_mhts),
1271
 
  N_("Don't allow creation of heap tables bigger than this."))
 
1261
  _("Don't allow creation of heap tables bigger than this."))
1272
1262
  ("max-join-size", po::value<drizzled::ha_rows>(&global_system_variables.max_join_size)->default_value(INT32_MAX)->notifier(&check_limits_max_join_size),
1273
 
  N_("Joins that are probably going to read more than max_join_size records "
 
1263
  _("Joins that are probably going to read more than max_join_size records "
1274
1264
     "return an error."))
1275
1265
  ("max-length-for-sort-data", po::value<uint64_t>(&global_system_variables.max_length_for_sort_data)->default_value(1024)->notifier(&check_limits_mlfsd),
1276
 
  N_("Max number of bytes in sorted records."))
 
1266
  _("Max number of bytes in sorted records."))
1277
1267
  ("max-seeks-for-key", po::value<uint64_t>(&global_system_variables.max_seeks_for_key)->default_value(ULONG_MAX)->notifier(&check_limits_msfk),
1278
 
  N_("Limit assumed max number of seeks when looking up rows based on a key"))
 
1268
  _("Limit assumed max number of seeks when looking up rows based on a key"))
1279
1269
  ("max-sort-length", po::value<size_t>(&global_system_variables.max_sort_length)->default_value(1024)->notifier(&check_limits_max_sort_length),  
1280
 
  N_("The number of bytes to use when sorting BLOB or TEXT values "
 
1270
  _("The number of bytes to use when sorting BLOB or TEXT values "
1281
1271
     "(only the first max_sort_length bytes of each value are used; the "
1282
1272
     "rest are ignored)."))
1283
1273
  ("max-write-lock-count", po::value<uint64_t>(&max_write_lock_count)->default_value(UINT64_MAX),
1284
 
  N_("After this many write locks, allow some read locks to run in between."))
 
1274
  _("After this many write locks, allow some read locks to run in between."))
1285
1275
  ("min-examined-row-limit", po::value<uint64_t>(&global_system_variables.min_examined_row_limit)->default_value(0)->notifier(&check_limits_merl),
1286
 
  N_("Don't log queries which examine less than min_examined_row_limit "
 
1276
  _("Don't log queries which examine less than min_examined_row_limit "
1287
1277
     "rows to file."))
1288
1278
  ("disable-optimizer-prune",
1289
 
  N_("Do not apply any heuristic(s) during query optimization to prune, "
 
1279
  _("Do not apply any heuristic(s) during query optimization to prune, "
1290
1280
     "thus perform an exhaustive search from the optimizer search space."))
1291
1281
  ("optimizer-search-depth", po::value<uint32_t>(&global_system_variables.optimizer_search_depth)->default_value(0)->notifier(&check_limits_osd),
1292
 
  N_("Maximum depth of search performed by the query optimizer. Values "
 
1282
  _("Maximum depth of search performed by the query optimizer. Values "
1293
1283
     "larger than the number of relations in a query result in better query "
1294
1284
     "plans, but take longer to compile a query. Smaller values than the "
1295
1285
     "number of tables in a relation result in faster optimization, but may "
1298
1288
     "optimizer will switch to the original find_best (used for "
1299
1289
     "testing/comparison)."))
1300
1290
  ("preload-buffer-size", po::value<uint64_t>(&global_system_variables.preload_buff_size)->default_value(32*1024L)->notifier(&check_limits_pbs),
1301
 
  N_("The size of the buffer that is allocated when preloading indexes"))
 
1291
  _("The size of the buffer that is allocated when preloading indexes"))
1302
1292
  ("query-alloc-block-size", 
1303
1293
  po::value<uint32_t>(&global_system_variables.query_alloc_block_size)->default_value(QUERY_ALLOC_BLOCK_SIZE)->notifier(&check_limits_qabs),
1304
 
  N_("Allocation block size for query parsing and execution"))
 
1294
  _("Allocation block size for query parsing and execution"))
1305
1295
  ("query-prealloc-size",
1306
1296
  po::value<uint32_t>(&global_system_variables.query_prealloc_size)->default_value(QUERY_ALLOC_PREALLOC_SIZE)->notifier(&check_limits_qps),
1307
 
  N_("Persistent buffer for query parsing and execution"))
 
1297
  _("Persistent buffer for query parsing and execution"))
1308
1298
  ("range-alloc-block-size",
1309
1299
  po::value<size_t>(&global_system_variables.range_alloc_block_size)->default_value(RANGE_ALLOC_BLOCK_SIZE)->notifier(&check_limits_rabs),
1310
 
  N_("Allocation block size for storing ranges during optimization"))
 
1300
  _("Allocation block size for storing ranges during optimization"))
1311
1301
  ("read-buffer-size",
1312
1302
  po::value<uint32_t>(&global_system_variables.read_buff_size)->default_value(128*1024L)->notifier(&check_limits_read_buffer_size),
1313
 
  N_("Each thread that does a sequential scan allocates a buffer of this "
 
1303
  _("Each thread that does a sequential scan allocates a buffer of this "
1314
1304
      "size for each table it scans. If you do many sequential scans, you may "
1315
1305
      "want to increase this value."))
1316
1306
  ("read-buffer-threshold",
1317
1307
  po::value<uint64_t>()->default_value(0),
1318
 
  N_("A global cap on the size of read-buffer-size (0 means unlimited)"))
 
1308
  _("A global cap on the size of read-buffer-size (0 means unlimited)"))
1319
1309
  ("read-rnd-buffer-size",
1320
1310
  po::value<uint32_t>(&global_system_variables.read_rnd_buff_size)->default_value(256*1024L)->notifier(&check_limits_read_rnd_buffer_size),
1321
 
  N_("When reading rows in sorted order after a sort, the rows are read "
 
1311
  _("When reading rows in sorted order after a sort, the rows are read "
1322
1312
     "through this buffer to avoid a disk seeks. If not set, then it's set "
1323
1313
     "to the value of record_buffer."))
1324
1314
  ("read-rnd-threshold",
1325
1315
  po::value<uint64_t>()->default_value(0),
1326
 
  N_("A global cap on the size of read-rnd-buffer-size (0 means unlimited)"))
 
1316
  _("A global cap on the size of read-rnd-buffer-size (0 means unlimited)"))
1327
1317
  ("scheduler", po::value<string>(),
1328
 
  N_("Select scheduler to be used (by default multi-thread)."))
 
1318
  _("Select scheduler to be used (by default multi-thread)."))
1329
1319
  ("sort-buffer-size",
1330
1320
  po::value<size_t>(&global_system_variables.sortbuff_size)->default_value(MAX_SORT_MEMORY)->notifier(&check_limits_sort_buffer_size),
1331
 
  N_("Each thread that needs to do a sort allocates a buffer of this size."))
 
1321
  _("Each thread that needs to do a sort allocates a buffer of this size."))
1332
1322
  ("sort-heap-threshold",
1333
1323
  po::value<uint64_t>()->default_value(0),
1334
 
  N_("A global cap on the amount of memory that can be allocated by session sort buffers (0 means unlimited)"))
 
1324
  _("A global cap on the amount of memory that can be allocated by session sort buffers (0 means unlimited)"))
1335
1325
  ("table-definition-cache", po::value<size_t>(&table_def_size)->default_value(128)->notifier(&check_limits_tdc),
1336
 
  N_("The number of cached table definitions."))
 
1326
  _("The number of cached table definitions."))
1337
1327
  ("table-open-cache", po::value<uint64_t>(&table_cache_size)->default_value(TABLE_OPEN_CACHE_DEFAULT)->notifier(&check_limits_toc),
1338
 
  N_("The number of cached open tables."))
 
1328
  _("The number of cached open tables."))
1339
1329
  ("table-lock-wait-timeout", po::value<uint64_t>(&table_lock_wait_timeout)->default_value(50)->notifier(&check_limits_tlwt),
1340
 
  N_("Timeout in seconds to wait for a table level lock before returning an "
 
1330
  _("Timeout in seconds to wait for a table level lock before returning an "
1341
1331
     "error. Used only if the connection has active cursors."))
1342
1332
  ("thread-stack", po::value<size_t>(&my_thread_stack_size)->default_value(DEFAULT_THREAD_STACK)->notifier(&check_limits_thread_stack),
1343
 
  N_("The stack size for each thread."))
 
1333
  _("The stack size for each thread."))
1344
1334
  ("tmp-table-size", 
1345
1335
  po::value<uint64_t>(&global_system_variables.tmp_table_size)->default_value(16*1024*1024L)->notifier(&check_limits_tmp_table_size),
1346
 
  N_("If an internal in-memory temporary table exceeds this size, Drizzle will"
 
1336
  _("If an internal in-memory temporary table exceeds this size, Drizzle will"
1347
1337
     " automatically convert it to an on-disk MyISAM table."))
1348
1338
  ;
1349
1339
 
1698
1688
  OPT_BACK_LOG,
1699
1689
  OPT_JOIN_BUFF_SIZE,
1700
1690
  OPT_MAX_ALLOWED_PACKET,
1701
 
  OPT_MAX_CONNECT_ERRORS,
1702
1691
  OPT_MAX_HEP_TABLE_SIZE,
1703
1692
  OPT_MAX_JOIN_SIZE,
1704
1693
  OPT_MAX_SORT_LENGTH,
1788
1777
  {"datadir", 'h',
1789
1778
   N_("Path to the database root."),
1790
1779
   NULL, NULL, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1791
 
  {"default-storage-engine", OPT_STORAGE_ENGINE,
1792
 
   N_("Set the default storage engine (table type) for tables."),
1793
 
   (char**)&default_storage_engine_str, (char**)&default_storage_engine_str,
1794
 
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1795
 
  {"default-time-zone", OPT_DEFAULT_TIME_ZONE,
1796
 
   N_("Set the default time zone."),
1797
 
   (char**) &default_tz_name, (char**) &default_tz_name,
1798
 
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
1799
1780
  /* See how it's handled in get_one_option() */
1800
1781
  {"exit-info", 'T',
1801
1782
   N_("Used for debugging;  Use at your own risk!"),
1806
1787
   N_("Set up signals usable for debugging"),
1807
1788
   (char**) &opt_debugging, (char**) &opt_debugging,
1808
1789
   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1809
 
  {"lc-time-names", OPT_LC_TIME_NAMES,
1810
 
   N_("Set the language used for the month names and the days of the week."),
1811
 
   (char**) &lc_time_names_name,
1812
 
   (char**) &lc_time_names_name,
1813
 
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
1814
1790
  {"log-warnings", 'W',
1815
1791
   N_("Log some not critical warnings to the log file."),
1816
1792
   (char**) &global_system_variables.log_warnings,
1853
1829
      "supported)"),
1854
1830
   (char**) &internal::timed_mutexes, (char**) &internal::timed_mutexes, 0, GET_BOOL, NO_ARG, 0,
1855
1831
    0, 0, 0, 0, 0},
1856
 
  {"tmpdir", 't',
1857
 
   N_("Path for temporary files."),
1858
 
   (char**) &opt_drizzle_tmpdir,
1859
 
   (char**) &opt_drizzle_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1860
1832
  {"transaction-isolation", OPT_TX_ISOLATION,
1861
1833
   N_("Default transaction isolation level."),
1862
1834
   0, 0, 0, GET_STR, REQUIRED_ARG, 0,
1865
1837
   N_("Run drizzled daemon as user."),
1866
1838
   0, 0, 0, GET_STR, REQUIRED_ARG,
1867
1839
   0, 0, 0, 0, 0, 0},
1868
 
  {"version", 'V',
1869
 
   N_("Output version information and exit."),
1870
 
   0, 0, 0, GET_NO_ARG,
1871
 
   NO_ARG, 0, 0, 0, 0, 0, 0},
1872
1840
  {"back_log", OPT_BACK_LOG,
1873
1841
   N_("The number of outstanding connection requests Drizzle can have. This "
1874
1842
      "comes into play when the main Drizzle thread gets very many connection "
1887
1855
   (char**) &global_system_variables.div_precincrement,
1888
1856
   (char**) &max_system_variables.div_precincrement, 0, GET_UINT,
1889
1857
   REQUIRED_ARG, 4, 0, DECIMAL_MAX_SCALE, 0, 0, 0},
1890
 
  { "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN,
1891
 
    N_("The maximum length of the result of function  group_concat."),
1892
 
    (char**) &global_system_variables.group_concat_max_len,
1893
 
    (char**) &max_system_variables.group_concat_max_len, 0, GET_UINT64,
1894
 
    REQUIRED_ARG, 1024, 4, ULONG_MAX, 0, 1, 0},
1895
1858
  { "join_buffer_size", OPT_JOIN_BUFF_SIZE,
1896
1859
    N_("The size of the buffer that is used for full joins."),
1897
1860
   (char**) &global_system_variables.join_buff_size,
1903
1866
   (char**) &global_system_variables.max_allowed_packet,
1904
1867
   (char**) &max_system_variables.max_allowed_packet, 0, GET_UINT32,
1905
1868
   REQUIRED_ARG, 64*1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
1906
 
  {"max_connect_errors", OPT_MAX_CONNECT_ERRORS,
1907
 
   N_("If there is more than this number of interrupted connections from a "
1908
 
      "host this host will be blocked from further connections."),
1909
 
   (char**) &max_connect_errors, (char**) &max_connect_errors, 0, GET_UINT64,
1910
 
   REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ULONG_MAX, 0, 1, 0},
1911
 
  {"max_error_count", OPT_MAX_ERROR_COUNT,
1912
 
   N_("Max number of errors/warnings to store for a statement."),
1913
 
   (char**) &global_system_variables.max_error_count,
1914
 
   (char**) &max_system_variables.max_error_count,
1915
 
   0, GET_UINT64, REQUIRED_ARG, DEFAULT_ERROR_COUNT, 0, 65535, 0, 1, 0},
1916
1869
  {"max_heap_table_size", OPT_MAX_HEP_TABLE_SIZE,
1917
1870
   N_("Don't allow creation of heap tables bigger than this."),
1918
1871
   (char**) &global_system_variables.max_heap_table_size,
2032
1985
   (char**) &max_system_variables.read_rnd_buff_size, 0,
2033
1986
   GET_UINT, REQUIRED_ARG, 256*1024L, 64 /*IO_SIZE*2+MALLOC_OVERHEAD*/ ,
2034
1987
   UINT32_MAX, MALLOC_OVERHEAD, 1 /* Small lower limit to be able to test MRR */, 0},
2035
 
  {"scheduler", OPT_SCHEDULER,
2036
 
   N_("Select scheduler to be used (by default multi-thread)."),
2037
 
   (char**)&opt_scheduler, (char**)&opt_scheduler,
2038
 
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2039
1988
  /* x8 compared to MySQL's x2. We have UTF8 to consider. */
2040
1989
  {"sort_buffer_size", OPT_SORT_BUFFER,
2041
1990
   N_("Each thread that needs to do a sort allocates a buffer of this size."),
2234
2183
      (vm["sort-heap-threshold"].as<uint64_t>() < 
2235
2184
      global_system_variables.sortbuff_size))
2236
2185
    {
2237
 
      cout << N_("Error: sort-heap-threshold cannot be less than sort-buffer-size") << endl;
 
2186
      cout << _("Error: sort-heap-threshold cannot be less than sort-buffer-size") << endl;
2238
2187
      exit(-1);
2239
2188
    }
2240
2189
 
2247
2196
      (vm["join-heap-threshold"].as<uint64_t>() <
2248
2197
      global_system_variables.join_buff_size))
2249
2198
    {
2250
 
      cout << N_("Error: join-heap-threshold cannot be less than join-buffer-size") << endl;
 
2199
      cout << _("Error: join-heap-threshold cannot be less than join-buffer-size") << endl;
2251
2200
      exit(-1);
2252
2201
    }
2253
2202
 
2260
2209
      (vm["read-rnd-threshold"].as<uint64_t>() <
2261
2210
      global_system_variables.read_rnd_buff_size))
2262
2211
    {
2263
 
      cout << N_("Error: read-rnd-threshold cannot be less than read-rnd-buffer-size") << endl;
 
2212
      cout << _("Error: read-rnd-threshold cannot be less than read-rnd-buffer-size") << endl;
2264
2213
      exit(-1);
2265
2214
    }
2266
2215
 
2273
2222
      (vm["read-buffer-threshold"].as<uint64_t>() <
2274
2223
      global_system_variables.read_buff_size))
2275
2224
    {
2276
 
      cout << N_("Error: read-buffer-threshold cannot be less than read-buffer-size") << endl;
 
2225
      cout << _("Error: read-buffer-threshold cannot be less than read-buffer-size") << endl;
2277
2226
      exit(-1);
2278
2227
    }
2279
2228