From ef8a5401f146e0aa17d9cc342c52a82e16e7c6ef Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Apr 2004 19:43:37 +0400 Subject: Many files: SQL Syntax for Prepared Statements (WL#1622) ps.test, ps.result: new file sql/item.cc: SQL Syntax for Prepared Statements (WL#1622) sql/item.h: SQL Syntax for Prepared Statements (WL#1622) sql/lex.h: SQL Syntax for Prepared Statements (WL#1622) sql/mysql_priv.h: SQL Syntax for Prepared Statements (WL#1622) sql/mysqld.cc: SQL Syntax for Prepared Statements (WL#1622) sql/sql_class.cc: SQL Syntax for Prepared Statements (WL#1622) sql/sql_class.h: SQL Syntax for Prepared Statements (WL#1622) sql/sql_lex.h: SQL Syntax for Prepared Statements (WL#1622) sql/sql_parse.cc: SQL Syntax for Prepared Statements (WL#1622) sql/sql_prepare.cc: SQL Syntax for Prepared Statements (WL#1622) sql/sql_yacc.yy: SQL Syntax for Prepared Statements (WL#1622) --- sql/sql_class.cc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 1b4c8bec416..49fa0455a30 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -78,6 +78,23 @@ extern "C" void free_user_var(user_var_entry *entry) my_free((char*) entry,MYF(0)); } +/**************************************************************************** +** SQL syntax names for Prepared Statements +****************************************************************************/ + +extern "C" byte *get_stmt_key(SQL_PREP_STMT_ENTRY *entry, uint *length, + my_bool not_used __attribute__((unused))) +{ + *length=(uint) entry->name.length; + return (byte*) entry->name.str; +} + +extern "C" void free_sql_stmt(SQL_PREP_STMT_ENTRY *entry) +{ + char *pos= (char*) entry+ALIGN_SIZE(sizeof(*entry)); + my_free((char*) entry,MYF(0)); +} + /**************************************************************************** ** Thread specific functions @@ -160,7 +177,10 @@ THD::THD():user_time(0), current_statement(0), is_fatal_error(0), 16); else bzero((char*) &user_var_events, sizeof(user_var_events)); - + + hash_init(&sql_prepared_stmts, &my_charset_bin, USER_VARS_HASH_SIZE, 0, 0, + (hash_get_key) get_stmt_key, + (hash_free_key) free_sql_stmt,0); /* Protocol */ protocol= &protocol_simple; // Default protocol protocol_simple.init(this); @@ -279,6 +299,7 @@ void THD::cleanup(void) my_free((char*) variables.datetime_format, MYF(MY_ALLOW_ZERO_PTR)); delete_dynamic(&user_var_events); hash_free(&user_vars); + hash_free(&sql_prepared_stmts); if (global_read_lock) unlock_global_read_lock(this); if (ull) -- cgit v1.2.1 From 756223bbda043a20840a1c2236a2f62a35640460 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Apr 2004 01:58:48 +0400 Subject: WL#1622 "SQL Syntax for Prepared Statements": post-review fixes: Moved PS name to Statement class, Statement_map now handles name-to-statement resolution. Both named and unnamed statements are now executed in one function (sql_prepare.cc:execute_stmt) Fixed a problem: Malformed sequence of commands from client could cause server to use previously deleted objects. Some code cleanup and small fixes sql/mysql_priv.h: WL#1622 "SQL Syntax for Prepared Statements": post-review fixes. sql/sql_class.cc: WL#1622 "SQL Syntax for Prepared Statements": post-review fixes. sql/sql_class.h: WL#1622 "SQL Syntax for Prepared Statements": post-review fixes. sql/sql_parse.cc: WL#1622 "SQL Syntax for Prepared Statements": post-review fixes. sql/sql_prepare.cc: WL#1622 "SQL Syntax for Prepared Statements": post-review fixes. --- sql/sql_class.cc | 62 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 24 deletions(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 49fa0455a30..87b6c49a4b7 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -78,24 +78,6 @@ extern "C" void free_user_var(user_var_entry *entry) my_free((char*) entry,MYF(0)); } -/**************************************************************************** -** SQL syntax names for Prepared Statements -****************************************************************************/ - -extern "C" byte *get_stmt_key(SQL_PREP_STMT_ENTRY *entry, uint *length, - my_bool not_used __attribute__((unused))) -{ - *length=(uint) entry->name.length; - return (byte*) entry->name.str; -} - -extern "C" void free_sql_stmt(SQL_PREP_STMT_ENTRY *entry) -{ - char *pos= (char*) entry+ALIGN_SIZE(sizeof(*entry)); - my_free((char*) entry,MYF(0)); -} - - /**************************************************************************** ** Thread specific functions ****************************************************************************/ @@ -178,9 +160,6 @@ THD::THD():user_time(0), current_statement(0), is_fatal_error(0), else bzero((char*) &user_var_events, sizeof(user_var_events)); - hash_init(&sql_prepared_stmts, &my_charset_bin, USER_VARS_HASH_SIZE, 0, 0, - (hash_get_key) get_stmt_key, - (hash_free_key) free_sql_stmt,0); /* Protocol */ protocol= &protocol_simple; // Default protocol protocol_simple.init(this); @@ -299,7 +278,6 @@ void THD::cleanup(void) my_free((char*) variables.datetime_format, MYF(MY_ALLOW_ZERO_PTR)); delete_dynamic(&user_var_events); hash_free(&user_vars); - hash_free(&sql_prepared_stmts); if (global_read_lock) unlock_global_read_lock(this); if (ull) @@ -1220,6 +1198,7 @@ Statement::Statement(THD *thd) query_length(0), free_list(0) { + name.str= NULL; init_sql_alloc(&mem_root, thd->variables.query_alloc_block_size, thd->variables.query_prealloc_size); @@ -1303,17 +1282,52 @@ static void delete_statement_as_hash_key(void *key) delete (Statement *) key; } +byte *get_stmt_name_hash_key(Statement *entry, uint *length, + my_bool not_used __attribute__((unused))) +{ + *length=(uint) entry->name.length; + return (byte*) entry->name.str; +} + C_MODE_END Statement_map::Statement_map() : last_found_statement(0) { - enum { START_HASH_SIZE = 16 }; - hash_init(&st_hash, default_charset_info, START_HASH_SIZE, 0, 0, + enum + { + START_STMT_HASH_SIZE = 16, + START_NAME_HASH_SIZE = 16 + }; + hash_init(&st_hash, default_charset_info, START_STMT_HASH_SIZE, 0, 0, get_statement_id_as_hash_key, delete_statement_as_hash_key, MYF(0)); + hash_init(&names_hash, &my_charset_bin, START_NAME_HASH_SIZE, 0, 0, + (hash_get_key) get_stmt_name_hash_key, + NULL,MYF(0)); +} + +int Statement_map::insert(Statement *statement) +{ + int rc= my_hash_insert(&st_hash, (byte *) statement); + if (rc == 0) + last_found_statement= statement; + if (statement->name.str) + { + /* + If there is a statement with the same name, remove it. It is ok to + remove old and fail to insert new one at the same time. + */ + Statement *old_stmt; + if ((old_stmt= find_by_name(&statement->name))) + erase(old_stmt); + if ((rc= my_hash_insert(&names_hash, (byte*)statement))) + hash_delete(&st_hash, (byte*)statement); + } + return rc; } + bool select_dumpvar::send_data(List &items) { List_iterator_fast li(vars); -- cgit v1.2.1 From 47322bf9b8e7eed66181d1b88cfd1a5d3ce2ea91 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Apr 2004 20:08:38 +0400 Subject: WL#1622 "SQL Syntax for Prepared Statements" - cosmetic code review fixes mysql-test/r/ps.result: Added check if multiple SQL statements inside a PS are disabled mysql-test/t/ps.test: Added check if multiple SQL statements inside a PS are disabled --- sql/sql_class.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 87b6c49a4b7..bf2dbb3fc5c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1282,8 +1282,8 @@ static void delete_statement_as_hash_key(void *key) delete (Statement *) key; } -byte *get_stmt_name_hash_key(Statement *entry, uint *length, - my_bool not_used __attribute__((unused))) +static byte *get_stmt_name_hash_key(Statement *entry, uint *length, + my_bool not_used __attribute__((unused))) { *length=(uint) entry->name.length; return (byte*) entry->name.str; @@ -1303,8 +1303,8 @@ Statement_map::Statement_map() : get_statement_id_as_hash_key, delete_statement_as_hash_key, MYF(0)); hash_init(&names_hash, &my_charset_bin, START_NAME_HASH_SIZE, 0, 0, - (hash_get_key) get_stmt_name_hash_key, - NULL,MYF(0)); + (hash_get_key) get_stmt_name_hash_key, + NULL,MYF(0)); } int Statement_map::insert(Statement *statement) -- cgit v1.2.1 From 431d0e610114110233b1cccc1f8a1d6d49951509 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 May 2004 15:59:29 +0500 Subject: Proposed fix for bug #3412 (embedded server: prepared statement returns empty recordset where some records should be found) sql/ha_myisam.cc: Code simplified with vio_ok() sql/mysqld.cc: vio_ok used sql/slave.cc: vio_ok used sql/sql_class.cc: Here is the place of the error - we should not examine net.vio in embedded library sql/sql_class.h: method added to always return TRUE in embedded library, and to sheck thd.net.vio otherwise sql/sql_show.cc: code simplified with vio_ok() --- sql/sql_class.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 9d368db0229..d16d1de7607 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -746,7 +746,7 @@ bool select_send::send_data(List &items) } } thd->sent_row_count++; - if (!thd->net.vio) + if (!thd->vio_ok()) DBUG_RETURN(0); if (!thd->net.report_error) DBUG_RETURN(protocol->write()); -- cgit v1.2.1 From 934bb37d39b7c18c8d80eccdd914dc08f988c646 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Jun 2004 23:17:18 +0200 Subject: 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 --- sql/sql_class.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 9d368db0229..f2978edc033 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -181,6 +181,7 @@ THD::THD():user_time(0), current_statement(0), is_fatal_error(0), current_linfo = 0; slave_thread = 0; variables.pseudo_thread_id= 0; + one_shot_set= 0; file_id = 0; warn_id= 0; db_charset= global_system_variables.collation_database; -- cgit v1.2.1 From 1d4ee7f81c1fff2579c3aab8690f977e99a4840e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Jun 2004 12:09:10 +0400 Subject: Post review fixes for "SQL Syntax for Prepared Statements". mysql-test/r/ps.result: Better error message mysys/my_error.c: Comments added sql/item.cc: Moved a chunk of code from sql_prepare.cc to Item_param::set_from_user_var sql/item.h: Moved a chunk of code from sql_prepare.cc to Item_param::set_from_user_var sql/item_func.cc: Code cleanup sql/mysql_priv.h: Code cleanup sql/sql_class.cc: Code cleanup sql/sql_parse.cc: use user_var_entry::val_str in PREPARE stmt FROM @var. sql/sql_prepare.cc: Post-review fixes and code cleanup. sql/sql_yacc.yy: Coding style fixes --- sql/sql_class.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index a1ca227afe8..704662fa4bf 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -233,7 +233,7 @@ THD::THD():user_time(0), current_statement(0), is_fatal_error(0), 16); else bzero((char*) &user_var_events, sizeof(user_var_events)); - + /* Protocol */ protocol= &protocol_simple; // Default protocol protocol_simple.init(this); -- cgit v1.2.1 From 6aaccbcbf7902f9e628713147567dc84611303a5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Jun 2004 10:11:31 +0400 Subject: 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 --- sql/sql_class.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 704662fa4bf..a04823c6c43 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -157,8 +157,8 @@ bool foreign_key_prefix(Key *a, Key *b) THD::THD():user_time(0), current_statement(0), is_fatal_error(0), last_insert_id_used(0), - insert_id_used(0), rand_used(0), in_lock_tables(0), - global_read_lock(0), bootstrap(0) + insert_id_used(0), rand_used(0), time_zone_used(0), + in_lock_tables(0), global_read_lock(0), bootstrap(0) { host= user= priv_user= db= ip=0; host_or_ip= "connecting host"; -- cgit v1.2.1 From b5dfd05662464d2c19da349942914cce897cdbaf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Jun 2004 10:21:20 +0300 Subject: After merge fixes Return NULL if a time argument is given to date_add(). (Warning will be shown after Dimitri's timezone patch is pushed) client/mysqltest.c: Added MAX_VAR_NAME which was lost in merge Added more debugging Fixed bug in 'eval' innobase/data/data0type.c: After merge fix innobase/fil/fil0fil.c: After merge fix innobase/log/log0recv.c: After merge fix myisam/mi_unique.c: Better checksum handling mysql-test/r/func_time.result: Return NULL if a time argument is given to date_add() mysql-test/r/rpl_free_items.result: After merge fix mysql-test/r/rpl_get_lock.result: Test was depending on when server was restarted. mysql-test/r/type_date.result: After merge fix mysql-test/r/type_decimal.result: After merge fix mysql-test/t/func_time.test: Removed comment that is not needed anymore (After Dimitri's timezone patch is pushed, we should get a warning for the date_add(time...) entry) mysql-test/t/rpl_get_lock.test: Test was depending on when server was restarted. mysql-test/t/type_date.test: Addded missing explanation for bug netware/mysqld_safe.c: Removed end \r Run program through indent-ex to get MySQL indentation sql-common/client.c: After merge fix sql/field.cc: Fixed that get_date(time) gives a warning sql/field.h: After merge fix sql/net_serv.cc: More debugging (if DEBUG_DATA_PACKETS is set) sql/sql_class.cc: Removed compiler warning sql/table.cc: Better comment --- sql/sql_class.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 704662fa4bf..7d0e0c3f78f 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -162,7 +162,8 @@ THD::THD():user_time(0), current_statement(0), is_fatal_error(0), { host= user= priv_user= db= ip=0; host_or_ip= "connecting host"; - locked=killed=some_tables_deleted=no_errors=password= 0; + locked=some_tables_deleted=no_errors=password= 0; + killed=0; query_start_used= 0; count_cuted_fields= CHECK_FIELD_IGNORE; db_length= col_access= 0; -- cgit v1.2.1