From 1fb887361d3fe899a4c7af37ecc216a4ca707992 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Oct 2006 18:17:41 +0200 Subject: Fix for bug#23379 "wrong time value in SHOW PROCESSLIST" The value taken to be shown in SHOW PROCESSLIST is not initialized when THD is created and will be random for unauthenticated connections. To the documentor: Random value, instead of NULL, was shown, in SHOW PROCESSLIST for still non-authenticated connections. sql/sql_class.cc: Initialize time_after_lock. It is used from SHOW PROCESSLIST's code. If not initialized random value is shown for connected but still unauthenticated clients in the column Time. --- 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 da752977fcd..f18f2fb6b7c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -181,6 +181,7 @@ THD::THD() // Must be reset to handle error with THD's created for init of mysqld lex->current_select= 0; start_time=(time_t) 0; + time_after_lock=(time_t) 0; current_linfo = 0; slave_thread = 0; variables.pseudo_thread_id= 0; -- cgit v1.2.1 From ca817b49cf00eebfb95e7765714a1a0db8913433 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Oct 2006 11:37:07 +0200 Subject: Fix for bug#23379 "wrong time value in SHOW PROCESSLIST" The value taken to be shown in SHOW PROCESSLIST is not initialized when THD is created and will be random for unauthenticated connections. To the documentor: Random value, instead of NULL, was shown, in SHOW PROCESSLIST for still non-authenticated connections. sql/sql_class.cc: Initialize time_after_lock. It is used from SHOW PROCESSLIST's code. If not initialized random value is shown for connected but still unauthenticated clients in the column Time. --- 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 bd292814bfa..fc9597cba87 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -181,6 +181,7 @@ THD::THD() // Must be reset to handle error with THD's created for init of mysqld lex->current_select= 0; start_time=(time_t) 0; + time_after_lock=(time_t) 0; current_linfo = 0; slave_thread = 0; variables.pseudo_thread_id= 0; -- cgit v1.2.1 From ed53c394f93444e4f8a11114c0a5f3d426c6220b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Oct 2006 19:11:09 +0200 Subject: Bug#18888 Trying to overwrite sql/lex_hash.h during build - As a sideeffect of the patch to generate lex_hash.h only once on the machine where the source dist was produced, a problem was found when compiling a mysqld without partition support - it would crash when looking up the lex symbols due to mismatch between lex.h and the generated lex_hash.h - Remove the ifdef for partition in lex.h - Fix minor problem with"EXPLAIN PARTITION" when not compiled with partition(existed also without the above patch) - Add test case that will be run when we don't have partition support compiled into mysqld - Return error ER_FEATURE_DISABLED if user tries to use PARTITION when there is no support for it. sql/lex.h: There should be no ifdefs of features in lex.h sql/sql_class.cc: In line with the comment in sql_yacc.yy that we want the same output from "EXPLAIN PARTITIONS.." regardless of wheter we have compiled in support for partition or not, remove the ifdef so the extra field is added to output if the DESCRIBE_PARTITIONS bit it set. Without this patch we get a crash as the code in select_describe believes the field is there. sql/sql_select.cc: Use "const" for the variable as it's a ssigned once and never changes sql/sql_yacc.yy: Don't allow PARTITION syntax oif there is no suport for partitioning mysql-test/r/not_partition.require: New BitKeeper file ``mysql-test/r/not_partition.require'' mysql-test/r/not_partition.result: New BitKeeper file ``mysql-test/r/not_partition.result'' mysql-test/t/not_partition.test: New BitKeeper file ``mysql-test/t/not_partition.test'' --- sql/sql_class.cc | 2 -- 1 file changed, 2 deletions(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index dcb3620f329..e1904527866 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -859,7 +859,6 @@ int THD::send_explain_fields(select_result *result) field_list.push_back(new Item_empty_string("select_type", 19, cs)); field_list.push_back(item= new Item_empty_string("table", NAME_LEN, cs)); item->maybe_null= 1; -#ifdef WITH_PARTITION_STORAGE_ENGINE if (lex->describe & DESCRIBE_PARTITIONS) { /* Maximum length of string that make_used_partitions_str() can produce */ @@ -868,7 +867,6 @@ int THD::send_explain_fields(select_result *result) field_list.push_back(item); item->maybe_null= 1; } -#endif field_list.push_back(item= new Item_empty_string("type", 10, cs)); item->maybe_null= 1; field_list.push_back(item=new Item_empty_string("possible_keys", -- cgit v1.2.1 From e948c64ff52fda43d2a7cb59bc631e53051adc05 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 Oct 2006 13:35:57 +0100 Subject: Improve comments around FLUSH STATUS It's not possible to flush the global status variables in 5.0 Update test case so it works by recording the value of handle_rollback before and compare it to the value after mysql-test/r/innodb_mysql.result: Update result file mysql-test/t/innodb_mysql.test: It's not possible to reset the global status variables in 5.0 so intead its value is recorded and compared to the after value. It should not have changed. sql/mysqld.cc: Improve comments sql/set_var.cc: Improve comments sql/sql_class.cc: Improve comments sql/sql_class.h: Improve comments --- sql/sql_class.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f5bab1d17f4..ba2f525a4a4 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -464,14 +464,13 @@ THD::~THD() void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var) { - ulong *end= (ulong*) ((byte*) to_var + offsetof(STATUS_VAR, - last_system_status_var) + + ulong *end= (ulong*) ((byte*) to_var + + offsetof(STATUS_VAR, last_system_status_var) + sizeof(ulong)); ulong *to= (ulong*) to_var, *from= (ulong*) from_var; while (to != end) *(to++)+= *(from++); - /* it doesn't make sense to add last_query_cost values */ } -- cgit v1.2.1