2003-07-06 18:09:57 +02:00
|
|
|
/* Copyright (C) 2000-2003 MySQL AB
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2006-12-23 20:17:15 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
|
|
/*
|
|
|
|
Handling of MySQL SQL variables
|
|
|
|
|
|
|
|
To add a new variable, one has to do the following:
|
|
|
|
|
|
|
|
- Use one of the 'sys_var... classes from set_var.h or write a specific
|
|
|
|
one for the variable type.
|
|
|
|
- Define it in the 'variable definition list' in this file.
|
2002-10-02 12:33:08 +02:00
|
|
|
- If the variable should be changeable or one should be able to access it
|
|
|
|
with @@variable_name, it should be added to the 'list of all variables'
|
2004-04-28 12:08:54 +02:00
|
|
|
list (sys_variables) in this file.
|
|
|
|
- If the variable is thread specific, add it to 'system_variables' struct.
|
|
|
|
If not, add it to mysqld.cc and an declaration in 'mysql_priv.h'
|
2002-07-23 17:31:22 +02:00
|
|
|
- If the variable should be changed from the command line, add a definition
|
2005-01-21 17:38:46 +01:00
|
|
|
of it in the my_option structure list in mysqld.cc
|
2004-04-28 12:08:54 +02:00
|
|
|
- Don't forget to initialize new fields in global_system_variables and
|
|
|
|
max_system_variables!
|
2002-07-23 17:31:22 +02:00
|
|
|
- If the variable should show up in 'show variables' add it to the
|
|
|
|
init_vars[] struct in this file
|
|
|
|
|
2004-08-16 17:00:48 +02:00
|
|
|
NOTES:
|
|
|
|
- Be careful with var->save_result: sys_var::check() only updates
|
|
|
|
ulonglong_value; so other members of the union are garbage then; to use
|
|
|
|
them you must first assign a value to them (in specific ::check() for
|
|
|
|
example).
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
TODO:
|
|
|
|
- Add full support for the variable character_set (for 4.1)
|
|
|
|
|
|
|
|
- When updating myisam_delay_key_write, we should do a 'flush tables'
|
|
|
|
of all MyISAM tables to ensure that they are reopen with the
|
|
|
|
new attribute.
|
|
|
|
*/
|
|
|
|
|
2005-05-26 12:09:14 +02:00
|
|
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
2002-07-23 17:31:22 +02:00
|
|
|
#pragma implementation // gcc: Class implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "mysql_priv.h"
|
2002-12-16 14:33:29 +01:00
|
|
|
#include <mysql.h>
|
2002-07-23 17:31:22 +02:00
|
|
|
#include "slave.h"
|
|
|
|
#include <my_getopt.h>
|
2003-10-16 06:44:18 +02:00
|
|
|
#include <thr_alarm.h>
|
2002-07-23 17:31:22 +02:00
|
|
|
#include <myisam.h>
|
2006-07-04 14:40:40 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
#ifdef HAVE_BERKELEY_DB
|
|
|
|
#include "ha_berkeley.h"
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_INNOBASE_DB
|
|
|
|
#include "ha_innodb.h"
|
|
|
|
#endif
|
2004-04-15 09:14:14 +02:00
|
|
|
#ifdef HAVE_NDBCLUSTER_DB
|
|
|
|
#include "ha_ndbcluster.h"
|
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
static HASH system_variable_hash;
|
|
|
|
const char *bool_type_names[]= { "OFF", "ON", NullS };
|
|
|
|
TYPELIB bool_typelib=
|
|
|
|
{
|
2004-10-25 14:51:26 +02:00
|
|
|
array_elements(bool_type_names)-1, "", bool_type_names, NULL
|
2002-07-23 17:31:22 +02:00
|
|
|
};
|
|
|
|
|
2002-08-13 01:18:39 +02:00
|
|
|
const char *delay_key_write_type_names[]= { "OFF", "ON", "ALL", NullS };
|
|
|
|
TYPELIB delay_key_write_typelib=
|
|
|
|
{
|
2004-10-25 14:51:26 +02:00
|
|
|
array_elements(delay_key_write_type_names)-1, "",
|
|
|
|
delay_key_write_type_names, NULL
|
2002-08-13 01:18:39 +02:00
|
|
|
};
|
|
|
|
|
2004-04-28 12:08:54 +02:00
|
|
|
static int sys_check_ftb_syntax(THD *thd, set_var *var);
|
|
|
|
static bool sys_update_ftb_syntax(THD *thd, set_var * var);
|
|
|
|
static void sys_default_ftb_syntax(THD *thd, enum_var_type type);
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
static bool sys_update_init_connect(THD*, set_var*);
|
|
|
|
static void sys_default_init_connect(THD*, enum_var_type type);
|
|
|
|
static bool sys_update_init_slave(THD*, set_var*);
|
|
|
|
static void sys_default_init_slave(THD*, enum_var_type type);
|
2002-07-23 17:31:22 +02:00
|
|
|
static bool set_option_bit(THD *thd, set_var *var);
|
|
|
|
static bool set_option_autocommit(THD *thd, set_var *var);
|
2004-04-28 12:08:54 +02:00
|
|
|
static int check_log_update(THD *thd, set_var *var);
|
2002-07-23 17:31:22 +02:00
|
|
|
static bool set_log_update(THD *thd, set_var *var);
|
2004-04-28 12:08:54 +02:00
|
|
|
static int check_pseudo_thread_id(THD *thd, set_var *var);
|
2003-04-02 00:15:20 +02:00
|
|
|
static bool set_log_bin(THD *thd, set_var *var);
|
2002-07-23 17:31:22 +02:00
|
|
|
static void fix_low_priority_updates(THD *thd, enum_var_type type);
|
|
|
|
static void fix_tx_isolation(THD *thd, enum_var_type type);
|
2005-02-01 20:48:05 +01:00
|
|
|
static int check_completion_type(THD *thd, set_var *var);
|
|
|
|
static void fix_completion_type(THD *thd, enum_var_type type);
|
2002-07-23 17:31:22 +02:00
|
|
|
static void fix_net_read_timeout(THD *thd, enum_var_type type);
|
|
|
|
static void fix_net_write_timeout(THD *thd, enum_var_type type);
|
2002-08-08 19:49:06 +02:00
|
|
|
static void fix_net_retry_count(THD *thd, enum_var_type type);
|
2002-07-23 17:31:22 +02:00
|
|
|
static void fix_max_join_size(THD *thd, enum_var_type type);
|
|
|
|
static void fix_query_cache_size(THD *thd, enum_var_type type);
|
2003-03-02 20:39:03 +01:00
|
|
|
static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type);
|
2003-05-13 18:34:51 +02:00
|
|
|
static void fix_myisam_max_sort_file_size(THD *thd, enum_var_type type);
|
2003-07-06 17:59:54 +02:00
|
|
|
static void fix_max_binlog_size(THD *thd, enum_var_type type);
|
|
|
|
static void fix_max_relay_log_size(THD *thd, enum_var_type type);
|
2003-10-06 14:11:16 +02:00
|
|
|
static void fix_max_connections(THD *thd, enum_var_type type);
|
2004-04-09 18:50:28 +02:00
|
|
|
static int check_max_delayed_threads(THD *thd, set_var *var);
|
2004-04-28 12:08:54 +02:00
|
|
|
static void fix_thd_mem_root(THD *thd, enum_var_type type);
|
|
|
|
static void fix_trans_mem_root(THD *thd, enum_var_type type);
|
2004-05-19 15:03:32 +02:00
|
|
|
static void fix_server_id(THD *thd, enum_var_type type);
|
2003-11-20 21:06:25 +01:00
|
|
|
static KEY_CACHE *create_key_cache(const char *name, uint length);
|
2003-06-04 17:28:51 +02:00
|
|
|
void fix_sql_mode_var(THD *thd, enum_var_type type);
|
2002-10-02 12:33:08 +02:00
|
|
|
static byte *get_error_count(THD *thd);
|
|
|
|
static byte *get_warning_count(THD *thd);
|
2005-08-26 10:23:32 +02:00
|
|
|
static byte *get_have_innodb(THD *thd);
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
static byte *get_tmpdir(THD *thd);
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
Variable definition list
|
|
|
|
|
|
|
|
These are variables that can be set from the command line, in
|
|
|
|
alphabetic order
|
|
|
|
*/
|
|
|
|
|
2004-09-15 21:10:31 +02:00
|
|
|
sys_var_thd_ulong sys_auto_increment_increment("auto_increment_increment",
|
|
|
|
&SV::auto_increment_increment);
|
|
|
|
sys_var_thd_ulong sys_auto_increment_offset("auto_increment_offset",
|
|
|
|
&SV::auto_increment_offset);
|
|
|
|
|
2004-12-23 11:46:24 +01:00
|
|
|
sys_var_bool_ptr sys_automatic_sp_privileges("automatic_sp_privileges",
|
|
|
|
&sp_automatic_privileges);
|
|
|
|
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
sys_var_const_str sys_basedir("basedir", mysql_home);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_binlog_cache_size("binlog_cache_size",
|
|
|
|
&binlog_cache_size);
|
|
|
|
sys_var_thd_ulong sys_bulk_insert_buff_size("bulk_insert_buffer_size",
|
|
|
|
&SV::bulk_insert_buff_size);
|
2003-05-30 10:03:56 +02:00
|
|
|
sys_var_character_set_server sys_character_set_server("character_set_server");
|
2005-09-07 12:38:09 +02:00
|
|
|
sys_var_const_str sys_charset_system("character_set_system",
|
|
|
|
(char *)my_charset_utf8_general_ci.name);
|
2003-05-30 10:03:56 +02:00
|
|
|
sys_var_character_set_database sys_character_set_database("character_set_database");
|
2003-05-21 14:44:12 +02:00
|
|
|
sys_var_character_set_client sys_character_set_client("character_set_client");
|
2003-05-30 10:24:24 +02:00
|
|
|
sys_var_character_set_connection sys_character_set_connection("character_set_connection");
|
2003-05-21 14:44:12 +02:00
|
|
|
sys_var_character_set_results sys_character_set_results("character_set_results");
|
2006-02-14 05:24:01 +01:00
|
|
|
sys_var_character_set_filesystem sys_character_set_filesystem("character_set_filesystem");
|
2005-02-01 20:48:05 +01:00
|
|
|
sys_var_thd_ulong sys_completion_type("completion_type",
|
|
|
|
&SV::completion_type,
|
|
|
|
check_completion_type,
|
|
|
|
fix_completion_type);
|
2003-04-23 15:19:22 +02:00
|
|
|
sys_var_collation_connection sys_collation_connection("collation_connection");
|
2003-09-15 13:31:04 +02:00
|
|
|
sys_var_collation_database sys_collation_database("collation_database");
|
|
|
|
sys_var_collation_server sys_collation_server("collation_server");
|
2005-05-13 11:08:08 +02:00
|
|
|
sys_var_long_ptr sys_concurrent_insert("concurrent_insert",
|
|
|
|
&myisam_concurrent_insert);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_connect_timeout("connect_timeout",
|
|
|
|
&connect_timeout);
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
sys_var_const_str sys_datadir("datadir", mysql_real_data_home);
|
2002-08-13 01:18:39 +02:00
|
|
|
sys_var_enum sys_delay_key_write("delay_key_write",
|
|
|
|
&delay_key_write_options,
|
|
|
|
&delay_key_write_typelib,
|
|
|
|
fix_delay_key_write);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_delayed_insert_limit("delayed_insert_limit",
|
|
|
|
&delayed_insert_limit);
|
|
|
|
sys_var_long_ptr sys_delayed_insert_timeout("delayed_insert_timeout",
|
|
|
|
&delayed_insert_timeout);
|
|
|
|
sys_var_long_ptr sys_delayed_queue_size("delayed_queue_size",
|
|
|
|
&delayed_queue_size);
|
2003-03-11 10:49:06 +01:00
|
|
|
sys_var_long_ptr sys_expire_logs_days("expire_logs_days",
|
|
|
|
&expire_logs_days);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_bool_ptr sys_flush("flush", &myisam_flush);
|
|
|
|
sys_var_long_ptr sys_flush_time("flush_time", &flush_time);
|
2004-04-28 12:08:54 +02:00
|
|
|
sys_var_str sys_ft_boolean_syntax("ft_boolean_syntax",
|
|
|
|
sys_check_ftb_syntax,
|
|
|
|
sys_update_ftb_syntax,
|
|
|
|
sys_default_ftb_syntax,
|
|
|
|
ft_boolean_syntax);
|
|
|
|
sys_var_str sys_init_connect("init_connect", 0,
|
|
|
|
sys_update_init_connect,
|
|
|
|
sys_default_init_connect,0);
|
|
|
|
sys_var_str sys_init_slave("init_slave", 0,
|
|
|
|
sys_update_init_slave,
|
|
|
|
sys_default_init_slave,0);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_interactive_timeout("interactive_timeout",
|
|
|
|
&SV::net_interactive_timeout);
|
|
|
|
sys_var_thd_ulong sys_join_buffer_size("join_buffer_size",
|
|
|
|
&SV::join_buff_size);
|
2003-07-06 18:09:57 +02:00
|
|
|
sys_var_key_buffer_size sys_key_buffer_size("key_buffer_size");
|
2003-11-18 12:47:27 +01:00
|
|
|
sys_var_key_cache_long sys_key_cache_block_size("key_cache_block_size",
|
2003-11-20 21:06:25 +01:00
|
|
|
offsetof(KEY_CACHE,
|
|
|
|
param_block_size));
|
2003-11-18 12:47:27 +01:00
|
|
|
sys_var_key_cache_long sys_key_cache_division_limit("key_cache_division_limit",
|
2003-11-20 21:06:25 +01:00
|
|
|
offsetof(KEY_CACHE,
|
|
|
|
param_division_limit));
|
2003-11-18 12:47:27 +01:00
|
|
|
sys_var_key_cache_long sys_key_cache_age_threshold("key_cache_age_threshold",
|
2003-11-20 21:06:25 +01:00
|
|
|
offsetof(KEY_CACHE,
|
|
|
|
param_age_threshold));
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_bool_ptr sys_local_infile("local_infile",
|
|
|
|
&opt_local_infile);
|
2007-10-25 12:02:27 +02:00
|
|
|
sys_var_bool_const_ptr sys_log("log", &opt_log);
|
2005-11-10 17:50:51 +01:00
|
|
|
sys_var_trust_routine_creators
|
Approximative fixes for BUG#2610,2611,9100 i.e. WL#2146 binlogging/replication of routines (stored procs and functions).
Approximative, because it's using our binlogging way (what we call "query"-level) and this is not as good as record-level binlog (5.1) would be. It imposes several
limitations to routines, and has caveats (which I'll document, and for which the server will try to issue errors but that is not always possible).
Reason I don't propagate caller info to the binlog as planned is that on master and slave
users may be different; even with that some caveats would remain.
mysql-test/mysql-test-run.sh:
In the testsuite we know what we do, we are not creating nasty routines, and breaking binlog is ok except in rpl_sp.
mysql-test/r/blackhole.result:
Updating results now that 4.1 has been merged
mysql-test/valgrind.supp:
Some suppressions for Valgrind (useful on my machine Suse 9.1);
this is just adding to the already existing suppressions of pthread and dl.
sql/item_func.cc:
Don't binlog the substatements when executing a function. If the function
is declared to modify data and does not complete, warning "broken binlog".
Note that SELECT myfunc() will not be binlogged even if myfunc() updates data (will be documented);
but INSERT INTO t VALUES(myfunc()) will be binlogged (what decides is if the caller
gets binlogged; the function changes nothing to binlogging).
sql/log_event.cc:
Just making functions which can be re-used when we binlog more strings
in status_vars in Query_log_event (e.g. one day "user", "host").
sql/log_event.h:
comment
sql/mysql_priv.h:
--log-bin-trust-routine-creators
sql/mysqld.cc:
--log-bin-trust-routine-creators
sql/set_var.cc:
--log-bin-trust-routine-creators
sql/share/errmsg.txt:
error messages to warn about problems with routines and binlog
sql/slave.cc:
If in a routine, replication table inclusion/exclusion rules always answer "replicate!" (see comment in code).
sql/sp.cc:
If binlog is on: errors if one wants to create a non-deterministic update routine
(repeatability problem - note that the test is not perfect for functions) or does not have SUPER (because routines can easily
be made to destroy slave's data with just CREATE ROUTINE and EXECUTE priv on master).
--log-bin-trust-routine-creators removes these errors.
Binlogging of CREATE PROCEDURE|FUNCTION.
sql/sql_acl.cc:
No thd==0 in tables_ok().
sql/sql_parse.cc:
Binlogging of CALL (and not of the substatements of the SP).
If SP returns error, we don't binlog it (see comment); we push warning in this case.
Binlogging of ALTER|DROP PROCEDURE|FUNCTION with safety messages.
2005-05-05 14:20:53 +02:00
|
|
|
sys_trust_routine_creators("log_bin_trust_routine_creators",
|
2005-11-10 17:50:51 +01:00
|
|
|
&trust_function_creators);
|
2006-04-13 09:50:33 +02:00
|
|
|
sys_var_bool_ptr
|
2005-11-10 17:50:51 +01:00
|
|
|
sys_trust_function_creators("log_bin_trust_function_creators",
|
|
|
|
&trust_function_creators);
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
sys_var_bool_ptr
|
|
|
|
sys_log_queries_not_using_indexes("log_queries_not_using_indexes",
|
|
|
|
&opt_log_queries_not_using_indexes);
|
2004-06-01 16:29:24 +02:00
|
|
|
sys_var_thd_ulong sys_log_warnings("log_warnings", &SV::log_warnings);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_long_query_time("long_query_time",
|
|
|
|
&SV::long_query_time);
|
2007-10-25 12:02:27 +02:00
|
|
|
sys_var_bool_const_ptr sys_log_slow("log_slow_queries", &opt_slow_log);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_bool sys_low_priority_updates("low_priority_updates",
|
|
|
|
&SV::low_priority_updates,
|
|
|
|
fix_low_priority_updates);
|
|
|
|
#ifndef TO_BE_DELETED /* Alias for the low_priority_updates */
|
|
|
|
sys_var_thd_bool sys_sql_low_priority_updates("sql_low_priority_updates",
|
|
|
|
&SV::low_priority_updates,
|
|
|
|
fix_low_priority_updates);
|
|
|
|
#endif
|
|
|
|
sys_var_thd_ulong sys_max_allowed_packet("max_allowed_packet",
|
|
|
|
&SV::max_allowed_packet);
|
|
|
|
sys_var_long_ptr sys_max_binlog_cache_size("max_binlog_cache_size",
|
|
|
|
&max_binlog_cache_size);
|
|
|
|
sys_var_long_ptr sys_max_binlog_size("max_binlog_size",
|
2003-07-06 17:59:54 +02:00
|
|
|
&max_binlog_size,
|
|
|
|
fix_max_binlog_size);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_max_connections("max_connections",
|
2003-10-06 14:11:16 +02:00
|
|
|
&max_connections,
|
|
|
|
fix_max_connections);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_max_connect_errors("max_connect_errors",
|
|
|
|
&max_connect_errors);
|
2004-04-28 12:08:54 +02:00
|
|
|
sys_var_thd_ulong sys_max_insert_delayed_threads("max_insert_delayed_threads",
|
2004-04-09 18:50:28 +02:00
|
|
|
&SV::max_insert_delayed_threads,
|
|
|
|
check_max_delayed_threads,
|
|
|
|
fix_max_connections);
|
2004-04-28 12:08:54 +02:00
|
|
|
sys_var_thd_ulong sys_max_delayed_threads("max_delayed_threads",
|
|
|
|
&SV::max_insert_delayed_threads,
|
2004-04-09 18:50:28 +02:00
|
|
|
check_max_delayed_threads,
|
|
|
|
fix_max_connections);
|
2002-10-02 12:33:08 +02:00
|
|
|
sys_var_thd_ulong sys_max_error_count("max_error_count",
|
|
|
|
&SV::max_error_count);
|
2006-11-27 23:47:21 +01:00
|
|
|
sys_var_thd_ulonglong sys_max_heap_table_size("max_heap_table_size",
|
2002-07-23 17:31:22 +02:00
|
|
|
&SV::max_heap_table_size);
|
2004-04-28 12:08:54 +02:00
|
|
|
sys_var_thd_ulong sys_pseudo_thread_id("pseudo_thread_id",
|
|
|
|
&SV::pseudo_thread_id,
|
|
|
|
check_pseudo_thread_id, 0);
|
2002-12-20 13:58:27 +01:00
|
|
|
sys_var_thd_ha_rows sys_max_join_size("max_join_size",
|
2002-07-23 17:31:22 +02:00
|
|
|
&SV::max_join_size,
|
|
|
|
fix_max_join_size);
|
2003-06-27 02:04:54 +02:00
|
|
|
sys_var_thd_ulong sys_max_seeks_for_key("max_seeks_for_key",
|
|
|
|
&SV::max_seeks_for_key);
|
2003-04-24 13:33:33 +02:00
|
|
|
sys_var_thd_ulong sys_max_length_for_sort_data("max_length_for_sort_data",
|
2004-04-28 12:08:54 +02:00
|
|
|
&SV::max_length_for_sort_data);
|
2002-07-23 17:31:22 +02:00
|
|
|
#ifndef TO_BE_DELETED /* Alias for max_join_size */
|
2002-12-20 13:58:27 +01:00
|
|
|
sys_var_thd_ha_rows sys_sql_max_join_size("sql_max_join_size",
|
2002-07-23 17:31:22 +02:00
|
|
|
&SV::max_join_size,
|
|
|
|
fix_max_join_size);
|
|
|
|
#endif
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
static sys_var_long_ptr_global
|
|
|
|
sys_max_prepared_stmt_count("max_prepared_stmt_count",
|
|
|
|
&max_prepared_stmt_count,
|
|
|
|
&LOCK_prepared_stmt_count);
|
2003-07-06 17:59:54 +02:00
|
|
|
sys_var_long_ptr sys_max_relay_log_size("max_relay_log_size",
|
|
|
|
&max_relay_log_size,
|
|
|
|
fix_max_relay_log_size);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_max_sort_length("max_sort_length",
|
|
|
|
&SV::max_sort_length);
|
2005-11-23 00:11:19 +01:00
|
|
|
sys_var_thd_ulong sys_max_sp_recursion_depth("max_sp_recursion_depth",
|
|
|
|
&SV::max_sp_recursion_depth);
|
2004-12-29 18:30:37 +01:00
|
|
|
sys_var_max_user_conn sys_max_user_connections("max_user_connections");
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_max_tmp_tables("max_tmp_tables",
|
|
|
|
&SV::max_tmp_tables);
|
|
|
|
sys_var_long_ptr sys_max_write_lock_count("max_write_lock_count",
|
|
|
|
&max_write_lock_count);
|
2004-12-23 21:45:10 +01:00
|
|
|
sys_var_thd_ulong sys_multi_range_count("multi_range_count",
|
|
|
|
&SV::multi_range_count);
|
2004-05-01 15:41:59 +02:00
|
|
|
sys_var_long_ptr sys_myisam_data_pointer_size("myisam_data_pointer_size",
|
|
|
|
&myisam_data_pointer_size);
|
2003-05-13 18:34:51 +02:00
|
|
|
sys_var_thd_ulonglong sys_myisam_max_sort_file_size("myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
|
2003-05-04 18:43:37 +02:00
|
|
|
sys_var_thd_ulong sys_myisam_repair_threads("myisam_repair_threads", &SV::myisam_repair_threads);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_myisam_sort_buffer_size("myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
|
2005-09-21 00:18:29 +02:00
|
|
|
|
|
|
|
sys_var_thd_enum sys_myisam_stats_method("myisam_stats_method",
|
|
|
|
&SV::myisam_stats_method,
|
|
|
|
&myisam_stats_method_typelib,
|
|
|
|
NULL);
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_net_buffer_length("net_buffer_length",
|
|
|
|
&SV::net_buffer_length);
|
|
|
|
sys_var_thd_ulong sys_net_read_timeout("net_read_timeout",
|
|
|
|
&SV::net_read_timeout,
|
2004-04-28 12:08:54 +02:00
|
|
|
0, fix_net_read_timeout);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_net_write_timeout("net_write_timeout",
|
|
|
|
&SV::net_write_timeout,
|
2004-04-28 12:08:54 +02:00
|
|
|
0, fix_net_write_timeout);
|
2002-08-08 19:49:06 +02:00
|
|
|
sys_var_thd_ulong sys_net_retry_count("net_retry_count",
|
|
|
|
&SV::net_retry_count,
|
2004-04-28 12:08:54 +02:00
|
|
|
0, fix_net_retry_count);
|
2003-03-05 18:43:56 +01:00
|
|
|
sys_var_thd_bool sys_new_mode("new", &SV::new_mode);
|
2003-07-08 00:36:14 +02:00
|
|
|
sys_var_thd_bool sys_old_passwords("old_passwords", &SV::old_passwords);
|
2004-05-20 16:47:43 +02:00
|
|
|
sys_var_thd_ulong sys_optimizer_prune_level("optimizer_prune_level",
|
|
|
|
&SV::optimizer_prune_level);
|
|
|
|
sys_var_thd_ulong sys_optimizer_search_depth("optimizer_search_depth",
|
|
|
|
&SV::optimizer_search_depth);
|
2003-06-12 13:29:02 +02:00
|
|
|
sys_var_thd_ulong sys_preload_buff_size("preload_buffer_size",
|
|
|
|
&SV::preload_buff_size);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
|
|
|
|
&SV::read_buff_size);
|
2003-05-26 10:47:03 +02:00
|
|
|
sys_var_bool_ptr sys_readonly("read_only", &opt_readonly);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size",
|
|
|
|
&SV::read_rnd_buff_size);
|
2005-05-05 17:06:49 +02:00
|
|
|
sys_var_thd_ulong sys_div_precincrement("div_precision_increment",
|
|
|
|
&SV::div_precincrement);
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
#ifdef HAVE_REPLICATION
|
|
|
|
sys_var_bool_ptr sys_relay_log_purge("relay_log_purge",
|
|
|
|
&relay_log_purge);
|
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_rpl_recovery_rank("rpl_recovery_rank",
|
|
|
|
&rpl_recovery_rank);
|
|
|
|
sys_var_long_ptr sys_query_cache_size("query_cache_size",
|
|
|
|
&query_cache_size,
|
|
|
|
fix_query_cache_size);
|
2003-10-11 21:00:24 +02:00
|
|
|
|
|
|
|
sys_var_thd_ulong sys_range_alloc_block_size("range_alloc_block_size",
|
|
|
|
&SV::range_alloc_block_size);
|
|
|
|
sys_var_thd_ulong sys_query_alloc_block_size("query_alloc_block_size",
|
2004-04-28 12:08:54 +02:00
|
|
|
&SV::query_alloc_block_size,
|
|
|
|
0, fix_thd_mem_root);
|
2003-10-11 21:00:24 +02:00
|
|
|
sys_var_thd_ulong sys_query_prealloc_size("query_prealloc_size",
|
2004-04-28 12:08:54 +02:00
|
|
|
&SV::query_prealloc_size,
|
|
|
|
0, fix_thd_mem_root);
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
sys_var_readonly sys_tmpdir("tmpdir", OPT_GLOBAL, SHOW_CHAR, get_tmpdir);
|
2003-10-11 21:00:24 +02:00
|
|
|
sys_var_thd_ulong sys_trans_alloc_block_size("transaction_alloc_block_size",
|
2004-04-28 12:08:54 +02:00
|
|
|
&SV::trans_alloc_block_size,
|
|
|
|
0, fix_trans_mem_root);
|
2003-10-11 21:00:24 +02:00
|
|
|
sys_var_thd_ulong sys_trans_prealloc_size("transaction_prealloc_size",
|
2004-04-28 12:08:54 +02:00
|
|
|
&SV::trans_prealloc_size,
|
|
|
|
0, fix_trans_mem_root);
|
2003-10-11 21:00:24 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
#ifdef HAVE_QUERY_CACHE
|
|
|
|
sys_var_long_ptr sys_query_cache_limit("query_cache_limit",
|
|
|
|
&query_cache.query_cache_limit);
|
2003-03-02 20:39:03 +01:00
|
|
|
sys_var_long_ptr sys_query_cache_min_res_unit("query_cache_min_res_unit",
|
|
|
|
&query_cache_min_res_unit,
|
|
|
|
fix_query_cache_min_res_unit);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_enum sys_query_cache_type("query_cache_type",
|
|
|
|
&SV::query_cache_type,
|
|
|
|
&query_cache_type_typelib);
|
2004-04-28 12:08:54 +02:00
|
|
|
sys_var_thd_bool
|
|
|
|
sys_query_cache_wlock_invalidate("query_cache_wlock_invalidate",
|
|
|
|
&SV::query_cache_wlock_invalidate);
|
2002-07-23 17:31:22 +02:00
|
|
|
#endif /* HAVE_QUERY_CACHE */
|
2003-07-08 00:36:14 +02:00
|
|
|
sys_var_bool_ptr sys_secure_auth("secure_auth", &opt_secure_auth);
|
2007-02-14 14:44:34 +01:00
|
|
|
sys_var_const_str_ptr sys_secure_file_priv("secure_file_priv",
|
|
|
|
&opt_secure_file_priv);
|
2004-05-19 15:03:32 +02:00
|
|
|
sys_var_long_ptr sys_server_id("server_id", &server_id, fix_server_id);
|
2002-08-08 02:12:02 +02:00
|
|
|
sys_var_bool_ptr sys_slave_compressed_protocol("slave_compressed_protocol",
|
|
|
|
&opt_slave_compressed_protocol);
|
2003-01-15 09:11:44 +01:00
|
|
|
#ifdef HAVE_REPLICATION
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_slave_net_timeout("slave_net_timeout",
|
|
|
|
&slave_net_timeout);
|
2005-03-02 11:29:48 +01:00
|
|
|
sys_var_long_ptr sys_slave_trans_retries("slave_transaction_retries",
|
|
|
|
&slave_trans_retries);
|
2002-12-16 14:33:29 +01:00
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_slow_launch_time("slow_launch_time",
|
|
|
|
&slow_launch_time);
|
|
|
|
sys_var_thd_ulong sys_sort_buffer("sort_buffer_size",
|
|
|
|
&SV::sortbuff_size);
|
2003-01-16 01:04:50 +01:00
|
|
|
sys_var_thd_sql_mode sys_sql_mode("sql_mode",
|
|
|
|
&SV::sql_mode);
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
#ifdef HAVE_OPENSSL
|
|
|
|
extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher,
|
|
|
|
*opt_ssl_key;
|
|
|
|
sys_var_const_str_ptr sys_ssl_ca("ssl_ca", &opt_ssl_ca);
|
|
|
|
sys_var_const_str_ptr sys_ssl_capath("ssl_capath", &opt_ssl_capath);
|
|
|
|
sys_var_const_str_ptr sys_ssl_cert("ssl_cert", &opt_ssl_cert);
|
|
|
|
sys_var_const_str_ptr sys_ssl_cipher("ssl_cipher", &opt_ssl_cipher);
|
|
|
|
sys_var_const_str_ptr sys_ssl_key("ssl_key", &opt_ssl_key);
|
|
|
|
#else
|
|
|
|
sys_var_const_str sys_ssl_ca("ssl_ca", NULL);
|
|
|
|
sys_var_const_str sys_ssl_capath("ssl_capath", NULL);
|
|
|
|
sys_var_const_str sys_ssl_cert("ssl_cert", NULL);
|
|
|
|
sys_var_const_str sys_ssl_cipher("ssl_cipher", NULL);
|
|
|
|
sys_var_const_str sys_ssl_key("ssl_key", NULL);
|
|
|
|
#endif
|
2004-10-07 11:13:42 +02:00
|
|
|
sys_var_thd_enum
|
|
|
|
sys_updatable_views_with_limit("updatable_views_with_limit",
|
|
|
|
&SV::updatable_views_with_limit,
|
|
|
|
&updatable_views_with_limit_typelib);
|
2004-07-16 00:15:55 +02:00
|
|
|
|
2003-12-02 21:23:13 +01:00
|
|
|
sys_var_thd_table_type sys_table_type("table_type",
|
|
|
|
&SV::table_type);
|
2003-12-17 23:52:03 +01:00
|
|
|
sys_var_thd_storage_engine sys_storage_engine("storage_engine",
|
|
|
|
&SV::table_type);
|
2006-04-26 17:55:26 +02:00
|
|
|
#ifdef HAVE_REPLICATION
|
|
|
|
sys_var_sync_binlog_period sys_sync_binlog_period("sync_binlog", &sync_binlog_period);
|
|
|
|
#endif
|
2004-06-10 15:56:13 +02:00
|
|
|
sys_var_bool_ptr sys_sync_frm("sync_frm", &opt_sync_frm);
|
2006-04-21 06:56:53 +02:00
|
|
|
sys_var_const_str sys_system_time_zone("system_time_zone",
|
|
|
|
system_time_zone);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_table_cache_size("table_cache",
|
|
|
|
&table_cache_size);
|
A fix and a test case for Bug#10760 and complementary cleanups.
The idea of the patch
is that every cursor gets its own lock id for table level locking.
Thus cursors are protected from updates performed within the same
connection. Additionally a list of transient (must be closed at
commit) cursors is maintained and all transient cursors are closed
when necessary. Lastly, this patch adds support for deadlock
timeouts to TLL locking when using cursors.
+ post-review fixes.
include/thr_lock.h:
- add a notion of lock owner to table level locking. When using
cursors, lock owner can not be identified by a thread id any more,
as we must protect cursors from updates issued within the same
connection (thread). So, each cursor has its own lock identifier to
use with table level locking.
- extend return values of thr_lock and thr_multi_lock with
THR_LOCK_TIMEOUT and THR_LOCK_DEADLOCK, since these conditions
are now possible (see comments to thr_lock.c)
mysys/thr_lock.c:
Better support for cursors:
- use THR_LOCK_OWNER * as lock identifier, not pthread_t.
- check and return an error for a trivial deadlock case, when an
update statement is issued to a table locked by a cursor which has
been previously opened in the same connection.
- add support for locking timeouts: with use of cursors, trivial
deadlocks can occur. For now the only remedy is the lock wait timeout,
which is initialized from a new global variable 'table_lock_wait_timeout'
Example of a deadlock (assuming the storage engine does not downgrade
locks):
con1: open cursor for select * from t1;
con2: open cursor for select * from t2;
con1: update t2 set id=id*2; -- blocked
con2: update t1 set id=id*2; -- deadlock
Lock timeouts are active only if a connection is using cursors.
- the check in the wait_for_lock loop has been changed from
data->cond != cond to data->cond != 0. data->cond is zeroed
in every place it's changed.
- added comments
sql/examples/ha_archive.cc:
- extend the handlerton with the info about cursor behaviour at commit.
sql/examples/ha_archive.h:
- ctor moved to .cc to make use of archive handlerton
sql/examples/ha_example.cc:
- add handlerton instance, init handler::ht with it
sql/examples/ha_example.h:
- ctor moved to .cc to make use of ha_example handlerton
sql/examples/ha_tina.cc:
- add handlerton instance, init handler::ht with it
sql/examples/ha_tina.h:
- ctor moved to .cc to make use of CSV handlerton
sql/ha_berkeley.cc:
- init handlerton::flags and handler::ht
sql/ha_berkeley.h:
- ctor moved to .cc to make use of BerkeleyDB handlerton
sql/ha_blackhole.cc:
- add handlerton instance, init handler::ht with it
sql/ha_blackhole.h:
- ctor moved to .cc to make use of blackhole handlerton
sql/ha_federated.cc:
- add handlerton instance, init handler::ht with it
sql/ha_federated.h:
- ctor moved to .cc to make use of federated handlerton
sql/ha_heap.cc:
- add handlerton instance, init handler::ht with it
sql/ha_heap.h:
- ctor moved to .cc to make use of ha_heap handlerton
sql/ha_innodb.cc:
- init handlerton::flags and handler::ht of innobase storage engine
sql/ha_innodb.h:
- ctor moved to .cc to make use of archive handlerton
sql/ha_myisam.cc:
- add handlerton instance, init handler::ht with it
sql/ha_myisam.h:
- ctor moved to .cc to make use of MyISAM handlerton
sql/ha_myisammrg.cc:
- init handler::ht in the ctor
sql/ha_myisammrg.h:
- ctor moved to .cc to make use of MyISAM MERGE handlerton
sql/ha_ndbcluster.cc:
- init handlerton::flags and handler::ht
sql/handler.cc:
- drop support for ISAM storage engine, which was removed from 5.0
- close all "transient" cursors at COMMIT/ROLLBACK. A "transient"
SQL level cursor is a cursor that uses tables that have a transaction-
specific state.
sql/handler.h:
- extend struct handlerton with flags, add handlerton *ht to every
handler instance.
sql/lock.cc:
- extend mysql_lock_tables to send error to the client if
thr_multi_lock returns a timeout or a deadlock error.
sql/mysqld.cc:
- add server option --table_lock_wait_timeout (in seconds)
sql/set_var.cc:
- add new global variable 'table_lock_wait_timeout' to specify
a wait timeout for table-level locks of MySQL (in seconds). The default
timeout is 50 seconds. The timeout is active only if the connection
has open cursors.
sql/sql_class.cc:
- implement Statement_map::close_transient_cursors
- safety suggests that we need an assert ensuring
llock_info->n_cursors is functioning properly, adjust destruction of
the Statement_map to allow such assert in THD::~THD
sql/sql_class.h:
- add support for Cursors registry to Statement map.
sql/sql_prepare.cc:
- maintain a list of cursors that must be closed at commit/rollback.
sql/sql_select.cc:
- extend class Cursor to support specific at-COMMIT/ROLLBACK behavior.
If a cursor uses tables of a storage engine that
invalidates all open tables at COMMIT/ROLLBACK, it must be closed
before COMMIT/ROLLBACK is executed.
sql/sql_select.h:
- add an own lock_id and commit/rollback status flag to class Cursor
tests/mysql_client_test.c:
A test case for Bug#10760 and complementary issues: test a simple
deadlock case too.
mysql-test/var:
New BitKeeper file ``mysql-test/var''
2005-07-19 20:21:12 +02:00
|
|
|
sys_var_long_ptr sys_table_lock_wait_timeout("table_lock_wait_timeout",
|
|
|
|
&table_lock_wait_timeout);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_long_ptr sys_thread_cache_size("thread_cache_size",
|
|
|
|
&thread_cache_size);
|
|
|
|
sys_var_thd_enum sys_tx_isolation("tx_isolation",
|
|
|
|
&SV::tx_isolation,
|
|
|
|
&tx_isolation_typelib,
|
|
|
|
fix_tx_isolation);
|
2006-11-27 23:47:21 +01:00
|
|
|
sys_var_thd_ulonglong sys_tmp_table_size("tmp_table_size",
|
2002-07-23 17:31:22 +02:00
|
|
|
&SV::tmp_table_size);
|
2004-12-24 13:31:21 +01:00
|
|
|
sys_var_bool_ptr sys_timed_mutexes("timed_mutexes",
|
|
|
|
&timed_mutexes);
|
2006-04-21 06:56:53 +02:00
|
|
|
sys_var_const_str sys_version("version", server_version);
|
|
|
|
#ifdef HAVE_BERKELEY_DB
|
|
|
|
sys_var_const_str sys_version_bdb("version_bdb", DB_VERSION_STRING);
|
|
|
|
#endif
|
|
|
|
sys_var_const_str sys_version_comment("version_comment",
|
|
|
|
MYSQL_COMPILATION_COMMENT);
|
|
|
|
sys_var_const_str sys_version_compile_machine("version_compile_machine",
|
|
|
|
MACHINE_TYPE);
|
|
|
|
sys_var_const_str sys_version_compile_os("version_compile_os",
|
|
|
|
SYSTEM_TYPE);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var_thd_ulong sys_net_wait_timeout("wait_timeout",
|
|
|
|
&SV::net_wait_timeout);
|
2003-11-03 13:01:59 +01:00
|
|
|
|
2003-05-04 12:41:21 +02:00
|
|
|
#ifdef HAVE_INNOBASE_DB
|
2005-04-15 18:00:38 +02:00
|
|
|
sys_var_long_ptr sys_innodb_fast_shutdown("innodb_fast_shutdown",
|
|
|
|
&innobase_fast_shutdown);
|
2003-05-04 12:41:21 +02:00
|
|
|
sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct",
|
|
|
|
&srv_max_buf_pool_modified_pct);
|
2004-10-27 12:33:11 +02:00
|
|
|
sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag",
|
|
|
|
&srv_max_purge_lag);
|
2004-10-20 10:24:08 +02:00
|
|
|
sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks",
|
|
|
|
&SV::innodb_table_locks);
|
2005-03-13 11:49:39 +01:00
|
|
|
sys_var_thd_bool sys_innodb_support_xa("innodb_support_xa",
|
|
|
|
&SV::innodb_support_xa);
|
2004-09-30 11:31:41 +02:00
|
|
|
sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment",
|
|
|
|
&srv_auto_extend_increment);
|
2005-01-05 12:43:48 +01:00
|
|
|
sys_var_long_ptr sys_innodb_sync_spin_loops("innodb_sync_spin_loops",
|
|
|
|
&srv_n_spin_wait_rounds);
|
2005-01-12 20:55:06 +01:00
|
|
|
sys_var_long_ptr sys_innodb_concurrency_tickets("innodb_concurrency_tickets",
|
2005-01-08 15:01:37 +01:00
|
|
|
&srv_n_free_tickets_to_enter);
|
|
|
|
sys_var_long_ptr sys_innodb_thread_sleep_delay("innodb_thread_sleep_delay",
|
|
|
|
&srv_thread_sleep_delay);
|
|
|
|
sys_var_long_ptr sys_innodb_thread_concurrency("innodb_thread_concurrency",
|
|
|
|
&srv_thread_concurrency);
|
2005-08-11 18:03:01 +02:00
|
|
|
sys_var_long_ptr sys_innodb_commit_concurrency("innodb_commit_concurrency",
|
|
|
|
&srv_commit_concurrency);
|
2006-01-18 13:02:03 +01:00
|
|
|
sys_var_long_ptr sys_innodb_flush_log_at_trx_commit(
|
|
|
|
"innodb_flush_log_at_trx_commit",
|
|
|
|
&srv_flush_log_at_trx_commit);
|
2004-04-28 12:08:54 +02:00
|
|
|
#endif
|
2004-12-09 11:47:20 +01:00
|
|
|
|
2005-02-11 22:05:24 +01:00
|
|
|
/* Condition pushdown to storage engine */
|
|
|
|
sys_var_thd_bool
|
|
|
|
sys_engine_condition_pushdown("engine_condition_pushdown",
|
|
|
|
&SV::engine_condition_pushdown);
|
|
|
|
|
2004-11-17 09:15:53 +01:00
|
|
|
#ifdef HAVE_NDBCLUSTER_DB
|
2004-12-09 11:47:20 +01:00
|
|
|
/* ndb thread specific variable settings */
|
2005-03-15 15:03:25 +01:00
|
|
|
sys_var_thd_ulong
|
2004-11-17 09:15:53 +01:00
|
|
|
sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz",
|
|
|
|
&SV::ndb_autoincrement_prefetch_sz);
|
|
|
|
sys_var_thd_bool
|
2004-12-09 11:47:20 +01:00
|
|
|
sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send);
|
2004-11-17 09:15:53 +01:00
|
|
|
sys_var_thd_bool
|
2004-12-09 11:47:20 +01:00
|
|
|
sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count);
|
2004-11-17 09:15:53 +01:00
|
|
|
sys_var_thd_bool
|
2004-12-09 11:47:20 +01:00
|
|
|
sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions);
|
2005-03-15 15:03:25 +01:00
|
|
|
sys_var_long_ptr
|
|
|
|
sys_ndb_cache_check_time("ndb_cache_check_time", &ndb_cache_check_time);
|
2007-03-12 19:08:35 +01:00
|
|
|
sys_var_const_str
|
|
|
|
sys_ndb_connectstring("ndb_connectstring", opt_ndb_constrbuf);
|
2004-11-17 09:15:53 +01:00
|
|
|
#endif
|
2003-11-03 13:01:59 +01:00
|
|
|
|
|
|
|
/* Time/date/datetime formats */
|
|
|
|
|
|
|
|
sys_var_thd_date_time_format sys_time_format("time_format",
|
|
|
|
&SV::time_format,
|
Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
MYSQL_TIMESTAMP_TIME);
|
2003-11-03 13:01:59 +01:00
|
|
|
sys_var_thd_date_time_format sys_date_format("date_format",
|
|
|
|
&SV::date_format,
|
Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
MYSQL_TIMESTAMP_DATE);
|
2003-11-03 13:01:59 +01:00
|
|
|
sys_var_thd_date_time_format sys_datetime_format("datetime_format",
|
|
|
|
&SV::datetime_format,
|
Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
MYSQL_TIMESTAMP_DATETIME);
|
2003-11-03 13:01:59 +01:00
|
|
|
|
|
|
|
/* Variables that are bits in THD */
|
2002-07-23 17:31:22 +02:00
|
|
|
|
2005-09-13 17:16:12 +02:00
|
|
|
sys_var_thd_bit sys_autocommit("autocommit", 0,
|
|
|
|
set_option_autocommit,
|
|
|
|
OPTION_NOT_AUTOCOMMIT,
|
|
|
|
1);
|
2004-04-28 12:08:54 +02:00
|
|
|
static sys_var_thd_bit sys_big_tables("big_tables", 0,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_BIG_TABLES);
|
|
|
|
#ifndef TO_BE_DELETED /* Alias for big_tables */
|
2004-04-28 12:08:54 +02:00
|
|
|
static sys_var_thd_bit sys_sql_big_tables("sql_big_tables", 0,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_BIG_TABLES);
|
|
|
|
#endif
|
2004-04-28 12:08:54 +02:00
|
|
|
static sys_var_thd_bit sys_big_selects("sql_big_selects", 0,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit,
|
2003-03-19 16:25:59 +01:00
|
|
|
OPTION_BIG_SELECTS);
|
2006-06-28 02:10:49 +02:00
|
|
|
static sys_var_thd_bit sys_log_off("sql_log_off",
|
|
|
|
check_log_update,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_LOG_OFF);
|
|
|
|
static sys_var_thd_bit sys_log_update("sql_log_update",
|
2004-04-28 12:08:54 +02:00
|
|
|
check_log_update,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_log_update,
|
|
|
|
OPTION_UPDATE_LOG);
|
|
|
|
static sys_var_thd_bit sys_log_binlog("sql_log_bin",
|
2004-04-28 12:08:54 +02:00
|
|
|
check_log_update,
|
|
|
|
set_log_bin,
|
|
|
|
OPTION_BIN_LOG);
|
|
|
|
static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_WARNINGS);
|
2005-02-21 18:40:28 +01:00
|
|
|
static sys_var_thd_bit sys_sql_notes("sql_notes", 0,
|
|
|
|
set_option_bit,
|
2005-02-22 12:40:31 +01:00
|
|
|
OPTION_SQL_NOTES);
|
2004-04-28 12:08:54 +02:00
|
|
|
static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_AUTO_IS_NULL);
|
2004-04-28 12:08:54 +02:00
|
|
|
static sys_var_thd_bit sys_safe_updates("sql_safe_updates", 0,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_SAFE_UPDATES);
|
2004-04-28 12:08:54 +02:00
|
|
|
static sys_var_thd_bit sys_buffer_results("sql_buffer_result", 0,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_BUFFER_RESULT);
|
2004-04-28 12:08:54 +02:00
|
|
|
static sys_var_thd_bit sys_quote_show_create("sql_quote_show_create", 0,
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_QUOTE_SHOW_CREATE);
|
2004-04-28 12:08:54 +02:00
|
|
|
static sys_var_thd_bit sys_foreign_key_checks("foreign_key_checks", 0,
|
2002-08-08 02:12:02 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_NO_FOREIGN_KEY_CHECKS,
|
|
|
|
1);
|
2004-04-28 12:08:54 +02:00
|
|
|
static sys_var_thd_bit sys_unique_checks("unique_checks", 0,
|
2002-08-08 02:12:02 +02:00
|
|
|
set_option_bit,
|
|
|
|
OPTION_RELAXED_UNIQUE_CHECKS,
|
|
|
|
1);
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/* Local state variables */
|
|
|
|
|
2002-12-20 13:58:27 +01:00
|
|
|
static sys_var_thd_ha_rows sys_select_limit("sql_select_limit",
|
2002-07-23 17:31:22 +02:00
|
|
|
&SV::select_limit);
|
|
|
|
static sys_var_timestamp sys_timestamp("timestamp");
|
|
|
|
static sys_var_last_insert_id sys_last_insert_id("last_insert_id");
|
|
|
|
static sys_var_last_insert_id sys_identity("identity");
|
2006-07-04 14:40:40 +02:00
|
|
|
|
|
|
|
static sys_var_thd_lc_time_names sys_lc_time_names("lc_time_names");
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
static sys_var_insert_id sys_insert_id("insert_id");
|
2002-10-02 12:33:08 +02:00
|
|
|
static sys_var_readonly sys_error_count("error_count",
|
|
|
|
OPT_SESSION,
|
|
|
|
SHOW_LONG,
|
|
|
|
get_error_count);
|
|
|
|
static sys_var_readonly sys_warning_count("warning_count",
|
|
|
|
OPT_SESSION,
|
|
|
|
SHOW_LONG,
|
|
|
|
get_warning_count);
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/* alias for last_insert_id() to be compatible with Sybase */
|
2003-01-15 09:11:44 +01:00
|
|
|
#ifdef HAVE_REPLICATION
|
2002-07-23 17:31:22 +02:00
|
|
|
static sys_var_slave_skip_counter sys_slave_skip_counter("sql_slave_skip_counter");
|
2002-12-16 14:33:29 +01:00
|
|
|
#endif
|
2002-11-07 03:02:37 +01:00
|
|
|
static sys_var_rand_seed1 sys_rand_seed1("rand_seed1");
|
|
|
|
static sys_var_rand_seed2 sys_rand_seed2("rand_seed2");
|
2002-07-23 17:31:22 +02:00
|
|
|
|
2003-02-19 13:05:35 +01:00
|
|
|
static sys_var_thd_ulong sys_default_week_format("default_week_format",
|
|
|
|
&SV::default_week_format);
|
2002-07-23 17:31:22 +02:00
|
|
|
|
2003-04-02 15:16:19 +02:00
|
|
|
sys_var_thd_ulong sys_group_concat_max_len("group_concat_max_len",
|
|
|
|
&SV::group_concat_max_len);
|
|
|
|
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
sys_var_thd_time_zone sys_time_zone("time_zone");
|
2004-04-28 12:08:54 +02:00
|
|
|
|
|
|
|
/* Read only variables */
|
|
|
|
|
2005-08-26 10:23:32 +02:00
|
|
|
sys_var_readonly sys_have_innodb("have_innodb", OPT_GLOBAL,
|
|
|
|
SHOW_CHAR, get_have_innodb);
|
2004-04-28 12:08:54 +02:00
|
|
|
/* Global read-only variable describing server license */
|
2004-05-25 01:28:44 +02:00
|
|
|
sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE));
|
2004-04-28 12:08:54 +02:00
|
|
|
|
2007-02-20 16:24:38 +01:00
|
|
|
/* Global read-only variable containing hostname */
|
|
|
|
sys_var_const_str sys_hostname("hostname", glob_hostname);
|
|
|
|
|
2007-07-11 09:49:54 +02:00
|
|
|
sys_var_thd_bool sys_keep_files_on_create("keep_files_on_create",
|
|
|
|
&SV::keep_files_on_create);
|
|
|
|
|
|
|
|
|
2007-02-20 16:24:38 +01:00
|
|
|
|
2004-04-28 12:08:54 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/*
|
|
|
|
List of all variables for initialisation and storage in hash
|
|
|
|
This is sorted in alphabetical order to make it easy to add new variables
|
|
|
|
|
|
|
|
If the variable is not in this list, it can't be changed with
|
|
|
|
SET variable_name=
|
|
|
|
*/
|
|
|
|
|
|
|
|
sys_var *sys_variables[]=
|
|
|
|
{
|
|
|
|
&sys_auto_is_null,
|
2004-09-15 21:10:31 +02:00
|
|
|
&sys_auto_increment_increment,
|
|
|
|
&sys_auto_increment_offset,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_autocommit,
|
2004-12-23 11:46:24 +01:00
|
|
|
&sys_automatic_sp_privileges,
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
&sys_basedir,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_big_tables,
|
|
|
|
&sys_big_selects,
|
|
|
|
&sys_binlog_cache_size,
|
|
|
|
&sys_buffer_results,
|
|
|
|
&sys_bulk_insert_buff_size,
|
2003-05-30 10:03:56 +02:00
|
|
|
&sys_character_set_server,
|
|
|
|
&sys_character_set_database,
|
2003-05-21 14:44:12 +02:00
|
|
|
&sys_character_set_client,
|
2003-05-30 10:24:24 +02:00
|
|
|
&sys_character_set_connection,
|
2003-05-21 14:44:12 +02:00
|
|
|
&sys_character_set_results,
|
2006-02-14 05:24:01 +01:00
|
|
|
&sys_character_set_filesystem,
|
2005-09-07 12:38:09 +02:00
|
|
|
&sys_charset_system,
|
2003-04-23 15:19:22 +02:00
|
|
|
&sys_collation_connection,
|
2003-09-15 13:31:04 +02:00
|
|
|
&sys_collation_database,
|
|
|
|
&sys_collation_server,
|
2005-02-01 20:48:05 +01:00
|
|
|
&sys_completion_type,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_concurrent_insert,
|
|
|
|
&sys_connect_timeout,
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
&sys_datadir,
|
2003-11-03 13:01:59 +01:00
|
|
|
&sys_date_format,
|
|
|
|
&sys_datetime_format,
|
2005-05-05 17:06:49 +02:00
|
|
|
&sys_div_precincrement,
|
2003-02-19 13:05:35 +01:00
|
|
|
&sys_default_week_format,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_delay_key_write,
|
|
|
|
&sys_delayed_insert_limit,
|
|
|
|
&sys_delayed_insert_timeout,
|
|
|
|
&sys_delayed_queue_size,
|
2007-07-11 09:49:54 +02:00
|
|
|
&sys_keep_files_on_create,
|
2002-10-02 12:33:08 +02:00
|
|
|
&sys_error_count,
|
2003-03-11 10:49:06 +01:00
|
|
|
&sys_expire_logs_days,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_flush,
|
|
|
|
&sys_flush_time,
|
2004-04-28 12:08:54 +02:00
|
|
|
&sys_ft_boolean_syntax,
|
2002-08-08 02:12:02 +02:00
|
|
|
&sys_foreign_key_checks,
|
2003-04-02 15:16:19 +02:00
|
|
|
&sys_group_concat_max_len,
|
2005-08-26 10:23:32 +02:00
|
|
|
&sys_have_innodb,
|
2007-02-20 16:24:38 +01:00
|
|
|
&sys_hostname,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_identity,
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
&sys_init_connect,
|
|
|
|
&sys_init_slave,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_insert_id,
|
|
|
|
&sys_interactive_timeout,
|
|
|
|
&sys_join_buffer_size,
|
|
|
|
&sys_key_buffer_size,
|
2003-08-02 11:43:18 +02:00
|
|
|
&sys_key_cache_block_size,
|
2003-08-09 20:12:22 +02:00
|
|
|
&sys_key_cache_division_limit,
|
|
|
|
&sys_key_cache_age_threshold,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_last_insert_id,
|
2006-07-04 14:40:40 +02:00
|
|
|
&sys_lc_time_names,
|
2004-04-28 12:08:54 +02:00
|
|
|
&sys_license,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_local_infile,
|
2007-10-25 12:02:27 +02:00
|
|
|
&sys_log,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_log_binlog,
|
|
|
|
&sys_log_off,
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
&sys_log_queries_not_using_indexes,
|
2007-10-25 12:02:27 +02:00
|
|
|
&sys_log_slow,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_log_update,
|
|
|
|
&sys_log_warnings,
|
|
|
|
&sys_long_query_time,
|
|
|
|
&sys_low_priority_updates,
|
|
|
|
&sys_max_allowed_packet,
|
|
|
|
&sys_max_binlog_cache_size,
|
|
|
|
&sys_max_binlog_size,
|
|
|
|
&sys_max_connect_errors,
|
|
|
|
&sys_max_connections,
|
|
|
|
&sys_max_delayed_threads,
|
2002-10-02 12:33:08 +02:00
|
|
|
&sys_max_error_count,
|
2004-04-28 12:08:54 +02:00
|
|
|
&sys_max_insert_delayed_threads,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_max_heap_table_size,
|
|
|
|
&sys_max_join_size,
|
2003-04-24 13:33:33 +02:00
|
|
|
&sys_max_length_for_sort_data,
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
&sys_max_prepared_stmt_count,
|
2003-07-06 17:59:54 +02:00
|
|
|
&sys_max_relay_log_size,
|
2003-06-27 02:04:54 +02:00
|
|
|
&sys_max_seeks_for_key,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_max_sort_length,
|
2005-11-23 00:11:19 +01:00
|
|
|
&sys_max_sp_recursion_depth,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_max_tmp_tables,
|
|
|
|
&sys_max_user_connections,
|
|
|
|
&sys_max_write_lock_count,
|
2005-01-21 17:38:46 +01:00
|
|
|
&sys_multi_range_count,
|
2004-05-01 15:41:59 +02:00
|
|
|
&sys_myisam_data_pointer_size,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_myisam_max_sort_file_size,
|
2003-05-04 18:43:37 +02:00
|
|
|
&sys_myisam_repair_threads,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_myisam_sort_buffer_size,
|
2005-09-21 00:18:29 +02:00
|
|
|
&sys_myisam_stats_method,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_net_buffer_length,
|
|
|
|
&sys_net_read_timeout,
|
2002-08-08 19:49:06 +02:00
|
|
|
&sys_net_retry_count,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_net_wait_timeout,
|
|
|
|
&sys_net_write_timeout,
|
2003-03-05 18:43:56 +01:00
|
|
|
&sys_new_mode,
|
2003-07-08 00:36:14 +02:00
|
|
|
&sys_old_passwords,
|
2004-05-20 16:47:43 +02:00
|
|
|
&sys_optimizer_prune_level,
|
|
|
|
&sys_optimizer_search_depth,
|
2003-06-12 13:29:02 +02:00
|
|
|
&sys_preload_buff_size,
|
2002-12-29 22:46:48 +01:00
|
|
|
&sys_pseudo_thread_id,
|
2003-10-11 21:00:24 +02:00
|
|
|
&sys_query_alloc_block_size,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_query_cache_size,
|
2003-10-11 21:00:24 +02:00
|
|
|
&sys_query_prealloc_size,
|
2002-07-23 17:31:22 +02:00
|
|
|
#ifdef HAVE_QUERY_CACHE
|
|
|
|
&sys_query_cache_limit,
|
2003-03-02 20:39:03 +01:00
|
|
|
&sys_query_cache_min_res_unit,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_query_cache_type,
|
2004-04-28 12:08:54 +02:00
|
|
|
&sys_query_cache_wlock_invalidate,
|
2002-08-08 02:12:02 +02:00
|
|
|
#endif /* HAVE_QUERY_CACHE */
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_quote_show_create,
|
2002-11-07 03:02:37 +01:00
|
|
|
&sys_rand_seed1,
|
|
|
|
&sys_rand_seed2,
|
2003-10-14 15:30:42 +02:00
|
|
|
&sys_range_alloc_block_size,
|
2003-11-03 13:01:59 +01:00
|
|
|
&sys_readonly,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_read_buff_size,
|
|
|
|
&sys_read_rnd_buff_size,
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
#ifdef HAVE_REPLICATION
|
|
|
|
&sys_relay_log_purge,
|
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_rpl_recovery_rank,
|
|
|
|
&sys_safe_updates,
|
2003-07-08 00:36:14 +02:00
|
|
|
&sys_secure_auth,
|
2007-02-14 14:44:34 +01:00
|
|
|
&sys_secure_file_priv,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_select_limit,
|
|
|
|
&sys_server_id,
|
2003-01-15 09:11:44 +01:00
|
|
|
#ifdef HAVE_REPLICATION
|
2002-08-08 02:12:02 +02:00
|
|
|
&sys_slave_compressed_protocol,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_slave_net_timeout,
|
2005-03-02 11:29:48 +01:00
|
|
|
&sys_slave_trans_retries,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_slave_skip_counter,
|
2002-12-16 14:33:29 +01:00
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_slow_launch_time,
|
|
|
|
&sys_sort_buffer,
|
|
|
|
&sys_sql_big_tables,
|
|
|
|
&sys_sql_low_priority_updates,
|
|
|
|
&sys_sql_max_join_size,
|
2003-01-16 01:04:50 +01:00
|
|
|
&sys_sql_mode,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_sql_warnings,
|
2005-02-21 18:40:28 +01:00
|
|
|
&sys_sql_notes,
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
&sys_ssl_ca,
|
|
|
|
&sys_ssl_capath,
|
|
|
|
&sys_ssl_cert,
|
|
|
|
&sys_ssl_cipher,
|
|
|
|
&sys_ssl_key,
|
2003-12-17 23:52:03 +01:00
|
|
|
&sys_storage_engine,
|
2006-04-26 17:55:26 +02:00
|
|
|
#ifdef HAVE_REPLICATION
|
|
|
|
&sys_sync_binlog_period,
|
|
|
|
#endif
|
2004-06-10 15:56:13 +02:00
|
|
|
&sys_sync_frm,
|
2006-04-21 06:56:53 +02:00
|
|
|
&sys_system_time_zone,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_table_cache_size,
|
A fix and a test case for Bug#10760 and complementary cleanups.
The idea of the patch
is that every cursor gets its own lock id for table level locking.
Thus cursors are protected from updates performed within the same
connection. Additionally a list of transient (must be closed at
commit) cursors is maintained and all transient cursors are closed
when necessary. Lastly, this patch adds support for deadlock
timeouts to TLL locking when using cursors.
+ post-review fixes.
include/thr_lock.h:
- add a notion of lock owner to table level locking. When using
cursors, lock owner can not be identified by a thread id any more,
as we must protect cursors from updates issued within the same
connection (thread). So, each cursor has its own lock identifier to
use with table level locking.
- extend return values of thr_lock and thr_multi_lock with
THR_LOCK_TIMEOUT and THR_LOCK_DEADLOCK, since these conditions
are now possible (see comments to thr_lock.c)
mysys/thr_lock.c:
Better support for cursors:
- use THR_LOCK_OWNER * as lock identifier, not pthread_t.
- check and return an error for a trivial deadlock case, when an
update statement is issued to a table locked by a cursor which has
been previously opened in the same connection.
- add support for locking timeouts: with use of cursors, trivial
deadlocks can occur. For now the only remedy is the lock wait timeout,
which is initialized from a new global variable 'table_lock_wait_timeout'
Example of a deadlock (assuming the storage engine does not downgrade
locks):
con1: open cursor for select * from t1;
con2: open cursor for select * from t2;
con1: update t2 set id=id*2; -- blocked
con2: update t1 set id=id*2; -- deadlock
Lock timeouts are active only if a connection is using cursors.
- the check in the wait_for_lock loop has been changed from
data->cond != cond to data->cond != 0. data->cond is zeroed
in every place it's changed.
- added comments
sql/examples/ha_archive.cc:
- extend the handlerton with the info about cursor behaviour at commit.
sql/examples/ha_archive.h:
- ctor moved to .cc to make use of archive handlerton
sql/examples/ha_example.cc:
- add handlerton instance, init handler::ht with it
sql/examples/ha_example.h:
- ctor moved to .cc to make use of ha_example handlerton
sql/examples/ha_tina.cc:
- add handlerton instance, init handler::ht with it
sql/examples/ha_tina.h:
- ctor moved to .cc to make use of CSV handlerton
sql/ha_berkeley.cc:
- init handlerton::flags and handler::ht
sql/ha_berkeley.h:
- ctor moved to .cc to make use of BerkeleyDB handlerton
sql/ha_blackhole.cc:
- add handlerton instance, init handler::ht with it
sql/ha_blackhole.h:
- ctor moved to .cc to make use of blackhole handlerton
sql/ha_federated.cc:
- add handlerton instance, init handler::ht with it
sql/ha_federated.h:
- ctor moved to .cc to make use of federated handlerton
sql/ha_heap.cc:
- add handlerton instance, init handler::ht with it
sql/ha_heap.h:
- ctor moved to .cc to make use of ha_heap handlerton
sql/ha_innodb.cc:
- init handlerton::flags and handler::ht of innobase storage engine
sql/ha_innodb.h:
- ctor moved to .cc to make use of archive handlerton
sql/ha_myisam.cc:
- add handlerton instance, init handler::ht with it
sql/ha_myisam.h:
- ctor moved to .cc to make use of MyISAM handlerton
sql/ha_myisammrg.cc:
- init handler::ht in the ctor
sql/ha_myisammrg.h:
- ctor moved to .cc to make use of MyISAM MERGE handlerton
sql/ha_ndbcluster.cc:
- init handlerton::flags and handler::ht
sql/handler.cc:
- drop support for ISAM storage engine, which was removed from 5.0
- close all "transient" cursors at COMMIT/ROLLBACK. A "transient"
SQL level cursor is a cursor that uses tables that have a transaction-
specific state.
sql/handler.h:
- extend struct handlerton with flags, add handlerton *ht to every
handler instance.
sql/lock.cc:
- extend mysql_lock_tables to send error to the client if
thr_multi_lock returns a timeout or a deadlock error.
sql/mysqld.cc:
- add server option --table_lock_wait_timeout (in seconds)
sql/set_var.cc:
- add new global variable 'table_lock_wait_timeout' to specify
a wait timeout for table-level locks of MySQL (in seconds). The default
timeout is 50 seconds. The timeout is active only if the connection
has open cursors.
sql/sql_class.cc:
- implement Statement_map::close_transient_cursors
- safety suggests that we need an assert ensuring
llock_info->n_cursors is functioning properly, adjust destruction of
the Statement_map to allow such assert in THD::~THD
sql/sql_class.h:
- add support for Cursors registry to Statement map.
sql/sql_prepare.cc:
- maintain a list of cursors that must be closed at commit/rollback.
sql/sql_select.cc:
- extend class Cursor to support specific at-COMMIT/ROLLBACK behavior.
If a cursor uses tables of a storage engine that
invalidates all open tables at COMMIT/ROLLBACK, it must be closed
before COMMIT/ROLLBACK is executed.
sql/sql_select.h:
- add an own lock_id and commit/rollback status flag to class Cursor
tests/mysql_client_test.c:
A test case for Bug#10760 and complementary issues: test a simple
deadlock case too.
mysql-test/var:
New BitKeeper file ``mysql-test/var''
2005-07-19 20:21:12 +02:00
|
|
|
&sys_table_lock_wait_timeout,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_table_type,
|
|
|
|
&sys_thread_cache_size,
|
2003-11-03 13:01:59 +01:00
|
|
|
&sys_time_format,
|
2004-12-24 12:13:32 +01:00
|
|
|
&sys_timed_mutexes,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_timestamp,
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
&sys_time_zone,
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
&sys_tmpdir,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_tmp_table_size,
|
2003-10-11 21:00:24 +02:00
|
|
|
&sys_trans_alloc_block_size,
|
|
|
|
&sys_trans_prealloc_size,
|
2002-07-23 17:31:22 +02:00
|
|
|
&sys_tx_isolation,
|
2006-04-21 06:56:53 +02:00
|
|
|
&sys_version,
|
|
|
|
#ifdef HAVE_BERKELEY_DB
|
|
|
|
&sys_version_bdb,
|
|
|
|
#endif
|
|
|
|
&sys_version_comment,
|
|
|
|
&sys_version_compile_machine,
|
|
|
|
&sys_version_compile_os,
|
2003-05-04 12:41:21 +02:00
|
|
|
#ifdef HAVE_INNOBASE_DB
|
2005-04-15 18:00:38 +02:00
|
|
|
&sys_innodb_fast_shutdown,
|
2003-05-04 12:41:21 +02:00
|
|
|
&sys_innodb_max_dirty_pages_pct,
|
2004-10-27 12:33:11 +02:00
|
|
|
&sys_innodb_max_purge_lag,
|
2004-10-20 10:24:08 +02:00
|
|
|
&sys_innodb_table_locks,
|
2005-03-13 11:49:39 +01:00
|
|
|
&sys_innodb_support_xa,
|
2004-09-30 11:31:41 +02:00
|
|
|
&sys_innodb_autoextend_increment,
|
2005-01-05 12:43:48 +01:00
|
|
|
&sys_innodb_sync_spin_loops,
|
2005-01-12 20:55:06 +01:00
|
|
|
&sys_innodb_concurrency_tickets,
|
2005-01-08 15:01:37 +01:00
|
|
|
&sys_innodb_thread_sleep_delay,
|
|
|
|
&sys_innodb_thread_concurrency,
|
2005-08-11 18:03:01 +02:00
|
|
|
&sys_innodb_commit_concurrency,
|
2006-01-18 13:02:03 +01:00
|
|
|
&sys_innodb_flush_log_at_trx_commit,
|
2006-04-13 09:50:33 +02:00
|
|
|
#endif
|
Approximative fixes for BUG#2610,2611,9100 i.e. WL#2146 binlogging/replication of routines (stored procs and functions).
Approximative, because it's using our binlogging way (what we call "query"-level) and this is not as good as record-level binlog (5.1) would be. It imposes several
limitations to routines, and has caveats (which I'll document, and for which the server will try to issue errors but that is not always possible).
Reason I don't propagate caller info to the binlog as planned is that on master and slave
users may be different; even with that some caveats would remain.
mysql-test/mysql-test-run.sh:
In the testsuite we know what we do, we are not creating nasty routines, and breaking binlog is ok except in rpl_sp.
mysql-test/r/blackhole.result:
Updating results now that 4.1 has been merged
mysql-test/valgrind.supp:
Some suppressions for Valgrind (useful on my machine Suse 9.1);
this is just adding to the already existing suppressions of pthread and dl.
sql/item_func.cc:
Don't binlog the substatements when executing a function. If the function
is declared to modify data and does not complete, warning "broken binlog".
Note that SELECT myfunc() will not be binlogged even if myfunc() updates data (will be documented);
but INSERT INTO t VALUES(myfunc()) will be binlogged (what decides is if the caller
gets binlogged; the function changes nothing to binlogging).
sql/log_event.cc:
Just making functions which can be re-used when we binlog more strings
in status_vars in Query_log_event (e.g. one day "user", "host").
sql/log_event.h:
comment
sql/mysql_priv.h:
--log-bin-trust-routine-creators
sql/mysqld.cc:
--log-bin-trust-routine-creators
sql/set_var.cc:
--log-bin-trust-routine-creators
sql/share/errmsg.txt:
error messages to warn about problems with routines and binlog
sql/slave.cc:
If in a routine, replication table inclusion/exclusion rules always answer "replicate!" (see comment in code).
sql/sp.cc:
If binlog is on: errors if one wants to create a non-deterministic update routine
(repeatability problem - note that the test is not perfect for functions) or does not have SUPER (because routines can easily
be made to destroy slave's data with just CREATE ROUTINE and EXECUTE priv on master).
--log-bin-trust-routine-creators removes these errors.
Binlogging of CREATE PROCEDURE|FUNCTION.
sql/sql_acl.cc:
No thd==0 in tables_ok().
sql/sql_parse.cc:
Binlogging of CALL (and not of the substatements of the SP).
If SP returns error, we don't binlog it (see comment); we push warning in this case.
Binlogging of ALTER|DROP PROCEDURE|FUNCTION with safety messages.
2005-05-05 14:20:53 +02:00
|
|
|
&sys_trust_routine_creators,
|
2005-11-10 17:50:51 +01:00
|
|
|
&sys_trust_function_creators,
|
2005-02-11 22:05:24 +01:00
|
|
|
&sys_engine_condition_pushdown,
|
2004-11-17 09:15:53 +01:00
|
|
|
#ifdef HAVE_NDBCLUSTER_DB
|
|
|
|
&sys_ndb_autoincrement_prefetch_sz,
|
2005-03-15 15:03:25 +01:00
|
|
|
&sys_ndb_cache_check_time,
|
2007-03-12 19:08:35 +01:00
|
|
|
&sys_ndb_connectstring,
|
2004-11-17 09:15:53 +01:00
|
|
|
&sys_ndb_force_send,
|
|
|
|
&sys_ndb_use_exact_count,
|
|
|
|
&sys_ndb_use_transactions,
|
2004-10-07 11:13:42 +02:00
|
|
|
#endif
|
2002-10-02 12:33:08 +02:00
|
|
|
&sys_unique_checks,
|
2004-10-07 11:13:42 +02:00
|
|
|
&sys_updatable_views_with_limit,
|
2002-10-02 12:33:08 +02:00
|
|
|
&sys_warning_count
|
2002-07-23 17:31:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2006-10-30 13:35:57 +01:00
|
|
|
Variables shown by SHOW VARIABLES in alphabetical order
|
2002-07-23 17:31:22 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
struct show_var_st init_vars[]= {
|
2004-10-22 09:47:32 +02:00
|
|
|
{"auto_increment_increment", (char*) &sys_auto_increment_increment, SHOW_SYS},
|
2004-09-15 21:10:31 +02:00
|
|
|
{"auto_increment_offset", (char*) &sys_auto_increment_offset, SHOW_SYS},
|
2004-12-23 11:46:24 +01:00
|
|
|
{sys_automatic_sp_privileges.name,(char*) &sys_automatic_sp_privileges, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"back_log", (char*) &back_log, SHOW_LONG},
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
{sys_basedir.name, (char*) &sys_basedir, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
#ifdef HAVE_BERKELEY_DB
|
|
|
|
{"bdb_cache_size", (char*) &berkeley_cache_size, SHOW_LONG},
|
|
|
|
{"bdb_home", (char*) &berkeley_home, SHOW_CHAR_PTR},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"bdb_log_buffer_size", (char*) &berkeley_log_buffer_size, SHOW_LONG},
|
2004-07-28 21:52:04 +02:00
|
|
|
{"bdb_logdir", (char*) &berkeley_logdir, SHOW_CHAR_PTR},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"bdb_max_lock", (char*) &berkeley_max_lock, SHOW_LONG},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"bdb_shared_data", (char*) &berkeley_shared_data, SHOW_BOOL},
|
|
|
|
{"bdb_tmpdir", (char*) &berkeley_tmpdir, SHOW_CHAR_PTR},
|
|
|
|
#endif
|
|
|
|
{sys_binlog_cache_size.name,(char*) &sys_binlog_cache_size, SHOW_SYS},
|
|
|
|
{sys_bulk_insert_buff_size.name,(char*) &sys_bulk_insert_buff_size,SHOW_SYS},
|
2003-10-08 17:53:31 +02:00
|
|
|
{sys_character_set_client.name,(char*) &sys_character_set_client, SHOW_SYS},
|
2003-05-30 10:24:24 +02:00
|
|
|
{sys_character_set_connection.name,(char*) &sys_character_set_connection,SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_character_set_database.name, (char*) &sys_character_set_database,SHOW_SYS},
|
2006-02-14 05:24:01 +01:00
|
|
|
{sys_character_set_filesystem.name,(char*) &sys_character_set_filesystem, SHOW_SYS},
|
2003-05-21 14:44:12 +02:00
|
|
|
{sys_character_set_results.name,(char*) &sys_character_set_results, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_character_set_server.name, (char*) &sys_character_set_server,SHOW_SYS},
|
|
|
|
{sys_charset_system.name, (char*) &sys_charset_system, SHOW_SYS},
|
|
|
|
{"character_sets_dir", mysql_charsets_dir, SHOW_CHAR},
|
2003-04-23 15:19:22 +02:00
|
|
|
{sys_collation_connection.name,(char*) &sys_collation_connection, SHOW_SYS},
|
2003-09-15 13:31:04 +02:00
|
|
|
{sys_collation_database.name,(char*) &sys_collation_database, SHOW_SYS},
|
|
|
|
{sys_collation_server.name,(char*) &sys_collation_server, SHOW_SYS},
|
2005-02-01 20:48:05 +01:00
|
|
|
{sys_completion_type.name, (char*) &sys_completion_type, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_concurrent_insert.name,(char*) &sys_concurrent_insert, SHOW_SYS},
|
|
|
|
{sys_connect_timeout.name, (char*) &sys_connect_timeout, SHOW_SYS},
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
{sys_datadir.name, (char*) &sys_datadir, SHOW_SYS},
|
2003-11-03 13:01:59 +01:00
|
|
|
{sys_date_format.name, (char*) &sys_date_format, SHOW_SYS},
|
|
|
|
{sys_datetime_format.name, (char*) &sys_datetime_format, SHOW_SYS},
|
|
|
|
{sys_default_week_format.name, (char*) &sys_default_week_format, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_delay_key_write.name, (char*) &sys_delay_key_write, SHOW_SYS},
|
|
|
|
{sys_delayed_insert_limit.name, (char*) &sys_delayed_insert_limit,SHOW_SYS},
|
|
|
|
{sys_delayed_insert_timeout.name, (char*) &sys_delayed_insert_timeout, SHOW_SYS},
|
|
|
|
{sys_delayed_queue_size.name,(char*) &sys_delayed_queue_size, SHOW_SYS},
|
2005-08-30 20:15:43 +02:00
|
|
|
{sys_div_precincrement.name,(char*) &sys_div_precincrement,SHOW_SYS},
|
2007-07-11 09:49:54 +02:00
|
|
|
{sys_keep_files_on_create.name,(char*) &sys_keep_files_on_create, SHOW_SYS},
|
2006-04-13 09:50:33 +02:00
|
|
|
{sys_engine_condition_pushdown.name,
|
2005-08-30 20:15:43 +02:00
|
|
|
(char*) &sys_engine_condition_pushdown, SHOW_SYS},
|
2003-03-11 10:49:06 +01:00
|
|
|
{sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_flush.name, (char*) &sys_flush, SHOW_SYS},
|
|
|
|
{sys_flush_time.name, (char*) &sys_flush_time, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_ft_boolean_syntax.name,(char*) &ft_boolean_syntax, SHOW_CHAR},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"ft_max_word_len", (char*) &ft_max_word_len, SHOW_LONG},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"ft_min_word_len", (char*) &ft_min_word_len, SHOW_LONG},
|
2003-10-23 15:21:06 +02:00
|
|
|
{"ft_query_expansion_limit",(char*) &ft_query_expansion_limit, SHOW_LONG},
|
2003-01-27 12:12:12 +01:00
|
|
|
{"ft_stopword_file", (char*) &ft_stopword_file, SHOW_CHAR_PTR},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_group_concat_max_len.name, (char*) &sys_group_concat_max_len, SHOW_SYS},
|
2004-05-25 22:27:01 +02:00
|
|
|
{"have_archive", (char*) &have_archive_db, SHOW_HAVE},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE},
|
2005-03-23 01:10:39 +01:00
|
|
|
{"have_blackhole_engine", (char*) &have_blackhole_db, SHOW_HAVE},
|
2003-04-10 02:50:30 +02:00
|
|
|
{"have_compress", (char*) &have_compress, SHOW_HAVE},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"have_crypt", (char*) &have_crypt, SHOW_HAVE},
|
2004-08-13 05:57:18 +02:00
|
|
|
{"have_csv", (char*) &have_csv_db, SHOW_HAVE},
|
2006-04-12 15:13:16 +02:00
|
|
|
{"have_dynamic_loading", (char*) &have_dlopen, SHOW_HAVE},
|
2004-12-11 21:03:51 +01:00
|
|
|
{"have_example_engine", (char*) &have_example_db, SHOW_HAVE},
|
2005-01-13 22:03:05 +01:00
|
|
|
{"have_federated_engine", (char*) &have_federated_db, SHOW_HAVE},
|
2004-07-28 21:52:04 +02:00
|
|
|
{"have_geometry", (char*) &have_geometry, SHOW_HAVE},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"have_innodb", (char*) &have_innodb, SHOW_HAVE},
|
2003-10-23 15:21:06 +02:00
|
|
|
{"have_isam", (char*) &have_isam, SHOW_HAVE},
|
2006-07-14 13:26:58 +02:00
|
|
|
{"have_merge_engine", (char*) &have_merge_db, SHOW_HAVE},
|
2006-08-14 07:54:24 +02:00
|
|
|
{"have_ndbcluster", (char*) &have_ndbcluster, SHOW_HAVE},
|
2007-03-05 10:03:42 +01:00
|
|
|
/* have_openssl is just and alias for have_ssl */
|
|
|
|
{"have_openssl", (char*) &have_ssl, SHOW_HAVE},
|
|
|
|
{"have_ssl", (char*) &have_ssl, SHOW_HAVE},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"have_query_cache", (char*) &have_query_cache, SHOW_HAVE},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"have_raid", (char*) &have_raid, SHOW_HAVE},
|
2004-05-27 17:31:30 +02:00
|
|
|
{"have_rtree_keys", (char*) &have_rtree_keys, SHOW_HAVE},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"have_symlink", (char*) &have_symlink, SHOW_HAVE},
|
2007-02-20 16:24:38 +01:00
|
|
|
{sys_hostname.name, (char*) &sys_hostname, SHOW_SYS},
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
{"init_connect", (char*) &sys_init_connect, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR},
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
{"init_slave", (char*) &sys_init_slave, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
#ifdef HAVE_INNOBASE_DB
|
|
|
|
{"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG },
|
2004-09-30 11:31:41 +02:00
|
|
|
{sys_innodb_autoextend_increment.name, (char*) &sys_innodb_autoextend_increment, SHOW_SYS},
|
2003-01-06 21:07:25 +01:00
|
|
|
{"innodb_buffer_pool_awe_mem_mb", (char*) &innobase_buffer_pool_awe_mem_mb, SHOW_LONG },
|
2005-11-17 15:08:49 +01:00
|
|
|
{"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONGLONG },
|
2005-01-13 03:38:05 +01:00
|
|
|
{"innodb_checksums", (char*) &innobase_use_checksums, SHOW_MY_BOOL},
|
2005-08-30 20:15:43 +02:00
|
|
|
{sys_innodb_commit_concurrency.name, (char*) &sys_innodb_commit_concurrency, SHOW_SYS},
|
2005-01-13 03:38:05 +01:00
|
|
|
{sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR},
|
|
|
|
{"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR},
|
2007-10-03 07:47:30 +02:00
|
|
|
{"innodb_adaptive_hash_index", (char*) &innobase_adaptive_hash_index, SHOW_MY_BOOL},
|
2004-12-14 20:26:31 +01:00
|
|
|
{"innodb_doublewrite", (char*) &innobase_use_doublewrite, SHOW_MY_BOOL},
|
2005-04-15 18:00:38 +02:00
|
|
|
{sys_innodb_fast_shutdown.name,(char*) &sys_innodb_fast_shutdown, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
|
2003-10-07 16:28:59 +02:00
|
|
|
{"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL},
|
2006-02-13 18:20:15 +01:00
|
|
|
{sys_innodb_flush_log_at_trx_commit.name, (char*) &sys_innodb_flush_log_at_trx_commit, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG },
|
2002-07-23 17:31:22 +02:00
|
|
|
{"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG },
|
2005-01-07 21:17:08 +01:00
|
|
|
{"innodb_locks_unsafe_for_binlog", (char*) &innobase_locks_unsafe_for_binlog, SHOW_MY_BOOL},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR},
|
|
|
|
{"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL},
|
|
|
|
{"innodb_log_buffer_size", (char*) &innobase_log_buffer_size, SHOW_LONG },
|
2005-11-17 15:08:49 +01:00
|
|
|
{"innodb_log_file_size", (char*) &innobase_log_file_size, SHOW_LONGLONG},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"innodb_log_files_in_group", (char*) &innobase_log_files_in_group, SHOW_LONG},
|
|
|
|
{"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR},
|
2003-05-04 12:41:21 +02:00
|
|
|
{sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS},
|
2004-10-27 12:33:11 +02:00
|
|
|
{sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG},
|
|
|
|
{"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG },
|
2006-12-20 00:57:51 +01:00
|
|
|
{"innodb_rollback_on_timeout", (char*) &innobase_rollback_on_timeout, SHOW_MY_BOOL},
|
2005-08-30 20:15:43 +02:00
|
|
|
{sys_innodb_support_xa.name, (char*) &sys_innodb_support_xa, SHOW_SYS},
|
2005-01-05 12:43:48 +01:00
|
|
|
{sys_innodb_sync_spin_loops.name, (char*) &sys_innodb_sync_spin_loops, SHOW_SYS},
|
2005-01-07 21:17:08 +01:00
|
|
|
{sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS},
|
2005-01-13 03:38:05 +01:00
|
|
|
{sys_innodb_thread_concurrency.name, (char*) &sys_innodb_thread_concurrency, SHOW_SYS},
|
|
|
|
{sys_innodb_thread_sleep_delay.name, (char*) &sys_innodb_thread_sleep_delay, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
#endif
|
|
|
|
{sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS},
|
|
|
|
{sys_join_buffer_size.name, (char*) &sys_join_buffer_size, SHOW_SYS},
|
|
|
|
{sys_key_buffer_size.name, (char*) &sys_key_buffer_size, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_key_cache_age_threshold.name, (char*) &sys_key_cache_age_threshold,
|
|
|
|
SHOW_SYS},
|
2003-08-02 11:43:18 +02:00
|
|
|
{sys_key_cache_block_size.name, (char*) &sys_key_cache_block_size,
|
2004-04-28 12:08:54 +02:00
|
|
|
SHOW_SYS},
|
2003-08-09 20:12:22 +02:00
|
|
|
{sys_key_cache_division_limit.name, (char*) &sys_key_cache_division_limit,
|
2004-04-28 12:08:54 +02:00
|
|
|
SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"language", language, SHOW_CHAR},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"large_files_support", (char*) &opt_large_files, SHOW_BOOL},
|
2004-12-14 20:26:31 +01:00
|
|
|
{"large_page_size", (char*) &opt_large_page_size, SHOW_INT},
|
2005-08-30 20:15:43 +02:00
|
|
|
{"large_pages", (char*) &opt_large_pages, SHOW_MY_BOOL},
|
2006-07-04 14:40:40 +02:00
|
|
|
{sys_lc_time_names.name, (char*) &sys_lc_time_names, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_license.name, (char*) &sys_license, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_local_infile.name, (char*) &sys_local_infile, SHOW_SYS},
|
|
|
|
#ifdef HAVE_MLOCKALL
|
|
|
|
{"locked_in_memory", (char*) &locked_in_memory, SHOW_BOOL},
|
|
|
|
#endif
|
2007-10-25 12:02:27 +02:00
|
|
|
{sys_log.name, (char*) &sys_log, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"log_bin", (char*) &opt_bin_log, SHOW_BOOL},
|
2005-11-10 17:50:51 +01:00
|
|
|
{sys_trust_function_creators.name,(char*) &sys_trust_function_creators, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"log_error", (char*) log_error_file, SHOW_CHAR},
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
{sys_log_queries_not_using_indexes.name,
|
|
|
|
(char*) &sys_log_queries_not_using_indexes, SHOW_SYS},
|
2003-01-15 09:11:44 +01:00
|
|
|
#ifdef HAVE_REPLICATION
|
2002-08-28 18:22:42 +02:00
|
|
|
{"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_MY_BOOL},
|
2002-12-16 14:33:29 +01:00
|
|
|
#endif
|
2007-10-25 12:02:27 +02:00
|
|
|
{sys_log_slow.name, (char*) &sys_log_slow, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_log_warnings.name, (char*) &sys_log_warnings, SHOW_SYS},
|
|
|
|
{sys_long_query_time.name, (char*) &sys_long_query_time, SHOW_SYS},
|
|
|
|
{sys_low_priority_updates.name, (char*) &sys_low_priority_updates, SHOW_SYS},
|
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
Ensured that all projects compile
Removed compiler warnings
Better setting of server_version variable.
Fix that make_win_src_distribution creates the privilege tables.
VC++Files/bdb/bdb.dsp:
Small, automatic changes
VC++Files/client/mysql.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/client/mysqladmin.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/client/mysqlclient.dsp:
Removed files that should only be used with mysql command line client
VC++Files/client/mysqldump.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/client/mysqlimport.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/client/mysqlshow.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/comp_err/comp_err.dsp:
Automatic changes
VC++Files/dbug/dbug.dsp:
Automatic changes
VC++Files/heap/heap.dsp:
automatic changes
VC++Files/innobase/innobase.dsp:
Automatic changes
VC++Files/isam/isam.dsp:
Automatic changes
VC++Files/isamchk/isamchk.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/libmysql/libmysql.dsp:
Automatic changes
VC++Files/libmysqld/examples/test_libmysqld.dsp:
Add missing files
VC++Files/libmysqld/libmysqld.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/libmysqltest/myTest.dsp:
Automatic changes
VC++Files/merge/merge.dsp:
Automatic changes
VC++Files/my_print_defaults/my_print_defaults.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/myisam/myisam.dsp:
automatic changes
VC++Files/myisam_ftdump/myisam_ftdump.dsp:
automatic changes
VC++Files/myisamchk/myisamchk.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/myisamlog/myisamlog.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/myisammrg/myisammrg.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/myisampack/myisampack.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/mysql.dsw:
Automatic changes
VC++Files/mysqlbinlog/mysqlbinlog.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/mysqlcheck/mysqlcheck.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/mysqldemb/mysqldemb.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/mysqlserver/mysqlserver.dsp:
Automatic changes
VC++Files/mysqlshutdown/mysqlshutdown.dsp:
Automatic changes
VC++Files/mysqlwatch/mysqlwatch.dsp:
Automatic changes
VC++Files/mysys/mysys.dsp:
Automatic changes
VC++Files/pack_isam/pack_isam.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/perror/perror.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/regex/regex.dsp:
Automatic changes
VC++Files/replace/replace.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/sql/mysqld.dsp:
Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt'
VC++Files/strings/strings.dsp:
Removed duplicate code for strnlen
VC++Files/test1/test1.dsp:
Automatic changes
VC++Files/thr_test/thr_test.dsp:
Automatic changes
VC++Files/vio/vio.dsp:
Automatic changes
VC++Files/zlib/contrib/asm386/zlibvc.dsp:
Automatic changes
VC++Files/zlib/zlib.dsp:
Automatic changes
extra/my_print_defaults.c:
Fixed bug in --verbose
include/m_string.h:
Portability fix
include/mysql_embed.h:
Better setting of server_version variable
include/mysql_version.h.in:
Better license text handling
innobase/pars/pars0lex.l:
Remove compiler warnings
innobase/trx/trx0sys.c:
Remove compiler warnings
libmysqld/lib_sql.cc:
Better setting of server_version variable
libmysqld/libmysqld.def:
Add functions needed for mysql command line client
myisam/myisam_ftdump.c:
Remove compiler warnings
mysys/sha1.c:
Remove compiler warnings
scripts/make_win_src_distribution.sh:
Safety fix
scripts/mysql_install_db.sh:
Backport from 4.1 to allow make_win_src_distribution create the privilege tables
sql/Makefile.am:
Add new file mysqld_suffix.h
Remove not used file sql_olap.h
sql/ha_innodb.cc:
Remove not used variable
sql/mysqld.cc:
Better setting of server_version variable
sql/set_var.cc:
Fixed bug when showing lower_case_file_system
strings/ctype-tis620.c:
Remove compiler warnings
2004-05-19 15:38:12 +02:00
|
|
|
{"lower_case_file_system", (char*) &lower_case_file_system, SHOW_MY_BOOL},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"lower_case_table_names", (char*) &lower_case_table_names, SHOW_INT},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_max_allowed_packet.name,(char*) &sys_max_allowed_packet, SHOW_SYS},
|
|
|
|
{sys_max_binlog_cache_size.name,(char*) &sys_max_binlog_cache_size, SHOW_SYS},
|
|
|
|
{sys_max_binlog_size.name, (char*) &sys_max_binlog_size, SHOW_SYS},
|
|
|
|
{sys_max_connect_errors.name, (char*) &sys_max_connect_errors, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_max_connections.name, (char*) &sys_max_connections, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_max_delayed_threads.name,(char*) &sys_max_delayed_threads, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_max_error_count.name, (char*) &sys_max_error_count, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_max_heap_table_size.name,(char*) &sys_max_heap_table_size, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_max_insert_delayed_threads.name,
|
|
|
|
(char*) &sys_max_insert_delayed_threads, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_max_join_size.name, (char*) &sys_max_join_size, SHOW_SYS},
|
2003-08-11 21:44:43 +02:00
|
|
|
{sys_max_length_for_sort_data.name, (char*) &sys_max_length_for_sort_data,
|
2003-04-24 13:33:33 +02:00
|
|
|
SHOW_SYS},
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
{sys_max_prepared_stmt_count.name, (char*) &sys_max_prepared_stmt_count,
|
|
|
|
SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_max_relay_log_size.name, (char*) &sys_max_relay_log_size, SHOW_SYS},
|
|
|
|
{sys_max_seeks_for_key.name, (char*) &sys_max_seeks_for_key, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_max_sort_length.name, (char*) &sys_max_sort_length, SHOW_SYS},
|
2005-11-23 00:11:19 +01:00
|
|
|
{sys_max_sp_recursion_depth.name,
|
|
|
|
(char*) &sys_max_sp_recursion_depth, SHOW_SYS},
|
2003-05-04 18:43:37 +02:00
|
|
|
{sys_max_tmp_tables.name, (char*) &sys_max_tmp_tables, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_max_write_lock_count.name, (char*) &sys_max_write_lock_count,SHOW_SYS},
|
2005-01-21 17:38:46 +01:00
|
|
|
{sys_multi_range_count.name, (char*) &sys_multi_range_count, SHOW_SYS},
|
2004-05-01 15:41:59 +02:00
|
|
|
{sys_myisam_data_pointer_size.name, (char*) &sys_myisam_data_pointer_size, SHOW_SYS},
|
2003-05-04 18:43:37 +02:00
|
|
|
{sys_myisam_max_sort_file_size.name, (char*) &sys_myisam_max_sort_file_size,
|
|
|
|
SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR},
|
2003-05-04 18:43:37 +02:00
|
|
|
{sys_myisam_repair_threads.name, (char*) &sys_myisam_repair_threads,
|
2002-07-23 17:31:22 +02:00
|
|
|
SHOW_SYS},
|
|
|
|
{sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS},
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2005-09-21 00:18:29 +02:00
|
|
|
{sys_myisam_stats_method.name, (char*) &sys_myisam_stats_method, SHOW_SYS},
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
#ifdef __NT__
|
2002-08-28 18:22:42 +02:00
|
|
|
{"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL},
|
2004-11-17 09:15:53 +01:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NDBCLUSTER_DB
|
|
|
|
{sys_ndb_autoincrement_prefetch_sz.name,
|
|
|
|
(char*) &sys_ndb_autoincrement_prefetch_sz, SHOW_SYS},
|
|
|
|
{sys_ndb_force_send.name, (char*) &sys_ndb_force_send, SHOW_SYS},
|
|
|
|
{sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count, SHOW_SYS},
|
|
|
|
{sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS},
|
2005-02-01 15:43:08 +01:00
|
|
|
{sys_ndb_cache_check_time.name,(char*) &sys_ndb_cache_check_time, SHOW_SYS},
|
2007-03-12 19:08:35 +01:00
|
|
|
{sys_ndb_connectstring.name,(char*) &sys_ndb_connectstring, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
#endif
|
|
|
|
{sys_net_buffer_length.name,(char*) &sys_net_buffer_length, SHOW_SYS},
|
|
|
|
{sys_net_read_timeout.name, (char*) &sys_net_read_timeout, SHOW_SYS},
|
2002-08-08 19:49:06 +02:00
|
|
|
{sys_net_retry_count.name, (char*) &sys_net_retry_count, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_net_write_timeout.name,(char*) &sys_net_write_timeout, SHOW_SYS},
|
2003-03-05 18:43:56 +01:00
|
|
|
{sys_new_mode.name, (char*) &sys_new_mode, SHOW_SYS},
|
2003-07-08 00:36:14 +02:00
|
|
|
{sys_old_passwords.name, (char*) &sys_old_passwords, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"open_files_limit", (char*) &open_files_limit, SHOW_LONG},
|
2004-05-20 16:47:43 +02:00
|
|
|
{sys_optimizer_prune_level.name, (char*) &sys_optimizer_prune_level,
|
|
|
|
SHOW_SYS},
|
|
|
|
{sys_optimizer_search_depth.name,(char*) &sys_optimizer_search_depth,
|
|
|
|
SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
|
2003-06-14 10:37:42 +02:00
|
|
|
{"port", (char*) &mysqld_port, SHOW_INT},
|
2003-06-12 13:29:02 +02:00
|
|
|
{sys_preload_buff_size.name, (char*) &sys_preload_buff_size, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"protocol_version", (char*) &protocol_version, SHOW_INT},
|
2003-10-11 21:00:24 +02:00
|
|
|
{sys_query_alloc_block_size.name, (char*) &sys_query_alloc_block_size,
|
|
|
|
SHOW_SYS},
|
2002-07-28 21:36:34 +02:00
|
|
|
#ifdef HAVE_QUERY_CACHE
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_query_cache_limit.name,(char*) &sys_query_cache_limit, SHOW_SYS},
|
2003-03-02 20:39:03 +01:00
|
|
|
{sys_query_cache_min_res_unit.name, (char*) &sys_query_cache_min_res_unit,
|
|
|
|
SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_query_cache_size.name, (char*) &sys_query_cache_size, SHOW_SYS},
|
|
|
|
{sys_query_cache_type.name, (char*) &sys_query_cache_type, SHOW_SYS},
|
2004-08-13 21:31:30 +02:00
|
|
|
{sys_query_cache_wlock_invalidate.name,
|
|
|
|
(char *) &sys_query_cache_wlock_invalidate, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
#endif /* HAVE_QUERY_CACHE */
|
2003-10-11 21:00:24 +02:00
|
|
|
{sys_query_prealloc_size.name, (char*) &sys_query_prealloc_size, SHOW_SYS},
|
2003-10-14 15:30:42 +02:00
|
|
|
{sys_range_alloc_block_size.name, (char*) &sys_range_alloc_block_size,
|
|
|
|
SHOW_SYS},
|
2003-08-21 10:44:17 +02:00
|
|
|
{sys_read_buff_size.name, (char*) &sys_read_buff_size, SHOW_SYS},
|
|
|
|
{sys_readonly.name, (char*) &sys_readonly, SHOW_SYS},
|
|
|
|
{sys_read_rnd_buff_size.name,(char*) &sys_read_rnd_buff_size, SHOW_SYS},
|
2003-08-29 12:44:35 +02:00
|
|
|
#ifdef HAVE_REPLICATION
|
2007-10-10 09:21:11 +02:00
|
|
|
{"relay_log" , (char*) &opt_relay_logname, SHOW_CHAR_PTR},
|
|
|
|
{"relay_log_index", (char*) &opt_relaylog_index_name, SHOW_CHAR_PTR},
|
|
|
|
{"relay_log_info_file", (char*) &relay_log_info_file, SHOW_CHAR_PTR},
|
2003-08-29 12:44:35 +02:00
|
|
|
{sys_relay_log_purge.name, (char*) &sys_relay_log_purge, SHOW_SYS},
|
2005-03-16 13:57:57 +01:00
|
|
|
{"relay_log_space_limit", (char*) &relay_log_space_limit, SHOW_LONGLONG},
|
2003-08-29 12:44:35 +02:00
|
|
|
#endif
|
2003-08-21 10:44:17 +02:00
|
|
|
{sys_rpl_recovery_rank.name,(char*) &sys_rpl_recovery_rank, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{"secure_auth", (char*) &sys_secure_auth, SHOW_SYS},
|
2007-02-14 14:44:34 +01:00
|
|
|
{"secure_file_priv", (char*) &sys_secure_file_priv, SHOW_SYS},
|
2002-11-14 20:16:30 +01:00
|
|
|
#ifdef HAVE_SMEM
|
|
|
|
{"shared_memory", (char*) &opt_enable_shared_memory, SHOW_MY_BOOL},
|
|
|
|
{"shared_memory_base_name", (char*) &shared_memory_base_name, SHOW_CHAR_PTR},
|
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_server_id.name, (char*) &sys_server_id, SHOW_SYS},
|
2002-07-24 18:55:08 +02:00
|
|
|
{"skip_external_locking", (char*) &my_disable_locking, SHOW_MY_BOOL},
|
2002-07-23 17:31:22 +02:00
|
|
|
{"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL},
|
|
|
|
{"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL},
|
2004-04-28 12:08:54 +02:00
|
|
|
#ifdef HAVE_REPLICATION
|
2005-05-07 15:55:47 +02:00
|
|
|
{sys_slave_compressed_protocol.name,
|
|
|
|
(char*) &sys_slave_compressed_protocol, SHOW_SYS},
|
|
|
|
{"slave_load_tmpdir", (char*) &slave_load_tmpdir, SHOW_CHAR_PTR},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout, SHOW_SYS},
|
2005-05-07 15:55:47 +02:00
|
|
|
{"slave_skip_errors", (char*) &slave_error_mask, SHOW_SLAVE_SKIP_ERRORS},
|
2005-03-02 11:29:48 +01:00
|
|
|
{sys_slave_trans_retries.name,(char*) &sys_slave_trans_retries, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_slow_launch_time.name, (char*) &sys_slow_launch_time, SHOW_SYS},
|
2002-11-05 21:45:42 +01:00
|
|
|
#ifdef HAVE_SYS_UN_H
|
2003-06-14 10:37:42 +02:00
|
|
|
{"socket", (char*) &mysqld_unix_port, SHOW_CHAR_PTR},
|
2002-11-05 21:45:42 +01:00
|
|
|
#endif
|
2006-04-26 18:21:53 +02:00
|
|
|
{sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
|
|
|
|
{sys_big_selects.name, (char*) &sys_big_selects, SHOW_SYS},
|
2003-01-16 01:04:50 +01:00
|
|
|
{sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS},
|
2006-04-21 05:41:12 +02:00
|
|
|
{"sql_notes", (char*) &sys_sql_notes, SHOW_SYS},
|
|
|
|
{"sql_warnings", (char*) &sys_sql_warnings, SHOW_SYS},
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
{sys_ssl_ca.name, (char*) &sys_ssl_ca, SHOW_SYS},
|
|
|
|
{sys_ssl_capath.name, (char*) &sys_ssl_capath, SHOW_SYS},
|
|
|
|
{sys_ssl_cert.name, (char*) &sys_ssl_cert, SHOW_SYS},
|
|
|
|
{sys_ssl_cipher.name, (char*) &sys_ssl_cipher, SHOW_SYS},
|
|
|
|
{sys_ssl_key.name, (char*) &sys_ssl_key, SHOW_SYS},
|
2005-08-28 02:20:10 +02:00
|
|
|
{sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS},
|
2006-04-26 17:55:26 +02:00
|
|
|
#ifdef HAVE_REPLICATION
|
|
|
|
{sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS},
|
|
|
|
#endif
|
2005-08-28 02:20:10 +02:00
|
|
|
{sys_sync_frm.name, (char*) &sys_sync_frm, SHOW_SYS},
|
2004-07-10 13:21:44 +02:00
|
|
|
#ifdef HAVE_TZNAME
|
|
|
|
{"system_time_zone", system_time_zone, SHOW_CHAR},
|
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
{"table_cache", (char*) &table_cache_size, SHOW_LONG},
|
A fix and a test case for Bug#10760 and complementary cleanups.
The idea of the patch
is that every cursor gets its own lock id for table level locking.
Thus cursors are protected from updates performed within the same
connection. Additionally a list of transient (must be closed at
commit) cursors is maintained and all transient cursors are closed
when necessary. Lastly, this patch adds support for deadlock
timeouts to TLL locking when using cursors.
+ post-review fixes.
include/thr_lock.h:
- add a notion of lock owner to table level locking. When using
cursors, lock owner can not be identified by a thread id any more,
as we must protect cursors from updates issued within the same
connection (thread). So, each cursor has its own lock identifier to
use with table level locking.
- extend return values of thr_lock and thr_multi_lock with
THR_LOCK_TIMEOUT and THR_LOCK_DEADLOCK, since these conditions
are now possible (see comments to thr_lock.c)
mysys/thr_lock.c:
Better support for cursors:
- use THR_LOCK_OWNER * as lock identifier, not pthread_t.
- check and return an error for a trivial deadlock case, when an
update statement is issued to a table locked by a cursor which has
been previously opened in the same connection.
- add support for locking timeouts: with use of cursors, trivial
deadlocks can occur. For now the only remedy is the lock wait timeout,
which is initialized from a new global variable 'table_lock_wait_timeout'
Example of a deadlock (assuming the storage engine does not downgrade
locks):
con1: open cursor for select * from t1;
con2: open cursor for select * from t2;
con1: update t2 set id=id*2; -- blocked
con2: update t1 set id=id*2; -- deadlock
Lock timeouts are active only if a connection is using cursors.
- the check in the wait_for_lock loop has been changed from
data->cond != cond to data->cond != 0. data->cond is zeroed
in every place it's changed.
- added comments
sql/examples/ha_archive.cc:
- extend the handlerton with the info about cursor behaviour at commit.
sql/examples/ha_archive.h:
- ctor moved to .cc to make use of archive handlerton
sql/examples/ha_example.cc:
- add handlerton instance, init handler::ht with it
sql/examples/ha_example.h:
- ctor moved to .cc to make use of ha_example handlerton
sql/examples/ha_tina.cc:
- add handlerton instance, init handler::ht with it
sql/examples/ha_tina.h:
- ctor moved to .cc to make use of CSV handlerton
sql/ha_berkeley.cc:
- init handlerton::flags and handler::ht
sql/ha_berkeley.h:
- ctor moved to .cc to make use of BerkeleyDB handlerton
sql/ha_blackhole.cc:
- add handlerton instance, init handler::ht with it
sql/ha_blackhole.h:
- ctor moved to .cc to make use of blackhole handlerton
sql/ha_federated.cc:
- add handlerton instance, init handler::ht with it
sql/ha_federated.h:
- ctor moved to .cc to make use of federated handlerton
sql/ha_heap.cc:
- add handlerton instance, init handler::ht with it
sql/ha_heap.h:
- ctor moved to .cc to make use of ha_heap handlerton
sql/ha_innodb.cc:
- init handlerton::flags and handler::ht of innobase storage engine
sql/ha_innodb.h:
- ctor moved to .cc to make use of archive handlerton
sql/ha_myisam.cc:
- add handlerton instance, init handler::ht with it
sql/ha_myisam.h:
- ctor moved to .cc to make use of MyISAM handlerton
sql/ha_myisammrg.cc:
- init handler::ht in the ctor
sql/ha_myisammrg.h:
- ctor moved to .cc to make use of MyISAM MERGE handlerton
sql/ha_ndbcluster.cc:
- init handlerton::flags and handler::ht
sql/handler.cc:
- drop support for ISAM storage engine, which was removed from 5.0
- close all "transient" cursors at COMMIT/ROLLBACK. A "transient"
SQL level cursor is a cursor that uses tables that have a transaction-
specific state.
sql/handler.h:
- extend struct handlerton with flags, add handlerton *ht to every
handler instance.
sql/lock.cc:
- extend mysql_lock_tables to send error to the client if
thr_multi_lock returns a timeout or a deadlock error.
sql/mysqld.cc:
- add server option --table_lock_wait_timeout (in seconds)
sql/set_var.cc:
- add new global variable 'table_lock_wait_timeout' to specify
a wait timeout for table-level locks of MySQL (in seconds). The default
timeout is 50 seconds. The timeout is active only if the connection
has open cursors.
sql/sql_class.cc:
- implement Statement_map::close_transient_cursors
- safety suggests that we need an assert ensuring
llock_info->n_cursors is functioning properly, adjust destruction of
the Statement_map to allow such assert in THD::~THD
sql/sql_class.h:
- add support for Cursors registry to Statement map.
sql/sql_prepare.cc:
- maintain a list of cursors that must be closed at commit/rollback.
sql/sql_select.cc:
- extend class Cursor to support specific at-COMMIT/ROLLBACK behavior.
If a cursor uses tables of a storage engine that
invalidates all open tables at COMMIT/ROLLBACK, it must be closed
before COMMIT/ROLLBACK is executed.
sql/sql_select.h:
- add an own lock_id and commit/rollback status flag to class Cursor
tests/mysql_client_test.c:
A test case for Bug#10760 and complementary issues: test a simple
deadlock case too.
mysql-test/var:
New BitKeeper file ``mysql-test/var''
2005-07-19 20:21:12 +02:00
|
|
|
{"table_lock_wait_timeout", (char*) &table_lock_wait_timeout, SHOW_LONG },
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_table_type.name, (char*) &sys_table_type, SHOW_SYS},
|
|
|
|
{sys_thread_cache_size.name,(char*) &sys_thread_cache_size, SHOW_SYS},
|
|
|
|
#ifdef HAVE_THR_SETCONCURRENCY
|
|
|
|
{"thread_concurrency", (char*) &concurrency, SHOW_LONG},
|
|
|
|
#endif
|
|
|
|
{"thread_stack", (char*) &thread_stack, SHOW_LONG},
|
2003-11-03 13:01:59 +01:00
|
|
|
{sys_time_format.name, (char*) &sys_time_format, SHOW_SYS},
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
{"time_zone", (char*) &sys_time_zone, SHOW_SYS},
|
2004-12-24 13:31:21 +01:00
|
|
|
{sys_timed_mutexes.name, (char*) &sys_timed_mutexes, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_tmp_table_size.name, (char*) &sys_tmp_table_size, SHOW_SYS},
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
{sys_tmpdir.name, (char*) &sys_tmpdir, SHOW_SYS},
|
2003-10-11 21:00:24 +02:00
|
|
|
{sys_trans_alloc_block_size.name, (char*) &sys_trans_alloc_block_size,
|
|
|
|
SHOW_SYS},
|
|
|
|
{sys_trans_prealloc_size.name, (char*) &sys_trans_prealloc_size, SHOW_SYS},
|
2004-04-28 12:08:54 +02:00
|
|
|
{sys_tx_isolation.name, (char*) &sys_tx_isolation, SHOW_SYS},
|
2004-10-07 11:13:42 +02:00
|
|
|
{sys_updatable_views_with_limit.name,
|
|
|
|
(char*) &sys_updatable_views_with_limit,SHOW_SYS},
|
2006-04-21 06:56:53 +02:00
|
|
|
{sys_version.name, (char*) &sys_version, SHOW_SYS},
|
2003-11-28 11:18:13 +01:00
|
|
|
#ifdef HAVE_BERKELEY_DB
|
2006-04-21 06:56:53 +02:00
|
|
|
{sys_version_bdb.name, (char*) &sys_version_bdb, SHOW_SYS},
|
2003-11-28 11:18:13 +01:00
|
|
|
#endif
|
2006-04-21 06:56:53 +02:00
|
|
|
{sys_version_comment.name, (char*) &sys_version_comment, SHOW_SYS},
|
|
|
|
{sys_version_compile_machine.name, (char*) &sys_version_compile_machine,
|
|
|
|
SHOW_SYS},
|
|
|
|
{sys_version_compile_os.name, (char*) &sys_version_compile_os, SHOW_SYS},
|
2002-07-23 17:31:22 +02:00
|
|
|
{sys_net_wait_timeout.name, (char*) &sys_net_wait_timeout, SHOW_SYS},
|
|
|
|
{NullS, NullS, SHOW_LONG}
|
|
|
|
};
|
|
|
|
|
2003-10-20 10:24:18 +02:00
|
|
|
|
2003-10-24 16:28:32 +02:00
|
|
|
bool sys_var::check(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
var->save_result.ulonglong_value= var->value->val_int();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-04-28 12:08:54 +02:00
|
|
|
bool sys_var_str::check(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
int res;
|
|
|
|
if (!check_func)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if ((res=(*check_func)(thd, var)) < 0)
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0),
|
|
|
|
name, var->value->str_value.ptr());
|
2004-04-28 12:08:54 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/*
|
|
|
|
Functions to check and update variables
|
|
|
|
*/
|
|
|
|
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
|
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
(Similar to the client command: mysql_options(... MYSQL_INIT_COMMAND ...).
sql/mysql_priv.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/mysqld.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/protocol.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/set_var.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/slave.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_parse.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_show.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
2003-12-08 06:13:14 +01:00
|
|
|
/*
|
|
|
|
Update variables 'init_connect, init_slave'.
|
|
|
|
|
|
|
|
In case of 'DEFAULT' value
|
|
|
|
(for example: 'set GLOBAL init_connect=DEFAULT')
|
|
|
|
'var' parameter is NULL pointer.
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex,
|
|
|
|
set_var *var)
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
{
|
2004-04-28 12:08:54 +02:00
|
|
|
char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
|
|
|
|
uint new_length= (var ? var->value->str_value.length() : 0);
|
|
|
|
if (!old_value)
|
|
|
|
old_value= (char*) "";
|
2006-06-27 12:56:24 +02:00
|
|
|
if (!(res= my_strdup_with_length(old_value, new_length, MYF(0))))
|
2004-04-28 12:08:54 +02:00
|
|
|
return 1;
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
/*
|
|
|
|
Replace the old value in such a way that the any thread using
|
|
|
|
the value will work.
|
|
|
|
*/
|
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
(Similar to the client command: mysql_options(... MYSQL_INIT_COMMAND ...).
sql/mysql_priv.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/mysqld.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/protocol.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/set_var.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/slave.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_parse.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_show.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
2003-12-08 06:13:14 +01:00
|
|
|
rw_wrlock(var_mutex);
|
|
|
|
old_value= var_str->value;
|
|
|
|
var_str->value= res;
|
|
|
|
var_str->value_length= new_length;
|
|
|
|
rw_unlock(var_mutex);
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
my_free(old_value, MYF(MY_ALLOW_ZERO_PTR));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
(Similar to the client command: mysql_options(... MYSQL_INIT_COMMAND ...).
sql/mysql_priv.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/mysqld.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/protocol.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/set_var.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/slave.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_parse.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_show.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
2003-12-08 06:13:14 +01:00
|
|
|
static bool sys_update_init_connect(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
return update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, var);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
static void sys_default_init_connect(THD* thd, enum_var_type type)
|
|
|
|
{
|
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
(Similar to the client command: mysql_options(... MYSQL_INIT_COMMAND ...).
sql/mysql_priv.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/mysqld.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/protocol.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/set_var.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/slave.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_parse.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_show.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
2003-12-08 06:13:14 +01:00
|
|
|
update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, 0);
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool sys_update_init_slave(THD *thd, set_var *var)
|
|
|
|
{
|
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
(Similar to the client command: mysql_options(... MYSQL_INIT_COMMAND ...).
sql/mysql_priv.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/mysqld.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/protocol.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/set_var.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/slave.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_parse.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_show.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
2003-12-08 06:13:14 +01:00
|
|
|
return update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, var);
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void sys_default_init_slave(THD* thd, enum_var_type type)
|
|
|
|
{
|
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
(Similar to the client command: mysql_options(... MYSQL_INIT_COMMAND ...).
sql/mysql_priv.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/mysqld.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/protocol.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/set_var.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/slave.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_class.h:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_parse.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
sql/sql_show.cc:
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
2003-12-08 06:13:14 +01:00
|
|
|
update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, 0);
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
}
|
|
|
|
|
2004-04-28 12:08:54 +02:00
|
|
|
static int sys_check_ftb_syntax(THD *thd, set_var *var)
|
|
|
|
{
|
2005-09-15 21:29:07 +02:00
|
|
|
if (thd->security_ctx->master_access & SUPER_ACL)
|
|
|
|
return (ft_boolean_check_syntax_string((byte*)
|
|
|
|
var->value->str_value.c_ptr()) ?
|
|
|
|
-1 : 0);
|
2004-04-28 12:08:54 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool sys_update_ftb_syntax(THD *thd, set_var * var)
|
|
|
|
{
|
|
|
|
strmake(ft_boolean_syntax, var->value->str_value.c_ptr(),
|
|
|
|
sizeof(ft_boolean_syntax)-1);
|
2007-05-08 11:24:07 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_QUERY_CACHE
|
|
|
|
query_cache.flush();
|
|
|
|
#endif /* HAVE_QUERY_CACHE */
|
|
|
|
|
2004-04-28 12:08:54 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sys_default_ftb_syntax(THD *thd, enum_var_type type)
|
|
|
|
{
|
2004-04-07 20:58:33 +02:00
|
|
|
strmake(ft_boolean_syntax, def_ft_boolean_syntax,
|
2004-04-28 12:08:54 +02:00
|
|
|
sizeof(ft_boolean_syntax)-1);
|
|
|
|
}
|
SCRUM:
Task 499 'init_connect, init_slave options'
mysql-test/mysql-test-run.sh:
Task 499 'init_connect, init_slave options'
This change needs because mysql-test-run cuts string variable on first space
sql/mysql_priv.h:
Task 499 'init_connect, init_slave options'
sql/mysqld.cc:
Task 499 'init_connect, init_slave options'
sql/protocol.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.cc:
Task 499 'init_connect, init_slave options'
sql/set_var.h:
Task 499 'init_connect, init_slave options'
sql/slave.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.cc:
Task 499 'init_connect, init_slave options'
sql/sql_class.h:
Task 499 'init_connect, init_slave options'
sql/sql_parse.cc:
Task 499 'init_connect, init_slave options'
sql/sql_show.cc:
Task 499 'init_connect, init_slave options'
2003-07-18 11:11:01 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
If one sets the LOW_PRIORIY UPDATES flag, we also must change the
|
|
|
|
used lock type
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void fix_low_priority_updates(THD *thd, enum_var_type type)
|
|
|
|
{
|
2007-06-03 08:40:00 +02:00
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
thr_upgraded_concurrent_insert_lock=
|
|
|
|
(global_system_variables.low_priority_updates ?
|
|
|
|
TL_WRITE_LOW_PRIORITY : TL_WRITE);
|
|
|
|
else
|
2002-07-23 17:31:22 +02:00
|
|
|
thd->update_lock_default= (thd->variables.low_priority_updates ?
|
|
|
|
TL_WRITE_LOW_PRIORITY : TL_WRITE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-05-13 18:34:51 +02:00
|
|
|
static void
|
|
|
|
fix_myisam_max_sort_file_size(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
myisam_max_temp_length=
|
|
|
|
(my_off_t) global_system_variables.myisam_max_sort_file_size;
|
|
|
|
}
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/*
|
|
|
|
Set the OPTION_BIG_SELECTS flag if max_join_size == HA_POS_ERROR
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void fix_max_join_size(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type != OPT_GLOBAL)
|
|
|
|
{
|
2002-12-20 13:58:27 +01:00
|
|
|
if (thd->variables.max_join_size == HA_POS_ERROR)
|
2002-07-23 17:31:22 +02:00
|
|
|
thd->options|= OPTION_BIG_SELECTS;
|
|
|
|
else
|
|
|
|
thd->options&= ~OPTION_BIG_SELECTS;
|
|
|
|
}
|
|
|
|
}
|
2003-10-06 14:11:16 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
If one doesn't use the SESSION modifier, the isolation level
|
|
|
|
is only active for the next command
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void fix_tx_isolation(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_SESSION)
|
|
|
|
thd->session_tx_isolation= ((enum_tx_isolation)
|
|
|
|
thd->variables.tx_isolation);
|
|
|
|
}
|
|
|
|
|
2006-09-29 05:15:58 +02:00
|
|
|
static void fix_completion_type(THD *thd __attribute__((unused)),
|
|
|
|
enum_var_type type __attribute__((unused))) {}
|
2005-02-01 20:48:05 +01:00
|
|
|
|
|
|
|
static int check_completion_type(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
longlong val= var->value->val_int();
|
|
|
|
if (val < 0 || val > 2)
|
|
|
|
{
|
|
|
|
char buf[64];
|
|
|
|
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, llstr(val, buf));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
If we are changing the thread variable, we have to copy it to NET too
|
|
|
|
*/
|
|
|
|
|
2003-01-15 09:11:44 +01:00
|
|
|
#ifdef HAVE_REPLICATION
|
2002-07-23 17:31:22 +02:00
|
|
|
static void fix_net_read_timeout(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type != OPT_GLOBAL)
|
2007-05-24 11:21:27 +02:00
|
|
|
my_net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void fix_net_write_timeout(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type != OPT_GLOBAL)
|
2007-05-24 11:21:27 +02:00
|
|
|
my_net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
2002-08-08 19:49:06 +02:00
|
|
|
static void fix_net_retry_count(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type != OPT_GLOBAL)
|
|
|
|
thd->net.retry_count=thd->variables.net_retry_count;
|
|
|
|
}
|
2003-01-15 09:11:44 +01:00
|
|
|
#else /* HAVE_REPLICATION */
|
2006-08-17 21:25:40 +02:00
|
|
|
static void fix_net_read_timeout(THD *thd __attribute__((unused)),
|
|
|
|
enum_var_type type __attribute__((unused)))
|
2002-12-16 14:33:29 +01:00
|
|
|
{}
|
2006-08-17 21:25:40 +02:00
|
|
|
static void fix_net_write_timeout(THD *thd __attribute__((unused)),
|
|
|
|
enum_var_type type __attribute__((unused)))
|
2002-12-16 14:33:29 +01:00
|
|
|
{}
|
2006-08-17 21:25:40 +02:00
|
|
|
static void fix_net_retry_count(THD *thd __attribute__((unused)),
|
|
|
|
enum_var_type type __attribute__((unused)))
|
2002-12-16 14:33:29 +01:00
|
|
|
{}
|
2003-01-15 09:11:44 +01:00
|
|
|
#endif /* HAVE_REPLICATION */
|
2002-08-08 19:49:06 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
static void fix_query_cache_size(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_QUERY_CACHE
|
2003-10-08 23:13:15 +02:00
|
|
|
ulong requested= query_cache_size;
|
2002-07-23 17:31:22 +02:00
|
|
|
query_cache.resize(query_cache_size);
|
2003-10-08 23:13:15 +02:00
|
|
|
if (requested != query_cache_size)
|
|
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
|
|
ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE),
|
|
|
|
requested, query_cache_size);
|
2002-07-23 17:31:22 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-02 20:39:03 +01:00
|
|
|
#ifdef HAVE_QUERY_CACHE
|
|
|
|
static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type)
|
|
|
|
{
|
2006-04-13 09:50:33 +02:00
|
|
|
query_cache_min_res_unit=
|
2003-03-02 20:39:03 +01:00
|
|
|
query_cache.set_min_res_unit(query_cache_min_res_unit);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2003-10-06 14:11:16 +02:00
|
|
|
extern void fix_delay_key_write(THD *thd, enum_var_type type)
|
2002-08-13 01:18:39 +02:00
|
|
|
{
|
|
|
|
switch ((enum_delay_key_write) delay_key_write_options) {
|
|
|
|
case DELAY_KEY_WRITE_NONE:
|
|
|
|
myisam_delay_key_write=0;
|
|
|
|
break;
|
|
|
|
case DELAY_KEY_WRITE_ON:
|
|
|
|
myisam_delay_key_write=1;
|
|
|
|
break;
|
|
|
|
case DELAY_KEY_WRITE_ALL:
|
|
|
|
myisam_delay_key_write=1;
|
|
|
|
ha_open_options|= HA_OPEN_DELAY_KEY_WRITE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-06 14:11:16 +02:00
|
|
|
static void fix_max_binlog_size(THD *thd, enum_var_type type)
|
2003-07-06 17:59:54 +02:00
|
|
|
{
|
|
|
|
DBUG_ENTER("fix_max_binlog_size");
|
|
|
|
DBUG_PRINT("info",("max_binlog_size=%lu max_relay_log_size=%lu",
|
|
|
|
max_binlog_size, max_relay_log_size));
|
|
|
|
mysql_bin_log.set_max_size(max_binlog_size);
|
2003-08-19 15:00:12 +02:00
|
|
|
#ifdef HAVE_REPLICATION
|
2003-07-06 17:59:54 +02:00
|
|
|
if (!max_relay_log_size)
|
|
|
|
active_mi->rli.relay_log.set_max_size(max_binlog_size);
|
2003-08-18 23:08:08 +02:00
|
|
|
#endif
|
2003-07-06 17:59:54 +02:00
|
|
|
DBUG_VOID_RETURN;
|
|
|
|
}
|
|
|
|
|
2003-10-06 14:11:16 +02:00
|
|
|
static void fix_max_relay_log_size(THD *thd, enum_var_type type)
|
2003-07-06 17:59:54 +02:00
|
|
|
{
|
|
|
|
DBUG_ENTER("fix_max_relay_log_size");
|
|
|
|
DBUG_PRINT("info",("max_binlog_size=%lu max_relay_log_size=%lu",
|
|
|
|
max_binlog_size, max_relay_log_size));
|
2003-08-19 15:00:12 +02:00
|
|
|
#ifdef HAVE_REPLICATION
|
2003-07-06 17:59:54 +02:00
|
|
|
active_mi->rli.relay_log.set_max_size(max_relay_log_size ?
|
|
|
|
max_relay_log_size: max_binlog_size);
|
2003-08-19 15:00:12 +02:00
|
|
|
#endif
|
2003-07-06 17:59:54 +02:00
|
|
|
DBUG_VOID_RETURN;
|
|
|
|
}
|
2002-08-13 01:18:39 +02:00
|
|
|
|
2003-10-16 06:44:18 +02:00
|
|
|
|
2004-04-09 18:50:28 +02:00
|
|
|
static int check_max_delayed_threads(THD *thd, set_var *var)
|
|
|
|
{
|
2004-04-27 14:33:40 +02:00
|
|
|
longlong val= var->value->val_int();
|
2004-04-09 18:50:28 +02:00
|
|
|
if (var->type != OPT_GLOBAL && val != 0 &&
|
2004-04-27 14:33:40 +02:00
|
|
|
val != (longlong) global_system_variables.max_insert_delayed_threads)
|
2004-04-09 18:50:28 +02:00
|
|
|
{
|
|
|
|
char buf[64];
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, llstr(val, buf));
|
2004-04-09 18:50:28 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-10-16 06:44:18 +02:00
|
|
|
static void fix_max_connections(THD *thd, enum_var_type type)
|
2003-10-06 14:11:16 +02:00
|
|
|
{
|
2004-07-22 21:00:50 +02:00
|
|
|
#ifndef EMBEDDED_LIBRARY
|
2006-04-13 09:50:33 +02:00
|
|
|
resize_thr_alarm(max_connections +
|
2004-04-28 12:08:54 +02:00
|
|
|
global_system_variables.max_insert_delayed_threads + 10);
|
2004-07-22 21:00:50 +02:00
|
|
|
#endif
|
2004-04-28 12:08:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void fix_thd_mem_root(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type != OPT_GLOBAL)
|
2004-11-08 00:13:54 +01:00
|
|
|
reset_root_defaults(thd->mem_root,
|
2004-04-28 12:08:54 +02:00
|
|
|
thd->variables.query_alloc_block_size,
|
|
|
|
thd->variables.query_prealloc_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void fix_trans_mem_root(THD *thd, enum_var_type type)
|
|
|
|
{
|
2005-03-04 12:29:05 +01:00
|
|
|
#ifdef USING_TRANSACTIONS
|
2004-04-28 12:08:54 +02:00
|
|
|
if (type != OPT_GLOBAL)
|
|
|
|
reset_root_defaults(&thd->transaction.mem_root,
|
|
|
|
thd->variables.trans_alloc_block_size,
|
|
|
|
thd->variables.trans_prealloc_size);
|
2005-03-04 12:29:05 +01:00
|
|
|
#endif
|
2003-10-06 14:11:16 +02:00
|
|
|
}
|
|
|
|
|
2004-05-19 23:54:52 +02:00
|
|
|
|
2004-05-19 15:03:32 +02:00
|
|
|
static void fix_server_id(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
server_id_supplied = 1;
|
|
|
|
}
|
2004-02-02 21:01:58 +01:00
|
|
|
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
|
|
|
|
sys_var_long_ptr::
|
2006-12-14 23:51:37 +01:00
|
|
|
sys_var_long_ptr(const char *name_arg, ulong *value_ptr_arg,
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
sys_after_update_func after_update_arg)
|
2006-12-14 23:51:37 +01:00
|
|
|
:sys_var_long_ptr_global(name_arg, value_ptr_arg,
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
&LOCK_global_system_variables, after_update_arg)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_long_ptr_global::check(THD *thd, set_var *var)
|
2005-02-17 12:04:04 +01:00
|
|
|
{
|
|
|
|
longlong v= var->value->val_int();
|
|
|
|
var->save_result.ulonglong_value= v < 0 ? 0 : v;
|
|
|
|
return 0;
|
|
|
|
}
|
2004-05-19 23:54:52 +02:00
|
|
|
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
bool sys_var_long_ptr_global::update(THD *thd, set_var *var)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
ulonglong tmp= var->save_result.ulonglong_value;
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
pthread_mutex_lock(guard);
|
2002-07-23 17:31:22 +02:00
|
|
|
if (option_limits)
|
|
|
|
*value= (ulong) getopt_ull_limit_value(tmp, option_limits);
|
|
|
|
else
|
|
|
|
*value= (ulong) tmp;
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
pthread_mutex_unlock(guard);
|
2002-07-23 17:31:22 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
void sys_var_long_ptr_global::set_default(THD *thd, enum_var_type type)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
pthread_mutex_lock(guard);
|
2002-07-23 17:31:22 +02:00
|
|
|
*value= (ulong) option_limits->def_value;
|
A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
2006-04-07 21:37:06 +02:00
|
|
|
pthread_mutex_unlock(guard);
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-12-05 15:38:49 +01:00
|
|
|
bool sys_var_ulonglong_ptr::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
ulonglong tmp= var->save_result.ulonglong_value;
|
2003-08-17 13:10:15 +02:00
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2002-12-05 15:38:49 +01:00
|
|
|
if (option_limits)
|
|
|
|
*value= (ulonglong) getopt_ull_limit_value(tmp, option_limits);
|
|
|
|
else
|
|
|
|
*value= (ulonglong) tmp;
|
2003-08-17 13:10:15 +02:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
2002-12-05 15:38:49 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_ulonglong_ptr::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
2003-08-17 13:10:15 +02:00
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2002-12-05 15:38:49 +01:00
|
|
|
*value= (ulonglong) option_limits->def_value;
|
2003-08-17 13:10:15 +02:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
2002-12-05 15:38:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
bool sys_var_bool_ptr::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
*value= (my_bool) var->save_result.ulong_value;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_bool_ptr::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
*value= (my_bool) option_limits->def_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-13 01:18:39 +02:00
|
|
|
bool sys_var_enum::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
*value= (uint) var->save_result.ulong_value;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_enum::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
|
2002-08-13 01:18:39 +02:00
|
|
|
{
|
|
|
|
return (byte*) enum_names->type_names[*value];
|
|
|
|
}
|
|
|
|
|
2004-04-28 12:08:54 +02:00
|
|
|
bool sys_var_thd_ulong::check(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
return (sys_var_thd::check(thd, var) ||
|
|
|
|
(check_func && (*check_func)(thd, var)));
|
|
|
|
}
|
2002-08-13 01:18:39 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
bool sys_var_thd_ulong::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
ulonglong tmp= var->save_result.ulonglong_value;
|
2007-10-04 10:34:00 +02:00
|
|
|
char buf[22];
|
|
|
|
bool truncated= false;
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
/* Don't use bigger value than given with --maximum-variable-name=.. */
|
|
|
|
if ((ulong) tmp > max_system_variables.*offset)
|
2007-10-04 10:34:00 +02:00
|
|
|
{
|
|
|
|
truncated= true;
|
|
|
|
llstr(tmp, buf);
|
2002-07-23 17:31:22 +02:00
|
|
|
tmp= max_system_variables.*offset;
|
2007-10-04 10:34:00 +02:00
|
|
|
}
|
2002-07-23 17:31:22 +02:00
|
|
|
|
2005-07-31 11:49:55 +02:00
|
|
|
#if SIZEOF_LONG == 4
|
|
|
|
/* Avoid overflows on 32 bit systems */
|
|
|
|
if (tmp > (ulonglong) ~(ulong) 0)
|
2007-10-04 10:34:00 +02:00
|
|
|
{
|
|
|
|
truncated= true;
|
|
|
|
llstr(tmp, buf);
|
2005-07-31 11:49:55 +02:00
|
|
|
tmp= ((ulonglong) ~(ulong) 0);
|
2007-10-04 10:34:00 +02:00
|
|
|
}
|
2005-07-31 11:49:55 +02:00
|
|
|
#endif
|
2007-10-04 10:34:00 +02:00
|
|
|
if (truncated)
|
|
|
|
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
|
|
ER_TRUNCATED_WRONG_VALUE,
|
|
|
|
ER(ER_TRUNCATED_WRONG_VALUE), name,
|
|
|
|
buf);
|
2005-07-31 11:49:55 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
if (option_limits)
|
|
|
|
tmp= (ulong) getopt_ull_limit_value(tmp, option_limits);
|
|
|
|
if (var->type == OPT_GLOBAL)
|
2002-08-12 02:33:46 +02:00
|
|
|
global_system_variables.*offset= (ulong) tmp;
|
2002-07-23 17:31:22 +02:00
|
|
|
else
|
|
|
|
thd->variables.*offset= (ulong) tmp;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_thd_ulong::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
{
|
|
|
|
/* We will not come here if option_limits is not set */
|
|
|
|
global_system_variables.*offset= (ulong) option_limits->def_value;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
thd->variables.*offset= global_system_variables.*offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
return (byte*) &(global_system_variables.*offset);
|
|
|
|
return (byte*) &(thd->variables.*offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-12-20 13:58:27 +01:00
|
|
|
bool sys_var_thd_ha_rows::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
ulonglong tmp= var->save_result.ulonglong_value;
|
2002-12-20 13:58:27 +01:00
|
|
|
|
|
|
|
/* Don't use bigger value than given with --maximum-variable-name=.. */
|
|
|
|
if ((ha_rows) tmp > max_system_variables.*offset)
|
|
|
|
tmp= max_system_variables.*offset;
|
|
|
|
|
|
|
|
if (option_limits)
|
|
|
|
tmp= (ha_rows) getopt_ull_limit_value(tmp, option_limits);
|
|
|
|
if (var->type == OPT_GLOBAL)
|
|
|
|
{
|
|
|
|
/* Lock is needed to make things safe on 32 bit systems */
|
2006-04-13 09:50:33 +02:00
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2002-12-20 13:58:27 +01:00
|
|
|
global_system_variables.*offset= (ha_rows) tmp;
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
thd->variables.*offset= (ha_rows) tmp;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_thd_ha_rows::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
{
|
|
|
|
/* We will not come here if option_limits is not set */
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
|
|
|
global_system_variables.*offset= (ha_rows) option_limits->def_value;
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
thd->variables.*offset= global_system_variables.*offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2002-12-20 13:58:27 +01:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
return (byte*) &(global_system_variables.*offset);
|
|
|
|
return (byte*) &(thd->variables.*offset);
|
|
|
|
}
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
bool sys_var_thd_ulonglong::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
ulonglong tmp= var->save_result.ulonglong_value;
|
2003-05-13 18:34:51 +02:00
|
|
|
|
2004-05-19 14:42:29 +02:00
|
|
|
if (tmp > max_system_variables.*offset)
|
2003-05-13 18:34:51 +02:00
|
|
|
tmp= max_system_variables.*offset;
|
|
|
|
|
|
|
|
if (option_limits)
|
2004-05-19 14:42:29 +02:00
|
|
|
tmp= getopt_ull_limit_value(tmp, option_limits);
|
2002-07-23 17:31:22 +02:00
|
|
|
if (var->type == OPT_GLOBAL)
|
2002-12-20 13:58:27 +01:00
|
|
|
{
|
|
|
|
/* Lock is needed to make things safe on 32 bit systems */
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2003-05-13 18:34:51 +02:00
|
|
|
global_system_variables.*offset= (ulonglong) tmp;
|
2002-12-20 13:58:27 +01:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
}
|
2002-07-23 17:31:22 +02:00
|
|
|
else
|
2003-05-13 18:34:51 +02:00
|
|
|
thd->variables.*offset= (ulonglong) tmp;
|
2002-07-23 17:31:22 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_thd_ulonglong::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
2002-12-20 13:58:27 +01:00
|
|
|
{
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2002-11-11 16:28:58 +01:00
|
|
|
global_system_variables.*offset= (ulonglong) option_limits->def_value;
|
2002-12-20 13:58:27 +01:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
}
|
2002-07-23 17:31:22 +02:00
|
|
|
else
|
|
|
|
thd->variables.*offset= global_system_variables.*offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_thd_ulonglong::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
return (byte*) &(global_system_variables.*offset);
|
|
|
|
return (byte*) &(thd->variables.*offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_thd_bool::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
if (var->type == OPT_GLOBAL)
|
|
|
|
global_system_variables.*offset= (my_bool) var->save_result.ulong_value;
|
|
|
|
else
|
|
|
|
thd->variables.*offset= (my_bool) var->save_result.ulong_value;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_thd_bool::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.*offset= (my_bool) option_limits->def_value;
|
|
|
|
else
|
|
|
|
thd->variables.*offset= global_system_variables.*offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
return (byte*) &(global_system_variables.*offset);
|
|
|
|
return (byte*) &(thd->variables.*offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var::check_enum(THD *thd, set_var *var, TYPELIB *enum_names)
|
|
|
|
{
|
2005-02-08 23:50:45 +01:00
|
|
|
char buff[STRING_BUFFER_USUAL_SIZE];
|
2003-10-14 15:30:42 +02:00
|
|
|
const char *value;
|
2002-10-02 12:33:08 +02:00
|
|
|
String str(buff, sizeof(buff), system_charset_info), *res;
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
if (var->value->result_type() == STRING_RESULT)
|
|
|
|
{
|
|
|
|
if (!(res=var->value->val_str(&str)) ||
|
|
|
|
((long) (var->save_result.ulong_value=
|
2003-11-03 13:01:59 +01:00
|
|
|
(ulong) find_type(enum_names, res->ptr(),
|
|
|
|
res->length(),1)-1)) < 0)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2003-10-14 15:30:42 +02:00
|
|
|
value= res ? res->c_ptr() : "NULL";
|
2002-07-23 17:31:22 +02:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ulonglong tmp=var->value->val_int();
|
|
|
|
if (tmp >= enum_names->count)
|
|
|
|
{
|
|
|
|
llstr(tmp,buff);
|
|
|
|
value=buff; // Wrong value is here
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
var->save_result.ulong_value= (ulong) tmp; // Save for update
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
err:
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, value);
|
2002-07-23 17:31:22 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2003-01-16 01:04:50 +01:00
|
|
|
|
|
|
|
bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names)
|
|
|
|
{
|
2003-04-30 09:02:28 +02:00
|
|
|
bool not_used;
|
2005-02-08 23:50:45 +01:00
|
|
|
char buff[STRING_BUFFER_USUAL_SIZE], *error= 0;
|
2003-01-16 01:04:50 +01:00
|
|
|
uint error_len= 0;
|
|
|
|
String str(buff, sizeof(buff), system_charset_info), *res;
|
|
|
|
|
|
|
|
if (var->value->result_type() == STRING_RESULT)
|
|
|
|
{
|
|
|
|
if (!(res= var->value->val_str(&str)))
|
2005-06-09 11:39:29 +02:00
|
|
|
{
|
2005-06-21 17:18:58 +02:00
|
|
|
strmov(buff, "NULL");
|
2003-01-16 01:04:50 +01:00
|
|
|
goto err;
|
2005-06-09 11:39:29 +02:00
|
|
|
}
|
2003-08-18 23:08:08 +02:00
|
|
|
var->save_result.ulong_value= ((ulong)
|
|
|
|
find_set(enum_names, res->c_ptr(),
|
2004-10-26 10:17:37 +02:00
|
|
|
res->length(),
|
|
|
|
NULL,
|
|
|
|
&error, &error_len,
|
2003-08-18 23:08:08 +02:00
|
|
|
¬_used));
|
2003-01-16 01:04:50 +01:00
|
|
|
if (error_len)
|
|
|
|
{
|
2007-10-18 10:47:54 +02:00
|
|
|
strmake(buff, error, min(sizeof(buff) - 1, error_len));
|
2003-01-16 01:04:50 +01:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ulonglong tmp= var->value->val_int();
|
2006-02-18 17:32:15 +01:00
|
|
|
/*
|
|
|
|
For when the enum is made to contain 64 elements, as 1ULL<<64 is
|
|
|
|
undefined, we guard with a "count<64" test.
|
|
|
|
*/
|
|
|
|
if (unlikely((tmp >= ((ULL(1)) << enum_names->count)) &&
|
|
|
|
(enum_names->count < 64)))
|
2003-01-16 01:04:50 +01:00
|
|
|
{
|
|
|
|
llstr(tmp, buff);
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
var->save_result.ulong_value= (ulong) tmp; // Save for update
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
err:
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buff);
|
2003-01-16 01:04:50 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/*
|
|
|
|
Return an Item for a variable. Used with @@[global.]variable_name
|
|
|
|
If type is not given, return local value if exists, else global
|
|
|
|
*/
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
if (check_type(var_type))
|
|
|
|
{
|
|
|
|
if (var_type != OPT_DEFAULT)
|
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0),
|
|
|
|
name, var_type == OPT_GLOBAL ? "SESSION" : "GLOBAL");
|
2002-07-23 17:31:22 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* As there was no local variable, return the global value */
|
|
|
|
var_type= OPT_GLOBAL;
|
|
|
|
}
|
2006-12-14 23:51:37 +01:00
|
|
|
switch (show_type()) {
|
2005-01-19 22:54:01 +01:00
|
|
|
case SHOW_INT:
|
|
|
|
{
|
|
|
|
uint value;
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
|
|
|
value= *(uint*) value_ptr(thd, var_type, base);
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
2005-07-31 11:49:55 +02:00
|
|
|
return new Item_uint((ulonglong) value);
|
2005-01-19 22:54:01 +01:00
|
|
|
}
|
2002-07-23 17:31:22 +02:00
|
|
|
case SHOW_LONG:
|
2003-11-18 12:47:27 +01:00
|
|
|
{
|
|
|
|
ulong value;
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
|
|
|
value= *(ulong*) value_ptr(thd, var_type, base);
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
2005-07-31 11:49:55 +02:00
|
|
|
return new Item_uint((ulonglong) value);
|
2003-11-18 12:47:27 +01:00
|
|
|
}
|
2002-07-23 17:31:22 +02:00
|
|
|
case SHOW_LONGLONG:
|
2003-08-17 13:10:15 +02:00
|
|
|
{
|
|
|
|
longlong value;
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2003-08-29 12:44:35 +02:00
|
|
|
value= *(longlong*) value_ptr(thd, var_type, base);
|
2003-08-17 13:10:15 +02:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
return new Item_int(value);
|
|
|
|
}
|
2002-12-20 13:58:27 +01:00
|
|
|
case SHOW_HA_ROWS:
|
2003-08-17 13:10:15 +02:00
|
|
|
{
|
|
|
|
ha_rows value;
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2003-08-29 12:44:35 +02:00
|
|
|
value= *(ha_rows*) value_ptr(thd, var_type, base);
|
2003-08-17 13:10:15 +02:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
return new Item_int((longlong) value);
|
|
|
|
}
|
2002-07-23 17:31:22 +02:00
|
|
|
case SHOW_MY_BOOL:
|
2003-07-06 18:09:57 +02:00
|
|
|
return new Item_int((int32) *(my_bool*) value_ptr(thd, var_type, base),1);
|
2002-07-23 17:31:22 +02:00
|
|
|
case SHOW_CHAR:
|
|
|
|
{
|
2005-08-30 14:11:59 +02:00
|
|
|
Item *tmp;
|
2003-11-03 13:01:59 +01:00
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2003-07-06 18:09:57 +02:00
|
|
|
char *str= (char*) value_ptr(thd, var_type, base);
|
2005-08-30 14:11:59 +02:00
|
|
|
if (str)
|
|
|
|
tmp= new Item_string(str, strlen(str),
|
|
|
|
system_charset_info, DERIVATION_SYSCONST);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tmp= new Item_null();
|
|
|
|
tmp->collation.set(system_charset_info, DERIVATION_SYSCONST);
|
|
|
|
}
|
2003-11-03 13:01:59 +01:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
return tmp;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
default:
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_VAR_CANT_BE_READ, MYF(0), name);
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_thd_enum::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
if (var->type == OPT_GLOBAL)
|
|
|
|
global_system_variables.*offset= var->save_result.ulong_value;
|
|
|
|
else
|
|
|
|
thd->variables.*offset= var->save_result.ulong_value;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_thd_enum::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.*offset= (ulong) option_limits->def_value;
|
|
|
|
else
|
|
|
|
thd->variables.*offset= global_system_variables.*offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
ulong tmp= ((type == OPT_GLOBAL) ?
|
|
|
|
global_system_variables.*offset :
|
|
|
|
thd->variables.*offset);
|
|
|
|
return (byte*) enum_names->type_names[tmp];
|
|
|
|
}
|
|
|
|
|
2004-04-28 12:08:54 +02:00
|
|
|
bool sys_var_thd_bit::check(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
return (check_enum(thd, var, &bool_typelib) ||
|
|
|
|
(check_func && (*check_func)(thd, var)));
|
|
|
|
}
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
bool sys_var_thd_bit::update(THD *thd, set_var *var)
|
|
|
|
{
|
2002-09-22 17:02:39 +02:00
|
|
|
int res= (*update_func)(thd, var);
|
2002-07-23 17:31:22 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_thd_bit::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
If reverse is 0 (default) return 1 if bit is set.
|
|
|
|
If reverse is 1, return 0 if bit is set
|
|
|
|
*/
|
|
|
|
thd->sys_var_tmp.my_bool_value= ((thd->options & bit_flag) ?
|
|
|
|
!reverse : reverse);
|
|
|
|
return (byte*) &thd->sys_var_tmp.my_bool_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-03 13:01:59 +01:00
|
|
|
/* Update a date_time format variable based on given value */
|
|
|
|
|
|
|
|
void sys_var_thd_date_time_format::update2(THD *thd, enum_var_type type,
|
|
|
|
DATE_TIME_FORMAT *new_value)
|
|
|
|
{
|
|
|
|
DATE_TIME_FORMAT *old;
|
|
|
|
DBUG_ENTER("sys_var_date_time_format::update2");
|
|
|
|
DBUG_DUMP("positions",(char*) new_value->positions,
|
|
|
|
sizeof(new_value->positions));
|
|
|
|
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
{
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
|
|
|
old= (global_system_variables.*offset);
|
|
|
|
(global_system_variables.*offset)= new_value;
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
old= (thd->variables.*offset);
|
|
|
|
(thd->variables.*offset)= new_value;
|
|
|
|
}
|
|
|
|
my_free((char*) old, MYF(MY_ALLOW_ZERO_PTR));
|
|
|
|
DBUG_VOID_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_thd_date_time_format::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
DATE_TIME_FORMAT *new_value;
|
|
|
|
/* We must make a copy of the last value to get it into normal memory */
|
|
|
|
new_value= date_time_format_copy((THD*) 0,
|
|
|
|
var->save_result.date_time_format);
|
|
|
|
if (!new_value)
|
|
|
|
return 1; // Out of memory
|
|
|
|
update2(thd, var->type, new_value); // Can't fail
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_thd_date_time_format::check(THD *thd, set_var *var)
|
|
|
|
{
|
2005-02-08 23:50:45 +01:00
|
|
|
char buff[STRING_BUFFER_USUAL_SIZE];
|
2003-11-03 13:01:59 +01:00
|
|
|
String str(buff,sizeof(buff), system_charset_info), *res;
|
|
|
|
DATE_TIME_FORMAT *format;
|
|
|
|
|
|
|
|
if (!(res=var->value->val_str(&str)))
|
|
|
|
res= &my_empty_string;
|
|
|
|
|
|
|
|
if (!(format= date_time_format_make(date_time_type,
|
|
|
|
res->ptr(), res->length())))
|
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, res->c_ptr());
|
2003-11-03 13:01:59 +01:00
|
|
|
return 1;
|
|
|
|
}
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2003-11-03 13:01:59 +01:00
|
|
|
/*
|
|
|
|
We must copy result to thread space to not get a memory leak if
|
|
|
|
update is aborted
|
|
|
|
*/
|
|
|
|
var->save_result.date_time_format= date_time_format_copy(thd, format);
|
|
|
|
my_free((char*) format, MYF(0));
|
|
|
|
return var->save_result.date_time_format == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_thd_date_time_format::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
DATE_TIME_FORMAT *res= 0;
|
|
|
|
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
{
|
|
|
|
const char *format;
|
|
|
|
if ((format= opt_date_time_formats[date_time_type]))
|
|
|
|
res= date_time_format_make(date_time_type, format, strlen(format));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Make copy with malloc */
|
|
|
|
res= date_time_format_copy((THD *) 0, global_system_variables.*offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (res) // Should always be true
|
|
|
|
update2(thd, type, res);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
byte *sys_var_thd_date_time_format::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
{
|
|
|
|
char *res;
|
|
|
|
/*
|
|
|
|
We do a copy here just to be sure things will work even if someone
|
|
|
|
is modifying the original string while the copy is accessed
|
|
|
|
(Can't happen now in SQL SHOW, but this is a good safety for the future)
|
|
|
|
*/
|
|
|
|
res= thd->strmake((global_system_variables.*offset)->format.str,
|
|
|
|
(global_system_variables.*offset)->format.length);
|
|
|
|
return (byte*) res;
|
|
|
|
}
|
|
|
|
return (byte*) (thd->variables.*offset)->format.str;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-04-07 13:10:27 +02:00
|
|
|
typedef struct old_names_map_st
|
|
|
|
{
|
2003-03-18 14:01:32 +01:00
|
|
|
const char *old_name;
|
|
|
|
const char *new_name;
|
|
|
|
} my_old_conv;
|
2002-07-23 17:31:22 +02:00
|
|
|
|
2006-04-13 09:50:33 +02:00
|
|
|
static my_old_conv old_conv[]=
|
2003-03-18 14:01:32 +01:00
|
|
|
{
|
2003-11-03 13:01:59 +01:00
|
|
|
{ "cp1251_koi8" , "cp1251" },
|
|
|
|
{ "cp1250_latin2" , "cp1250" },
|
|
|
|
{ "kam_latin2" , "keybcs2" },
|
|
|
|
{ "mac_latin2" , "MacRoman" },
|
|
|
|
{ "macce_latin2" , "MacCE" },
|
|
|
|
{ "pc2_latin2" , "pclatin2" },
|
|
|
|
{ "vga_latin2" , "pclatin1" },
|
|
|
|
{ "koi8_cp1251" , "koi8r" },
|
|
|
|
{ "win1251ukr_koi8_ukr" , "win1251ukr" },
|
|
|
|
{ "koi8_ukr_win1251ukr" , "koi8u" },
|
|
|
|
{ NULL , NULL }
|
2003-03-18 14:01:32 +01:00
|
|
|
};
|
2002-07-23 17:31:22 +02:00
|
|
|
|
2003-04-05 15:56:15 +02:00
|
|
|
CHARSET_INFO *get_old_charset_by_name(const char *name)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2003-08-18 23:08:08 +02:00
|
|
|
my_old_conv *conv;
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2003-08-18 23:08:08 +02:00
|
|
|
for (conv= old_conv; conv->old_name; conv++)
|
2002-12-14 16:43:01 +01:00
|
|
|
{
|
2003-08-18 23:08:08 +02:00
|
|
|
if (!my_strcasecmp(&my_charset_latin1, name, conv->old_name))
|
|
|
|
return get_charset_by_csname(conv->new_name, MY_CS_PRIMARY, MYF(0));
|
2002-12-14 16:43:01 +01:00
|
|
|
}
|
2003-03-18 14:01:32 +01:00
|
|
|
return NULL;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
2003-08-18 23:08:08 +02:00
|
|
|
|
2003-04-07 13:10:27 +02:00
|
|
|
bool sys_var_collation::check(THD *thd, set_var *var)
|
2003-02-26 13:37:41 +01:00
|
|
|
{
|
|
|
|
CHARSET_INFO *tmp;
|
|
|
|
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
if (var->value->result_type() == STRING_RESULT)
|
2004-04-28 12:08:54 +02:00
|
|
|
{
|
2005-02-08 23:50:45 +01:00
|
|
|
char buff[STRING_BUFFER_USUAL_SIZE];
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
String str(buff,sizeof(buff), system_charset_info), *res;
|
|
|
|
if (!(res=var->value->val_str(&str)))
|
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL");
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (!(tmp=get_charset_by_name(res->c_ptr(),MYF(0))))
|
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_UNKNOWN_COLLATION, MYF(0), res->c_ptr());
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
return 1;
|
|
|
|
}
|
2004-04-28 12:08:54 +02:00
|
|
|
}
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
else // INT_RESULT
|
2003-05-21 14:44:12 +02:00
|
|
|
{
|
2004-07-08 14:45:25 +02:00
|
|
|
if (!(tmp=get_charset((int) var->value->val_int(),MYF(0))))
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
{
|
|
|
|
char buf[20];
|
2004-07-08 14:45:25 +02:00
|
|
|
int10_to_str((int) var->value->val_int(), buf, -10);
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_UNKNOWN_COLLATION, MYF(0), buf);
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
return 1;
|
|
|
|
}
|
2003-05-21 14:44:12 +02:00
|
|
|
}
|
|
|
|
var->save_result.charset= tmp; // Save for update
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-05-21 14:44:12 +02:00
|
|
|
bool sys_var_character_set::check(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
CHARSET_INFO *tmp;
|
|
|
|
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
if (var->value->result_type() == STRING_RESULT)
|
|
|
|
{
|
2005-02-08 23:50:45 +01:00
|
|
|
char buff[STRING_BUFFER_USUAL_SIZE];
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
String str(buff,sizeof(buff), system_charset_info), *res;
|
|
|
|
if (!(res=var->value->val_str(&str)))
|
2003-05-30 10:56:02 +02:00
|
|
|
{
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
if (!nullable)
|
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL");
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
tmp= NULL;
|
|
|
|
}
|
|
|
|
else if (!(tmp=get_charset_by_csname(res->c_ptr(),MY_CS_PRIMARY,MYF(0))) &&
|
|
|
|
!(tmp=get_old_charset_by_name(res->c_ptr())))
|
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), res->c_ptr());
|
2003-05-30 10:56:02 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
else // INT_RESULT
|
2003-02-26 13:37:41 +01:00
|
|
|
{
|
2004-07-08 14:45:25 +02:00
|
|
|
if (!(tmp=get_charset((int) var->value->val_int(),MYF(0))))
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
{
|
|
|
|
char buf[20];
|
2004-07-08 14:45:25 +02:00
|
|
|
int10_to_str((int) var->value->val_int(), buf, -10);
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), buf);
|
|
|
|
return 1;
|
|
|
|
}
|
2003-02-26 13:37:41 +01:00
|
|
|
}
|
|
|
|
var->save_result.charset= tmp; // Save for update
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-05-30 10:03:56 +02:00
|
|
|
bool sys_var_character_set::update(THD *thd, set_var *var)
|
2003-02-26 13:37:41 +01:00
|
|
|
{
|
2003-05-30 10:03:56 +02:00
|
|
|
ci_ptr(thd,var->type)[0]= var->save_result.charset;
|
2003-09-16 14:14:23 +02:00
|
|
|
thd->update_charset();
|
2003-02-26 13:37:41 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
|
|
|
byte *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2003-02-26 13:37:41 +01:00
|
|
|
{
|
2003-05-30 10:03:56 +02:00
|
|
|
CHARSET_INFO *cs= ci_ptr(thd,type)[0];
|
2005-08-30 14:11:59 +02:00
|
|
|
return cs ? (byte*) cs->csname : (byte*) NULL;
|
2003-02-26 13:37:41 +01:00
|
|
|
}
|
|
|
|
|
2003-05-30 10:03:56 +02:00
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
CHARSET_INFO ** sys_var_character_set_connection::ci_ptr(THD *thd,
|
|
|
|
enum_var_type type)
|
2003-05-30 10:24:24 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
return &global_system_variables.collation_connection;
|
|
|
|
else
|
|
|
|
return &thd->variables.collation_connection;
|
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
|
|
|
void sys_var_character_set_connection::set_default(THD *thd,
|
|
|
|
enum_var_type type)
|
2003-05-30 10:24:24 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.collation_connection= default_charset_info;
|
|
|
|
else
|
2003-08-18 23:08:08 +02:00
|
|
|
{
|
2003-05-30 10:24:24 +02:00
|
|
|
thd->variables.collation_connection= global_system_variables.collation_connection;
|
2003-08-18 23:08:08 +02:00
|
|
|
thd->update_charset();
|
|
|
|
}
|
2003-05-30 10:24:24 +02:00
|
|
|
}
|
|
|
|
|
2003-05-30 10:03:56 +02:00
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
CHARSET_INFO ** sys_var_character_set_client::ci_ptr(THD *thd,
|
|
|
|
enum_var_type type)
|
2003-05-30 10:03:56 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
return &global_system_variables.character_set_client;
|
|
|
|
else
|
|
|
|
return &thd->variables.character_set_client;
|
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-05-21 14:44:12 +02:00
|
|
|
void sys_var_character_set_client::set_default(THD *thd, enum_var_type type)
|
2003-04-07 13:10:27 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
2003-05-21 14:44:12 +02:00
|
|
|
global_system_variables.character_set_client= default_charset_info;
|
2003-04-07 13:10:27 +02:00
|
|
|
else
|
2003-08-18 23:08:08 +02:00
|
|
|
{
|
|
|
|
thd->variables.character_set_client= (global_system_variables.
|
|
|
|
character_set_client);
|
|
|
|
thd->update_charset();
|
|
|
|
}
|
2003-04-07 13:10:27 +02:00
|
|
|
}
|
2003-02-26 13:37:41 +01:00
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2006-02-14 05:24:01 +01:00
|
|
|
CHARSET_INFO **
|
|
|
|
sys_var_character_set_filesystem::ci_ptr(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
return &global_system_variables.character_set_filesystem;
|
|
|
|
else
|
|
|
|
return &thd->variables.character_set_filesystem;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern CHARSET_INFO *character_set_filesystem;
|
|
|
|
|
|
|
|
void
|
|
|
|
sys_var_character_set_filesystem::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.character_set_filesystem= character_set_filesystem;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
thd->variables.character_set_filesystem= (global_system_variables.
|
|
|
|
character_set_filesystem);
|
|
|
|
thd->update_charset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-08-18 23:08:08 +02:00
|
|
|
CHARSET_INFO **
|
|
|
|
sys_var_character_set_results::ci_ptr(THD *thd, enum_var_type type)
|
2003-04-07 13:10:27 +02:00
|
|
|
{
|
2003-05-30 10:03:56 +02:00
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
return &global_system_variables.character_set_results;
|
2003-04-07 13:10:27 +02:00
|
|
|
else
|
2003-05-30 10:03:56 +02:00
|
|
|
return &thd->variables.character_set_results;
|
2003-04-07 13:10:27 +02:00
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-05-30 10:03:56 +02:00
|
|
|
void sys_var_character_set_results::set_default(THD *thd, enum_var_type type)
|
2003-04-07 13:10:27 +02:00
|
|
|
{
|
2003-05-30 10:03:56 +02:00
|
|
|
if (type == OPT_GLOBAL)
|
2003-05-30 20:09:35 +02:00
|
|
|
global_system_variables.character_set_results= default_charset_info;
|
2003-05-30 10:03:56 +02:00
|
|
|
else
|
2003-08-18 23:08:08 +02:00
|
|
|
{
|
|
|
|
thd->variables.character_set_results= (global_system_variables.
|
|
|
|
character_set_results);
|
|
|
|
thd->update_charset();
|
|
|
|
}
|
2003-04-07 13:10:27 +02:00
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-08-18 23:08:08 +02:00
|
|
|
CHARSET_INFO **
|
|
|
|
sys_var_character_set_server::ci_ptr(THD *thd, enum_var_type type)
|
2003-05-30 10:03:56 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
2003-09-15 13:31:04 +02:00
|
|
|
return &global_system_variables.collation_server;
|
2003-05-30 10:03:56 +02:00
|
|
|
else
|
2003-09-15 13:31:04 +02:00
|
|
|
return &thd->variables.collation_server;
|
2003-05-30 10:03:56 +02:00
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-05-30 10:03:56 +02:00
|
|
|
void sys_var_character_set_server::set_default(THD *thd, enum_var_type type)
|
2003-04-07 13:10:27 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
2003-09-15 13:31:04 +02:00
|
|
|
global_system_variables.collation_server= default_charset_info;
|
2003-04-07 13:10:27 +02:00
|
|
|
else
|
2003-08-18 23:08:08 +02:00
|
|
|
{
|
2003-09-15 13:31:04 +02:00
|
|
|
thd->variables.collation_server= global_system_variables.collation_server;
|
2003-08-18 23:08:08 +02:00
|
|
|
thd->update_charset();
|
|
|
|
}
|
2003-05-30 10:03:56 +02:00
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
CHARSET_INFO ** sys_var_character_set_database::ci_ptr(THD *thd,
|
|
|
|
enum_var_type type)
|
2003-05-30 10:03:56 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
2003-09-15 13:31:04 +02:00
|
|
|
return &global_system_variables.collation_database;
|
2003-05-30 10:03:56 +02:00
|
|
|
else
|
2003-09-15 13:31:04 +02:00
|
|
|
return &thd->variables.collation_database;
|
2003-04-07 13:10:27 +02:00
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-05-30 10:03:56 +02:00
|
|
|
void sys_var_character_set_database::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
2003-09-15 13:31:04 +02:00
|
|
|
global_system_variables.collation_database= default_charset_info;
|
2003-05-30 10:03:56 +02:00
|
|
|
else
|
2003-08-18 23:08:08 +02:00
|
|
|
{
|
2003-09-15 13:31:04 +02:00
|
|
|
thd->variables.collation_database= thd->db_charset;
|
2003-08-18 23:08:08 +02:00
|
|
|
thd->update_charset();
|
|
|
|
}
|
2003-05-30 10:03:56 +02:00
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-05-30 10:03:56 +02:00
|
|
|
bool sys_var_collation_connection::update(THD *thd, set_var *var)
|
2003-04-08 11:38:17 +02:00
|
|
|
{
|
|
|
|
if (var->type == OPT_GLOBAL)
|
2003-05-30 10:03:56 +02:00
|
|
|
global_system_variables.collation_connection= var->save_result.charset;
|
2003-04-08 11:38:17 +02:00
|
|
|
else
|
2003-08-18 23:08:08 +02:00
|
|
|
{
|
2003-05-30 10:03:56 +02:00
|
|
|
thd->variables.collation_connection= var->save_result.charset;
|
2003-08-18 23:08:08 +02:00
|
|
|
thd->update_charset();
|
|
|
|
}
|
2003-04-08 11:38:17 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
|
|
|
byte *sys_var_collation_connection::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2003-04-08 11:38:17 +02:00
|
|
|
{
|
|
|
|
CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
|
2003-05-30 10:03:56 +02:00
|
|
|
global_system_variables.collation_connection :
|
|
|
|
thd->variables.collation_connection);
|
|
|
|
return cs ? (byte*) cs->name : (byte*) "NULL";
|
2003-04-08 11:38:17 +02:00
|
|
|
}
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-05-30 10:03:56 +02:00
|
|
|
void sys_var_collation_connection::set_default(THD *thd, enum_var_type type)
|
2003-04-08 11:38:17 +02:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
2003-05-30 10:03:56 +02:00
|
|
|
global_system_variables.collation_connection= default_charset_info;
|
2003-04-08 11:38:17 +02:00
|
|
|
else
|
2003-08-18 23:08:08 +02:00
|
|
|
{
|
|
|
|
thd->variables.collation_connection= (global_system_variables.
|
|
|
|
collation_connection);
|
|
|
|
thd->update_charset();
|
|
|
|
}
|
2003-04-08 11:38:17 +02:00
|
|
|
}
|
|
|
|
|
2003-09-15 13:31:04 +02:00
|
|
|
bool sys_var_collation_database::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
if (var->type == OPT_GLOBAL)
|
|
|
|
global_system_variables.collation_database= var->save_result.charset;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
thd->variables.collation_database= var->save_result.charset;
|
|
|
|
thd->update_charset();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
byte *sys_var_collation_database::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
|
|
|
{
|
|
|
|
CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
|
|
|
|
global_system_variables.collation_database :
|
|
|
|
thd->variables.collation_database);
|
|
|
|
return cs ? (byte*) cs->name : (byte*) "NULL";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_collation_database::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.collation_database= default_charset_info;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
thd->variables.collation_database= (global_system_variables.
|
|
|
|
collation_database);
|
|
|
|
thd->update_charset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_collation_server::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
if (var->type == OPT_GLOBAL)
|
|
|
|
global_system_variables.collation_server= var->save_result.charset;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
thd->variables.collation_server= var->save_result.charset;
|
|
|
|
thd->update_charset();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
byte *sys_var_collation_server::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
|
|
|
{
|
|
|
|
CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
|
|
|
|
global_system_variables.collation_server :
|
|
|
|
thd->variables.collation_server);
|
|
|
|
return cs ? (byte*) cs->name : (byte*) "NULL";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_collation_server::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.collation_server= default_charset_info;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
thd->variables.collation_server= (global_system_variables.
|
|
|
|
collation_server);
|
|
|
|
thd->update_charset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-04-07 13:10:27 +02:00
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
LEX_STRING default_key_cache_base= {(char *) "default", 7 };
|
2003-08-02 11:43:18 +02:00
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
static KEY_CACHE zero_key_cache;
|
2003-08-02 11:43:18 +02:00
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
KEY_CACHE *get_key_cache(LEX_STRING *cache_name)
|
2003-08-02 11:43:18 +02:00
|
|
|
{
|
2003-11-18 12:47:27 +01:00
|
|
|
safe_mutex_assert_owner(&LOCK_global_system_variables);
|
|
|
|
if (!cache_name || ! cache_name->length)
|
2003-08-02 11:43:18 +02:00
|
|
|
cache_name= &default_key_cache_base;
|
2003-11-20 21:06:25 +01:00
|
|
|
return ((KEY_CACHE*) find_named(&key_caches,
|
2003-11-18 12:47:27 +01:00
|
|
|
cache_name->str, cache_name->length, 0));
|
2003-08-02 11:43:18 +02:00
|
|
|
}
|
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
|
2003-08-02 11:43:18 +02:00
|
|
|
byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2003-07-06 18:09:57 +02:00
|
|
|
{
|
2003-11-20 21:06:25 +01:00
|
|
|
KEY_CACHE *key_cache= get_key_cache(base);
|
2003-08-02 11:43:18 +02:00
|
|
|
if (!key_cache)
|
|
|
|
key_cache= &zero_key_cache;
|
|
|
|
return (byte*) key_cache + offset ;
|
|
|
|
}
|
2004-04-28 12:08:54 +02:00
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
ulonglong tmp= var->save_result.ulonglong_value;
|
2003-08-18 23:08:08 +02:00
|
|
|
LEX_STRING *base_name= &var->base;
|
2003-11-20 21:06:25 +01:00
|
|
|
KEY_CACHE *key_cache;
|
2003-11-18 12:47:27 +01:00
|
|
|
bool error= 0;
|
|
|
|
|
|
|
|
/* If no basename, assume it's for the key cache named 'default' */
|
2003-08-18 23:08:08 +02:00
|
|
|
if (!base_name->length)
|
2003-08-27 00:14:13 +02:00
|
|
|
base_name= &default_key_cache_base;
|
2003-11-18 12:47:27 +01:00
|
|
|
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
|
|
|
key_cache= get_key_cache(base_name);
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
if (!key_cache)
|
|
|
|
{
|
2003-11-18 12:47:27 +01:00
|
|
|
/* Key cache didn't exists */
|
2003-07-06 18:09:57 +02:00
|
|
|
if (!tmp) // Tried to delete cache
|
2003-11-18 12:47:27 +01:00
|
|
|
goto end; // Ok, nothing to do
|
|
|
|
if (!(key_cache= create_key_cache(base_name->str, base_name->length)))
|
|
|
|
{
|
|
|
|
error= 1;
|
|
|
|
goto end;
|
|
|
|
}
|
2003-07-06 18:09:57 +02:00
|
|
|
}
|
2003-11-18 12:47:27 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
Abort if some other thread is changing the key cache
|
|
|
|
TODO: This should be changed so that we wait until the previous
|
|
|
|
assignment is done and then do the new assign
|
|
|
|
*/
|
|
|
|
if (key_cache->in_init)
|
|
|
|
goto end;
|
|
|
|
|
2003-08-18 23:08:08 +02:00
|
|
|
if (!tmp) // Zero size means delete
|
2003-07-06 18:09:57 +02:00
|
|
|
{
|
2005-01-19 11:55:54 +01:00
|
|
|
if (key_cache == dflt_key_cache)
|
2005-08-07 20:39:17 +02:00
|
|
|
{
|
|
|
|
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
|
|
ER_WARN_CANT_DROP_DEFAULT_KEYCACHE,
|
|
|
|
ER(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE));
|
2003-11-18 12:47:27 +01:00
|
|
|
goto end; // Ignore default key cache
|
2005-08-07 20:39:17 +02:00
|
|
|
}
|
2003-11-18 12:47:27 +01:00
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
if (key_cache->key_cache_inited) // If initied
|
2003-07-06 18:09:57 +02:00
|
|
|
{
|
|
|
|
/*
|
2003-11-18 12:47:27 +01:00
|
|
|
Move tables using this key cache to the default key cache
|
|
|
|
and clear the old key cache.
|
2003-07-06 18:09:57 +02:00
|
|
|
*/
|
2006-04-13 09:50:33 +02:00
|
|
|
NAMED_LIST *list;
|
2003-11-20 21:06:25 +01:00
|
|
|
key_cache= (KEY_CACHE *) find_named(&key_caches, base_name->str,
|
2003-08-27 00:14:13 +02:00
|
|
|
base_name->length, &list);
|
2003-11-18 12:47:27 +01:00
|
|
|
key_cache->in_init= 1;
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
2005-01-19 11:55:54 +01:00
|
|
|
error= reassign_keycache_tables(thd, key_cache, dflt_key_cache);
|
2003-11-18 12:47:27 +01:00
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
|
|
|
key_cache->in_init= 0;
|
2003-07-06 18:09:57 +02:00
|
|
|
}
|
2003-11-18 12:47:27 +01:00
|
|
|
/*
|
|
|
|
We don't delete the key cache as some running threads my still be
|
|
|
|
in the key cache code with a pointer to the deleted (empty) key cache
|
|
|
|
*/
|
|
|
|
goto end;
|
2003-07-06 18:09:57 +02:00
|
|
|
}
|
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
key_cache->param_buff_size=
|
|
|
|
(ulonglong) getopt_ull_limit_value(tmp, option_limits);
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
/* If key cache didn't existed initialize it, else resize it */
|
|
|
|
key_cache->in_init= 1;
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
if (!key_cache->key_cache_inited)
|
2003-11-18 12:47:27 +01:00
|
|
|
error= (bool) (ha_init_key_cache("", key_cache));
|
2003-08-02 11:43:18 +02:00
|
|
|
else
|
2003-11-18 12:47:27 +01:00
|
|
|
error= (bool)(ha_resize_key_cache(key_cache));
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2006-04-13 09:50:33 +02:00
|
|
|
key_cache->in_init= 0;
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
end:
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
return error;
|
2003-07-06 18:09:57 +02:00
|
|
|
}
|
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
|
|
|
|
bool sys_var_key_cache_long::update(THD *thd, set_var *var)
|
2003-08-09 20:12:22 +02:00
|
|
|
{
|
2003-11-21 00:53:01 +01:00
|
|
|
ulong tmp= (ulong) var->value->val_int();
|
2003-08-27 00:14:13 +02:00
|
|
|
LEX_STRING *base_name= &var->base;
|
2003-11-18 12:47:27 +01:00
|
|
|
bool error= 0;
|
|
|
|
|
2003-08-27 00:14:13 +02:00
|
|
|
if (!base_name->length)
|
2003-08-26 09:13:22 +02:00
|
|
|
base_name= &default_key_cache_base;
|
2003-11-18 12:47:27 +01:00
|
|
|
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2003-11-20 21:06:25 +01:00
|
|
|
KEY_CACHE *key_cache= get_key_cache(base_name);
|
2004-04-28 12:08:54 +02:00
|
|
|
|
2003-08-26 09:13:22 +02:00
|
|
|
if (!key_cache && !(key_cache= create_key_cache(base_name->str,
|
|
|
|
base_name->length)))
|
2003-11-18 12:47:27 +01:00
|
|
|
{
|
|
|
|
error= 1;
|
|
|
|
goto end;
|
|
|
|
}
|
2004-04-28 12:08:54 +02:00
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
/*
|
|
|
|
Abort if some other thread is changing the key cache
|
|
|
|
TODO: This should be changed so that we wait until the previous
|
|
|
|
assignment is done and then do the new assign
|
|
|
|
*/
|
|
|
|
if (key_cache->in_init)
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
*((ulong*) (((char*) key_cache) + offset))=
|
2003-08-09 20:12:22 +02:00
|
|
|
(ulong) getopt_ull_limit_value(tmp, option_limits);
|
2003-08-18 23:08:08 +02:00
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
/*
|
|
|
|
Don't create a new key cache if it didn't exist
|
|
|
|
(key_caches are created only when the user sets block_size)
|
|
|
|
*/
|
|
|
|
key_cache->in_init= 1;
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
error= (bool) (ha_resize_key_cache(key_cache));
|
|
|
|
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2006-04-13 09:50:33 +02:00
|
|
|
key_cache->in_init= 0;
|
2003-11-18 12:47:27 +01:00
|
|
|
|
|
|
|
end:
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
return error;
|
2003-07-06 18:09:57 +02:00
|
|
|
}
|
|
|
|
|
2003-05-30 10:03:56 +02:00
|
|
|
|
2003-04-07 13:10:27 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
Functions to handle SET NAMES and SET CHARACTER SET
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2003-04-23 15:19:22 +02:00
|
|
|
int set_var_collation_client::check(THD *thd)
|
2003-04-07 13:10:27 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-04-23 15:19:22 +02:00
|
|
|
int set_var_collation_client::update(THD *thd)
|
2003-04-07 13:10:27 +02:00
|
|
|
{
|
2003-05-21 14:44:12 +02:00
|
|
|
thd->variables.character_set_client= character_set_client;
|
|
|
|
thd->variables.character_set_results= character_set_results;
|
2003-04-23 15:19:22 +02:00
|
|
|
thd->variables.collation_connection= collation_connection;
|
2003-08-18 23:08:08 +02:00
|
|
|
thd->update_charset();
|
2003-04-07 13:10:27 +02:00
|
|
|
thd->protocol_simple.init(thd);
|
|
|
|
thd->protocol_prep.init(thd);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************/
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
bool sys_var_timestamp::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
thd->set_time((time_t) var->save_result.ulonglong_value);
|
2002-07-23 17:31:22 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_timestamp::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
thd->user_time=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_timestamp::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
thd->sys_var_tmp.long_value= (long) thd->start_time;
|
|
|
|
return (byte*) &thd->sys_var_tmp.long_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_last_insert_id::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
thd->insert_id(var->save_result.ulonglong_value);
|
2002-07-23 17:31:22 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_last_insert_id::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID
Non-upper-level INSERTs (the ones in the body of stored procedure,
stored function, or trigger) into a table that have AUTO_INCREMENT
column didn't affected the result of LAST_INSERT_ID() on this level.
The problem was introduced with the fix of bug 6880, which in turn was
introduced with the fix of bug 3117, where current insert_id value was
remembered on the first call to LAST_INSERT_ID() (bug 3117) and was
returned from that function until it was reset before the next
_upper-level_ statement (bug 6880).
The fix for bug#21726 brings back the behaviour of version 4.0, and
implements the following: remember insert_id value at the beginning
of the statement or expression (which at that point equals to
the first insert_id value generated by the previous statement), and
return that remembered value from LAST_INSERT_ID() or @@LAST_INSERT_ID.
Thus, the value returned by LAST_INSERT_ID() is not affected by values
generated by current statement, nor by LAST_INSERT_ID(expr) calls in
this statement.
Version 5.1 does not have this bug (it was fixed by WL 3146).
mysql-test/r/rpl_insert_id.result:
Add results for bug#21726: Incorrect result with multiple invocations
of LAST_INSERT_ID, and bug#20339: stored procedure using LAST_INSERT_ID()
does not replicate statement-based.
mysql-test/t/rpl_insert_id.test:
Add test cases for bug#21726: Incorrect result with multiple invocations
of LAST_INSERT_ID, and bug#20339: stored procedure using LAST_INSERT_ID()
does not replicate statement-based.
sql/item_func.cc:
Add implementation of Item_func_last_insert_id::fix_fields(), where we
remember in THD::current_insert_id the first value generated during
execution of the previous statement, which is returned then from
Item_func_last_insert_id::val_int().
sql/item_func.h:
Add declaration of Item_func_last_insert_id::fix_fields().
sql/log_event.cc:
Do not set THD::last_insert_id_used on LAST_INSERT_ID_EVENT. Though we
know the statement will call LAST_INSERT_ID(), it wasn't called yet.
sql/set_var.cc:
In sys_var_last_insert_id::value_ptr() remember in
THD::current_insert_id the first value generated during execution of the
previous statement, and return this value for @@LAST_INSERT_ID.
sql/sql_class.cc:
Reset THD::last_insert_id_used after each statement execution.
sql/sql_class.h:
Rather then remember current insert_id value on first invocation of
THD::insert_id(), remember it in Item_func_last_insert_id::fix_fields(),
sys_var_last_insert_id::value_ptr(), or mysql_execute_command().
Remove THD::insert_id(), as it lost its value now.
sql/sql_insert.cc:
THD::insert_id() is removed, use THD::last_insert_id directly.
sql/sql_load.cc:
THD::insert_id() is removed, using THD::last_insert_id directly is OK.
sql/sql_parse.cc:
Remember in THD::current_insert_id first generated insert id value of
the previous statement in mysql_execute_command().
No need to reset THD::last_insert_id_used in
mysql_reset_thd_for_next_command(), it will be reset after each
statement.
sql/sql_select.cc:
If "IS NULL" is replaced with "= <LAST_INSERT_ID>", use right value,
which is THD::current_insert_id, and also set THD::last_insert_id_used
to issue binary log LAST_INSERT_ID_EVENT.
sql/sql_update.cc:
THD::insert_id() is removed, use THD::last_insert_id directly.
tests/mysql_client_test.c:
Add test case for bug#21726: Incorrect result with multiple invocations
of LAST_INSERT_ID.
2006-10-02 12:28:23 +02:00
|
|
|
if (!thd->last_insert_id_used)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
As this statement reads @@LAST_INSERT_ID, set
|
|
|
|
THD::last_insert_id_used and remember first generated insert id
|
|
|
|
of the previous statement in THD::current_insert_id.
|
|
|
|
*/
|
|
|
|
thd->last_insert_id_used= TRUE;
|
2006-10-03 11:38:16 +02:00
|
|
|
thd->last_insert_id_used_bin_log= TRUE;
|
BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID
Non-upper-level INSERTs (the ones in the body of stored procedure,
stored function, or trigger) into a table that have AUTO_INCREMENT
column didn't affected the result of LAST_INSERT_ID() on this level.
The problem was introduced with the fix of bug 6880, which in turn was
introduced with the fix of bug 3117, where current insert_id value was
remembered on the first call to LAST_INSERT_ID() (bug 3117) and was
returned from that function until it was reset before the next
_upper-level_ statement (bug 6880).
The fix for bug#21726 brings back the behaviour of version 4.0, and
implements the following: remember insert_id value at the beginning
of the statement or expression (which at that point equals to
the first insert_id value generated by the previous statement), and
return that remembered value from LAST_INSERT_ID() or @@LAST_INSERT_ID.
Thus, the value returned by LAST_INSERT_ID() is not affected by values
generated by current statement, nor by LAST_INSERT_ID(expr) calls in
this statement.
Version 5.1 does not have this bug (it was fixed by WL 3146).
mysql-test/r/rpl_insert_id.result:
Add results for bug#21726: Incorrect result with multiple invocations
of LAST_INSERT_ID, and bug#20339: stored procedure using LAST_INSERT_ID()
does not replicate statement-based.
mysql-test/t/rpl_insert_id.test:
Add test cases for bug#21726: Incorrect result with multiple invocations
of LAST_INSERT_ID, and bug#20339: stored procedure using LAST_INSERT_ID()
does not replicate statement-based.
sql/item_func.cc:
Add implementation of Item_func_last_insert_id::fix_fields(), where we
remember in THD::current_insert_id the first value generated during
execution of the previous statement, which is returned then from
Item_func_last_insert_id::val_int().
sql/item_func.h:
Add declaration of Item_func_last_insert_id::fix_fields().
sql/log_event.cc:
Do not set THD::last_insert_id_used on LAST_INSERT_ID_EVENT. Though we
know the statement will call LAST_INSERT_ID(), it wasn't called yet.
sql/set_var.cc:
In sys_var_last_insert_id::value_ptr() remember in
THD::current_insert_id the first value generated during execution of the
previous statement, and return this value for @@LAST_INSERT_ID.
sql/sql_class.cc:
Reset THD::last_insert_id_used after each statement execution.
sql/sql_class.h:
Rather then remember current insert_id value on first invocation of
THD::insert_id(), remember it in Item_func_last_insert_id::fix_fields(),
sys_var_last_insert_id::value_ptr(), or mysql_execute_command().
Remove THD::insert_id(), as it lost its value now.
sql/sql_insert.cc:
THD::insert_id() is removed, use THD::last_insert_id directly.
sql/sql_load.cc:
THD::insert_id() is removed, using THD::last_insert_id directly is OK.
sql/sql_parse.cc:
Remember in THD::current_insert_id first generated insert id value of
the previous statement in mysql_execute_command().
No need to reset THD::last_insert_id_used in
mysql_reset_thd_for_next_command(), it will be reset after each
statement.
sql/sql_select.cc:
If "IS NULL" is replaced with "= <LAST_INSERT_ID>", use right value,
which is THD::current_insert_id, and also set THD::last_insert_id_used
to issue binary log LAST_INSERT_ID_EVENT.
sql/sql_update.cc:
THD::insert_id() is removed, use THD::last_insert_id directly.
tests/mysql_client_test.c:
Add test case for bug#21726: Incorrect result with multiple invocations
of LAST_INSERT_ID.
2006-10-02 12:28:23 +02:00
|
|
|
thd->current_insert_id= thd->last_insert_id;
|
|
|
|
}
|
|
|
|
return (byte*) &thd->current_insert_id;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_insert_id::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
thd->next_insert_id= var->save_result.ulonglong_value;
|
2002-07-23 17:31:22 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
byte *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2006-06-22 16:10:11 +02:00
|
|
|
return (byte*) &thd->next_insert_id;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-01-15 09:11:44 +01:00
|
|
|
#ifdef HAVE_REPLICATION
|
2002-07-23 17:31:22 +02:00
|
|
|
bool sys_var_slave_skip_counter::check(THD *thd, set_var *var)
|
|
|
|
{
|
2002-09-22 17:02:39 +02:00
|
|
|
int result= 0;
|
2004-04-28 12:08:54 +02:00
|
|
|
pthread_mutex_lock(&LOCK_active_mi);
|
2002-07-23 17:31:22 +02:00
|
|
|
pthread_mutex_lock(&active_mi->rli.run_lock);
|
|
|
|
if (active_mi->rli.slave_running)
|
|
|
|
{
|
2004-11-12 13:34:00 +01:00
|
|
|
my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0));
|
2002-07-23 17:31:22 +02:00
|
|
|
result=1;
|
|
|
|
}
|
|
|
|
pthread_mutex_unlock(&active_mi->rli.run_lock);
|
2004-04-28 12:08:54 +02:00
|
|
|
pthread_mutex_unlock(&LOCK_active_mi);
|
2003-10-24 16:28:32 +02:00
|
|
|
var->save_result.ulong_value= (ulong) var->value->val_int();
|
2002-07-23 17:31:22 +02:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_slave_skip_counter::update(THD *thd, set_var *var)
|
|
|
|
{
|
2004-04-28 12:08:54 +02:00
|
|
|
pthread_mutex_lock(&LOCK_active_mi);
|
2002-07-23 17:31:22 +02:00
|
|
|
pthread_mutex_lock(&active_mi->rli.run_lock);
|
|
|
|
/*
|
|
|
|
The following test should normally never be true as we test this
|
|
|
|
in the check function; To be safe against multiple
|
|
|
|
SQL_SLAVE_SKIP_COUNTER request, we do the check anyway
|
|
|
|
*/
|
|
|
|
if (!active_mi->rli.slave_running)
|
|
|
|
{
|
|
|
|
pthread_mutex_lock(&active_mi->rli.data_lock);
|
2003-10-24 16:28:32 +02:00
|
|
|
active_mi->rli.slave_skip_counter= var->save_result.ulong_value;
|
2002-07-23 17:31:22 +02:00
|
|
|
pthread_mutex_unlock(&active_mi->rli.data_lock);
|
|
|
|
}
|
|
|
|
pthread_mutex_unlock(&active_mi->rli.run_lock);
|
2004-04-28 12:08:54 +02:00
|
|
|
pthread_mutex_unlock(&LOCK_active_mi);
|
2002-07-23 17:31:22 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2004-06-10 15:56:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_sync_binlog_period::update(THD *thd, set_var *var)
|
|
|
|
{
|
2004-08-16 17:00:48 +02:00
|
|
|
sync_binlog_period= (ulong) var->save_result.ulonglong_value;
|
2004-06-10 15:56:13 +02:00
|
|
|
return 0;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
2003-01-15 09:11:44 +01:00
|
|
|
#endif /* HAVE_REPLICATION */
|
2002-07-23 17:31:22 +02:00
|
|
|
|
2002-11-07 03:02:37 +01:00
|
|
|
bool sys_var_rand_seed1::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
thd->rand.seed1= (ulong) var->save_result.ulonglong_value;
|
2002-11-07 03:02:37 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool sys_var_rand_seed2::update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-10-24 16:28:32 +02:00
|
|
|
thd->rand.seed2= (ulong) var->save_result.ulonglong_value;
|
2002-11-07 03:02:37 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
bool sys_var_thd_time_zone::check(THD *thd, set_var *var)
|
|
|
|
{
|
2005-04-05 13:17:49 +02:00
|
|
|
char buff[MAX_TIME_ZONE_NAME_LENGTH];
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
String str(buff, sizeof(buff), &my_charset_latin1);
|
|
|
|
String *res= var->value->val_str(&str);
|
|
|
|
|
2004-08-10 10:42:31 +02:00
|
|
|
if (!(var->save_result.time_zone=
|
2004-09-09 05:59:26 +02:00
|
|
|
my_tz_find(res, thd->lex->time_zone_tables_used)))
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), res ? res->c_ptr() : "NULL");
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_thd_time_zone::update(THD *thd, set_var *var)
|
|
|
|
{
|
2005-01-26 20:25:02 +01:00
|
|
|
/* We are using Time_zone object found during check() phase. */
|
|
|
|
if (var->type == OPT_GLOBAL)
|
|
|
|
{
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
|
|
|
global_system_variables.time_zone= var->save_result.time_zone;
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
thd->variables.time_zone= var->save_result.time_zone;
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
byte *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
|
|
|
{
|
2006-04-13 09:50:33 +02:00
|
|
|
/*
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
We can use ptr() instead of c_ptr() here because String contaning
|
|
|
|
time zone name is guaranteed to be zero ended.
|
|
|
|
*/
|
|
|
|
if (type == OPT_GLOBAL)
|
2005-01-26 20:25:02 +01:00
|
|
|
return (byte *)(global_system_variables.time_zone->get_name()->ptr());
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
else
|
Last part of WL#1062: better replication of timezones: no more use
of SET ONE_SHOT; storing tz info directly in event (if this info is needed),
it's now allowed to have different global tz on master and slave.
client/mysqlbinlog.cc:
we need MAX_TIME_ZONE_NAME_LENGTH when processing log_event.h, and it's declared in mysql_priv.h
mysql-test/r/rpl_timezone.result:
result update
mysql-test/t/rpl_timezone-slave.opt:
Now that we can have different global value of timezone on master and slave, let's test it.
mysql-test/t/rpl_timezone.test:
Tests of the new replication of timezones: checking the output of mysqlbinlog,
replication of CONVERT_TZ().
sql/ha_innodb.cc:
No very fast shutdown on Netware (anyway it's disabled on all platforms,
but this is so that we don't forget to keep it disabled on Netware in the future).
sql/log.cc:
No more need to write SET ONE_SHOT to binlog for character set and timezone
(as we store this info directly nin the Query_log_event now).
sql/log_event.cc:
Exclude ::write() methods if MYSQL_CLIENT.
Storing timezone info in the Query_log_event in master. Re-reading it in slave.
Small code cleanups. I plan to not store the end 0 of catalog in binlog
events soon.
sql/log_event.h:
replication of time zones: a place for tz info in Query_log_event,
in LAST_EVENT_INFO. Plus if we are compiling a client, we don't need
the ::write() methods, so keeping them out (of mysqlbinlog.cc;
keeping them in, resulted in problem that mysqlbinlog does not know Timezone
structure).
sql/mysql_priv.h:
moving this define from tztime.h (tztime.h has things which are
too much for a client like mysqlbinlog).
sql/set_var.cc:
It's now allowed to change global value of charset or timezone even if using binlogging
or if being a slave.
Making CONVERT_TZ(,,@@session.time_zone) replicate.
sql/set_var.h:
these ::check()s are not needed anymore (changing global charset
or timezone is now allowed even if binlogging or slave)
sql/slave.cc:
No more need to check for same global timezone if master is 5.x
(ok, strictly speaking if it is > 5.0.3 but this is alpha).
sql/slave.h:
a function to wrap settings of charset to default.
sql/tztime.cc:
Adaptation of my_tz_find() to the case where it's not called from inside
a query (i.e. cannot join its tz tables to the query's ones): this variant
opens the tz tables itself, reads from them, and closes them. This is presently
only used by the slave SQL thread (when it sets the tz before executing a query).
sql/tztime.h:
declaration of new function, plus moving symbol to mysql_priv.h
for easier usage in mysqlbinlog (Dmitri, pardon me).
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
2005-03-22 00:26:12 +01:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
This is an ugly fix for replication: we don't replicate properly queries
|
|
|
|
invoking system variables' values to update tables; but
|
|
|
|
CONVERT_TZ(,,@@session.time_zone) is so popular that we make it
|
|
|
|
replicable (i.e. we tell the binlog code to store the session
|
|
|
|
timezone). If it's the global value which was used we can't replicate
|
|
|
|
(binlog code stores session value only).
|
|
|
|
*/
|
|
|
|
thd->time_zone_used= 1;
|
2005-01-26 20:25:02 +01:00
|
|
|
return (byte *)(thd->variables.time_zone->get_name()->ptr());
|
Last part of WL#1062: better replication of timezones: no more use
of SET ONE_SHOT; storing tz info directly in event (if this info is needed),
it's now allowed to have different global tz on master and slave.
client/mysqlbinlog.cc:
we need MAX_TIME_ZONE_NAME_LENGTH when processing log_event.h, and it's declared in mysql_priv.h
mysql-test/r/rpl_timezone.result:
result update
mysql-test/t/rpl_timezone-slave.opt:
Now that we can have different global value of timezone on master and slave, let's test it.
mysql-test/t/rpl_timezone.test:
Tests of the new replication of timezones: checking the output of mysqlbinlog,
replication of CONVERT_TZ().
sql/ha_innodb.cc:
No very fast shutdown on Netware (anyway it's disabled on all platforms,
but this is so that we don't forget to keep it disabled on Netware in the future).
sql/log.cc:
No more need to write SET ONE_SHOT to binlog for character set and timezone
(as we store this info directly nin the Query_log_event now).
sql/log_event.cc:
Exclude ::write() methods if MYSQL_CLIENT.
Storing timezone info in the Query_log_event in master. Re-reading it in slave.
Small code cleanups. I plan to not store the end 0 of catalog in binlog
events soon.
sql/log_event.h:
replication of time zones: a place for tz info in Query_log_event,
in LAST_EVENT_INFO. Plus if we are compiling a client, we don't need
the ::write() methods, so keeping them out (of mysqlbinlog.cc;
keeping them in, resulted in problem that mysqlbinlog does not know Timezone
structure).
sql/mysql_priv.h:
moving this define from tztime.h (tztime.h has things which are
too much for a client like mysqlbinlog).
sql/set_var.cc:
It's now allowed to change global value of charset or timezone even if using binlogging
or if being a slave.
Making CONVERT_TZ(,,@@session.time_zone) replicate.
sql/set_var.h:
these ::check()s are not needed anymore (changing global charset
or timezone is now allowed even if binlogging or slave)
sql/slave.cc:
No more need to check for same global timezone if master is 5.x
(ok, strictly speaking if it is > 5.0.3 but this is alpha).
sql/slave.h:
a function to wrap settings of charset to default.
sql/tztime.cc:
Adaptation of my_tz_find() to the case where it's not called from inside
a query (i.e. cannot join its tz tables to the query's ones): this variant
opens the tz tables itself, reads from them, and closes them. This is presently
only used by the slave SQL thread (when it sets the tz before executing a query).
sql/tztime.h:
declaration of new function, plus moving symbol to mysql_priv.h
for easier usage in mysqlbinlog (Dmitri, pardon me).
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
2005-03-22 00:26:12 +01:00
|
|
|
}
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
2005-01-26 20:25:02 +01:00
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
{
|
|
|
|
if (default_tz_name)
|
|
|
|
{
|
|
|
|
String str(default_tz_name, &my_charset_latin1);
|
2005-01-26 20:25:02 +01:00
|
|
|
/*
|
|
|
|
We are guaranteed to find this time zone since its existence
|
|
|
|
is checked during start-up.
|
|
|
|
*/
|
2004-08-10 10:42:31 +02:00
|
|
|
global_system_variables.time_zone=
|
|
|
|
my_tz_find(&str, thd->lex->time_zone_tables_used);
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
global_system_variables.time_zone= my_tz_SYSTEM;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
thd->variables.time_zone= global_system_variables.time_zone;
|
2005-01-26 20:25:02 +01:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
include/my_global.h:
Added macro for reading of 32-bit ints stored in network order from
unaligned memory location.
include/mysqld_error.h:
Added error-code for invalid timestamp warning and error-code
for wrong or unknown time zone specification.
libmysqld/Makefile.am:
Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
Updated test result since now mysql database contains more
system tables.
mysql-test/r/date_formats.result:
Now when truncation occurs during conversion to datetime value we are producing Warnings
instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/func_time.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling.
mysql-test/r/select.result:
New warnings about truncation occured during conversion to datetime value added due
their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
Updated test result because new system tables holding time zone descriptions were
added.
mysql-test/r/timezone.result:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
Separated and extended test of values and warnings produced for bad values stored in
DATETTIME fields.
mysql-test/r/type_time.result:
Now we are producing more consistent warning when we are truncating datetime value while
storing it in TIME field.
mysql-test/r/type_timestamp.result:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
mysql-test/t/select.test:
Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
Updated timezone.test to use new system variable which shows system time zone.
Added test of warning which is produced if someone tries to store non-existing (due
falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
Separated and extended test of values and warnings produced for bad
values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
Separated and extended test of values and warnings produced for bad
values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
Added creation of tables with time zone descriptions.
Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
Added mysql.time_zone* tables family.
sql/Makefile.am:
Added files implementing time zone support to server, also added
rules for building of mysql_tzinfo_to_sql converter and test_time
test.
sql/field.cc:
Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
any other Field to datetime conversion (now we are generating warnings no in lower
level functions like in str_to_TIME() but in Field methods. This allows generate
better and more consistent warnings and to reuse code of str_to_TIME() outside of
server).
Added 3rd parameter to set_warning() method to be able to not increment cut fields
but still produce a warning. Also added set_datetime_warning() family of auxiliary
methods which allow easier generate datetime related warnings.
Also replaced occurences of current_thd with table->in_use member, added
asserts for catching all places there we need to set table->in_use
accordingly. Renamed fix_datetime() function to number_to_TIME() and
moved it to sql/time.cc there it fits better.
sql/field.h:
Added comment about places where we can use table->in_use member
instead of current_thd.
Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
family of methods.
sql/field_conv.cc:
Field::set_warning() method with 2 arguments was replaced with more
generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
Now we set table->in_use for temporary tables so we have to use
table->tmp_table for checking if table is temporary.
sql/item.cc:
Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
generating analogs.
sql/item_create.cc:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
UNIX_TIMESTAMP functions.
Added support for CONVERT_TZ function.
Removed call to str_to_timestamp function which caused non-optimal
behavior in certain cases. Replaced calls to str_to_time() function
with its warning generating analog.
sql/item_timefunc.h:
Added support of per-thread time zone to NOW-like and
FROM_UNIXTIME, UNIX_TIMESTAMP functions.
Added support of CONVERT_TZ function.
sql/lex.h:
Added support of CONVERT_TZ function.
sql/log.cc:
Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
Now including headers with per-thread time zone support functions
and classes. Added portable replacement of time_t - my_time_t type.
Added time zone as one of query distinguishing parameters for
query cache.
Fixed declarations of str_to_TIME, str_to_time and
my_system_gmt_sec (former my_gmt_sec) since now they have one more
out parameter which informs about wrong datetime value or data
truncation during conversion.
Added warning generating version of str_to_TIME() and str_to_time()
functions.
Thrown away str_to_datetime/timestamp functions since they are not
needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
Added per-thread time zone support initialization.
Added new startup parameter --default-time-zone.
sql/set_var.cc:
Added support for per-thread time_zone variable.
Renamed old timezone variable to system_time_zone.
sql/set_var.h:
Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
Added error message for barking when incorrect time zone name or
specifiaction is provided and for warning about invalid TIMESTAMP
values (e.g. falling into the spring time-gap).
sql/slave.cc:
In order to support replication of statements using time zones in 4.1 we should
ensure that both master and slave have same default time zone.
sql/sql_base.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_cache.cc:
Added time zone as one more query distinguishing parameter
for query cache.
sql/sql_class.cc:
Added THD::time_zone_used variable indicating that this query
uses per thread time zone.
sql/sql_class.h:
Added per-thread time zone variable. Added THD::time_zone_used
variable indicating that this query uses per thread time zone
so if this is updating query the time zone should be logged to
binlog.
sql/sql_insert.cc:
We should set TABLE::in_use member pointing to thread which is called
INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
Resetting THD::time_zone_used variable in the end of query
processing.
sql/sql_select.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
sql/sql_show.cc:
Now using per thread time zone for extended show tables.
sql/time.cc:
Added support for per-thread time zones for TIMESTAMP type and
reworked generation of warnings for TIMESTAMP and DATETIME types.
(Introduced new TIME_to_timestamp() function. Removed hours
normalisation from former my_gmt_sec() since it was not working
and not used anywhere now, but breaks parameter constness, added
to this function generation of warning if we are falling in spring
time-gap. Removed str_to_timestamp and str_to_datetime functions
which are no longer used. Moved fix_datetime function from
sql/field.cc to this file as number_to_TIME() function. Added
out parameter for str_to_TIME and str_to_time functions which
indicates if value was truncated during conversion, removed direct
generation of warnings from this functions.)
sql/unireg.cc:
Now we are setting TABLE::in_use member for all tables (which assume
calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 08:11:31 +02:00
|
|
|
}
|
|
|
|
|
2004-12-29 18:30:37 +01:00
|
|
|
|
|
|
|
bool sys_var_max_user_conn::check(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
if (var->type == OPT_GLOBAL)
|
|
|
|
return sys_var_thd::check(thd, var);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Per-session values of max_user_connections can't be set directly.
|
|
|
|
QQ: May be we should have a separate error message for this?
|
|
|
|
*/
|
|
|
|
my_error(ER_GLOBAL_VARIABLE, MYF(0), name);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool sys_var_max_user_conn::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
DBUG_ASSERT(var->type == OPT_GLOBAL);
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
2005-03-19 01:12:25 +01:00
|
|
|
max_user_connections= (uint)var->save_result.ulonglong_value;
|
2004-12-29 18:30:37 +01:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_max_user_conn::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
DBUG_ASSERT(type == OPT_GLOBAL);
|
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
|
|
|
max_user_connections= (ulong) option_limits->def_value;
|
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
byte *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
|
|
|
{
|
|
|
|
if (type != OPT_GLOBAL &&
|
|
|
|
thd->user_connect && thd->user_connect->user_resources.user_conn)
|
|
|
|
return (byte*) &(thd->user_connect->user_resources.user_conn);
|
|
|
|
return (byte*) &(max_user_connections);
|
|
|
|
}
|
|
|
|
|
2006-12-05 11:08:19 +01:00
|
|
|
|
2006-07-04 14:40:40 +02:00
|
|
|
bool sys_var_thd_lc_time_names::check(THD *thd, set_var *var)
|
|
|
|
{
|
2006-12-05 10:45:21 +01:00
|
|
|
MY_LOCALE *locale_match;
|
2006-07-04 14:40:40 +02:00
|
|
|
|
2006-12-05 10:45:21 +01:00
|
|
|
if (var->value->result_type() == INT_RESULT)
|
2006-07-04 14:40:40 +02:00
|
|
|
{
|
2006-12-05 10:45:21 +01:00
|
|
|
if (!(locale_match= my_locale_by_number((uint) var->value->val_int())))
|
|
|
|
{
|
|
|
|
char buf[20];
|
|
|
|
int10_to_str((int) var->value->val_int(), buf, -10);
|
|
|
|
my_printf_error(ER_UNKNOWN_ERROR, "Unknown locale: '%s'", MYF(0), buf);
|
|
|
|
return 1;
|
|
|
|
}
|
2006-07-04 14:40:40 +02:00
|
|
|
}
|
2006-12-05 10:45:21 +01:00
|
|
|
else // STRING_RESULT
|
2006-07-04 14:40:40 +02:00
|
|
|
{
|
2006-12-05 10:45:21 +01:00
|
|
|
char buff[6];
|
|
|
|
String str(buff, sizeof(buff), &my_charset_latin1), *res;
|
|
|
|
if (!(res=var->value->val_str(&str)))
|
|
|
|
{
|
|
|
|
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
const char *locale_str= res->c_ptr();
|
|
|
|
if (!(locale_match= my_locale_by_name(locale_str)))
|
|
|
|
{
|
|
|
|
my_printf_error(ER_UNKNOWN_ERROR,
|
|
|
|
"Unknown locale: '%s'", MYF(0), locale_str);
|
|
|
|
return 1;
|
|
|
|
}
|
2006-07-04 14:40:40 +02:00
|
|
|
}
|
2006-12-05 10:45:21 +01:00
|
|
|
|
2006-07-08 00:30:07 +02:00
|
|
|
var->save_result.locale_value= locale_match;
|
|
|
|
return 0;
|
2006-07-04 14:40:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var)
|
|
|
|
{
|
2007-04-09 14:58:56 +02:00
|
|
|
if (var->type == OPT_GLOBAL)
|
|
|
|
global_system_variables.lc_time_names= var->save_result.locale_value;
|
|
|
|
else
|
|
|
|
thd->variables.lc_time_names= var->save_result.locale_value;
|
2006-07-04 14:40:40 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
byte *sys_var_thd_lc_time_names::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
|
|
|
{
|
2007-04-09 14:58:56 +02:00
|
|
|
return type == OPT_GLOBAL ?
|
|
|
|
(byte *) global_system_variables.lc_time_names->name :
|
|
|
|
(byte *) thd->variables.lc_time_names->name;
|
2006-07-04 14:40:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
2007-04-09 14:58:56 +02:00
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.lc_time_names= my_default_lc_time_names;
|
|
|
|
else
|
|
|
|
thd->variables.lc_time_names= global_system_variables.lc_time_names;
|
2006-07-04 14:40:40 +02:00
|
|
|
}
|
2004-12-29 18:30:37 +01:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/*
|
|
|
|
Functions to update thd->options bits
|
|
|
|
*/
|
|
|
|
|
|
|
|
static bool set_option_bit(THD *thd, set_var *var)
|
|
|
|
{
|
2002-08-08 02:12:02 +02:00
|
|
|
sys_var_thd_bit *sys_var= ((sys_var_thd_bit*) var->var);
|
|
|
|
if ((var->save_result.ulong_value != 0) == sys_var->reverse)
|
|
|
|
thd->options&= ~sys_var->bit_flag;
|
2002-07-23 17:31:22 +02:00
|
|
|
else
|
2002-08-08 02:12:02 +02:00
|
|
|
thd->options|= sys_var->bit_flag;
|
2002-07-23 17:31:22 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool set_option_autocommit(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
/* The test is negative as the flag we use is NOT autocommit */
|
|
|
|
|
2006-11-30 17:25:05 +01:00
|
|
|
ulonglong org_options= thd->options;
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
if (var->save_result.ulong_value != 0)
|
|
|
|
thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag;
|
|
|
|
else
|
|
|
|
thd->options|= ((sys_var_thd_bit*) var->var)->bit_flag;
|
|
|
|
|
|
|
|
if ((org_options ^ thd->options) & OPTION_NOT_AUTOCOMMIT)
|
|
|
|
{
|
|
|
|
if ((org_options & OPTION_NOT_AUTOCOMMIT))
|
|
|
|
{
|
|
|
|
/* We changed to auto_commit mode */
|
2007-03-23 16:12:58 +01:00
|
|
|
thd->options&= ~(ulong) OPTION_BEGIN;
|
(pushing for Andrei)
Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
Once had been set the flag might later got reset inside of a stored routine
execution stack.
The reason was in that there was no check if a new statement started at time
of resetting.
The artifact affects most of binlogable DML queries. Notice, that multi-update
is wrapped up within
bug@27716 fix, multi-delete bug@29136.
Fixed with saving parent's statement flag of whether the statement modified
non-transactional table, and unioning (merging) the value with that was gained
in mysql_execute_command.
Resettling thd->no_trans_update members into thd->transaction.`member`;
Asserting code;
Effectively the following properties are held.
1. At the end of a substatement thd->transaction.stmt.modified_non_trans_table
reflects the fact if such a table got modified by the substatement.
That also respects THD::really_abort_on_warnin() requirements.
2. Eventually thd->transaction.stmt.modified_non_trans_table will be computed as
the union of the values of all invoked sub-statements.
That fixes this bug#27417;
Computing of thd->transaction.all.modified_non_trans_table is refined to base to
the stmt's value for all the case including insert .. select statement which
before the patch had an extra issue bug@28960.
Minor issues are covered with mysql_load, mysql_delete, and binloggin of insert in
to temp_table select.
The supplied test verifies limitely, mostly asserts. The ultimate testing is defered
for bug@13270, bug@23333.
mysql-test/r/mix_innodb_myisam_binlog.result:
results changed
mysql-test/t/mix_innodb_myisam_binlog.test:
regression test incl the related bug#28960.
sql/ha_ndbcluster.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/handler.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/handler.h:
new member added
sql/log.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/set_var.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sp_head.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
and saving and merging stmt's flag at the end of a substatement.
sql/sql_class.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sql_class.h:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sql_delete.cc:
correcting basic delete incl truncate branch and multi-delete queries to set
stmt.modified_non_trans_table;
optimization to set the flag at the end of per-row loop;
multi-delete still has an extra issue similar to bug#27716 of multi-update
- to be address with bug_29136 fix.
sql/sql_insert.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sql_load.cc:
eliminating a separate issue where the stmt flag was saved and re-stored after
write_record that actually could change it and the change would be lost but
should remain permanent;
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sql_parse.cc:
initialization to transaction.stmt.modified_non_trans_table at the common part
of all types of statements processing - mysql_execute_command().
sql/sql_table.cc:
moving the reset up to the mysql_execute_command() caller
sql/sql_update.cc:
correcting update query case (multi-update part of the issues covered by other
bug#27716 fix)
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
2007-07-30 17:27:36 +02:00
|
|
|
thd->transaction.all.modified_non_trans_table= FALSE;
|
2002-07-23 17:31:22 +02:00
|
|
|
thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
|
|
|
|
if (ha_commit(thd))
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
(pushing for Andrei)
Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
Once had been set the flag might later got reset inside of a stored routine
execution stack.
The reason was in that there was no check if a new statement started at time
of resetting.
The artifact affects most of binlogable DML queries. Notice, that multi-update
is wrapped up within
bug@27716 fix, multi-delete bug@29136.
Fixed with saving parent's statement flag of whether the statement modified
non-transactional table, and unioning (merging) the value with that was gained
in mysql_execute_command.
Resettling thd->no_trans_update members into thd->transaction.`member`;
Asserting code;
Effectively the following properties are held.
1. At the end of a substatement thd->transaction.stmt.modified_non_trans_table
reflects the fact if such a table got modified by the substatement.
That also respects THD::really_abort_on_warnin() requirements.
2. Eventually thd->transaction.stmt.modified_non_trans_table will be computed as
the union of the values of all invoked sub-statements.
That fixes this bug#27417;
Computing of thd->transaction.all.modified_non_trans_table is refined to base to
the stmt's value for all the case including insert .. select statement which
before the patch had an extra issue bug@28960.
Minor issues are covered with mysql_load, mysql_delete, and binloggin of insert in
to temp_table select.
The supplied test verifies limitely, mostly asserts. The ultimate testing is defered
for bug@13270, bug@23333.
mysql-test/r/mix_innodb_myisam_binlog.result:
results changed
mysql-test/t/mix_innodb_myisam_binlog.test:
regression test incl the related bug#28960.
sql/ha_ndbcluster.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/handler.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/handler.h:
new member added
sql/log.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/set_var.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sp_head.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
and saving and merging stmt's flag at the end of a substatement.
sql/sql_class.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sql_class.h:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sql_delete.cc:
correcting basic delete incl truncate branch and multi-delete queries to set
stmt.modified_non_trans_table;
optimization to set the flag at the end of per-row loop;
multi-delete still has an extra issue similar to bug#27716 of multi-update
- to be address with bug_29136 fix.
sql/sql_insert.cc:
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sql_load.cc:
eliminating a separate issue where the stmt flag was saved and re-stored after
write_record that actually could change it and the change would be lost but
should remain permanent;
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
sql/sql_parse.cc:
initialization to transaction.stmt.modified_non_trans_table at the common part
of all types of statements processing - mysql_execute_command().
sql/sql_table.cc:
moving the reset up to the mysql_execute_command() caller
sql/sql_update.cc:
correcting update query case (multi-update part of the issues covered by other
bug#27716 fix)
thd->transaction.{all,stmt}.modified_non_trans_table
instead of
thd->no_trans_update.{all,stmt}
2007-07-30 17:27:36 +02:00
|
|
|
thd->transaction.all.modified_non_trans_table= FALSE;
|
2002-07-23 17:31:22 +02:00
|
|
|
thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-04-28 12:08:54 +02:00
|
|
|
static int check_log_update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
2005-09-15 21:29:07 +02:00
|
|
|
if (!(thd->security_ctx->master_access & SUPER_ACL))
|
2004-04-28 12:08:54 +02:00
|
|
|
{
|
|
|
|
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
static bool set_log_update(THD *thd, set_var *var)
|
|
|
|
{
|
2003-04-02 00:15:20 +02:00
|
|
|
/*
|
|
|
|
The update log is not supported anymore since 5.0.
|
|
|
|
See sql/mysqld.cc/, comments in function init_server_components() for an
|
|
|
|
explaination of the different warnings we send below
|
|
|
|
*/
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
if (opt_sql_bin_update)
|
2003-04-02 00:15:20 +02:00
|
|
|
{
|
2002-07-23 17:31:22 +02:00
|
|
|
((sys_var_thd_bit*) var->var)->bit_flag|= (OPTION_BIN_LOG |
|
|
|
|
OPTION_UPDATE_LOG);
|
2003-04-02 00:15:20 +02:00
|
|
|
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
|
|
|
|
ER_UPDATE_LOG_DEPRECATED_TRANSLATED,
|
|
|
|
ER(ER_UPDATE_LOG_DEPRECATED_TRANSLATED));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
|
|
|
|
ER_UPDATE_LOG_DEPRECATED_IGNORED,
|
|
|
|
ER(ER_UPDATE_LOG_DEPRECATED_IGNORED));
|
2002-07-23 17:31:22 +02:00
|
|
|
set_option_bit(thd, var);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-04-02 00:15:20 +02:00
|
|
|
static bool set_log_bin(THD *thd, set_var *var)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
if (opt_sql_bin_update)
|
|
|
|
((sys_var_thd_bit*) var->var)->bit_flag|= (OPTION_BIN_LOG |
|
|
|
|
OPTION_UPDATE_LOG);
|
|
|
|
set_option_bit(thd, var);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-04-28 12:08:54 +02:00
|
|
|
static int check_pseudo_thread_id(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
var->save_result.ulonglong_value= var->value->val_int();
|
|
|
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
2005-09-15 21:29:07 +02:00
|
|
|
if (thd->security_ctx->master_access & SUPER_ACL)
|
2004-04-28 12:08:54 +02:00
|
|
|
return 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
2003-04-02 00:15:20 +02:00
|
|
|
|
2002-10-02 12:33:08 +02:00
|
|
|
static byte *get_warning_count(THD *thd)
|
|
|
|
{
|
|
|
|
thd->sys_var_tmp.long_value=
|
|
|
|
(thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_NOTE] +
|
2006-10-04 16:49:39 +02:00
|
|
|
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR] +
|
2002-10-02 12:33:08 +02:00
|
|
|
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_WARN]);
|
|
|
|
return (byte*) &thd->sys_var_tmp.long_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static byte *get_error_count(THD *thd)
|
|
|
|
{
|
2006-04-13 09:50:33 +02:00
|
|
|
thd->sys_var_tmp.long_value=
|
2002-10-02 12:33:08 +02:00
|
|
|
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR];
|
|
|
|
return (byte*) &thd->sys_var_tmp.long_value;
|
|
|
|
}
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
|
2005-08-26 10:23:32 +02:00
|
|
|
static byte *get_have_innodb(THD *thd)
|
|
|
|
{
|
|
|
|
return (byte*) show_comp_option_name[have_innodb];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Bug #1039: tmpdir and datadir not available via @@ system variable syntax
Bug #19606: ssl variables are not displayed in show variables
Bug #19616: log_queries_not_using_indexes is not listed in show variables
Make basedir, datadir, tmpdir, log_queries_not_using_indexes, ssl_ca,
ssl_capath, ssl_cert, ssl_cipher, and ssl_key all available both from
SHOW VARIABLES and as @@variables.
As a side-effect of this change, log_queries_not_using_indexes can
be changed at runtime (but only globally, not per-connection).
include/sslopt-longopts.h:
Put options in alphabetical order
include/sslopt-vars.h:
Allow define of SSL_VARS_NOT_STATIC to prevent variables from not being
made static.
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression tests
sql/mysql_priv.h:
Add extern for opt_log_queries_not_using_indexes
sql/mysqld.cc:
Handle opt_log_queries_not_using_indexes as extern, and define
SSL_VARS_NO_STATIC so they can be accessed outside of mysqld.cc
sql/set_var.cc:
Handle basedir, datadir, tmpdir, log_queries_not_using_indexes, and
various ssl settings so that they are accessible as server variables
and listed in SHOW VARIABLES.
sql/set_var.h:
Add new sys_var_constr_str_ptr class, for when we have a system variable
that is only set via the command-line that is a pointer to a string.
2006-05-09 01:38:45 +02:00
|
|
|
/*
|
|
|
|
Get the tmpdir that was specified or chosen by default
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
get_tmpdir()
|
|
|
|
thd thread handle
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
This is necessary because if the user does not specify a temporary
|
|
|
|
directory via the command line, one is chosen based on the environment
|
|
|
|
or system defaults. But we can't just always use mysql_tmpdir, because
|
|
|
|
that is actually a call to my_tmpdir() which cycles among possible
|
|
|
|
temporary directories.
|
|
|
|
|
|
|
|
RETURN VALUES
|
|
|
|
ptr pointer to NUL-terminated string
|
|
|
|
*/
|
|
|
|
static byte *get_tmpdir(THD *thd)
|
|
|
|
{
|
|
|
|
if (opt_mysql_tmpdir)
|
|
|
|
return (byte *)opt_mysql_tmpdir;
|
|
|
|
return (byte*)mysql_tmpdir;
|
|
|
|
}
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/****************************************************************************
|
|
|
|
Main handling of variables:
|
|
|
|
- Initialisation
|
|
|
|
- Searching during parsing
|
|
|
|
- Update loop
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
Find variable name in option my_getopt structure used for command line args
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
find_option()
|
|
|
|
opt option structure array to search in
|
|
|
|
name variable name
|
|
|
|
|
|
|
|
RETURN VALUES
|
|
|
|
0 Error
|
|
|
|
ptr pointer to option structure
|
|
|
|
*/
|
|
|
|
|
2006-04-13 09:50:33 +02:00
|
|
|
static struct my_option *find_option(struct my_option *opt, const char *name)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
uint length=strlen(name);
|
|
|
|
for (; opt->name; opt++)
|
|
|
|
{
|
|
|
|
if (!getopt_compare_strings(opt->name, name, length) &&
|
|
|
|
!opt->name[length])
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Only accept the option if one can set values through it.
|
|
|
|
If not, there is no default value or limits in the option.
|
|
|
|
*/
|
|
|
|
return (opt->value) ? opt : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Return variable name and length for hashing of variables
|
|
|
|
*/
|
|
|
|
|
|
|
|
static byte *get_sys_var_length(const sys_var *var, uint *length,
|
|
|
|
my_bool first)
|
|
|
|
{
|
|
|
|
*length= var->name_length;
|
|
|
|
return (byte*) var->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Initialises sys variables and put them in system_variable_hash
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
void set_var_init()
|
|
|
|
{
|
2002-10-02 12:33:08 +02:00
|
|
|
hash_init(&system_variable_hash, system_charset_info,
|
|
|
|
array_elements(sys_variables),0,0,
|
2003-04-01 09:45:16 +02:00
|
|
|
(hash_get_key) get_sys_var_length,0,0);
|
2002-07-23 17:31:22 +02:00
|
|
|
sys_var **var, **end;
|
|
|
|
for (var= sys_variables, end= sys_variables+array_elements(sys_variables) ;
|
|
|
|
var < end;
|
|
|
|
var++)
|
|
|
|
{
|
|
|
|
(*var)->name_length= strlen((*var)->name);
|
|
|
|
(*var)->option_limits= find_option(my_long_options, (*var)->name);
|
2003-09-19 11:44:31 +02:00
|
|
|
my_hash_insert(&system_variable_hash, (byte*) *var);
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
Special cases
|
|
|
|
Needed because MySQL can't find the limits for a variable it it has
|
|
|
|
a different name than the command line option.
|
|
|
|
As these variables are deprecated, this code will disappear soon...
|
|
|
|
*/
|
|
|
|
sys_sql_max_join_size.option_limits= sys_max_join_size.option_limits;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void set_var_free()
|
|
|
|
{
|
|
|
|
hash_free(&system_variable_hash);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Find a user set-table variable
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
find_sys_var()
|
|
|
|
str Name of system variable to find
|
|
|
|
length Length of variable. zero means that we should use strlen()
|
|
|
|
on the variable
|
|
|
|
|
|
|
|
RETURN VALUES
|
|
|
|
pointer pointer to variable definitions
|
|
|
|
0 Unknown variable (error message is given)
|
|
|
|
*/
|
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
sys_var *find_sys_var(const char *str, uint length)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2002-08-28 16:00:58 +02:00
|
|
|
sys_var *var= (sys_var*) hash_search(&system_variable_hash,
|
|
|
|
(byte*) str,
|
2002-07-23 17:31:22 +02:00
|
|
|
length ? length :
|
|
|
|
strlen(str));
|
|
|
|
if (!var)
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str);
|
2002-07-23 17:31:22 +02:00
|
|
|
return var;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Execute update of all variables
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
|
|
|
|
sql_set
|
|
|
|
THD Thread id
|
|
|
|
set_var List of variables to update
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
First run a check of all variables that all updates will go ok.
|
|
|
|
If yes, then execute all updates, returning an error if any one failed.
|
|
|
|
|
|
|
|
This should ensure that in all normal cases none all or variables are
|
|
|
|
updated
|
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
0 ok
|
2002-09-22 17:02:39 +02:00
|
|
|
1 ERROR, message sent (normally no variables was updated)
|
|
|
|
-1 ERROR, message not sent
|
2002-07-23 17:31:22 +02:00
|
|
|
*/
|
|
|
|
|
2002-09-22 17:02:39 +02:00
|
|
|
int sql_set_variables(THD *thd, List<set_var_base> *var_list)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2004-12-02 13:43:51 +01:00
|
|
|
int error;
|
2003-05-27 17:40:37 +02:00
|
|
|
List_iterator_fast<set_var_base> it(*var_list);
|
2003-08-18 23:08:08 +02:00
|
|
|
DBUG_ENTER("sql_set_variables");
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
set_var_base *var;
|
|
|
|
while ((var=it++))
|
|
|
|
{
|
2004-12-02 13:43:51 +01:00
|
|
|
if ((error= var->check(thd)))
|
2004-11-22 11:05:10 +01:00
|
|
|
goto err;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
2004-12-02 13:43:51 +01:00
|
|
|
if (!(error= test(thd->net.report_error)))
|
2004-11-22 11:05:10 +01:00
|
|
|
{
|
|
|
|
it.rewind();
|
|
|
|
while ((var= it++))
|
|
|
|
error|= var->update(thd); // Returns 0, -1 or 1
|
|
|
|
}
|
2004-12-02 13:43:51 +01:00
|
|
|
|
2004-11-22 11:05:10 +01:00
|
|
|
err:
|
|
|
|
free_underlaid_joins(thd, &thd->lex->select_lex);
|
2003-08-18 23:08:08 +02:00
|
|
|
DBUG_RETURN(error);
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Implementation of WL#1824 "Add replication of character set variables in 4.1",
by binlogging some SET ONE_SHOT CHARACTER_SETetc,
which will be enough until we have it more compact and more complete in 5.0. With the present patch,
replication will work ok between 4.1.3 master and slaves, as long as:
- master and slave have the same GLOBAL.COLLATION_SERVER
- COLLATION_DATABASE and CHARACTER_SET_DATABASE are not used
- application does not use the fact that table is created with charset of the USEd db (BUG#2326).
all of which are not too hard to fulfill.
ONE_SHOT is reserved for internal use of mysqlbinlog|mysql and works only for charsets,
so we give error if used for non-charset vars.
Fix for BUG#3875 "mysqlbinlog produces wrong ouput if query uses
variables containing quotes" and BUG#3943 "Queries with non-ASCII literals are not replicated
properly after SET NAMES".
Detecting that master and slave have different global charsets or server ids.
mysql-test/r/rpl_server_id1.result:
it's normal to not run as I have added a test to compare server ids of master and slave
at startup and stop if equal (unless --replicate-same-server-id)
mysql-test/r/rpl_user_variables.result:
result update (as we now print charset of user var).
mysql-test/r/user_var.result:
result update
mysql-test/t/rpl_server_id1.test:
no need to select as slave is not running
mysql-test/t/user_var.test:
testing if the content of user vars is escaped when mysqlbinlog prints them,
and if the name is backquoted.
sql/lex.h:
new keyword ONE_SHOT
sql/log.cc:
when writing to the binlog, before writing the actual statement, write some SET ONE_SHOT CHARACTER_SET_CLIENT etc
for the slave to know the charset variables (which are important as they affect the inserted data).
sql/log_event.cc:
print charset and collation of user var in mysqlbinlog and SHOW BINLOG EVENTS.
escape the content of the var. Backquote its name.
Will ask Bar to check that using my_charset_bin for escaping is ok.
sql/set_var.cc:
understand SET CHARACTER_SET_CLIENT=10 (don't require a string, accept a number).
Refuse changing of GLOBAL CHARACTER_SET_SERVER/COLLATION_SERVER if binlog or slave,
as it will make the master or slave make wrong assumptions.
A function to catch SET ONE_SHOT on non-charset variables (which is forbidden)
sql/set_var.h:
no_support_one_shot to know if the var supports ONE_SHOT (only charset vars do, soon timezones).
Accept int arg in SET CHARACTER_SET_etc
sql/slave.cc:
when I/O slave thread starts, verify that master's and slave charsets match.
And by the way verify that server ids are different.
Don't fail if UNIX_TIMESTAMP() can't be done on master (very old master), that's
not fatal.
sql/sql_class.cc:
one_shot
sql/sql_class.h:
one_shot
sql/sql_lex.h:
one_shot
sql/sql_parse.cc:
when SET ONE_SHOT is used, verify that it's only used for charset/collation vars;
otherwise refuse.
sql/sql_yacc.yy:
ONE_SHOT keyword in SET
2004-06-03 23:17:18 +02:00
|
|
|
/*
|
|
|
|
Say if all variables set by a SET support the ONE_SHOT keyword (currently,
|
|
|
|
only character set and collation do; later timezones will).
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
|
|
|
|
not_all_support_one_shot
|
|
|
|
set_var List of variables to update
|
|
|
|
|
|
|
|
NOTES
|
|
|
|
It has a "not_" because it makes faster tests (no need to "!")
|
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
0 all variables of the list support ONE_SHOT
|
|
|
|
1 at least one does not support ONE_SHOT
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool not_all_support_one_shot(List<set_var_base> *var_list)
|
|
|
|
{
|
|
|
|
List_iterator_fast<set_var_base> it(*var_list);
|
|
|
|
set_var_base *var;
|
|
|
|
while ((var= it++))
|
|
|
|
{
|
|
|
|
if (var->no_support_one_shot())
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
Functions to handle SET mysql_internal_variable=const_expr
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2002-09-22 17:02:39 +02:00
|
|
|
int set_var::check(THD *thd)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2005-05-13 13:18:27 +02:00
|
|
|
if (var->is_readonly())
|
|
|
|
{
|
|
|
|
my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->name, "read only");
|
|
|
|
return -1;
|
|
|
|
}
|
2002-07-23 17:31:22 +02:00
|
|
|
if (var->check_type(type))
|
|
|
|
{
|
2004-11-12 13:34:00 +01:00
|
|
|
int err= type == OPT_GLOBAL ? ER_LOCAL_VARIABLE : ER_GLOBAL_VARIABLE;
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(err, MYF(0), var->name);
|
2002-09-22 17:02:39 +02:00
|
|
|
return -1;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
if ((type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL)))
|
|
|
|
return 1;
|
|
|
|
/* value is a NULL pointer if we are using SET ... = DEFAULT */
|
|
|
|
if (!value)
|
|
|
|
{
|
|
|
|
if (var->check_default(type))
|
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_NO_DEFAULT, MYF(0), var->name);
|
2002-09-22 17:02:39 +02:00
|
|
|
return -1;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-02-08 23:50:45 +01:00
|
|
|
if ((!value->fixed &&
|
2005-07-01 06:05:42 +02:00
|
|
|
value->fix_fields(thd, &value)) || value->check_cols(1))
|
2002-09-22 17:02:39 +02:00
|
|
|
return -1;
|
2002-07-23 17:31:22 +02:00
|
|
|
if (var->check_update_type(value->result_type()))
|
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_WRONG_TYPE_FOR_VAR, MYF(0), var->name);
|
2002-09-22 17:02:39 +02:00
|
|
|
return -1;
|
2003-10-06 14:11:16 +02:00
|
|
|
}
|
2002-09-22 17:02:39 +02:00
|
|
|
return var->check(thd, this) ? -1 : 0;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-04-10 00:14:32 +02:00
|
|
|
/*
|
|
|
|
Check variable, but without assigning value (used by PS)
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
set_var::light_check()
|
|
|
|
thd thread handler
|
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
0 ok
|
|
|
|
1 ERROR, message sent (normally no variables was updated)
|
|
|
|
-1 ERROR, message not sent
|
|
|
|
*/
|
new error for unsupported command in PS
fixed IN subselect with basic constant left expression
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
unchecked commands now is rejected by PS protocol to avoid serever crash
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
include/mysqld_error.h:
new error for unsupported command in PS
mysql-test/r/multi_update.result:
test sutes (BUG#3408, BUG#3411)
mysql-test/t/multi_update.test:
test sutes (BUG#3408, BUG#3411)
sql/item_cmpfunc.cc:
fixed IN subselect with basic constant left expression
sql/mysql_priv.h:
some function frop sql_parse.h become public
sql/set_var.cc:
check for SET command via PS
sql/set_var.h:
check for SET command via PS
sql/share/czech/errmsg.txt:
new error for unsupported command in PS
sql/share/danish/errmsg.txt:
new error for unsupported command in PS
sql/share/dutch/errmsg.txt:
new error for unsupported command in PS
sql/share/english/errmsg.txt:
new error for unsupported command in PS
sql/share/estonian/errmsg.txt:
new error for unsupported command in PS
sql/share/french/errmsg.txt:
new error for unsupported command in PS
sql/share/german/errmsg.txt:
new error for unsupported command in PS
sql/share/greek/errmsg.txt:
new error for unsupported command in PS
sql/share/hungarian/errmsg.txt:
new error for unsupported command in PS
sql/share/italian/errmsg.txt:
new error for unsupported command in PS
sql/share/japanese/errmsg.txt:
new error for unsupported command in PS
sql/share/korean/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian-ny/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian/errmsg.txt:
new error for unsupported command in PS
sql/share/polish/errmsg.txt:
new error for unsupported command in PS
sql/share/portuguese/errmsg.txt:
new error for unsupported command in PS
sql/share/romanian/errmsg.txt:
new error for unsupported command in PS
sql/share/russian/errmsg.txt:
new error for unsupported command in PS
sql/share/serbian/errmsg.txt:
new error for unsupported command in PS
sql/share/slovak/errmsg.txt:
new error for unsupported command in PS
sql/share/spanish/errmsg.txt:
new error for unsupported command in PS
sql/share/swedish/errmsg.txt:
new error for unsupported command in PS
sql/share/ukrainian/errmsg.txt:
new error for unsupported command in PS
sql/sql_lex.cc:
first table unlincking procedures for CREATE command
sql/sql_lex.h:
first table unlincking procedures for CREATE command
sql/sql_parse.cc:
used function to exclude first table from list
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
sql/sql_prepare.cc:
fixed a lot of commands to be compatible with PS
unchecked commands now is rejected to avoid serever crash
sql/sql_select.cc:
allow empty result for PS preparing
sql/sql_union.cc:
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
sql/sql_update.cc:
fixed update to use correct tables lists (BUG#3408)
sql/table.h:
flag to support multi update tables check (BUG#3408)
tests/client_test.c:
removed unsupported tables
fixed show table test
added new tests
2004-04-07 23:16:17 +02:00
|
|
|
int set_var::light_check(THD *thd)
|
|
|
|
{
|
|
|
|
if (var->check_type(type))
|
|
|
|
{
|
2004-11-12 13:34:00 +01:00
|
|
|
int err= type == OPT_GLOBAL ? ER_LOCAL_VARIABLE : ER_GLOBAL_VARIABLE;
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(err, MYF(0), var->name);
|
new error for unsupported command in PS
fixed IN subselect with basic constant left expression
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
unchecked commands now is rejected by PS protocol to avoid serever crash
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
include/mysqld_error.h:
new error for unsupported command in PS
mysql-test/r/multi_update.result:
test sutes (BUG#3408, BUG#3411)
mysql-test/t/multi_update.test:
test sutes (BUG#3408, BUG#3411)
sql/item_cmpfunc.cc:
fixed IN subselect with basic constant left expression
sql/mysql_priv.h:
some function frop sql_parse.h become public
sql/set_var.cc:
check for SET command via PS
sql/set_var.h:
check for SET command via PS
sql/share/czech/errmsg.txt:
new error for unsupported command in PS
sql/share/danish/errmsg.txt:
new error for unsupported command in PS
sql/share/dutch/errmsg.txt:
new error for unsupported command in PS
sql/share/english/errmsg.txt:
new error for unsupported command in PS
sql/share/estonian/errmsg.txt:
new error for unsupported command in PS
sql/share/french/errmsg.txt:
new error for unsupported command in PS
sql/share/german/errmsg.txt:
new error for unsupported command in PS
sql/share/greek/errmsg.txt:
new error for unsupported command in PS
sql/share/hungarian/errmsg.txt:
new error for unsupported command in PS
sql/share/italian/errmsg.txt:
new error for unsupported command in PS
sql/share/japanese/errmsg.txt:
new error for unsupported command in PS
sql/share/korean/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian-ny/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian/errmsg.txt:
new error for unsupported command in PS
sql/share/polish/errmsg.txt:
new error for unsupported command in PS
sql/share/portuguese/errmsg.txt:
new error for unsupported command in PS
sql/share/romanian/errmsg.txt:
new error for unsupported command in PS
sql/share/russian/errmsg.txt:
new error for unsupported command in PS
sql/share/serbian/errmsg.txt:
new error for unsupported command in PS
sql/share/slovak/errmsg.txt:
new error for unsupported command in PS
sql/share/spanish/errmsg.txt:
new error for unsupported command in PS
sql/share/swedish/errmsg.txt:
new error for unsupported command in PS
sql/share/ukrainian/errmsg.txt:
new error for unsupported command in PS
sql/sql_lex.cc:
first table unlincking procedures for CREATE command
sql/sql_lex.h:
first table unlincking procedures for CREATE command
sql/sql_parse.cc:
used function to exclude first table from list
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
sql/sql_prepare.cc:
fixed a lot of commands to be compatible with PS
unchecked commands now is rejected to avoid serever crash
sql/sql_select.cc:
allow empty result for PS preparing
sql/sql_union.cc:
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
sql/sql_update.cc:
fixed update to use correct tables lists (BUG#3408)
sql/table.h:
flag to support multi update tables check (BUG#3408)
tests/client_test.c:
removed unsupported tables
fixed show table test
added new tests
2004-04-07 23:16:17 +02:00
|
|
|
return -1;
|
|
|
|
}
|
2004-04-10 00:14:32 +02:00
|
|
|
if (type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL))
|
new error for unsupported command in PS
fixed IN subselect with basic constant left expression
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
unchecked commands now is rejected by PS protocol to avoid serever crash
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
include/mysqld_error.h:
new error for unsupported command in PS
mysql-test/r/multi_update.result:
test sutes (BUG#3408, BUG#3411)
mysql-test/t/multi_update.test:
test sutes (BUG#3408, BUG#3411)
sql/item_cmpfunc.cc:
fixed IN subselect with basic constant left expression
sql/mysql_priv.h:
some function frop sql_parse.h become public
sql/set_var.cc:
check for SET command via PS
sql/set_var.h:
check for SET command via PS
sql/share/czech/errmsg.txt:
new error for unsupported command in PS
sql/share/danish/errmsg.txt:
new error for unsupported command in PS
sql/share/dutch/errmsg.txt:
new error for unsupported command in PS
sql/share/english/errmsg.txt:
new error for unsupported command in PS
sql/share/estonian/errmsg.txt:
new error for unsupported command in PS
sql/share/french/errmsg.txt:
new error for unsupported command in PS
sql/share/german/errmsg.txt:
new error for unsupported command in PS
sql/share/greek/errmsg.txt:
new error for unsupported command in PS
sql/share/hungarian/errmsg.txt:
new error for unsupported command in PS
sql/share/italian/errmsg.txt:
new error for unsupported command in PS
sql/share/japanese/errmsg.txt:
new error for unsupported command in PS
sql/share/korean/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian-ny/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian/errmsg.txt:
new error for unsupported command in PS
sql/share/polish/errmsg.txt:
new error for unsupported command in PS
sql/share/portuguese/errmsg.txt:
new error for unsupported command in PS
sql/share/romanian/errmsg.txt:
new error for unsupported command in PS
sql/share/russian/errmsg.txt:
new error for unsupported command in PS
sql/share/serbian/errmsg.txt:
new error for unsupported command in PS
sql/share/slovak/errmsg.txt:
new error for unsupported command in PS
sql/share/spanish/errmsg.txt:
new error for unsupported command in PS
sql/share/swedish/errmsg.txt:
new error for unsupported command in PS
sql/share/ukrainian/errmsg.txt:
new error for unsupported command in PS
sql/sql_lex.cc:
first table unlincking procedures for CREATE command
sql/sql_lex.h:
first table unlincking procedures for CREATE command
sql/sql_parse.cc:
used function to exclude first table from list
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
sql/sql_prepare.cc:
fixed a lot of commands to be compatible with PS
unchecked commands now is rejected to avoid serever crash
sql/sql_select.cc:
allow empty result for PS preparing
sql/sql_union.cc:
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
sql/sql_update.cc:
fixed update to use correct tables lists (BUG#3408)
sql/table.h:
flag to support multi update tables check (BUG#3408)
tests/client_test.c:
removed unsupported tables
fixed show table test
added new tests
2004-04-07 23:16:17 +02:00
|
|
|
return 1;
|
|
|
|
|
2005-07-01 06:05:42 +02:00
|
|
|
if (value && ((!value->fixed && value->fix_fields(thd, &value)) ||
|
2004-12-14 01:36:19 +01:00
|
|
|
value->check_cols(1)))
|
new error for unsupported command in PS
fixed IN subselect with basic constant left expression
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
unchecked commands now is rejected by PS protocol to avoid serever crash
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
include/mysqld_error.h:
new error for unsupported command in PS
mysql-test/r/multi_update.result:
test sutes (BUG#3408, BUG#3411)
mysql-test/t/multi_update.test:
test sutes (BUG#3408, BUG#3411)
sql/item_cmpfunc.cc:
fixed IN subselect with basic constant left expression
sql/mysql_priv.h:
some function frop sql_parse.h become public
sql/set_var.cc:
check for SET command via PS
sql/set_var.h:
check for SET command via PS
sql/share/czech/errmsg.txt:
new error for unsupported command in PS
sql/share/danish/errmsg.txt:
new error for unsupported command in PS
sql/share/dutch/errmsg.txt:
new error for unsupported command in PS
sql/share/english/errmsg.txt:
new error for unsupported command in PS
sql/share/estonian/errmsg.txt:
new error for unsupported command in PS
sql/share/french/errmsg.txt:
new error for unsupported command in PS
sql/share/german/errmsg.txt:
new error for unsupported command in PS
sql/share/greek/errmsg.txt:
new error for unsupported command in PS
sql/share/hungarian/errmsg.txt:
new error for unsupported command in PS
sql/share/italian/errmsg.txt:
new error for unsupported command in PS
sql/share/japanese/errmsg.txt:
new error for unsupported command in PS
sql/share/korean/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian-ny/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian/errmsg.txt:
new error for unsupported command in PS
sql/share/polish/errmsg.txt:
new error for unsupported command in PS
sql/share/portuguese/errmsg.txt:
new error for unsupported command in PS
sql/share/romanian/errmsg.txt:
new error for unsupported command in PS
sql/share/russian/errmsg.txt:
new error for unsupported command in PS
sql/share/serbian/errmsg.txt:
new error for unsupported command in PS
sql/share/slovak/errmsg.txt:
new error for unsupported command in PS
sql/share/spanish/errmsg.txt:
new error for unsupported command in PS
sql/share/swedish/errmsg.txt:
new error for unsupported command in PS
sql/share/ukrainian/errmsg.txt:
new error for unsupported command in PS
sql/sql_lex.cc:
first table unlincking procedures for CREATE command
sql/sql_lex.h:
first table unlincking procedures for CREATE command
sql/sql_parse.cc:
used function to exclude first table from list
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
sql/sql_prepare.cc:
fixed a lot of commands to be compatible with PS
unchecked commands now is rejected to avoid serever crash
sql/sql_select.cc:
allow empty result for PS preparing
sql/sql_union.cc:
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
sql/sql_update.cc:
fixed update to use correct tables lists (BUG#3408)
sql/table.h:
flag to support multi update tables check (BUG#3408)
tests/client_test.c:
removed unsupported tables
fixed show table test
added new tests
2004-04-07 23:16:17 +02:00
|
|
|
return -1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-09-22 17:02:39 +02:00
|
|
|
int set_var::update(THD *thd)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
if (!value)
|
|
|
|
var->set_default(thd, type);
|
|
|
|
else if (var->update(thd, this))
|
2002-09-22 17:02:39 +02:00
|
|
|
return -1; // should never happen
|
2002-07-23 17:31:22 +02:00
|
|
|
if (var->after_update)
|
|
|
|
(*var->after_update)(thd, type);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
Functions to handle SET @user_variable=const_expr
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2002-09-22 17:02:39 +02:00
|
|
|
int set_var_user::check(THD *thd)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2003-11-02 16:27:35 +01:00
|
|
|
/*
|
|
|
|
Item_func_set_user_var can't substitute something else on its place =>
|
2004-04-28 12:08:54 +02:00
|
|
|
0 can be passed as last argument (reference on item)
|
2003-11-02 16:27:35 +01:00
|
|
|
*/
|
2005-07-01 06:05:42 +02:00
|
|
|
return (user_var_item->fix_fields(thd, (Item**) 0) ||
|
2006-08-22 15:37:41 +02:00
|
|
|
user_var_item->check(0)) ? -1 : 0;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-04-10 00:14:32 +02:00
|
|
|
/*
|
|
|
|
Check variable, but without assigning value (used by PS)
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
set_var_user::light_check()
|
|
|
|
thd thread handler
|
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
0 ok
|
|
|
|
1 ERROR, message sent (normally no variables was updated)
|
|
|
|
-1 ERROR, message not sent
|
|
|
|
*/
|
new error for unsupported command in PS
fixed IN subselect with basic constant left expression
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
unchecked commands now is rejected by PS protocol to avoid serever crash
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
include/mysqld_error.h:
new error for unsupported command in PS
mysql-test/r/multi_update.result:
test sutes (BUG#3408, BUG#3411)
mysql-test/t/multi_update.test:
test sutes (BUG#3408, BUG#3411)
sql/item_cmpfunc.cc:
fixed IN subselect with basic constant left expression
sql/mysql_priv.h:
some function frop sql_parse.h become public
sql/set_var.cc:
check for SET command via PS
sql/set_var.h:
check for SET command via PS
sql/share/czech/errmsg.txt:
new error for unsupported command in PS
sql/share/danish/errmsg.txt:
new error for unsupported command in PS
sql/share/dutch/errmsg.txt:
new error for unsupported command in PS
sql/share/english/errmsg.txt:
new error for unsupported command in PS
sql/share/estonian/errmsg.txt:
new error for unsupported command in PS
sql/share/french/errmsg.txt:
new error for unsupported command in PS
sql/share/german/errmsg.txt:
new error for unsupported command in PS
sql/share/greek/errmsg.txt:
new error for unsupported command in PS
sql/share/hungarian/errmsg.txt:
new error for unsupported command in PS
sql/share/italian/errmsg.txt:
new error for unsupported command in PS
sql/share/japanese/errmsg.txt:
new error for unsupported command in PS
sql/share/korean/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian-ny/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian/errmsg.txt:
new error for unsupported command in PS
sql/share/polish/errmsg.txt:
new error for unsupported command in PS
sql/share/portuguese/errmsg.txt:
new error for unsupported command in PS
sql/share/romanian/errmsg.txt:
new error for unsupported command in PS
sql/share/russian/errmsg.txt:
new error for unsupported command in PS
sql/share/serbian/errmsg.txt:
new error for unsupported command in PS
sql/share/slovak/errmsg.txt:
new error for unsupported command in PS
sql/share/spanish/errmsg.txt:
new error for unsupported command in PS
sql/share/swedish/errmsg.txt:
new error for unsupported command in PS
sql/share/ukrainian/errmsg.txt:
new error for unsupported command in PS
sql/sql_lex.cc:
first table unlincking procedures for CREATE command
sql/sql_lex.h:
first table unlincking procedures for CREATE command
sql/sql_parse.cc:
used function to exclude first table from list
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
sql/sql_prepare.cc:
fixed a lot of commands to be compatible with PS
unchecked commands now is rejected to avoid serever crash
sql/sql_select.cc:
allow empty result for PS preparing
sql/sql_union.cc:
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
sql/sql_update.cc:
fixed update to use correct tables lists (BUG#3408)
sql/table.h:
flag to support multi update tables check (BUG#3408)
tests/client_test.c:
removed unsupported tables
fixed show table test
added new tests
2004-04-07 23:16:17 +02:00
|
|
|
int set_var_user::light_check(THD *thd)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Item_func_set_user_var can't substitute something else on its place =>
|
|
|
|
0 can be passed as last argument (reference on item)
|
|
|
|
*/
|
2005-07-01 06:05:42 +02:00
|
|
|
return (user_var_item->fix_fields(thd, (Item**) 0));
|
new error for unsupported command in PS
fixed IN subselect with basic constant left expression
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
unchecked commands now is rejected by PS protocol to avoid serever crash
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
include/mysqld_error.h:
new error for unsupported command in PS
mysql-test/r/multi_update.result:
test sutes (BUG#3408, BUG#3411)
mysql-test/t/multi_update.test:
test sutes (BUG#3408, BUG#3411)
sql/item_cmpfunc.cc:
fixed IN subselect with basic constant left expression
sql/mysql_priv.h:
some function frop sql_parse.h become public
sql/set_var.cc:
check for SET command via PS
sql/set_var.h:
check for SET command via PS
sql/share/czech/errmsg.txt:
new error for unsupported command in PS
sql/share/danish/errmsg.txt:
new error for unsupported command in PS
sql/share/dutch/errmsg.txt:
new error for unsupported command in PS
sql/share/english/errmsg.txt:
new error for unsupported command in PS
sql/share/estonian/errmsg.txt:
new error for unsupported command in PS
sql/share/french/errmsg.txt:
new error for unsupported command in PS
sql/share/german/errmsg.txt:
new error for unsupported command in PS
sql/share/greek/errmsg.txt:
new error for unsupported command in PS
sql/share/hungarian/errmsg.txt:
new error for unsupported command in PS
sql/share/italian/errmsg.txt:
new error for unsupported command in PS
sql/share/japanese/errmsg.txt:
new error for unsupported command in PS
sql/share/korean/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian-ny/errmsg.txt:
new error for unsupported command in PS
sql/share/norwegian/errmsg.txt:
new error for unsupported command in PS
sql/share/polish/errmsg.txt:
new error for unsupported command in PS
sql/share/portuguese/errmsg.txt:
new error for unsupported command in PS
sql/share/romanian/errmsg.txt:
new error for unsupported command in PS
sql/share/russian/errmsg.txt:
new error for unsupported command in PS
sql/share/serbian/errmsg.txt:
new error for unsupported command in PS
sql/share/slovak/errmsg.txt:
new error for unsupported command in PS
sql/share/spanish/errmsg.txt:
new error for unsupported command in PS
sql/share/swedish/errmsg.txt:
new error for unsupported command in PS
sql/share/ukrainian/errmsg.txt:
new error for unsupported command in PS
sql/sql_lex.cc:
first table unlincking procedures for CREATE command
sql/sql_lex.h:
first table unlincking procedures for CREATE command
sql/sql_parse.cc:
used function to exclude first table from list
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
sql/sql_prepare.cc:
fixed a lot of commands to be compatible with PS
unchecked commands now is rejected to avoid serever crash
sql/sql_select.cc:
allow empty result for PS preparing
sql/sql_union.cc:
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
sql/sql_update.cc:
fixed update to use correct tables lists (BUG#3408)
sql/table.h:
flag to support multi update tables check (BUG#3408)
tests/client_test.c:
removed unsupported tables
fixed show table test
added new tests
2004-04-07 23:16:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-09-22 17:02:39 +02:00
|
|
|
int set_var_user::update(THD *thd)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
if (user_var_item->update())
|
|
|
|
{
|
|
|
|
/* Give an error if it's not given already */
|
2004-11-12 13:34:00 +01:00
|
|
|
my_message(ER_SET_CONSTANTS_ONLY, ER(ER_SET_CONSTANTS_ONLY), MYF(0));
|
2002-09-22 17:02:39 +02:00
|
|
|
return -1;
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
Functions to handle SET PASSWORD
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2002-09-22 17:02:39 +02:00
|
|
|
int set_var_password::check(THD *thd)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2003-09-26 12:33:13 +02:00
|
|
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
2002-07-23 17:31:22 +02:00
|
|
|
if (!user->host.str)
|
2005-08-23 00:48:50 +02:00
|
|
|
{
|
2005-09-15 21:29:07 +02:00
|
|
|
if (*thd->security_ctx->priv_host != 0)
|
2005-08-23 00:48:50 +02:00
|
|
|
{
|
2005-09-15 21:29:07 +02:00
|
|
|
user->host.str= (char *) thd->security_ctx->priv_host;
|
|
|
|
user->host.length= strlen(thd->security_ctx->priv_host);
|
2005-08-23 00:48:50 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
user->host.str= (char *)"%";
|
|
|
|
user->host.length= 1;
|
|
|
|
}
|
|
|
|
}
|
2002-09-22 17:02:39 +02:00
|
|
|
/* Returns 1 as the function sends error to client */
|
2005-01-24 15:48:25 +01:00
|
|
|
return check_change_password(thd, user->host.str, user->user.str,
|
|
|
|
password, strlen(password)) ? 1 : 0;
|
2004-07-30 22:05:08 +02:00
|
|
|
#else
|
2003-09-26 12:33:13 +02:00
|
|
|
return 0;
|
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
2002-09-22 17:02:39 +02:00
|
|
|
int set_var_password::update(THD *thd)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
2003-09-26 12:33:13 +02:00
|
|
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
2002-09-22 17:02:39 +02:00
|
|
|
/* Returns 1 as the function sends error to client */
|
2004-07-30 22:05:08 +02:00
|
|
|
return change_password(thd, user->host.str, user->user.str, password) ?
|
|
|
|
1 : 0;
|
2003-09-26 12:33:13 +02:00
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
|
2003-12-02 21:23:13 +01:00
|
|
|
/****************************************************************************
|
|
|
|
Functions to handle table_type
|
|
|
|
****************************************************************************/
|
|
|
|
|
2003-12-08 11:25:37 +01:00
|
|
|
/* Based upon sys_var::check_enum() */
|
|
|
|
|
2003-12-17 23:52:03 +01:00
|
|
|
bool sys_var_thd_storage_engine::check(THD *thd, set_var *var)
|
2003-12-02 21:23:13 +01:00
|
|
|
{
|
2005-02-08 23:50:45 +01:00
|
|
|
char buff[STRING_BUFFER_USUAL_SIZE];
|
2003-12-02 21:23:13 +01:00
|
|
|
const char *value;
|
|
|
|
String str(buff, sizeof(buff), &my_charset_latin1), *res;
|
|
|
|
|
|
|
|
if (var->value->result_type() == STRING_RESULT)
|
|
|
|
{
|
2004-12-21 12:09:48 +01:00
|
|
|
enum db_type db_type;
|
2003-12-02 21:23:13 +01:00
|
|
|
if (!(res=var->value->val_str(&str)) ||
|
|
|
|
!(var->save_result.ulong_value=
|
2005-04-16 02:40:33 +02:00
|
|
|
(ulong) (db_type= ha_resolve_by_name(res->ptr(), res->length()))) ||
|
2005-06-17 23:14:44 +02:00
|
|
|
ha_checktype(thd, db_type, 1, 0) != db_type)
|
2003-12-02 21:23:13 +01:00
|
|
|
{
|
|
|
|
value= res ? res->c_ptr() : "NULL";
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2003-12-19 15:25:50 +01:00
|
|
|
value= "unknown";
|
2003-12-02 21:23:13 +01:00
|
|
|
|
|
|
|
err:
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), value);
|
2004-11-12 13:34:00 +01:00
|
|
|
return 1;
|
2003-12-02 21:23:13 +01:00
|
|
|
}
|
|
|
|
|
2003-12-08 11:25:37 +01:00
|
|
|
|
2003-12-17 23:52:03 +01:00
|
|
|
byte *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
2003-12-02 21:23:13 +01:00
|
|
|
{
|
|
|
|
ulong val;
|
|
|
|
val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
|
|
|
|
thd->variables.*offset);
|
2003-12-17 23:52:03 +01:00
|
|
|
const char *table_type= ha_get_storage_engine((enum db_type)val);
|
2003-12-08 11:25:37 +01:00
|
|
|
return (byte *) table_type;
|
2003-12-02 21:23:13 +01:00
|
|
|
}
|
|
|
|
|
2003-12-08 11:25:37 +01:00
|
|
|
|
2003-12-17 23:52:03 +01:00
|
|
|
void sys_var_thd_storage_engine::set_default(THD *thd, enum_var_type type)
|
2003-12-02 21:23:13 +01:00
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.*offset= (ulong) DB_TYPE_MYISAM;
|
|
|
|
else
|
|
|
|
thd->variables.*offset= (ulong) (global_system_variables.*offset);
|
|
|
|
}
|
|
|
|
|
2003-12-08 11:25:37 +01:00
|
|
|
|
2003-12-17 23:52:03 +01:00
|
|
|
bool sys_var_thd_storage_engine::update(THD *thd, set_var *var)
|
2003-12-02 21:23:13 +01:00
|
|
|
{
|
|
|
|
if (var->type == OPT_GLOBAL)
|
|
|
|
global_system_variables.*offset= var->save_result.ulong_value;
|
|
|
|
else
|
|
|
|
thd->variables.*offset= var->save_result.ulong_value;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-12-17 23:52:03 +01:00
|
|
|
void sys_var_thd_table_type::warn_deprecated(THD *thd)
|
|
|
|
{
|
|
|
|
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
|
|
ER_WARN_DEPRECATED_SYNTAX,
|
2004-10-26 18:30:01 +02:00
|
|
|
ER(ER_WARN_DEPRECATED_SYNTAX), "table_type",
|
2006-04-13 09:50:33 +02:00
|
|
|
"storage_engine");
|
2003-12-17 23:52:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sys_var_thd_table_type::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
warn_deprecated(thd);
|
|
|
|
sys_var_thd_storage_engine::set_default(thd, type);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool sys_var_thd_table_type::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
warn_deprecated(thd);
|
|
|
|
return sys_var_thd_storage_engine::update(thd, var);
|
|
|
|
}
|
|
|
|
|
2003-12-08 11:25:37 +01:00
|
|
|
|
2003-06-04 17:28:51 +02:00
|
|
|
/****************************************************************************
|
|
|
|
Functions to handle sql_mode
|
|
|
|
****************************************************************************/
|
2003-04-05 12:59:29 +02:00
|
|
|
|
2005-07-28 21:39:11 +02:00
|
|
|
/*
|
|
|
|
Make string representation of mode
|
|
|
|
|
2005-07-29 22:39:08 +02:00
|
|
|
SYNOPSIS
|
|
|
|
thd in thread handler
|
|
|
|
val in sql_mode value
|
|
|
|
len out pointer on length of string
|
|
|
|
|
|
|
|
RETURN
|
|
|
|
pointer to string with sql_mode representation
|
2005-07-28 21:39:11 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd, ulong val,
|
|
|
|
ulong *len)
|
2003-06-04 17:28:51 +02:00
|
|
|
{
|
|
|
|
char buff[256];
|
|
|
|
String tmp(buff, sizeof(buff), &my_charset_latin1);
|
2005-07-31 21:56:24 +02:00
|
|
|
ulong length;
|
2003-06-04 17:28:51 +02:00
|
|
|
|
|
|
|
tmp.length(0);
|
|
|
|
for (uint i= 0; val; val>>= 1, i++)
|
|
|
|
{
|
|
|
|
if (val & 1)
|
|
|
|
{
|
2005-07-28 21:39:11 +02:00
|
|
|
tmp.append(sql_mode_typelib.type_names[i],
|
|
|
|
sql_mode_typelib.type_lengths[i]);
|
2003-06-04 17:28:51 +02:00
|
|
|
tmp.append(',');
|
|
|
|
}
|
|
|
|
}
|
2005-07-31 21:56:24 +02:00
|
|
|
|
|
|
|
if ((length= tmp.length()))
|
|
|
|
length--;
|
|
|
|
*len= length;
|
|
|
|
return (byte*) thd->strmake(tmp.ptr(), length);
|
2003-06-04 17:28:51 +02:00
|
|
|
}
|
|
|
|
|
2005-07-31 21:56:24 +02:00
|
|
|
|
2005-07-28 21:39:11 +02:00
|
|
|
byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type,
|
|
|
|
LEX_STRING *base)
|
|
|
|
{
|
|
|
|
ulong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
|
|
|
|
thd->variables.*offset);
|
|
|
|
ulong length_unused;
|
|
|
|
return symbolic_mode_representation(thd, val, &length_unused);
|
|
|
|
}
|
|
|
|
|
2003-06-04 17:28:51 +02:00
|
|
|
|
|
|
|
void sys_var_thd_sql_mode::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.*offset= 0;
|
|
|
|
else
|
|
|
|
thd->variables.*offset= global_system_variables.*offset;
|
|
|
|
}
|
|
|
|
|
2005-07-31 21:56:24 +02:00
|
|
|
|
2003-06-04 17:28:51 +02:00
|
|
|
void fix_sql_mode_var(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
if (type == OPT_GLOBAL)
|
|
|
|
global_system_variables.sql_mode=
|
|
|
|
fix_sql_mode(global_system_variables.sql_mode);
|
|
|
|
else
|
2005-06-24 03:29:56 +02:00
|
|
|
{
|
2003-06-04 17:28:51 +02:00
|
|
|
thd->variables.sql_mode= fix_sql_mode(thd->variables.sql_mode);
|
2005-06-24 03:29:56 +02:00
|
|
|
/*
|
|
|
|
Update thd->server_status
|
|
|
|
*/
|
|
|
|
if (thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
|
|
|
|
thd->server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES;
|
|
|
|
else
|
|
|
|
thd->server_status&= ~SERVER_STATUS_NO_BACKSLASH_ESCAPES;
|
|
|
|
}
|
2003-06-04 17:28:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Map database specific bits to function bits */
|
2003-04-05 12:59:29 +02:00
|
|
|
|
2003-06-04 17:28:51 +02:00
|
|
|
ulong fix_sql_mode(ulong sql_mode)
|
|
|
|
{
|
|
|
|
/*
|
2006-04-13 09:50:33 +02:00
|
|
|
Note that we dont set
|
2003-06-04 17:28:51 +02:00
|
|
|
MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | MODE_NO_FIELD_OPTIONS
|
|
|
|
to allow one to get full use of MySQL in this mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (sql_mode & MODE_ANSI)
|
2005-02-17 05:12:31 +01:00
|
|
|
{
|
2003-06-04 17:28:51 +02:00
|
|
|
sql_mode|= (MODE_REAL_AS_FLOAT | MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
|
2005-02-17 05:12:31 +01:00
|
|
|
MODE_IGNORE_SPACE);
|
2006-04-13 09:50:33 +02:00
|
|
|
/*
|
2005-02-17 05:12:31 +01:00
|
|
|
MODE_ONLY_FULL_GROUP_BY removed from ANSI mode because it is currently
|
|
|
|
overly restrictive (see BUG#8510).
|
|
|
|
*/
|
|
|
|
}
|
2003-06-04 17:28:51 +02:00
|
|
|
if (sql_mode & MODE_ORACLE)
|
|
|
|
sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
|
|
|
|
MODE_IGNORE_SPACE |
|
|
|
|
MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
|
2004-11-02 15:45:26 +01:00
|
|
|
MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER);
|
2003-06-04 17:28:51 +02:00
|
|
|
if (sql_mode & MODE_MSSQL)
|
|
|
|
sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
|
|
|
|
MODE_IGNORE_SPACE |
|
|
|
|
MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
|
|
|
|
MODE_NO_FIELD_OPTIONS);
|
|
|
|
if (sql_mode & MODE_POSTGRESQL)
|
|
|
|
sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
|
|
|
|
MODE_IGNORE_SPACE |
|
|
|
|
MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
|
|
|
|
MODE_NO_FIELD_OPTIONS);
|
|
|
|
if (sql_mode & MODE_DB2)
|
|
|
|
sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
|
|
|
|
MODE_IGNORE_SPACE |
|
|
|
|
MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
|
|
|
|
MODE_NO_FIELD_OPTIONS);
|
2003-10-15 11:50:36 +02:00
|
|
|
if (sql_mode & MODE_MAXDB)
|
2003-06-04 17:28:51 +02:00
|
|
|
sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
|
|
|
|
MODE_IGNORE_SPACE |
|
|
|
|
MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
|
2004-11-02 15:45:26 +01:00
|
|
|
MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER);
|
2003-06-04 17:28:51 +02:00
|
|
|
if (sql_mode & MODE_MYSQL40)
|
2006-05-04 17:35:58 +02:00
|
|
|
sql_mode|= MODE_HIGH_NOT_PRECEDENCE;
|
2003-06-04 17:28:51 +02:00
|
|
|
if (sql_mode & MODE_MYSQL323)
|
2006-05-04 17:35:58 +02:00
|
|
|
sql_mode|= MODE_HIGH_NOT_PRECEDENCE;
|
2004-09-28 19:08:00 +02:00
|
|
|
if (sql_mode & MODE_TRADITIONAL)
|
|
|
|
sql_mode|= (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES |
|
|
|
|
MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
|
2004-11-02 15:45:26 +01:00
|
|
|
MODE_ERROR_FOR_DIVISION_BY_ZERO | MODE_NO_AUTO_CREATE_USER);
|
2003-06-04 17:28:51 +02:00
|
|
|
return sql_mode;
|
|
|
|
}
|
2003-04-05 12:59:29 +02:00
|
|
|
|
|
|
|
|
2003-07-06 18:09:57 +02:00
|
|
|
/****************************************************************************
|
|
|
|
Named list handling
|
|
|
|
****************************************************************************/
|
|
|
|
|
2003-08-18 23:08:08 +02:00
|
|
|
gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
|
|
|
|
NAMED_LIST **found)
|
2003-07-06 18:09:57 +02:00
|
|
|
{
|
|
|
|
I_List_iterator<NAMED_LIST> it(*list);
|
|
|
|
NAMED_LIST *element;
|
|
|
|
while ((element= it++))
|
|
|
|
{
|
|
|
|
if (element->cmp(name, length))
|
2003-08-18 23:08:08 +02:00
|
|
|
{
|
2003-08-27 00:14:13 +02:00
|
|
|
if (found)
|
|
|
|
*found= element;
|
2003-07-06 18:09:57 +02:00
|
|
|
return element->data;
|
2003-08-18 23:08:08 +02:00
|
|
|
}
|
2003-07-06 18:09:57 +02:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-18 12:47:27 +01:00
|
|
|
void delete_elements(I_List<NAMED_LIST> *list,
|
|
|
|
void (*free_element)(const char *name, gptr))
|
2003-07-06 18:09:57 +02:00
|
|
|
{
|
|
|
|
NAMED_LIST *element;
|
2003-08-18 23:08:08 +02:00
|
|
|
DBUG_ENTER("delete_elements");
|
2003-07-06 18:09:57 +02:00
|
|
|
while ((element= list->get()))
|
|
|
|
{
|
2003-11-18 12:47:27 +01:00
|
|
|
(*free_element)(element->name, element->data);
|
2003-07-06 18:09:57 +02:00
|
|
|
delete element;
|
|
|
|
}
|
2003-08-18 23:08:08 +02:00
|
|
|
DBUG_VOID_RETURN;
|
2003-07-06 18:09:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Key cache functions */
|
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
static KEY_CACHE *create_key_cache(const char *name, uint length)
|
2003-07-06 18:09:57 +02:00
|
|
|
{
|
2003-11-20 21:06:25 +01:00
|
|
|
KEY_CACHE *key_cache;
|
2003-11-18 12:47:27 +01:00
|
|
|
DBUG_ENTER("create_key_cache");
|
|
|
|
DBUG_PRINT("enter",("name: %.*s", length, name));
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
if ((key_cache= (KEY_CACHE*) my_malloc(sizeof(KEY_CACHE),
|
2003-11-18 12:47:27 +01:00
|
|
|
MYF(MY_ZEROFILL | MY_WME))))
|
2003-08-02 11:43:18 +02:00
|
|
|
{
|
|
|
|
if (!new NAMED_LIST(&key_caches, name, length, (gptr) key_cache))
|
2003-11-18 12:47:27 +01:00
|
|
|
{
|
|
|
|
my_free((char*) key_cache, MYF(0));
|
2003-08-02 11:43:18 +02:00
|
|
|
key_cache= 0;
|
2003-11-18 12:47:27 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Set default values for a key cache
|
|
|
|
The values in dflt_key_cache_var is set by my_getopt() at startup
|
|
|
|
|
|
|
|
We don't set 'buff_size' as this is used to enable the key cache
|
|
|
|
*/
|
2003-11-20 21:06:25 +01:00
|
|
|
key_cache->param_block_size= dflt_key_cache_var.param_block_size;
|
|
|
|
key_cache->param_division_limit= dflt_key_cache_var.param_division_limit;
|
|
|
|
key_cache->param_age_threshold= dflt_key_cache_var.param_age_threshold;
|
2003-11-18 12:47:27 +01:00
|
|
|
}
|
2003-08-02 11:43:18 +02:00
|
|
|
}
|
2003-11-18 12:47:27 +01:00
|
|
|
DBUG_RETURN(key_cache);
|
2003-07-06 18:09:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
KEY_CACHE *get_or_create_key_cache(const char *name, uint length)
|
2003-07-06 18:09:57 +02:00
|
|
|
{
|
2003-08-02 11:43:18 +02:00
|
|
|
LEX_STRING key_cache_name;
|
2003-11-20 21:06:25 +01:00
|
|
|
KEY_CACHE *key_cache;
|
2003-11-18 12:47:27 +01:00
|
|
|
|
2003-08-02 11:43:18 +02:00
|
|
|
key_cache_name.str= (char *) name;
|
|
|
|
key_cache_name.length= length;
|
2003-11-18 12:47:27 +01:00
|
|
|
pthread_mutex_lock(&LOCK_global_system_variables);
|
|
|
|
if (!(key_cache= get_key_cache(&key_cache_name)))
|
2003-07-06 18:09:57 +02:00
|
|
|
key_cache= create_key_cache(name, length);
|
2003-11-18 12:47:27 +01:00
|
|
|
pthread_mutex_unlock(&LOCK_global_system_variables);
|
2003-07-06 18:09:57 +02:00
|
|
|
return key_cache;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
void free_key_cache(const char *name, KEY_CACHE *key_cache)
|
2003-07-06 18:09:57 +02:00
|
|
|
{
|
2003-11-18 12:47:27 +01:00
|
|
|
ha_end_key_cache(key_cache);
|
|
|
|
my_free((char*) key_cache, MYF(0));
|
2003-08-02 11:43:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-20 21:06:25 +01:00
|
|
|
bool process_key_caches(int (* func) (const char *name, KEY_CACHE *))
|
2003-11-18 12:47:27 +01:00
|
|
|
{
|
2003-08-02 11:43:18 +02:00
|
|
|
I_List_iterator<NAMED_LIST> it(key_caches);
|
|
|
|
NAMED_LIST *element;
|
2003-11-18 12:47:27 +01:00
|
|
|
|
2003-08-02 11:43:18 +02:00
|
|
|
while ((element= it++))
|
|
|
|
{
|
2003-11-20 21:06:25 +01:00
|
|
|
KEY_CACHE *key_cache= (KEY_CACHE *) element->data;
|
2003-11-18 12:47:27 +01:00
|
|
|
func(element->name, key_cache);
|
2003-08-02 11:43:18 +02:00
|
|
|
}
|
|
|
|
return 0;
|
2003-07-06 18:09:57 +02:00
|
|
|
}
|
|
|
|
|
2003-04-05 12:59:29 +02:00
|
|
|
|
2005-11-10 17:50:51 +01:00
|
|
|
void sys_var_trust_routine_creators::warn_deprecated(THD *thd)
|
|
|
|
{
|
|
|
|
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
|
|
ER_WARN_DEPRECATED_SYNTAX,
|
|
|
|
ER(ER_WARN_DEPRECATED_SYNTAX), "log_bin_trust_routine_creators",
|
2006-04-13 09:50:33 +02:00
|
|
|
"log_bin_trust_function_creators");
|
2005-11-10 17:50:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sys_var_trust_routine_creators::set_default(THD *thd, enum_var_type type)
|
|
|
|
{
|
|
|
|
warn_deprecated(thd);
|
|
|
|
sys_var_bool_ptr::set_default(thd, type);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool sys_var_trust_routine_creators::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
warn_deprecated(thd);
|
|
|
|
return sys_var_bool_ptr::update(thd, var);
|
|
|
|
}
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/****************************************************************************
|
|
|
|
Used templates
|
|
|
|
****************************************************************************/
|
|
|
|
|
2005-06-22 11:08:28 +02:00
|
|
|
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
2002-07-23 17:31:22 +02:00
|
|
|
template class List<set_var_base>;
|
2003-05-27 17:40:37 +02:00
|
|
|
template class List_iterator_fast<set_var_base>;
|
2003-07-06 18:09:57 +02:00
|
|
|
template class I_List_iterator<NAMED_LIST>;
|
2002-07-23 17:31:22 +02:00
|
|
|
#endif
|